Skip to contentSkip to conversation

net/bnxt: fix variable size of port id

PATCH Superseded Chenbo Xia 7 participants 15 messages Aug 4, 2020 – Sep 30, 2020 Network drivers

lore
Share & tools
lore

Chenbo Xia

author
#0 lore raw

PATCH 1/1 net/bnxt: fix variable size of port id

Currenly the variable size of ethdev port id is 8 bits. This patch standarizes it to 16 bits.

Fixes 769de16872ab ("net/bnxt: fix port default rule create/destroy")
---
 drivers/net/bnxt/tf_ulp/ulp_def_rules.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/bnxt/tf_ulp/ulp_def_rules.c +1 -1
index 9fb1a028f..ff5aed3d7 100644
@@ -397,7 +397,7 @@ void
 bnxt_ulp_destroy_df_rules(struct bnxt *bp, bool global)
 {
 	struct bnxt_ulp_df_rule_info *info;
-	uint8_t port_id;
+	uint16_t port_id;
 
 	if (!BNXT_TRUFLOW_EN(bp) ||
 	    BNXT_ETH_DEV_IS_REPRESENTOR(bp->eth_dev))
Signature · 1 line
2.17.1
Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · On Tue, 4 Aug 2020 17:41:47 +0000 Chenbo Xia <[email protected]> wrote:

Currenly the variable size of ethdev port id is 8 bits. This patch standarizes it to 16 bits.

Fixes 769de16872ab ("net/bnxt: fix port default rule create/destroy")

---

	    BNXT_ETH_DEV_IS_REPRESENTOR(bp->eth_dev))
#2 lore raw
In reply to Chenbo Xia

04/08/2020 19:41, Chenbo Xia:

Quoted 17 lines

Currenly the variable size of ethdev port id is 8 bits. This patch standarizes it to 16 bits.

Fixes 769de16872ab ("net/bnxt: fix port default rule create/destroy")
---
 drivers/net/bnxt/tf_ulp/ulp_def_rules.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/bnxt/tf_ulp/ulp_def_rules.c +0 -0
index 9fb1a028f..ff5aed3d7 100644

drivers/net/bnxt/tf_ulp/ulp_def_rules.c void · line 400

