netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Simon Horman <simon.horman@corigine.com>
To: William Tu <u9012063@gmail.com>
Cc: netdev@vger.kernel.org, jsankararama@vmware.com,
	gyang@vmware.com, doshir@vmware.com, alexander.duyck@gmail.com,
	alexandr.lobakin@intel.com, bang@vmware.com,
	maciej.fijalkowski@intel.com, witu@nvidia.com,
	horatiu.vultur@microchip.com, error27@gmail.com,
	Alexander Duyck <alexanderduyck@fb.com>
Subject: Re: [PATCH RFC net-next v20] vmxnet3: Add XDP support.
Date: Tue, 18 Apr 2023 14:11:33 +0200	[thread overview]
Message-ID: <ZD6I9eTJWS1KWL3R@corigine.com> (raw)
In-Reply-To: <20230412234434.91819-1-witu@nvidia.com>

On Wed, Apr 12, 2023 at 04:44:34PM -0700, William Tu wrote:
> From: William Tu <u9012063@gmail.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;
> +}

...

  reply	other threads:[~2023-04-18 12:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-12 23:44 [PATCH RFC net-next v20] vmxnet3: Add XDP support William Tu
2023-04-18 12:11 ` Simon Horman [this message]
2023-04-18 13:59   ` William Tu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZD6I9eTJWS1KWL3R@corigine.com \
    --to=simon.horman@corigine.com \
    --cc=alexander.duyck@gmail.com \
    --cc=alexanderduyck@fb.com \
    --cc=alexandr.lobakin@intel.com \
    --cc=bang@vmware.com \
    --cc=doshir@vmware.com \
    --cc=error27@gmail.com \
    --cc=gyang@vmware.com \
    --cc=horatiu.vultur@microchip.com \
    --cc=jsankararama@vmware.com \
    --cc=maciej.fijalkowski@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=u9012063@gmail.com \
    --cc=witu@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).