Skip to contentSkip to conversation

net/ixgbe: fix l3fwd start failed on PF

PATCH Superseded Yanglong Wu 3 participants 13 messages Nov 20, 2017 – Jan 10, 2018 1 message not in the archive Network drivers

lore
Share & tools
lore
#1 lore raw

PATCH v2 1/1 net/ixgbe: fix l3fwd start failed on PF

In reply to a message not in the archive

L3fwd start failed on PF, for tx_q check failed.
That occured when the SRIOV is active and tx_q > rx_q. The tx_q is equal to nb_q_per_pool. The number of nb_q_per_pool should equeal to max number of queues supported by HW not nb_rx_q.

Fixes 27b609cbd1c6 (ethdev: move the multi-queue mode check to specific drivers)
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ixgbe/ixgbe_ethdev.c +1 -1
index ae9c44421..0f0641da1 100644
@@ -2180,7 +2180,7 @@ ixgbe_check_vf_rss_rxq_num(struct rte_eth_dev *dev, uint16_t nb_rx_q)
 		return -EINVAL;
 	}
 
-	RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool = nb_rx_q;
+	RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool = 128 / RTE_ETH_DEV_SRIOV(dev).active;
 	RTE_ETH_DEV_SRIOV(dev).def_pool_q_idx = pci_dev->max_vfs * nb_rx_q;
 
 	return 0;
Signature · 1 line
2.11.0
#2 lore raw

PATCH v3 1/1 net/ixgbe: fix l3fwd start failed on PF

L3fwd start failed on PF, for tx_q check failed.
That occurred when the SRIOV is active and tx_q > rx_q. The tx_q is equal to nb_q_per_pool. The number of nb_q_per_pool should equeal to max number of queues supported by HW not nb_rx_q.

Fixes 27b609cbd1c6 (ethdev: move the multi-queue mode check to specific drivers)
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ixgbe/ixgbe_ethdev.c +1 -1
index ae9c44421..0f0641da1 100644
@@ -2180,7 +2180,7 @@ ixgbe_check_vf_rss_rxq_num(struct rte_eth_dev *dev, uint16_t nb_rx_q)
 		return -EINVAL;
 	}
 
-	RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool = nb_rx_q;
+	RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool = 128/RTE_ETH_DEV_SRIOV(dev).active;
 	RTE_ETH_DEV_SRIOV(dev).def_pool_q_idx = pci_dev->max_vfs * nb_rx_q;
 
 	return 0;
Signature · 1 line
2.11.0
#3 lore raw

PATCH v4 1/1 net/ixgbe: fix l3fwd start failed on PF

L3fwd start failed on PF, for tx_q check failed.
That occurred when the SRIOV is active and tx_q > rx_q. The tx_q is equal to nb_q_per_pool. The number of nb_q_per_pool should equeal to max number of queues supported by HW not nb_rx_q.

Fixes 27b609cbd1c6 (ethdev: move the multi-queue mode check to specific drivers)
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ixgbe/ixgbe_ethdev.c +1 -1
index ae9c44421..0f0641da1 100644
@@ -2180,7 +2180,7 @@ ixgbe_check_vf_rss_rxq_num(struct rte_eth_dev *dev, uint16_t nb_rx_q)
 		return -EINVAL;
 	}
 
-	RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool = nb_rx_q;
+	RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool = 128 / RTE_ETH_DEV_SRIOV(dev).active;
 	RTE_ETH_DEV_SRIOV(dev).def_pool_q_idx = pci_dev->max_vfs * nb_rx_q;
 
 	return 0;
Signature · 1 line
2.11.0
#4 lore raw
Quoted 26 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Yanglong Wu
Sent: Monday, November 20, 2017 2:40 AM
To: [email protected]
Cc: Wu, Yanglong <[email protected]>
Subject: [dpdk-dev] [PATCH v4] net/ixgbe: fix l3fwd start failed on PF

