All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: ferruh.yigit@intel.com, arybchenko@solarflare.com
Cc: dev@dpdk.org, ophirmu@mellanox.com, bernard.iremonger@intel.com,
	rahul.lakkireddy@chelsio.com
Subject: [PATCH v5 0/6] ethdev port freeing
Date: Thu, 18 Oct 2018 03:23:56 +0200	[thread overview]
Message-ID: <20181018012402.1240-1-thomas@monjalon.net> (raw)
In-Reply-To: <20180907233929.21950-1-thomas@monjalon.net>

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().


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: fix ports list after removing several at once

 app/test-pmd/testpmd.c                    | 64 +++++++++++++----------
 doc/guides/rel_notes/release_18_11.rst    |  4 ++
 drivers/net/af_packet/rte_eth_af_packet.c | 11 ++--
 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            |  8 ---
 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/failsafe/failsafe_ops.c       |  2 +
 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                   |  9 +++-
 drivers/net/mlx5/mlx5.c                   | 13 +++--
 drivers/net/mvneta/mvneta_ethdev.c        | 16 ++----
 drivers/net/mvpp2/mrvl_ethdev.c           | 16 ++----
 drivers/net/netvsc/hn_ethdev.c            | 20 +++----
 drivers/net/null/rte_eth_null.c           |  7 ++-
 drivers/net/octeontx/octeontx_ethdev.c    | 31 +++++------
 drivers/net/pcap/rte_eth_pcap.c           | 19 ++++---
 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     | 10 ++--
 drivers/net/szedata2/rte_eth_szedata2.c   |  1 -
 drivers/net/tap/rte_eth_tap.c             | 11 +++-
 drivers/net/vhost/rte_eth_vhost.c         | 15 ++----
 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            | 45 +++++-----------
 lib/librte_ethdev/rte_ethdev.h            |  3 +-
 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 ---
 50 files changed, 196 insertions(+), 347 deletions(-)

-- 
2.19.0

  parent reply	other threads:[~2018-10-18  1:24 UTC|newest]

