Skip to contentSkip to conversation

net/ice: fix queue bind MSI-X interrupt error

PATCH Applied [email protected] 3 participants 5 messages Feb 19, 2020 – Feb 20, 2020 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/ice: fix queue bind MSI-X interrupt error

From: Zhu Tao <[email protected]>

To bind a queue to an MSI-X interrupt, need to set some register. The register consists of many parts, each of which has several bits; therefore, the shift operator '<<' was used; so the operator '<' in the code should be '<<'.

Old code adds 1 on even MSI-X interrupt vector index used by queue, resulting in interrupt mapping error.

Fixes 65dfc889d8 ("net/ice: support Rx queue interruption")
---
 drivers/net/ice/ice_ethdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ice/ice_ethdev.c +2 -2
index 8e9369e0a..85ef83e92 100644
@@ -2605,9 +2605,9 @@ __vsi_queues_bind_intr(struct ice_vsi *vsi, uint16_t msix_vect,
 	for (i = 0; i < nb_queue; i++) {
 		/*do actual bind*/
 		val = (msix_vect & QINT_RQCTL_MSIX_INDX_M) |
-		      (0 < QINT_RQCTL_ITR_INDX_S) | QINT_RQCTL_CAUSE_ENA_M;
+		      (0 << QINT_RQCTL_ITR_INDX_S) | QINT_RQCTL_CAUSE_ENA_M;
 		val_tx = (msix_vect & QINT_TQCTL_MSIX_INDX_M) |
-			 (0 < QINT_TQCTL_ITR_INDX_S) | QINT_TQCTL_CAUSE_ENA_M;
+			 (0 << QINT_TQCTL_ITR_INDX_S) | QINT_TQCTL_CAUSE_ENA_M;
 
 		PMD_DRV_LOG(INFO, "queue %d is binding to vect %d",
 			    base_queue + i, msix_vect);
Signature · 1 line
2.17.1
Acked-by on v1 1/1 Applied
#1 lore raw
Quoted 37 lines · On 02/19, [email protected] wrote:

From: Zhu Tao <[email protected]>

To bind a queue to an MSI-X interrupt, need to set some register. The register consists of many parts, each of which has several bits; therefore, the shift operator '<<' was used; so the operator '<' in the code should be '<<'.

Old code adds 1 on even MSI-X interrupt vector index used by queue, resulting in interrupt mapping error.

Fixes 65dfc889d8 ("net/ice: support Rx queue interruption")

---
drivers/net/ice/ice_ethdev.c | 4 ++--

1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ice/ice_ethdev.c +2 -2
index 8e9369e0a..85ef83e92 100644
@@ -2605,9 +2605,9 @@ __vsi_queues_bind_intr(struct ice_vsi *vsi, uint16_t msix_vect,
 	for (i = 0; i < nb_queue; i++) {
 		/*do actual bind*/
 		val = (msix_vect & QINT_RQCTL_MSIX_INDX_M) |
-		      (0 < QINT_RQCTL_ITR_INDX_S) | QINT_RQCTL_CAUSE_ENA_M;
+		      (0 << QINT_RQCTL_ITR_INDX_S) | QINT_RQCTL_CAUSE_ENA_M;
 		val_tx = (msix_vect & QINT_TQCTL_MSIX_INDX_M) |
-			 (0 < QINT_TQCTL_ITR_INDX_S) | QINT_TQCTL_CAUSE_ENA_M;
+			 (0 << QINT_TQCTL_ITR_INDX_S) | QINT_TQCTL_CAUSE_ENA_M;
 
 		PMD_DRV_LOG(INFO, "queue %d is binding to vect %d",
 			    base_queue + i, msix_vect);
Signature · 1 line
2.17.1

Applied to dpdk-next-net-intel, Thanks.

#2 lore raw
In reply to [email protected]
Quoted 23 lines · On 2/19/2020 10:17 AM, [email protected] wrote:

From: Zhu Tao <[email protected]>

To bind a queue to an MSI-X interrupt, need to set some register. The register consists of many parts, each of which has several bits; therefore, the shift operator '<<' was used; so the operator '<' in the code should be '<<'.

Old code adds 1 on even MSI-X interrupt vector index used by queue, resulting in interrupt mapping error.

Fixes 65dfc889d8 ("net/ice: support Rx queue interruption")
---
 drivers/net/ice/ice_ethdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ice/ice_ethdev.c +0 -0
index 8e9369e0a..85ef83e92 100644

drivers/net/ice/ice_ethdev.c __vsi_queues_bind_intr(struct ice_vsi *vsi, uint16_t msix_vect, · line 2610

Quoted 8 lines
drivers/net/ice/ice_ethdev.c +2 -2
@@ -2605,9 +2605,9 @@ __vsi_queues_bind_intr(struct ice_vsi *vsi, uint16_t msix_vect,
 	for (i = 0; i < nb_queue; i++) {
 		/*do actual bind*/
 		val = (msix_vect & QINT_RQCTL_MSIX_INDX_M) |
-		      (0 < QINT_RQCTL_ITR_INDX_S) | QINT_RQCTL_CAUSE_ENA_M;
+		      (0 << QINT_RQCTL_ITR_INDX_S) | QINT_RQCTL_CAUSE_ENA_M;
 		val_tx = (msix_vect & QINT_TQCTL_MSIX_INDX_M) |
-			 (0 < QINT_TQCTL_ITR_INDX_S) | QINT_TQCTL_CAUSE_ENA_M;
+			 (0 << QINT_TQCTL_ITR_INDX_S) | QINT_TQCTL_CAUSE_ENA_M;

Hi Tao,

Out of curiosity, what is the point of left shifting "0"?

author
#3 lore raw

Hi Yigit, Ferruh

The original author was not found. The meaning of these bits is as follows:
ITR Index of the interrupt cause:
00b - ITR0 ; 01b - ITR1; 10b - ITR2; 11b - NoITR

I think the reason why the original author wrote this strange code is to highlight that these bits are important in this function, he wanted to make it clear that he used ITR0 . I think it's possible, so I keep it.

BR,
Zhu, Tao

Quoted 52 lines

-----Original Message-----
From: Yigit, Ferruh
Sent: Thursday, February 20, 2020 5:21 PM
To: Zhu, TaoX <[email protected]>; Yang, Qiming <[email protected]>; Lu, Wenzhuo <[email protected]>
Cc: [email protected]; Xing, Beilei <[email protected]>; Zhang, Qi Z <[email protected]>; Ye, Xiaolong <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [PATCH] net/ice: fix queue bind MSI-X interrupt error

drivers/net/ice/ice_ethdev.c __vsi_queues_bind_intr(struct ice_vsi *vsi,

Quoted 23 lines · On 2/19/2020 10:17 AM, [email protected] wrote:

From: Zhu Tao <[email protected]>

To bind a queue to an MSI-X interrupt, need to set some register. The register consists of many parts, each of which has several bits; therefore, the shift operator '<<' was used; so the operator '<' in the code should be '<<'.

Old code adds 1 on even MSI-X interrupt vector index used by queue, resulting in interrupt mapping error.

Fixes 65dfc889d8 ("net/ice: support Rx queue interruption")
---
 drivers/net/ice/ice_ethdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
(quoted diff) +0 -0

b/drivers/net/ice/ice_ethdev.c index 8e9369e0a..85ef83e92 100644

drivers/net/ice/ice_ethdev.c +0 -0
@@ -2605,9 +2605,9 @@ __vsi_queues_bind_intr(struct ice_vsi *vsi,

uint16_t msix_vect,

drivers/net/ice/ice_ethdev.c __vsi_queues_bind_intr(struct ice_vsi *vsi, uint16_t msix_vect,

Quoted 4 lines
drivers/net/ice/ice_ethdev.c +0 -1
 	for (i = 0; i < nb_queue; i++) {
 		/*do actual bind*/
 		val = (msix_vect & QINT_RQCTL_MSIX_INDX_M) |
-		      (0 < QINT_RQCTL_ITR_INDX_S) |

QINT_RQCTL_CAUSE_ENA_M;

drivers/net/ice/ice_ethdev.c __vsi_queues_bind_intr(struct ice_vsi *vsi, · line 2608

Quoted 1 line
drivers/net/ice/ice_ethdev.c +1 -0
+		      (0 << QINT_RQCTL_ITR_INDX_S) |

QINT_RQCTL_CAUSE_ENA_M;

drivers/net/ice/ice_ethdev.c __vsi_queues_bind_intr(struct ice_vsi *vsi, · line 2610

Quoted 2 lines
drivers/net/ice/ice_ethdev.c +0 -1
 		val_tx = (msix_vect & QINT_TQCTL_MSIX_INDX_M) |
-			 (0 < QINT_TQCTL_ITR_INDX_S) |

QINT_TQCTL_CAUSE_ENA_M;

drivers/net/ice/ice_ethdev.c __vsi_queues_bind_intr(struct ice_vsi *vsi, · line 2610

Quoted 1 line
drivers/net/ice/ice_ethdev.c +1 -0
+			 (0 << QINT_TQCTL_ITR_INDX_S) |

QINT_TQCTL_CAUSE_ENA_M;

Hi Tao,

Out of curiosity, what is the point of left shifting "0"?

#4 lore raw
Quoted 8 lines · TaoX

Hi Yigit, Ferruh

The original author was not found. The meaning of these bits is as follows:
ITR Index of the interrupt cause:
00b - ITR0 ; 01b - ITR1; 10b - ITR2; 11b - NoITR

I think the reason why the original author wrote this strange code is to highlight that these bits are important in this function, he wanted to make it clear that he used ITR0 . I think it's possible, so I keep it.

That is OK, thanks for clarification.

Quoted 58 lines

BR,
Zhu, Tao

Quoted 52 lines

-----Original Message-----
From: Yigit, Ferruh
Sent: Thursday, February 20, 2020 5:21 PM
To: Zhu, TaoX <[email protected]>; Yang, Qiming <[email protected]>; Lu, Wenzhuo <[email protected]>
Cc: [email protected]; Xing, Beilei <[email protected]>; Zhang, Qi Z <[email protected]>; Ye, Xiaolong <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [PATCH] net/ice: fix queue bind MSI-X interrupt error

drivers/net/ice/ice_ethdev.c __vsi_queues_bind_intr(struct ice_vsi *vsi,

Quoted 23 lines · On 2/19/2020 10:17 AM, [email protected] wrote:

From: Zhu Tao <[email protected]>

To bind a queue to an MSI-X interrupt, need to set some register. The register consists of many parts, each of which has several bits; therefore, the shift operator '<<' was used; so the operator '<' in the code should be '<<'.

Old code adds 1 on even MSI-X interrupt vector index used by queue, resulting in interrupt mapping error.

Fixes 65dfc889d8 ("net/ice: support Rx queue interruption")
---
 drivers/net/ice/ice_ethdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
(quoted diff) +0 -0

b/drivers/net/ice/ice_ethdev.c index 8e9369e0a..85ef83e92 100644

drivers/net/ice/ice_ethdev.c +0 -0
@@ -2605,9 +2605,9 @@ __vsi_queues_bind_intr(struct ice_vsi *vsi,

uint16_t msix_vect,

drivers/net/ice/ice_ethdev.c __vsi_queues_bind_intr(struct ice_vsi *vsi, uint16_t msix_vect,

Quoted 4 lines
drivers/net/ice/ice_ethdev.c +0 -1
 	for (i = 0; i < nb_queue; i++) {
 		/*do actual bind*/
 		val = (msix_vect & QINT_RQCTL_MSIX_INDX_M) |
-		      (0 < QINT_RQCTL_ITR_INDX_S) |

QINT_RQCTL_CAUSE_ENA_M;

drivers/net/ice/ice_ethdev.c __vsi_queues_bind_intr(struct ice_vsi *vsi, · line 2608

Quoted 1 line
drivers/net/ice/ice_ethdev.c +1 -0
+		      (0 << QINT_RQCTL_ITR_INDX_S) |

QINT_RQCTL_CAUSE_ENA_M;

drivers/net/ice/ice_ethdev.c __vsi_queues_bind_intr(struct ice_vsi *vsi, · line 2610

Quoted 2 lines
drivers/net/ice/ice_ethdev.c +0 -1
 		val_tx = (msix_vect & QINT_TQCTL_MSIX_INDX_M) |
-			 (0 < QINT_TQCTL_ITR_INDX_S) |

QINT_TQCTL_CAUSE_ENA_M;

drivers/net/ice/ice_ethdev.c __vsi_queues_bind_intr(struct ice_vsi *vsi, · line 2610

Quoted 1 line
drivers/net/ice/ice_ethdev.c +1 -0
+			 (0 << QINT_TQCTL_ITR_INDX_S) |

QINT_TQCTL_CAUSE_ENA_M;

Hi Tao,

Out of curiosity, what is the point of left shifting "0"?