L3fwd start failed on PF, for tx_q check failed.
That occurred when the SRIOV is active and tx_q > rx_q. The tx_q is equal to nb_q_per_pool. The number of nb_q_per_pool should equeal to max number of queues supported by HW not nb_rx_q.

Fixes 27b609cbd1c6 (ethdev: move the multi-queue mode check to specific drivers)
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ixgbe/ixgbe_ethdev.c +0 -0
index ae9c44421..0f0641da1 100644

drivers/net/ixgbe/ixgbe_ethdev.c ixgbe_check_vf_rss_rxq_num(struct rte_eth_dev *dev, uint16_t nb_rx_q) · line 2183

Quoted 5 lines
drivers/net/ixgbe/ixgbe_ethdev.c +1 -1
@@ -2180,7 +2180,7 @@ ixgbe_check_vf_rss_rxq_num(struct rte_eth_dev *dev, uint16_t nb_rx_q)
 		return -EINVAL;
 	}
 
-	RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool = nb_rx_q;
+	RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool = 128 / RTE_ETH_DEV_SRIOV(dev).active;

Please use appropriate macros instead of constants (s/128/IXGBE_MAX_RX_QUEUE_NUM).

drivers/net/ixgbe/ixgbe_ethdev.c ixgbe_check_vf_rss_rxq_num(struct rte_eth_dev *dev, uint16_t nb_rx_q) · line 2184

Quoted 1 line
drivers/net/ixgbe/ixgbe_ethdev.c +0 -0
 	RTE_ETH_DEV_SRIOV(dev).def_pool_q_idx = pci_dev->max_vfs * nb_rx_q;

Shouldn't we also change that line to:
RTE_ETH_DEV_SRIOV(dev).def_pool_q_idx = pci_dev->max_vfs * RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool; ?

Konstantin

Quoted 4 lines
drivers/net/ixgbe/ixgbe_ethdev.c +0 -1
 	return 0;
--

2.11.0

#5 lore raw

Hi,
Yes, I think so, we can change it. nb_rx_q just means the number of queue used for a port and RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool means max queue can be used.

-----Original Message-----
From: Ananyev, Konstantin
Sent: Monday, November 20, 2017 6:44 PM
To: Wu, Yanglong <[email protected]>; [email protected]
Cc: Wu, Yanglong <[email protected]>
Subject: RE: [dpdk-dev] [PATCH v4] net/ixgbe: fix l3fwd start failed on PF

Quoted 26 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Yanglong Wu
Sent: Monday, November 20, 2017 2:40 AM
To: [email protected]
Cc: Wu, Yanglong <[email protected]>
Subject: [dpdk-dev] [PATCH v4] net/ixgbe: fix l3fwd start failed on PF

L3fwd start failed on PF, for tx_q check failed.
That occurred when the SRIOV is active and tx_q > rx_q.
The tx_q is equal to nb_q_per_pool. The number of nb_q_per_pool should equeal to max number of queues supported by HW not nb_rx_q.

Fixes 27b609cbd1c6 (ethdev: move the multi-queue mode check to

specific drivers)

---
 drivers/net/ixgbe/ixgbe_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ixgbe/ixgbe_ethdev.c +0 -0
index ae9c44421..0f0641da1 100644

drivers/net/ixgbe/ixgbe_ethdev.c ixgbe_check_vf_rss_rxq_num(struct rte_eth_dev *dev, uint16_t nb_rx_q) · line 2184

Quoted 6 lines
drivers/net/ixgbe/ixgbe_ethdev.c +2 -1
@@ -2180,7 +2180,7 @@ ixgbe_check_vf_rss_rxq_num(struct rte_eth_dev *dev, uint16_t nb_rx_q)
 		return -EINVAL;
 	}
 
-	RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool = nb_rx_q;
+	RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool = 128 / 
+RTE_ETH_DEV_SRIOV(dev).active;

Please use appropriate macros instead of constants (s/128/IXGBE_MAX_RX_QUEUE_NUM).

