Skip to contentSkip to conversation

net/iavf: add devargs to enable vf auto-reset

PATCH Superseded Shiyang He 4 participants 14 messages Aug 1, 2023 – Sep 27, 2023 Network drivers

lore
Share & tools
lore

Shiyang He

author
#0 lore raw

PATCH 1/1 net/iavf: add devargs to enable vf auto-reset

Originally, the iavf PMD does not perform special actions when it receives a PF-to-VF reset event, resulting in vf being offline and unavailable.

This patch enables vf auto-reset by setting 'watchdog_period' devargs to true. The iavf PMD will perform an automatic reset to bring the vf back online when it receives a PF-to-VF event.

---
 doc/guides/nics/intel_vf.rst   |   3 +
 drivers/net/iavf/iavf.h        |  28 ++++++
 drivers/net/iavf/iavf_ethdev.c | 166 +++++++++++++++++++++++++++++++++
 drivers/net/iavf/iavf_rxtx.c   |  25 +++++
 drivers/net/iavf/iavf_rxtx.h   |   1 +
 drivers/net/iavf/iavf_vchnl.c  |   8 ++
 6 files changed, 231 insertions(+)
doc/guides/nics/intel_vf.rst +3 -0
index d365dbc185..c0acd2a7f5 100644
@@ -101,6 +101,9 @@ For more detail on SR-IOV, please refer to the following documents:
     Set ``devargs`` parameter ``watchdog_period`` to adjust the watchdog period in microseconds, or set it to 0 to disable the watchdog,
     for example, ``-a 18:01.0,watchdog_period=5000`` or ``-a 18:01.0,watchdog_period=0``.
 
+    Enable vf auto-reset by setting the ``devargs`` parameter like ``-a 18:01.0,enable_auto_reset=1`` when IAVF is backed
+    by an Intel® E810 device or an Intel® 700 Series Ethernet device.
+
 The PCIE host-interface of Intel Ethernet Switch FM10000 Series VF infrastructure
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
drivers/net/iavf/iavf.h +28 -0
index 98861e4242..a150b7d5cf 100644
@@ -95,6 +95,24 @@
 
 #define IAVF_L2TPV2_FLAGS_LEN	0x4000
 
+#ifndef DIV_ROUND_UP
+#define DIV_ROUND_UP(n, d) (	\
+{								\
+	const typeof(d) __d = d;	\
+	(((n) + (__d) - 1) / (__d));\
+}								\
+)
+#endif
+#ifndef DELAY
+#define DELAY(x) rte_delay_us(x)
+#endif
+#ifndef msleep
+#define msleep(x) DELAY(1000 * (x))
+#endif
+#ifndef usleep_range
+#define usleep_range(min, max) msleep(DIV_ROUND_UP(min, 1000))
+#endif
+
 struct iavf_adapter;
 struct iavf_rx_queue;
 struct iavf_tx_queue;
@@ -305,6 +323,7 @@ struct iavf_devargs {
 	uint8_t proto_xtr[IAVF_MAX_QUEUE_NUM];
 	uint16_t quanta_size;
 	uint32_t watchdog_period;
+	uint8_t  enable_auto_reset;
 };
 
 struct iavf_security_ctx;
@@ -424,6 +443,14 @@ _atomic_set_async_response_cmd(struct iavf_info *vf, enum virtchnl_ops ops)
 
 	return !ret;
 }
+
+static inline bool
+iavf_is_reset(struct iavf_hw *hw)
+{
+	return !(IAVF_READ_REG(hw, IAVF_VF_ARQLEN1) &
+		 IAVF_VF_ARQLEN1_ARQENABLE_MASK);
+}
+
 int iavf_check_api_version(struct iavf_adapter *adapter);
 int iavf_get_vf_resource(struct iavf_adapter *adapter);
 void iavf_dev_event_handler_fini(void);
@@ -501,4 +528,5 @@ int iavf_flow_sub_check(struct iavf_adapter *adapter,
 			struct iavf_fsub_conf *filter);
 void iavf_dev_watchdog_enable(struct iavf_adapter *adapter);
 void iavf_dev_watchdog_disable(struct iavf_adapter *adapter);
+int iavf_handle_hw_reset(struct rte_eth_dev *dev);
 #endif /* _IAVF_ETHDEV_H_ */
drivers/net/iavf/iavf_ethdev.c +166 -0

202 lines not on this page · raw message

drivers/net/iavf/iavf_rxtx.c +25 -0
index f7df4665d1..a1f556d1ce 100644
@@ -1094,6 +1094,31 @@ iavf_dev_tx_queue_release(struct rte_eth_dev *dev, uint16_t qid)
 	rte_free(q);
 }
 
+void
+iavf_reset_queues(struct rte_eth_dev *dev)
+{
+	struct iavf_rx_queue *rxq;
+	struct iavf_tx_queue *txq;
+	int i;
+
+	for (i = 0; i < dev->data->nb_tx_queues; i++) {
+		txq = dev->data->tx_queues[i];
+		if (!txq)
+			continue;
+		iavf_txq_release_mbufs_ops[txq->rel_mbufs_type].release_mbufs(txq);
+		reset_tx_queue(txq);
+		dev->data->tx_queue_state[i] = RTE_ETH_QUEUE_STATE_STOPPED;
+	}
+	for (i = 0; i < dev->data->nb_rx_queues; i++) {
+		rxq = dev->data->rx_queues[i];
+		if (!rxq)
+			continue;
+		iavf_rxq_release_mbufs_ops[rxq->rel_mbufs_type].release_mbufs(rxq);
+		reset_rx_queue(rxq);
+		dev->data->rx_queue_state[i] = RTE_ETH_QUEUE_STATE_STOPPED;
+	}
+}
+
 void
 iavf_stop_queues(struct rte_eth_dev *dev)
 {
drivers/net/iavf/iavf_rxtx.h +1 -0
index 605ea3f824..237022338e 100644
@@ -650,6 +650,7 @@ int iavf_dev_tx_queue_start(struct rte_eth_dev *dev, uint16_t tx_queue_id);
 int iavf_dev_tx_queue_stop(struct rte_eth_dev *dev, uint16_t tx_queue_id);
 int iavf_dev_tx_done_cleanup(void *txq, uint32_t free_cnt);
 void iavf_dev_tx_queue_release(struct rte_eth_dev *dev, uint16_t qid);
+void iavf_reset_queues(struct rte_eth_dev *dev);
 void iavf_stop_queues(struct rte_eth_dev *dev);
 uint16_t iavf_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
 		       uint16_t nb_pkts);
drivers/net/iavf/iavf_vchnl.c +8 -0
index 524732f67d..19e22ae283 100644
@@ -80,6 +80,14 @@ iavf_dev_event_handle(void *param __rte_unused)
 		TAILQ_FOREACH_SAFE(pos, &pending, next, save_next) {
 			TAILQ_REMOVE(&pending, pos, next);
 			rte_eth_dev_callback_process(pos->dev, pos->event, pos->param);
+
+			switch (pos->event) {
+			case RTE_ETH_EVENT_INTR_RESET:
+				iavf_handle_hw_reset(pos->dev);
+				break;
+			default:
+				break;
+			}
 			rte_free(pos);
 		}
 	}
Signature · 1 line
2.37.2
author
#1 lore raw

PATCH v2 1/1 net/iavf: add devargs to enable vf auto-reset

Originally, the iavf PMD does not perform special actions when it receives a PF-to-VF reset event, resulting in vf being offline and unavailable.

This patch enables vf auto-reset by setting 'watchdog_period' devargs to true. The iavf PMD will perform an automatic reset to bring the vf back online when it receives a PF-to-VF event.

v2: using event handler to handle reset

---
 doc/guides/nics/intel_vf.rst           |   3 +
 doc/guides/rel_notes/release_23_11.rst |   3 +
 drivers/net/iavf/iavf.h                |  31 +++++
 drivers/net/iavf/iavf_ethdev.c         | 177 ++++++++++++++++++++++++-
 drivers/net/iavf/iavf_rxtx.c           |  25 ++++
 drivers/net/iavf/iavf_rxtx.h           |   1 +
 drivers/net/iavf/iavf_vchnl.c          |  11 +-
 7 files changed, 248 insertions(+), 3 deletions(-)
