From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f170.google.com (mail-pf0-f170.google.com [209.85.192.170]) by dpdk.org (Postfix) with ESMTP id 9F9D156AB for ; Wed, 23 Mar 2016 02:07:43 +0100 (CET) Received: by mail-pf0-f170.google.com with SMTP id u190so1586928pfb.3 for ; Tue, 22 Mar 2016 18:07:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=igel-co-jp.20150623.gappssmtp.com; s=20150623; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=jmWmRw0AB8lNHJdylAUGSsQWnStDl9Umf2UQReH7XDI=; b=htPgCSKScWAD1Uz6qwkFkfjvh1Or6tWmuPwfJafYALUhqSNShXpQzIwE2HPhGqEkUc 4u1MS7mHPWSAOuP3g5Yio5ytbroaIaqHwOA/R4GWkIVjAHLmhmTjTyyCmEFRdY33AN7d 4UyRgMlmKQL7upW+6eI4Yi4t7JYYq2KLw9YewTgYPZQPwxv92q8Ju+xclgt/0MYZfujp s49jSPGa+w7S8TZn8q/0Y3/Gee4wjjEZlKz8B3RYZ2l0bHuqVtvCEfi9PLWIGs8Le/KO 4N93VEc+dkVWkMR0/6yeGvzixPSMWO9BN1oeM/ZJJpHsSq1USY0rDGeNcHhtKM4tuVNP tGQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=jmWmRw0AB8lNHJdylAUGSsQWnStDl9Umf2UQReH7XDI=; b=WhRGUpZCUOl4l4ki369/LF5q+k5qGVxW1DfY01q17jqgHYRXF/bZu2BDqdOk52VQmF hQ8ob1w/BiG4DCJUtpmIaJmHIfOMzUt5yGDiNd+kw8frsc9HlKKTI9UJkX/ul+ZhWnfn bjVJeDQh+aKuZSJ7ieySoHps0CJ9azR/JlIlNj09bi0Hq/jUKRqUiTx5hWTcpSIOuqYj 2BXR0OuOis8WNBQfEJvvtExnbLnjeSlKsHPeOOzUtY977gkGfJJviQkXTJ82L+SkxE5t qGAT36jbA2mFMy+SKF7jmnwH0irtXBdWU1SfxVDQ2qwZy/takLyhVC1ByE267klL3K0P deTQ== X-Gm-Message-State: AD7BkJLGiT2ZEH2wUgj+qtdiPNSZk9S6z5XzmhdbQreRpyRwGhWC/+wsyiiRu9p6QoLhqA== X-Received: by 10.98.87.200 with SMTP id i69mr189896pfj.63.1458695262992; Tue, 22 Mar 2016 18:07:42 -0700 (PDT) Received: from [10.16.129.101] (napt.igel.co.jp. [219.106.231.132]) by smtp.googlemail.com with ESMTPSA id m87sm39581pfj.38.2016.03.22.18.07.40 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 22 Mar 2016 18:07:42 -0700 (PDT) To: "Loftus, Ciara" , "dev@dpdk.org" References: <1458634185-2526-1-git-send-email-mukawa@igel.co.jp> <74F120C019F4A64C9B78E802F6AD4CC24F847A6D@IRSMSX106.ger.corp.intel.com> Cc: "ann.zhuangyanying@huawei.com" , "Richardson, Bruce" , "yuanhan.liu@linux.intel.com" From: Tetsuya Mukawa Message-ID: <56F1EC5D.8010105@igel.co.jp> Date: Wed, 23 Mar 2016 10:07:41 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <74F120C019F4A64C9B78E802F6AD4CC24F847A6D@IRSMSX106.ger.corp.intel.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] vhost PMD: Fix wrong handling of maximum value of rx/tx queues 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: Wed, 23 Mar 2016 01:07:44 -0000 On 2016/03/23 2:17, Loftus, Ciara wrote: >> Currently, the maximum value of rx/tx queueus are kept by EAL. But, >> the value are used like below different meanings in vhost PMD. >> - The maximum value of current enabled queues. >> - The maximum value of current supported queues. >> >> This wrong double meaning will cause an issue like below steps. >> >> * Invoke application with below option. >> --vdev 'eth_vhost0,iface=,queues=4' >> * Configure queues like below. >> rte_eth_dev_configure(portid, 2, 2, ...); >> * Configure queues again like below. >> rte_eth_dev_configure(portid, 4, 4, ...); >> >> The second rte_eth_dev_configure() will be failed because both >> the maximum value of current enabled queues and supported queues >> will be '2' after calling first rte_eth_dev_configure(). >> >> To fix the issue, the patch prepare one more variable to keep the >> number of maximum supported queues in vhost PMD. >> >> Signed-off-by: Tetsuya Mukawa >> --- >> drivers/net/vhost/rte_eth_vhost.c | 14 ++++++++++++-- >> 1 file changed, 12 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/net/vhost/rte_eth_vhost.c >> b/drivers/net/vhost/rte_eth_vhost.c >> index 6b9d287..5fd8c70 100644 >> --- a/drivers/net/vhost/rte_eth_vhost.c >> +++ b/drivers/net/vhost/rte_eth_vhost.c >> @@ -88,6 +88,7 @@ struct vhost_queue { >> struct pmd_internal { >> char *dev_name; >> char *iface_name; >> + uint16_t max_queues; >> >> volatile uint16_t once; >> }; >> @@ -555,11 +556,19 @@ static void >> eth_dev_info(struct rte_eth_dev *dev, >> struct rte_eth_dev_info *dev_info) >> { >> + struct pmd_internal *internal; >> + >> + internal = dev->data->dev_private; >> + if (internal == NULL) { >> + RTE_LOG(ERR, PMD, "Invalid device specified\n"); >> + return; >> + } >> + >> dev_info->driver_name = drivername; >> dev_info->max_mac_addrs = 1; >> dev_info->max_rx_pktlen = (uint32_t)-1; >> - dev_info->max_rx_queues = dev->data->nb_rx_queues; >> - dev_info->max_tx_queues = dev->data->nb_tx_queues; >> + dev_info->max_rx_queues = internal->max_queues; >> + dev_info->max_tx_queues = internal->max_queues; >> dev_info->min_rx_bufsize = 0; >> } >> >> @@ -751,6 +760,7 @@ eth_dev_vhost_create(const char *name, char >> *iface_name, int16_t queues, >> memmove(data->name, eth_dev->data->name, sizeof(data- >>> name)); >> data->nb_rx_queues = queues; >> data->nb_tx_queues = queues; >> + internal->max_queues = queues; >> data->dev_link = pmd_link; >> data->mac_addrs = eth_addr; >> >> -- >> 2.1.4 > Hi Tetsuya, > > Thanks again for the patch. > > Acked-by: Ciara Loftus > > Thanks, > Ciara > I appreciate your reviewing and testing. Thanks, Tetsuya