drivers/net/ixgbe/ixgbe_ethdev.c ixgbe_check_vf_rss_rxq_num(struct rte_eth_dev *dev, uint16_t nb_rx_q) · line 2184

Quoted 1 line
drivers/net/ixgbe/ixgbe_ethdev.c +0 -0
 	RTE_ETH_DEV_SRIOV(dev).def_pool_q_idx = pci_dev->max_vfs * nb_rx_q;

Shouldn't we also change that line to:
RTE_ETH_DEV_SRIOV(dev).def_pool_q_idx = pci_dev->max_vfs * RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool; ?

Konstantin

Quoted 4 lines
drivers/net/ixgbe/ixgbe_ethdev.c +0 -1
 	return 0;
--

2.11.0

#6 lore raw
In reply to Ananyev, Konstantin

Hi Yanglong

Please follow the comments, and get all of them well addressed. My comments is you need to use in-reply-to when you send any updated versions of a patch.

Regards,
Helin

Quoted 63 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Ananyev, Konstantin
Sent: Monday, November 20, 2017 6:44 PM
To: Wu, Yanglong; [email protected]
Cc: Wu, Yanglong
Subject: Re: [dpdk-dev] [PATCH v4] net/ixgbe: fix l3fwd start failed on PF

drivers/net/ixgbe/ixgbe_ethdev.c ixgbe_check_vf_rss_rxq_num(struct rte_eth_dev

Quoted 26 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Yanglong Wu
Sent: Monday, November 20, 2017 2:40 AM
To: [email protected]
Cc: Wu, Yanglong <[email protected]>
Subject: [dpdk-dev] [PATCH v4] net/ixgbe: fix l3fwd start failed on PF

L3fwd start failed on PF, for tx_q check failed.
That occurred when the SRIOV is active and tx_q > rx_q.
The tx_q is equal to nb_q_per_pool. The number of nb_q_per_pool should equeal to max number of queues supported by HW not nb_rx_q.

Fixes 27b609cbd1c6 (ethdev: move the multi-queue mode check to

specific drivers)

---
 drivers/net/ixgbe/ixgbe_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ixgbe/ixgbe_ethdev.c +0 -0
index ae9c44421..0f0641da1 100644
@@ -2180,7 +2180,7 @@ ixgbe_check_vf_rss_rxq_num(struct rte_eth_dev

*dev, uint16_t nb_rx_q)

drivers/net/ixgbe/ixgbe_ethdev.c ixgbe_check_vf_rss_rxq_num(struct rte_eth_dev *dev, uint16_t nb_rx_q)

Quoted 6 lines
drivers/net/ixgbe/ixgbe_ethdev.c +2 -1
 		return -EINVAL;
 	}
 
-	RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool = nb_rx_q;
+	RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool = 128 /
+RTE_ETH_DEV_SRIOV(dev).active;

Please use appropriate macros instead of constants (s/128/IXGBE_MAX_RX_QUEUE_NUM).

drivers/net/ixgbe/ixgbe_ethdev.c ixgbe_check_vf_rss_rxq_num(struct rte_eth_dev · line 2185

Quoted 1 line
drivers/net/ixgbe/ixgbe_ethdev.c +0 -0
 	RTE_ETH_DEV_SRIOV(dev).def_pool_q_idx = pci_dev->max_vfs *

nb_rx_q;

Shouldn't we also change that line to:
RTE_ETH_DEV_SRIOV(dev).def_pool_q_idx = pci_dev->max_vfs * RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool;
?

Konstantin

Quoted 4 lines
drivers/net/ixgbe/ixgbe_ethdev.c +0 -1
 	return 0;
--

2.11.0

#7 lore raw

PATCH v5 1/1 net/ixgbe: fix l3fwd start failed on

In reply to Yanglong Wu

L3fwd start failed on PF, for tx_q check failed.
That occurred when the SRIOV is active and tx_q > rx_q. The tx_q is equal to nb_q_per_pool. The number of nb_q_per_pool should equeal to max number of queues supported by HW not nb_rx_q.

Fixes 27b609cbd1c6 (ethdev: move the multi-queue mode check to

specific drivers)

---
v5:
Rework according to comments

---
 drivers/net/ixgbe/ixgbe_ethdev.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
drivers/net/ixgbe/ixgbe_ethdev.c +7 -3
index ff19a564a..baaeee5d9 100644
@@ -95,6 +95,9 @@
 /* Timer value included in XOFF frames. */
 #define IXGBE_FC_PAUSE 0x680
 
+/*Default value of Max Rx Queue*/
+#define IXGBE_MAX_RX_QUEUE_NUM 128
+
 #define IXGBE_LINK_DOWN_CHECK_TIMEOUT 4000 /* ms */
 #define IXGBE_LINK_UP_CHECK_TIMEOUT   1000 /* ms */
 #define IXGBE_VMDQ_NUM_UC_MAC         4096 /* Maximum nb. of UC MAC addr. */
@@ -2194,9 +2197,10 @@ ixgbe_check_vf_rss_rxq_num(struct rte_eth_dev *dev, uint16_t nb_rx_q)
 		return -EINVAL;
 	}
 