doc/guides/nics/intel_vf.rst +3 -0
index d365dbc185..c0acd2a7f5 100644
@@ -101,6 +101,9 @@ For more detail on SR-IOV, please refer to the following documents:
     Set ``devargs`` parameter ``watchdog_period`` to adjust the watchdog period in microseconds, or set it to 0 to disable the watchdog,
     for example, ``-a 18:01.0,watchdog_period=5000`` or ``-a 18:01.0,watchdog_period=0``.
 
+    Enable vf auto-reset by setting the ``devargs`` parameter like ``-a 18:01.0,enable_auto_reset=1`` when IAVF is backed
+    by an Intel® E810 device or an Intel® 700 Series Ethernet device.
+
 The PCIE host-interface of Intel Ethernet Switch FM10000 Series VF infrastructure
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
doc/guides/rel_notes/release_23_11.rst +3 -0
index 4411bb32c1..80e2d7672f 100644
@@ -72,6 +72,9 @@ New Features
      Also, make sure to start the actual text at the margin.
      =======================================================
 
+* **Updated Intel iavf driver.**
+
+  Added support for iavf auto-reset.
 
 Removed Items
 -------------
drivers/net/iavf/iavf.h +31 -0
index 98861e4242..e78bcda962 100644
@@ -95,6 +95,24 @@
 
 #define IAVF_L2TPV2_FLAGS_LEN	0x4000
 
+#ifndef DIV_ROUND_UP
+#define DIV_ROUND_UP(n, d) (	\
+{								\
+	const typeof(d) __d = d;	\
+	(((n) + (__d) - 1) / (__d));\
+}								\
+)
+#endif
+#ifndef DELAY
+#define DELAY(x) rte_delay_us(x)
+#endif
+#ifndef msleep
+#define msleep(x) DELAY(1000 * (x))
+#endif
+#ifndef usleep_range
+#define usleep_range(min, max) msleep(DIV_ROUND_UP(min, 1000))
+#endif
+
 struct iavf_adapter;
 struct iavf_rx_queue;
 struct iavf_tx_queue;
@@ -305,6 +323,7 @@ struct iavf_devargs {
 	uint8_t proto_xtr[IAVF_MAX_QUEUE_NUM];
 	uint16_t quanta_size;
 	uint32_t watchdog_period;
+	uint8_t  enable_auto_reset;
 };
 
 struct iavf_security_ctx;
@@ -424,8 +443,19 @@ _atomic_set_async_response_cmd(struct iavf_info *vf, enum virtchnl_ops ops)
 
 	return !ret;
 }
+
+static inline bool
+iavf_is_reset(struct iavf_hw *hw)
+{
+	return !(IAVF_READ_REG(hw, IAVF_VF_ARQLEN1) &
+		 IAVF_VF_ARQLEN1_ARQENABLE_MASK);
+}
+
 int iavf_check_api_version(struct iavf_adapter *adapter);
 int iavf_get_vf_resource(struct iavf_adapter *adapter);
+void iavf_dev_event_post(struct rte_eth_dev *dev,
+			enum rte_eth_event_type event,
+			void *param, size_t param_alloc_size);
 void iavf_dev_event_handler_fini(void);
 int iavf_dev_event_handler_init(void);
 void iavf_handle_virtchnl_msg(struct rte_eth_dev *dev);
@@ -501,4 +531,5 @@ int iavf_flow_sub_check(struct iavf_adapter *adapter,
 			struct iavf_fsub_conf *filter);
 void iavf_dev_watchdog_enable(struct iavf_adapter *adapter);
 void iavf_dev_watchdog_disable(struct iavf_adapter *adapter);
+int iavf_handle_hw_reset(struct rte_eth_dev *dev);
 #endif /* _IAVF_ETHDEV_H_ */
drivers/net/iavf/iavf_ethdev.c +175 -2

213 lines not on this page · raw message

drivers/net/iavf/iavf_rxtx.c +25 -0
index f7df4665d1..a1f556d1ce 100644
@@ -1094,6 +1094,31 @@ iavf_dev_tx_queue_release(struct rte_eth_dev *dev, uint16_t qid)
 	rte_free(q);
 }
 
+void
+iavf_reset_queues(struct rte_eth_dev *dev)
+{
+	struct iavf_rx_queue *rxq;
+	struct iavf_tx_queue *txq;
+	int i;
+
+	for (i = 0; i < dev->data->nb_tx_queues; i++) {
+		txq = dev->data->tx_queues[i];
+		if (!txq)
+			continue;
+		iavf_txq_release_mbufs_ops[txq->rel_mbufs_type].release_mbufs(txq);
+		reset_tx_queue(txq);
+		dev->data->tx_queue_state[i] = RTE_ETH_QUEUE_STATE_STOPPED;
+	}
+	for (i = 0; i < dev->data->nb_rx_queues; i++) {
+		rxq = dev->data->rx_queues[i];
+		if (!rxq)
+			continue;
+		iavf_rxq_release_mbufs_ops[rxq->rel_mbufs_type].release_mbufs(rxq);
+		reset_rx_queue(rxq);
+		dev->data->rx_queue_state[i] = RTE_ETH_QUEUE_STATE_STOPPED;
+	}
+}
+
 void
 iavf_stop_queues(struct rte_eth_dev *dev)
 {
drivers/net/iavf/iavf_rxtx.h +1 -0
index 605ea3f824..237022338e 100644
@@ -650,6 +650,7 @@ int iavf_dev_tx_queue_start(struct rte_eth_dev *dev, uint16_t tx_queue_id);
 int iavf_dev_tx_queue_stop(struct rte_eth_dev *dev, uint16_t tx_queue_id);
 int iavf_dev_tx_done_cleanup(void *txq, uint32_t free_cnt);
 void iavf_dev_tx_queue_release(struct rte_eth_dev *dev, uint16_t qid);
+void iavf_reset_queues(struct rte_eth_dev *dev);
 void iavf_stop_queues(struct rte_eth_dev *dev);
 uint16_t iavf_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
 		       uint16_t nb_pkts);
drivers/net/iavf/iavf_vchnl.c +10 -1
index 524732f67d..dffe91f8c9 100644
@@ -79,6 +79,15 @@ iavf_dev_event_handle(void *param __rte_unused)
 		struct iavf_event_element *pos, *save_next;
 		TAILQ_FOREACH_SAFE(pos, &pending, next, save_next) {
 			TAILQ_REMOVE(&pending, pos, next);
+
+			struct iavf_adapter *adapter = pos->dev->data->dev_private;
+			if (pos->event == RTE_ETH_EVENT_INTR_RESET &&
+			    adapter->devargs.enable_auto_reset) {
+				iavf_handle_hw_reset(pos->dev);
+				rte_free(pos);
+				continue;
+			}
+
 			rte_eth_dev_callback_process(pos->dev, pos->event, pos->param);
 			rte_free(pos);
 		}
@@ -87,7 +96,7 @@ iavf_dev_event_handle(void *param __rte_unused)
 	return 0;
 }
 
-static void
+void
 iavf_dev_event_post(struct rte_eth_dev *dev,
 		enum rte_eth_event_type event,
 		void *param, size_t param_alloc_size)
Signature · 1 line
2.37.2
author
#2 lore raw

PATCH v3 1/1 net/iavf: add devargs to enable vf auto-reset

Originally, the iavf PMD does not perform special actions when it receives a PF-to-VF reset event, resulting in vf being offline and unavailable.

This patch enables vf auto-reset by setting 'watchdog_period' devargs to true. The iavf PMD will perform an automatic reset to bring the vf back online when it receives a PF-to-VF event.

v2: handling reset by event handler
v3: change reset process

