Skip to contentSkip to conversation

ixgbe: initialize scattered_rx during dev_configure

PATCH In review David Harton 2 participants 3 messages Aug 23, 2017 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ixgbe: initialize scattered_rx during dev_configure

An application may want to manipulate the MTU settings of a device without having to start the device first. In order to remove the need to start the device the ixgbe/ixgbevf drivers need to initialize the scattered_rx value during dev_configure.

---
 drivers/net/ixgbe/ixgbe_ethdev.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
drivers/net/ixgbe/ixgbe_ethdev.c +14 -0
index 22171d8..e85bdb4 100644
@@ -2372,6 +2372,13 @@ static int eth_ixgbevf_pci_remove(struct rte_pci_device *pci_dev)
 	intr->flags |= IXGBE_FLAG_NEED_LINK_UPDATE;
 
 	/*
+	 * Update scattered_rx so we can update MTU immediately
+	 * following configure without having to start the device
+	 */
+	if (dev->data->dev_conf.rxmode.enable_scatter)
+		dev->data->scattered_rx = 1;
+
+	/*
 	 * Initialize to TRUE. If any of Rx queues doesn't meet the bulk
 	 * allocation or vector Rx preconditions we will reset it.
 	 */
@@ -4949,6 +4956,13 @@ static int ixgbevf_dev_xstats_get_names(__rte_unused struct rte_eth_dev *dev,
 #endif
 
 	/*
+	 * Update scattered_rx so we can update MTU immediately
+	 * following configure without having to start the device
+	 */
+	if (dev->data->dev_conf.rxmode.enable_scatter)
+		dev->data->scattered_rx = 1;
+
+	/*
 	 * Initialize to TRUE. If any of Rx queues doesn't meet the bulk
 	 * allocation or vector Rx preconditions we will reset it.
 	 */
Signature · 1 line
1.8.3.1
#1 lore raw

Hi David,

Quoted 6 lines

An application may want to manipulate the MTU settings of a device without having to start the device first. In order to remove the need to start the device the ixgbe/ixgbevf drivers need to initialize the scattered_rx value during dev_configure.

Not sure how that would help?
As I can see ixgbe_dev_mtu_set() uses rx_conf->enable_scatter to check is multiseg RX allowed or not.
Konstantin

Quoted 40 lines
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
drivers/net/ixgbe/ixgbe_ethdev.c +14 -1
index 22171d8..e85bdb4 100644
@@ -2372,6 +2372,13 @@ static int eth_ixgbevf_pci_remove(struct rte_pci_device *pci_dev)
 	intr->flags |= IXGBE_FLAG_NEED_LINK_UPDATE;
 
 	/*
+	 * Update scattered_rx so we can update MTU immediately
+	 * following configure without having to start the device
+	 */
+	if (dev->data->dev_conf.rxmode.enable_scatter)
+		dev->data->scattered_rx = 1;
+
+	/*
 	 * Initialize to TRUE. If any of Rx queues doesn't meet the bulk
 	 * allocation or vector Rx preconditions we will reset it.
 	 */
@@ -4949,6 +4956,13 @@ static int ixgbevf_dev_xstats_get_names(__rte_unused struct rte_eth_dev *dev,
 #endif
 
 	/*
+	 * Update scattered_rx so we can update MTU immediately
+	 * following configure without having to start the device
+	 */
+	if (dev->data->dev_conf.rxmode.enable_scatter)
+		dev->data->scattered_rx = 1;
+
+	/*
 	 * Initialize to TRUE. If any of Rx queues doesn't meet the bulk
 	 * allocation or vector Rx preconditions we will reset it.
 	 */
--

1.8.3.1

#2 lore raw
Quoted 17 lines

-----Original Message-----
From: Ananyev, Konstantin [mailto:[email protected]]
Sent: Wednesday, August 23, 2017 6:32 AM
To: David Harton (dharton) <[email protected]>; [email protected]
Cc: [email protected]
Subject: RE: [PATCH] ixgbe: initialize scattered_rx during dev_configure

Hi David,

Quoted 6 lines

An application may want to manipulate the MTU settings of a device without having to start the device first.
In order to remove the need to start the device the ixgbe/ixgbevf drivers need to initialize the scattered_rx value during dev_configure.

Quoted 3 lines

Not sure how that would help?
As I can see ixgbe_dev_mtu_set() uses rx_conf->enable_scatter to check is multiseg RX allowed or not.

Hi Konstantin,

I see. The problem has been fixed already. Originally (v2.2), the check in ixgbe_dev_mtu_set() was made against dev->data->scattered_rx but it has been changed.

Sorry, I'll rescind the request.

Thanks!
Dave

Quoted 45 lines

Konstantin

drivers/net/ixgbe/ixgbe_ethdev.c static int eth_ixgbevf_pci_remove(struct

Quoted 12 lines
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
drivers/net/ixgbe/ixgbe_ethdev.c +0 -0
index 22171d8..e85bdb4 100644
@@ -2372,6 +2372,13 @@ static int eth_ixgbevf_pci_remove(struct

rte_pci_device *pci_dev)

Quoted 30 lines
drivers/net/ixgbe/ixgbe_ethdev.c +14 -0
 	intr->flags |= IXGBE_FLAG_NEED_LINK_UPDATE;
 
 	/*
+	 * Update scattered_rx so we can update MTU immediately
+	 * following configure without having to start the device
+	 */
+	if (dev->data->dev_conf.rxmode.enable_scatter)
+		dev->data->scattered_rx = 1;
+
+	/*
 	 * Initialize to TRUE. If any of Rx queues doesn't meet the bulk
 	 * allocation or vector Rx preconditions we will reset it.
 	 */
@@ -4949,6 +4956,13 @@ static int
 ixgbevf_dev_xstats_get_names(__rte_unused struct rte_eth_dev *dev,
 #endif
 
 	/*
+	 * Update scattered_rx so we can update MTU immediately
+	 * following configure without having to start the device
+	 */
+	if (dev->data->dev_conf.rxmode.enable_scatter)
+		dev->data->scattered_rx = 1;
+
+	/*
 	 * Initialize to TRUE. If any of Rx queues doesn't meet the bulk
 	 * allocation or vector Rx preconditions we will reset it.

*/
--
1.8.3.1