-	RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool = nb_rx_q;
-	RTE_ETH_DEV_SRIOV(dev).def_pool_q_idx = pci_dev->max_vfs * nb_rx_q;
-
+	RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool =
+		IXGBE_MAX_RX_QUEUE_NUM / RTE_ETH_DEV_SRIOV(dev).active;
+	RTE_ETH_DEV_SRIOV(dev).def_pool_q_idx =
+		pci_dev->max_vfs * RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool;
 	return 0;
 }
 
Signature · 1 line
2.11.0
#8 lore raw

Re: [PATCH v5] net/ixgbe: fix l3fwd start failed on

Quoted 9 lines

-----Original Message-----
From: Wu, Yanglong
Sent: Monday, January 8, 2018 3:06 AM
To: [email protected]
Cc: Ananyev, Konstantin <[email protected]>; Wu, Yanglong <[email protected]>
Subject: [PATCH v5] net/ixgbe: fix l3fwd start failed on

Quoted 4 lines

L3fwd start failed on PF, for tx_q check failed.
That occurred when the SRIOV is active and tx_q > rx_q. The tx_q is equal to nb_q_per_pool. The number of nb_q_per_pool should equeal to max number of queues supported by HW not nb_rx_q.

But then 2 (or more cores) could try to TX packets through the same TX queue? Why not just fil to start gracefully (call rte_exit() or so) if such situation occurred? Konstantin

Quoted 42 lines
Fixes 27b609cbd1c6 (ethdev: move the multi-queue mode check to

specific drivers)

---
v5:
Rework according to comments

---
 drivers/net/ixgbe/ixgbe_ethdev.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
drivers/net/ixgbe/ixgbe_ethdev.c +7 -4
index ff19a564a..baaeee5d9 100644
@@ -95,6 +95,9 @@
 /* Timer value included in XOFF frames. */
 #define IXGBE_FC_PAUSE 0x680
 
+/*Default value of Max Rx Queue*/
+#define IXGBE_MAX_RX_QUEUE_NUM 128
+
 #define IXGBE_LINK_DOWN_CHECK_TIMEOUT 4000 /* ms */
 #define IXGBE_LINK_UP_CHECK_TIMEOUT   1000 /* ms */
 #define IXGBE_VMDQ_NUM_UC_MAC         4096 /* Maximum nb. of UC MAC addr. */
@@ -2194,9 +2197,10 @@ ixgbe_check_vf_rss_rxq_num(struct rte_eth_dev *dev, uint16_t nb_rx_q)
 		return -EINVAL;
 	}
 
-	RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool = nb_rx_q;
-	RTE_ETH_DEV_SRIOV(dev).def_pool_q_idx = pci_dev->max_vfs * nb_rx_q;
-
+	RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool =
+		IXGBE_MAX_RX_QUEUE_NUM / RTE_ETH_DEV_SRIOV(dev).active;
+	RTE_ETH_DEV_SRIOV(dev).def_pool_q_idx =
+		pci_dev->max_vfs * RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool;
 	return 0;
 }
 