---
 doc/guides/nics/intel_vf.rst           |  3 +
 doc/guides/rel_notes/release_23_11.rst |  3 +
 drivers/net/iavf/iavf.h                |  7 +++
 drivers/net/iavf/iavf_ethdev.c         | 86 +++++++++++++++++++++++---
 drivers/net/iavf/iavf_rxtx.c           | 52 ++++++++++------
 drivers/net/iavf/iavf_vchnl.c          | 11 +++-
 6 files changed, 135 insertions(+), 27 deletions(-)
doc/guides/nics/intel_vf.rst +3 -0
index d365dbc185..c0acd2a7f5 100644
@@ -101,6 +101,9 @@ For more detail on SR-IOV, please refer to the following documents:
     Set ``devargs`` parameter ``watchdog_period`` to adjust the watchdog period in microseconds, or set it to 0 to disable the watchdog,
     for example, ``-a 18:01.0,watchdog_period=5000`` or ``-a 18:01.0,watchdog_period=0``.
 
+    Enable vf auto-reset by setting the ``devargs`` parameter like ``-a 18:01.0,enable_auto_reset=1`` when IAVF is backed
+    by an Intel® E810 device or an Intel® 700 Series Ethernet device.
+
 The PCIE host-interface of Intel Ethernet Switch FM10000 Series VF infrastructure
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
doc/guides/rel_notes/release_23_11.rst +3 -0
index 333e1d95a2..aeddb0d8f6 100644
@@ -78,6 +78,9 @@ New Features
 * build: Optional libraries can now be selected with the new ``enable_libs``
   build option similarly to the existing ``enable_drivers`` build option.
 
+* **Updated Intel iavf driver.**
+
+  * Added support for iavf auto-reset.
 
 Removed Items
 -------------
drivers/net/iavf/iavf.h +7 -0
index 98861e4242..3641401f38 100644
@@ -277,6 +277,8 @@ struct iavf_info {
 
 	struct rte_eth_dev *eth_dev;
 
+	bool in_reset_recovery;
+
 	uint32_t ptp_caps;
 	rte_spinlock_t phc_time_aq_lock;
 };
@@ -305,6 +307,7 @@ struct iavf_devargs {
 	uint8_t proto_xtr[IAVF_MAX_QUEUE_NUM];
 	uint16_t quanta_size;
 	uint32_t watchdog_period;
+	uint8_t  enable_auto_reset;
 };
 
 struct iavf_security_ctx;
@@ -426,6 +429,9 @@ _atomic_set_async_response_cmd(struct iavf_info *vf, enum virtchnl_ops ops)
 }
 int iavf_check_api_version(struct iavf_adapter *adapter);
 int iavf_get_vf_resource(struct iavf_adapter *adapter);
+void iavf_dev_event_post(struct rte_eth_dev *dev,
+		enum rte_eth_event_type event,
+		void *param, size_t param_alloc_size);
 void iavf_dev_event_handler_fini(void);
 int iavf_dev_event_handler_init(void);
 void iavf_handle_virtchnl_msg(struct rte_eth_dev *dev);
@@ -501,4 +507,5 @@ int iavf_flow_sub_check(struct iavf_adapter *adapter,
 			struct iavf_fsub_conf *filter);
 void iavf_dev_watchdog_enable(struct iavf_adapter *adapter);
 void iavf_dev_watchdog_disable(struct iavf_adapter *adapter);
+int iavf_handle_hw_reset(struct rte_eth_dev *dev);
 #endif /* _IAVF_ETHDEV_H_ */
drivers/net/iavf/iavf_ethdev.c +79 -7

153 lines not on this page · raw message

drivers/net/iavf/iavf_rxtx.c +33 -19

70 lines not on this page · raw message

drivers/net/iavf/iavf_vchnl.c +10 -1
index c31a6d5c98..0726dc87be 100644
@@ -79,6 +79,15 @@ iavf_dev_event_handle(void *param __rte_unused)
 		struct iavf_event_element *pos, *save_next;
 		TAILQ_FOREACH_SAFE(pos, &pending, next, save_next) {
 			TAILQ_REMOVE(&pending, pos, next);
+
+			struct iavf_adapter *adapter = pos->dev->data->dev_private;
+			if (pos->event == RTE_ETH_EVENT_INTR_RESET &&
+			    adapter->devargs.enable_auto_reset) {
+				iavf_handle_hw_reset(pos->dev);
+				rte_free(pos);
+				continue;
+			}
+
 			rte_eth_dev_callback_process(pos->dev, pos->event, pos->param);
 			rte_free(pos);
 		}
@@ -87,7 +96,7 @@ iavf_dev_event_handle(void *param __rte_unused)
 	return 0;
 }
 
-static void
+void
 iavf_dev_event_post(struct rte_eth_dev *dev,
 		enum rte_eth_event_type event,
 		void *param, size_t param_alloc_size)
Signature · 1 line
2.37.2
author
#3 lore raw

PATCH v4 1/1 net/iavf: add devargs to enable vf auto-reset

Originally, the iavf PMD does not perform special actions when it receives a PF-to-VF reset event, resulting in vf being offline and unavailable.

This patch enables vf auto-reset by setting 'watchdog_period' devargs to true. The iavf PMD will perform an automatic reset to bring the vf back online when it receives a PF-to-VF event.

v2: handling reset by event handler
v3: change reset process
v3: rebase

---
 doc/guides/nics/intel_vf.rst           |  3 +
 doc/guides/rel_notes/release_23_11.rst |  3 +
 drivers/net/iavf/iavf.h                |  7 +++
 drivers/net/iavf/iavf_ethdev.c         | 86 +++++++++++++++++++++++---
 drivers/net/iavf/iavf_rxtx.c           | 52 ++++++++++------
 drivers/net/iavf/iavf_vchnl.c          | 11 +++-
 6 files changed, 135 insertions(+), 27 deletions(-)
doc/guides/nics/intel_vf.rst +3 -0
index d365dbc185..c0acd2a7f5 100644
@@ -101,6 +101,9 @@ For more detail on SR-IOV, please refer to the following documents:
     Set ``devargs`` parameter ``watchdog_period`` to adjust the watchdog period in microseconds, or set it to 0 to disable the watchdog,
     for example, ``-a 18:01.0,watchdog_period=5000`` or ``-a 18:01.0,watchdog_period=0``.
 
+    Enable vf auto-reset by setting the ``devargs`` parameter like ``-a 18:01.0,enable_auto_reset=1`` when IAVF is backed
+    by an Intel® E810 device or an Intel® 700 Series Ethernet device.
+
 The PCIE host-interface of Intel Ethernet Switch FM10000 Series VF infrastructure
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
doc/guides/rel_notes/release_23_11.rst +3 -0
index 03191b3ae0..8536ce88f4 100644
@@ -86,6 +86,9 @@ New Features
 
   * Added support for port representor.
 
+* **Updated Intel iavf driver.**
+  * Added support for iavf auto-reset.
+
 Removed Items
 -------------
 
drivers/net/iavf/iavf.h +7 -0
index 98861e4242..3641401f38 100644
@@ -277,6 +277,8 @@ struct iavf_info {
 
 	struct rte_eth_dev *eth_dev;
 
+	bool in_reset_recovery;
+
 	uint32_t ptp_caps;
 	rte_spinlock_t phc_time_aq_lock;
 };
@@ -305,6 +307,7 @@ struct iavf_devargs {
 	uint8_t proto_xtr[IAVF_MAX_QUEUE_NUM];
 	uint16_t quanta_size;
 	uint32_t watchdog_period;
+	uint8_t  enable_auto_reset;
 };
 
 struct iavf_security_ctx;
@@ -426,6 +429,9 @@ _atomic_set_async_response_cmd(struct iavf_info *vf, enum virtchnl_ops ops)
 }
 int iavf_check_api_version(struct iavf_adapter *adapter);
 int iavf_get_vf_resource(struct iavf_adapter *adapter);
+void iavf_dev_event_post(struct rte_eth_dev *dev,
+		enum rte_eth_event_type event,
+		void *param, size_t param_alloc_size);
 void iavf_dev_event_handler_fini(void);
 int iavf_dev_event_handler_init(void);
 void iavf_handle_virtchnl_msg(struct rte_eth_dev *dev);
