Skip to contentSkip to conversation

librte_pmd_e1000: igb and em1000 PCI Port Hotplug changes

RFC PATCH New Bernard Iremonger 1 participant 1 message May 6, 2015

lore
Share & tools
lore
#0 lore raw

RFC PATCH v2 1/1 librte_pmd_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 V2:
Call dev_close() from dev_uninit() functions. Remove input parameter checking from dev_unit() functions.

---
 lib/librte_pmd_e1000/e1000/e1000_hw.h |    3 +-
 lib/librte_pmd_e1000/e1000_ethdev.h   |    4 +-
 lib/librte_pmd_e1000/em_ethdev.c      |   42 +++++++++++++++++-
 lib/librte_pmd_e1000/igb_ethdev.c     |   79 +++++++++++++++++++++++++++++++-
 lib/librte_pmd_e1000/igb_pf.c         |   24 ++++++++++-
 5 files changed, 144 insertions(+), 8 deletions(-)
lib/librte_pmd_e1000/e1000/e1000_hw.h +2 -1
index 4dd92a3..60cd237 100644
@@ -1,6 +1,6 @@
 /*******************************************************************************
 
-Copyright (c) 2001-2014, Intel Corporation
+Copyright (c) 2001-2015, Intel Corporation
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
@@ -1005,6 +1005,7 @@ struct e1000_hw {
 	u16 vendor_id;
 
 	u8  revision_id;
+	bool adapter_stopped;
 };
 
 #include "e1000_82541.h"
lib/librte_pmd_e1000/e1000_ethdev.h +3 -1
index c451faa..51720b9 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
@@ -298,6 +298,8 @@ void eth_igbvf_tx_init(struct rte_eth_dev *dev);
  */
 void igb_pf_host_init(struct rte_eth_dev *eth_dev);
 
+void igb_pf_host_uninit(struct rte_eth_dev *eth_dev);
+
 void igb_pf_mbx_process(struct rte_eth_dev *eth_dev);
 
 int igb_pf_host_configure(struct rte_eth_dev *eth_dev);
lib/librte_pmd_e1000/em_ethdev.c +40 -2

78 lines not on this page · raw message

lib/librte_pmd_e1000/igb_ethdev.c +76 -3

147 lines not on this page · raw message

lib/librte_pmd_e1000/igb_pf.c +23 -1
index 2d49379..87fd812 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
@@ -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 *eth_dev)
+{
+	struct e1000_vf_info **vfinfo;
+	uint16_t vf_num;
+
+	PMD_INIT_FUNC_TRACE();
+
+	vfinfo = E1000_DEV_PRIVATE_TO_P_VFDATA(eth_dev->data->dev_private);
+
+	RTE_ETH_DEV_SRIOV(eth_dev).active = 0;
+	RTE_ETH_DEV_SRIOV(eth_dev).nb_q_per_pool = 0;
+	RTE_ETH_DEV_SRIOV(eth_dev).def_vmdq_idx = 0;
+	RTE_ETH_DEV_SRIOV(eth_dev).def_pool_q_idx = 0;
+
+	vf_num = dev_num_vf(eth_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