From: Simon Horman <simon.horman@corigine.com>
To: Amritha Nambiar <amritha.nambiar@intel.com>
Cc: netdev@vger.kernel.org, kuba@kernel.org, davem@davemloft.net,
sridhar.samudrala@intel.com
Subject: Re: [net-next/RFC PATCH v1 2/4] net: Add support for associating napi with queue[s]
Date: Fri, 2 Jun 2023 17:42:17 +0200 [thread overview]
Message-ID: <ZHoN2ci/QbBIT7qj@corigine.com> (raw)
In-Reply-To: <168564135094.7284.9691772825401908320.stgit@anambiarhost.jf.intel.com>
On Thu, Jun 01, 2023 at 10:42:30AM -0700, Amritha Nambiar wrote:
> After the napi context is initialized, map the napi instance
> with the queue/queue-set on the corresponding irq line.
>
> Signed-off-by: Amritha Nambiar <amritha.nambiar@intel.com>
Hi Amritha,
some minor feedback from my side.
...
> diff --git a/net/core/dev.c b/net/core/dev.c
> index 9ee8eb3ef223..ba712119ec85 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -6366,6 +6366,40 @@ int dev_set_threaded(struct net_device *dev, bool threaded)
> }
> EXPORT_SYMBOL(dev_set_threaded);
>
> +/**
> + * netif_napi_add_queue - Associate queue with the napi
> + * @napi: NAPI context
> + * @queue_index: Index of queue
> + * @napi_container_type: queue type as RX or TX
s/@napi_container_type:/@type:/
> + *
> + * Add queue with its corresponding napi context
> + */
> +int netif_napi_add_queue(struct napi_struct *napi, u16 queue_index,
> + enum napi_container_type type)
> +{
> + struct napi_queue *napi_queue;
> +
> + napi_queue = kzalloc(sizeof(*napi_queue), GFP_KERNEL);
> + if (!napi_queue)
> + return -ENOMEM;
> +
> + napi_queue->queue_index = queue_index;
> +
> + switch (type) {
> + case NAPI_RX_CONTAINER:
> + list_add_rcu(&napi_queue->q_list, &napi->napi_rxq_list);
> + break;
> + case NAPI_TX_CONTAINER:
> + list_add_rcu(&napi_queue->q_list, &napi->napi_txq_list);
> + break;
> + default:
Perhaps napi_queue is leaked here.
> + return -EINVAL;
> + }
> +
> + return 0;
> +}
> +EXPORT_SYMBOL(netif_napi_add_queue);
> +
> void netif_napi_add_weight(struct net_device *dev, struct napi_struct *napi,
> int (*poll)(struct napi_struct *, int), int weight)
> {
>
>
next prev parent reply other threads:[~2023-06-02 15:42 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-01 17:42 [net-next/RFC PATCH v1 0/4] Introduce napi queues support Amritha Nambiar
2023-06-01 17:42 ` [net-next/RFC PATCH v1 1/4] net: Introduce new napi fields for rx/tx queues Amritha Nambiar
2023-06-03 6:06 ` Jakub Kicinski
2023-07-12 20:09 ` Nambiar, Amritha
2023-07-12 21:14 ` Jakub Kicinski
2023-07-12 23:11 ` Nambiar, Amritha
2023-07-12 23:53 ` Jakub Kicinski
2023-07-28 21:59 ` Jakub Kicinski
2023-07-28 22:37 ` Nambiar, Amritha
2023-07-28 23:09 ` Jakub Kicinski
2023-07-31 23:48 ` Nambiar, Amritha
2023-08-02 0:26 ` David Ahern
2023-08-02 0:50 ` Jakub Kicinski
2023-06-01 17:42 ` [net-next/RFC PATCH v1 2/4] net: Add support for associating napi with queue[s] Amritha Nambiar
2023-06-02 7:50 ` Dan Carpenter
2023-06-02 15:42 ` Simon Horman [this message]
2023-07-12 19:53 ` Nambiar, Amritha
2023-06-03 6:31 ` Paolo Abeni
2023-07-12 19:56 ` Nambiar, Amritha
2023-06-01 17:42 ` [net-next/RFC PATCH v1 3/4] netdev-genl: Introduce netdev dump ctx Amritha Nambiar
2023-06-01 17:42 ` [net-next/RFC PATCH v1 4/4] netdev-genl: Add support for exposing napi info from netdev Amritha Nambiar
2023-06-02 15:47 ` Simon Horman
2023-06-03 6:08 ` Jakub Kicinski
2023-07-12 20:05 ` Nambiar, Amritha
2023-07-12 19:54 ` Nambiar, Amritha
2023-06-03 6:17 ` Jakub Kicinski
2023-07-12 20:10 ` Nambiar, Amritha
2023-07-12 21:19 ` Jakub Kicinski
2023-06-03 6:00 ` [net-next/RFC PATCH v1 0/4] Introduce napi queues support Jakub Kicinski
2023-07-12 19:52 ` Nambiar, Amritha
-- strict thread matches above, loose matches on Subject: below --
2023-06-02 0:24 [net-next/RFC PATCH v1 2/4] net: Add support for associating napi with queue[s] kernel test robot
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=ZHoN2ci/QbBIT7qj@corigine.com \
--to=simon.horman@corigine.com \
--cc=amritha.nambiar@intel.com \
--cc=davem@davemloft.net \
--cc=kuba@kernel.org \
--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.