mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2025-01-18 11:54:37 +08:00
geneve: use dev_sw_netstats_rx_add()
use new helper for netstats settings Signed-off-by: Fabian Frederick <fabf@skynet.be> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
1f8dda1d26
commit
1e84527b7f
@ -217,7 +217,6 @@ static void geneve_rx(struct geneve_dev *geneve, struct geneve_sock *gs,
|
|||||||
{
|
{
|
||||||
struct genevehdr *gnvh = geneve_hdr(skb);
|
struct genevehdr *gnvh = geneve_hdr(skb);
|
||||||
struct metadata_dst *tun_dst = NULL;
|
struct metadata_dst *tun_dst = NULL;
|
||||||
struct pcpu_sw_netstats *stats;
|
|
||||||
unsigned int len;
|
unsigned int len;
|
||||||
int err = 0;
|
int err = 0;
|
||||||
void *oiph;
|
void *oiph;
|
||||||
@ -296,13 +295,9 @@ static void geneve_rx(struct geneve_dev *geneve, struct geneve_sock *gs,
|
|||||||
|
|
||||||
len = skb->len;
|
len = skb->len;
|
||||||
err = gro_cells_receive(&geneve->gro_cells, skb);
|
err = gro_cells_receive(&geneve->gro_cells, skb);
|
||||||
if (likely(err == NET_RX_SUCCESS)) {
|
if (likely(err == NET_RX_SUCCESS))
|
||||||
stats = this_cpu_ptr(geneve->dev->tstats);
|
dev_sw_netstats_rx_add(geneve->dev, len);
|
||||||
u64_stats_update_begin(&stats->syncp);
|
|
||||||
stats->rx_packets++;
|
|
||||||
stats->rx_bytes += len;
|
|
||||||
u64_stats_update_end(&stats->syncp);
|
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
drop:
|
drop:
|
||||||
/* Consume bad packet */
|
/* Consume bad packet */
|
||||||
|
Loading…
Reference in New Issue
Block a user