--

2.11.0

#9 lore raw

Re: [PATCH v5] net/ixgbe: fix l3fwd start failed on

Hi, Konstantin

Thanks for your comments!
Do you means that tx_q is must less than rx_q when the SRIOV is active and if not, the application case will not be supported?
Do you think my patch will cause to 2 (or more cores) could try to TX packets through the same TX queue? And as far as I know, the way of core using tx_q queue is depend on the application (e.g. in l3fwd tx_q equal to number of core) and multi core use same tx_q is not suggested for locker is needed in this situation. So why do you think my patch will lead to multi core using same queue?

Yanglong Wu

-----Original Message-----
From: Ananyev, Konstantin
Sent: Monday, January 8, 2018 7:55 PM
To: Wu, Yanglong <[email protected]>; [email protected]
Subject: RE: [PATCH v5] net/ixgbe: fix l3fwd start failed on

Quoted 8 lines

-----Original Message-----
From: Wu, Yanglong
Sent: Monday, January 8, 2018 3:06 AM
To: [email protected]
Cc: Ananyev, Konstantin <[email protected]>; Wu, Yanglong <[email protected]>
Subject: [PATCH v5] net/ixgbe: fix l3fwd start failed on

Quoted 4 lines

L3fwd start failed on PF, for tx_q check failed.
That occurred when the SRIOV is active and tx_q > rx_q.
The tx_q is equal to nb_q_per_pool. The number of nb_q_per_pool should equeal to max number of queues supported by HW not nb_rx_q.

But then 2 (or more cores) could try to TX packets through the same TX queue? Why not just fil to start gracefully (call rte_exit() or so) if such situation occurred? Konstantin

Quoted 43 lines
Fixes 27b609cbd1c6 (ethdev: move the multi-queue mode check to

specific drivers)

---
v5:
Rework according to comments

---
 drivers/net/ixgbe/ixgbe_ethdev.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
drivers/net/ixgbe/ixgbe_ethdev.c +0 -0
index ff19a564a..baaeee5d9 100644
@@ -95,6 +95,9 @@
 /* Timer value included in XOFF frames. */  #define IXGBE_FC_PAUSE 

0x680

drivers/net/ixgbe/ixgbe_ethdev.c +7 -4
+/*Default value of Max Rx Queue*/
+#define IXGBE_MAX_RX_QUEUE_NUM 128
+
 #define IXGBE_LINK_DOWN_CHECK_TIMEOUT 4000 /* ms */
 #define IXGBE_LINK_UP_CHECK_TIMEOUT   1000 /* ms */
 #define IXGBE_VMDQ_NUM_UC_MAC         4096 /* Maximum nb. of UC MAC addr. */
@@ -2194,9 +2197,10 @@ ixgbe_check_vf_rss_rxq_num(struct rte_eth_dev *dev, uint16_t nb_rx_q)
 		return -EINVAL;
 	}
 
-	RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool = nb_rx_q;
-	RTE_ETH_DEV_SRIOV(dev).def_pool_q_idx = pci_dev->max_vfs * nb_rx_q;
-
+	RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool =
+		IXGBE_MAX_RX_QUEUE_NUM / RTE_ETH_DEV_SRIOV(dev).active;
+	RTE_ETH_DEV_SRIOV(dev).def_pool_q_idx =
+		pci_dev->max_vfs * RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool;
 	return 0;
 }
 
--

2.11.0

#10 lore raw

Re: [PATCH v5] net/ixgbe: fix l3fwd start failed on

Hi Yanglong,

Sorry, I was just confused by the description of the patch. The code itself seems ok... probably need to rephrase the description (remove mentioning l3fwd?).
Konstantin

Quoted 79 lines

Hi, Konstantin

