From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <konstantin.ananyev@intel.com>
Received: from mga04.intel.com (mga04.intel.com [192.55.52.120])
 by dpdk.org (Postfix) with ESMTP id BA0027CF8
 for <dev@dpdk.org>; Mon,  4 Sep 2017 17:55:15 +0200 (CEST)
Received: from orsmga004.jf.intel.com ([10.7.209.38])
 by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;
 04 Sep 2017 08:55:14 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.41,475,1498546800"; d="scan'208";a="125444261"
Received: from irsmsx108.ger.corp.intel.com ([163.33.3.3])
 by orsmga004.jf.intel.com with ESMTP; 04 Sep 2017 08:55:13 -0700
Received: from irsmsx156.ger.corp.intel.com (10.108.20.68) by
 IRSMSX108.ger.corp.intel.com (163.33.3.3) with Microsoft SMTP Server (TLS) id
 14.3.319.2; Mon, 4 Sep 2017 16:55:12 +0100
Received: from irsmsx105.ger.corp.intel.com ([169.254.7.75]) by
 IRSMSX156.ger.corp.intel.com ([169.254.3.130]) with mapi id 14.03.0319.002;
 Mon, 4 Sep 2017 16:55:12 +0100
From: "Ananyev, Konstantin" <konstantin.ananyev@intel.com>
To: Shahaf Shuler <shahafs@mellanox.com>, Thomas Monjalon <thomas@monjalon.net>
CC: "dev@dpdk.org" <dev@dpdk.org>
Thread-Topic: [dpdk-dev] [PATCH 4/4] ethdev: add helpers to move to the new
 offloads API
Thread-Index: AQHTJU1fVpbLAok7P06kzXdRtIICjKKkr2EAgAACQgCAACmKQA==
Date: Mon, 4 Sep 2017 15:55:11 +0000
Message-ID: <2601191342CEEE43887BDE71AB9772584F246317@irsmsx105.ger.corp.intel.com>
References: <cover.1504508374.git.shahafs@mellanox.com>
 <810c1d26724f82f0d9fc9d6684dc4b1c62fd5f62.1504508375.git.shahafs@mellanox.com>
 <2601191342CEEE43887BDE71AB9772584F24602F@irsmsx105.ger.corp.intel.com>
 <VI1PR05MB3149B5578E2C77F591A39711C3910@VI1PR05MB3149.eurprd05.prod.outlook.com>
In-Reply-To: <VI1PR05MB3149B5578E2C77F591A39711C3910@VI1PR05MB3149.eurprd05.prod.outlook.com>
Accept-Language: en-IE, en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
dlp-product: dlpe-windows
dlp-version: 11.0.0.116
dlp-reaction: no-action
x-originating-ip: [163.33.239.180]
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
Subject: Re: [dpdk-dev] [PATCH 4/4] ethdev: add helpers to move to the
	new	offloads API
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <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>
X-List-Received-Date: Mon, 04 Sep 2017 15:55:16 -0000



