Skip to content

Commit 48df65b

Browse files
marckleinebuddeNipaLocal
authored andcommitted
net: fec: fec_enet_rx_queue(): move_call to _vlan_hwaccel_put_tag()
Move __vlan_hwaccel_put_tag() into the if statement that sets vlan_packet_rcvd = true. This change eliminates the unnecessary vlan_packet_rcvd variable, simplifying the code and improving clarity. Reviewed-by: Frank Li <[email protected]> Reviewed-by: Wei Fang <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]> Signed-off-by: NipaLocal <nipa@local>
1 parent 4d7634e commit 48df65b

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

drivers/net/ethernet/freescale/fec_main.c

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1722,8 +1722,6 @@ fec_enet_rx_queue(struct net_device *ndev, u16 queue_id, int budget)
17221722
ushort pkt_len;
17231723
int pkt_received = 0;
17241724
struct bufdesc_ex *ebdp = NULL;
1725-
bool vlan_packet_rcvd = false;
1726-
u16 vlan_tag;
17271725
int index = 0;
17281726
bool need_swap = fep->quirks & FEC_QUIRK_SWAP_FRAME;
17291727
struct bpf_prog *xdp_prog = READ_ONCE(fep->xdp_prog);
@@ -1854,18 +1852,18 @@ fec_enet_rx_queue(struct net_device *ndev, u16 queue_id, int budget)
18541852
ebdp = (struct bufdesc_ex *)bdp;
18551853

18561854
/* If this is a VLAN packet remove the VLAN Tag */
1857-
vlan_packet_rcvd = false;
18581855
if ((ndev->features & NETIF_F_HW_VLAN_CTAG_RX) &&
18591856
fep->bufdesc_ex &&
18601857
(ebdp->cbd_esc & cpu_to_fec32(BD_ENET_RX_VLAN))) {
18611858
/* Push and remove the vlan tag */
18621859
struct vlan_ethhdr *vlan_header = skb_vlan_eth_hdr(skb);
1863-
vlan_tag = ntohs(vlan_header->h_vlan_TCI);
1864-
1865-
vlan_packet_rcvd = true;
1860+
u16 vlan_tag = ntohs(vlan_header->h_vlan_TCI);
18661861

18671862
memmove(skb->data + VLAN_HLEN, skb->data, ETH_ALEN * 2);
18681863
skb_pull(skb, VLAN_HLEN);
1864+
__vlan_hwaccel_put_tag(skb,
1865+
htons(ETH_P_8021Q),
1866+
vlan_tag);
18691867
}
18701868

18711869
skb->protocol = eth_type_trans(skb, ndev);
@@ -1885,12 +1883,6 @@ fec_enet_rx_queue(struct net_device *ndev, u16 queue_id, int budget)
18851883
}
18861884
}
18871885

1888-
/* Handle received VLAN packets */
1889-
if (vlan_packet_rcvd)
1890-
__vlan_hwaccel_put_tag(skb,
1891-
htons(ETH_P_8021Q),
1892-
vlan_tag);
1893-
18941886
skb_record_rx_queue(skb, queue_id);
18951887
napi_gro_receive(&fep->napi, skb);
18961888

0 commit comments

Comments
 (0)