From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0081.outbound.protection.outlook.com [104.47.0.81]) by dpdk.org (Postfix) with ESMTP id 63069378E for ; Mon, 4 Sep 2017 16:02:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=QEQDjnoEGtEbc0crKyS+qwE/hjMc/o524fkewkR8Dnw=; b=QUThACOUwgXA7sQAeDy51q5TlHU6OEjEyh/VCuPjZ839gXyhP6bPSURFDs191HWBTC8v1f/hlJAErEQaDp0sR5mo5wAIOENPW1OEWqFL2XAUdgkeqIHKLS5qfDcwWejcgrz1K9jTM9VI0ZkEw8ckXfJmvfBVFCrH5n5gLh8CHWI= Received: from VI1PR05MB3149.eurprd05.prod.outlook.com (10.170.237.142) by VI1PR05MB1213.eurprd05.prod.outlook.com (10.162.15.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.13.10; Mon, 4 Sep 2017 14:02:55 +0000 Received: from VI1PR05MB3149.eurprd05.prod.outlook.com ([fe80::8450:1a86:2dd0:82c2]) by VI1PR05MB3149.eurprd05.prod.outlook.com ([fe80::8450:1a86:2dd0:82c2%13]) with mapi id 15.20.0013.018; Mon, 4 Sep 2017 14:02:55 +0000 From: Shahaf Shuler To: "Ananyev, Konstantin" , Thomas Monjalon CC: "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH 4/4] ethdev: add helpers to move to the new offloads API Thread-Index: AQHTJU1Pk0iCZ9SkkUOghy7YfYNWq6Kkt9wAgAAFjhA= Date: Mon, 4 Sep 2017 14:02:54 +0000 Message-ID: References: <810c1d26724f82f0d9fc9d6684dc4b1c62fd5f62.1504508375.git.shahafs@mellanox.com> <2601191342CEEE43887BDE71AB9772584F24602F@irsmsx105.ger.corp.intel.com> In-Reply-To: <2601191342CEEE43887BDE71AB9772584F24602F@irsmsx105.ger.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=shahafs@mellanox.com; x-originating-ip: [193.47.165.251] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; VI1PR05MB1213; 6:I5vnBD9gvOKHRKIA3zutU58CZnomVSgZB7Xk33SATltwH4bQ7QfpoX5xZWJrtFhhjAd9hO28UJ1lgkJy/VwGB5L+QG5IpsJTmcAOSVC0cLNdEpD+y4AmGNRj86XJCA2wxkYmXNBbKo3lHXwUvm4hsYPwHrVmGfeRPzFfSAENREhE0lJYYnlpBdxrgip31Uzk14+JG2v9hDNhW51yqeih1Vjx4sdy04NyMn+hg2Mkkm/ZHJnt7EVNF7kLVyUpTi04VJm+lPErc/wjHRCJYODhYWIc3lG4YP3p5x9ixA4fbNOcvS2uYJQMSTd/G5Ha2evSE9lOyd+Bqr7IL7zFYla4Xw==; 5:iBTzdBh/3POvTsV1n2N6ndFynYiv1Q1YuOFO5rNT3YyRk8aNtwnuwo7YyuVK/R9mc2RtEwdN3UWugpe9h6uRdNi2PoRCF4wu78e/pW47fxTooWmAKpTSSCklcEOy+bBmcnOsyq8GHE8pUBclyKLsvA==; 24:Ft+fTciLuxNY3fi1TQF5V6aHJbJ9sm1817J74rE3CdgvYZcoa87NJ7tcWVU6pf/v7T3Od4SA86X19RWQ5Q0PRW6uMPM9YIEe0jwNxf8Bdhs=; 7:W6fgAPltrURRBtA0sbtGCptBqFKFj9KsaMNRdyReEL5kPIGy+Pg2wq9MKGGMEBQCDeiJ/VUvU8dxwd0tB7qZIDA6rw4gadkHlLWePUjZ8672dHrDKfC3DvVmjf5aFkOixbrVj6w1aA+wjrjilujgcLgkGoGfiPa4mt5ENOAXiUqVlmD/f/PT97+TkUrWBrscat9WqWLgJ6cOI+GcZGEYg3GnGQ/Q46h0rvoK8w20vQ4= x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-ms-office365-filtering-correlation-id: 2fe62a6f-403e-4c61-f932-08d4f39da3de x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(48565401081)(300000503095)(300135400095)(2017052603199)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:VI1PR05MB1213; x-ms-traffictypediagnostic: VI1PR05MB1213: x-exchange-antispam-report-test: UriScan:(17755550239193); x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3002001)(100000703101)(100105400095)(6055026)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123564025)(20161123555025)(20161123560025)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:VI1PR05MB1213; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:VI1PR05MB1213; x-forefront-prvs: 0420213CCD x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(39860400002)(377454003)(189002)(199003)(6436002)(229853002)(6506006)(4326008)(6116002)(2900100001)(66066001)(97736004)(50986999)(9686003)(76176999)(53936002)(33656002)(305945005)(54356999)(5250100002)(68736007)(189998001)(105586002)(74316002)(102836003)(3846002)(7736002)(101416001)(106356001)(99286003)(55016002)(7696004)(8936002)(81156014)(25786009)(3660700001)(14454004)(86362001)(478600001)(3280700002)(2950100002)(5660300001)(2906002)(81166006)(6246003); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR05MB1213; H:VI1PR05MB3149.eurprd05.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Sep 2017 14:02:54.9702 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB1213 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Sep 2017 14:02:58 -0000 Hi Konstantin, Monday, September 4, 2017 4:25 PM, Ananyev, Konstantin: >=20 > Hi Shahaf, >=20 > > } > > > > +/** > > + * A conversion function from rxmode offloads API to rte_eth_rxq_conf > > + * 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; >=20 > 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. This is vendor specific. For Mellanox this is one per device (regardless if= it is a vf/pf). > For Intel devices VLAN_STRIP is also per device and will also be applied= to all > corresponding VFs. Again - vendor specific. For Mellanox is per queue. > In fact, right now it is possible to query/change these 3 vlan offload fl= ags 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. Am not sure I agree.=20 Why, for example, block from application the option to set some queues with= vlan strip and some without if device allows? Also how will we decide which offloads should stay per port and which are a= llowed to move per queue? this much depends on the underlying PMD. Looks like i missed that part on ethdev, and if Rx offload will be per queu= e I will need to change it also. > 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 port > basis. > - rx_queue_setup() will also accept RX_OFFLOAD_* flags and apply them on > a queue basis. > - if particular RX_OFFLOAD flag for that device couldn't be setup on a qu= eue > basis - > rx_queue_setup() will return an error. Why not taking the per port configuration as a sub-case of per queue config= uration? For per-port offloads as long as the same configuration applies the queue s= etup succeeds. > - rte_eth_rxq_info can be extended to provide information which > RX_OFFLOADs > can be configured on a per queue basis. I am OK with the info suggestion.=20 > BTW - in that case we probably wouldn't need ignore flag inside rx_conf > anymore. >=20 >=20 > > + 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; >=20 > 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 updated= . >=20 > > + 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; } > > + >=20 > Konstantin