From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pd0-f174.google.com (mail-pd0-f174.google.com [209.85.192.174]) by dpdk.org (Postfix) with ESMTP id F0197B674 for ; Tue, 17 Feb 2015 07:15:09 +0100 (CET) Received: by pdbfp1 with SMTP id fp1so37214088pdb.5 for ; Mon, 16 Feb 2015 22:15:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=RQV7Gn9rWTmb4dhF+9P0Q/jH2Cuij6d2eJy4bnK5q+U=; b=DvbjIanTVnnc063L9qh7uSX8/mq8WmXrhc6BAiinVaa1u9w4EKdyMZFNBj5ECcTqkR I+qnmLqRWeYCGEOnNLHz7/M1QoZlx4XUgceAzRLaqHervqSJWJdA21NiYVVCG7c42V1m 78Yl/URxfaWg5KjI3HaVEDpydETe3tXxegFGXtVJ4fyguOYCfqGYm2wbIaW/CcowaLGU vv9rhpPvuqDwHQP5icg8cVlM7KVvxyCNLn/HhjE646ozqvxTncQ0tlB8HMrRVvC3E6nJ gTQ3C5h0CqpLrtD1zNV8ESvrymFn5GO8uM+5BfDsRV0Zwrxo1QpoaZP6BuJT1p77greb EVaQ== X-Gm-Message-State: ALoCoQl81dD7rty5n5+ji14kYRnM4BbelAMm399jqNEkbJFN3I1s5GHWW7L8oaZ62+DWZWRAH/Ie X-Received: by 10.68.115.196 with SMTP id jq4mr46814119pbb.150.1424153709420; Mon, 16 Feb 2015 22:15:09 -0800 (PST) Received: from [10.16.129.101] (napt.igel.co.jp. [219.106.231.132]) by mx.google.com with ESMTPSA id hn4sm16509976pdb.58.2015.02.16.22.15.08 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Feb 2015 22:15:08 -0800 (PST) Message-ID: <54E2DC6B.8000409@igel.co.jp> Date: Tue, 17 Feb 2015 15:15:07 +0900 From: Tetsuya Mukawa User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Thomas Monjalon References: <1423470639-15744-2-git-send-email-mukawa@igel.co.jp> <1424060073-23484-1-git-send-email-mukawa@igel.co.jp> <1424060073-23484-6-git-send-email-mukawa@igel.co.jp> <5935372.TlW161azlx@xps13> In-Reply-To: <5935372.TlW161azlx@xps13> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH v8 05/14] ethdev: Add rte_eth_dev_free to free specified device X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2015 06:15:10 -0000 On 2015/02/17 9:46, Thomas Monjalon wrote: > 2015-02-16 13:14, Tetsuya Mukawa: >> This patch adds rte_eth_dev_free(). The function is used for changing = an >> attached status of the device that has specified name. >> >> v6: >> - Use rte_eth_dev structure as the paramter of rte_eth_dev_free(). >> v4: >> - Add parameter checking. >> >> Signed-off-by: Tetsuya Mukawa >> --- >> lib/librte_ether/rte_ethdev.c | 11 +++++++++++ >> lib/librte_ether/rte_ethdev.h | 14 ++++++++++++++ >> 2 files changed, 25 insertions(+) >> >> diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethd= ev.c >> index a79fa5b..2463d18 100644 >> --- a/lib/librte_ether/rte_ethdev.c >> +++ b/lib/librte_ether/rte_ethdev.c >> @@ -260,6 +260,17 @@ rte_eth_dev_allocate(const char *name) >> return eth_dev; >> } >> =20 >> +int >> +rte_eth_dev_free(struct rte_eth_dev *eth_dev) >> +{ >> + if (eth_dev =3D=3D NULL) >> + return -EINVAL; >> + >> + eth_dev->attached =3D 0; >> + nb_ports--; >> + return 0; >> +} > This function is strange. I would imagine it calling the free (uninit) = function > of the driver. How about changing the name like below? rte_eth_dev_release_port() > [...] >> +/** >> + * Function for internal use by dummy drivers primarily, e.g. ring-ba= sed >> + * driver. >> + * Free the specified ethdev. >> + * >> + * @param eth_dev >> + * The *eth_dev* pointer is the address of the *rte_eth_dev* structur= e >> + * associated with the matching device and which have been [automat= ically] >> + * allocated in the *rte_eth_devices* array. >> + * @return >> + * - 0 on success, negative on error >> + */ >> +int rte_eth_dev_free(struct rte_eth_dev *eth_dev); >> + >> struct eth_driver; >> /** >> * @internal >> >