@@ -501,4 +507,5 @@ int iavf_flow_sub_check(struct iavf_adapter *adapter,
 			struct iavf_fsub_conf *filter);
 void iavf_dev_watchdog_enable(struct iavf_adapter *adapter);
 void iavf_dev_watchdog_disable(struct iavf_adapter *adapter);
+int iavf_handle_hw_reset(struct rte_eth_dev *dev);
 #endif /* _IAVF_ETHDEV_H_ */
drivers/net/iavf/iavf_ethdev.c +79 -7

153 lines not on this page · raw message

drivers/net/iavf/iavf_rxtx.c +33 -19

70 lines not on this page · raw message

drivers/net/iavf/iavf_vchnl.c +10 -1
index b3e106b41f..caf7cd6d8e 100644
@@ -79,6 +79,15 @@ iavf_dev_event_handle(void *param __rte_unused)
 		struct iavf_event_element *pos, *save_next;
 		TAILQ_FOREACH_SAFE(pos, &pending, next, save_next) {
 			TAILQ_REMOVE(&pending, pos, next);
+
+			struct iavf_adapter *adapter = pos->dev->data->dev_private;
+			if (pos->event == RTE_ETH_EVENT_INTR_RESET &&
+			    adapter->devargs.enable_auto_reset) {
+				iavf_handle_hw_reset(pos->dev);
+				rte_free(pos);
+				continue;
+			}
+
 			rte_eth_dev_callback_process(pos->dev, pos->event, pos->param);
 			rte_free(pos);
 		}
@@ -87,7 +96,7 @@ iavf_dev_event_handle(void *param __rte_unused)
 	return 0;
 }
 
-static void
+void
 iavf_dev_event_post(struct rte_eth_dev *dev,
 		enum rte_eth_event_type event,
 		void *param, size_t param_alloc_size)
Signature · 1 line
2.37.2
Acked-by on v4 1/1
#4 lore raw
Quoted 44 lines

-----Original Message-----
From: Shiyang He <[email protected]>
Sent: Tuesday, September 26, 2023 7:32 PM
To: [email protected]
Cc: Zhou, YidingX <[email protected]>; He, ShiyangX <[email protected]>; Wang, Liang-min <[email protected]>; Zhang, Yuying <[email protected]>; Xing, Beilei <[email protected]>; Su, Simei <[email protected]>; Wu, Wenjun1 <[email protected]>; Yang, Qiming <[email protected]>; Wu, Jingjing <[email protected]>
Subject: [PATCH v4] net/iavf: add devargs to enable vf auto-reset

Originally, the iavf PMD does not perform special actions when it receives a PF-to-VF reset event, resulting in vf being offline and unavailable.

This patch enables vf auto-reset by setting 'watchdog_period' devargs to true. The iavf PMD will perform an automatic reset to bring the vf back online when it receives a PF-to-VF event.

v2: handling reset by event handler
v3: change reset process
v3: rebase

---
 doc/guides/nics/intel_vf.rst           |  3 +
 doc/guides/rel_notes/release_23_11.rst |  3 +
 drivers/net/iavf/iavf.h                |  7 +++
 drivers/net/iavf/iavf_ethdev.c         | 86 +++++++++++++++++++++++---
 drivers/net/iavf/iavf_rxtx.c           | 52 ++++++++++------
 drivers/net/iavf/iavf_vchnl.c          | 11 +++-
 6 files changed, 135 insertions(+), 27 deletions(-)
doc/guides/nics/intel_vf.rst index renamed from doc/guides/nics/intel_vf.rst +0 -0

d365dbc185..c0acd2a7f5 100644

doc/guides/nics/intel_vf.rst +0 -0
@@ -101,6 +101,9 @@ For more detail on SR-IOV, please refer to the

following documents:
Set ``devargs`` parameter ``watchdog_period`` to adjust the watchdog
period in microseconds, or set it to 0 to disable the watchdog,

Quoted 5 lines
     for example, ``-a 18:01.0,watchdog_period=5000`` or ``-a

18:01.0,watchdog_period=0``.

+ Enable vf auto-reset by setting the ``devargs`` parameter like ``-a
18:01.0,enable_auto_reset=1`` when IAVF is backed

The argument enable_auto_reset=1 seems somewhat redundant; why not simply use auto_reset=1 instead?

Otherwise

author
#5 lore raw

PATCH v5 1/1 net/iavf: add devargs to enable vf auto-reset

In reply to Shiyang He

Originally, the iavf PMD does not perform special actions when it receives a PF-to-VF reset event, resulting in vf being offline and unavailable.

This patch enables vf auto-reset by setting 'watchdog_period' devargs to true. The iavf PMD will perform an automatic reset to bring the vf back online when it receives a PF-to-VF event.

v2: handling reset by event handler
v3: change reset process
v3: rebase

---
 doc/guides/nics/intel_vf.rst           |  3 +
 doc/guides/rel_notes/release_23_11.rst |  3 +
 drivers/net/iavf/iavf.h                |  7 +++
 drivers/net/iavf/iavf_ethdev.c         | 86 +++++++++++++++++++++++---
 drivers/net/iavf/iavf_rxtx.c           | 52 ++++++++++------
 drivers/net/iavf/iavf_vchnl.c          | 11 +++-
 6 files changed, 135 insertions(+), 27 deletions(-)
doc/guides/nics/intel_vf.rst +3 -0
index d365dbc185..c0acd2a7f5 100644
@@ -101,6 +101,9 @@ For more detail on SR-IOV, please refer to the following documents:
     Set ``devargs`` parameter ``watchdog_period`` to adjust the watchdog period in microseconds, or set it to 0 to disable the watchdog,
     for example, ``-a 18:01.0,watchdog_period=5000`` or ``-a 18:01.0,watchdog_period=0``.
 
+    Enable vf auto-reset by setting the ``devargs`` parameter like ``-a 18:01.0,enable_auto_reset=1`` when IAVF is backed
+    by an Intel® E810 device or an Intel® 700 Series Ethernet device.
+
 The PCIE host-interface of Intel Ethernet Switch FM10000 Series VF infrastructure
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
doc/guides/rel_notes/release_23_11.rst +3 -0
index 03191b3ae0..8536ce88f4 100644
@@ -86,6 +86,9 @@ New Features
 
   * Added support for port representor.
 
+* **Updated Intel iavf driver.**
+  * Added support for iavf auto-reset.
+
 Removed Items
 -------------
 
drivers/net/iavf/iavf.h +7 -0
index 98861e4242..3641401f38 100644
@@ -277,6 +277,8 @@ struct iavf_info {
 
 	struct rte_eth_dev *eth_dev;
 
+	bool in_reset_recovery;
+
 	uint32_t ptp_caps;
 	rte_spinlock_t phc_time_aq_lock;
 };
@@ -305,6 +307,7 @@ struct iavf_devargs {
 	uint8_t proto_xtr[IAVF_MAX_QUEUE_NUM];
 	uint16_t quanta_size;
 	uint32_t watchdog_period;
+	uint8_t  enable_auto_reset;
 };
 
 struct iavf_security_ctx;
@@ -426,6 +429,9 @@ _atomic_set_async_response_cmd(struct iavf_info *vf, enum virtchnl_ops ops)
 }
 int iavf_check_api_version(struct iavf_adapter *adapter);
 int iavf_get_vf_resource(struct iavf_adapter *adapter);
+void iavf_dev_event_post(struct rte_eth_dev *dev,
+		enum rte_eth_event_type event,
+		void *param, size_t param_alloc_size);
 void iavf_dev_event_handler_fini(void);
 int iavf_dev_event_handler_init(void);
 void iavf_handle_virtchnl_msg(struct rte_eth_dev *dev);
@@ -501,4 +507,5 @@ int iavf_flow_sub_check(struct iavf_adapter *adapter,
 			struct iavf_fsub_conf *filter);
 void iavf_dev_watchdog_enable(struct iavf_adapter *adapter);
 void iavf_dev_watchdog_disable(struct iavf_adapter *adapter);
