DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Roger Melton (rmelton)" <rmelton@cisco.com>
To: Bruce Richardson <bruce.richardson@intel.com>
Cc: "vladimir.medvedkin@intel.com" <vladimir.medvedkin@intel.com>,
	"anatoly.burakov@intel.com" <anatoly.burakov@intel.com>,
	"dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [PATCH v3] net/ixgbe: support Rx/Tx burst mode info
Date: Mon, 28 Apr 2025 21:35:21 +0000	[thread overview]
Message-ID: <dc2452e9-6cff-422c-879a-777b147fbade@cisco.com> (raw)
In-Reply-To: <aA-ofe1zhRsrokcU@bricha3-mobl1.ger.corp.intel.com>


On 4/28/25 12:11 PM, Bruce Richardson wrote:
> On Wed, Apr 16, 2025 at 01:23:11PM -0400, Roger Melton wrote:
>> Return burst mode according to the selected Rx/Tx burst
>> function name.
>> Update 25.07 release notes with this information.
>>
>> Signed-off-by: Roger Melton <rmelton@cisco.com>
>> ---
> Generally looks good. Couple of nits/suggestions inline below. If you are
> happy with the suggestions I can change them on apply for you [otherwise
> please do a v4].
>
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>

v4 patch sent with your changes applied Bruce.

Thanks for the review.

-Roger

