From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 5BBF82BB4 for ; Tue, 22 Mar 2016 18:17:53 +0100 (CET) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga102.jf.intel.com with ESMTP; 22 Mar 2016 10:17:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,378,1455004800"; d="scan'208";a="929549648" Received: from irsmsx101.ger.corp.intel.com ([163.33.3.153]) by fmsmga001.fm.intel.com with ESMTP; 22 Mar 2016 10:17:43 -0700 Received: from irsmsx106.ger.corp.intel.com ([169.254.8.172]) by IRSMSX101.ger.corp.intel.com ([169.254.1.157]) with mapi id 14.03.0248.002; Tue, 22 Mar 2016 17:17:42 +0000 From: "Loftus, Ciara" To: Tetsuya Mukawa , "dev@dpdk.org" CC: "ann.zhuangyanying@huawei.com" , "Richardson, Bruce" , "yuanhan.liu@linux.intel.com" Thread-Topic: [PATCH] vhost PMD: Fix wrong handling of maximum value of rx/tx queues Thread-Index: AQHRhBJlilq29zsPkUmLrZ9xCWfUeJ9ltLQg Date: Tue, 22 Mar 2016 17:17:42 +0000 Message-ID: <74F120C019F4A64C9B78E802F6AD4CC24F847A6D@IRSMSX106.ger.corp.intel.com> References: <1458634185-2526-1-git-send-email-mukawa@igel.co.jp> In-Reply-To: <1458634185-2526-1-git-send-email-mukawa@igel.co.jp> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYWM4NmIwMTktMjhlZS00MDQ0LWJjMWQtMWNkYmE5NWFmZDYwIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IlNWSTBtbVgzbURiYld2TnBTbTJBY1k2NGtOYW1Da3JWUkNBeEhQS2FBUG89In0= x-ctpclassification: CTP_IC x-originating-ip: [163.33.239.181] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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: Tue, 22 Mar 2016 17:17:53 -0000 >=20 > 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. >=20 > This wrong double meaning will cause an issue like below steps. >=20 > * Invoke application with below option. > --vdev 'eth_vhost0,iface=3D,queues=3D4' > * Configure queues like below. > rte_eth_dev_configure(portid, 2, 2, ...); > * Configure queues again like below. > rte_eth_dev_configure(portid, 4, 4, ...); >=20 > 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(). >=20 > To fix the issue, the patch prepare one more variable to keep the > number of maximum supported queues in vhost PMD. >=20 > Signed-off-by: Tetsuya Mukawa > --- > drivers/net/vhost/rte_eth_vhost.c | 14 ++++++++++++-- > 1 file changed, 12 insertions(+), 2 deletions(-) >=20 > 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; >=20 > 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 =3D dev->data->dev_private; > + if (internal =3D=3D NULL) { > + RTE_LOG(ERR, PMD, "Invalid device specified\n"); > + return; > + } > + > dev_info->driver_name =3D drivername; > dev_info->max_mac_addrs =3D 1; > dev_info->max_rx_pktlen =3D (uint32_t)-1; > - dev_info->max_rx_queues =3D dev->data->nb_rx_queues; > - dev_info->max_tx_queues =3D dev->data->nb_tx_queues; > + dev_info->max_rx_queues =3D internal->max_queues; > + dev_info->max_tx_queues =3D internal->max_queues; > dev_info->min_rx_bufsize =3D 0; > } >=20 > @@ -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 =3D queues; > data->nb_tx_queues =3D queues; > + internal->max_queues =3D queues; > data->dev_link =3D pmd_link; > data->mac_addrs =3D eth_addr; >=20 > -- > 2.1.4 Hi Tetsuya, Thanks again for the patch. Acked-by: Ciara Loftus Thanks, Ciara