patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH] net/e1000: fix cannot getting Rx interrupts issue
@ 2017-11-03  9:40 Xiaoyun Li
  2017-11-03  9:57 ` Luca Boccassi
  0 siblings, 1 reply; 4+ messages in thread
From: Xiaoyun Li @ 2017-11-03  9:40 UTC (permalink / raw)
  To: qabuild; +Cc: Xiaoyun Li, stable

When using VFIO and MSIX interrupt mode, cannot get Rx interrupts. Because
the interrupt vectors that are used by VFIO are not enabled. This patch
fixes this issue.

Fixes: c3cd3de0ab50 ("igb: enable Rx queue interrupts for PF")
Cc: stable@dpdk.org

Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
---
 drivers/net/e1000/igb_ethdev.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c
index 003bdf0..dc70d22 100644
--- a/drivers/net/e1000/igb_ethdev.c
+++ b/drivers/net/e1000/igb_ethdev.c
@@ -5387,7 +5387,14 @@ eth_igb_rx_queue_intr_disable(struct rte_eth_dev *dev, uint16_t queue_id)
 {
 	struct e1000_hw *hw =
 		E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private);
-	uint32_t mask = 1 << queue_id;
+	struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
+	struct rte_intr_handle *intr_handle = &pci_dev->intr_handle;
+	uint32_t vec = E1000_MISC_VEC_ID;
+
+	if (rte_intr_allow_others(intr_handle))
+		vec = E1000_RX_VEC_START;
+
+	uint32_t mask = 1 << (queue_id + vec);
 
 	E1000_WRITE_REG(hw, E1000_EIMC, mask);
 	E1000_WRITE_FLUSH(hw);
@@ -5402,7 +5409,12 @@ eth_igb_rx_queue_intr_enable(struct rte_eth_dev *dev, uint16_t queue_id)
 		E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 	struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
 	struct rte_intr_handle *intr_handle = &pci_dev->intr_handle;
-	uint32_t mask = 1 << queue_id;
+	uint32_t vec = E1000_MISC_VEC_ID;
+
+	if (rte_intr_allow_others(intr_handle))
+		vec = E1000_RX_VEC_START;
+
+	uint32_t mask = 1 << (queue_id + vec);
 	uint32_t regval;
 
 	regval = E1000_READ_REG(hw, E1000_EIMS);
-- 
2.7.4

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-stable] [PATCH] net/e1000: fix cannot getting Rx interrupts issue
  2017-11-03  9:40 [dpdk-stable] [PATCH] net/e1000: fix cannot getting Rx interrupts issue Xiaoyun Li
@ 2017-11-03  9:57 ` Luca Boccassi
  2017-11-03 11:06   ` Li, Xiaoyun
  0 siblings, 1 reply; 4+ messages in thread
From: Luca Boccassi @ 2017-11-03  9:57 UTC (permalink / raw)
  To: Xiaoyun Li, qabuild; +Cc: stable

On Fri, 2017-11-03 at 17:40 +0800, Xiaoyun Li wrote:
> When using VFIO and MSIX interrupt mode, cannot get Rx interrupts.
> Because
> the interrupt vectors that are used by VFIO are not enabled. This
> patch
> fixes this issue.
> 
> Fixes: c3cd3de0ab50 ("igb: enable Rx queue interrupts for PF")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
> ---
>  drivers/net/e1000/igb_ethdev.c | 16 ++++++++++++++--
>  1 file changed, 14 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/e1000/igb_ethdev.c
> b/drivers/net/e1000/igb_ethdev.c
> index 003bdf0..dc70d22 100644
> --- a/drivers/net/e1000/igb_ethdev.c
> +++ b/drivers/net/e1000/igb_ethdev.c
> @@ -5387,7 +5387,14 @@ eth_igb_rx_queue_intr_disable(struct
> rte_eth_dev *dev, uint16_t queue_id)
>  {
>  	struct e1000_hw *hw =
>  		E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private);
> -	uint32_t mask = 1 << queue_id;
> +	struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
> +	struct rte_intr_handle *intr_handle = &pci_dev->intr_handle;
> +	uint32_t vec = E1000_MISC_VEC_ID;
> +
> +	if (rte_intr_allow_others(intr_handle))
> +		vec = E1000_RX_VEC_START;
> +
> +	uint32_t mask = 1 << (queue_id + vec);
>  
>  	E1000_WRITE_REG(hw, E1000_EIMC, mask);
>  	E1000_WRITE_FLUSH(hw);
> @@ -5402,7 +5409,12 @@ eth_igb_rx_queue_intr_enable(struct
> rte_eth_dev *dev, uint16_t queue_id)
>  		E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private);
>  	struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
>  	struct rte_intr_handle *intr_handle = &pci_dev->intr_handle;
> -	uint32_t mask = 1 << queue_id;
> +	uint32_t vec = E1000_MISC_VEC_ID;
> +
> +	if (rte_intr_allow_others(intr_handle))
> +		vec = E1000_RX_VEC_START;
> +
> +	uint32_t mask = 1 << (queue_id + vec);
>  	uint32_t regval;
>  
>  	regval = E1000_READ_REG(hw, E1000_EIMS);

Hi,

Has this fix, or a version of this fix, being accepted into dpdk/master
? I did a quick search in the git log but cannot see it.

If it has, it applies to 16.11 with a small change to get the pci_dev
in the "old way", so if you would like it in 16.11.4 and it's accepted
in mainline let me know.

-- 
Kind regards,
Luca Boccassi

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-stable] [PATCH] net/e1000: fix cannot getting Rx interrupts issue
  2017-11-03  9:57 ` Luca Boccassi
