Skip to content

Commit

Permalink
net: openvswitch: use dev_sw_netstats_rx_add()
Browse files Browse the repository at this point in the history
use new helper for netstats settings

Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Fabian Frederick authored and David S. Miller committed Oct 6, 2020
1 parent c852162 commit e40b372
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions net/openvswitch/vport-internal_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
Expand Down

0 comments on commit e40b372

Please sign in to comment.