[dpdk-dev,v2] net/ixgbe: use queues assigned to PF instad of VF

Message ID 1472520209-51252-1-git-send-email-alexz@att.com (mailing list archive)
State Accepted, archived
Delegated to: Bruce Richardson
Headers

Commit Message

azelezniak Aug. 30, 2016, 1:23 a.m. UTC
  From: azelezniak <alexz@att.com>

v2:
* shorten Subject line 
* added more thorough description

v1:
this patch uses queues which belong to PF instead of queus 0 -
nb_rx_queues which belong to VF0 in SR-IOV configuration

Signed-off-by: Alex Zelezniak <alexz@att.com>

---
 drivers/net/ixgbe/ixgbe_ethdev.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
  

Comments

Wenzhuo Lu Sept. 8, 2016, 12:55 a.m. UTC | #1
Hi,

> -----Original Message-----
> From: Alex Zelezniak [mailto:alexz@att.com]
> Sent: Tuesday, August 30, 2016 9:23 AM
> To: dev@dpdk.org
> Cc: Lu, Wenzhuo; Yigit, Ferruh; stephen@networkplumber.org; azelezniak
> Subject: [PATCH v2] net/ixgbe: use queues assigned to PF instad of VF
> 
> From: azelezniak <alexz@att.com>
> 
> v2:
> * shorten Subject line
> * added more thorough description
> 
> v1:
> this patch uses queues which belong to PF instead of queus 0 - nb_rx_queues
> which belong to VF0 in SR-IOV configuration
> 
> Signed-off-by: Alex Zelezniak <alexz@att.com>
Acked-by: Wenzhuo Lu <Wenzhuo.lu@intel.com>
Thanks for the patch:)
  
Bruce Richardson Sept. 21, 2016, 12:47 p.m. UTC | #2
On Thu, Sep 08, 2016 at 12:55:00AM +0000, Lu, Wenzhuo wrote:
> Hi,
> 
> > -----Original Message-----
> > From: Alex Zelezniak [mailto:alexz@att.com]
> > Sent: Tuesday, August 30, 2016 9:23 AM
> > To: dev@dpdk.org
> > Cc: Lu, Wenzhuo; Yigit, Ferruh; stephen@networkplumber.org; azelezniak
> > Subject: [PATCH v2] net/ixgbe: use queues assigned to PF instad of VF
> > 
> > From: azelezniak <alexz@att.com>
> > 
> > v2:
> > * shorten Subject line
> > * added more thorough description
> > 
> > v1:
> > this patch uses queues which belong to PF instead of queus 0 - nb_rx_queues
> > which belong to VF0 in SR-IOV configuration
> > 
> > Signed-off-by: Alex Zelezniak <alexz@att.com>
> Acked-by: Wenzhuo Lu <Wenzhuo.lu@intel.com>
> Thanks for the patch:)
> 

Applied to dpdk-next-net/rel_16_11 with updated title "net/ixgbe: fix VF 
reset to apply to correct VF".

Regards,
/Bruce
  

Patch

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index bc2ad4b..d8d32f7 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -1779,6 +1779,7 @@  ixgbe_vlan_hw_strip_disable_all(struct rte_eth_dev *dev)
 		IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 	uint32_t ctrl;
 	uint16_t i;
+	struct ixgbe_rx_queue *rxq;
 
 	PMD_INIT_FUNC_TRACE();
 
@@ -1789,9 +1790,10 @@  ixgbe_vlan_hw_strip_disable_all(struct rte_eth_dev *dev)
 	} else {
 		/* Other 10G NIC, the VLAN strip can be setup per queue in RXDCTL */
 		for (i = 0; i < dev->data->nb_rx_queues; i++) {
-			ctrl = IXGBE_READ_REG(hw, IXGBE_RXDCTL(i));
+			rxq = dev->data->rx_queues[i];
+			ctrl = IXGBE_READ_REG(hw, IXGBE_RXDCTL(rxq->reg_idx));
 			ctrl &= ~IXGBE_RXDCTL_VME;
-			IXGBE_WRITE_REG(hw, IXGBE_RXDCTL(i), ctrl);
+			IXGBE_WRITE_REG(hw, IXGBE_RXDCTL(rxq->reg_idx), ctrl);
 
 			/* record those setting for HW strip per queue */
 			ixgbe_vlan_hw_strip_bitmap_set(dev, i, 0);
@@ -1806,6 +1808,7 @@  ixgbe_vlan_hw_strip_enable_all(struct rte_eth_dev *dev)
 		IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 	uint32_t ctrl;
 	uint16_t i;
+	struct ixgbe_rx_queue *rxq;
 
 	PMD_INIT_FUNC_TRACE();
 
@@ -1816,9 +1819,10 @@  ixgbe_vlan_hw_strip_enable_all(struct rte_eth_dev *dev)
 	} else {
 		/* Other 10G NIC, the VLAN strip can be setup per queue in RXDCTL */
 		for (i = 0; i < dev->data->nb_rx_queues; i++) {
-			ctrl = IXGBE_READ_REG(hw, IXGBE_RXDCTL(i));
+			rxq = dev->data->rx_queues[i];
+			ctrl = IXGBE_READ_REG(hw, IXGBE_RXDCTL(rxq->reg_idx));
 			ctrl |= IXGBE_RXDCTL_VME;
-			IXGBE_WRITE_REG(hw, IXGBE_RXDCTL(i), ctrl);
+			IXGBE_WRITE_REG(hw, IXGBE_RXDCTL(rxq->reg_idx), ctrl);
 
 			/* record those setting for HW strip per queue */
 			ixgbe_vlan_hw_strip_bitmap_set(dev, i, 1);