From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by dpdk.space (Postfix) with ESMTP id 4013EA05D3
	for <public@inbox.dpdk.org>; Sat, 25 May 2019 13:29:59 +0200 (CEST)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id BEEF5343C;
	Sat, 25 May 2019 13:29:57 +0200 (CEST)
Received: from mga11.intel.com (mga11.intel.com [192.55.52.93])
 by dpdk.org (Postfix) with ESMTP id 740741DBD
 for <dev@dpdk.org>; Sat, 25 May 2019 13:29:55 +0200 (CEST)
X-Amp-Result: SKIPPED(no attachment in message)
X-Amp-File-Uploaded: False
Received: from fmsmga007.fm.intel.com ([10.253.24.52])
 by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;
 25 May 2019 04:29:54 -0700
X-ExtLoop1: 1
Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202])
 by fmsmga007.fm.intel.com with ESMTP; 25 May 2019 04:29:55 -0700
Received: from FMSMSX109.amr.corp.intel.com (10.18.116.9) by
 fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS)
 id 14.3.408.0; Sat, 25 May 2019 04:29:54 -0700
Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by
 fmsmsx109.amr.corp.intel.com (10.18.116.9) with Microsoft SMTP Server (TLS)
 id 14.3.408.0; Sat, 25 May 2019 04:29:53 -0700
Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.70]) by
 SHSMSX151.ccr.corp.intel.com ([169.254.3.216]) with mapi id 14.03.0415.000;
 Sat, 25 May 2019 19:29:51 +0800
From: "Zhang, Qi Z" <qi.z.zhang@intel.com>
To: "Ergin, Mesut A" <mesut.a.ergin@intel.com>, "Xing, Beilei"
 <beilei.xing@intel.com>
CC: "dev@dpdk.org" <dev@dpdk.org>
Thread-Topic: [PATCH 3/3] net/i40e: fix inadvertent override of vector RX
 allowance
Thread-Index: AQHVC5/WLBSaKt0SjEmZhwLDjaSjEaZ3H4VggAFtCoCAAQQWEIAAiXOAgAGnh1A=
Date: Sat, 25 May 2019 11:29:51 +0000
Message-ID: <039ED4275CED7440929022BC67E706115338732B@SHSMSX103.ccr.corp.intel.com>
References: <1557980885-183777-1-git-send-email-mesut.a.ergin@intel.com>
 <1557980885-183777-4-git-send-email-mesut.a.ergin@intel.com>
 <039ED4275CED7440929022BC67E7061153385EC0@SHSMSX103.ccr.corp.intel.com>
 <3615B82CA151CF42A86EDDD9846A8B38C7A8C3E5@ORSMSX112.amr.corp.intel.com>
 <039ED4275CED7440929022BC67E7061153386A98@SHSMSX103.ccr.corp.intel.com>
 <3615B82CA151CF42A86EDDD9846A8B38C7A8E453@ORSMSX112.amr.corp.intel.com>
In-Reply-To: <3615B82CA151CF42A86EDDD9846A8B38C7A8E453@ORSMSX112.amr.corp.intel.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMmYwMjViZjktNzEyNS00MGExLTkxYTEtYmJmZGE1ZTNjYWJkIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiVFYzanh6WFkyRTY5bmV5QVh3WGVnQVFwZGdFTGpFSml1a0c3WGJHOUdTZWRrMnJ6XC9tbEp5T25PalNLZWFJMjUifQ==
x-ctpclassification: CTP_NT
dlp-product: dlpe-windows
dlp-version: 11.0.600.7
dlp-reaction: no-action
x-originating-ip: [10.239.127.40]
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
Subject: Re: [dpdk-dev] [PATCH 3/3] net/i40e: fix inadvertent override of
 vector RX allowance
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

Hi Muset:

> -----Original Message-----
> From: Ergin, Mesut A
> Sent: Saturday, May 25, 2019 2:09 AM
> To: Zhang, Qi Z <qi.z.zhang@intel.com>; Xing, Beilei <beilei.xing@intel.c=
om>
> Cc: dev@dpdk.org
> Subject: RE: [PATCH 3/3] net/i40e: fix inadvertent override of vector RX
> allowance
>=20
> Hi,
>=20
> > > > > i40e_rx_vec_dev_conf_condition_check_default(struct rte_eth_dev
> *dev)
> > > > >  	if (rxmode->offloads & DEV_RX_OFFLOAD_VLAN_EXTEND)
> > > > >  		return -1;
> > > > >
> > > > > +	/* Should not override if vector was already disallowed */
> > > >
> > > > It is possible a device be reconfigured between
> > > > dev_stop/dev_start, vector mode may fit for the new configure, so
> > > > the old rx_vec_allowd should be ignored,
> > > >
> > >
> > > i40e_dev_configure would reset rx_vec_allowed already. Am I missing
> > > another reconfiguration path?
> >
> > Look at below scenario,
> >
> > 1. dev_configure (rx_vec_allowed is reset to true) 2. queue_setup (the
> > ring size is not power of 2) 3. dev_start (vector will not be selected
> > due to ring size, rx_vec_allowed set to
> > false)
> > 4. dev_stop
> > 5. queue_setup  (this time, with power of 2 ring size) 6. dev_start
> > (assume vector path should be selected, and rx_vec_allowed should be
> > overwrite to true, but your patch will prevent it)
> >
> > Also, I may not get the point of the gap you observed, would you share
> > more detail scenario?
> >
> > Regards
> > Qi
>=20
> It seems like queue setup should reset vector_allowed flag, too. Because
> i40e_dev_rx_queue_setup_runtime is already doing it, though covering only
> half of the state space (i.e. device already started).
>=20
> Do you think this patch plus that would be a preferred approach?

First, I need to understand your gap, that might be obvious, but so far I j=
ust did not figure out it base your commit log yet, so please give me more =
heads up :)
Secondary, I think move below codes from dev_configure to dev_start might b=
e a better solution

        ad->rx_bulk_alloc_allowed =3D true;
        ad->rx_vec_allowed =3D true;
        ad->tx_simple_allowed =3D true;
        ad->tx_vec_allowed =3D true;

Regards
Qi
>=20
> >
> > >
> > > Mesut
> > >
> > > > Regards
> > > > Qi
> > > >
> > > > > +	if (!ad->rx_vec_allowed)
> > > > > +	return -1;
> > > > > +
> > > > >  	/**
> > > > >  	 * Vector mode is allowed only when number of Rx queue
> > > > >  	 * descriptor is power of 2.
> > > > > --
> > > > > 2.7.4