Thread overview: 78+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-07 23:39 [RFC] ethdev: complete closing to free all resources Thomas Monjalon
2018-09-10  8:03 ` Andrew Rybchenko
2018-09-10  8:42   ` Thomas Monjalon
2018-09-10  8:54     ` Andrew Rybchenko
2018-09-12 14:57       ` Thomas Monjalon
2018-09-12 15:44         ` Andrew Rybchenko
2018-09-28 12:46 ` Ferruh Yigit
2018-10-09 22:00   ` Thomas Monjalon
2018-10-09 22:17 ` [PATCH v2] ethdev: complete closing of port Thomas Monjalon
2018-10-10  6:15   ` Andrew Rybchenko
2018-10-10  7:44     ` Thomas Monjalon
2018-10-10  7:50       ` Andrew Rybchenko
2018-10-10  8:39         ` Thomas Monjalon
2018-10-10 15:01           ` Andrew Rybchenko
2018-10-10 16:43             ` Thomas Monjalon
2018-10-10 18:01               ` Andrew Rybchenko
2018-10-10 19:03                 ` Thomas Monjalon
2018-10-14 23:20 ` [PATCH v3 0/2] ethdev port freeing Thomas Monjalon
2018-10-14 23:20   ` [PATCH v3 1/2] ethdev: free all common data when releasing port Thomas Monjalon
2018-10-16 11:16     ` Andrew Rybchenko
2018-10-16 12:22       ` Thomas Monjalon
2018-10-16 12:47         ` Andrew Rybchenko
2018-10-16 12:52           ` Thomas Monjalon
2018-10-16 12:55             ` Andrew Rybchenko
2018-10-14 23:20   ` [PATCH v3 2/2] ethdev: complete closing of port Thomas Monjalon
2018-10-16 11:24     ` Andrew Rybchenko
2018-10-16 12:25       ` Thomas Monjalon
2018-10-17  1:54 ` [PATCH v3 0/4] ethdev port freeing Thomas Monjalon
2018-10-17  1:54   ` [PATCH v3 1/4] app/testpmd: allow detaching a port not closed Thomas Monjalon
2018-10-17  2:06     ` Thomas Monjalon
2018-10-17  6:26     ` Andrew Rybchenko
2018-10-17  8:20       ` Thomas Monjalon
2018-10-17 10:30         ` Iremonger, Bernard
2018-10-17 11:33           ` Thomas Monjalon
2018-10-17  1:54   ` [PATCH v3 2/4] ethdev: free all common data when releasing port Thomas Monjalon
2018-10-17  7:13     ` Andrew Rybchenko
2018-10-17  8:22       ` Thomas Monjalon
2018-10-17  1:54   ` [PATCH v3 3/4] ethdev: remove release function for secondary process Thomas Monjalon
2018-10-17  7:25     ` Andrew Rybchenko
2018-10-17  9:27       ` Thomas Monjalon
2018-10-17  1:54   ` [PATCH v3 4/4] ethdev: complete closing of port Thomas Monjalon
2018-10-17  2:12     ` Thomas Monjalon
2018-10-17 10:24   ` [PATCH v3 0/4] ethdev port freeing Shreyansh Jain
2018-10-17 11:31     ` Thomas Monjalon
2018-10-18  1:23 ` Thomas Monjalon [this message]
2018-10-18  1:23   ` [PATCH v5 1/6] app/testpmd: fix ports list after removing several at once Thomas Monjalon
2018-10-18 10:40     ` Iremonger, Bernard
2018-10-18 11:29       ` Thomas Monjalon
2018-10-18 11:41         ` Iremonger, Bernard
2018-10-18 14:21           ` Thomas Monjalon
2018-10-18 16:42             ` Iremonger, Bernard
2018-10-18 17:06               ` Thomas Monjalon
2018-10-18 11:49         ` Wisam Monther
2018-10-18 13:22           ` Iremonger, Bernard
2018-10-18  1:23   ` [PATCH v5 2/6] app/testpmd: allow detaching a port not closed Thomas Monjalon
2018-10-18  7:45     ` Andrew Rybchenko
2018-10-18 10:51       ` Iremonger, Bernard
2018-10-18 11:24         ` Thomas Monjalon
2018-10-18  1:23   ` [PATCH v5 3/6] ethdev: fix doxygen comments of shared data fields Thomas Monjalon
2018-10-18  7:11     ` Andrew Rybchenko
2018-10-18  1:24   ` [PATCH v5 4/6] ethdev: free all common data when releasing port Thomas Monjalon
2018-10-18  7:13     ` Andrew Rybchenko
2018-10-18  1:24   ` [PATCH v5 5/6] ethdev: remove release function for secondary process Thomas Monjalon
2018-10-18  7:15     ` Andrew Rybchenko
2018-10-18  1:24   ` [PATCH v5 6/6] ethdev: complete closing of port Thomas Monjalon
2018-10-18  8:33     ` Andrew Rybchenko
2018-10-18  9:32       ` Thomas Monjalon
2018-10-19  2:07 ` [PATCH v6 0/6] ethdev port freeing Thomas Monjalon
2018-10-19  2:07   ` [PATCH v6 1/6] app/testpmd: update port list for multiple removals Thomas Monjalon
2018-10-19 14:32     ` Iremonger, Bernard
2018-10-19  2:07   ` [PATCH v6 2/6] app/testpmd: allow detaching a port not closed Thomas Monjalon
2018-10-19 14:32     ` Iremonger, Bernard
2018-10-19  2:07   ` [PATCH v6 3/6] ethdev: fix doxygen comments of shared data fields Thomas Monjalon
2018-10-19  2:07   ` [PATCH v6 4/6] ethdev: free all common data when releasing port Thomas Monjalon
2018-10-19  2:07   ` [PATCH v6 5/6] ethdev: remove release function for secondary process Thomas Monjalon
2018-10-19  2:07   ` [PATCH v6 6/6] ethdev: complete closing of port Thomas Monjalon
2018-10-19 10:13     ` Andrew Rybchenko
2018-10-22 15:43   ` [PATCH v6 0/6] ethdev port freeing Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181018012402.1240-1-thomas@monjalon.net \
    --to=thomas@monjalon.net \
    --cc=arybchenko@solarflare.com \
    --cc=bernard.iremonger@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=ophirmu@mellanox.com \
    --cc=rahul.lakkireddy@chelsio.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.