From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0042.outbound.protection.outlook.com [104.47.1.42]) by dpdk.org (Postfix) with ESMTP id 38E857D4F for ; Wed, 23 Aug 2017 15:06:43 +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=4O2DM05gFRdFOAQp89daP6/WqHjxEgWjRVtsKOhTB3o=; b=AFWN4vWw2UX4dpXH1+WgQFnE8yCLTGxlfPyGBRKJbY84SUvbUYxlLY1RQsOpFyv+yRBE+wi8yaWzrh4Ts9ycvkmw8sCr4tdCNKS/bv5rsakNO6J75EXVGHSltfFDD1craCs+jK3lX3dIfLzw8XsgbpIT5rhsEMhc8gqjcDAxnv8= Received: from VI1PR05MB3149.eurprd05.prod.outlook.com (10.170.237.142) by VI1PR05MB0992.eurprd05.prod.outlook.com (10.162.11.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.1362.18; Wed, 23 Aug 2017 13:06:42 +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.01.1362.019; Wed, 23 Aug 2017 13:06:41 +0000 From: Shahaf Shuler To: "Ananyev, Konstantin" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [RFC PATCH 2/4] ethdev: introduce Rx queue offloads API Thread-Index: AQHTD2uoOcrFxuGJoES+/K7+shcRIaKR9cEAgAAJImA= Date: Wed, 23 Aug 2017 13:06:41 +0000 Message-ID: References: <2601191342CEEE43887BDE71AB977258489B5058@irsmsx105.ger.corp.intel.com> In-Reply-To: <2601191342CEEE43887BDE71AB977258489B5058@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; VI1PR05MB0992; 6:E121/cfx9Wejdu1gPC8EGv6pqaKQR/F6Zk6R33BuRPhWWqOP1X0bX0GFYrfFJI+cnNZahReAc401cwrZ5b8OxbAvmKsTUdOu2dX6oNFOHL/aNf4lE1bDCK7klBv33d0Vop90TUDXl+Xtv9kccen16VRheoDPW6rGwv2mmZlr/zHQtDXPjXu3anLK7O6BejRHgC5zD8L1sgSP5KTjE+rLK/CIDqCbIssfci4wUpnfMp7aJic9Uyyvt3uQHgP/uTq4/hjbN3wSEKz5a7Na/y515gAk7UGBbQnaTf6NR1R4bLmHTOqBrkavUtdX2fdltvlIpcZMEEnutoukKcSaGjaxjg==; 5:NmaAYGdZkLEU4vInggcG4axcRXzjfKspIEwii76dc8xxRal7jX21JS0GwmD8+TivZaXmhwQTby+7K7A7ZixKLzpn+nY0ZOzUWu1fhlY5t42dHw8lXpTyDNuuyVnyMZggJ8MelFrARtTCg5XHcQ9SJg==; 24:4BViklGQZsLKl4bfYgBr0aC0jK/wNS+AjdEhmo4IE3Y3dHDj600UAbq+9RI2/bj7ffJ/uPdTYgNljTmx9FKVQ+l8ieZ3L+Ze/NenDm2ABzY=; 7:BQ1deIy7LPhfLqstCln5wFbDsWe2oZm/2DmRLmNF3/7UNDnGlRgtVgkYCJk1pBFyDkFkqEmmMSNuQJemZVjVEIadUTQpq625hPCTPY6jeoo4maYQ9dQSfoQRJfaZcZ5AZQHI/Nu67j3yje9XEL3rpIDLHBLuCOcbNPFqYX32nDRlU1Mj53J3HMvCf0d1h4eqGr9IHjo/bqejj+0X7NVnvvMd4FIyhmZiW91BtHVhOTE= x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-correlation-id: 96473ff9-b99a-4810-b1d8-08d4ea27cc62 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)(2017052603184)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:VI1PR05MB0992; x-ms-traffictypediagnostic: VI1PR05MB0992: x-exchange-antispam-report-test: UriScan:; x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(93006095)(93001095)(3002001)(100000703101)(100105400095)(10201501046)(6055026)(6041248)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123558100)(20161123564025)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:VI1PR05MB0992; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:VI1PR05MB0992; x-forefront-prvs: 040866B734 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(39860400002)(57704003)(189002)(377454003)(199003)(3660700001)(106356001)(3280700002)(97736004)(6436002)(9686003)(105586002)(5250100002)(478600001)(6246003)(2501003)(101416001)(2950100002)(74316002)(2906002)(33656002)(54356999)(50986999)(76176999)(86362001)(575784001)(68736007)(66066001)(3846002)(6506006)(81156014)(81166006)(8676002)(55016002)(5660300001)(102836003)(2900100001)(8936002)(189998001)(229853002)(7696004)(305945005)(53936002)(7736002)(99286003)(25786009)(6116002)(14454004)(217873001); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR05MB0992; 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: 23 Aug 2017 13:06:41.9121 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB0992 Subject: Re: [dpdk-dev] [RFC PATCH 2/4] ethdev: introduce Rx queue 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: Wed, 23 Aug 2017 13:06:44 -0000 Wednesday, August 23, 2017 3:21 PM, Ananyev, Konstantin: > Hi, >=20 > > Introduce a new API to configure Rx offloads. > > > > The new API will re-use existing DEV_RX_OFFLOAD_* flags to enable the > > different offloads. This will ease the process of adding a new Rx > > offloads, as no ABI breakage is involved. > > In addition, the offload configuration can be done per queue, instead > > of per port. > > > > The Rx queue offload API can be used only with devices which advertize > > the RTE_ETH_DEV_RXQ_OFFLOAD capability. >=20 > Not sure why do we need that? > Why (till the deprication) user can't use both old rxmode and new offload > flags? > I.E. at rte_ethdev_rx_queue_setup() we always convert rxmode to new > offload flags (as I can see you already have a function for it), then we = call > dev_ops->rx_queue_setup(). > That way both new and old ethdev API should work. > Of course that mean that all PMDs have to support new way to setup rx > offloads... > But I suppose that have to be done anyway. > Same for TX path. The reason for this capability is to enable the different PMDs to *graduall= y move* to the new API. Offloads management on the PMD is complex, it has to deal with the internal= of the device on which they work. For example some devices probably have offloads configuration they can do only per port. Another example can= be that some PMDs enable Tx offloads from the PMD specific parameters (lik= e mlx5).=20 This is why I believe that the task to move the PMD to the new API should b= e done by the PMD developers/maintainers. This work provides the means (the copy functions and the capability bits) f= or both APIs to co-exists and to be used on top of PMDs which support eithe= r old or new API. Once the majority of the PMD made the transition, we can remove and depreca= te this cap (and the old API). > Konstantin >=20 > > > > The old Rx offloads API is kept for the meanwhile, in order to enable > > a smooth transition for PMDs and application to the new API. > > > > Signed-off-by: Shahaf Shuler > > --- > > lib/librte_ether/rte_ethdev.h | 30 +++++++++++++++++++++++++++++- > > 1 file changed, 29 insertions(+), 1 deletion(-) > > > > diff --git a/lib/librte_ether/rte_ethdev.h > > b/lib/librte_ether/rte_ethdev.h index f7a44578c..ce33c61c4 100644 > > --- a/lib/librte_ether/rte_ethdev.h > > +++ b/lib/librte_ether/rte_ethdev.h > > @@ -357,7 +357,14 @@ struct rte_eth_rxmode { > > jumbo_frame : 1, /**< Jumbo Frame Receipt enable. */ > > hw_strip_crc : 1, /**< Enable CRC stripping by hardware. */ > > enable_scatter : 1, /**< Enable scatter packets rx handler */ > > - enable_lro : 1; /**< Enable LRO */ > > + enable_lro : 1, /**< Enable LRO */ > > + ignore : 1; > > + /** > > + * When set the rxmode offloads should be ignored, > > + * instead the Rx offloads will be set on rte_eth_rxq_conf. > > + * This bit is temporary till rxmode Rx offloads API will > > + * be deprecated. > > + */ > > }; > > > > /** > > @@ -691,6 +698,12 @@ struct rte_eth_rxq_conf { > > uint16_t rx_free_thresh; /**< Drives the freeing of RX descriptors. > */ > > uint8_t rx_drop_en; /**< Drop packets if no descriptors are > available. */ > > uint8_t rx_deferred_start; /**< Do not start queue with > > rte_eth_dev_start(). */ > > + uint64_t offloads; > > + /** > > + * Enable Rx offloads using DEV_RX_OFFLOAD_* flags. > > + * Supported only for devices which advertize the > > + * RTE_ETH_DEV_RXQ_OFFLOAD capability. > > + */ > > }; > > > > #define ETH_TXQ_FLAGS_NOMULTSEGS 0x0001 /**< nb_segs=3D1 for all > mbufs > > */ @@ -907,6 +920,19 @@ struct rte_eth_conf { #define > > DEV_RX_OFFLOAD_QINQ_STRIP 0x00000020 #define > > DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM 0x00000040 > > #define DEV_RX_OFFLOAD_MACSEC_STRIP 0x00000080 > > +#define DEV_RX_OFFLOAD_HEADER_SPLIT 0x00000100 > > +#define DEV_RX_OFFLOAD_VLAN_FILTER 0x00000200 > > +#define DEV_RX_OFFLOAD_VLAN_EXTEND 0x00000400 > > +#define DEV_RX_OFFLOAD_JUMBO_FRAME 0x00000800 > > +#define DEV_RX_OFFLOAD_CRC_STRIP 0x00001000 > > +#define DEV_RX_OFFLOAD_SCATTER 0x00002000 > > +#define DEV_RX_OFFLOAD_LRO 0x00004000 > > +#define DEV_RX_OFFLOAD_CHECKSUM > (DEV_RX_OFFLOAD_IPV4_CKSUM | \ > > + DEV_RX_OFFLOAD_UDP_CKSUM | \ > > + DEV_RX_OFFLOAD_TCP_CKSUM) > > +#define DEV_RX_OFFLOAD_VLAN (DEV_RX_OFFLOAD_VLAN_STRIP | \ > > + DEV_RX_OFFLOAD_VLAN_FILTER | \ > > + DEV_RX_OFFLOAD_VLAN_EXTEND) > > > > /** > > * TX offload capabilities of a device. > > @@ -1723,6 +1749,8 @@ struct rte_eth_dev_data { #define > > RTE_ETH_DEV_BONDED_SLAVE 0x0004 > > /** Device supports device removal interrupt */ > > #define RTE_ETH_DEV_INTR_RMV 0x0008 > > +/** Device supports the rte_eth_rxq_conf offloads API */ #define > > +RTE_ETH_DEV_RXQ_OFFLOAD 0x0010 > > > > /** > > * @internal > > -- > > 2.12.0