All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Cc: intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org,
	aleksander.lobakin@intel.com, przemyslaw.kitszel@intel.com,
	piotr.kwapulinski@intel.com, aleksandr.loktionov@intel.com,
	jedrzej.jagielski@intel.com, larysa.zaremba@intel.com,
	anthony.l.nguyen@intel.com
Subject: Re: [Intel-wired-lan] [iwl-next v2 1/8] ice, libie: move generic adminq descriptors to lib
Date: Mon, 21 Apr 2025 11:58:30 +0100	[thread overview]
Message-ID: <20250421105830.GD2789685@horms.kernel.org> (raw)
In-Reply-To: <20250410100121.2353754-2-michal.swiatkowski@linux.intel.com>

On Thu, Apr 10, 2025 at 12:01:14PM +0200, Michal Swiatkowski wrote:
> The descriptor structure is the same in ice, ixgbe and i40e. Move it to
> common libie header to use it across different driver.
> 
> Leave device specific adminq commands in separate folders. This lead to
> a change that need to be done in filling/getting descriptor:
> - previous: struct specific_desc *cmd;
> 	    cmd = &desc.params.specific_desc;
> - now: struct specific_desc *cmd;
>        cmd = libie_aq_raw(&desc);
> 
> Do this changes across the driver to allow clean build. The casting only
> have to be done in case of specific descriptors, for generic one union
> can still be used.
> 
> Changes beside code moving:
> - change ICE_ prefix to LIBIE_ prefix (ice_ and libie_ too)
> - remove shift variables not otherwise needed (in libie_aq_flags)
> - fill/get descriptor data based on desc.params.raw whenever the
>   descriptor isn't defined in libie
> - move defines from the libie_aq_sth structure outside
> - add libie_aq_raw helper and use it instead of explicit casting
> 
> Reviewed by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
> Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
> Signed-off-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>

...

> diff --git a/include/linux/net/intel/libie/adminq.h b/include/linux/net/intel/libie/adminq.h
> new file mode 100644
> index 000000000000..568980ddf4c1
> --- /dev/null
> +++ b/include/linux/net/intel/libie/adminq.h
> @@ -0,0 +1,269 @@
> +/* SPDX-License-Identifier: GPL-2.0-only */
> +/* Copyright (C) 2025 Intel Corporation */
> +
> +#ifndef __LIBIE_ADMINQ_H
> +#define __LIBIE_ADMINQ_H
> +
> +#include <linux/build_bug.h>
> +#include <linux/types.h>
> +
> +#define LIBIE_CHECK_STRUCT_LEN(n, X)	\
> +	static_assert((n) == sizeof(struct X))
> +
> +/**
> + * struct libie_aqc_generic - Generic structure used in adminq communication
> + * @param: generic parameter
> + * @addr: generic address

nit: The struct members documented above do not match those present below.

> + */
> +struct libie_aqc_generic {
> +	__le32 param0;
> +	__le32 param1;
> +	__le32 addr_high;
> +	__le32 addr_low;
> +};
> +LIBIE_CHECK_STRUCT_LEN(16, libie_aqc_generic);

...

WARNING: multiple messages have this Message-ID (diff)
From: Simon Horman <horms@kernel.org>
To: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Cc: intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org,
	aleksander.lobakin@intel.com, przemyslaw.kitszel@intel.com,
	piotr.kwapulinski@intel.com, aleksandr.loktionov@intel.com,
	jedrzej.jagielski@intel.com, larysa.zaremba@intel.com,
	anthony.l.nguyen@intel.com
Subject: Re: [iwl-next v2 1/8] ice, libie: move generic adminq descriptors to lib
Date: Mon, 21 Apr 2025 11:58:30 +0100	[thread overview]
Message-ID: <20250421105830.GD2789685@horms.kernel.org> (raw)
In-Reply-To: <20250410100121.2353754-2-michal.swiatkowski@linux.intel.com>

On Thu, Apr 10, 2025 at 12:01:14PM +0200, Michal Swiatkowski wrote:
> The descriptor structure is the same in ice, ixgbe and i40e. Move it to
> common libie header to use it across different driver.
> 
> Leave device specific adminq commands in separate folders. This lead to
> a change that need to be done in filling/getting descriptor:
> - previous: struct specific_desc *cmd;
> 	    cmd = &desc.params.specific_desc;
> - now: struct specific_desc *cmd;
>        cmd = libie_aq_raw(&desc);
> 
> Do this changes across the driver to allow clean build. The casting only
> have to be done in case of specific descriptors, for generic one union
> can still be used.
> 
> Changes beside code moving:
> - change ICE_ prefix to LIBIE_ prefix (ice_ and libie_ too)
> - remove shift variables not otherwise needed (in libie_aq_flags)
> - fill/get descriptor data based on desc.params.raw whenever the
>   descriptor isn't defined in libie
> - move defines from the libie_aq_sth structure outside
> - add libie_aq_raw helper and use it instead of explicit casting
> 
> Reviewed by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
> Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
> Signed-off-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>

