Skip to contentSkip to conversation

net/ixgbe: fix VFIO interrupt mapping in VF

PATCH New Wei Dai 3 participants 7 messages Sep 20, 2017 – Oct 11, 2017 1 message not in the archive Network drivers

lore
Share & tools
lore

Wei Dai

author
#0 lore raw

PATCH 1/1 net/ixgbe: fix VFIO interrupt mapping in VF

When a VF port is bound to VFIO-PIC, only miscellaneous interrupt is mapped to VFIO vector 0 in ixgbevf_dev_init( ).
In ixgbevf_dev_start(), if previous VFIO interrupt mapping set in ixgbevf_dev_init( ) is not cleard, it will fail when calling rte_intr_enable( ) tries to map Rx queue interrupt to other VFIO vectors. This patch clears the VFIO interrupt mappings before setting both miscellaneous and Rx queue interrupt mappings again to avoid failure.

Fixes 77234603fba0 ("net/ixgbe: support VF mailbox interrupt for link up/down")
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 9 +++++++++
 1 file changed, 9 insertions(+)
drivers/net/ixgbe/ixgbe_ethdev.c +9 -0
index 9ca5cbc..f7a8dc8 100644
@@ -5046,6 +5046,15 @@ ixgbevf_dev_start(struct rte_eth_dev *dev)
 	}
 	ixgbevf_configure_msix(dev);
 
+	/* When a PF port is bound to VFIO-PCI, only miscellaneous interrupt
+	 * is mapped to VFIO vector 0 in ixgbe_dev_init( ).
+	 * If previous VFIO interrupt mapping set in ixgbe_dev_init( ) is
+	 * not cleared, it will fail when following rte_intr_enable( ) tries
+	 * to map Rx queue interrupt to other VFIO vectors.
+	 * So clear uio/vfio intr/evevnfd first to avoid failure.
+	 */
+	rte_intr_disable(intr_handle);
+
 	rte_intr_enable(intr_handle);
 
 	/* Re-enable interrupt for VF */
Signature · 1 line
2.7.5
author
#1 lore raw

PATCH v2 1/1 net/ixgbe: fix VFIO interrupt mapping in VF

When a VF port is bound to VFIO-PIC, only miscellaneous interrupt is mapped to VFIO vector 0 in eth_ixgbevf_dev_init( ). In ixgbevf_dev_start(), if previous VFIO interrupt mapping set in eth_ixgbevf_dev_init( ) is not cleard, it will fail when calling rte_intr_enable( ) tries to map Rx queue interrupt to other VFIO vectors. This patch clears the VFIO interrupt mappings before setting both miscellaneous and Rx queue interrupt mappings again to avoid failure.

Fixes 77234603fba0 ("net/ixgbe: support VF mailbox interrupt for link up/down")
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 9 +++++++++
 1 file changed, 9 insertions(+)
drivers/net/ixgbe/ixgbe_ethdev.c +9 -0
index 9ca5cbc..f49c616 100644
@@ -5046,6 +5046,15 @@ ixgbevf_dev_start(struct rte_eth_dev *dev)
 	}
 	ixgbevf_configure_msix(dev);
 
+	/* When a VF port is bound to VFIO-PCI, only miscellaneous interrupt
+	 * is mapped to VFIO vector 0 in eth_ixgbevf_dev_init( ).
+	 * If previous VFIO interrupt mapping setting in eth_ixgbevf_dev_init( )
+	 * is not cleared, it will fail when following rte_intr_enable( ) tries
+	 * to map Rx queue interrupt to other VFIO vectors.
+	 * So clear uio/vfio intr/evevnfd first to avoid failure.
+	 */
+	rte_intr_disable(intr_handle);
+
 	rte_intr_enable(intr_handle);
 
 	/* Re-enable interrupt for VF */
Signature · 1 line
2.7.5
author
#2 lore raw

Hi, Jianwei
How about your test result ?

Hi Wenzhuo
Would you please review this patch ?

Thanks a lot !

Quoted 49 lines

-----Original Message-----
From: Dai, Wei
Sent: Thursday, September 28, 2017 10:29 AM
To: Lu, Wenzhuo <[email protected]>; Ananyev, Konstantin <[email protected]>; Liang, Cunming <[email protected]>; Ma, Jianwei <[email protected]>
Cc: [email protected]; Dai, Wei <[email protected]>; [email protected]
Subject: [PATCH v2] net/ixgbe: fix VFIO interrupt mapping in VF

