netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Larysa Zaremba <larysa.zaremba@intel.com>
Cc: intel-wired-lan@lists.osuosl.org,
	Tony Nguyen <anthony.l.nguyen@intel.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Przemek Kitszel <przemyslaw.kitszel@intel.com>,
	Jiri Pirko <jiri@resnulli.us>,
	Mustafa Ismail <mustafa.ismail@intel.com>,
	Tatyana Nikolova <tatyana.e.nikolova@intel.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	Alexander Lobakin <aleksander.lobakin@intel.com>,
	Michael Ellerman <mpe@ellerman.id.au>,
	Maciej Fijalkowski <maciej.fijalkowski@intel.com>,
	Lee Trager <lee@trager.us>,
	Madhavan Srinivasan <maddy@linux.ibm.com>,
	Sridhar Samudrala <sridhar.samudrala@intel.com>,
	Jacob Keller <jacob.e.keller@intel.com>,
	Michal Swiatkowski <michal.swiatkowski@linux.intel.com>,
	Mateusz Polchlopek <mateusz.polchlopek@intel.com>,
	Wenjun Wu <wenjun1.wu@intel.com>,
	Ahmed Zaki <ahmed.zaki@intel.com>,
	netdev@vger.kernel.org, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org, "Karlsson,
	Magnus" <magnus.karlsson@intel.com>,
	Emil Tantilov <emil.s.tantilov@intel.com>,
	Madhu Chittim <madhu.chittim@intel.com>,
	Josh Hay <joshua.a.hay@intel.com>,
	Milena Olech <milena.olech@intel.com>,
	pavan.kumar.linga@intel.com, "Singhai,
	Anjali" <anjali.singhai@intel.com>,
	Phani R Burra <phani.r.burra@intel.com>
Subject: Re: [PATCH iwl-next 06/14] libeth: add bookkeeping support for control queue messages
Date: Mon, 21 Apr 2025 15:19:37 +0100	[thread overview]
Message-ID: <20250421141937.GI2789685@horms.kernel.org> (raw)
In-Reply-To: <20250408124816.11584-7-larysa.zaremba@intel.com>

On Tue, Apr 08, 2025 at 02:47:52PM +0200, Larysa Zaremba wrote:
> From: Phani R Burra <phani.r.burra@intel.com>
> 
> All send control queue messages are allocated/freed in libeth itself
> and tracked with the unique transaction (Xn) ids until they receive
> response or time out. Responses can be received out of order, therefore
> transactions are stored in an array and tracked though a bitmap.
> 
> Pre-allocated DMA memory is used where possible. It reduces the driver
> overhead in handling memory allocation/free and message timeouts.
> 
> Reviewed-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
> Signed-off-by: Phani R Burra <phani.r.burra@intel.com>
> Co-developed-by: Victor Raj <victor.raj@intel.com>
> Signed-off-by: Victor Raj <victor.raj@intel.com>
> Co-developed-by: Pavan Kumar Linga <pavan.kumar.linga@intel.com>
> Signed-off-by: Pavan Kumar Linga <pavan.kumar.linga@intel.com>
> Co-developed-by: Larysa Zaremba <larysa.zaremba@intel.com>
> Signed-off-by: Larysa Zaremba <larysa.zaremba@intel.com>
> ---
>  drivers/net/ethernet/intel/libeth/controlq.c | 578 +++++++++++++++++++
>  include/net/libeth/controlq.h                | 169 ++++++
>  2 files changed, 747 insertions(+)
> 
> diff --git a/drivers/net/ethernet/intel/libeth/controlq.c b/drivers/net/ethernet/intel/libeth/controlq.c

...

> +/**
> + * libeth_ctlq_xn_deinit - deallocate and free the transaction manager resources
> + * @xnm: pointer to the transaction manager
> + * @ctx: controlq context structure
> + *
> + * All Rx processing must be stopped beforehand.
> + */
> +void libeth_ctlq_xn_deinit(struct libeth_ctlq_xn_manager *xnm,
> +			   struct libeth_ctlq_ctx *ctx)
> +{
> +	bool must_wait = false;
> +	u32 i;
> +
> +	/* Should be no new clear bits after this */
> +	spin_lock(&xnm->free_xns_bm_lock);
> +		xnm->shutdown = true;

nit: The line above is not correctly indented.

     Flagged by Smatch.

> +
> +	for_each_clear_bit(i, xnm->free_xns_bm, LIBETH_CTLQ_MAX_XN_ENTRIES) {
> +		struct libeth_ctlq_xn *xn = &xnm->ring[i];
> +
> +		spin_lock(&xn->xn_lock);
> +
> +		if (xn->state == LIBETH_CTLQ_XN_WAITING ||
> +		    xn->state == LIBETH_CTLQ_XN_IDLE) {
> +			complete(&xn->cmd_completion_event);
> +			must_wait = true;
> +		} else if (xn->state == LIBETH_CTLQ_XN_ASYNC) {
> +			__libeth_ctlq_xn_push_free(xnm, xn);
> +		}
> +
> +		spin_unlock(&xn->xn_lock);
> +	}
> +
> +	spin_unlock(&xnm->free_xns_bm_lock);
> +
> +	if (must_wait)
> +		wait_for_completion(&xnm->can_destroy);
> +
> +	libeth_ctlq_xn_deinit_dma(&ctx->mmio_info.pdev->dev, xnm,
> +				  LIBETH_CTLQ_MAX_XN_ENTRIES);
> +	kfree(xnm);
> +	libeth_ctlq_deinit(ctx);
> +}
> +EXPORT_SYMBOL_NS_GPL(libeth_ctlq_xn_deinit, "LIBETH_CP");