...

> diff --git a/include/linux/net/intel/libie/adminq.h b/include/linux/net/intel/libie/adminq.h
> new file mode 100644
> index 000000000000..568980ddf4c1
> --- /dev/null
> +++ b/include/linux/net/intel/libie/adminq.h
> @@ -0,0 +1,269 @@
> +/* SPDX-License-Identifier: GPL-2.0-only */
> +/* Copyright (C) 2025 Intel Corporation */
> +
> +#ifndef __LIBIE_ADMINQ_H
> +#define __LIBIE_ADMINQ_H
> +
> +#include <linux/build_bug.h>
> +#include <linux/types.h>
> +
> +#define LIBIE_CHECK_STRUCT_LEN(n, X)	\
> +	static_assert((n) == sizeof(struct X))
> +
> +/**
> + * struct libie_aqc_generic - Generic structure used in adminq communication
> + * @param: generic parameter
> + * @addr: generic address

nit: The struct members documented above do not match those present below.

> + */
> +struct libie_aqc_generic {
> +	__le32 param0;
> +	__le32 param1;
> +	__le32 addr_high;
> +	__le32 addr_low;
> +};
> +LIBIE_CHECK_STRUCT_LEN(16, libie_aqc_generic);

...

  reply	other threads:[~2025-04-21 10:58 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-10 10:01 [Intel-wired-lan] [iwl-next v2 0/8] libie: commonize adminq structure Michal Swiatkowski
2025-04-10 10:01 ` Michal Swiatkowski
2025-04-10 10:01 ` [Intel-wired-lan] [iwl-next v2 1/8] ice, libie: move generic adminq descriptors to lib Michal Swiatkowski
2025-04-10 10:01   ` Michal Swiatkowski
2025-04-21 10:58   ` Simon Horman [this message]
2025-04-21 10:58     ` Simon Horman
2025-04-10 10:01 ` [Intel-wired-lan] [iwl-next v2 2/8] ixgbe: use libie adminq descriptors Michal Swiatkowski
2025-04-10 10:01   ` Michal Swiatkowski
2025-04-10 10:01 ` [Intel-wired-lan] [iwl-next v2 3/8] i40e: " Michal Swiatkowski
2025-04-10 10:01   ` Michal Swiatkowski
2025-04-10 10:01 ` [Intel-wired-lan] [iwl-next v2 4/8] iavf: " Michal Swiatkowski
2025-04-10 10:01   ` Michal Swiatkowski
2025-04-10 10:01 ` [Intel-wired-lan] [iwl-next v2 5/8] libie: add adminq helper for converting err to str Michal Swiatkowski
2025-04-10 10:01   ` Michal Swiatkowski
2025-04-10 10:01 ` [Intel-wired-lan] [iwl-next v2 6/8] ice: use libie_aq_str Michal Swiatkowski
2025-04-10 10:01   ` Michal Swiatkowski
2025-04-10 10:01 ` [Intel-wired-lan] [iwl-next v2 7/8] iavf: " Michal Swiatkowski
2025-04-10 10:01   ` Michal Swiatkowski
2025-04-10 12:50   ` [Intel-wired-lan] " Loktionov, Aleksandr
2025-04-10 12:50     ` Loktionov, Aleksandr
2025-04-10 10:01 ` [Intel-wired-lan] [iwl-next v2 8/8] i40e: " Michal Swiatkowski
2025-04-10 10:01   ` Michal Swiatkowski
2025-04-15 22:59 ` [Intel-wired-lan] [iwl-next v2 0/8] libie: commonize adminq structure Tony Nguyen
2025-04-15 22:59   ` Tony Nguyen
2025-04-16  8:38   ` [Intel-wired-lan] " Michal Swiatkowski
2025-04-16  8:38     ` Michal Swiatkowski

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=20250421105830.GD2789685@horms.kernel.org \
    --to=horms@kernel.org \
    --cc=aleksander.lobakin@intel.com \
    --cc=aleksandr.loktionov@intel.com \
    --cc=anthony.l.nguyen@intel.com \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=jedrzej.jagielski@intel.com \
    --cc=larysa.zaremba@intel.com \
    --cc=michal.swiatkowski@linux.intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=piotr.kwapulinski@intel.com \
    --cc=przemyslaw.kitszel@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.