+int iavf_handle_hw_reset(struct rte_eth_dev *dev);
 #endif /* _IAVF_ETHDEV_H_ */
drivers/net/iavf/iavf_ethdev.c +79 -7

153 lines not on this page · raw message

drivers/net/iavf/iavf_rxtx.c +33 -19

70 lines not on this page · raw message

drivers/net/iavf/iavf_vchnl.c +10 -1
index b3e106b41f..caf7cd6d8e 100644
@@ -79,6 +79,15 @@ iavf_dev_event_handle(void *param __rte_unused)
 		struct iavf_event_element *pos, *save_next;
 		TAILQ_FOREACH_SAFE(pos, &pending, next, save_next) {
 			TAILQ_REMOVE(&pending, pos, next);
+
+			struct iavf_adapter *adapter = pos->dev->data->dev_private;
+			if (pos->event == RTE_ETH_EVENT_INTR_RESET &&
+			    adapter->devargs.enable_auto_reset) {
+				iavf_handle_hw_reset(pos->dev);
+				rte_free(pos);
+				continue;
+			}
+
 			rte_eth_dev_callback_process(pos->dev, pos->event, pos->param);
 			rte_free(pos);
 		}
@@ -87,7 +96,7 @@ iavf_dev_event_handle(void *param __rte_unused)
 	return 0;
 }
 
-static void
+void
 iavf_dev_event_post(struct rte_eth_dev *dev,
 		enum rte_eth_event_type event,
 		void *param, size_t param_alloc_size)
Signature · 1 line
2.37.2
author
#6 lore raw

PATCH v5 1/1 net/iavf: add devargs to enable vf auto-reset

In reply to Shiyang He

Originally, the iavf PMD does not perform special actions when it receives a PF-to-VF reset event, resulting in vf being offline and unavailable.

This patch enables vf auto-reset by setting 'watchdog_period' devargs to true. The iavf PMD will perform an automatic reset to bring the vf back online when it receives a PF-to-VF event.

v2: handling reset by event handler
v3: change reset process
v4: rebase
v5: change enable_auto_reset to enable_reset

---
 doc/guides/nics/intel_vf.rst           |  3 +
 doc/guides/rel_notes/release_23_11.rst |  3 +
 drivers/net/iavf/iavf.h                |  7 +++
 drivers/net/iavf/iavf_ethdev.c         | 86 +++++++++++++++++++++++---
 drivers/net/iavf/iavf_rxtx.c           | 52 ++++++++++------
 drivers/net/iavf/iavf_vchnl.c          | 11 +++-
 6 files changed, 135 insertions(+), 27 deletions(-)
doc/guides/nics/intel_vf.rst +3 -0
index d365dbc185..f771948242 100644
@@ -101,6 +101,9 @@ For more detail on SR-IOV, please refer to the following documents:
     Set ``devargs`` parameter ``watchdog_period`` to adjust the watchdog period in microseconds, or set it to 0 to disable the watchdog,
     for example, ``-a 18:01.0,watchdog_period=5000`` or ``-a 18:01.0,watchdog_period=0``.
 
+    Enable vf auto-reset by setting the ``devargs`` parameter like ``-a 18:01.0,enable_reset=1`` when IAVF is backed
+    by an Intel® E810 device or an Intel® 700 Series Ethernet device.
+
 The PCIE host-interface of Intel Ethernet Switch FM10000 Series VF infrastructure
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
doc/guides/rel_notes/release_23_11.rst +3 -0
index 03191b3ae0..8536ce88f4 100644
@@ -86,6 +86,9 @@ New Features
 
   * Added support for port representor.
 
+* **Updated Intel iavf driver.**
+  * Added support for iavf auto-reset.
+
 Removed Items
 -------------
 
drivers/net/iavf/iavf.h +7 -0
index 98861e4242..be6b9920e6 100644
@@ -277,6 +277,8 @@ struct iavf_info {
 
 	struct rte_eth_dev *eth_dev;
 
+	bool in_reset_recovery;
+
 	uint32_t ptp_caps;
 	rte_spinlock_t phc_time_aq_lock;
 };
@@ -305,6 +307,7 @@ struct iavf_devargs {
 	uint8_t proto_xtr[IAVF_MAX_QUEUE_NUM];
 	uint16_t quanta_size;
 	uint32_t watchdog_period;
+	uint8_t  enable_reset;
 };
 
 struct iavf_security_ctx;
@@ -426,6 +429,9 @@ _atomic_set_async_response_cmd(struct iavf_info *vf, enum virtchnl_ops ops)
 }
 int iavf_check_api_version(struct iavf_adapter *adapter);
 int iavf_get_vf_resource(struct iavf_adapter *adapter);
+void iavf_dev_event_post(struct rte_eth_dev *dev,
+		enum rte_eth_event_type event,
+		void *param, size_t param_alloc_size);
 void iavf_dev_event_handler_fini(void);
 int iavf_dev_event_handler_init(void);
 void iavf_handle_virtchnl_msg(struct rte_eth_dev *dev);
@@ -501,4 +507,5 @@ int iavf_flow_sub_check(struct iavf_adapter *adapter,
 			struct iavf_fsub_conf *filter);
 void iavf_dev_watchdog_enable(struct iavf_adapter *adapter);
 void iavf_dev_watchdog_disable(struct iavf_adapter *adapter);
+int iavf_handle_hw_reset(struct rte_eth_dev *dev);
 #endif /* _IAVF_ETHDEV_H_ */
drivers/net/iavf/iavf_ethdev.c +79 -7

153 lines not on this page · raw message

drivers/net/iavf/iavf_rxtx.c +33 -19

70 lines not on this page · raw message

drivers/net/iavf/iavf_vchnl.c +10 -1
index b3e106b41f..9cefa26854 100644
@@ -79,6 +79,15 @@ iavf_dev_event_handle(void *param __rte_unused)
 		struct iavf_event_element *pos, *save_next;
 		TAILQ_FOREACH_SAFE(pos, &pending, next, save_next) {
 			TAILQ_REMOVE(&pending, pos, next);
+
+			struct iavf_adapter *adapter = pos->dev->data->dev_private;
+			if (pos->event == RTE_ETH_EVENT_INTR_RESET &&
+			    adapter->devargs.enable_reset) {
+				iavf_handle_hw_reset(pos->dev);
+				rte_free(pos);
+				continue;
+			}
+
 			rte_eth_dev_callback_process(pos->dev, pos->event, pos->param);
 			rte_free(pos);
 		}
@@ -87,7 +96,7 @@ iavf_dev_event_handle(void *param __rte_unused)
 	return 0;
 }
 
-static void
+void
 iavf_dev_event_post(struct rte_eth_dev *dev,
 		enum rte_eth_event_type event,
 		void *param, size_t param_alloc_size)
Signature · 1 line
2.37.2
author
#7 lore raw

PATCH v5 1/1 net/iavf: add devargs to enable vf auto-reset

In reply to Shiyang He

Originally, the iavf PMD does not perform special actions when it receives a PF-to-VF reset event, resulting in vf being offline and unavailable.

This patch enables vf auto-reset by setting 'watchdog_period' devargs to true. The iavf PMD will perform an automatic reset to bring the vf back online when it receives a PF-to-VF event.

v2: handling reset by event handler
v3: change reset process
v4: rebase
v5: change enable_auto_reset to auto_reset

---
 doc/guides/nics/intel_vf.rst           |  3 +
 doc/guides/rel_notes/release_23_11.rst |  3 +
 drivers/net/iavf/iavf.h                |  7 +++
 drivers/net/iavf/iavf_ethdev.c         | 86 +++++++++++++++++++++++---
 drivers/net/iavf/iavf_rxtx.c           | 52 ++++++++++------
 drivers/net/iavf/iavf_vchnl.c          | 11 +++-
 6 files changed, 135 insertions(+), 27 deletions(-)
