From patchwork Mon Oct 5 20:34:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabian Frederick X-Patchwork-Id: 268078 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 92844C4363A for ; Mon, 5 Oct 2020 20:34:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6923721527 for ; Mon, 5 Oct 2020 20:34:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729193AbgJEUe4 (ORCPT ); Mon, 5 Oct 2020 16:34:56 -0400 Received: from mailrelay115.isp.belgacom.be ([195.238.20.142]:49351 "EHLO mailrelay115.isp.belgacom.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725901AbgJEUe4 (ORCPT ); Mon, 5 Oct 2020 16:34:56 -0400 IronPort-SDR: 5zb/ogqFKYZYSSJ7DzNsEki1SA7h5zRcHEVPkyWZTXVYH2OFKQ2J7c5AoTavzi8kklTcG4qXkH g8nFjZZ0Qjz/qWz7nHHRWe9w/P4BLjZh8nwiqmwssSd40sCBy+ChV7mu5WDJ8nW/71Q4sPpbb5 MGZ3BLL6+4bzVM1z32q92OpYF5ZLqkqewTQw/Adrr2Rc5qtPwz0jfTcH1z/XfPsS2ZkS59Akkv Rxpy4Jkq1v40E97uYHmXj9N8QNGoakuyuzEFwiRas4WB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3yAArOBOqPIrVCI/v4vI/WLZIINuzb9NuMq6OT1gH86h1AdZ6+p0oUTaHyiGfRmOUqZa2L2gtgdCWcKohY+TOvyhV2ETzFTe2u9ULwi5jwgFoKmApnMRpq3jLyCwii7BJtWaX5CClyWFnfobYqEUe8WaC2OOs9hjiAEVb+5Ro8vzx6hrwH6xqF8LurX+iwYs4zs1MRv6+LIix5hvQBzWsiUzWyIZ219gG4NQzg4wOZ5rFA5glSe26FQgPFCE9FXofRTXUNyM5PAw+FkI879VxiHfdqTTluiBNK8DmIfVNU0lvEHaUd0HZ2MlB3P0jCrCLxdw7KCDpIc6aHN2XXtYcxwnSWVnJI9hkUrF5McfVatgbRyolDe X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2DgAgDggntf/xCltltgHAEBAQEBAQcBARIBAQQEAQFHgUiBHoJRX40/klaKWYctCwEBAQEBAQEBATUBAgQBAYRKgjsmOBMCAwEBAQMCBQEBBgEBAQEBAQUEAYYPRYI3IoNHCwEjI4E/EoMmglgpqhczhBCBRINHgUKBOIgyhRqBQT+EX4o0BLdNgnGDE4RrklQPIqEfLZJnoimBek0gGIMkUBkNjisXjiZCMDcCBgoBAQMJVwE9AY0yAQE X-IPAS-Result: A2DgAgDggntf/xCltltgHAEBAQEBAQcBARIBAQQEAQFHgUiBHoJRX40/klaKWYctCwEBAQEBAQEBATUBAgQBAYRKgjsmOBMCAwEBAQMCBQEBBgEBAQEBAQUEAYYPRYI3IoNHCwEjI4E/EoMmglgpqhczhBCBRINHgUKBOIgyhRqBQT+EX4o0BLdNgnGDE4RrklQPIqEfLZJnoimBek0gGIMkUBkNjisXjiZCMDcCBgoBAQMJVwE9AY0yAQE Received: from 16.165-182-91.adsl-dyn.isp.belgacom.be (HELO localhost.localdomain) ([91.182.165.16]) by relay.skynet.be with ESMTP; 05 Oct 2020 22:34:54 +0200 From: Fabian Frederick To: davem@davemloft.net, kuba@kernel.org, netdev@vger.kernel.org Cc: Fabian Frederick Subject: [PATCH 2/9 net-next] vxlan: use dev_sw_netstats_rx_add() Date: Mon, 5 Oct 2020 22:34:28 +0200 Message-Id: <20201005203428.55178-1-fabf@skynet.be> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org use new helper for netstats settings Signed-off-by: Fabian Frederick --- drivers/net/vxlan.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c index be3bf233a809e..1a557aeba32b4 100644 --- a/drivers/net/vxlan.c +++ b/drivers/net/vxlan.c @@ -1826,7 +1826,6 @@ static bool vxlan_ecn_decapsulate(struct vxlan_sock *vs, void *oiph, /* Callback from net/ipv4/udp.c to receive packets */ static int vxlan_rcv(struct sock *sk, struct sk_buff *skb) { - struct pcpu_sw_netstats *stats; struct vxlan_dev *vxlan; struct vxlan_sock *vs; struct vxlanhdr unparsed; @@ -1940,12 +1939,7 @@ static int vxlan_rcv(struct sock *sk, struct sk_buff *skb) goto drop; } - stats = this_cpu_ptr(vxlan->dev->tstats); - u64_stats_update_begin(&stats->syncp); - stats->rx_packets++; - stats->rx_bytes += skb->len; - u64_stats_update_end(&stats->syncp); - + dev_sw_netstats_rx_add(vxlan->dev, skb->len); gro_cells_receive(&vxlan->gro_cells, skb); rcu_read_unlock(); From patchwork Mon Oct 5 20:35:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabian Frederick X-Patchwork-Id: 268077 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EE648C4363A for ; Mon, 5 Oct 2020 20:35:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B915D21548 for ; Mon, 5 Oct 2020 20:35:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729207AbgJEUfl (ORCPT ); Mon, 5 Oct 2020 16:35:41 -0400 Received: from mailrelay115.isp.belgacom.be ([195.238.20.142]:49414 "EHLO mailrelay115.isp.belgacom.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725901AbgJEUfk (ORCPT ); Mon, 5 Oct 2020 16:35:40 -0400 IronPort-SDR: iV/6qVTijZF9FGv5C+vBkRl/DzMIj/Mob6Aa5MbG27kimPkBv35oaW9GiP/jpLlTcc/1qi1TDC MlwviKtVJLhC/0Oy43UtaKnv0Ig0s8c2r+7q0mCISBpGhoqPx9OgwuYMjL3WJpKqtTrjgmrkux ahEZHkNpDk730fpIYq2GtO0ALAMsFjReLU3Omxm5KzTRMUNGS2thhWKaqZ52YJOF+3U2KQLaWc HmG1AKwinT65xxrnOLNenkyL/fE6feQGK4c+oiat+VEW9QuTlxtnm2LYLwUxUj6VuHZx+lgfT2 ukM= X-Belgacom-Dynamic: yes IronPort-PHdr: 9a23:wndjwBfRQq2ncymabO8FBPn7lGMj4u6mDksu8pMizoh2WeGdxcWyZB7h7PlgxGXEQZ/co6odzbaP7Oa8AydZus/JmUtBWaQEbwUCh8QSkl5oK+++Imq/EsTXaTcnFt9JTl5v8iLzG0FUHMHjew+a+SXqvnYdFRrlKAV6OPn+FJLMgMSrzeCy/IDYbxlViDanbr5+MRe7oR/eu8UIjoduN6g8xgbUqXZUZupawn9lK0iOlBjm/Mew+5Bj8yVUu/0/8sNLTLv3caclQ7FGFToqK2866tHluhnFVguP+2ATU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Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2C8CADggntf/xCltltgHAEBAQEBAQcBARIBAQQEAQFHgUgCgRyCUV+NP5JWilmFMYF8CwEBAQEBAQEBATUBAgQBAYRKgjsmOgQNAgMBAQEDAgUBAQYBAQEBAQEFBAGGD0WCNyKDRwsBIyOBPxKDJoJYKaoXM4QQgUSDR4FCgTiIMoUagUE/gRGDToo0BLdNgnGDE4RrklQPIqEfLZJnm2KGSgyBa00gGIMkUBkNnGhCMDcCBgoBAQMJVwE9AY0yAQE X-IPAS-Result: A2C8CADggntf/xCltltgHAEBAQEBAQcBARIBAQQEAQFHgUgCgRyCUV+NP5JWilmFMYF8CwEBAQEBAQEBATUBAgQBAYRKgjsmOgQNAgMBAQEDAgUBAQYBAQEBAQEFBAGGD0WCNyKDRwsBIyOBPxKDJoJYKaoXM4QQgUSDR4FCgTiIMoUagUE/gRGDToo0BLdNgnGDE4RrklQPIqEfLZJnm2KGSgyBa00gGIMkUBkNnGhCMDcCBgoBAQMJVwE9AY0yAQE Received: from 16.165-182-91.adsl-dyn.isp.belgacom.be (HELO localhost.localdomain) ([91.182.165.16]) by relay.skynet.be with ESMTP; 05 Oct 2020 22:35:38 +0200 From: Fabian Frederick To: davem@davemloft.net, kuba@kernel.org, netdev@vger.kernel.org Cc: Fabian Frederick Subject: [PATCH 4/9 net-next] bareudp: use dev_sw_netstats_rx_add() Date: Mon, 5 Oct 2020 22:35:15 +0200 Message-Id: <20201005203515.55280-1-fabf@skynet.be> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org use new helper for netstats settings Signed-off-by: Fabian Frederick --- drivers/net/bareudp.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/net/bareudp.c b/drivers/net/bareudp.c index 841910f1db655..ff0bea1554f9b 100644 --- a/drivers/net/bareudp.c +++ b/drivers/net/bareudp.c @@ -54,7 +54,6 @@ struct bareudp_dev { static int bareudp_udp_encap_recv(struct sock *sk, struct sk_buff *skb) { struct metadata_dst *tun_dst = NULL; - struct pcpu_sw_netstats *stats; struct bareudp_dev *bareudp; unsigned short family; unsigned int len; @@ -160,13 +159,9 @@ static int bareudp_udp_encap_recv(struct sock *sk, struct sk_buff *skb) len = skb->len; err = gro_cells_receive(&bareudp->gro_cells, skb); - if (likely(err == NET_RX_SUCCESS)) { - stats = this_cpu_ptr(bareudp->dev->tstats); - u64_stats_update_begin(&stats->syncp); - stats->rx_packets++; - stats->rx_bytes += len; - u64_stats_update_end(&stats->syncp); - } + if (likely(err == NET_RX_SUCCESS)) + dev_sw_netstats_rx_add(bareudp->dev, len); + return 0; drop: /* Consume bad packet */ From patchwork Mon Oct 5 20:36:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabian Frederick X-Patchwork-Id: 268076 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8DB0BC4742A for ; Mon, 5 Oct 2020 20:36:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 58677204EA for ; Mon, 5 Oct 2020 20:36:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729904AbgJEUg4 (ORCPT ); Mon, 5 Oct 2020 16:36:56 -0400 Received: from mailrelay115.isp.belgacom.be ([195.238.20.142]:49513 "EHLO mailrelay115.isp.belgacom.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729273AbgJEUgo (ORCPT ); Mon, 5 Oct 2020 16:36:44 -0400 IronPort-SDR: f7Q7fvpmyrrJVFvQljq0BqxY68CaasLHQmz7uRmNqj3UqszYMyuyz8xq2ZLMncDv97/J8eTC5k 0jSxWhshSrG2Ckd3/WpfMrBb/fPaz/qPHhLgf6BCkhxAbu/TxJfVvPxmP4UdZGD5QXEIt8n0xQ Wt3/U0y5/HAS7elxM6xrGndXaf1XQY/tNyElKBcqKSIGNBesyri/xb1AMktuOu9mpBMbEQoZcj yRWYt4RftR8xYy+qN+PBUT1z8dBb0KAxhCNsK49Q1rjtzCJgiw+OqquQEPJiAEmgcWjZDlE2e7 5bw= X-Belgacom-Dynamic: yes IronPort-PHdr: 9a23:DUCfjhey+gtNpqUgnqmsULVhlGMj4u6mDksu8pMizoh2WeGdxc26bRyN2/xhgRfzUJnB7Loc0qyK6v+mBTZLuM3Y+Fk5M7V0HycfjssXmwFySOWkMmbcaMDQUiohAc5ZX0Vk9XzoeWJcGcL5ekGA6ibqtW1aFRrwLxd6KfroEYDOkcu3y/qy+5rOaAlUmTaxe7x/IAi0oAnLucQan4RuJrs/xxfUv3BFZ/lYyWR0KFyJgh3y/N2w/Jlt8yRRv/Iu6ctNWrjkcqo7ULJVEi0oP3g668P3uxbDSxCP5mYHXWUNjhVIGQnF4wrkUZr3ryD3q/By2CiePc3xULA0RTGv5LplRRP0lCsKMSMy/WfKgcJyka1bugqsqRxhzYDJbo+bN/1wcazSc94BWWZMXdxcWzBbD4+gc4cCCfcKM+ZCr4n6olsDtRuwChO3C+Pu0DBIgGL9060g0+s/DA7JwhYgH9MSv3TXsd74M6kSXvquw6nG1jjDdPBW2Df76IfWbhAtu+qDUqxpfMfX1EIgGB/LgE+Kpoz5IzOayP4Ns26D4uRuVu+ij24ppgBxrzSxyMoiipTEip4IxlzY9Ch3z4k7KMC2RUNlfNOpEJlduj+VOYdq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HCwEjI4E/EoMmglgpqhczhBCBRINHgUKBOIgyhRqBQT+EX4o0BLdNgnGDE4RrklQPIqEfLZJnm2KGR4F6TSAYgyRQGQ2caEIwNwIGCgEBAwlXAT0BjTIBAQ X-IPAS-Result: A2DgAgDggntf/xCltltgHAEBAQEBAQcBARIBAQQEAQFHgUiBHoJRX40/klaKWYctCwEBAQEBAQEBATUBAgQBAYRKgjsmOBMCAwEBAQMCBQEBBgEBAQEBAQUEAYYPRYI3IoNHCwEjI4E/EoMmglgpqhczhBCBRINHgUKBOIgyhRqBQT+EX4o0BLdNgnGDE4RrklQPIqEfLZJnm2KGR4F6TSAYgyRQGQ2caEIwNwIGCgEBAwlXAT0BjTIBAQ Received: from 16.165-182-91.adsl-dyn.isp.belgacom.be (HELO localhost.localdomain) ([91.182.165.16]) by relay.skynet.be with ESMTP; 05 Oct 2020 22:36:42 +0200 From: Fabian Frederick To: davem@davemloft.net, kuba@kernel.org, netdev@vger.kernel.org Cc: kuznet@ms2.inr.ac.ru, yoshfuji@linux-ipv6.org, Fabian Frederick Subject: [PATCH 6/9 net-next] ipv6: use dev_sw_netstats_rx_add() Date: Mon, 5 Oct 2020 22:36:19 +0200 Message-Id: <20201005203619.55383-1-fabf@skynet.be> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org use new helper for netstats settings Signed-off-by: Fabian Frederick --- net/ipv6/ip6_vti.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/net/ipv6/ip6_vti.c b/net/ipv6/ip6_vti.c index fac01b80a1040..5f9c4fdc120d6 100644 --- a/net/ipv6/ip6_vti.c +++ b/net/ipv6/ip6_vti.c @@ -347,7 +347,6 @@ static int vti6_rcv_cb(struct sk_buff *skb, int err) { unsigned short family; struct net_device *dev; - struct pcpu_sw_netstats *tstats; struct xfrm_state *x; const struct xfrm_mode *inner_mode; struct ip6_tnl *t = XFRM_TUNNEL_SKB_CB(skb)->tunnel.ip6; @@ -390,12 +389,7 @@ static int vti6_rcv_cb(struct sk_buff *skb, int err) skb_scrub_packet(skb, !net_eq(t->net, dev_net(skb->dev))); skb->dev = dev; - - tstats = this_cpu_ptr(dev->tstats); - u64_stats_update_begin(&tstats->syncp); - tstats->rx_packets++; - tstats->rx_bytes += skb->len; - u64_stats_update_end(&tstats->syncp); + dev_sw_netstats_rx_add(dev, skb->len); return 0; } From patchwork Mon Oct 5 20:37:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabian Frederick X-Patchwork-Id: 268075 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5225AC47095 for ; Mon, 5 Oct 2020 20:37:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1B56821548 for ; Mon, 5 Oct 2020 20:37:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729514AbgJEUh2 (ORCPT ); Mon, 5 Oct 2020 16:37:28 -0400 Received: from mailrelay115.isp.belgacom.be ([195.238.20.142]:49578 "EHLO mailrelay115.isp.belgacom.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725901AbgJEUh1 (ORCPT ); Mon, 5 Oct 2020 16:37:27 -0400 IronPort-SDR: pwmTBCu8aSaf+0kSqpblu/lBRbNuKrIXyMglNFuzICA16yGKyDQ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mOBMCAwEBAQMCBQEBBgEBAQEBAQUEAYYPRYI3IoNHCwEjI4E/EoMmglgpqhczhBCBRINHgUKBOIgyhRqBQT+EX4o0BLdNgnGDE4RrklQPIqEfLZJnoimBek0gGIMkUBkNjisXjiZCMDcCBgoBAQMJVwE9AY0yAQE Received: from 16.165-182-91.adsl-dyn.isp.belgacom.be (HELO localhost.localdomain) ([91.182.165.16]) by relay.skynet.be with ESMTP; 05 Oct 2020 22:37:25 +0200 From: Fabian Frederick To: davem@davemloft.net, kuba@kernel.org, netdev@vger.kernel.org Cc: pshelar@ovn.org, dev@openvswitch.org, Fabian Frederick Subject: [PATCH 8/9 net-next] net: openvswitch: use dev_sw_netstats_rx_add() Date: Mon, 5 Oct 2020 22:37:03 +0200 Message-Id: <20201005203703.55486-1-fabf@skynet.be> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org use new helper for netstats settings Signed-off-by: Fabian Frederick --- net/openvswitch/vport-internal_dev.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/net/openvswitch/vport-internal_dev.c b/net/openvswitch/vport-internal_dev.c index 58a7b8312c289..d8fe66eea206b 100644 --- a/net/openvswitch/vport-internal_dev.c +++ b/net/openvswitch/vport-internal_dev.c @@ -225,7 +225,6 @@ static void internal_dev_destroy(struct vport *vport) static netdev_tx_t internal_dev_recv(struct sk_buff *skb) { struct net_device *netdev = skb->dev; - struct pcpu_sw_netstats *stats; if (unlikely(!(netdev->flags & IFF_UP))) { kfree_skb(skb); @@ -240,12 +239,7 @@ static netdev_tx_t internal_dev_recv(struct sk_buff *skb) skb->pkt_type = PACKET_HOST; skb->protocol = eth_type_trans(skb, netdev); skb_postpull_rcsum(skb, eth_hdr(skb), ETH_HLEN); - - stats = this_cpu_ptr(netdev->tstats); - u64_stats_update_begin(&stats->syncp); - stats->rx_packets++; - stats->rx_bytes += skb->len; - u64_stats_update_end(&stats->syncp); + dev_sw_netstats_rx_add(netdev, skb->len); netif_rx(skb); return NETDEV_TX_OK;