> -----Original Message-----
> From: Intel-wired-lan <[email protected]> On Behalf
> Of Larysa Zaremba
> Sent: Monday, November 17, 2025 2:49 PM
> To: [email protected]; Nguyen, Anthony L
> <[email protected]>
> Cc: Lobakin, Aleksander <[email protected]>; Samudrala,
> Sridhar <[email protected]>; Singhai, Anjali
> <[email protected]>; Michal Swiatkowski
> <[email protected]>; Zaremba, Larysa
> <[email protected]>; Fijalkowski, Maciej
> <[email protected]>; Tantilov, Emil S
> <[email protected]>; Chittim, Madhu <[email protected]>;
> Hay, Joshua A <[email protected]>; Keller, Jacob E
> <[email protected]>; Shanmugam, Jayaprakash
> <[email protected]>; Wochtman, Natalia
> <[email protected]>; Jiri Pirko <[email protected]>; David S.
> Miller <[email protected]>; Eric Dumazet <[email protected]>;
> Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>;
> Simon Horman <[email protected]>; Jonathan Corbet <[email protected]>;
> Richard Cochran <[email protected]>; Kitszel, Przemyslaw
> <[email protected]>; Andrew Lunn <[email protected]>;
> [email protected]; [email protected]; linux-
> [email protected]
> Subject: [Intel-wired-lan] [PATCH iwl-next v5 15/15] ixd: add devlink
> support
> 
> From: Amritha Nambiar <[email protected]>
> 
> Enable initial support for the devlink interface with the ixd driver.
> The ixd hardware is a single function PCIe device. So, the PCIe
> adapter gets its own devlink instance to manage device-wide resources
> or configuration.
> 
> $ devlink dev show
> pci/0000:83:00.6
> 
> $ devlink dev info pci/0000:83:00.6
> pci/0000:83:00.6:
>   driver ixd
>   serial_number 00-a0-c9-ff-ff-23-45-67
>   versions:
>       fixed:
>         device.type MEV
>       running:
>         cp 0.0
>         virtchnl 2.0
> 
This commit mentions MEV without expansion.
Kernel docs require expanding uncommon abbreviations.


> Signed-off-by: Amritha Nambiar <[email protected]>
> Reviewed-by: Michal Swiatkowski <[email protected]>
> Reviewed-by: Maciej Fijalkowski <[email protected]>
> Reviewed-by: Przemek Kitszel <[email protected]>
> Signed-off-by: Larysa Zaremba <[email protected]>
> ---
>  Documentation/networking/devlink/index.rst   |   1 +
>  Documentation/networking/devlink/ixd.rst     |  35 +++++++
>  drivers/net/ethernet/intel/ixd/Kconfig       |   1 +
>  drivers/net/ethernet/intel/ixd/Makefile      |   1 +
>  drivers/net/ethernet/intel/ixd/ixd_devlink.c | 105
> +++++++++++++++++++  drivers/net/ethernet/intel/ixd/ixd_devlink.h |
> 44 ++++++++
>  drivers/net/ethernet/intel/ixd/ixd_main.c    |  16 ++-
>  7 files changed, 200 insertions(+), 3 deletions(-)  create mode
> 100644 Documentation/networking/devlink/ixd.rst
>  create mode 100644 drivers/net/ethernet/intel/ixd/ixd_devlink.c
>  create mode 100644 drivers/net/ethernet/intel/ixd/ixd_devlink.h
> 
> diff --git a/Documentation/networking/devlink/index.rst
> b/Documentation/networking/devlink/index.rst
> index 35b12a2bfeba..efd138d8e7d3 100644
> --- a/Documentation/networking/devlink/index.rst
> +++ b/Documentation/networking/devlink/index.rst
> @@ -87,6 +87,7 @@ parameters, info versions, and other features it
> supports.
>     ionic
>     iosm
>     ixgbe
> +   ixd
>     kvaser_pciefd
>     kvaser_usb
>     mlx4
> diff --git a/Documentation/networking/devlink/ixd.rst
> b/Documentation/networking/devlink/ixd.rst
> new file mode 100644
> index 000000000000..81b28ffb00f6
> --- /dev/null
> +++ b/Documentation/networking/devlink/ixd.rst
> @@ -0,0 +1,35 @@
> +.. SPDX-License-Identifier: GPL-2.0
> +
> +===================
> +ixd devlink support
> +===================
> +
> +This document describes the devlink features implemented by the
> ``ixd``
> +device driver.
> +
> +Info versions
> +=============
> +
> +The ``ixd`` driver reports the following versions
> +
> +.. list-table:: devlink info versions implemented
> +    :widths: 5 5 5 90
> +
> +    * - Name
> +      - Type
> +      - Example
> +      - Description
> +    * - ``device.type``
> +      - fixed
> +      - MEV
> +      - The hardware type for this device
> +    * - ``cp``
> +      - running
> +      - 0.0
> +      - Version number (major.minor) of the Control Plane software
> +        running on the device.
> +    * - ``virtchnl``
> +      - running
> +      - 2.0
> +      - 2-digit version number (major.minor) of the communication
> channel
> +        (virtchnl) used by the device.

...

> +++ b/drivers/net/ethernet/intel/ixd/ixd_devlink.c
> @@ -0,0 +1,105 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/* Copyright (c) 2025, Intel Corporation. */
> +
> +#include "ixd.h"
> +#include "ixd_devlink.h"
> +
> +#define IXD_DEVLINK_INFO_LEN 128
> +
> +/**
> + * ixd_fill_dsn - Get the serial number for the ixd device
> + * @adapter: adapter to query
> + * @buf: storage buffer for the info request  */ static void
> +ixd_fill_dsn(struct ixd_adapter *adapter, char *buf) {
> +     u8 dsn[8];
> +
> +     /* Copy the DSN into an array in Big Endian format */
> +     put_unaligned_be64(pci_get_dsn(adapter->cp_ctx.mmio_info.pdev),
> dsn);
> +
> +     snprintf(buf, IXD_DEVLINK_INFO_LEN, "%8phD", dsn); }
> +
Hardcoded buffer length.
Better pass len as a parameter.


> +/**
> + * ixd_fill_device_name - Get the name of the underlying hardware
> + * @adapter: adapter to query
> + * @buf: storage buffer for the info request
> + * @buf_size: size of the storage buffer  */ static void
> +ixd_fill_device_name(struct ixd_adapter *adapter, char *buf,
> +                              size_t buf_size)
> +{
> +     if (adapter->caps.device_type == VIRTCHNL2_MEV_DEVICE)
> +             snprintf(buf, buf_size, "%s", "MEV");
> +     else
> +             snprintf(buf, buf_size, "%s", "UNKNOWN"); }
> +
I'd recommend to use strscpy() for fixed strings instead of snprintf() with 
"%s".

...

> --
> 2.47.0

Reply via email to