doc/guides/nics/intel_vf.rst +3 -0
index d365dbc185..7613e1c5e5 100644
@@ -101,6 +101,9 @@ For more detail on SR-IOV, please refer to the following documents:
     Set ``devargs`` parameter ``watchdog_period`` to adjust the watchdog period in microseconds, or set it to 0 to disable the watchdog,
     for example, ``-a 18:01.0,watchdog_period=5000`` or ``-a 18:01.0,watchdog_period=0``.
 
+    Enable vf auto-reset by setting the ``devargs`` parameter like ``-a 18:01.0,auto_reset=1`` when IAVF is backed
+    by an Intel® E810 device or an Intel® 700 Series Ethernet device.
+
 The PCIE host-interface of Intel Ethernet Switch FM10000 Series VF infrastructure
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
doc/guides/rel_notes/release_23_11.rst +3 -0
index 03191b3ae0..8536ce88f4 100644
@@ -86,6 +86,9 @@ New Features
 
   * Added support for port representor.
 
+* **Updated Intel iavf driver.**
+  * Added support for iavf auto-reset.
+
 Removed Items
 -------------
 
drivers/net/iavf/iavf.h +7 -0
index 98861e4242..04774ce124 100644
@@ -277,6 +277,8 @@ struct iavf_info {
 
 	struct rte_eth_dev *eth_dev;
 
+	bool in_reset_recovery;
+
 	uint32_t ptp_caps;
 	rte_spinlock_t phc_time_aq_lock;
 };
@@ -305,6 +307,7 @@ struct iavf_devargs {
 	uint8_t proto_xtr[IAVF_MAX_QUEUE_NUM];
 	uint16_t quanta_size;
 	uint32_t watchdog_period;
+	uint8_t  auto_reset;
 };
 
 struct iavf_security_ctx;
@@ -426,6 +429,9 @@ _atomic_set_async_response_cmd(struct iavf_info *vf, enum virtchnl_ops ops)
 }
 int iavf_check_api_version(struct iavf_adapter *adapter);
 int iavf_get_vf_resource(struct iavf_adapter *adapter);
+void iavf_dev_event_post(struct rte_eth_dev *dev,
+		enum rte_eth_event_type event,
+		void *param, size_t param_alloc_size);
 void iavf_dev_event_handler_fini(void);
 int iavf_dev_event_handler_init(void);
 void iavf_handle_virtchnl_msg(struct rte_eth_dev *dev);
@@ -501,4 +507,5 @@ int iavf_flow_sub_check(struct iavf_adapter *adapter,
 			struct iavf_fsub_conf *filter);
 void iavf_dev_watchdog_enable(struct iavf_adapter *adapter);
 void iavf_dev_watchdog_disable(struct iavf_adapter *adapter);
+int iavf_handle_hw_reset(struct rte_eth_dev *dev);
 #endif /* _IAVF_ETHDEV_H_ */
drivers/net/iavf/iavf_ethdev.c +79 -7

153 lines not on this page · raw message

drivers/net/iavf/iavf_rxtx.c +33 -19

70 lines not on this page · raw message

drivers/net/iavf/iavf_vchnl.c +10 -1
index b3e106b41f..7f49eb2c1e 100644
@@ -79,6 +79,15 @@ iavf_dev_event_handle(void *param __rte_unused)
 		struct iavf_event_element *pos, *save_next;
 		TAILQ_FOREACH_SAFE(pos, &pending, next, save_next) {
 			TAILQ_REMOVE(&pending, pos, next);
+
+			struct iavf_adapter *adapter = pos->dev->data->dev_private;
+			if (pos->event == RTE_ETH_EVENT_INTR_RESET &&
+			    adapter->devargs.auto_reset) {
+				iavf_handle_hw_reset(pos->dev);
+				rte_free(pos);
+				continue;
+			}
+
 			rte_eth_dev_callback_process(pos->dev, pos->event, pos->param);
 			rte_free(pos);
 		}
@@ -87,7 +96,7 @@ iavf_dev_event_handle(void *param __rte_unused)
 	return 0;
 }
 
-static void
+void
 iavf_dev_event_post(struct rte_eth_dev *dev,
 		enum rte_eth_event_type event,
 		void *param, size_t param_alloc_size)
Signature · 1 line
2.37.2
Applied
#8 lore raw
Quoted 14 lines

-----Original Message-----
From: He, ShiyangX <[email protected]>
Sent: Tuesday, September 26, 2023 8:39 PM
To: [email protected]
Cc: Zhou, YidingX <[email protected]>; He, ShiyangX <[email protected]>; Zhang, Qi Z <[email protected]>; Wang, Liang- min <[email protected]>; Zhang, Yuying <[email protected]>; Xing, Beilei <[email protected]>; Su, Simei <[email protected]>; Wu, Wenjun1 <[email protected]>; Yang, Qiming <[email protected]>; Wu, Jingjing <[email protected]>
Subject: [PATCH v5] net/iavf: add devargs to enable vf auto-reset

Quoted 6 lines

Originally, the iavf PMD does not perform special actions when it receives a PF-to-VF reset event, resulting in vf being offline and unavailable.

This patch enables vf auto-reset by setting 'watchdog_period' devargs to true. The iavf PMD will perform an automatic reset to bring the vf back online when it receives a PF-to-VF event.

Fix typo by s/watchdog_period/auto_reset

Quoted 9 lines

v2: handling reset by event handler
v3: change reset process
v4: rebase
v5: change enable_auto_reset to auto_reset

Applied to dpdk-next-net-intel.

Thanks
Qi

#9 lore raw
In reply to Shiyang He
Quoted 27 lines · Shiyang He

Originally, the iavf PMD does not perform special actions when it receives a PF-to-VF reset event, resulting in vf being offline and unavailable.

This patch enables vf auto-reset by setting 'watchdog_period' devargs to true. The iavf PMD will perform an automatic reset to bring the vf back online when it receives a PF-to-VF event.

v2: handling reset by event handler
v3: change reset process

---
 doc/guides/nics/intel_vf.rst           |  3 +
 doc/guides/rel_notes/release_23_11.rst |  3 +
 drivers/net/iavf/iavf.h                |  7 +++
 drivers/net/iavf/iavf_ethdev.c         | 86 +++++++++++++++++++++++---
 drivers/net/iavf/iavf_rxtx.c           | 52 ++++++++++------
 drivers/net/iavf/iavf_vchnl.c          | 11 +++-
 6 files changed, 135 insertions(+), 27 deletions(-)
doc/guides/nics/intel_vf.rst +0 -0
index d365dbc185..c0acd2a7f5 100644

doc/guides/nics/intel_vf.rst For more detail on SR-IOV, please refer to the following documents: · line 106

Quoted 6 lines
doc/guides/nics/intel_vf.rst +3 -0
@@ -101,6 +101,9 @@ For more detail on SR-IOV, please refer to the following documents:
     Set ``devargs`` parameter ``watchdog_period`` to adjust the watchdog period in microseconds, or set it to 0 to disable the watchdog,
     for example, ``-a 18:01.0,watchdog_period=5000`` or ``-a 18:01.0,watchdog_period=0``.
 
+    Enable vf auto-reset by setting the ``devargs`` parameter like ``-a 18:01.0,enable_auto_reset=1`` when IAVF is backed
+    by an Intel® E810 device or an Intel® 700 Series Ethernet device.
+

Why do we need a devargs for this? If the VF is unavailable - as you mention in the commit log above - should this behaviour not always be the case without the user having to ask?

/Bruce

#10 lore raw
Quoted 47 lines

-----Original Message-----
From: Bruce Richardson <[email protected]>
Sent: Tuesday, September 26, 2023 3:49 PM
To: He, ShiyangX <[email protected]>
Cc: [email protected]; Zhou, YidingX <[email protected]>; Wang, Liang- min <[email protected]>; Su, Simei <[email protected]>; Wu, Wenjun1 <[email protected]>; Zhang, Yuying <[email protected]>; Xing, Beilei <[email protected]>; Yang, Qiming <[email protected]>; Wu, Jingjing <[email protected]>
Subject: Re: [PATCH v3] net/iavf: add devargs to enable vf auto-reset

doc/guides/nics/intel_vf.rst For more detail on SR-IOV, please refer to the

