OSDN Git Service

net: enetc: move skb creation into enetc_build_skb
authorVladimir Oltean <vladimir.oltean@nxp.com>
Wed, 31 Mar 2021 20:08:50 +0000 (23:08 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 31 Mar 2021 21:57:44 +0000 (14:57 -0700)
commita800abd3ecb9acc55821f7ac9bba6c956b36a595
tree9cf552b123582bbd825ddbc903522881d2e2a7b5
parent2fa423f5f0c6891effd4d5c8bdb91d418001da11
net: enetc: move skb creation into enetc_build_skb

We need to build an skb from two code paths now: from the plain RX data
path and from the XDP data path when the verdict is XDP_PASS.

Create a new enetc_build_skb function which contains the essential steps
for building an skb based on the first and last positions of buffer
descriptors within the RX ring.

We also squash the enetc_process_skb function into enetc_build_skb,
because what that function did wasn't very meaningful on its own.

The "rx_frm_cnt++" instruction has been moved around napi_gro_receive
for cosmetic reasons, to be in the same spot as rx_byte_cnt++, which
itself must be before napi_gro_receive, because that's when we lose
ownership of the skb.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/enetc/enetc.c