[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y3K3GyhBnMI4m6ic@lunn.ch>
Date: Mon, 14 Nov 2022 22:46:03 +0100
From: Andrew Lunn <andrew@...n.ch>
To: Shenwei Wang <shenwei.wang@....com>
Cc: Alexander Lobakin <alexandr.lobakin@...el.com>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Jesper Dangaard Brouer <hawk@...nel.org>,
John Fastabend <john.fastabend@...il.com>,
Wei Fang <wei.fang@....com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"imx@...ts.linux.dev" <imx@...ts.linux.dev>,
kernel test robot <lkp@...el.com>
Subject: Re: [EXT] Re: [PATCH v3 1/1] net: fec: add xdp and page pool
statistics
> @@ -1764,7 +1768,13 @@ fec_enet_rx_queue(struct net_device *ndev, int budget, u16 queue_id)
>
> if (xdp_result & FEC_ENET_XDP_REDIR)
> xdp_do_flush_map();
> +#if 1
> + if (xdp_prog) {
> + int i;
> + for(i = 0; i < XDP_STATS_TOTAL; i++)
> + atomic64_add(xdp_stats[i], &rxq->stats[i]);
> + }
> +#endif
Atomic operations are expensive. You should not use them unless you
really do need them.
What driver are you copying here? There is nothing particularly new
here, so you should just be copying code from another driver, and hope
you picked a good example.
Andrew
Powered by blists - more mailing lists