From: Fabian Frederick <fabf@skynet.be>
To: davem@davemloft.net, kuba@kernel.org, netdev@vger.kernel.org
Cc: pshelar@ovn.org, dev@openvswitch.org, Fabian Frederick <fabf@skynet.be>
Subject: [PATCH 8/9 net-next] net: openvswitch: use dev_sw_netstats_rx_add()
Date: Mon, 5 Oct 2020 22:37:03 +0200 [thread overview]
Message-ID: <20201005203703.55486-1-fabf@skynet.be> (raw)
use new helper for netstats settings
Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
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;
--
2.28.0
reply other threads:[~2020-10-05 20:37 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201005203703.55486-1-fabf@skynet.be \
--to=fabf@skynet.be \
--cc=davem@davemloft.net \
--cc=dev@openvswitch.org \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pshelar@ovn.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).