* [PATCH 5/9 net-next] gtp: use dev_sw_netstats_rx_add()
@ 2020-10-05 20:35 Fabian Frederick
2020-10-06 8:18 ` Harald Welte
0 siblings, 1 reply; 2+ messages in thread
From: Fabian Frederick @ 2020-10-05 20:35 UTC (permalink / raw)
To: davem, kuba, netdev; +Cc: pablo, laforge, Fabian Frederick
use new helper for netstats settings
Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
drivers/net/gtp.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c
index c09fe18c6c52d..030a1a5afe05a 100644
--- a/drivers/net/gtp.c
+++ b/drivers/net/gtp.c
@@ -182,8 +182,6 @@ static bool gtp_check_ms(struct sk_buff *skb, struct pdp_ctx *pctx,
static int gtp_rx(struct pdp_ctx *pctx, struct sk_buff *skb,
unsigned int hdrlen, unsigned int role)
{
- struct pcpu_sw_netstats *stats;
-
if (!gtp_check_ms(skb, pctx, hdrlen, role)) {
netdev_dbg(pctx->dev, "No PDP ctx for this MS\n");
return 1;
@@ -204,11 +202,7 @@ static int gtp_rx(struct pdp_ctx *pctx, struct sk_buff *skb,
skb->dev = pctx->dev;
- stats = this_cpu_ptr(pctx->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(pctx->dev, skb->len);
netif_rx(skb);
return 0;
--
2.28.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 5/9 net-next] gtp: use dev_sw_netstats_rx_add()
2020-10-05 20:35 [PATCH 5/9 net-next] gtp: use dev_sw_netstats_rx_add() Fabian Frederick
@ 2020-10-06 8:18 ` Harald Welte
0 siblings, 0 replies; 2+ messages in thread
From: Harald Welte @ 2020-10-06 8:18 UTC (permalink / raw)
To: Fabian Frederick; +Cc: davem, kuba, netdev, pablo
On Mon, Oct 05, 2020 at 10:35:46PM +0200, Fabian Frederick wrote:
> use new helper for netstats settings
Acked-by: Harald Welte <laforge@gnumonks.org>
--
- Harald Welte <laforge@gnumonks.org> http://laforge.gnumonks.org/
============================================================================
"Privacy in residential applications is a desirable marketing option."
(ETSI EN 300 175-7 Ch. A6)
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-10-06 8:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-05 20:35 [PATCH 5/9 net-next] gtp: use dev_sw_netstats_rx_add() Fabian Frederick
2020-10-06 8:18 ` Harald Welte
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.