From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id EACBDA0350; Fri, 26 Jun 2020 12:46:54 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CB3DD1BE95; Fri, 26 Jun 2020 12:46:54 +0200 (CEST) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by dpdk.org (Postfix) with ESMTP id 779571B951 for ; Fri, 26 Jun 2020 12:46:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593168413; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=q1Pv8BhT6RyxWK2+tZS8owGR9jjF3FOD/P394nurZuU=; b=Ry8V8BOXJSNN9qeVQgMZMxvC4s1np6vtHlmiEymOHYG6bsmy8TzICog8nLJYWBw5Ur7rwI 6hizSEtVrIATSa95MBG5bsFrt561tjbX9FuaVTXv9gh5Tzu5sA3B9nRLrIYAiawfxHIU6P +Vt7BaJ8CKHPqaFVqlW9iknDyCFP9JE= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-49-BwJyJb8PPyya_edwl04__w-1; Fri, 26 Jun 2020 06:46:51 -0400 X-MC-Unique: BwJyJb8PPyya_edwl04__w-1 Received: by mail-wm1-f71.google.com with SMTP id q20so462736wme.3 for ; Fri, 26 Jun 2020 03:46:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:autocrypt:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=q1Pv8BhT6RyxWK2+tZS8owGR9jjF3FOD/P394nurZuU=; b=juie1uNWclAEIPKkZ+3v9j/7LmFdfZaJOsNj39S1FpSJl0I11VVfXKIXUS+0Gx8gdg L9qHOGAGQbTgZ8hMFRhtjX+Je6elceg26V48gqgokgKPZakkrGpS81OqQ4S6FAkKLmOK b+BOqQOJmFOWEcePJzvU1HdOH4XB7M5oJO0RwImANDhUHLgpRSSfuVpU4NQOlWYcYVmy cYjmk7KPUPn0iQ7JihLClGLoxzxDutNzJaOZRPMWc9MLOZm2m34qXcsXjbqmnCKjuM6u 5gdfiEWB7FNL5/MWKwIGZoJDY6L1R5dPbPS3IhdArHD2hvnPhpEC7GpLixM2LNEzVCtF C0ow== X-Gm-Message-State: AOAM533qpJYd0yhDHO9U2bl2wgz43wRfuNlutT/jCos4K4UbOtiL6Ag9 8t4+wzzkmijr9tIw9GDFxx4UEbiEtp55HRGocAmlRTjv+9dlbayitvW6NPZ1u4IpXiBWB7L+ogx jGVg= X-Received: by 2002:a5d:4a01:: with SMTP id m1mr3046176wrq.250.1593168409716; Fri, 26 Jun 2020 03:46:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxkQTOcyvc675LGBvZ9FMFQTAFo7I9hR8ojcHa3Dqk1o1eGa3SRYIrdGWUZXnaXZ/oWbY9JfA== X-Received: by 2002:a5d:4a01:: with SMTP id m1mr3046158wrq.250.1593168409456; Fri, 26 Jun 2020 03:46:49 -0700 (PDT) Received: from amorenoz.users.ipa.redhat.com ([92.176.159.3]) by smtp.gmail.com with ESMTPSA id u74sm17395986wmu.31.2020.06.26.03.46.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 26 Jun 2020 03:46:48 -0700 (PDT) To: Maxime Coquelin , matan@mellanox.com, xiao.w.wang@intel.com, zhihong.wang@intel.com, chenbo.xia@intel.com, david.marchand@redhat.com, viacheslavo@mellanox.com, hemant.agrawal@nxp.com, sachin.saxena@nxp.com, grive@u256.net, dev@dpdk.org References: <20200624122701.1369327-1-maxime.coquelin@redhat.com> <20200624122701.1369327-9-maxime.coquelin@redhat.com> From: Adrian Moreno Autocrypt: addr=amorenoz@redhat.com; prefer-encrypt=mutual; keydata= mQENBF1syNUBCADQ9dk3fDMxOZ/+OQpmbanpodYxEv8IRtDz8PXw8YX7UyGfozOpLjQ8Fftj ZxuubYNbt2QVbSgviFilFdNWu2eTnN/JaGtfhmTOLPVoakkPHZF8lbgImMoch7L0fH8wN2IM KPxQyPNlX+K9FD5brHsV1lfe1TwAxmhcvLW8yNrVq+9eDIDykxc7tH4exIqXgZroahGxMHKy c8Ti2kJka/t6pDfRaY0J+6J7I1nrn6GXXSMNA45EH8+0N/QlcXhP3rfftnoPeVmpjswzvJqY FNjf/Q5VPLx7RX0Qx+y8mMB2JcChV5Bl7D7x5EUbItj6+Sy7QfOgCtPegk9HSrBCNYaLABEB AAG0I0FkcmlhbiBNb3Jlbm8gPGFtb3Jlbm96QHJlZGhhdC5jb20+iQFUBBMBCAA+FiEEogUD gihhmbOPHy26d5C5fbYeFsUFAl1syNUCGwMFCQHhM4AFCwkIBwIGFQoJCAsCBBYCAwECHgEC F4AACgkQd5C5fbYeFsX7qwgArGHSkX+ILNcujkVzjTG4OtkpJMPFlkn/1PxSEKD0jLuzx14B COzpg/Mqj3Re/QBuOas+ci9bsUA0/2nORtmmEBvzDOJpR5FH1jaGCx8USlY4WM6QqEDNZgTw hsy9KhjFzFjMk+oo3HyItXA+Uq9yrRBTjNBGTXxezMRcMuUZ4MIAfY0IRBglL2BufiuL43jD BvTENNFLoQ/wFV7qkFWSkv+8IjTsxr7M6XUo1QLd29Hn0dvwssN579HL1+BP46i2REpzeBEG L75iVChi+YnIQQNMJ9NYarVabZx4Y1Gn8+7B/1SNArDV+IDgnYgt7E58otoV2Ap310dmtuvE VbxGpbkBDQRdbMjVAQgAqyp9oA7WDu7/Y9T4Ommt69iZx8os7shUIfdgPEy5xrcPn6qGwN1/ HQ4j8nWfBG9uuX1X0RXUZIUEtYTxtED4yaCQMTqDUf9cBAwAA2mYxBfoiNYx8YqxM+sT0/J4 2qmDd+y+20UR4yzHE8AmIbspTzDFIJDAi+jKSR8F355z0sfW7CIMDC4ZWrPsskjEy1YN/U10 r6tRRH1kNyrCSbTG0d9MtcQO58h7DLXuzUhErB+BtG52A04t5cweIJTJC+koV5XPeilzlHnm RFoj0ncruGa9Odns21BNt3cy9wLfK+aUnWuAB1uc6bJGQPiAwjkilz7g7MBRUuIQ2Zt7HGLc SwARAQABiQE8BBgBCAAmFiEEogUDgihhmbOPHy26d5C5fbYeFsUFAl1syNUCGwwFCQHhM4AA CgkQd5C5fbYeFsUlSwf8CH+u/IXaE7WeWxwFkMaORfW8cM4q0xrL3M6yRGuQNW+kMjnrvK9U J9G+L1/5uTRbDQ/4LdoKqize8LjehA+iF6ba4t9Npikh8fLKWgaJfQ/hPhH4C3O5gWPOLTW6 ylGxiuER4CdFwQIoAMMslhFA7G+teeOKBq36E+1+zrybI6Xy1UBSlpDK9j4CtTnMQejjuSQb Qhle+l8VroaUHq869wjAhRHHhqmtJKggI+OvzgQpDIwfHIDypb1BuKydi2W6cVYEALUYyCLS dTBDhzj8zR5tPCsga8J7+TclQzkWOiI2C6ZtiWrMsL/Uym3uXk5nsoc7lSj7yLd/MrBRhYfP JQ== Message-ID: <02478e78-bdd3-cc8b-2681-ff73d04675ef@redhat.com> Date: Fri, 26 Jun 2020 12:46:47 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <20200624122701.1369327-9-maxime.coquelin@redhat.com> Content-Language: en-US Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=amorenoz@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH v2 08/14] vhost: remove useless vDPA API 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 6/24/20 2:26 PM, Maxime Coquelin wrote: > vDPA is no more used outside of the vDPA internals, > so remove rte_vdpa_get_device() API that is now useless. > > Signed-off-by: Maxime Coquelin > --- > lib/librte_vhost/rte_vdpa.h | 30 ----------------- > lib/librte_vhost/rte_vhost_version.map | 1 - > lib/librte_vhost/vdpa.c | 46 ++++++-------------------- > 3 files changed, 10 insertions(+), 67 deletions(-) > > diff --git a/lib/librte_vhost/rte_vdpa.h b/lib/librte_vhost/rte_vdpa.h > index 549b0a2cb0..da8ee33ab1 100644 > --- a/lib/librte_vhost/rte_vdpa.h > +++ b/lib/librte_vhost/rte_vdpa.h > @@ -174,36 +174,6 @@ __rte_experimental > struct rte_device * > rte_vdpa_get_rte_device(struct rte_vdpa_device *vdpa_dev); > > -/** > - * @warning > - * @b EXPERIMENTAL: this API may change without prior notice > - * > - * Find the device id of a vdpa device > - * > - * @param addr > - * the vdpa device address > - * @return > - * device id on success, -1 on failure > - */ > -__rte_experimental > -int > -rte_vdpa_find_device_id(struct rte_vdpa_device *dev); > - > -/** > - * @warning > - * @b EXPERIMENTAL: this API may change without prior notice > - * > - * Find a vdpa device based on device id > - * > - * @param did > - * device id > - * @return > - * rte_vdpa_device on success, NULL on failure > - */ > -__rte_experimental > -struct rte_vdpa_device * > -rte_vdpa_get_device(int did); > - > /** > * @warning > * @b EXPERIMENTAL: this API may change without prior notice > diff --git a/lib/librte_vhost/rte_vhost_version.map b/lib/librte_vhost/rte_vhost_version.map > index ba55f6f421..d9124d0462 100644 > --- a/lib/librte_vhost/rte_vhost_version.map > +++ b/lib/librte_vhost/rte_vhost_version.map > @@ -36,7 +36,6 @@ EXPERIMENTAL { > rte_vdpa_register_device; > rte_vdpa_unregister_device; > rte_vdpa_find_device_id; > - rte_vdpa_get_device; > rte_vdpa_get_device_num; > rte_vdpa_get_stats_names; > rte_vdpa_get_stats; > diff --git a/lib/librte_vhost/vdpa.c b/lib/librte_vhost/vdpa.c > index 91bc483774..d7965b8854 100644 > --- a/lib/librte_vhost/vdpa.c > +++ b/lib/librte_vhost/vdpa.c > @@ -19,27 +19,6 @@ static struct rte_vdpa_device vdpa_devices[MAX_VHOST_DEVICE]; > static uint32_t vdpa_device_num; > > > -int > -rte_vdpa_find_device_id(struct rte_vdpa_device *dev) > -{ > - struct rte_vdpa_device *tmp_dev; > - int i; > - > - if (dev == NULL) > - return -1; > - > - for (i = 0; i < MAX_VHOST_DEVICE; ++i) { > - tmp_dev = &vdpa_devices[i]; > - if (tmp_dev->ops == NULL) > - continue; > - > - if (tmp_dev == dev) > - return i; > - } > - > - return -1; > -} > - > struct rte_vdpa_device * > rte_vdpa_find_device_by_name(const char *name) > { > @@ -70,15 +49,6 @@ rte_vdpa_get_rte_device(struct rte_vdpa_device *vdpa_dev) > return vdpa_dev->device; > } > > -struct rte_vdpa_device * > -rte_vdpa_get_device(int did) > -{ > - if (did < 0 || did >= MAX_VHOST_DEVICE) > - return NULL; > - > - return &vdpa_devices[did]; > -} > - > struct rte_vdpa_device * > rte_vdpa_register_device(struct rte_device *rte_dev, > struct rte_vdpa_dev_ops *ops) > @@ -117,15 +87,19 @@ rte_vdpa_register_device(struct rte_device *rte_dev, > int > rte_vdpa_unregister_device(struct rte_vdpa_device *vdev) > { > - int did = rte_vdpa_find_device_id(vdev); > + int i; > > - if (did < 0 || vdpa_devices[did].ops == NULL) > - return -1; > + for (i = 0; i < MAX_VHOST_DEVICE; i++) { > + if (vdev != &vdpa_devices[i]) > + continue; > > - memset(&vdpa_devices[did], 0, sizeof(struct rte_vdpa_device)); > - vdpa_device_num--; > + memset(vdev, 0, sizeof(struct rte_vdpa_device)); > + vdpa_device_num--; > > - return 0; > + return 0; > + } > + > + return -1; > } > > int > Acked-by: Adrián Moreno -- Adrián Moreno