[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZD6I9eTJWS1KWL3R@corigine.com>
Date: Tue, 18 Apr 2023 14:11:33 +0200
From: Simon Horman <simon.horman@...igine.com>
To: William Tu <u9012063@...il.com>
Cc: netdev@...r.kernel.org, jsankararama@...are.com, gyang@...are.com,
doshir@...are.com, alexander.duyck@...il.com,
alexandr.lobakin@...el.com, bang@...are.com,
maciej.fijalkowski@...el.com, witu@...dia.com,
horatiu.vultur@...rochip.com, error27@...il.com,
Alexander Duyck <alexanderduyck@...com>
Subject: Re: [PATCH RFC net-next v20] vmxnet3: Add XDP support.
On Wed, Apr 12, 2023 at 04:44:34PM -0700, William Tu wrote:
> From: William Tu <u9012063@...il.com>
>
> The patch adds native-mode XDP support: XDP DROP, PASS, TX, and REDIRECT.
...
> +/* ndo_xdp_xmit */
> +int
> +vmxnet3_xdp_xmit(struct net_device *dev,
> + int n, struct xdp_frame **frames, u32 flags)
> +{
> + struct vmxnet3_adapter *adapter = netdev_priv(dev);
> + struct vmxnet3_tx_queue *tq;
> + struct netdev_queue *nq;
> + int i;
> +
> + if (unlikely(test_bit(VMXNET3_STATE_BIT_QUIESCED, &adapter->state)))
> + return -ENETDOWN;
> + if (unlikely(test_bit(VMXNET3_STATE_BIT_RESETTING, &adapter->state)))
> + return -EINVAL;
> +
> + tq = vmxnet3_xdp_get_tq(adapter);
> + if (tq->stopped)
> + return -ENETDOWN;
> +
> + nq = netdev_get_tx_queue(adapter->netdev, tq->qid);
Hi William,
gcc-12 with W=1 tells me that:
drivers/net/vmxnet3/vmxnet3_xdp.c:228:23: warning: variable 'nq' set but not used [-Wunused-but-set-variable]
struct netdev_queue *nq;
> +
> + for (i = 0; i < n; i++) {
> + if (vmxnet3_xdp_xmit_frame(adapter, frames[i], tq, true)) {
> + tq->stats.xdp_xmit_err++;
> + break;
> + }
> + }
> + tq->stats.xdp_xmit += i;
> +
> + return i;
> +}
...
Powered by blists - more mailing lists