Quoted 5 lines
drivers/net/bnxt/tf_ulp/ulp_def_rules.c +1 -1
@@ -397,7 +397,7 @@ void
 bnxt_ulp_destroy_df_rules(struct bnxt *bp, bool global)
 {
 	struct bnxt_ulp_df_rule_info *info;
-	uint8_t port_id;
+	uint16_t port_id;

There are more occurences in bnxt, introduced by the same patch.

In general, in other drivers, it would be good to make this clean-up.

	git grep 'uint8_t port' | wc -l
	297
#3 lore raw

Hi Thomas,

Quoted 36 lines

-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Thursday, August 6, 2020 4:18 AM
To: Xia, Chenbo <[email protected]>; Wang, Yinan <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [dpdk-dev] [PATCH] net/bnxt: fix variable size of port id

04/08/2020 19:41, Chenbo Xia:

Quoted 6 lines

Currenly the variable size of ethdev port id is 8 bits. This patch standarizes it to 16 bits.

Fixes 769de16872ab ("net/bnxt: fix port default rule create/destroy")

Review

Quoted 7 lines
---
 drivers/net/bnxt/tf_ulp/ulp_def_rules.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
(quoted diff) +0 -0

b/drivers/net/bnxt/tf_ulp/ulp_def_rules.c

drivers/net/bnxt/tf_ulp/ulp_def_rules.c void · line 400

Quoted 9 lines

index 9fb1a028f..ff5aed3d7 100644

drivers/net/bnxt/tf_ulp/ulp_def_rules.c +1 -1
@@ -397,7 +397,7 @@ void
 bnxt_ulp_destroy_df_rules(struct bnxt *bp, bool global)
 {
 	struct bnxt_ulp_df_rule_info *info;
-	uint8_t port_id;
+	uint16_t port_id;

There are more occurences in bnxt, introduced by the same patch.

Quoted 1 line

In general, in other drivers, it would be good to make this clean-up.

Sure, I could do the clean-up. Btw, only net drivers, right?

Quoted 3 lines
	git grep 'uint8_t port' | wc -l
	297
#4 lore raw

06/08/2020 04:03, Xia, Chenbo:

Quoted 30 lines

Hi Thomas,

From: Thomas Monjalon <[email protected]>

Quoted 27 lines

04/08/2020 19:41, Chenbo Xia:

Quoted 6 lines

Currenly the variable size of ethdev port id is 8 bits. This patch standarizes it to 16 bits.

Fixes 769de16872ab ("net/bnxt: fix port default rule create/destroy")

Review

Quoted 7 lines
---
 drivers/net/bnxt/tf_ulp/ulp_def_rules.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
(quoted diff) +0 -0

b/drivers/net/bnxt/tf_ulp/ulp_def_rules.c

drivers/net/bnxt/tf_ulp/ulp_def_rules.c void · line 400

Quoted 9 lines

index 9fb1a028f..ff5aed3d7 100644

drivers/net/bnxt/tf_ulp/ulp_def_rules.c +1 -1
@@ -397,7 +397,7 @@ void
 bnxt_ulp_destroy_df_rules(struct bnxt *bp, bool global)
 {
 	struct bnxt_ulp_df_rule_info *info;
-	uint8_t port_id;
+	uint16_t port_id;

There are more occurences in bnxt, introduced by the same patch.

Quoted 3 lines
Quoted 1 line

In general, in other drivers, it would be good to make this clean-up.

Sure, I could do the clean-up. Btw, only net drivers, right?

ethdev drivers and applications referencing a port id should use uint16_t, yes.

Tested-by on v1 1/1
#5 lore raw
In reply to Chenbo Xia

Regards,
Xiao Qimai

Quoted 36 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Chenbo Xia
Sent: Wednesday, August 5, 2020 1:42 AM
To: [email protected]
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: [dpdk-dev] [PATCH] net/bnxt: fix variable size of port id

Currenly the variable size of ethdev port id is 8 bits. This patch standarizes it to 16 bits.

Fixes 769de16872ab ("net/bnxt: fix port default rule create/destroy")
---
 drivers/net/bnxt/tf_ulp/ulp_def_rules.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/bnxt/tf_ulp/ulp_def_rules.c +1 -2
index 9fb1a028f..ff5aed3d7 100644
@@ -397,7 +397,7 @@ void
 bnxt_ulp_destroy_df_rules(struct bnxt *bp, bool global)  {
 	struct bnxt_ulp_df_rule_info *info;
-	uint8_t port_id;
+	uint16_t port_id;
 
 	if (!BNXT_TRUFLOW_EN(bp) ||
 	    BNXT_ETH_DEV_IS_REPRESENTOR(bp->eth_dev))
--

2.17.1

author
#6 lore raw

PATCH v2 1/3 net: fix variable size of ethdev port id

In reply to Chenbo Xia

The ethdev port id should be 16 bits now. This patch changes the variable size of port id in some net drivers from 8 bits to 16 bits.

Fixes cf18d4def295 ("net/ark: provide API for hardware modules UDM and DDM")
Fixes 09b23f8b9df6 ("net/bnxt: fix port stop process and cleanup resources")
Fixes 769de16872ab ("net/bnxt: fix port default rule create/destroy")
Fixes 50370662b727 ("net/ice: support device and queue ops")
Fixes a50d7cbbdad7 ("net/qede: support registers dump")
---
 drivers/net/ark/ark_udm.h               | 2 +-
 drivers/net/bnxt/tf_ulp/bnxt_ulp.c      | 2 +-
 drivers/net/bnxt/tf_ulp/ulp_def_rules.c | 6 +++---
 drivers/net/ice/ice_rxtx.h              | 4 ++--
 drivers/net/qede/base/bcm_osal.h        | 2 +-
 drivers/net/qede/qede_regs.c            | 2 +-
 6 files changed, 9 insertions(+), 9 deletions(-)
drivers/net/ark/ark_udm.h +1 -1
index 5846c825b..32eb82faa 100644
@@ -19,7 +19,7 @@
 struct ark_rx_meta {
 	uint64_t timestamp;
 	uint64_t user_data;
-	uint8_t port;
+	uint16_t port;
 	uint8_t dst_queue;
 	uint16_t pkt_len;
 };
drivers/net/bnxt/tf_ulp/bnxt_ulp.c +1 -1
index e8927f629..3d148029e 100644
@@ -646,7 +646,7 @@ static void
 bnxt_ulp_destroy_vfr_default_rules(struct bnxt *bp, bool global)
 {
 	struct bnxt_ulp_vfr_rule_info *info;
-	uint8_t port_id;
+	uint16_t port_id;
 	struct rte_eth_dev *vfr_eth_dev;
 	struct bnxt_vf_representor *vfr_bp;
 
drivers/net/bnxt/tf_ulp/ulp_def_rules.c +3 -3
index 2d0c3bccc..fdd2692f6 100644
@@ -402,7 +402,7 @@ void
 bnxt_ulp_destroy_df_rules(struct bnxt *bp, bool global)
 {
 	struct bnxt_ulp_df_rule_info *info;
-	uint8_t port_id;
+	uint16_t port_id;
 
 	if (!BNXT_TRUFLOW_EN(bp) ||
 	    BNXT_ETH_DEV_IS_REPRESENTOR(bp->eth_dev))
@@ -466,7 +466,7 @@ int32_t
 bnxt_ulp_create_df_rules(struct bnxt *bp)
 {
 	struct bnxt_ulp_df_rule_info *info;
-	uint8_t port_id;
+	uint16_t port_id;
 	int rc;
 
 	if (!BNXT_TRUFLOW_EN(bp) ||
@@ -540,7 +540,7 @@ bnxt_ulp_create_vfr_default_rules(struct rte_eth_dev *vfr_ethdev)
 	struct rte_eth_dev *parent_dev = vfr->parent_dev;
 	struct bnxt *bp = parent_dev->data->dev_private;
 	uint16_t vfr_port_id = vfr_ethdev->data->port_id;
-	uint8_t port_id;
+	uint16_t port_id;
 	int rc;
 
 	if (!bp || !BNXT_TRUFLOW_EN(bp))
drivers/net/ice/ice_rxtx.h +2 -2
index 9fa57b3b2..e4309b8b9 100644
@@ -68,7 +68,7 @@ struct ice_rx_queue {
 	uint16_t rxrearm_start;	/**< the idx we start the re-arming from */
 	uint64_t mbuf_initializer; /**< value to init mbufs */
 
-	uint8_t port_id; /* device port ID */
+	uint16_t port_id; /* device port ID */
 	uint8_t crc_len; /* 0 if CRC stripped, 4 otherwise */
 	uint8_t fdir_enabled; /* 0 if FDIR disabled, 1 when enabled */
 	uint16_t queue_id; /* RX queue index */
@@ -112,7 +112,7 @@ struct ice_tx_queue {
 	uint8_t pthresh; /**< Prefetch threshold register. */
 	uint8_t hthresh; /**< Host threshold register. */
 	uint8_t wthresh; /**< Write-back threshold reg. */
-	uint8_t port_id; /* Device port identifier. */
+	uint16_t port_id; /* Device port identifier. */
 	uint16_t queue_id; /* TX queue index. */
 	uint32_t q_teid; /* TX schedule node id. */
 	uint16_t reg_idx;
drivers/net/qede/base/bcm_osal.h +1 -1
index 5d4df5907..814000039 100644
@@ -372,7 +372,7 @@ void qede_hw_err_notify(struct ecore_hwfn *p_hwfn,
 /* TODO: */
 #define OSAL_SCHEDULE_RECOVERY_HANDLER(hwfn) nothing
 
-int qede_save_fw_dump(uint8_t port_id);
+int qede_save_fw_dump(uint16_t port_id);
 
 #define OSAL_SAVE_FW_DUMP(port_id) qede_save_fw_dump(port_id)
 
drivers/net/qede/qede_regs.c +1 -1
index 1f2dbc6e7..d2ea1c910 100644
@@ -242,7 +242,7 @@ qede_write_fwdump(const char *dump_file, void *dump, size_t len)
 }
 
 int
-qede_save_fw_dump(uint8_t port_id)
+qede_save_fw_dump(uint16_t port_id)
 {
 	struct rte_eth_dev *eth_dev = &rte_eth_devices[port_id];
 	struct rte_dev_reg_info regs;
Signature · 1 line
2.17.1
author
#7 lore raw

PATCH v2 2/3 app: fix variable size of ethdev port id

The ethdev port id should be 16 bits now. This patch changes the variable size of port id in applications from 8 bits to 16 bits.

Fixes e977e4199a8d ("app/testpmd: add commands to load/unload BPF filters")
Fixes 46cf97e4bbfa ("eventdev: add test for eth Tx adapter")
---
 app/test-pmd/bpf_cmd.c               | 4 ++--
 app/test/test_event_eth_tx_adapter.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
app/test-pmd/bpf_cmd.c +2 -2
index 0f984ccf4..16e3c3b3b 100644
@@ -55,7 +55,7 @@ static const struct rte_bpf_xsym bpf_xsym[] = {
 struct cmd_bpf_ld_result {
 	cmdline_fixed_string_t bpf;
 	cmdline_fixed_string_t dir;
-	uint8_t port;
+	uint16_t port;
 	uint16_t queue;
 	cmdline_fixed_string_t op;
 	cmdline_fixed_string_t flags;
@@ -153,7 +153,7 @@ cmdline_parse_inst_t cmd_operate_bpf_ld_parse = {
 struct cmd_bpf_unld_result {
 	cmdline_fixed_string_t bpf;
 	cmdline_fixed_string_t dir;
-	uint8_t port;
+	uint16_t port;
 	uint16_t queue;
 };
 
app/test/test_event_eth_tx_adapter.c +2 -2
index 3af749280..707303090 100644
@@ -45,7 +45,7 @@ static uint64_t eid = ~0ULL;
 static uint32_t tid;
 
 static inline int
-port_init_common(uint8_t port, const struct rte_eth_conf *port_conf,
+port_init_common(uint16_t port, const struct rte_eth_conf *port_conf,
 		struct rte_mempool *mp)
 {
 	const uint16_t rx_ring_size = RING_SIZE, tx_ring_size = RING_SIZE;
@@ -104,7 +104,7 @@ port_init_common(uint8_t port, const struct rte_eth_conf *port_conf,
 }
 
 static inline int
-port_init(uint8_t port, struct rte_mempool *mp)
+port_init(uint16_t port, struct rte_mempool *mp)
 {
 	struct rte_eth_conf conf = { 0 };
 	return port_init_common(port, &conf, mp);
Signature · 1 line
2.17.1
author
#8 lore raw

PATCH v2 3/3 doc: fix variable size of ethdev port id

In reply to Chenbo Xia

The ethdev port id should be 16 bits now. This patch changes the variable size of port id in docs from 8 bits to 16 bits.

Fixes fdec9301f52d ("doc: add flow classify guides")
Fixes 4a3ef59a10c8 ("examples/flow_filtering: add simple demo of flow API")
---
 doc/guides/sample_app_ug/flow_classify.rst  | 2 +-
 doc/guides/sample_app_ug/flow_filtering.rst | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
doc/guides/sample_app_ug/flow_classify.rst +1 -1
index dc40b4d6f..31175cff0 100644
@@ -271,7 +271,7 @@ Forwarding application is shown below:
 .. code-block:: c
 
     static inline int
-    port_init(uint8_t port, struct rte_mempool *mbuf_pool)
+    port_init(uint16_t port, struct rte_mempool *mbuf_pool)
     {
         struct rte_eth_conf port_conf = port_conf_default;
         const uint16_t rx_rings = 1, tx_rings = 1;
doc/guides/sample_app_ug/flow_filtering.rst +1 -1
index 5e5a6cd8a..d3653e57b 100644
@@ -384,7 +384,7 @@ This function is located in the ``flow_blocks.c`` file.
 .. code-block:: c
 
    static struct rte_flow *
-   generate_ipv4_flow(uint8_t port_id, uint16_t rx_q,
+   generate_ipv4_flow(uint16_t port_id, uint16_t rx_q,
                    uint32_t src_ip, uint32_t src_mask,
                    uint32_t dest_ip, uint32_t dest_mask,
                    struct rte_flow_error *error)
Signature · 1 line
2.17.1
#9 lore raw

Re: [dpdk-dev] [PATCH v2 1/3] net: fix variable size of ethdev port id

In reply to Chenbo Xia
Quoted 27 lines · Chenbo Xia

The ethdev port id should be 16 bits now. This patch changes the variable size of port id in some net drivers from 8 bits to 16 bits.

Fixes cf18d4def295 ("net/ark: provide API for hardware modules UDM and DDM")
Fixes 09b23f8b9df6 ("net/bnxt: fix port stop process and cleanup resources")
Fixes 769de16872ab ("net/bnxt: fix port default rule create/destroy")
Fixes 50370662b727 ("net/ice: support device and queue ops")
Fixes a50d7cbbdad7 ("net/qede: support registers dump")
---
 drivers/net/ark/ark_udm.h               | 2 +-
 drivers/net/bnxt/tf_ulp/bnxt_ulp.c      | 2 +-
 drivers/net/bnxt/tf_ulp/ulp_def_rules.c | 6 +++---
 drivers/net/ice/ice_rxtx.h              | 4 ++--
 drivers/net/qede/base/bcm_osal.h        | 2 +-
 drivers/net/qede/qede_regs.c            | 2 +-
 6 files changed, 9 insertions(+), 9 deletions(-)
drivers/net/ark/ark_udm.h +0 -0
index 5846c825b..32eb82faa 100644

drivers/net/ark/ark_udm.h line 25

Quoted 8 lines
drivers/net/ark/ark_udm.h +1 -1
@@ -19,7 +19,7 @@
 struct ark_rx_meta {
        uint64_t timestamp;
        uint64_t user_data;
-       uint8_t port;
+       uint16_t port;
        uint8_t dst_queue;
        uint16_t pkt_len;
 };

NACK - this struct correlates with an identical structure in the hardware module. The C-level cannot be changed without a hardware update. For the net/ark driver we will be content with 8-bit port ids.
Ed.

author
#10 lore raw

PATCH v3 1/3 net: fix variable size of ethdev port id

In reply to Chenbo Xia

The ethdev port id should be 16 bits now. This patch changes the variable size of port id in some net drivers from 8 bits to 16 bits.

Fixes 09b23f8b9df6 ("net/bnxt: fix port stop process and cleanup resources")
Fixes 769de16872ab ("net/bnxt: fix port default rule create/destroy")
Fixes 50370662b727 ("net/ice: support device and queue ops")
Fixes a50d7cbbdad7 ("net/qede: support registers dump")
---
 drivers/net/bnxt/tf_ulp/bnxt_ulp.c      | 2 +-
 drivers/net/bnxt/tf_ulp/ulp_def_rules.c | 6 +++---
 drivers/net/ice/ice_rxtx.h              | 4 ++--
 drivers/net/qede/base/bcm_osal.h        | 2 +-
 drivers/net/qede/qede_regs.c            | 2 +-
 5 files changed, 8 insertions(+), 8 deletions(-)
drivers/net/bnxt/tf_ulp/bnxt_ulp.c +1 -1
index e8927f629..3d148029e 100644
@@ -646,7 +646,7 @@ static void
 bnxt_ulp_destroy_vfr_default_rules(struct bnxt *bp, bool global)
 {
 	struct bnxt_ulp_vfr_rule_info *info;
-	uint8_t port_id;
+	uint16_t port_id;
 	struct rte_eth_dev *vfr_eth_dev;
 	struct bnxt_vf_representor *vfr_bp;
 
drivers/net/bnxt/tf_ulp/ulp_def_rules.c +3 -3
index 2d0c3bccc..fdd2692f6 100644
@@ -402,7 +402,7 @@ void
 bnxt_ulp_destroy_df_rules(struct bnxt *bp, bool global)
 {
 	struct bnxt_ulp_df_rule_info *info;
-	uint8_t port_id;
+	uint16_t port_id;
 
 	if (!BNXT_TRUFLOW_EN(bp) ||
 	    BNXT_ETH_DEV_IS_REPRESENTOR(bp->eth_dev))
@@ -466,7 +466,7 @@ int32_t
 bnxt_ulp_create_df_rules(struct bnxt *bp)
 {
 	struct bnxt_ulp_df_rule_info *info;
-	uint8_t port_id;
+	uint16_t port_id;
 	int rc;
 
 	if (!BNXT_TRUFLOW_EN(bp) ||
@@ -540,7 +540,7 @@ bnxt_ulp_create_vfr_default_rules(struct rte_eth_dev *vfr_ethdev)
 	struct rte_eth_dev *parent_dev = vfr->parent_dev;
 	struct bnxt *bp = parent_dev->data->dev_private;
 	uint16_t vfr_port_id = vfr_ethdev->data->port_id;
-	uint8_t port_id;
+	uint16_t port_id;
 	int rc;
 
 	if (!bp || !BNXT_TRUFLOW_EN(bp))
drivers/net/ice/ice_rxtx.h +2 -2
index 9fa57b3b2..e4309b8b9 100644
@@ -68,7 +68,7 @@ struct ice_rx_queue {
 	uint16_t rxrearm_start;	/**< the idx we start the re-arming from */
 	uint64_t mbuf_initializer; /**< value to init mbufs */
 
-	uint8_t port_id; /* device port ID */
+	uint16_t port_id; /* device port ID */
 	uint8_t crc_len; /* 0 if CRC stripped, 4 otherwise */
 	uint8_t fdir_enabled; /* 0 if FDIR disabled, 1 when enabled */
 	uint16_t queue_id; /* RX queue index */
@@ -112,7 +112,7 @@ struct ice_tx_queue {
 	uint8_t pthresh; /**< Prefetch threshold register. */
 	uint8_t hthresh; /**< Host threshold register. */
 	uint8_t wthresh; /**< Write-back threshold reg. */
-	uint8_t port_id; /* Device port identifier. */
+	uint16_t port_id; /* Device port identifier. */
 	uint16_t queue_id; /* TX queue index. */
 	uint32_t q_teid; /* TX schedule node id. */
 	uint16_t reg_idx;
drivers/net/qede/base/bcm_osal.h +1 -1
index 5d4df5907..814000039 100644
@@ -372,7 +372,7 @@ void qede_hw_err_notify(struct ecore_hwfn *p_hwfn,
 /* TODO: */
 #define OSAL_SCHEDULE_RECOVERY_HANDLER(hwfn) nothing
 
-int qede_save_fw_dump(uint8_t port_id);
+int qede_save_fw_dump(uint16_t port_id);
 
 #define OSAL_SAVE_FW_DUMP(port_id) qede_save_fw_dump(port_id)
 
drivers/net/qede/qede_regs.c +1 -1
index 1f2dbc6e7..d2ea1c910 100644
@@ -242,7 +242,7 @@ qede_write_fwdump(const char *dump_file, void *dump, size_t len)
 }
 
 int
-qede_save_fw_dump(uint8_t port_id)
+qede_save_fw_dump(uint16_t port_id)
 {
 	struct rte_eth_dev *eth_dev = &rte_eth_devices[port_id];
 	struct rte_dev_reg_info regs;
Signature · 1 line
2.17.1
author
#11 lore raw

PATCH v3 2/3 app: fix variable size of ethdev port id

The ethdev port id should be 16 bits now. This patch changes the variable size of port id in applications from 8 bits to 16 bits.

Fixes e977e4199a8d ("app/testpmd: add commands to load/unload BPF filters")
Fixes 46cf97e4bbfa ("eventdev: add test for eth Tx adapter")
---
 app/test-pmd/bpf_cmd.c               | 4 ++--
 app/test/test_event_eth_tx_adapter.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
app/test-pmd/bpf_cmd.c +2 -2
index 0f984ccf4..16e3c3b3b 100644
@@ -55,7 +55,7 @@ static const struct rte_bpf_xsym bpf_xsym[] = {
 struct cmd_bpf_ld_result {
 	cmdline_fixed_string_t bpf;
 	cmdline_fixed_string_t dir;
-	uint8_t port;
+	uint16_t port;
 	uint16_t queue;
 	cmdline_fixed_string_t op;
 	cmdline_fixed_string_t flags;
@@ -153,7 +153,7 @@ cmdline_parse_inst_t cmd_operate_bpf_ld_parse = {
 struct cmd_bpf_unld_result {
 	cmdline_fixed_string_t bpf;
 	cmdline_fixed_string_t dir;
-	uint8_t port;
+	uint16_t port;
 	uint16_t queue;
 };
 
app/test/test_event_eth_tx_adapter.c +2 -2
index 3af749280..707303090 100644
@@ -45,7 +45,7 @@ static uint64_t eid = ~0ULL;
 static uint32_t tid;
 
 static inline int
-port_init_common(uint8_t port, const struct rte_eth_conf *port_conf,
+port_init_common(uint16_t port, const struct rte_eth_conf *port_conf,
 		struct rte_mempool *mp)
 {
 	const uint16_t rx_ring_size = RING_SIZE, tx_ring_size = RING_SIZE;
@@ -104,7 +104,7 @@ port_init_common(uint8_t port, const struct rte_eth_conf *port_conf,
 }
 
 static inline int
-port_init(uint8_t port, struct rte_mempool *mp)
+port_init(uint16_t port, struct rte_mempool *mp)
 {
 	struct rte_eth_conf conf = { 0 };
 	return port_init_common(port, &conf, mp);
Signature · 1 line
2.17.1
author
#12 lore raw

PATCH v3 3/3 doc: fix variable size of ethdev port id

In reply to Chenbo Xia

The ethdev port id should be 16 bits now. This patch changes the variable size of port id in docs from 8 bits to 16 bits.

Fixes fdec9301f52d ("doc: add flow classify guides")
Fixes 4a3ef59a10c8 ("examples/flow_filtering: add simple demo of flow API")
---
 doc/guides/sample_app_ug/flow_classify.rst  | 2 +-
 doc/guides/sample_app_ug/flow_filtering.rst | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
doc/guides/sample_app_ug/flow_classify.rst +1 -1
index dc40b4d6f..31175cff0 100644
@@ -271,7 +271,7 @@ Forwarding application is shown below:
 .. code-block:: c
 
     static inline int
-    port_init(uint8_t port, struct rte_mempool *mbuf_pool)
+    port_init(uint16_t port, struct rte_mempool *mbuf_pool)
     {
         struct rte_eth_conf port_conf = port_conf_default;
         const uint16_t rx_rings = 1, tx_rings = 1;
doc/guides/sample_app_ug/flow_filtering.rst +1 -1
index 5e5a6cd8a..d3653e57b 100644
@@ -384,7 +384,7 @@ This function is located in the ``flow_blocks.c`` file.
 .. code-block:: c
 
    static struct rte_flow *
-   generate_ipv4_flow(uint8_t port_id, uint16_t rx_q,
+   generate_ipv4_flow(uint16_t port_id, uint16_t rx_q,
                    uint32_t src_ip, uint32_t src_mask,
                    uint32_t dest_ip, uint32_t dest_mask,
                    struct rte_flow_error *error)
Signature · 1 line
2.17.1
Acked-by on v3 1/3
#13 lore raw

Re: [dpdk-dev] [PATCH v3 1/3] net: fix variable size of ethdev port id

In reply to Chenbo Xia
Quoted 5 lines · Chenbo Xia

The ethdev port id should be 16 bits now. This patch changes the variable size of port id in some net drivers from 8 bits to 16 bits.

Quoted 7 lines
Fixes 09b23f8b9df6 ("net/bnxt: fix port stop process and cleanup resources")
Fixes 769de16872ab ("net/bnxt: fix port default rule create/destroy")
Fixes 50370662b727 ("net/ice: support device and queue ops")
Fixes a50d7cbbdad7 ("net/qede: support registers dump")

For bnxt,

Quoted 104 lines
---
 drivers/net/bnxt/tf_ulp/bnxt_ulp.c      | 2 +-
 drivers/net/bnxt/tf_ulp/ulp_def_rules.c | 6 +++---
 drivers/net/ice/ice_rxtx.h              | 4 ++--
 drivers/net/qede/base/bcm_osal.h        | 2 +-
 drivers/net/qede/qede_regs.c            | 2 +-
 5 files changed, 8 insertions(+), 8 deletions(-)
drivers/net/bnxt/tf_ulp/bnxt_ulp.c +1 -1
index e8927f629..3d148029e 100644
@@ -646,7 +646,7 @@ static void
 bnxt_ulp_destroy_vfr_default_rules(struct bnxt *bp, bool global)
 {
        struct bnxt_ulp_vfr_rule_info *info;
-       uint8_t port_id;
+       uint16_t port_id;
        struct rte_eth_dev *vfr_eth_dev;
        struct bnxt_vf_representor *vfr_bp;
 
drivers/net/bnxt/tf_ulp/ulp_def_rules.c +3 -3
index 2d0c3bccc..fdd2692f6 100644
@@ -402,7 +402,7 @@ void
 bnxt_ulp_destroy_df_rules(struct bnxt *bp, bool global)
 {
        struct bnxt_ulp_df_rule_info *info;
-       uint8_t port_id;
+       uint16_t port_id;
 
        if (!BNXT_TRUFLOW_EN(bp) ||
            BNXT_ETH_DEV_IS_REPRESENTOR(bp->eth_dev))
@@ -466,7 +466,7 @@ int32_t
 bnxt_ulp_create_df_rules(struct bnxt *bp)
 {
        struct bnxt_ulp_df_rule_info *info;
-       uint8_t port_id;
+       uint16_t port_id;
        int rc;
 
        if (!BNXT_TRUFLOW_EN(bp) ||
@@ -540,7 +540,7 @@ bnxt_ulp_create_vfr_default_rules(struct rte_eth_dev *vfr_ethdev)
        struct rte_eth_dev *parent_dev = vfr->parent_dev;
        struct bnxt *bp = parent_dev->data->dev_private;
        uint16_t vfr_port_id = vfr_ethdev->data->port_id;
-       uint8_t port_id;
+       uint16_t port_id;
        int rc;
 
        if (!bp || !BNXT_TRUFLOW_EN(bp))
drivers/net/ice/ice_rxtx.h +2 -2
index 9fa57b3b2..e4309b8b9 100644
@@ -68,7 +68,7 @@ struct ice_rx_queue {
        uint16_t rxrearm_start; /**< the idx we start the re-arming from */
        uint64_t mbuf_initializer; /**< value to init mbufs */
 
-       uint8_t port_id; /* device port ID */
+       uint16_t port_id; /* device port ID */
        uint8_t crc_len; /* 0 if CRC stripped, 4 otherwise */
        uint8_t fdir_enabled; /* 0 if FDIR disabled, 1 when enabled */
        uint16_t queue_id; /* RX queue index */
@@ -112,7 +112,7 @@ struct ice_tx_queue {
        uint8_t pthresh; /**< Prefetch threshold register. */
        uint8_t hthresh; /**< Host threshold register. */
        uint8_t wthresh; /**< Write-back threshold reg. */
-       uint8_t port_id; /* Device port identifier. */
+       uint16_t port_id; /* Device port identifier. */
        uint16_t queue_id; /* TX queue index. */
        uint32_t q_teid; /* TX schedule node id. */
        uint16_t reg_idx;
drivers/net/qede/base/bcm_osal.h +1 -1
index 5d4df5907..814000039 100644
@@ -372,7 +372,7 @@ void qede_hw_err_notify(struct ecore_hwfn *p_hwfn,
 /* TODO: */
 #define OSAL_SCHEDULE_RECOVERY_HANDLER(hwfn) nothing
 
-int qede_save_fw_dump(uint8_t port_id);
+int qede_save_fw_dump(uint16_t port_id);
 
 #define OSAL_SAVE_FW_DUMP(port_id) qede_save_fw_dump(port_id)
 
drivers/net/qede/qede_regs.c +1 -2
index 1f2dbc6e7..d2ea1c910 100644
@@ -242,7 +242,7 @@ qede_write_fwdump(const char *dump_file, void *dump, size_t len)
 }
 
 int
-qede_save_fw_dump(uint8_t port_id)
+qede_save_fw_dump(uint16_t port_id)
 {
        struct rte_eth_dev *eth_dev = &rte_eth_devices[port_id];
        struct rte_dev_reg_info regs;
--

2.17.1

Reviewed-by on v3 1/3
#14 lore raw

Re: [dpdk-dev] [PATCH v3 1/3] net: fix variable size of ethdev port id

In reply to Chenbo Xia
Quoted 4 lines · Chenbo Xia

The ethdev port id should be 16 bits now. This patch changes the variable size of port id in some net drivers from 8 bits to 16 bits.

Quoted 8 lines
Fixes 09b23f8b9df6 ("net/bnxt: fix port stop process and cleanup resources")
Fixes 769de16872ab ("net/bnxt: fix port default rule create/destroy")
Fixes 50370662b727 ("net/ice: support device and queue ops")
Fixes a50d7cbbdad7 ("net/qede: support registers dump")

For series,

Series applied to dpdk-next-net/main, thanks.