DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/i40e: i40evf exposes LSC flag to application.
@ 2020-08-11  9:10 SteveX Yang
  2020-08-31  2:01 ` Zhang, Qi Z
  2020-09-03  7:19 ` [dpdk-dev] [PATCH v2] " SteveX Yang
  0 siblings, 2 replies; 4+ messages in thread
From: SteveX Yang @ 2020-08-11  9:10 UTC (permalink / raw)
  To: qiming.yang, beilei.xing, jia.guo, dev; +Cc: SteveX Yang

When PF event VIRTCHNL_EVENT_LINK_CHANGE received, i40evf need update
the link status and issue RTE_ETH_EVENT_INTR_LSC via
_rte_eth_dev_callback_process().

Signed-off-by: SteveX Yang <stevex.yang@intel.com>
---
 drivers/net/i40e/i40e_ethdev_vf.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
index 69cab8e73..a0a9268e5 100644
--- a/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/drivers/net/i40e/i40e_ethdev_vf.c
@@ -1381,13 +1381,16 @@ i40evf_handle_pf_event(struct rte_eth_dev *dev, uint8_t *msg,
 	switch (pf_msg->event) {
 	case VIRTCHNL_EVENT_RESET_IMPENDING:
 		PMD_DRV_LOG(DEBUG, "VIRTCHNL_EVENT_RESET_IMPENDING event");
-		_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_RESET,
-					      NULL);
+		_rte_eth_dev_callback_process(dev,
+				RTE_ETH_EVENT_INTR_RESET, NULL);
 		break;
 	case VIRTCHNL_EVENT_LINK_CHANGE:
 		PMD_DRV_LOG(DEBUG, "VIRTCHNL_EVENT_LINK_CHANGE event");
 		vf->link_up = pf_msg->event_data.link_event.link_status;
 		vf->link_speed = pf_msg->event_data.link_event.link_speed;
+		i40evf_dev_link_update(dev, 0);
+		_rte_eth_dev_callback_process(dev,
+				RTE_ETH_EVENT_INTR_LSC, NULL);
 		break;
 	case VIRTCHNL_EVENT_PF_DRIVER_CLOSE:
 		PMD_DRV_LOG(DEBUG, "VIRTCHNL_EVENT_PF_DRIVER_CLOSE event");
-- 
2.17.1


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

* Re: [dpdk-dev] [PATCH] net/i40e: i40evf exposes LSC flag to application.
  2020-08-11  9:10 [dpdk-dev] [PATCH] net/i40e: i40evf exposes LSC flag to application SteveX Yang
@ 2020-08-31  2:01 ` Zhang, Qi Z
  2020-09-03  7:19 ` [dpdk-dev] [PATCH v2] " SteveX Yang
  1 sibling, 0 replies; 4+ messages in thread
From: Zhang, Qi Z @ 2020-08-31  2:01 UTC (permalink / raw)
  To: Yang, SteveX, Yang, Qiming, Xing, Beilei, Guo, Jia, dev; +Cc: Yang, SteveX



> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of SteveX Yang
> Sent: Tuesday, August 11, 2020 5:11 PM
> To: Yang, Qiming <qiming.yang@intel.com>; Xing, Beilei
> <beilei.xing@intel.com>; Guo, Jia <jia.guo@intel.com>; dev@dpdk.org
> Cc: Yang, SteveX <stevex.yang@intel.com>
> Subject: [dpdk-dev] [PATCH] net/i40e: i40evf exposes LSC flag to application.
> 
> When PF event VIRTCHNL_EVENT_LINK_CHANGE received, i40evf need update
> the link status and issue RTE_ETH_EVENT_INTR_LSC via
> _rte_eth_dev_callback_process().

The implementation is incomplete, 

To support LSC in i40evf, please
1. add RTE_PCI_DRV_INTR_LSC in drv_flags
2. make sure dev_conf.intr_conf.lsc can be configure with 1
3.update i40e_vf.ini.



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

* [dpdk-dev] [PATCH v2] net/i40e: i40evf exposes LSC flag to application
  2020-08-11  9:10 [dpdk-dev] [PATCH] net/i40e: i40evf exposes LSC flag to application SteveX Yang
  2020-08-31  2:01 ` Zhang, Qi Z
@ 2020-09-03  7:19 ` SteveX Yang
  2020-09-03 14:13   ` Zhang, Qi Z
  1 sibling, 1 reply; 4+ messages in thread
From: SteveX Yang @ 2020-09-03  7:19 UTC (permalink / raw)
  To: dev; +Cc: qi.z.zhang, beilei.xing, jia.guo, qiming.yang, SteveX Yang

When PF event VIRTCHNL_EVENT_LINK_CHANGE received, i40evf need update
the link status and issue RTE_ETH_EVENT_INTR_LSC via rte ether device
callback function.

Signed-off-by: SteveX Yang <stevex.yang@intel.com>
---
v2:
  - add RTE_PCI_DRV_INTR_LSC in drv_flags
  - configure the intr_conf.lsc according to RTE_ETH_EVENT_INTR_LSC
  - update i40e_vf.ini

---
 doc/guides/nics/features/i40e_vf.ini |  1 +
 drivers/net/i40e/i40e_ethdev_vf.c    | 12 +++++++++---
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/doc/guides/nics/features/i40e_vf.ini b/doc/guides/nics/features/i40e_vf.ini
index 9f95063d2..4984a6177 100644
--- a/doc/guides/nics/features/i40e_vf.ini
+++ b/doc/guides/nics/features/i40e_vf.ini
@@ -6,6 +6,7 @@
 [Features]
 Rx interrupt         = Y
 Link status          = Y
+Link status event    = Y
 Fast mbuf free       = P
 Queue start/stop     = Y
 Jumbo frame          = Y
diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
index 69cab8e73..b4e42939e 100644
--- a/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/drivers/net/i40e/i40e_ethdev_vf.c
@@ -1381,13 +1381,16 @@ i40evf_handle_pf_event(struct rte_eth_dev *dev, uint8_t *msg,
 	switch (pf_msg->event) {
 	case VIRTCHNL_EVENT_RESET_IMPENDING:
 		PMD_DRV_LOG(DEBUG, "VIRTCHNL_EVENT_RESET_IMPENDING event");
-		_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_RESET,
-					      NULL);
+		_rte_eth_dev_callback_process(dev,
+				RTE_ETH_EVENT_INTR_RESET, NULL);
 		break;
 	case VIRTCHNL_EVENT_LINK_CHANGE:
 		PMD_DRV_LOG(DEBUG, "VIRTCHNL_EVENT_LINK_CHANGE event");
 		vf->link_up = pf_msg->event_data.link_event.link_status;
 		vf->link_speed = pf_msg->event_data.link_event.link_speed;
+		i40evf_dev_link_update(dev, 0);
+		_rte_eth_dev_callback_process(dev,
+				RTE_ETH_EVENT_INTR_LSC, NULL);
 		break;
 	case VIRTCHNL_EVENT_PF_DRIVER_CLOSE:
 		PMD_DRV_LOG(DEBUG, "VIRTCHNL_EVENT_PF_DRIVER_CLOSE event");
@@ -1609,7 +1612,7 @@ static int eth_i40evf_pci_remove(struct rte_pci_device *pci_dev)
  */
 static struct rte_pci_driver rte_i40evf_pmd = {
 	.id_table = pci_id_i40evf_map,
-	.drv_flags = RTE_PCI_DRV_NEED_MAPPING,
+	.drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC,
 	.probe = eth_i40evf_pci_probe,
 	.remove = eth_i40evf_pci_remove,
 };
@@ -1635,6 +1638,9 @@ i40evf_dev_configure(struct rte_eth_dev *dev)
 	ad->tx_simple_allowed = true;
 	ad->tx_vec_allowed = true;
 
+	dev->data->dev_conf.intr_conf.lsc =
+		!!(dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC);
+
 	if (num_queue_pairs > vf->vsi_res->num_queue_pairs) {
 		struct i40e_hw *hw;
 		int ret;
-- 
2.17.1


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

* Re: [dpdk-dev] [PATCH v2] net/i40e: i40evf exposes LSC flag to application
  2020-09-03  7:19 ` [dpdk-dev] [PATCH v2] " SteveX Yang
@ 2020-09-03 14:13   ` Zhang, Qi Z
  0 siblings, 0 replies; 4+ messages in thread
From: Zhang, Qi Z @ 2020-09-03 14:13 UTC (permalink / raw)
  To: Yang, SteveX, dev; +Cc: Xing, Beilei, Guo, Jia, Yang, Qiming



> -----Original Message-----
> From: Yang, SteveX <stevex.yang@intel.com>
> Sent: Thursday, September 3, 2020 3:19 PM
> To: dev@dpdk.org
> Cc: Zhang, Qi Z <qi.z.zhang@intel.com>; Xing, Beilei <beilei.xing@intel.com>;
> Guo, Jia <jia.guo@intel.com>; Yang, Qiming <qiming.yang@intel.com>; Yang,
> SteveX <stevex.yang@intel.com>
> Subject: [PATCH v2] net/i40e: i40evf exposes LSC flag to application
> 
> When PF event VIRTCHNL_EVENT_LINK_CHANGE received, i40evf need update
> the link status and issue RTE_ETH_EVENT_INTR_LSC via rte ether device
> callback function.
> 
> Signed-off-by: SteveX Yang <stevex.yang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>

Applied to dpdk-next-net-intel.

Thanks
Qi

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

end of thread, other threads:[~2020-09-03 14:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-11  9:10 [dpdk-dev] [PATCH] net/i40e: i40evf exposes LSC flag to application SteveX Yang
2020-08-31  2:01 ` Zhang, Qi Z
2020-09-03  7:19 ` [dpdk-dev] [PATCH v2] " SteveX Yang
2020-09-03 14:13   ` Zhang, Qi Z

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).