Quoted 27 lines · Shiyang He

Originally, the iavf PMD does not perform special actions when it receives a PF-to-VF reset event, resulting in vf being offline and unavailable.

This patch enables vf auto-reset by setting 'watchdog_period' devargs to true. The iavf PMD will perform an automatic reset to bring the vf back online when it receives a PF-to-VF event.

v2: handling reset by event handler
v3: change reset process

---
 doc/guides/nics/intel_vf.rst           |  3 +
 doc/guides/rel_notes/release_23_11.rst |  3 +
 drivers/net/iavf/iavf.h                |  7 +++
 drivers/net/iavf/iavf_ethdev.c         | 86 +++++++++++++++++++++++---
 drivers/net/iavf/iavf_rxtx.c           | 52 ++++++++++------
 drivers/net/iavf/iavf_vchnl.c          | 11 +++-
 6 files changed, 135 insertions(+), 27 deletions(-)
(quoted diff) +0 -0

b/doc/guides/nics/intel_vf.rst index d365dbc185..c0acd2a7f5 100644

doc/guides/nics/intel_vf.rst +0 -0
@@ -101,6 +101,9 @@ For more detail on SR-IOV, please refer to the

following documents:

doc/guides/nics/intel_vf.rst For more detail on SR-IOV, please refer to the · line 101

Quoted 1 line
doc/guides/nics/intel_vf.rst +0 -0
     Set ``devargs`` parameter ``watchdog_period`` to adjust the watchdog

period in microseconds, or set it to 0 to disable the watchdog,

doc/guides/nics/intel_vf.rst For more detail on SR-IOV, please refer to the · line 102

Quoted 1 line
doc/guides/nics/intel_vf.rst +0 -0
     for example, ``-a 18:01.0,watchdog_period=5000`` or ``-a

18:01.0,watchdog_period=0``.

Quoted 1 line
Quoted 8 lines
Quoted 1 line

+ Enable vf auto-reset by setting the ``devargs`` parameter like ``-a

18:01.0,enable_auto_reset=1`` when IAVF is backed

doc/guides/nics/intel_vf.rst

Quoted 2 lines
doc/guides/nics/intel_vf.rst +2 -0
+    by an Intel(r) E810 device or an Intel(r) 700 Series Ethernet device.
+

Why do we need a devargs for this? If the VF is unavailable - as you mention in the commit log above - should this behaviour not always be the case without the user having to ask?

Ideally it does not need, but with below considerations:

1. Not break existing scenario, which still assume some application will call dev_reset /dev_configure/ queue_setup / ... after receive RTE_ETH_EVENT_INTR_RESET event to recover the VF manually, the devargs make sure application be aware of this new feature and will not call rte_eth_dev_reset which will fail now.

2. intent to ensure a smoother transition, in case some corner case issues evaded our validation, keeping this devargs provides us with the flexibility to remove it once we determine that the implementation is stable enough.

Quoted 2 lines

/Bruce

#11 lore raw
Quoted 56 lines · Qi Z
Quoted 47 lines

-----Original Message-----
From: Bruce Richardson <[email protected]>
Sent: Tuesday, September 26, 2023 3:49 PM
To: He, ShiyangX <[email protected]>
Cc: [email protected]; Zhou, YidingX <[email protected]>; Wang, Liang- min <[email protected]>; Su, Simei <[email protected]>; Wu, Wenjun1 <[email protected]>; Zhang, Yuying <[email protected]>; Xing, Beilei <[email protected]>; Yang, Qiming <[email protected]>; Wu, Jingjing <[email protected]>
Subject: Re: [PATCH v3] net/iavf: add devargs to enable vf auto-reset

doc/guides/nics/intel_vf.rst For more detail on SR-IOV, please refer to the

Quoted 27 lines · Shiyang He

Originally, the iavf PMD does not perform special actions when it receives a PF-to-VF reset event, resulting in vf being offline and unavailable.

This patch enables vf auto-reset by setting 'watchdog_period' devargs to true. The iavf PMD will perform an automatic reset to bring the vf back online when it receives a PF-to-VF event.

v2: handling reset by event handler
v3: change reset process

---
 doc/guides/nics/intel_vf.rst           |  3 +
 doc/guides/rel_notes/release_23_11.rst |  3 +
 drivers/net/iavf/iavf.h                |  7 +++
 drivers/net/iavf/iavf_ethdev.c         | 86 +++++++++++++++++++++++---
 drivers/net/iavf/iavf_rxtx.c           | 52 ++++++++++------
 drivers/net/iavf/iavf_vchnl.c          | 11 +++-
 6 files changed, 135 insertions(+), 27 deletions(-)
(quoted diff) +0 -0

b/doc/guides/nics/intel_vf.rst index d365dbc185..c0acd2a7f5 100644

doc/guides/nics/intel_vf.rst +0 -0
@@ -101,6 +101,9 @@ For more detail on SR-IOV, please refer to the

following documents:

doc/guides/nics/intel_vf.rst For more detail on SR-IOV, please refer to the · line 101

Quoted 1 line
doc/guides/nics/intel_vf.rst +0 -0
     Set ``devargs`` parameter ``watchdog_period`` to adjust the watchdog

period in microseconds, or set it to 0 to disable the watchdog,

doc/guides/nics/intel_vf.rst For more detail on SR-IOV, please refer to the · line 102

Quoted 1 line
doc/guides/nics/intel_vf.rst +0 -0
     for example, ``-a 18:01.0,watchdog_period=5000`` or ``-a

18:01.0,watchdog_period=0``.

Quoted 1 line
Quoted 8 lines
Quoted 1 line

+ Enable vf auto-reset by setting the ``devargs`` parameter like ``-a

18:01.0,enable_auto_reset=1`` when IAVF is backed

doc/guides/nics/intel_vf.rst

Quoted 2 lines
doc/guides/nics/intel_vf.rst +2 -0
+    by an Intel(r) E810 device or an Intel(r) 700 Series Ethernet device.
+

Why do we need a devargs for this? If the VF is unavailable - as you mention in the commit log above - should this behaviour not always be the case without the user having to ask?

Quoted 6 lines

Ideally it does not need, but with below considerations:

1. Not break existing scenario, which still assume some application will call dev_reset /dev_configure/ queue_setup / ... after receive RTE_ETH_EVENT_INTR_RESET event to recover the VF manually, the devargs make sure application be aware of this new feature and will not call rte_eth_dev_reset which will fail now.

2. intent to ensure a smoother transition, in case some corner case issues evaded our validation, keeping this devargs provides us with the flexibility to remove it once we determine that the implementation is stable enough.

Thanks for the clear explanation.

One small suggestion: in the commit log, at the end of the first paragraph change "resulting in the VF being offline and unavailable" to "... offline and unavailable until the application resets the device on receipt of the RTE_ETH_EVENT_INTR_RESET event". Similarly at the end of the second paragraph you could add "This change removes the need for the application to handle the reset event, as it is transparently handled inside the driver".

Regards,
/Bruce

#12 lore raw
Quoted 88 lines

-----Original Message-----
From: Richardson, Bruce <[email protected]>
Sent: Tuesday, September 26, 2023 10:06 PM
To: Zhang, Qi Z <[email protected]>
Cc: He, ShiyangX <[email protected]>; [email protected]; Zhou, YidingX <[email protected]>; Wang, Liang-min <[email protected]>; Su, Simei <[email protected]>; Wu, Wenjun1 <[email protected]>; Zhang, Yuying <[email protected]>; Xing, Beilei <[email protected]>; Yang, Qiming <[email protected]>; Wu, Jingjing <[email protected]>
Subject: Re: [PATCH v3] net/iavf: add devargs to enable vf auto-reset

Quoted 57 lines · Qi Z
Quoted 57 lines

