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 BDD50A051C; Fri, 26 Jun 2020 15:50:09 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9205A1B13C; Fri, 26 Jun 2020 15:50:09 +0200 (CEST) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by dpdk.org (Postfix) with ESMTP id 128A9255 for ; Fri, 26 Jun 2020 15:50:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593179407; 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=/ZmLxmIPi0Eqxuyk2TRuqLSCTNbomGc03yNU4ig5Ik8=; b=UoAJLi0EugTfnlUq8+10bUkZgYFAst7kKbd+gg/oRjgK/hwo8WKPU9UM+xO8ENSN5WjPrs 3dXCjqqnzXL42VqQ8lPyM0v3I/d1iX/BwzAawh67jxrvsWCgTt6X6txZQ6AzyIXHAr4FYF oKs/OdezOldgZeiDs9HAgXtCjthjMrs= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-198-XGb7QovePG2C7L311xZ-rQ-1; Fri, 26 Jun 2020 09:50:05 -0400 X-MC-Unique: XGb7QovePG2C7L311xZ-rQ-1 Received: by mail-wr1-f72.google.com with SMTP id p9so10863250wrx.10 for ; Fri, 26 Jun 2020 06:50:05 -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=/ZmLxmIPi0Eqxuyk2TRuqLSCTNbomGc03yNU4ig5Ik8=; b=mtmRj5XeXcPaQqDQ/eMt9+aox1HJGndszDwOqry1+6gt4I5FwRT5vj3spdnXDZQmAL wi87T6HFhDbWpDMWlSIkTPDNEbR+fNSWjlYiNGahFLV4Izgv3LjZBx9wjHsma7j5PDb4 79bRAC7pjkulr2lUsD9Ro7GCiBHhP3vnbCbxjuTKbpZrORK/Y7+ukMPo86IQjOMHTVsI +sbklxd2Tw5VT5QH3xWb0rH69jUWnGIj4om5x2cjTIYPnD4La/e4SQx9326LuDhSbDtC qioSk0mCAdMqooD40l+A2SSCZ6whupm6ZfnKOnOhJy/a0kKGSYL1v4N8VnEdiDNY1qWJ KddA== X-Gm-Message-State: AOAM5331JcYTcFXnjWmssmSHksWyehnnl8tjHY84Tnkxxr/J1rYAFXfK X10gEpQo3KesEhgJk7zFIG2R6fhD/YV7RgIYbA+lPrfSaVzNfB+/xJtV7srr+XcLrhj13Vuola7 8wO4= X-Received: by 2002:a7b:cb05:: with SMTP id u5mr3549948wmj.169.1593179404270; Fri, 26 Jun 2020 06:50:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwoIG0/IoLWQXJ/RacI5hDaaNbgCPRk0NcXSKYj/bZGB7tXV1z8Q086BrAq7asl02kaTOEYbw== X-Received: by 2002:a7b:cb05:: with SMTP id u5mr3549937wmj.169.1593179404090; Fri, 26 Jun 2020 06:50:04 -0700 (PDT) Received: from amorenoz.users.ipa.redhat.com ([92.176.159.3]) by smtp.gmail.com with ESMTPSA id u84sm14232168wme.42.2020.06.26.06.50.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 26 Jun 2020 06:50:03 -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: <20200626132712.1437673-1-maxime.coquelin@redhat.com> <20200626132712.1437673-13-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: <397b7ed7-8546-375d-ad30-997999b82a46@redhat.com> Date: Fri, 26 Jun 2020 15:50:02 +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: <20200626132712.1437673-13-maxime.coquelin@redhat.com> Content-Language: en-US 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 v3 12/14] examples/vdpa: remove useless device count 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/26/20 3:27 PM, Maxime Coquelin wrote: > The VDPA example now uses the vDPA class iterator, so > knowing the number of available devices beforehand is > no longer needed. > > Signed-off-by: Maxime Coquelin > --- > examples/vdpa/main.c | 9 ++------- > 1 file changed, 2 insertions(+), 7 deletions(-) > > diff --git a/examples/vdpa/main.c b/examples/vdpa/main.c > index d59c7fa9b4..2345f98665 100644 > --- a/examples/vdpa/main.c > +++ b/examples/vdpa/main.c > @@ -38,7 +38,6 @@ struct vdpa_port { > static struct vdpa_port vports[MAX_VDPA_SAMPLE_PORTS]; > > static char iface[MAX_PATH_LEN]; > -static int dev_total; > static int devcnt; > static int interactive; > static int client_mode; > @@ -227,7 +226,7 @@ static void > vdpa_sample_quit(void) > { > int i; > - for (i = 0; i < RTE_MIN(MAX_VDPA_SAMPLE_PORTS, dev_total); i++) { > + for (i = 0; i < RTE_MIN(MAX_VDPA_SAMPLE_PORTS, devcnt); i++) { > if (vports[i].ifname[0] != '\0') > close_vdpa(&vports[i]); > } > @@ -399,7 +398,7 @@ static void cmd_device_stats_parsed(void *parsed_result, struct cmdline *cl, > res->bdf); > return; > } > - for (i = 0; i < RTE_MIN(MAX_VDPA_SAMPLE_PORTS, dev_total); i++) { > + for (i = 0; i < RTE_MIN(MAX_VDPA_SAMPLE_PORTS, devcnt); i++) { > if (vports[i].dev == vdev) { > vport = &vports[i]; > break; > @@ -536,10 +535,6 @@ main(int argc, char *argv[]) > argc -= ret; > argv += ret; > > - dev_total = rte_vdpa_get_device_num(); > - if (dev_total <= 0) > - rte_exit(EXIT_FAILURE, "No available vdpa device found\n"); > - > signal(SIGINT, signal_handler); > signal(SIGTERM, signal_handler); > > Acked-by: Adrián Moreno -- Adrián Moreno