Thanks for your comments!
Do you means that tx_q is must less than rx_q when the SRIOV is active and if not, the application case will not be supported? Do you think my patch will cause to 2 (or more cores) could try to TX packets through the same TX queue? And as far as I know, the way of core using tx_q queue is depend on the application (e.g. in l3fwd tx_q equal to number of core) and multi core use same tx_q is not suggested for locker is needed in this situation. So why do you think my patch will lead to multi core using same queue?

Yanglong Wu

-----Original Message-----
From: Ananyev, Konstantin
Sent: Monday, January 8, 2018 7:55 PM
To: Wu, Yanglong <[email protected]>; [email protected]
Subject: RE: [PATCH v5] net/ixgbe: fix l3fwd start failed on

Quoted 8 lines

-----Original Message-----
From: Wu, Yanglong
Sent: Monday, January 8, 2018 3:06 AM
To: [email protected]
Cc: Ananyev, Konstantin <[email protected]>; Wu, Yanglong <[email protected]>
Subject: [PATCH v5] net/ixgbe: fix l3fwd start failed on

Quoted 4 lines

L3fwd start failed on PF, for tx_q check failed.
That occurred when the SRIOV is active and tx_q > rx_q.
The tx_q is equal to nb_q_per_pool. The number of nb_q_per_pool should equeal to max number of queues supported by HW not nb_rx_q.

But then 2 (or more cores) could try to TX packets through the same TX queue? Why not just fil to start gracefully (call rte_exit() or so) if such situation occurred? Konstantin

Quoted 43 lines
Fixes 27b609cbd1c6 (ethdev: move the multi-queue mode check to

specific drivers)

---
v5:
Rework according to comments

---
 drivers/net/ixgbe/ixgbe_ethdev.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
drivers/net/ixgbe/ixgbe_ethdev.c +0 -0
index ff19a564a..baaeee5d9 100644
@@ -95,6 +95,9 @@
 /* Timer value included in XOFF frames. */  #define IXGBE_FC_PAUSE

0x680

drivers/net/ixgbe/ixgbe_ethdev.c +7 -4
+/*Default value of Max Rx Queue*/
+#define IXGBE_MAX_RX_QUEUE_NUM 128
+
 #define IXGBE_LINK_DOWN_CHECK_TIMEOUT 4000 /* ms */
 #define IXGBE_LINK_UP_CHECK_TIMEOUT   1000 /* ms */
 #define IXGBE_VMDQ_NUM_UC_MAC         4096 /* Maximum nb. of UC MAC addr. */
@@ -2194,9 +2197,10 @@ ixgbe_check_vf_rss_rxq_num(struct rte_eth_dev *dev, uint16_t nb_rx_q)
 		return -EINVAL;
 	}
 
-	RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool = nb_rx_q;
-	RTE_ETH_DEV_SRIOV(dev).def_pool_q_idx = pci_dev->max_vfs * nb_rx_q;
-
+	RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool =
+		IXGBE_MAX_RX_QUEUE_NUM / RTE_ETH_DEV_SRIOV(dev).active;
+	RTE_ETH_DEV_SRIOV(dev).def_pool_q_idx =
+		pci_dev->max_vfs * RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool;
 	return 0;
 }
 
--

2.11.0

#11 lore raw

PATCH v6 1/1 net/ixgbe: fix tx_q check failed on PF

In reply to Yanglong Wu

Tx_q check failed on PF that occurred when the SRIOV is active and tx_q > rx_q. The tx_q is equal to nb_q_per_pool. The number of nb_q_per_pool should equeal to max number of queues supported by HW not nb_rx_q.

Fixes 27b609cbd1c6 (ethdev: move the multi-queue mode check to

specific drivers)

---
v5:
Rework according to comments
---
v6:
rework commit log

---
 drivers/net/ixgbe/ixgbe_ethdev.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
drivers/net/ixgbe/ixgbe_ethdev.c +7 -3
index ff19a564a..baaeee5d9 100644
@@ -95,6 +95,9 @@
 /* Timer value included in XOFF frames. */
 #define IXGBE_FC_PAUSE 0x680
 
