Skip to contentSkip to conversation

e1000: igb and em1000 PCI Port Hotplug changes

RFC PATCH Superseded Bernard Iremonger 1 participant 1 message Jun 3, 2015 Network drivers

v3 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

RFC PATCH v3 1/1 e1000: igb and em1000 PCI Port Hotplug changes

This patch depends on the Port Hotplug Framework. It implements the eth_dev_uninit functions for rte_em_pmd, rte_igb_pmd and rte_igbvf_pmd.

Changes in V3:
Add igb_adapter_stopped and em_adapter_stopped booleans. Release rx and tx queues

Changes in V2:
Call dev_close() from dev_uninit() functions. Remove input parameter checking from dev_uninit() functions.

---
 drivers/net/e1000/e1000_ethdev.h |    4 +-
 drivers/net/e1000/em_ethdev.c    |   50 ++++++++++++++++++++++-
 drivers/net/e1000/igb_ethdev.c   |   85 +++++++++++++++++++++++++++++++++++++-
 drivers/net/e1000/igb_pf.c       |   22 ++++++++++
 4 files changed, 157 insertions(+), 4 deletions(-)
drivers/net/e1000/e1000_ethdev.h +3 -1
index c451faa..3ce1a22 100644
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2010-2015 Intel Corporation. All rights reserved.
  *   All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
@@ -337,4 +337,6 @@ uint16_t eth_em_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
 uint16_t eth_em_recv_scattered_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
 		uint16_t nb_pkts);
 
+void igb_pf_host_uninit(struct rte_eth_dev *dev);
+
 #endif /* _E1000_ETHDEV_H_ */
drivers/net/e1000/em_ethdev.c +49 -1

86 lines not on this page · raw message

drivers/net/e1000/igb_ethdev.c +83 -2

153 lines not on this page · raw message

drivers/net/e1000/igb_pf.c +22 -0
index 6a4d210..26c2960 100644
@@ -127,6 +127,28 @@ void igb_pf_host_init(struct rte_eth_dev *eth_dev)
 	return;
 }
 
+void igb_pf_host_uninit(struct rte_eth_dev *dev)
+{
+	struct e1000_vf_info **vfinfo;
+	uint16_t vf_num;
+
+	PMD_INIT_FUNC_TRACE();
+
+	vfinfo = E1000_DEV_PRIVATE_TO_P_VFDATA(dev->data->dev_private);
+
+	RTE_ETH_DEV_SRIOV(dev).active = 0;
+	RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool = 0;
+	RTE_ETH_DEV_SRIOV(dev).def_vmdq_idx = 0;
+	RTE_ETH_DEV_SRIOV(dev).def_pool_q_idx = 0;
+
+	vf_num = dev_num_vf(dev);
+	if (vf_num == 0)
+		return;
+
+	rte_free(*vfinfo);
+	*vfinfo = NULL;
+}
+
 #define E1000_RAH_POOLSEL_SHIFT    (18)
 int igb_pf_host_configure(struct rte_eth_dev *eth_dev)
 {
Signature · 1 line
1.7.4.1