@ 2017-11-03 11:06   ` Li, Xiaoyun
  0 siblings, 0 replies; 4+ messages in thread
From: Li, Xiaoyun @ 2017-11-03 11:06 UTC (permalink / raw)
  To: Luca Boccassi, qabuild; +Cc: stable



> -----Original Message-----
> From: Luca Boccassi [mailto:bluca@debian.org]
> Sent: Friday, November 3, 2017 17:58
> To: Li, Xiaoyun <xiaoyun.li@intel.com>; qabuild <qabuild@intel.com>
> Cc: stable@dpdk.org
> Subject: Re: [dpdk-stable] [PATCH] net/e1000: fix cannot getting Rx interrupts
> issue
> 
> On Fri, 2017-11-03 at 17:40 +0800, Xiaoyun Li wrote:
> > When using VFIO and MSIX interrupt mode, cannot get Rx interrupts.
> > Because
> > the interrupt vectors that are used by VFIO are not enabled. This
> > patch fixes this issue.
> >
> > Fixes: c3cd3de0ab50 ("igb: enable Rx queue interrupts for PF")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
> > ---
> >  drivers/net/e1000/igb_ethdev.c | 16 ++++++++++++++--
> >  1 file changed, 14 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/net/e1000/igb_ethdev.c
> > b/drivers/net/e1000/igb_ethdev.c index 003bdf0..dc70d22 100644
> > --- a/drivers/net/e1000/igb_ethdev.c
> > +++ b/drivers/net/e1000/igb_ethdev.c
> > @@ -5387,7 +5387,14 @@ eth_igb_rx_queue_intr_disable(struct
> > rte_eth_dev *dev, uint16_t queue_id)
> >  {
> >  	struct e1000_hw *hw =
> >  		E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private);
> > -	uint32_t mask = 1 << queue_id;
> > +	struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
> > +	struct rte_intr_handle *intr_handle = &pci_dev->intr_handle;
> > +	uint32_t vec = E1000_MISC_VEC_ID;
> > +
> > +	if (rte_intr_allow_others(intr_handle))
> > +		vec = E1000_RX_VEC_START;
> > +
> > +	uint32_t mask = 1 << (queue_id + vec);
> >
> >  	E1000_WRITE_REG(hw, E1000_EIMC, mask);
> >  	E1000_WRITE_FLUSH(hw);
> > @@ -5402,7 +5409,12 @@ eth_igb_rx_queue_intr_enable(struct
> > rte_eth_dev *dev, uint16_t queue_id)
> >  		E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private);
> >  	struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
> >  	struct rte_intr_handle *intr_handle = &pci_dev->intr_handle;
> > -	uint32_t mask = 1 << queue_id;
> > +	uint32_t vec = E1000_MISC_VEC_ID;
> > +
> > +	if (rte_intr_allow_others(intr_handle))
> > +		vec = E1000_RX_VEC_START;
> > +
> > +	uint32_t mask = 1 << (queue_id + vec);
> >  	uint32_t regval;
> >
> >  	regval = E1000_READ_REG(hw, E1000_EIMS);
> 
> Hi,
> 
> Has this fix, or a version of this fix, being accepted into dpdk/master ? I did a
> quick search in the git log but cannot see it.
> 
> If it has, it applies to 16.11 with a small change to get the pci_dev in the "old
> way", so if you would like it in 16.11.4 and it's accepted in mainline let me
> know.
>
No, it's a new patch and not acked or accepted. I just wanted to send it to qabuild
to do IP check. But forgot that the commit log include stable@dpdk.org.
Sorry.

/Xiaoyun
 
> --
> Kind regards,
> Luca Boccassi

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [dpdk-stable] [PATCH] net/e1000: fix cannot getting Rx interrupts issue
@ 2017-11-03 11:17 Xiaoyun Li
  0 siblings, 0 replies; 4+ messages in thread
From: Xiaoyun Li @ 2017-11-03 11:17 UTC (permalink / raw)
  To: wenzhuo.lu; +Cc: qiming.yang, jingjing.wu, beilei.xing, dev, Xiaoyun Li, stable

When using VFIO and MSIX interrupt mode, cannot get Rx interrupts. Because
the interrupt vectors that are used by VFIO are not enabled. This patch
fixes this issue.

Fixes: c3cd3de0ab50 ("igb: enable Rx queue interrupts for PF")
Cc: stable@dpdk.org

Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
---
 drivers/net/e1000/igb_ethdev.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c
index 003bdf0..dc70d22 100644
--- a/drivers/net/e1000/igb_ethdev.c
+++ b/drivers/net/e1000/igb_ethdev.c
@@ -5387,7 +5387,14 @@ eth_igb_rx_queue_intr_disable(struct rte_eth_dev *dev, uint16_t queue_id)
 {
 	struct e1000_hw *hw =
 		E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private);
-	uint32_t mask = 1 << queue_id;
+	struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
+	struct rte_intr_handle *intr_handle = &pci_dev->intr_handle;
+	uint32_t vec = E1000_MISC_VEC_ID;
+
+	if (rte_intr_allow_others(intr_handle))
+		vec = E1000_RX_VEC_START;
+
+	uint32_t mask = 1 << (queue_id + vec);
 
 	E1000_WRITE_REG(hw, E1000_EIMC, mask);
 	E1000_WRITE_FLUSH(hw);
@@ -5402,7 +5409,12 @@ eth_igb_rx_queue_intr_enable(struct rte_eth_dev *dev, uint16_t queue_id)
 		E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 	struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
 	struct rte_intr_handle *intr_handle = &pci_dev->intr_handle;
-	uint32_t mask = 1 << queue_id;
+	uint32_t vec = E1000_MISC_VEC_ID;
+
+	if (rte_intr_allow_others(intr_handle))
+		vec = E1000_RX_VEC_START;
+
+	uint32_t mask = 1 << (queue_id + vec);
 	uint32_t regval;
 
 	regval = E1000_READ_REG(hw, E1000_EIMS);
-- 
2.7.4

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-11-03 11:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-03  9:40 [dpdk-stable] [PATCH] net/e1000: fix cannot getting Rx interrupts issue Xiaoyun Li
2017-11-03  9:57 ` Luca Boccassi
2017-11-03 11:06   ` Li, Xiaoyun
2017-11-03 11:17 Xiaoyun Li

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).