Skip to content

Commit

Permalink
geneve: 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 davem330 committed Oct 6, 2020
1 parent 1f8dda1 commit 1e84527
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions drivers/net/geneve.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,6 @@ static void geneve_rx(struct geneve_dev *geneve, struct geneve_sock *gs,
{
struct genevehdr *gnvh = geneve_hdr(skb);
struct metadata_dst *tun_dst = NULL;
struct pcpu_sw_netstats *stats;
unsigned int len;
int err = 0;
void *oiph;
Expand Down Expand Up @@ -296,13 +295,9 @@ static void geneve_rx(struct geneve_dev *geneve, struct geneve_sock *gs,

len = skb->len;
err = gro_cells_receive(&geneve->gro_cells, skb);
if (likely(err == NET_RX_SUCCESS)) {
stats = this_cpu_ptr(geneve->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(geneve->dev, len);

return;
drop:
/* Consume bad packet */
Expand Down

0 comments on commit 1e84527

Please sign in to comment.