> -----Original Message-----
> From: Shahaf Shuler [mailto:shahafs@mellanox.com]
> Sent: Monday, September 4, 2017 3:03 PM
> To: Ananyev, Konstantin <konstantin.ananyev@intel.com>; Thomas Monjalon <=
thomas@monjalon.net>
> Cc: dev@dpdk.org
> Subject: RE: [dpdk-dev] [PATCH 4/4] ethdev: add helpers to move to the ne=
w offloads API
>=20
> Hi Konstantin,
>=20
> Monday, September 4, 2017 4:25 PM, Ananyev, Konstantin:
> >
> > Hi Shahaf,
> >
> > >  }
> > >
> > > +/**
> > > + * A conversion function from rxmode offloads API to rte_eth_rxq_con=
f
> > > + * offloads API.
> > > + */
> > > +static void
> > > +rte_eth_convert_rxmode_offloads(struct rte_eth_rxmode *rxmode,
> > > +				struct rte_eth_rxq_conf *rxq_conf) {
> > > +	if (rxmode->header_split =3D=3D 1)
> > > +		rxq_conf->offloads |=3D DEV_RX_OFFLOAD_HEADER_SPLIT;
> > > +	if (rxmode->hw_ip_checksum =3D=3D 1)
> > > +		rxq_conf->offloads |=3D DEV_RX_OFFLOAD_CHECKSUM;
> > > +	if (rxmode->hw_vlan_filter =3D=3D 1)
> > > +		rxq_conf->offloads |=3D DEV_RX_OFFLOAD_VLAN_FILTER;
> >
> > Thinking on it a bit more:
> > VLAN_FILTER is definitely one per device, as it would affect VFs also.
> > At least that's what we have for Intel devices (ixgbe, i40e) right now.
>=20
> This is vendor specific. For Mellanox this is one per device (regardless =
if it is a vf/pf).
>=20
> > For Intel devices VLAN_STRIP is also per device and will also be  appli=
ed to all
> > corresponding VFs.
>=20
> Again - vendor specific. For Mellanox is per queue.

Yep, I understand it varies quite a lot from vendor from vendor.
That's why I started to think we need to have to allow user to specify rx_o=
ffloads
for both port and queue basis.

>=20
> > In fact, right now it is possible to query/change these 3 vlan offload =
flags on
> > the fly (after dev_start) on  port basis by
> > rte_eth_dev_(get|set)_vlan_offload API.
> > So, I think at least these 3 flags need to be remained on a port basis.
>=20
> Am not sure I agree.
> Why, for example, block from application the option to set some queues wi=
th vlan strip and some without if device allows?
> Also how will we decide which offloads should stay per port and which are=
 allowed to move per queue? this much depends on the
> underlying PMD.
>=20
> Looks like i missed that part on ethdev, and if Rx offload will be per qu=
eue I will need to change it also.
>=20
>=20
> > In fact, why can't we have both per port and per queue RX offload:
> > - dev_configure() will accept RX_OFFLOAD_* flags and apply them on a po=
rt
> > basis.
> > - rx_queue_setup() will also accept RX_OFFLOAD_* flags and apply them o=
n
> > a queue basis.
> > - if particular RX_OFFLOAD flag for that device couldn't be setup on a =
queue
> > basis  -
> >    rx_queue_setup() will return an error.
>=20
> Why not taking the per port configuration as a sub-case of per queue conf=
iguration?
> For per-port offloads as long as the same configuration applies the queue=
 setup succeeds.

Do you mean that as long as queue config for offload X matches port config =
for the same offload - it is ok,
even if for that particular device offload X is per port not per queue?

Let say:
...
rxconf.offloads =3D DEV_RX_OFFLOAD_VLAN_STRIP;
...
rte_eth_dev_configure(port, ...);
...

/* queue offloads matches port offloads - always  */
rte_eth_rx_queue_setup(port, ..., &rcxonf);
...
rxconf.offloads &=3D ~ DEV_RX_OFFLOAD_VLAN_STRIP;

/* ok for devices where vlan_stip per queue is supported,
  * fails for devices with vlan_strip offload is per device.
  */=20
rte_eth_rx_queue_setup(port, ..., &rcxonf);

?

Konstantin





=20

>=20
>=20
> > - rte_eth_rxq_info can be extended to provide information which
> > RX_OFFLOADs
> >   can be configured on a per queue basis.
>=20
> I am OK with the info suggestion.
>=20
> > BTW - in that case we probably wouldn't need ignore flag inside rx_conf
> > anymore.
> >
> >
> > > +	if (rxmode->hw_vlan_strip =3D=3D 1)
> > > +		rxq_conf->offloads |=3D DEV_RX_OFFLOAD_VLAN_STRIP;
> > > +	if (rxmode->hw_vlan_extend =3D=3D 1)
> > > +		rxq_conf->offloads |=3D DEV_RX_OFFLOAD_VLAN_EXTEND;
> > > +	if (rxmode->jumbo_frame =3D=3D 1)
> > > +		rxq_conf->offloads |=3D DEV_RX_OFFLOAD_JUMBO_FRAME;
> >
> > There are some extra checks for that flag inside rte_eth_dev_configure(=
).
> > If we going so support it per queue - then it probably need to be updat=
ed.
> >
> > > +	if (rxmode->hw_strip_crc =3D=3D 1)
> > > +		rxq_conf->offloads |=3D DEV_RX_OFFLOAD_CRC_STRIP;
> > > +	if (rxmode->enable_scatter =3D=3D 1)
> > > +		rxq_conf->offloads |=3D DEV_RX_OFFLOAD_SCATTER;
> > > +	if (rxmode->enable_lro =3D=3D 1)
> > > +		rxq_conf->offloads |=3D DEV_RX_OFFLOAD_TCP_LRO; }
> > > +
> >
> > Konstantin