Skip to contentSkip to conversation

e1000: igb and em1000 PCI Port Hotplug changes

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

v5 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

PATCH v5 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 V5:
Moved adapter stopped boolean to struct e1000_adapter. Rebase to latest code.

Changes in V4:
Release rx and tx queues in eth_igbvf_dev_uninit.

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

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

---
 drivers/net/e1000/e1000_ethdev.h |    8 ++-
 drivers/net/e1000/em_ethdev.c    |   57 ++++++++++++++++++-
 drivers/net/e1000/igb_ethdev.c   |  115 +++++++++++++++++++++++++++++++++++++-
 drivers/net/e1000/igb_pf.c       |   22 +++++++
 4 files changed, 197 insertions(+), 5 deletions(-)
drivers/net/e1000/e1000_ethdev.h +7 -1
index c451faa..ee8b872 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
@@ -229,8 +229,12 @@ struct e1000_adapter {
 	struct e1000_vfta       shadow_vfta;
 	struct e1000_vf_info    *vfdata;
 	struct e1000_filter_info filter;
+	bool stopped;
 };
 
+#define E1000_DEV_PRIVATE(adapter) \
+	((struct e1000_adapter *)adapter)
+
 #define E1000_DEV_PRIVATE_TO_HW(adapter) \
 	(&((struct e1000_adapter *)adapter)->hw)
 
@@ -337,4 +341,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 +56 -1

101 lines not on this page · raw message

drivers/net/e1000/igb_ethdev.c +112 -3

211 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