Skip to content

ethdev port freeing

Thomas Monjalon dpdk-dev 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v6 Latest6 patches 4 repliesIn review
  2. v56 patches 16 repliesSuperseded
  3. v3 posting 2/24 patches 12 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v3 posting 1/22 patches7 repliesSuperseded

Changes in v6 from the cover letter

- fix testpmd ports list iteration
- keep old behaviour
- add flag RTE_ETH_DEV_CLOSE_REMOVE to enable new behaviour (port release)

Patches in v6 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6app/testpmd: update port list for multiple removalsapp/test-pmd/testpmd.c+26 -111 reply
2/6app/testpmd: allow detaching a port not closedapp/test-pmd/testpmd.c+7 -51 reply
3/6ethdev: fix doxygen comments of shared data fieldslib/librte_ethdev/rte_ethdev_core.h+13 -150 replies
4/6ethdev: free all common data when releasing portdrivers/net/af_packet/rte_eth_af_packet.c drivers/net/ark/ark_ethdev.c drivers/net/avf/avf_ethdev.c +42 more+109 -2320 replies
5/6ethdev: remove release function for secondary processdrivers/net/af_packet/rte_eth_af_packet.c drivers/net/bonding/rte_eth_bond_pmd.c drivers/net/kni/rte_eth_kni.c +9 more+15 -590 replies
6/6ethdev: complete closing of portapp/test-pmd/testpmd.c doc/guides/rel_notes/release_18_11.rst lib/librte_ethdev/rte_ethdev.c +1 more+25 -151 reply

Reviews trailers per patch

All 6 patches have a Reviewed-by or Acked-by.

PatchAndrew RybchenkoBernard Iremonger
1/6A-b
2/6A-b
3/6R-b
4/6A-b
5/6R-b
6/6R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v6 thread

Cover letter [PATCH v6 0/6] ethdev port freeing

The function rte_eth_dev_detach() is freeing a port and its underlying rte_device object. The issue is that we may have several ports associated to the same rte_device.

The right replacement is to free the port, and free the rte_device if no more ports.
At ethdev level, the public function for port freeing is rte_eth_dev_close(). The only miss is rte_eth_dev_release_port() to free all port resources.

This patchset does a cleanup by moving as much ethdev data freeing as possible in an unique function rte_eth_dev_release_port(), and call this function in rte_eth_dev_close().
The port is released on close only if the driver supports it.

Changes in v6:
- fix testpmd ports list iteration
- keep old behaviour
- add flag RTE_ETH_DEV_CLOSE_REMOVE to enable new behaviour (port release)

Changes in v5:
- fix testpmd for detaching multi-ports device
- fix testpmd for detaching only stopped ports
- add a release note about closed port freeing and state
- fix some doxygen comments in rte_eth_dev_data
- improve doxygen of rte_eth_dev_release_port()
- fix data freeing in some drivers

Changes in v4:
- do not free data fields which are not dynamically allocated blocks
- remove rte_eth_dev_release_port_secondary()
- remove testpmd check to detach without closing

Changes in v3:
- free queues, MAC addresses and private structure in rte_eth_dev_release_port.

Thomas Monjalon (5):
app/testpmd: allow detaching a port not closed
ethdev: fix doxygen comments of shared data fields
ethdev: free all common data when releasing port
ethdev: remove release function for secondary process
ethdev: complete closing of port

Wisam Jaddo (1):
app/testpmd: update port list for multiple removals

 app/test-pmd/testpmd.c                    | 65 +++++++++++++----------
 doc/guides/rel_notes/release_18_11.rst    |  5 ++
 drivers/net/af_packet/rte_eth_af_packet.c |  7 +--
 drivers/net/ark/ark_ethdev.c              |  1 -
 drivers/net/avf/avf_ethdev.c              |  3 --
 drivers/net/avp/avp_ethdev.c              |  5 --
 drivers/net/axgbe/axgbe_ethdev.c          |  3 --
 drivers/net/bnxt/bnxt_ethdev.c            |  4 --
 drivers/net/bonding/rte_eth_bond_pmd.c    | 11 ++--
 drivers/net/cxgbe/cxgbe_main.c            | 16 +-----
 drivers/net/cxgbe/cxgbevf_main.c          |  9 +---
 drivers/net/dpaa/dpaa_ethdev.c            | 10 ----
 drivers/net/dpaa2/dpaa2_ethdev.c          | 10 ----
 drivers/net/e1000/em_ethdev.c             |  3 --
 drivers/net/e1000/igb_ethdev.c            |  6 ---
 drivers/net/enetc/enetc_ethdev.c          |  4 +-
 drivers/net/failsafe/failsafe.c           |  6 ++-
 drivers/net/fm10k/fm10k_ethdev.c          |  8 ---
 drivers/net/i40e/i40e_ethdev.c            |  3 --
 drivers/net/i40e/i40e_ethdev_vf.c         |  3 --
 drivers/net/i40e/i40e_vf_representor.c    |  5 +-
 drivers/net/ixgbe/ixgbe_ethdev.c          |  9 ----
 drivers/net/ixgbe/ixgbe_vf_representor.c  |  5 +-
 drivers/net/kni/rte_eth_kni.c             |  7 +--
 drivers/net/liquidio/lio_ethdev.c         |  3 --
 drivers/net/mlx4/mlx4.c                   |  7 ++-
 drivers/net/mlx5/mlx5.c                   | 11 ++--
 drivers/net/mvneta/mvneta_ethdev.c        | 16 ++----
 drivers/net/mvpp2/mrvl_ethdev.c           | 16 ++----
 drivers/net/netvsc/hn_ethdev.c            | 15 +-----
 drivers/net/null/rte_eth_null.c           |  7 ++-
 drivers/net/octeontx/octeontx_ethdev.c    | 31 +++++------
 drivers/net/pcap/rte_eth_pcap.c           | 14 +++--
 drivers/net/qede/qede_ethdev.c            |  5 --
 drivers/net/ring/rte_eth_ring.c           |  6 +--
 drivers/net/sfc/sfc_ethdev.c              |  3 --
 drivers/net/softnic/rte_eth_softnic.c     |  7 ++-
 drivers/net/szedata2/rte_eth_szedata2.c   |  1 -
 drivers/net/tap/rte_eth_tap.c             |  8 ++-
 drivers/net/vhost/rte_eth_vhost.c         | 11 ++--
 drivers/net/virtio/virtio_ethdev.c        |  3 --
 drivers/net/virtio/virtio_user_ethdev.c   |  3 --
 drivers/net/vmxnet3/vmxnet3_ethdev.c      |  3 --
 lib/librte_ethdev/rte_ethdev.c            | 46 +++++++---------
 lib/librte_ethdev/rte_ethdev.h            |  9 +++-
 lib/librte_ethdev/rte_ethdev_core.h       | 38 +++++++------
 lib/librte_ethdev/rte_ethdev_driver.h     | 23 +++-----
 lib/librte_ethdev/rte_ethdev_pci.h        | 17 ------
 lib/librte_ethdev/rte_ethdev_version.map  |  7 ---
 49 files changed, 188 insertions(+), 330 deletions(-)
Signature · 1 line
2.19.0