[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250421105830.GD2789685@horms.kernel.org>
Date: Mon, 21 Apr 2025 11:58:30 +0100
From: Simon Horman <horms@...nel.org>
To: Michal Swiatkowski <michal.swiatkowski@...ux.intel.com>
Cc: intel-wired-lan@...ts.osuosl.org, netdev@...r.kernel.org,
aleksander.lobakin@...el.com, przemyslaw.kitszel@...el.com,
piotr.kwapulinski@...el.com, aleksandr.loktionov@...el.com,
jedrzej.jagielski@...el.com, larysa.zaremba@...el.com,
anthony.l.nguyen@...el.com
Subject: Re: [iwl-next v2 1/8] ice, libie: move generic adminq descriptors to
lib
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@...el.com>
> Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@...el.com>
> Signed-off-by: Michal Swiatkowski <michal.swiatkowski@...ux.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);
...
Powered by blists - more mailing lists