>
>
>>   doc/guides/rel_notes/release_25_07.rst        |  3 +
>>   drivers/net/intel/ixgbe/ixgbe_ethdev.c        |  4 ++
>>   drivers/net/intel/ixgbe/ixgbe_ethdev.h        |  4 ++
>>   drivers/net/intel/ixgbe/ixgbe_rxtx.c          | 70 +++++++++++++++++++
>>   drivers/net/intel/ixgbe/ixgbe_rxtx.h          |  4 ++
>>   .../net/intel/ixgbe/ixgbe_vf_representor.c    |  4 +-
>>   6 files changed, 87 insertions(+), 2 deletions(-)
>>
>> diff --git a/doc/guides/rel_notes/release_25_07.rst b/doc/guides/rel_notes/release_25_07.rst
>> index 093b85d206..30bc9622ee 100644
>> --- a/doc/guides/rel_notes/release_25_07.rst
>> +++ b/doc/guides/rel_notes/release_25_07.rst
>> @@ -55,6 +55,9 @@ New Features
>>        Also, make sure to start the actual text at the margin.
>>        =======================================================
>>   
>> +* **Updated Intel ixgbe driver.**
>> +
>> +  * Added support for rx_burst_mode_get and tx_burst_mode_get.
>>   
>>   Removed Items
>>   -------------
>> diff --git a/drivers/net/intel/ixgbe/ixgbe_ethdev.c b/drivers/net/intel/ixgbe/ixgbe_ethdev.c
>> index 0fa4898aba..f1fd271a0a 100644
>> --- a/drivers/net/intel/ixgbe/ixgbe_ethdev.c
>> +++ b/drivers/net/intel/ixgbe/ixgbe_ethdev.c
>> @@ -532,6 +532,8 @@ static const struct eth_dev_ops ixgbe_eth_dev_ops = {
>>   	.rx_queue_release     = ixgbe_dev_rx_queue_release,
>>   	.tx_queue_setup       = ixgbe_dev_tx_queue_setup,
>>   	.tx_queue_release     = ixgbe_dev_tx_queue_release,
>> +	.rx_burst_mode_get    = ixgbe_rx_burst_mode_get,
>> +	.tx_burst_mode_get    = ixgbe_tx_burst_mode_get,
>>   	.dev_led_on           = ixgbe_dev_led_on,
>>   	.dev_led_off          = ixgbe_dev_led_off,
>>   	.flow_ctrl_get        = ixgbe_flow_ctrl_get,
>> @@ -605,6 +607,8 @@ static const struct eth_dev_ops ixgbevf_eth_dev_ops = {
>>   	.tx_queue_release     = ixgbe_dev_tx_queue_release,
>>   	.rx_queue_intr_enable = ixgbevf_dev_rx_queue_intr_enable,
>>   	.rx_queue_intr_disable = ixgbevf_dev_rx_queue_intr_disable,
>> +	.rx_burst_mode_get    = ixgbe_rx_burst_mode_get,
>> +	.tx_burst_mode_get    = ixgbe_tx_burst_mode_get,
>>   	.mac_addr_add         = ixgbevf_add_mac_addr,
>>   	.mac_addr_remove      = ixgbevf_remove_mac_addr,
>>   	.set_mc_addr_list     = ixgbe_dev_set_mc_addr_list,
>> diff --git a/drivers/net/intel/ixgbe/ixgbe_ethdev.h b/drivers/net/intel/ixgbe/ixgbe_ethdev.h
>> index 8ad841ea2c..7b1cfe0ea4 100644
>> --- a/drivers/net/intel/ixgbe/ixgbe_ethdev.h
>> +++ b/drivers/net/intel/ixgbe/ixgbe_ethdev.h
>> @@ -523,6 +523,10 @@ struct ixgbe_vf_representor {
>>   
>>   int ixgbe_vf_representor_init(struct rte_eth_dev *ethdev, void *init_params);
>>   int ixgbe_vf_representor_uninit(struct rte_eth_dev *ethdev);
>> +uint16_t ixgbe_vf_representor_rx_burst(__rte_unused void *rx_queue,
>> +	__rte_unused struct rte_mbuf **rx_pkts, __rte_unused uint16_t nb_pkts);
>> +uint16_t ixgbe_vf_representor_tx_burst(__rte_unused void *tx_queue,
>> +	__rte_unused struct rte_mbuf **tx_pkts, __rte_unused uint16_t nb_pkts);
>>   
> The __rte_unused should not be necessary in the header file definition, its
> use in the C file is enough. Removing the unused attributes allows these
> prototypes to all fit on one line, as they are exactly 100 characters.
>
>>   #define IXGBE_DEV_FDIR_CONF(dev) \
>>   	(&((struct ixgbe_adapter *)(dev)->data->dev_private)->fdir_conf)
>> diff --git a/drivers/net/intel/ixgbe/ixgbe_rxtx.c b/drivers/net/intel/ixgbe/ixgbe_rxtx.c
>> index 77773d56ef..209dbe6685 100644
>> --- a/drivers/net/intel/ixgbe/ixgbe_rxtx.c
>> +++ b/drivers/net/intel/ixgbe/ixgbe_rxtx.c
>> @@ -2626,6 +2626,39 @@ static const struct ixgbe_txq_ops def_txq_ops = {
>>   	.reset = ixgbe_reset_tx_queue,
>>   };
>>   
>> +static const struct {
>> +	eth_tx_burst_t pkt_burst;
>> +	const char *info;
>> +} ixgbe_tx_burst_info[] = {
>> +	{	ixgbe_xmit_pkts, "Scalar"},
>> +	{	ixgbe_xmit_pkts_simple, "Scalar simple"},
>> +	{       ixgbe_vf_representor_tx_burst, "Scalar representor"},
>> +#ifdef RTE_ARCH_X86
>> +	{	ixgbe_xmit_pkts_vec, "Vector SSE"},
>> +#elif defined(RTE_ARCH_ARM)
>> +	{	ixgbe_xmit_pkts_vec, "Vector NEON"},
>> +#endif
>> +};
>> +
>> +int
>> +ixgbe_tx_burst_mode_get(struct rte_eth_dev *dev,
>> +				__rte_unused uint16_t queue_id,
>> +				struct rte_eth_burst_mode *mode)
>> +{
>> +	eth_tx_burst_t pkt_burst = dev->tx_pkt_burst;
>> +	size_t i;
>> +
>> +	for (i = 0; i < RTE_DIM(ixgbe_tx_burst_info); i++) {
>> +		if (pkt_burst == ixgbe_tx_burst_info[i].pkt_burst) {
>> +			snprintf(mode->info, sizeof(mode->info), "%s",
>> +				 ixgbe_tx_burst_info[i].info);
>> +			return 0;
>> +		}
>> +	}
>> +
>> +	return -EINVAL;
>> +}
>> +
>>   /* Takes an ethdev and a queue and sets up the tx function to be used based on
>>    * the queue parameters. Used in tx_queue_setup by primary process and then
>>    * in dev_init by secondary process when attaching to an existing ethdev.
>> @@ -4939,6 +4972,43 @@ ixgbe_set_ivar(struct rte_eth_dev *dev, u8 entry, u8 vector, s8 type)
>>   	}
>>   }
>>   
>> +static const struct {
>> +	eth_rx_burst_t pkt_burst;
>> +	const char *info;
>> +} ixgbe_rx_burst_info[] = {
>> +	{	ixgbe_recv_pkts, "Scalar"},
>> +	{	ixgbe_recv_pkts_bulk_alloc, "Scalar bulk allod"},
> typo: s/allod/alloc/
>
>> +	{	ixgbe_recv_pkts_lro_bulk_alloc, "Scalar LRO bulk alloc"},
>> +	{	ixgbe_recv_pkts_lro_single_alloc, "Scalar LRO single alloc"},
>> +	{       ixgbe_vf_representor_rx_burst, "Scalar representor"},
>> +#ifdef RTE_ARCH_X86
>> +	{	ixgbe_recv_pkts_vec, "Vector SSE"},
>> +	{	ixgbe_recv_scattered_pkts_vec, "Vector SSE scattered"},
>> +#elif defined(RTE_ARCH_ARM)
>> +	{	ixgbe_recv_pkts_vec, "Vector NEON"},
>> +	{	ixgbe_recv_scattered_pkts_vec, "Vector NEON scattered"},
>> +#endif
>> +};
>> +
>> +int
>> +ixgbe_rx_burst_mode_get(struct rte_eth_dev *dev,
>> +				__rte_unused uint16_t queue_id,
>> +				struct rte_eth_burst_mode *mode)
>> +{
>> +	eth_tx_burst_t pkt_burst = dev->rx_pkt_burst;
>> +	size_t i;
>> +
>> +	for (i = 0; i < RTE_DIM(ixgbe_rx_burst_info); i++) {
>> +		if (pkt_burst == ixgbe_rx_burst_info[i].pkt_burst) {
>> +			snprintf(mode->info, sizeof(mode->info), "%s",
>> +				 ixgbe_rx_burst_info[i].info);
>> +			return 0;
>> +		}
>> +	}
>> +
>> +	return -EINVAL;
>> +}
>> +
>>   void __rte_cold
>>   ixgbe_set_rx_function(struct rte_eth_dev *dev)
>>   {
>> diff --git a/drivers/net/intel/ixgbe/ixgbe_rxtx.h b/drivers/net/intel/ixgbe/ixgbe_rxtx.h
>> index 54569c7ade..3487073d30 100644
>> --- a/drivers/net/intel/ixgbe/ixgbe_rxtx.h
>> +++ b/drivers/net/intel/ixgbe/ixgbe_rxtx.h
>> @@ -204,6 +204,8 @@ struct ixgbe_txq_ops {
>>    * in dev_init by secondary process when attaching to an existing ethdev.
>>    */
>>   void ixgbe_set_tx_function(struct rte_eth_dev *dev, struct ci_tx_queue *txq);
>> +int ixgbe_tx_burst_mode_get(struct rte_eth_dev *dev,
>> +		__rte_unused uint16_t queue_id, struct rte_eth_burst_mode *mode);
>>   
>>   /**
>>    * Sets the rx_pkt_burst callback in the ixgbe rte_eth_dev instance.
>> @@ -220,6 +222,8 @@ void ixgbe_set_tx_function(struct rte_eth_dev *dev, struct ci_tx_queue *txq);
>>    * @dev rte_eth_dev handle
>>    */
>>   void ixgbe_set_rx_function(struct rte_eth_dev *dev);
>> +int ixgbe_rx_burst_mode_get(struct rte_eth_dev *dev,
>> +		__rte_unused uint16_t queue_id, struct rte_eth_burst_mode *mode);
>>   
> __rte_unused does not need to be used in these prototypes either. Sadly,
> however, it does not lead to shortening of the prototype to a single line
> in this case. :-(
>
>>   int ixgbe_check_supported_loopback_mode(struct rte_eth_dev *dev);
>>   uint16_t ixgbe_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts,
>> diff --git a/drivers/net/intel/ixgbe/ixgbe_vf_representor.c b/drivers/net/intel/ixgbe/ixgbe_vf_representor.c
>> index bd528ff346..901d80e406 100644
>> --- a/drivers/net/intel/ixgbe/ixgbe_vf_representor.c
>> +++ b/drivers/net/intel/ixgbe/ixgbe_vf_representor.c
>> @@ -157,14 +157,14 @@ static const struct eth_dev_ops ixgbe_vf_representor_dev_ops = {
>>   	.mac_addr_set		= ixgbe_vf_representor_mac_addr_set,
>>   };
>>   
>> -static uint16_t
>> +uint16_t
>>   ixgbe_vf_representor_rx_burst(__rte_unused void *rx_queue,
>>   	__rte_unused struct rte_mbuf **rx_pkts, __rte_unused uint16_t nb_pkts)
>>   {
>>   	return 0;
>>   }
>>   
>> -static uint16_t
>> +uint16_t
>>   ixgbe_vf_representor_tx_burst(__rte_unused void *tx_queue,
>>   	__rte_unused struct rte_mbuf **tx_pkts, __rte_unused uint16_t nb_pkts)
>>   {
>> -- 
>> 2.35.6
>>


  reply	other threads:[~2025-04-28 21:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-16 17:11 [PATCH v2] " Roger Melton
2025-04-16 17:23 ` [PATCH v3] " Roger Melton
2025-04-28 16:10   ` Bruce Richardson
2025-04-28 21:35     ` Roger Melton (rmelton) [this message]
2025-04-28 21:29   ` [PATCH v4] " Roger Melton

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=dc2452e9-6cff-422c-879a-777b147fbade@cisco.com \
    --to=rmelton@cisco.com \
    --cc=anatoly.burakov@intel.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --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;
as well as URLs for NNTP newsgroup(s).