[qca-nss-sfe] update PPPoE and VLAN to use kernel API

Change-Id: I6bd406f31b20cd9ebf73b98c42cb34bc819aa2c2
Signed-off-by: Nitin Shetty <quic_nitinsj@quicinc.com>
diff --git a/sfe_vlan.h b/sfe_vlan.h
index 505b24b..263b69a 100644
--- a/sfe_vlan.h
+++ b/sfe_vlan.h
@@ -101,8 +101,6 @@
 {
 	struct vlan_hdr *vhdr;
 
-	l2_info->vlan_hdr_cnt = 0;
-
 	while ((skb->protocol == htons(ETH_P_8021AD) || skb->protocol == htons(ETH_P_8021Q)) &&
 			l2_info->vlan_hdr_cnt < SFE_MAX_VLAN_DEPTH) {
 		if (unlikely(!pskb_may_pull(skb, VLAN_HLEN))) {
@@ -113,7 +111,11 @@
 		l2_info->vlan_hdr[l2_info->vlan_hdr_cnt].tci = ntohs(vhdr->h_vlan_TCI);
 		skb->protocol = vhdr->h_vlan_encapsulated_proto;
 		l2_info->vlan_hdr_cnt++;
+		/*
+		 * strip VLAN header
+		 */
 		__skb_pull(skb, VLAN_HLEN);
+		skb_reset_network_header(skb);
 	}
 
 	l2_info->protocol = htons(skb->protocol);
@@ -205,8 +207,7 @@
 	vlan += (count - 1);
 
 	for (i = 0; i < count; i++) {
-		skb_push(skb, VLAN_HLEN);
-		vhdr = (struct vlan_hdr *)skb->data;
+		vhdr = (struct vlan_hdr *)skb_push(skb, VLAN_HLEN);
 		vhdr->h_vlan_TCI = htons(vlan->tci);
 		vhdr->h_vlan_encapsulated_proto = skb->protocol;
 		skb->protocol = vlan->tpid;