...

  parent reply	other threads:[~2025-04-21 14:19 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-08 12:47 [PATCH iwl-next 00/14] Introduce iXD driver Larysa Zaremba
2025-04-08 12:47 ` [PATCH iwl-next 01/14] virtchnl: create 'include/linux/intel' and move necessary header files Larysa Zaremba
2025-04-15 18:53   ` Tony Nguyen
2025-04-08 12:47 ` [PATCH iwl-next 02/14] virtchnl: introduce control plane version fields Larysa Zaremba
2025-04-08 12:47 ` [PATCH iwl-next 03/14] libeth: add PCI device initialization helpers to libeth Larysa Zaremba
2025-04-21 14:08   ` Simon Horman
2025-04-08 12:47 ` [PATCH iwl-next 04/14] libeth: allow to create fill queues without NAPI Larysa Zaremba
2025-04-08 12:47 ` [PATCH iwl-next 05/14] libeth: add control queue support Larysa Zaremba
2025-04-10  8:21   ` Leon Romanovsky
2025-04-10 10:44     ` Larysa Zaremba
2025-04-10 11:23       ` Leon Romanovsky
2025-04-10 12:58         ` Larysa Zaremba
2025-04-10 13:27           ` Leon Romanovsky
2025-04-10 13:33             ` Alexander Lobakin
2025-04-10 13:58               ` Leon Romanovsky
2025-04-10 14:04                 ` Alexander Lobakin
2025-04-10 13:05         ` Alexander Lobakin
2025-04-10 13:44           ` Leon Romanovsky
2025-04-10 13:59             ` Larysa Zaremba
2025-04-11 17:18               ` Leon Romanovsky
2025-04-10 14:00             ` [Intel-wired-lan] " Alexander Lobakin
2025-04-08 12:47 ` [PATCH iwl-next 06/14] libeth: add bookkeeping support for control queue messages Larysa Zaremba
2025-04-15 18:54   ` Tony Nguyen
2025-04-21 14:19   ` Simon Horman [this message]
2025-04-08 12:47 ` [PATCH iwl-next 07/14] idpf: remove 'vport_params_reqd' field Larysa Zaremba
2025-04-08 12:47 ` [PATCH iwl-next 08/14] idpf: refactor idpf to use libeth controlq and Xn APIs Larysa Zaremba
2025-04-21 14:25   ` Simon Horman
2025-04-08 12:47 ` [PATCH iwl-next 09/14] idpf: make mbx_task queueing and cancelling more consistent Larysa Zaremba
2025-04-08 12:47 ` [PATCH iwl-next 10/14] idpf: print a debug message and bail in case of non-event ctlq message Larysa Zaremba
2025-04-08 12:47 ` [PATCH iwl-next 11/14] ixd: add basic driver framework for Intel(R) Control Plane Function Larysa Zaremba
2025-04-08 12:47 ` [PATCH iwl-next 12/14] ixd: add reset checks and initialize the mailbox Larysa Zaremba
2025-04-08 12:47 ` [PATCH iwl-next 13/14] ixd: add the core initialization Larysa Zaremba
2025-04-08 12:48 ` [PATCH iwl-next 14/14] ixd: add devlink support Larysa Zaremba
2025-04-15 18:54   ` Tony Nguyen
2025-04-16 15:49 ` [PATCH iwl-next 00/14] Introduce iXD driver Alexander Lobakin
2025-04-16 16:23   ` Keller, Jacob E

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=20250421141937.GI2789685@horms.kernel.org \
    --to=horms@kernel.org \
    --cc=ahmed.zaki@intel.com \
    --cc=aleksander.lobakin@intel.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=anjali.singhai@intel.com \
    --cc=anthony.l.nguyen@intel.com \
    --cc=corbet@lwn.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=emil.s.tantilov@intel.com \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=jacob.e.keller@intel.com \
    --cc=jiri@resnulli.us \
    --cc=joshua.a.hay@intel.com \
    --cc=kuba@kernel.org \
    --cc=larysa.zaremba@intel.com \
    --cc=lee@trager.us \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maciej.fijalkowski@intel.com \
    --cc=maddy@linux.ibm.com \
    --cc=madhu.chittim@intel.com \
    --cc=magnus.karlsson@intel.com \
    --cc=mateusz.polchlopek@intel.com \
    --cc=michal.swiatkowski@linux.intel.com \
    --cc=milena.olech@intel.com \
    --cc=mpe@ellerman.id.au \
    --cc=mustafa.ismail@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pavan.kumar.linga@intel.com \
    --cc=phani.r.burra@intel.com \
    --cc=przemyslaw.kitszel@intel.com \
    --cc=sridhar.samudrala@intel.com \
    --cc=tatyana.e.nikolova@intel.com \
    --cc=wenjun1.wu@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 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).