When a VF port is bound to VFIO-PIC, only miscellaneous interrupt is mapped to VFIO vector 0 in eth_ixgbevf_dev_init( ).
In ixgbevf_dev_start(), if previous VFIO interrupt mapping set in eth_ixgbevf_dev_init( ) is not cleard, it will fail when calling rte_intr_enable( ) tries to map Rx queue interrupt to other VFIO vectors. This patch clears the VFIO interrupt mappings before setting both miscellaneous and Rx queue interrupt mappings again to avoid failure.

Fixes 77234603fba0 ("net/ixgbe: support VF mailbox interrupt for link

up/down")
Cc: [email protected]

---
 drivers/net/ixgbe/ixgbe_ethdev.c | 9 +++++++++
 1 file changed, 9 insertions(+)
drivers/net/ixgbe/ixgbe_ethdev.c +9 -1
index 9ca5cbc..f49c616 100644
@@ -5046,6 +5046,15 @@ ixgbevf_dev_start(struct rte_eth_dev *dev)
 	}
 	ixgbevf_configure_msix(dev);
 
+	/* When a VF port is bound to VFIO-PCI, only miscellaneous interrupt
+	 * is mapped to VFIO vector 0 in eth_ixgbevf_dev_init( ).
+	 * If previous VFIO interrupt mapping setting in eth_ixgbevf_dev_init( )
+	 * is not cleared, it will fail when following rte_intr_enable( ) tries
+	 * to map Rx queue interrupt to other VFIO vectors.
+	 * So clear uio/vfio intr/evevnfd first to avoid failure.
+	 */
+	rte_intr_disable(intr_handle);
+
 	rte_intr_enable(intr_handle);
 
 	/* Re-enable interrupt for VF */
--

2.7.5

A message that is not in the archive (sent off-list or not yet received): B90411854DEF0649BE56FC396188B4FC3B930AFE@SHSMSX104.ccr.corp.intel.com

author
#4 lore raw

I look through from web browser and not find following mail from Jianwei Ma <[email protected]> Hope this can add his test result in the mail list to community.

Quoted 81 lines

-----Original Message-----
From: Ma, Jianwei
Sent: Tuesday, October 10, 2017 4:47 PM
To: Dai, Wei <[email protected]>; Lu, Wenzhuo <[email protected]>; Ananyev, Konstantin <[email protected]>; Liang, Cunming <[email protected]>
Cc: [email protected]; [email protected]
Subject: RE: [PATCH v2] net/ixgbe: fix VFIO interrupt mapping in VF

Verified with l3fwd-power. It worked well with this patch plus
http://dpdk.org/dev/patchwork/patch/29000/ " [dpdk-dev] net/ixgbe: fix Rx queue interrupt mapping in VF"

-----Original Message-----
From: Dai, Wei
Sent: Tuesday, October 10, 2017 11:30
To: Lu, Wenzhuo <[email protected]>; Ananyev, Konstantin <[email protected]>; Liang, Cunming <[email protected]>; Ma, Jianwei <[email protected]>
Cc: [email protected]; [email protected]
Subject: RE: [PATCH v2] net/ixgbe: fix VFIO interrupt mapping in VF

Hi, Jianwei
How about your test result ?

Hi Wenzhuo
Would you please review this patch ?

Thanks a lot !

Quoted 9 lines

-----Original Message-----
From: Dai, Wei
Sent: Thursday, September 28, 2017 10:29 AM
To: Lu, Wenzhuo <[email protected]>; Ananyev, Konstantin <[email protected]>; Liang, Cunming <[email protected]>; Ma, Jianwei <[email protected]>
Cc: [email protected]; Dai, Wei <[email protected]>; [email protected]
Subject: [PATCH v2] net/ixgbe: fix VFIO interrupt mapping in VF

Quoted 7 lines

When a VF port is bound to VFIO-PIC, only miscellaneous interrupt is mapped to VFIO vector 0 in eth_ixgbevf_dev_init( ).
In ixgbevf_dev_start(), if previous VFIO interrupt mapping set in eth_ixgbevf_dev_init( ) is not cleard, it will fail when calling rte_intr_enable( ) tries to map Rx queue interrupt to other VFIO vectors. This patch clears the VFIO interrupt mappings before setting both miscellaneous and Rx queue interrupt mappings again to avoid

