Message ID | 1458634185-2526-1-git-send-email-mukawa@igel.co.jp (mailing list archive) |
---|---|
State | Accepted, archived |
Delegated to: | Bruce Richardson |
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 608412B93; Tue, 22 Mar 2016 09:09:52 +0100 (CET) Received: from mail-pf0-f170.google.com (mail-pf0-f170.google.com [209.85.192.170]) by dpdk.org (Postfix) with ESMTP id 139E72949 for <dev@dpdk.org>; Tue, 22 Mar 2016 09:09:51 +0100 (CET) Received: by mail-pf0-f170.google.com with SMTP id x3so299708406pfb.1 for <dev@dpdk.org>; Tue, 22 Mar 2016 01:09:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=igel-co-jp.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=aGSibLF1VpGPAyXZOFN4nR6BzCtcxa2xSmdbQlNIiEA=; b=YE4wE6gIUhYKRypTjyVZ3/IhNKNJeHIw0yPIJI48bxLRoZhcE5+f+U+wMvyuluX80Q MsFJvjvauWGPfF/rZ/ziU5RbNFTmwARY+xOsxnO3gZDOZC5Y17u76/e3CLBGOavofvel FXcQi5qRpjknHGXtTvchXocOUGN4pW0dk9wIxuYuO2XTYkmFeKUYZKUVbxH2EUlSZgdO tirHv/MfBKYDapVH7UlXNQZkz0UvDOWjnqgc6brCBvb1arb0yPjk4VHpJGIZiTyIThzj 8+QTR4MRYYFPJjlRDLd89Re7E3DSinuQSJkXn2dzrYNjkyrnbXdRpUwgiDrnaD2RNmlW A66w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=aGSibLF1VpGPAyXZOFN4nR6BzCtcxa2xSmdbQlNIiEA=; b=eG79pgJtPTkTutJ50mE5AEvS9Z28tKwsXLvXxrgHQe7I+04pGsWvJfYhKhcM4w5pUp oBtwzbXRQdK3GJeyfmB5e0Q1VDn2Fszj1Xywgs7ZbMjUlhHXSH4SSNHhBnMaPcejVVd0 /zL5mACJYH6U0wFqMKacTQwwcPkmSIAc4ZUs8Bw9NmAFZAC0p/3u44xQ4zMKAdZ/RHJV YjSW3FmB5xyJ8ue7i284Dbq6AHKMx/bRLBDh3bfiKjthF96NgYSX6RgaKRHjg0sdPyVU navihq57A49A4qdPin3IxyU80OWc4Hfz2frug+AosJ78QliFEjjfjJlo1jvni2kp4zCD x/pA== X-Gm-Message-State: AD7BkJIZGaR3icFZzZ42DDq/Zw2Iwq6G0RCIbtrPZtsiowMG18pgdNkenqU4NtYWVOxfOw== X-Received: by 10.98.89.7 with SMTP id n7mr50709922pfb.81.1458634190505; Tue, 22 Mar 2016 01:09:50 -0700 (PDT) Received: from localhost.localdomain (napt.igel.co.jp. [219.106.231.132]) by smtp.gmail.com with ESMTPSA id ll7sm46107712pab.6.2016.03.22.01.09.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 22 Mar 2016 01:09:49 -0700 (PDT) From: Tetsuya Mukawa <mukawa@igel.co.jp> To: dev@dpdk.org, ciara.loftus@intel.com Cc: ann.zhuangyanying@huawei.com, bruce.richardson@intel.com, yuanhan.liu@linux.intel.com, Tetsuya Mukawa <mukawa@igel.co.jp> Date: Tue, 22 Mar 2016 17:09:45 +0900 Message-Id: <1458634185-2526-1-git-send-email-mukawa@igel.co.jp> X-Mailer: git-send-email 2.1.4 Subject: [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 <dev.dpdk.org> List-Unsubscribe: <http://dpdk.org/ml/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://dpdk.org/ml/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <http://dpdk.org/ml/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org Sender: "dev" <dev-bounces@dpdk.org> |
Commit Message
Tetsuya Mukawa
March 22, 2016, 8:09 a.m. UTC
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=<socket path>,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 <mukawa@igel.co.jp>
---
drivers/net/vhost/rte_eth_vhost.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
Comments
> > 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=<socket path>,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 <mukawa@igel.co.jp> > --- > 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 <ciara.loftus@intel.com> Thanks, Ciara
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=<socket path>,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 <mukawa@igel.co.jp> >> --- >> 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 <ciara.loftus@intel.com> > > Thanks, > Ciara > I appreciate your reviewing and testing. Thanks, Tetsuya
On Tue, Mar 22, 2016 at 05:17:42PM +0000, 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=<socket path>,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 <mukawa@igel.co.jp> > > --- <snip> > Acked-by: Ciara Loftus <ciara.loftus@intel.com> > Applied to dpdk-next-net/rel_16_04 /Bruce
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;