All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Amritha Nambiar <amritha.nambiar@intel.com>
Cc: netdev@vger.kernel.org, sridhar.samudrala@intel.com
Subject: Re: [net-next PATCH v4 02/10] net: Add queue and napi association
Date: Tue, 10 Oct 2023 19:17:09 -0700	[thread overview]
Message-ID: <20231010191709.1cc0fbe6@kernel.org> (raw)
In-Reply-To: <169658368866.3683.5936758786055991674.stgit@anambiarhost.jf.intel.com>

On Fri, 06 Oct 2023 02:14:48 -0700 Amritha Nambiar wrote:
>  #endif
> +	/* NAPI instance for the queue */
> +	struct napi_struct		*napi;

What's the protection on this field?
Writers and readers must be under rtnl_lock?

>  } ____cacheline_aligned_in_smp;
>  
>  /*
> diff --git a/net/core/dev.c b/net/core/dev.c
> index 606a366cc209..9b63a7b76c01 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -6394,6 +6394,40 @@ int dev_set_threaded(struct net_device *dev, bool threaded)
>  }
>  EXPORT_SYMBOL(dev_set_threaded);
>  
> +/**
> + * netif_queue_set_napi - Associate queue with the napi
> + * @queue_index: Index of queue
> + * @type: queue type as RX or TX
> + * @napi: NAPI context
> + *
> + * Set queue with its corresponding napi context

Let's add more relevant info, like the fact that NAPI must already be
added before calling, calling context, etc.

> + */
> +int netif_queue_set_napi(unsigned int queue_index, enum netdev_queue_type type,
> +			 struct napi_struct *napi)

Let's make this helper void.
It will be a PITA for callers to handle any error this may return.

> +{
> +	struct net_device *dev = napi->dev;
> +	struct netdev_rx_queue *rxq;
> +	struct netdev_queue *txq;
> +
> +	if (!dev)
> +		return -EINVAL;

	if (WARN_ON_ONCE(...))
		return;

> +	default:
> +		return -EINVAL;
> +	}

same here

  reply	other threads:[~2023-10-11  2:17 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-06  9:14 [net-next PATCH v4 00/10] Introduce queue and NAPI support in netdev-genl (Was: Introduce NAPI queues support) Amritha Nambiar
2023-10-06  9:14 ` [net-next PATCH v4 01/10] netdev-genl: spec: Extend netdev netlink spec in YAML for queue Amritha Nambiar
2023-10-11  2:12   ` Jakub Kicinski
2023-10-11 23:28     ` Nambiar, Amritha
2023-10-06  9:14 ` [net-next PATCH v4 02/10] net: Add queue and napi association Amritha Nambiar
2023-10-11  2:17   ` Jakub Kicinski [this message]
2023-10-11 23:36     ` Nambiar, Amritha
2023-10-06  9:14 ` [net-next PATCH v4 03/10] ice: Add support in the driver for associating queue with napi Amritha Nambiar
2023-10-06  9:14 ` [net-next PATCH v4 04/10] netdev-genl: Add netlink framework functions for queue Amritha Nambiar
2023-10-11  2:25   ` Jakub Kicinski
2023-10-11 23:54     ` Nambiar, Amritha
2023-10-12 23:48       ` Jakub Kicinski
2023-10-13  0:24         ` Nambiar, Amritha
2023-10-13  0:36           ` Jakub Kicinski
2023-10-13  0:40             ` Nambiar, Amritha
2023-10-13  0:44             ` Jakub Kicinski
2023-10-06  9:15 ` [net-next PATCH v4 05/10] netdev-genl: spec: Extend netdev netlink spec in YAML for NAPI Amritha Nambiar
2023-10-06  9:15 ` [net-next PATCH v4 06/10] netdev-genl: Add netlink framework functions for napi Amritha Nambiar
2023-10-11  2:29   ` Jakub Kicinski
2023-10-11 23:55     ` Nambiar, Amritha
2023-10-06  9:15 ` [net-next PATCH v4 07/10] netdev-genl: spec: Add irq in netdev netlink YAML spec Amritha Nambiar
2023-10-06  9:15 ` [net-next PATCH v4 08/10] net: Add NAPI IRQ support Amritha Nambiar
2023-10-06  9:15 ` [net-next PATCH v4 09/10] netdev-genl: spec: Add PID in netdev netlink YAML spec Amritha Nambiar
2023-10-06  9:15 ` [net-next PATCH v4 10/10] netdev-genl: Add PID for the NAPI thread Amritha Nambiar

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=20231010191709.1cc0fbe6@kernel.org \
    --to=kuba@kernel.org \
    --cc=amritha.nambiar@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=sridhar.samudrala@intel.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 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.