l2: L2/L3 mode swicth cleanup and l2-patch fix