failure.

Quoted 6 lines
Fixes 77234603fba0 ("net/ixgbe: support VF mailbox interrupt for link

up/down")
Cc: [email protected]

Quoted 27 lines
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 9 +++++++++
 1 file changed, 9 insertions(+)
drivers/net/ixgbe/ixgbe_ethdev.c +9 -1
index 9ca5cbc..f49c616 100644
@@ -5046,6 +5046,15 @@ ixgbevf_dev_start(struct rte_eth_dev *dev)
 	}
 	ixgbevf_configure_msix(dev);
 
+	/* When a VF port is bound to VFIO-PCI, only miscellaneous interrupt
+	 * is mapped to VFIO vector 0 in eth_ixgbevf_dev_init( ).
+	 * If previous VFIO interrupt mapping setting in eth_ixgbevf_dev_init( )
+	 * is not cleared, it will fail when following rte_intr_enable( ) tries
+	 * to map Rx queue interrupt to other VFIO vectors.
+	 * So clear uio/vfio intr/evevnfd first to avoid failure.
+	 */
+	rte_intr_disable(intr_handle);
+
 	rte_intr_enable(intr_handle);
 
 	/* Re-enable interrupt for VF */
--

2.7.5

author Tested-by Jianwei Ma
#5 lore raw
In reply to a message not in the archive

Reply for correct mail format.

Quoted 14 lines

-----Original Message-----
From: Dai, Wei
Sent: Wednesday, October 11, 2017 3:07 PM
To: Ma, Jianwei <[email protected]>; Lu, Wenzhuo <[email protected]>; Ananyev, Konstantin <[email protected]>; Liang, Cunming <[email protected]>
Cc: [email protected]; [email protected]
Subject: RE: [PATCH v2] net/ixgbe: fix VFIO interrupt mapping in VF

I look through from web browser and not find following mail from Jianwei Ma <[email protected]> Hope this can add his test result in the mail list to community.

Quoted 56 lines
Quoted 4 lines

-----Original Message-----
From: Ma, Jianwei
Sent: Tuesday, October 10, 2017 4:47 PM
To: Dai, Wei <[email protected]>; Lu, Wenzhuo

<[email protected]>;

Quoted 51 lines

Ananyev, Konstantin <[email protected]>; Liang, Cunming <[email protected]>
Cc: [email protected]; [email protected]
Subject: RE: [PATCH v2] net/ixgbe: fix VFIO interrupt mapping in VF

Verified with l3fwd-power. It worked well with this patch plus
http://dpdk.org/dev/patchwork/patch/29000/ " [dpdk-dev] net/ixgbe:
fix Rx queue interrupt mapping in VF"

-----Original Message-----
From: Dai, Wei
Sent: Tuesday, October 10, 2017 11:30
To: Lu, Wenzhuo <[email protected]>; Ananyev, Konstantin <[email protected]>; Liang, Cunming <[email protected]>; Ma, Jianwei <[email protected]>
Cc: [email protected]; [email protected]
Subject: RE: [PATCH v2] net/ixgbe: fix VFIO interrupt mapping in VF

Hi, Jianwei
How about your test result ?

Hi Wenzhuo
Would you please review this patch ?

Thanks a lot !

Quoted 9 lines

-----Original Message-----
From: Dai, Wei
Sent: Thursday, September 28, 2017 10:29 AM
To: Lu, Wenzhuo <[email protected]>; Ananyev, Konstantin <[email protected]>; Liang, Cunming <[email protected]>; Ma, Jianwei <[email protected]>
Cc: [email protected]; Dai, Wei <[email protected]>; [email protected]
Subject: [PATCH v2] net/ixgbe: fix VFIO interrupt mapping in VF

Quoted 8 lines

When a VF port is bound to VFIO-PIC, only miscellaneous interrupt is mapped to VFIO vector 0 in eth_ixgbevf_dev_init( ).
In ixgbevf_dev_start(), if previous VFIO interrupt mapping set in eth_ixgbevf_dev_init( ) is not cleard, it will fail when calling rte_intr_enable( ) tries to map Rx queue interrupt to other VFIO vectors. This patch clears the VFIO interrupt mappings before setting both miscellaneous and Rx queue interrupt mappings again to avoid

failure.

