DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Burakov, Anatoly" <anatoly.burakov@intel.com>
To: "Medvedkin, Vladimir" <vladimir.medvedkin@intel.com>,
	<dev@dpdk.org>, Bruce Richardson <bruce.richardson@intel.com>,
	Kevin Liu <kevinx.liu@intel.com>, Qi Zhang <qi.z.zhang@intel.com>
Subject: Re: [PATCH v2 3/3] net/ice: do not include private headers in testpmd
Date: Thu, 15 Oct 2026 17:00:38 +0200	[thread overview]
Message-ID: <ef450e1d-34ca-4876-b94c-6a3dcd885f19@intel.com> (raw)
In-Reply-To: <46e98c80-f44a-4c69-93fb-050ccc864c4b@intel.com>

On 10/15/2026 4:52 PM, Medvedkin, Vladimir wrote:
> Hi Anatoly,
> 
> One nit: the buffer must be allocated with malloc, could you please 
> reflect this information in doxygen comments?

@Bruce

Perhaps this can be fixed on apply?

diff --git a/drivers/net/intel/ice/rte_pmd_ice.h 
b/drivers/net/intel/ice/rte_pmd_ice.h
index dccfdcd5f4..881dc4cc56 100644
--- a/drivers/net/intel/ice/rte_pmd_ice.h
+++ b/drivers/net/intel/ice/rte_pmd_ice.h
@@ -27,8 +27,9 @@ extern "C" {
   * @param port
   *   The port identifier of the Ethernet device.
   * @param buff
- *   Pointer to an allocated buffer. On success, it may be replaced by a
- *   newly allocated buffer; the caller must free the resulting buffer.
+ *   Pointer to a `malloc()`-allocated buffer. On success, it will be 
freed by
+ *   `free()` and replaced by a newly `malloc()`-allocated buffer; the 
caller
+ *   must free the resulting buffer.
   * @param size
   *   Input buffer size in bytes; receives the size of the dump on success.
   * @return


> 
> Apart from this,
> 
> Acked-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
> 
> On 10/15/2026 3:21 PM, Anatoly Burakov wrote:
>> Currently, the `ice_testpmd.c` file includes headers that are only
>> available to driver itself, but should not be available to applications,
>> including testpmd. Instead, testpmd should access them through public PMD
>> specific API.
>>
>> The ice driver does not have one (even though it offers a testpmd 
>> file), so
>> add the public PMD-specific API header, move all function definitions
>> into that file, and get rid of driver-private includes in testpmd file.
>>
>> Fixes: df539aaf35cb ("net/ice: refactor flex descriptor protocol field 
>> extraction")
>> Cc: stable@dpdk.org
>>
>> Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
>> ---
>>   doc/guides/nics/ice.rst                |  3 +
>>   doc/guides/rel_notes/release_26_11.rst |  2 +
>>   drivers/net/intel/ice/ice_diagnose.c   |  1 +
>>   drivers/net/intel/ice/ice_ethdev.h     |  9 ---
>>   drivers/net/intel/ice/ice_testpmd.c    |  7 ++-
>>   drivers/net/intel/ice/meson.build      |  1 +
>>   drivers/net/intel/ice/rte_pmd_ice.h    | 76 ++++++++++++++++++++++++++
>>   7 files changed, 88 insertions(+), 11 deletions(-)
>>   create mode 100644 drivers/net/intel/ice/rte_pmd_ice.h
>>
>> diff --git a/doc/guides/nics/ice.rst b/doc/guides/nics/ice.rst
>> index ba598742c5..e4dd87649b 100644
>> --- a/doc/guides/nics/ice.rst
>> +++ b/doc/guides/nics/ice.rst
>> @@ -1021,6 +1021,9 @@ To start ``testpmd``, and add vlan 10 to port 0:
>>   Diagnostic Utilities
>>   --------------------
>> +The diagnostic dump functions are also available to applications through
>> +the public ``rte_pmd_ice.h`` header.
>> +
>>   Dump DDP Package
>>   ~~~~~~~~~~~~~~~~
>> diff --git a/doc/guides/rel_notes/release_26_11.rst b/doc/guides/ 
>> rel_notes/release_26_11.rst
>> index a4f44e5ebd..f3c820a72a 100644
>> --- a/doc/guides/rel_notes/release_26_11.rst
>> +++ b/doc/guides/rel_notes/release_26_11.rst
>> @@ -118,6 +118,8 @@ New Features
>>       enabling QinQ tag insertion and outer IPv4/UDP checksum offloads 
>> on those paths.
>>     * Added support for getting and setting link (802.3x) flow control.
>>     * Added support for Tx rate limiting per queue.
>> +  * Made the existing diagnostic dump functions available through
>> +    the public ``rte_pmd_ice.h`` header.
>>   * **Updated Intel ixgbe driver.**
>> diff --git a/drivers/net/intel/ice/ice_diagnose.c b/drivers/net/intel/ 
>> ice/ice_diagnose.c
>> index 4946ace7ae..ecfcdf5559 100644
>> --- a/drivers/net/intel/ice/ice_diagnose.c
>> +++ b/drivers/net/intel/ice/ice_diagnose.c
>> @@ -13,6 +13,7 @@
>>   #include "ice_ethdev.h"
>>   #include "ice_rxtx.h"
>> +#include "rte_pmd_ice.h"
>>   #define ICE_BLK_MAX_COUNT          512
>>   #define ICE_BUFF_SEG_HEADER_FLAG   0x1
>> diff --git a/drivers/net/intel/ice/ice_ethdev.h b/drivers/net/intel/ 
>> ice/ice_ethdev.h
>> index 8d5e17e2df..08c2b61519 100644
>> --- a/drivers/net/intel/ice/ice_ethdev.h
>> +++ b/drivers/net/intel/ice/ice_ethdev.h
>> @@ -821,15 +821,6 @@ ice_align_floor(int n)
>>       ((phy_type) & ICE_PHY_TYPE_HIGH_200G_AUI8_AOC_ACC) || \
>>       ((phy_type) & ICE_PHY_TYPE_HIGH_200G_AUI8))
>> -__rte_experimental
>> -int rte_pmd_ice_dump_package(uint16_t port, uint8_t **buff, uint32_t 
>> *size);
>> -
>> -__rte_experimental
>> -int rte_pmd_ice_dump_switch(uint16_t port, uint8_t **buff, uint32_t 
>> *size);
>> -
>> -__rte_experimental
>> -int rte_pmd_ice_dump_txsched(uint16_t port, bool detail, FILE *stream);
>> -
>>   int
>>   ice_tm_setup_txq_node(struct ice_pf *pf, struct ice_hw *hw, uint16_t 
>> qid, uint32_t node_teid);
>> diff --git a/drivers/net/intel/ice/ice_testpmd.c b/drivers/net/intel/ 
>> ice/ice_testpmd.c
>> index 98c02d68c6..0c135d79a3 100644
>> --- a/drivers/net/intel/ice/ice_testpmd.c
>> +++ b/drivers/net/intel/ice/ice_testpmd.c
>> @@ -2,14 +2,17 @@
>>    * Copyright(c) 2022 Intel Corporation.
>>    */
>> -#include <stdlib.h>
>> +#include <errno.h>
>>   #include <stdio.h>
>> +#include <stdlib.h>
>> +#include <string.h>
>> +
>> +#include <rte_pmd_ice.h>
>>   #include <cmdline_parse_num.h>
>>   #include <cmdline_parse_string.h>
>>   #include "testpmd.h"
>> -#include "ice_ethdev.h"
>>   /* Fixed size for ICE ddp runtime configure */
>>   #define ICE_BUFF_SIZE    0x000c9000
>> diff --git a/drivers/net/intel/ice/meson.build b/drivers/net/intel/ 
>> ice/meson.build
>> index 322d9597d2..00077be30a 100644
>> --- a/drivers/net/intel/ice/meson.build
>> +++ b/drivers/net/intel/ice/meson.build
>> @@ -19,6 +19,7 @@ sources = files(
>>   )
>>   testpmd_sources = files('ice_testpmd.c')
>> +headers = files('rte_pmd_ice.h')
>>   deps += ['hash', 'net']
>> diff --git a/drivers/net/intel/ice/rte_pmd_ice.h b/drivers/net/intel/ 
>> ice/rte_pmd_ice.h
>> new file mode 100644
>> index 0000000000..dccfdcd5f4
>> --- /dev/null
>> +++ b/drivers/net/intel/ice/rte_pmd_ice.h
>> @@ -0,0 +1,76 @@
>> +/* SPDX-License-Identifier: BSD-3-Clause
>> + * Copyright(c) 2026 Intel Corporation
>> + */
>> +
>> +#ifndef _RTE_PMD_ICE_H_
>> +#define _RTE_PMD_ICE_H_
>> +
>> +/**
>> + * @file rte_pmd_ice.h
>> + *
>> + * ICE PMD specific diagnostic functions.
>> + */
>> +
>> +#include <stdbool.h>
>> +#include <stdint.h>
>> +#include <stdio.h>
>> +
>> +#include <rte_compat.h>
>> +
>> +#ifdef __cplusplus
>> +extern "C" {
>> +#endif
>> +
>> +/**
>> + * Dump the runtime DDP package configuration.
>> + *
>> + * @param port
>> + *   The port identifier of the Ethernet device.
>> + * @param buff
>> + *   Pointer to an allocated buffer. On success, it may be replaced by a
>> + *   newly allocated buffer; the caller must free the resulting buffer.
>> + * @param size
>> + *   Input buffer size in bytes; receives the size of the dump on 
>> success.
>> + * @return
>> + *   0 on success, -ENODEV for an invalid port, -ENOTSUP for a non- 
>> ICE port,
>> + *   or a negative error code on failure.
>> + */
>> +__rte_experimental
>> +int rte_pmd_ice_dump_package(uint16_t port, uint8_t **buff, uint32_t 
>> *size);
>> +
>> +/**
>> + * Dump the runtime switch configuration.
>> + *
>> + * @param port
>> + *   The port identifier of the Ethernet device.
>> + * @param buff
>> + *   Pointer to a caller-allocated output buffer.
>> + * @param size
>> + *   Input buffer size in bytes; receives the size of the dump on 
>> success.
>> + * @return
>> + *   0 on success, -ENODEV for an invalid port, -ENOTSUP for a non- 
>> ICE port,
>> + *   or a negative error code on failure.
>> + */
>> +__rte_experimental
>> +int rte_pmd_ice_dump_switch(uint16_t port, uint8_t **buff, uint32_t 
>> *size);
>> +
>> +/**
>> + * Dump the Tx scheduling tree to a stream in DOT format.
>> + *
>> + * @param port
>> + *   The port identifier of the Ethernet device.
>> + * @param detail
>> + *   Include node configuration parameters when true.
>> + * @param stream
>> + *   Output stream opened by the caller.
>> + * @return
>> + *   0 on success, -ENODEV for an invalid port, or -ENOTSUP for a 
>> non-ICE port.
>> + */
>> +__rte_experimental
>> +int rte_pmd_ice_dump_txsched(uint16_t port, bool detail, FILE *stream);
>> +
>> +#ifdef __cplusplus
>> +}
>> +#endif
>> +
>> +#endif /* _RTE_PMD_ICE_H_ */
> 


-- 
Thanks,
Anatoly

  reply	other threads:[~2026-10-15 15:00 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-14 20:34 [PATCH] net/ixgbe: avoid private driver include in testpmd Thomas Monjalon
2026-10-15  8:53 ` Burakov, Anatoly
2026-10-15  9:13   ` Thomas Monjalon
2026-10-15 10:41     ` Burakov, Anatoly
2026-10-15 11:18       ` David Marchand
2026-10-15 11:21         ` Burakov, Anatoly
2026-10-15 11:50           ` Thomas Monjalon
2026-10-15 14:01             ` Burakov, Anatoly
2026-10-15 14:21 ` [PATCH v2 1/3] " Anatoly Burakov
2026-10-15 14:21   ` [PATCH v2 2/3] net/iavf: do not include private headers " Anatoly Burakov
2026-10-15 14:33     ` Bruce Richardson
2026-10-15 14:45     ` Medvedkin, Vladimir
2026-10-15 14:21   ` [PATCH v2 3/3] net/ice: " Anatoly Burakov
2026-10-15 14:36     ` Bruce Richardson
2026-10-15 14:39       ` Bruce Richardson
2026-10-15 14:52     ` Medvedkin, Vladimir
2026-10-15 15:00       ` Burakov, Anatoly [this message]
2026-10-15 15:21         ` Bruce Richardson
2026-10-15 15:29           ` Burakov, Anatoly
2026-10-15 14:44   ` [PATCH v2 1/3] net/ixgbe: avoid private driver include " Medvedkin, Vladimir

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=ef450e1d-34ca-4876-b94c-6a3dcd885f19@intel.com \
    --to=anatoly.burakov@intel.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=kevinx.liu@intel.com \
    --cc=qi.z.zhang@intel.com \
    --cc=vladimir.medvedkin@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