From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id 2103B1B109 for ; Fri, 19 Oct 2018 04:08:02 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id A3376229EF; Thu, 18 Oct 2018 22:08:01 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Thu, 18 Oct 2018 22:08:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=mesmtp; bh=omlo1ujZCU FXAg0BM87NSjABbwyC8KMdyy+31Lmekn0=; b=NMoDyN/bkXO+2dFjuroCn+UKKq qjM39y3/kPr2uzzoMoNG+vnooX0qBF3r/7xp8f5a1h7LZh3GlrjhFQ7pMXbyxC0C Telq5Try8BhZs0pY+911wlmLsvf6tUN5YdU8AXA74G6jIt593ICt4wnNRzMnotMd Ms7mKCesJKmm2v5PA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=omlo1ujZCUFXAg0BM87NSjABbwyC8KMdyy+31Lmekn0=; b=E93z8KGH 5RNlNMeO6d5uuMcPMS4l9DmUZja3NadcALCq7OHCFyTLurfGh8X0KQ4SGQDiOn/P yMJsFms+Mg8/31yU7oSQgQ2+A0kanY6FxdDLO+S2fi+J6DTKqP42KNBEnHnJph2p QkuMJjolGMIiR4khCHhz2Fo0GgFUrylPyLfy4IJJ8l3Ql9gsd7Xxp27xCG6qrGsR b8+N0zxQ5JWzD2uTtuKjNSvmfVB9Kf4VM/x4TyPS5bOyrnjV4jCXUBIds8TQA7px XCef1PHzYp4u/VtACDoPBUP0akAHVft4Y3VIBBFVbGkhT6J0vHq5orZlFI1TXfDq cZqxoI/zDO6y0Q== X-ME-Sender: X-ME-Proxy: Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 4B720102E4; Thu, 18 Oct 2018 22:08:00 -0400 (EDT) From: Thomas Monjalon To: ferruh.yigit@intel.com, arybchenko@solarflare.com Cc: dev@dpdk.org, ophirmu@mellanox.com, bernard.iremonger@intel.com, rahul.lakkireddy@chelsio.com Date: Fri, 19 Oct 2018 04:07:51 +0200 Message-Id: <20181019020757.27698-1-thomas@monjalon.net> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180907233929.21950-1-thomas@monjalon.net> References: <20180907233929.21950-1-thomas@monjalon.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v6 0/6] ethdev port freeing X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Oct 2018 02:08:02 -0000 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(-) -- 2.19.0