Quoted 7 lines
Fixes 77234603fba0 ("net/ixgbe: support VF mailbox interrupt for

link
up/down")
Cc: [email protected]

Quoted 29 lines
Quoted 13 lines
Quoted 13 lines
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 9 +++++++++
 1 file changed, 9 insertions(+)
drivers/net/ixgbe/ixgbe_ethdev.c +0 -0
index 9ca5cbc..f49c616 100644
@@ -5046,6 +5046,15 @@ ixgbevf_dev_start(struct rte_eth_dev *dev)
 	}
 	ixgbevf_configure_msix(dev);
 
Quoted 1 line

drivers/net/ixgbe/ixgbe_ethdev.c ixgbevf_dev_start(struct rte_eth_dev *dev) · line 5049

Quoted 1 line
drivers/net/ixgbe/ixgbe_ethdev.c +1 -0
+	/* When a VF port is bound to VFIO-PCI, only miscellaneous

interrupt

Quoted 2 lines

drivers/net/ixgbe/ixgbe_ethdev.c ixgbevf_dev_start(struct rte_eth_dev *dev) · line 5051

Quoted 2 lines
drivers/net/ixgbe/ixgbe_ethdev.c +2 -0
+	 * is mapped to VFIO vector 0 in eth_ixgbevf_dev_init( ).
+	 * If previous VFIO interrupt mapping setting in

eth_ixgbevf_dev_init( )

Quoted 11 lines
Quoted 11 lines
drivers/net/ixgbe/ixgbe_ethdev.c +6 -1
+	 * is not cleared, it will fail when following rte_intr_enable( ) tries
+	 * to map Rx queue interrupt to other VFIO vectors.
+	 * So clear uio/vfio intr/evevnfd first to avoid failure.
+	 */
+	rte_intr_disable(intr_handle);
+
 	rte_intr_enable(intr_handle);
 
 	/* Re-enable interrupt for VF */
--

2.7.5

Acked-by on v2 1/1
#6 lore raw
In reply to Wei Dai

Hi,

Quoted 17 lines

-----Original Message-----
From: Dai, Wei
Sent: Thursday, September 28, 2017 10:29 AM
To: Lu, Wenzhuo <[email protected]>; Ananyev, Konstantin <[email protected]>; Liang, Cunming <[email protected]>; Ma, Jianwei <[email protected]>
Cc: [email protected]; Dai, Wei <[email protected]>; [email protected]
Subject: [PATCH v2] net/ixgbe: fix VFIO interrupt mapping in VF

When a VF port is bound to VFIO-PIC, only miscellaneous interrupt is mapped to VFIO vector 0 in eth_ixgbevf_dev_init( ).
In ixgbevf_dev_start(), if previous VFIO interrupt mapping set in eth_ixgbevf_dev_init( ) is not cleard, it will fail when calling rte_intr_enable( ) tries to map Rx queue interrupt to other VFIO vectors. This patch clears the VFIO interrupt mappings before setting both miscellaneous and Rx queue interrupt mappings again to avoid failure.

Quoted 5 lines
Fixes 77234603fba0 ("net/ixgbe: support VF mailbox interrupt for link

up/down")
Cc: [email protected]

Applied
#7 lore raw
Quoted 19 lines · Wenzhuo

Hi,

Quoted 17 lines

-----Original Message-----
From: Dai, Wei
Sent: Thursday, September 28, 2017 10:29 AM
To: Lu, Wenzhuo <[email protected]>; Ananyev, Konstantin <[email protected]>; Liang, Cunming <[email protected]>; Ma, Jianwei <[email protected]>
Cc: [email protected]; Dai, Wei <[email protected]>; [email protected]
Subject: [PATCH v2] net/ixgbe: fix VFIO interrupt mapping in VF

When a VF port is bound to VFIO-PIC, only miscellaneous interrupt is mapped to VFIO vector 0 in eth_ixgbevf_dev_init( ).
In ixgbevf_dev_start(), if previous VFIO interrupt mapping set in eth_ixgbevf_dev_init( ) is not cleard, it will fail when calling rte_intr_enable( ) tries to map Rx queue interrupt to other VFIO vectors. This patch clears the VFIO interrupt mappings before setting both miscellaneous and Rx queue interrupt mappings again to avoid failure.

Quoted 6 lines
Quoted 5 lines
Fixes 77234603fba0 ("net/ixgbe: support VF mailbox interrupt for link

up/down")
Cc: [email protected]

Applied to dpdk-next-net/master, thanks.