+/*Default value of Max Rx Queue*/
+#define IXGBE_MAX_RX_QUEUE_NUM 128
+
 #define IXGBE_LINK_DOWN_CHECK_TIMEOUT 4000 /* ms */
 #define IXGBE_LINK_UP_CHECK_TIMEOUT   1000 /* ms */
 #define IXGBE_VMDQ_NUM_UC_MAC         4096 /* Maximum nb. of UC MAC addr. */
@@ -2194,9 +2197,10 @@ ixgbe_check_vf_rss_rxq_num(struct rte_eth_dev *dev, uint16_t nb_rx_q)
 		return -EINVAL;
 	}
 
-	RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool = nb_rx_q;
-	RTE_ETH_DEV_SRIOV(dev).def_pool_q_idx = pci_dev->max_vfs * nb_rx_q;
-
+	RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool =
+		IXGBE_MAX_RX_QUEUE_NUM / RTE_ETH_DEV_SRIOV(dev).active;
+	RTE_ETH_DEV_SRIOV(dev).def_pool_q_idx =
+		pci_dev->max_vfs * RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool;
 	return 0;
 }
 
Signature · 1 line
2.11.0
Acked-by on v6 1/1
#12 lore raw

Re: [PATCH v6] net/ixgbe: fix tx_q check failed on PF

Quoted 47 lines

-----Original Message-----
From: Wu, Yanglong
Sent: Wednesday, January 10, 2018 1:52 AM
To: [email protected]; Ananyev, Konstantin <[email protected]>; Zhang, Helin <[email protected]>
Cc: Wu, Yanglong <[email protected]>
Subject: [PATCH v6] net/ixgbe: fix tx_q check failed on PF

Tx_q check failed on PF that occurred when the SRIOV is active and tx_q > rx_q. The tx_q is equal to nb_q_per_pool. The number of nb_q_per_pool should equeal to max number of queues supported by HW not nb_rx_q.

Fixes 27b609cbd1c6 (ethdev: move the multi-queue mode check to

specific drivers)

---
v5:
Rework according to comments
---
v6:
rework commit log

---
 drivers/net/ixgbe/ixgbe_ethdev.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
drivers/net/ixgbe/ixgbe_ethdev.c +3 -1
index ff19a564a..baaeee5d9 100644
@@ -95,6 +95,9 @@
 /* Timer value included in XOFF frames. */
 #define IXGBE_FC_PAUSE 0x680
 
+/*Default value of Max Rx Queue*/
+#define IXGBE_MAX_RX_QUEUE_NUM 128
+
 #define IXGBE_LINK_DOWN_CHECK_TIMEOUT 4000 /* ms */
 #define IXGBE_LINK_UP_CHECK_TIMEOUT   1000 /* ms */
 #define IXGBE_VMDQ_NUM_UC_MAC         4096 /* Maximum nb. of UC MAC addr. */
@@ -2194,9 +2197,10 @@ ixgbe_check_vf_rss_rxq_num(struct rte_eth_dev *dev, uint16_t nb_rx_q)
 		return -EINVAL;
 	}
 
-	RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool = nb_rx_q;

drivers/net/ixgbe/ixgbe_ethdev.c ixgbe_check_vf_rss_rxq_num(struct rte_eth_dev *dev, uint16_t nb_rx_q)

Quoted 10 lines
drivers/net/ixgbe/ixgbe_ethdev.c +4 -3
-	RTE_ETH_DEV_SRIOV(dev).def_pool_q_idx = pci_dev->max_vfs * nb_rx_q;
-
+	RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool =
+		IXGBE_MAX_RX_QUEUE_NUM / RTE_ETH_DEV_SRIOV(dev).active;
+	RTE_ETH_DEV_SRIOV(dev).def_pool_q_idx =
+		pci_dev->max_vfs * RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool;
 	return 0;
 }
 
--
Quoted 1 line

2.11.0

Applied
#13 lore raw

Re: [PATCH v6] net/ixgbe: fix tx_q check failed on PF

