Re: [PATCH v12 01/13] net/sxe: add base driver directory and doc

Stephen Hemminger
2025-10-25T18:34:00Z

The following patch may help you fix the driver and have it build on current 25.11-rc1 or later.

diff --git a/drivers/net/sxe/pf/sxe_queue.c b/drivers/net/sxe/pf/sxe_queue.c
index 75287defda..59447cc8af 100644
--- a/drivers/net/sxe/pf/sxe_queue.c
+++ b/drivers/net/sxe/pf/sxe_queue.c
@@ -676,7 +676,7 @@ s32 __rte_cold sxe_rx_queue_stop(struct rte_eth_dev *dev, u16 queue_id)
return 0;
}

-u32 sxe_rx_queue_count(void *rx_queue)
+s32 sxe_rx_queue_count(void *rx_queue)
{
volatile sxe_rx_data_desc_u *desc;
struct sxe_rx_queue *rxq;
diff --git a/drivers/net/sxe/pf/sxe_queue.h b/drivers/net/sxe/pf/sxe_queue.h
index 43d8d4d633..c60bc6b9c2 100644
--- a/drivers/net/sxe/pf/sxe_queue.h
+++ b/drivers/net/sxe/pf/sxe_queue.h
@@ -76,7 +76,7 @@ void sxe_rx_queue_init(bool rx_batch_alloc_allowed,

void sxe_rx_queue_free(sxe_rx_queue_s *rxq);

-u32 sxe_rx_queue_count(void *rx_queue);
+s32 sxe_rx_queue_count(void *rx_queue);

s32 sxe_mq_mode_check(struct rte_eth_dev *dev);

diff --git a/drivers/net/sxe/pf/sxe_stats.c b/drivers/net/sxe/pf/sxe_stats.c
index 34470eae64..dd3196b75d 100644
--- a/drivers/net/sxe/pf/sxe_stats.c
+++ b/drivers/net/sxe/pf/sxe_stats.c
@@ -93,8 +93,8 @@ u32 sxe_xstats_cnt_get(void)
}
#endif

-s32 sxe_eth_stats_get(struct rte_eth_dev *eth_dev,
- struct rte_eth_stats *stats)
+s32 sxe_eth_stats_get(struct rte_eth_dev *eth_dev, struct rte_eth_stats *stats,
+ struct eth_queue_stats *qstats)
{
struct sxe_adapter *adapter = eth_dev->data->dev_private;
struct sxe_stats_info *stats_info = &adapter->stats_info;
@@ -112,16 +112,17 @@ s32 sxe_eth_stats_get(struct rte_eth_dev *eth_dev,
goto l_out;
}

- for (i = 0; i < RTE_MIN_T(SXE_QUEUE_STAT_COUNT,
- RTE_ETHDEV_QUEUE_STAT_CNTRS, typeof(i)); i++) {
+ for (i = 0; i < SXE_QUEUE_STAT_COUNT; i++) {
rx_packets += stats_info->hw_stats.qprc[i];
rx_bytes += stats_info->hw_stats.qbrc[i];

- stats->q_ipackets[i] = stats_info->hw_stats.qprc[i];
- stats->q_opackets[i] = stats_info->hw_stats.qptc[i];
- stats->q_ibytes[i] = stats_info->hw_stats.qbrc[i];
- stats->q_obytes[i] = stats_info->hw_stats.qbtc[i];
- stats->q_errors[i] = stats_info->hw_stats.qprdc[i];
+ if (qstats && i < RTE_ETHDEV_QUEUE_STAT_CNTRS) {
+ qstats->q_ipackets[i] = stats_info->hw_stats.qprc[i];
+ qstats->q_opackets[i] = stats_info->hw_stats.qptc[i];
+ qstats->q_ibytes[i] = stats_info->hw_stats.qbrc[i];
+ qstats->q_obytes[i] = stats_info->hw_stats.qbtc[i];
+ qstats->q_errors[i] = stats_info->hw_stats.qprdc[i];
+ }
}

stats->ipackets = rx_packets;
@@ -278,7 +279,7 @@ s32 sxe_stats_reset(struct rte_eth_dev *eth_dev)
sxe_rx_queue_s *rxq;
u32 i;

- sxe_eth_stats_get(eth_dev, NULL);
+ sxe_eth_stats_get(eth_dev, NULL, NULL);
sxe_hw_stats_seq_clean(hw, &stats_info->hw_stats);

for (i = 0; i < eth_dev->data->nb_rx_queues; i++) {
diff --git a/drivers/net/sxe/pf/sxe_stats.h b/drivers/net/sxe/pf/sxe_stats.h
index 7c70761cd6..d84d93421c 100644
--- a/drivers/net/sxe/pf/sxe_stats.h
+++ b/drivers/net/sxe/pf/sxe_stats.h
@@ -7,6 +7,7 @@

#include <rte_ethdev.h>
#include <rte_ethdev_core.h>
+#include <ethdev_driver.h>
#include "sxe_hw.h"

#define SXE_STATS_FIELD_NAME_SIZE 50
@@ -31,8 +32,8 @@ struct sxe_stats_field {
u32 offset;
};

-s32 sxe_eth_stats_get(struct rte_eth_dev *eth_dev,
- struct rte_eth_stats *stats);
+s32 sxe_eth_stats_get(struct rte_eth_dev *eth_dev,struct rte_eth_stats *stats,
+ struct eth_queue_stats *qstats);

s32 sxe_stats_reset(struct rte_eth_dev *eth_dev);

diff --git a/drivers/net/sxe/vf/sxevf_stats.c b/drivers/net/sxe/vf/sxevf_stats.c
index 30ce9753dd..3b75126eb7 100644
--- a/drivers/net/sxe/vf/sxevf_stats.c
+++ b/drivers/net/sxe/vf/sxevf_stats.c
@@ -5,6 +5,7 @@
#if defined SXE_DPDK_L4_FEATURES && defined SXE_DPDK_SRIOV

#include <rte_ethdev.h>
+#include <ethdev_driver.h>

#include "sxevf_stats.h"
#include "sxe_logs.h"
@@ -25,8 +26,8 @@ static u32 sxevf_xstats_cnt_get(void)
}
#endif

-s32 sxevf_eth_stats_get(struct rte_eth_dev *eth_dev,
- struct rte_eth_stats *stats)
+s32 sxevf_eth_stats_get(struct rte_eth_dev *eth_dev, struct rte_eth_stats *stats,
+ struct eth_queue_stats *qstats __rte_unused)
{
struct sxevf_adapter *adapter = eth_dev->data->dev_private;
struct sxevf_stats_info *stats_info = &adapter->stats_info;
@@ -55,7 +56,7 @@ s32 sxevf_dev_stats_reset(struct rte_eth_dev *eth_dev)
struct sxevf_adapter *adapter = eth_dev->data->dev_private;
struct sxevf_stats_info *stats_info = &adapter->stats_info;

- sxevf_eth_stats_get(eth_dev, NULL);
+ sxevf_eth_stats_get(eth_dev, NULL, NULL);

stats_info->hw_stats.vfgprc = 0;
stats_info->hw_stats.vfgorc = 0;
diff --git a/drivers/net/sxe/vf/sxevf_stats.h b/drivers/net/sxe/vf/sxevf_stats.h
index ddf56c39df..7a6649577b 100644
--- a/drivers/net/sxe/vf/sxevf_stats.h
+++ b/drivers/net/sxe/vf/sxevf_stats.h
@@ -16,8 +16,8 @@ struct sxevf_stats_info {
struct sxevf_hw_stats hw_stats;
};

-s32 sxevf_eth_stats_get(struct rte_eth_dev *eth_dev,
- struct rte_eth_stats *stats);
+s32 sxevf_eth_stats_get(struct rte_eth_dev *eth_dev, struct rte_eth_stats *stats,
+ struct eth_queue_stats *qstats);

s32 sxevf_dev_stats_reset(struct rte_eth_dev *eth_dev);