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 149D5239 for ; Mon, 15 Oct 2018 01:20:36 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 8EA6421D25; Sun, 14 Oct 2018 19:20:35 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Sun, 14 Oct 2018 19:20:35 -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=BMppWhEbo7 ZPccHEOdbE3HDUM1JVmdkFryQ3ir7AZNo=; b=OsENXyaJJHVUPw1ncSKPFmYjD7 MMCNSKfxCRsSh5lFtTXPwbBRWZSkkNOqZPK+h7RiPECIcW5y2TLd7BiSA1CA9SeM wDfMuhsgwLDyhjjST5dE4wLisSiytG6s3MhPfl2DRm8XmIo3laAeUR/F9q371rFB LlC2belOBDhMacTWs= 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=BMppWhEbo7ZPccHEOdbE3HDUM1JVmdkFryQ3ir7AZNo=; b=vybRZ9yW p/ebJjcozyd1Yb/amjirJ008SeYjecdIEYmP3N9UFEJwqwd+TpqRs+RnpLKygkPE gqlHLaWmGKOg/+EQxjVJjlEXE9ISBhQrTbdJ7edCHDieQASlzgwW/QvRLWTo6Q3U SNfR/n1YB9Hv34CYn+6P4yGBbPH5CATNJCDU60NiJml3xkrcnLY/g8cVIeE1N1xw 9Ik2zGQ123aGAAuBdN3LMaXD0ZOgwTXwj4RA7O40WdArS5oZX2pHPEE0EoNDC+1I 5sw6smcU4AJDVcs8EXmGBDKVh7HrMF+jtnP7KKvcgRbjnh531+vBSG5f6df3stcO t0lAy7bftGwWpA== 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 BF46BE4073; Sun, 14 Oct 2018 19:20:33 -0400 (EDT) From: Thomas Monjalon To: ferruh.yigit@intel.com, arybchenko@solarflare.com Cc: dev@dpdk.org, ophirmu@mellanox.com Date: Mon, 15 Oct 2018 01:20:18 +0200 Message-Id: <20181014232020.12114-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 v3 0/2] 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: Sun, 14 Oct 2018 23:20:36 -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. Changes in v3: - free queues, MAC addresses and private structure in rte_eth_dev_release_port. Thomas Monjalon (2): ethdev: free all common data when releasing port ethdev: complete closing of port drivers/net/af_packet/rte_eth_af_packet.c | 2 -- 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 | 7 +---- 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 | 3 --- drivers/net/fm10k/fm10k_ethdev.c | 8 ------ drivers/net/i40e/i40e_ethdev.c | 3 --- drivers/net/i40e/i40e_ethdev_vf.c | 3 --- drivers/net/ixgbe/ixgbe_ethdev.c | 9 ------- drivers/net/kni/rte_eth_kni.c | 2 -- drivers/net/liquidio/lio_ethdev.c | 3 --- drivers/net/mlx4/mlx4.c | 3 +-- drivers/net/mlx5/mlx5.c | 5 +--- drivers/net/mvneta/mvneta_ethdev.c | 16 ++++-------- drivers/net/mvpp2/mrvl_ethdev.c | 16 ++++-------- drivers/net/netvsc/hn_ethdev.c | 11 -------- drivers/net/null/rte_eth_null.c | 2 -- drivers/net/octeontx/octeontx_ethdev.c | 29 ++++++++------------ drivers/net/pcap/rte_eth_pcap.c | 7 ----- drivers/net/qede/qede_ethdev.c | 5 ---- drivers/net/ring/rte_eth_ring.c | 4 --- drivers/net/sfc/sfc_ethdev.c | 3 --- drivers/net/softnic/rte_eth_softnic.c | 6 ++--- drivers/net/szedata2/rte_eth_szedata2.c | 1 - drivers/net/tap/rte_eth_tap.c | 1 - drivers/net/vhost/rte_eth_vhost.c | 13 +++------ 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 | 32 +++++++++-------------- lib/librte_ethdev/rte_ethdev.h | 3 +-- lib/librte_ethdev/rte_ethdev_pci.h | 11 -------- 42 files changed, 47 insertions(+), 248 deletions(-) -- 2.19.0