-----Original Message-----
From: Bruce Richardson <[email protected]>
Sent: Tuesday, September 26, 2023 3:49 PM
To: He, ShiyangX <[email protected]>
Cc: [email protected]; Zhou, YidingX <[email protected]>; Wang, Liang- min <[email protected]>; Su, Simei <[email protected]>; Wu,
Wenjun1 <[email protected]>; Zhang, Yuying <[email protected]>; Xing, Beilei <[email protected]>; Yang, Qiming <[email protected]>; Wu, Jingjing <[email protected]>
Subject: Re: [PATCH v3] net/iavf: add devargs to enable vf auto-reset

doc/guides/nics/intel_vf.rst For more detail on SR-IOV, please refer to the

Quoted 27 lines · Shiyang He

Originally, the iavf PMD does not perform special actions when it receives a PF-to-VF reset event, resulting in vf being offline and unavailable.

This patch enables vf auto-reset by setting 'watchdog_period' devargs to true. The iavf PMD will perform an automatic reset to bring the vf back online when it receives a PF-to-VF event.

v2: handling reset by event handler
v3: change reset process

---
 doc/guides/nics/intel_vf.rst           |  3 +
 doc/guides/rel_notes/release_23_11.rst |  3 +
 drivers/net/iavf/iavf.h                |  7 +++
 drivers/net/iavf/iavf_ethdev.c         | 86 +++++++++++++++++++++++---
 drivers/net/iavf/iavf_rxtx.c           | 52 ++++++++++------
 drivers/net/iavf/iavf_vchnl.c          | 11 +++-
 6 files changed, 135 insertions(+), 27 deletions(-)
(quoted diff) +0 -0

b/doc/guides/nics/intel_vf.rst index d365dbc185..c0acd2a7f5 100644

doc/guides/nics/intel_vf.rst +0 -0
@@ -101,6 +101,9 @@ For more detail on SR-IOV, please refer to the

following documents:

Quoted 2 lines
doc/guides/nics/intel_vf.rst +0 -0
     Set ``devargs`` parameter ``watchdog_period`` to adjust the

watchdog

period in microseconds, or set it to 0 to disable the watchdog,

Quoted 1 line
     for example, ``-a 18:01.0,watchdog_period=5000`` or ``-a

18:01.0,watchdog_period=0``.

Quoted 3 lines

+ Enable vf auto-reset by setting the ``devargs`` parameter
+ like ``-a

18:01.0,enable_auto_reset=1`` when IAVF is backed

Quoted 2 lines
doc/guides/nics/intel_vf.rst +2 -0
+    by an Intel(r) E810 device or an Intel(r) 700 Series Ethernet device.
+
Quoted 7 lines
Quoted 3 lines

Why do we need a devargs for this? If the VF is unavailable - as you mention in the commit log above - should this behaviour not always be the case without the user having to ask?

Ideally it does not need, but with below considerations:

1. Not break existing scenario, which still assume some application will call

dev_reset /dev_configure/ queue_setup / ... after receive RTE_ETH_EVENT_INTR_RESET event to recover the VF manually, the devargs make sure application be aware of this new feature and will not call rte_eth_dev_reset which will fail now.

Quoted 2 lines

2. intent to ensure a smoother transition, in case some corner case issues

evaded our validation, keeping this devargs provides us with the flexibility to remove it once we determine that the implementation is stable enough.

Quoted 1 line
Quoted 8 lines

Thanks for the clear explanation.

One small suggestion: in the commit log, at the end of the first paragraph change "resulting in the VF being offline and unavailable" to "... offline and unavailable until the application resets the device on receipt of the RTE_ETH_EVENT_INTR_RESET event". Similarly at the end of the second paragraph you could add "This change removes the need for the application to handle the reset event, as it is transparently handled inside the driver".

Thank you for the suggestion. The commit log has been refined in the dpdk-next-net-intel repo.

Qi

Quoted 3 lines

Regards,
/Bruce

#13 lore raw
In reply to Bruce Richardson
Quoted 66 lines · Bruce Richardson
Quoted 56 lines · Qi Z
Quoted 47 lines

-----Original Message-----
From: Bruce Richardson <[email protected]>
Sent: Tuesday, September 26, 2023 3:49 PM
To: He, ShiyangX <[email protected]>
Cc: [email protected]; Zhou, YidingX <[email protected]>; Wang, Liang- min <[email protected]>; Su, Simei <[email protected]>; Wu, Wenjun1 <[email protected]>; Zhang, Yuying <[email protected]>; Xing, Beilei <[email protected]>; Yang, Qiming <[email protected]>; Wu, Jingjing <[email protected]>
Subject: Re: [PATCH v3] net/iavf: add devargs to enable vf auto-reset

doc/guides/nics/intel_vf.rst For more detail on SR-IOV, please refer to the

Quoted 27 lines · Shiyang He

Originally, the iavf PMD does not perform special actions when it receives a PF-to-VF reset event, resulting in vf being offline and unavailable.

This patch enables vf auto-reset by setting 'watchdog_period' devargs to true. The iavf PMD will perform an automatic reset to bring the vf back online when it receives a PF-to-VF event.

v2: handling reset by event handler
v3: change reset process

---
 doc/guides/nics/intel_vf.rst           |  3 +
 doc/guides/rel_notes/release_23_11.rst |  3 +
 drivers/net/iavf/iavf.h                |  7 +++
 drivers/net/iavf/iavf_ethdev.c         | 86 +++++++++++++++++++++++---
 drivers/net/iavf/iavf_rxtx.c           | 52 ++++++++++------
 drivers/net/iavf/iavf_vchnl.c          | 11 +++-
 6 files changed, 135 insertions(+), 27 deletions(-)
(quoted diff) +0 -0

b/doc/guides/nics/intel_vf.rst index d365dbc185..c0acd2a7f5 100644

doc/guides/nics/intel_vf.rst +0 -0
@@ -101,6 +101,9 @@ For more detail on SR-IOV, please refer to the

following documents:

doc/guides/nics/intel_vf.rst For more detail on SR-IOV, please refer to the · line 101

Quoted 1 line
doc/guides/nics/intel_vf.rst +0 -0
     Set ``devargs`` parameter ``watchdog_period`` to adjust the watchdog

period in microseconds, or set it to 0 to disable the watchdog,

doc/guides/nics/intel_vf.rst For more detail on SR-IOV, please refer to the · line 102

Quoted 1 line
doc/guides/nics/intel_vf.rst +0 -0
     for example, ``-a 18:01.0,watchdog_period=5000`` or ``-a

18:01.0,watchdog_period=0``.

Quoted 1 line
Quoted 8 lines
Quoted 1 line

+ Enable vf auto-reset by setting the ``devargs`` parameter like ``-a

18:01.0,enable_auto_reset=1`` when IAVF is backed

doc/guides/nics/intel_vf.rst

Quoted 2 lines
doc/guides/nics/intel_vf.rst +2 -0
+    by an Intel(r) E810 device or an Intel(r) 700 Series Ethernet device.
+

Why do we need a devargs for this? If the VF is unavailable - as you mention in the commit log above - should this behaviour not always be the case without the user having to ask?

Quoted 6 lines

Ideally it does not need, but with below considerations:

1. Not break existing scenario, which still assume some application will call dev_reset /dev_configure/ queue_setup / ... after receive RTE_ETH_EVENT_INTR_RESET event to recover the VF manually, the devargs make sure application be aware of this new feature and will not call rte_eth_dev_reset which will fail now.

2. intent to ensure a smoother transition, in case some corner case issues evaded our validation, keeping this devargs provides us with the flexibility to remove it once we determine that the implementation is stable enough.

Thanks for the clear explanation.

Quoted 7 lines

One small suggestion: in the commit log, at the end of the first paragraph change "resulting in the VF being offline and unavailable" to "... offline and unavailable until the application resets the device on receipt of the RTE_ETH_EVENT_INTR_RESET event". Similarly at the end of the second paragraph you could add "This change removes the need for the application to handle the reset event, as it is transparently handled inside the driver".

I did not read the patch.

You mention that rte_eth_dev_reset will fail now when this (horrific) devargs is passed.
Yet, will the driver send a RTE_ETH_EVENT_INTR_RESET event?

Additionnally, how does the driver make sure that no application/datapath thread is polling/reconfiguring this hw?

Signature · 1 line
David Marchand