Skip to contentSkip to conversation

af_packet: make the device detachable

PATCH Applied Wojciech Zmuda 3 participants 3 messages Mar 2, 2016 – Mar 10, 2016 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH v4 1/1 af_packet: make the device detachable

Allow dynamic deallocation of af_packet device through proper API functions. To achieve this:
* set device flag to RTE_ETH_DEV_DETACHABLE
* implement rte_pmd_af_packet_devuninit() and expose it through rte_driver.uninit()
* copy device name to ethdev->data to make discoverable with rte_eth_dev_allocated()
Moreover, make af_packet init function static, as there is no reason to keep it public.

---
v4:
* Rebased against current master branch

v3:
* Rephrased feature note in release notes.
* Rephrased commit log.
* Added API change note in release notes.
* Made init function static.
* Removed af_packet header file, as it is not needed after init function is not public anymore.

v2:
* Fixed typo and a comment.
* Added feature to the 2.3 release notes.
* Free memory allocated for rx and tx queues.

 doc/guides/rel_notes/release_16_04.rst             |  6 +++
 drivers/net/af_packet/Makefile                     |  5 --
 drivers/net/af_packet/rte_eth_af_packet.c          | 43 ++++++++++++++++--
 drivers/net/af_packet/rte_eth_af_packet.h          | 53 ----------------------
 .../net/af_packet/rte_pmd_af_packet_version.map    |  3 --
 5 files changed, 45 insertions(+), 65 deletions(-)
 delete mode 100644 drivers/net/af_packet/rte_eth_af_packet.h
doc/guides/rel_notes/release_16_04.rst +6 -0
index fd7dd1a..475acea 100644
@@ -51,6 +51,9 @@ This section should contain new features added in this release. Sample format:
 
 * **Added vhost-user live migration support.**
 
+* **Added af_packet dynamic removal function.**
+
+  Af_packet device can now be detached using API, like other PMD devices.
 
 Resolved Issues
 ---------------
@@ -120,6 +123,9 @@ This section should contain API changes. Sample format:
 * Add a short 1-2 sentence description of the API change. Use fixed width
   quotes for ``rte_function_names`` or ``rte_struct_names``. Use the past tense.
 
+* Af_packet device init function is no longer public. Device should be attached
+  with API.
+
 
 ABI Changes
 -----------
drivers/net/af_packet/Makefile +0 -5
index ce5d239..cb1a7ae 100644
@@ -50,11 +50,6 @@ CFLAGS += $(WERROR_FLAGS)
 #
 SRCS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET) += rte_eth_af_packet.c
 
-#
-# Export include files
-#
-SYMLINK-y-include += rte_eth_af_packet.h
-
 # this lib depends upon:
 DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET) += lib/librte_mbuf
 DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET) += lib/librte_ether
drivers/net/af_packet/rte_eth_af_packet.c +39 -4

81 lines not on this page · raw message

drivers/net/af_packet/rte_eth_af_packet.h deleted +0 -53

53 lines not on this page · raw message

drivers/net/af_packet/rte_pmd_af_packet_version.map +0 -3
index de95169..ef35398 100644
@@ -1,7 +1,4 @@
 DPDK_2.0 {
-	global:
-
-	rte_pmd_af_packet_devinit;
 
 	local: *;
 };
Signature · 1 line
1.9.1
Acked-by on v4 1/1
#1 lore raw
Quoted 19 lines

-----Original Message-----
From: Wojciech Zmuda [mailto:[email protected]]
Sent: Wednesday, March 2, 2016 11:56 AM
To: [email protected]
Cc: Iremonger, Bernard <[email protected]>; [email protected]; Richardson, Bruce <[email protected]>; [email protected]
Subject: [PATCH v4] af_packet: make the device detachable

Allow dynamic deallocation of af_packet device through proper API functions. To achieve this:
* set device flag to RTE_ETH_DEV_DETACHABLE
* implement rte_pmd_af_packet_devuninit() and expose it
through rte_driver.uninit()
* copy device name to ethdev->data to make discoverable with rte_eth_dev_allocated()
Moreover, make af_packet init function static, as there is no reason to keep it public.

Quoted 1 line
#2 lore raw
Quoted 19 lines · Bernard
Quoted 19 lines

-----Original Message-----
From: Wojciech Zmuda [mailto:[email protected]]
Sent: Wednesday, March 2, 2016 11:56 AM
To: [email protected]
Cc: Iremonger, Bernard <[email protected]>; [email protected]; Richardson, Bruce <[email protected]>; [email protected]
Subject: [PATCH v4] af_packet: make the device detachable

Allow dynamic deallocation of af_packet device through proper API functions. To achieve this:
* set device flag to RTE_ETH_DEV_DETACHABLE
* implement rte_pmd_af_packet_devuninit() and expose it
through rte_driver.uninit()
* copy device name to ethdev->data to make discoverable with rte_eth_dev_allocated()
Moreover, make af_packet init function static, as there is no reason to keep it public.

Quoted 4 lines
Quoted 1 line

Applied to dpdk-next-net/rel_16_04

/Bruce