Quoted 65 lines

-----Original Message-----
From: Ananyev, Konstantin
Sent: Wednesday, January 10, 2018 9:57 AM
To: Wu, Yanglong; [email protected]; Zhang, Helin
Subject: RE: [PATCH v6] net/ixgbe: fix tx_q check failed on PF

Quoted 36 lines

-----Original Message-----
From: Wu, Yanglong
Sent: Wednesday, January 10, 2018 1:52 AM
To: [email protected]; Ananyev, Konstantin <[email protected]>; Zhang, Helin <[email protected]>
Cc: Wu, Yanglong <[email protected]>
Subject: [PATCH v6] net/ixgbe: fix tx_q check failed on PF

Tx_q check failed on PF that occurred when the SRIOV is active and tx_q > rx_q. The tx_q is equal to nb_q_per_pool. The number of nb_q_per_pool should equeal to max number of queues supported by HW not nb_rx_q.

Fixes 27b609cbd1c6 (ethdev: move the multi-queue mode check to

specific drivers)

---
v5:
Rework according to comments
---
v6:
rework commit log

---
 drivers/net/ixgbe/ixgbe_ethdev.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
drivers/net/ixgbe/ixgbe_ethdev.c +0 -0
index ff19a564a..baaeee5d9 100644
@@ -95,6 +95,9 @@
 /* Timer value included in XOFF frames. */  #define IXGBE_FC_PAUSE

0x680

drivers/net/ixgbe/ixgbe_ethdev.c

Quoted 6 lines
drivers/net/ixgbe/ixgbe_ethdev.c +3 -0
+/*Default value of Max Rx Queue*/
+#define IXGBE_MAX_RX_QUEUE_NUM 128
+
 #define IXGBE_LINK_DOWN_CHECK_TIMEOUT 4000 /* ms */
 #define IXGBE_LINK_UP_CHECK_TIMEOUT   1000 /* ms */
 #define IXGBE_VMDQ_NUM_UC_MAC         4096 /* Maximum nb. of UC

MAC addr. */

drivers/net/ixgbe/ixgbe_ethdev.c ixgbe_check_vf_rss_rxq_num(struct rte_eth_dev

Quoted 1 line
drivers/net/ixgbe/ixgbe_ethdev.c +0 -0
@@ -2194,9 +2197,10 @@ ixgbe_check_vf_rss_rxq_num(struct rte_eth_dev

*dev, uint16_t nb_rx_q)

drivers/net/ixgbe/ixgbe_ethdev.c ixgbe_check_vf_rss_rxq_num(struct rte_eth_dev *dev, uint16_t nb_rx_q)

Quoted 5 lines
drivers/net/ixgbe/ixgbe_ethdev.c +0 -2
 		return -EINVAL;
 	}
 
-	RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool = nb_rx_q;
-	RTE_ETH_DEV_SRIOV(dev).def_pool_q_idx = pci_dev->max_vfs *

nb_rx_q;

drivers/net/ixgbe/ixgbe_ethdev.c ixgbe_check_vf_rss_rxq_num(struct rte_eth_dev *dev, uint16_t nb_rx_q)

Quoted 3 lines
drivers/net/ixgbe/ixgbe_ethdev.c +2 -1
-
+	RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool =
+		IXGBE_MAX_RX_QUEUE_NUM /

RTE_ETH_DEV_SRIOV(dev).active;

Quoted 8 lines

drivers/net/ixgbe/ixgbe_ethdev.c ixgbe_check_vf_rss_rxq_num(struct rte_eth_dev *dev, uint16_t nb_rx_q)

Quoted 6 lines
drivers/net/ixgbe/ixgbe_ethdev.c +2 -1
+	RTE_ETH_DEV_SRIOV(dev).def_pool_q_idx =
+		pci_dev->max_vfs * RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool;
 	return 0;
 }
 
--

Applied to dpdk-next-net-intel, with commit log changes. Thanks!

/Helin

Quoted 2 lines
Quoted 2 lines

2.11.0