From patchwork Wed Aug 21 20:47:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pavan Nikhilesh Bhagavatula X-Patchwork-Id: 57782 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 888811BF1B; Wed, 21 Aug 2019 22:48:07 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 604301BF12 for ; Wed, 21 Aug 2019 22:48:05 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x7LKj8WD014341; Wed, 21 Aug 2019 13:48:04 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=pfpt0818; bh=h2KdXtY6iRgb44Y8TqbdsIe1ooKWzxE2YAB7yws1hMw=; b=viVEERHGPx/tjcLXWge7fZpnx/x4Go7osVxPVY6p6JAM+kzRNOhV5xlugpQEYe9Nzh/u 0XTQqxJHexaB9J8EBV18ztJKlMrKF4RbhHk6ckCgtpjnLgztJvA6xjHWbWuvWHj4rzXj VzGJz/tTSkwKshVsfukfhc/LZDuhyHOt2OOmbjVeanTsLvwqyFStbTAdPWQ7Jrrd6xjc I19sn74x2BdS5p2AdZJxHBIJMZ968jPn71eXVgXYF0OS8XZ6Op4+lUNDiA6t4LuMyH8n lMTtbch9PMPfVMckiZ0MgSTxyz3fVq2uec0pNe6EWytR3rH0DKPDmpF6WNJIQBgvjKLa Cg== Received: from sc-exch02.marvell.com ([199.233.58.182]) by mx0b-0016f401.pphosted.com with ESMTP id 2uhag20p9d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 21 Aug 2019 13:48:04 -0700 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Wed, 21 Aug 2019 13:48:02 -0700 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Wed, 21 Aug 2019 13:48:02 -0700 Received: from BG-LT7430.marvell.com (unknown [10.28.17.62]) by maili.marvell.com (Postfix) with ESMTP id 0A18B3F703F; Wed, 21 Aug 2019 13:47:59 -0700 (PDT) From: To: , , John McNamara , Marko Kovacevic , Thomas Monjalon , Ferruh Yigit CC: , Pavan Nikhilesh Date: Thu, 22 Aug 2019 02:17:49 +0530 Message-ID: <20190821204755.1990-2-pbhagavatula@marvell.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190821204755.1990-1-pbhagavatula@marvell.com> References: <20190821204755.1990-1-pbhagavatula@marvell.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:5.22.84,1.0.8 definitions=2019-08-21_06:2019-08-19,2019-08-21 signatures=0 Subject: [dpdk-dev] [PATCH v2 1/7] ethdev: add set ptype function 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Pavan Nikhilesh Add `rte_eth_dev_set_supported_ptypes` function that will allow the application to inform the PMD the packet types it is interested in. Based on the ptypes set PMDs can optimize their Rx path. -If application doesn’t want any ptype information it can call `rte_eth_dev_set_supported_ptypes(ethdev_id, RTE_PTYPE_UNKNOWN)` and PMD will set rte_mbuf::packet_type to 0. -If application doesn’t call `rte_eth_dev_set_supported_ptypes` PMD can return `rte_mbuf::packet_type` with `rte_eth_dev_get_supported_ptypes`. -If application is interested only in L2/L3 layer, it can inform the PMD to update `rte_mbuf::packet_type` with L2/L3 ptype by calling `rte_eth_dev_set_supported_ptypes(ethdev_id, RTE_PTYPE_L2_MASK | RTE_PTYPE_L3_MASK)`. Suggested-by: Konstantin Ananyev Signed-off-by: Pavan Nikhilesh --- doc/guides/nics/features.rst | 12 ++++++--- doc/guides/rel_notes/release_19_11.rst | 7 ++++++ lib/librte_ethdev/rte_ethdev.c | 32 ++++++++++++++++++++++++ lib/librte_ethdev/rte_ethdev.h | 16 ++++++++++++ lib/librte_ethdev/rte_ethdev_core.h | 6 +++++ lib/librte_ethdev/rte_ethdev_version.map | 3 +++ 6 files changed, 72 insertions(+), 4 deletions(-) diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst index c4e128d2f..d4d55f721 100644 --- a/doc/guides/nics/features.rst +++ b/doc/guides/nics/features.rst @@ -582,10 +582,14 @@ Supports inner packet L4 checksum. Packet type parsing ------------------- -Supports packet type parsing and returns a list of supported types. - -* **[implements] eth_dev_ops**: ``dev_supported_ptypes_get``. -* **[related] API**: ``rte_eth_dev_get_supported_ptypes()``. +Supports packet type parsing and returns a list of supported types. Allows +application to set ptypes it is interested in. + +* **[implements] eth_dev_ops**: ``dev_supported_ptypes_get``, + ``dev_supported_ptypes_set``. +* **[related] API**: ``rte_eth_dev_get_supported_ptypes()``, + ``rte_eth_dev_set_supported_ptypes()``. +* **[provides] mbuf**: ``mbuf.packet_type``. .. _nic_features_timesync: diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst index 8490d897c..a7cec1fe8 100644 --- a/doc/guides/rel_notes/release_19_11.rst +++ b/doc/guides/rel_notes/release_19_11.rst @@ -56,6 +56,13 @@ New Features Also, make sure to start the actual text at the margin. ========================================================= +* **Added API in ethdev to set supported packet types** + + * Added new API ``rte_eth_dev_set_supported_ptypes`` that allows an + application to request PMD to set specific ptypes defined + through ``rte_eth_dev_set_supported_ptypes`` in ``rte_mbuf::packet_type``. + * This scheme will allow PMDs to avoid lookup to internal ptype table on Rx + and thereby improve Rx performance if application wishes do so. Removed Items ------------- diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c index 17d183e1f..f529cbe9f 100644 --- a/lib/librte_ethdev/rte_ethdev.c +++ b/lib/librte_ethdev/rte_ethdev.c @@ -2602,6 +2602,38 @@ rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask, return j; } +uint32_t +rte_eth_dev_set_supported_ptypes(uint16_t port_id, uint32_t ptype_mask) +{ + int i; + struct rte_eth_dev *dev; + const uint32_t *all_ptypes; + uint32_t all_ptype_mask = 0; + uint32_t supp_ptype_mask = 0; + + RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); + dev = &rte_eth_devices[port_id]; + RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_supported_ptypes_get, 0); + + if (ptype_mask == 0) { + RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_supported_ptypes_set, + 0); + return (*dev->dev_ops->dev_supported_ptypes_set)(dev, + ptype_mask); + } + + all_ptypes = (*dev->dev_ops->dev_supported_ptypes_get)(dev); + if (all_ptypes == NULL) + return 0; + + for (i = 0; all_ptypes[i] != RTE_PTYPE_UNKNOWN; ++i) + all_ptype_mask |= all_ptypes[i]; + + supp_ptype_mask = all_ptype_mask & ptype_mask; + + return (*dev->dev_ops->dev_supported_ptypes_set)(dev, supp_ptype_mask); +} + void rte_eth_macaddr_get(uint16_t port_id, struct rte_ether_addr *mac_addr) { diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h index dc6596bc9..1ab0af4d8 100644 --- a/lib/librte_ethdev/rte_ethdev.h +++ b/lib/librte_ethdev/rte_ethdev.h @@ -2431,6 +2431,22 @@ int rte_eth_dev_fw_version_get(uint16_t port_id, */ int rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask, uint32_t *ptypes, int num); +/** + * Request Ethernet device to set only specific packet types in the packet. + * + * Application can use this function to set only specific ptypes that it's + * interested. This information can be used by the PMD to optimize Rx path. + * + * @param port_id + * The port identifier of the Ethernet device. + * @param ptype_mask + * The ptype family that application is interested in. + * @return + * - (>=0) Ptype mask that has been set successfully. + */ +__rte_experimental +uint32_t rte_eth_dev_set_supported_ptypes(uint16_t port_id, + uint32_t ptype_mask); /** * Retrieve the MTU of an Ethernet device. diff --git a/lib/librte_ethdev/rte_ethdev_core.h b/lib/librte_ethdev/rte_ethdev_core.h index 2922d5b7c..e65ae983d 100644 --- a/lib/librte_ethdev/rte_ethdev_core.h +++ b/lib/librte_ethdev/rte_ethdev_core.h @@ -110,6 +110,10 @@ typedef void (*eth_dev_infos_get_t)(struct rte_eth_dev *dev, typedef const uint32_t *(*eth_dev_supported_ptypes_get_t)(struct rte_eth_dev *dev); /**< @internal Get supported ptypes of an Ethernet device. */ +typedef uint32_t (*eth_dev_supported_ptypes_set_t)(struct rte_eth_dev *dev, + uint32_t ptype_mask); +/**< @internal Set required ptypes of an Ethernet device. */ + typedef int (*eth_queue_start_t)(struct rte_eth_dev *dev, uint16_t queue_id); /**< @internal Start rx and tx of a queue of an Ethernet device. */ @@ -421,6 +425,8 @@ struct eth_dev_ops { eth_fw_version_get_t fw_version_get; /**< Get firmware version. */ eth_dev_supported_ptypes_get_t dev_supported_ptypes_get; /**< Get packet types supported and identified by device. */ + eth_dev_supported_ptypes_set_t dev_supported_ptypes_set; + /**< Inform device about the interested ptypes. */ vlan_filter_set_t vlan_filter_set; /**< Filter VLAN Setup. */ vlan_tpid_set_t vlan_tpid_set; /**< Outer/Inner VLAN TPID Setup. */ diff --git a/lib/librte_ethdev/rte_ethdev_version.map b/lib/librte_ethdev/rte_ethdev_version.map index 6df42a47b..e14745b9c 100644 --- a/lib/librte_ethdev/rte_ethdev_version.map +++ b/lib/librte_ethdev/rte_ethdev_version.map @@ -283,4 +283,7 @@ EXPERIMENTAL { # added in 19.08 rte_eth_read_clock; + + # added in 19.11 + rte_eth_dev_set_supported_ptypes; }; From patchwork Wed Aug 21 20:47:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavan Nikhilesh Bhagavatula X-Patchwork-Id: 57783 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 554C21BF20; Wed, 21 Aug 2019 22:48:10 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 884D31BF20 for ; Wed, 21 Aug 2019 22:48:09 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x7LKiwnL030451; Wed, 21 Aug 2019 13:48:08 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0818; bh=gaGHbFtJY1zdyGsO0IK3cZSwUrC+h+lXyB0+y/5h7lM=; b=XVqdcreCQy6vyFYvev4q6RvxzZLAY3kfW06VmeR2O0zG09p2Ck4UGuhxLicAWxVyAg7w q8FP9wtg8sw3VLpqShqS4GFqkA9WA4hcKPF/cAvA4OhjgfIG+smE2vwH34E40aYIJ3q2 G/V606LQB4L1cS0U/0xsqUO3XEi+cpGc4NvguiwhU5fo/195A/Mc2d1FPAcLWljUB8ji P81efO2Ci/IS9utc92H/JdUudrujXj99lRrof8iaDnR4t5GzuzkMzPbkGWIKSQhSjYJk bBstfln5yvfjJM4jzDSZ5HPrMXA+wXrxodw4frNx9ZpIjx0XpGzkbtPxTt+uJEf/L4Ls 2A== Received: from sc-exch03.marvell.com ([199.233.58.183]) by mx0a-0016f401.pphosted.com with ESMTP id 2uhad3rsrm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 21 Aug 2019 13:48:08 -0700 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Wed, 21 Aug 2019 13:48:07 -0700 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Wed, 21 Aug 2019 13:48:07 -0700 Received: from BG-LT7430.marvell.com (unknown [10.28.17.62]) by maili.marvell.com (Postfix) with ESMTP id 074FE3F7040; Wed, 21 Aug 2019 13:48:03 -0700 (PDT) From: To: , , John McNamara , Marko Kovacevic , Thomas Monjalon , Ferruh Yigit CC: , Pavan Nikhilesh Date: Thu, 22 Aug 2019 02:17:50 +0530 Message-ID: <20190821204755.1990-3-pbhagavatula@marvell.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190821204755.1990-1-pbhagavatula@marvell.com> References: <20190821204755.1990-1-pbhagavatula@marvell.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:5.22.84,1.0.8 definitions=2019-08-21_06:2019-08-19,2019-08-21 signatures=0 Subject: [dpdk-dev] [PATCH v2 2/7] ethdev: add mbuf RSS update as an offload 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Pavan Nikhilesh Add new Rx offload flag `DEV_RX_OFFLOAD_RSS_HASH` which can be used to enable/disable PMDs write to `rte_mbuf::hash::rss`. PMDs notify the validity of `rte_mbuf::hash:rss` to the applcation by enabling `PKT_RX_RSS_HASH ` flag in `rte_mbuf::ol_flags`. Signed-off-by: Pavan Nikhilesh Reviewed-by: Andrew Rybchenko --- doc/guides/nics/features.rst | 2 ++ lib/librte_ethdev/rte_ethdev.c | 1 + lib/librte_ethdev/rte_ethdev.h | 1 + 3 files changed, 4 insertions(+) diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst index d4d55f721..f79b69b38 100644 --- a/doc/guides/nics/features.rst +++ b/doc/guides/nics/features.rst @@ -274,6 +274,7 @@ Supports RSS hashing on RX. * **[uses] user config**: ``dev_conf.rxmode.mq_mode`` = ``ETH_MQ_RX_RSS_FLAG``. * **[uses] user config**: ``dev_conf.rx_adv_conf.rss_conf``. +* **[uses] rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_RSS_HASH``. * **[provides] rte_eth_dev_info**: ``flow_type_rss_offloads``. * **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_RSS_HASH``, ``mbuf.rss``. @@ -286,6 +287,7 @@ Inner RSS Supports RX RSS hashing on Inner headers. * **[uses] rte_flow_action_rss**: ``level``. +* **[uses] rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_RSS_HASH``. * **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_RSS_HASH``, ``mbuf.rss``. diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c index f529cbe9f..9c5517d5f 100644 --- a/lib/librte_ethdev/rte_ethdev.c +++ b/lib/librte_ethdev/rte_ethdev.c @@ -129,6 +129,7 @@ static const struct { RTE_RX_OFFLOAD_BIT2STR(KEEP_CRC), RTE_RX_OFFLOAD_BIT2STR(SCTP_CKSUM), RTE_RX_OFFLOAD_BIT2STR(OUTER_UDP_CKSUM), + RTE_RX_OFFLOAD_BIT2STR(RSS_HASH), }; #undef RTE_RX_OFFLOAD_BIT2STR diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h index 1ab0af4d8..836b30074 100644 --- a/lib/librte_ethdev/rte_ethdev.h +++ b/lib/librte_ethdev/rte_ethdev.h @@ -1013,6 +1013,7 @@ struct rte_eth_conf { #define DEV_RX_OFFLOAD_KEEP_CRC 0x00010000 #define DEV_RX_OFFLOAD_SCTP_CKSUM 0x00020000 #define DEV_RX_OFFLOAD_OUTER_UDP_CKSUM 0x00040000 +#define DEV_RX_OFFLOAD_RSS_HASH 0x00080000 #define DEV_RX_OFFLOAD_CHECKSUM (DEV_RX_OFFLOAD_IPV4_CKSUM | \ DEV_RX_OFFLOAD_UDP_CKSUM | \ From patchwork Wed Aug 21 20:47:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavan Nikhilesh Bhagavatula X-Patchwork-Id: 57784 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 60C2E1BF1A; Wed, 21 Aug 2019 22:48:17 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id D67841BF0E for ; Wed, 21 Aug 2019 22:48:14 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x7LKirHM030440; Wed, 21 Aug 2019 13:48:13 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0818; bh=VB0gwzIe6P3Xf5Lx/n9Td/jjny+L0AOgTsKEnO7XZJ4=; b=Ww16MIY1d+2/dMnDLqSZtRxtACg32HJcnZoek5ira4zJ32AoUksb5eWkGn0yY/AYtTqX gryJ8pBg4UYI0J9IU7VIiD4nM8/pAreEWDMGe3irJSJGi4BMENN3n63Nzp6JHevpStNH yR2Ocb7MNIvqKOnjQWaadApTfIODXS3vNDn+vetqFjHjDtEvOuvhbkx9K4jLJHoY2vyA hai7A2fk6ZTGiJb8smRMm0ExeqhIKBVosTwCdN3k8Lzf/2QcolMexX3tAs5yoEYJSWMJ /RDyABY9aZfs2KVFt5MFP4Mlqtlv7eRcocuT2/MFnJsl/GsnszGjgp5trQfg+KSQ9CGO fQ== Received: from sc-exch01.marvell.com ([199.233.58.181]) by mx0a-0016f401.pphosted.com with ESMTP id 2uhad3rsrv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 21 Aug 2019 13:48:13 -0700 Received: from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Wed, 21 Aug 2019 13:48:12 -0700 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Wed, 21 Aug 2019 13:48:12 -0700 Received: from BG-LT7430.marvell.com (unknown [10.28.17.62]) by maili.marvell.com (Postfix) with ESMTP id 436253F703F; Wed, 21 Aug 2019 13:48:08 -0700 (PDT) From: To: , , John McNamara , Marko Kovacevic , Thomas Monjalon , Ferruh Yigit , Adrien Mazarguil CC: , Pavan Nikhilesh Date: Thu, 22 Aug 2019 02:17:51 +0530 Message-ID: <20190821204755.1990-4-pbhagavatula@marvell.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190821204755.1990-1-pbhagavatula@marvell.com> References: <20190821204755.1990-1-pbhagavatula@marvell.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:5.22.84,1.0.8 definitions=2019-08-21_06:2019-08-19,2019-08-21 signatures=0 Subject: [dpdk-dev] [PATCH v2 3/7] ethdev: add flow action type update as an offload 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Pavan Nikhilesh Add new Rx offload flag `DEV_RX_OFFLOAD_FLOW_MARK` that can be used to enable/disable PMDs write to `rte_mbuf::hash::fdir::hi` and `rte_mbuf::ol_flags` when flow actions `RTE_FLOW_ACTION_MARK` and `RTE_FLOW_ACTION_FLAG` are enabled. PMDs notify the validity of `rte_mbuf::hash:fdir::hi` to the applcation by enabling `PKT_RX_FDIR_ID` flag in `rte_mbuf::ol_flags`. Signed-off-by: Pavan Nikhilesh Reviewed-by: Andrew Rybchenko --- doc/guides/nics/features.rst | 12 ++++++++++++ lib/librte_ethdev/rte_ethdev.c | 1 + lib/librte_ethdev/rte_ethdev.h | 1 + lib/librte_ethdev/rte_flow.h | 6 ++++-- 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst index f79b69b38..338b19e03 100644 --- a/doc/guides/nics/features.rst +++ b/doc/guides/nics/features.rst @@ -594,6 +594,18 @@ application to set ptypes it is interested in. * **[provides] mbuf**: ``mbuf.packet_type``. +.. _nic_features_flow_flag_mark: + +Flow flag/mark update +--------------------- + +Supports flow action type update to ``mbuf.ol_flags`` and ``mbuf.hash.fdir.hi``. + +* **[uses] rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_FLOW_MARK``. +* **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_FDIR``, ``mbuf.ol_flags:PKT_RX_FDIR_ID;``, + ``mbuf.hash.fdir.hi`` + + .. _nic_features_timesync: Timesync diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c index 9c5517d5f..bcbe06c5c 100644 --- a/lib/librte_ethdev/rte_ethdev.c +++ b/lib/librte_ethdev/rte_ethdev.c @@ -130,6 +130,7 @@ static const struct { RTE_RX_OFFLOAD_BIT2STR(SCTP_CKSUM), RTE_RX_OFFLOAD_BIT2STR(OUTER_UDP_CKSUM), RTE_RX_OFFLOAD_BIT2STR(RSS_HASH), + RTE_RX_OFFLOAD_BIT2STR(FLOW_MARK), }; #undef RTE_RX_OFFLOAD_BIT2STR diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h index 836b30074..44686ec21 100644 --- a/lib/librte_ethdev/rte_ethdev.h +++ b/lib/librte_ethdev/rte_ethdev.h @@ -1014,6 +1014,7 @@ struct rte_eth_conf { #define DEV_RX_OFFLOAD_SCTP_CKSUM 0x00020000 #define DEV_RX_OFFLOAD_OUTER_UDP_CKSUM 0x00040000 #define DEV_RX_OFFLOAD_RSS_HASH 0x00080000 +#define DEV_RX_OFFLOAD_FLOW_MARK 0x00100000 #define DEV_RX_OFFLOAD_CHECKSUM (DEV_RX_OFFLOAD_IPV4_CKSUM | \ DEV_RX_OFFLOAD_UDP_CKSUM | \ diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h index b66bf1495..5d9d88d76 100644 --- a/lib/librte_ethdev/rte_flow.h +++ b/lib/librte_ethdev/rte_flow.h @@ -1316,7 +1316,8 @@ enum rte_flow_action_type { /** * Attaches an integer value to packets and sets PKT_RX_FDIR and - * PKT_RX_FDIR_ID mbuf flags. + * PKT_RX_FDIR_ID mbuf flags when + * `rx_mode:offloads:DEV_RX_OFFLOAD_FLOW_MARK` is set. * * See struct rte_flow_action_mark. */ @@ -1324,7 +1325,8 @@ enum rte_flow_action_type { /** * Flags packets. Similar to MARK without a specific value; only - * sets the PKT_RX_FDIR mbuf flag. + * sets the PKT_RX_FDIR mbuf flag when + * `rx_mode:offloads:DEV_RX_OFFLOAD_FLOW_MARK` is set * * No associated configuration structure. */ From patchwork Wed Aug 21 20:47:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavan Nikhilesh Bhagavatula X-Patchwork-Id: 57785 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 501E71BF2A; Wed, 21 Aug 2019 22:48:29 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id D9C9D1BF29 for ; Wed, 21 Aug 2019 22:48:27 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x7LKj3OM014288; Wed, 21 Aug 2019 13:48:25 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0818; bh=EDnuXaofnzmPDBJ1Q/Ge3MbgFIZVUo0v807Fr5PxdQk=; b=i89TAjxnHYk5FLyRtPxTpEStdOvySDbiO4OLddO2Rx1/gwO4fguWOg+y6JI96jxQz+0P 7TRSRDVGaiFb7bFbGzgApYNzjXmQ9+2VNoXbOn9qiYNMbUW1XqyK8LkgpkydWB2mga4h ImhPwUqWeAyIrIiCVuV57eyIYNqm+RefY0dKC/pJSSo0vIFsbx5Y2ZBVHVy4uxpBsfwh rxWVddpT8QCRNCnpfmHfPwmtWONFODKaKLqjoZZmycHvfCoRVD0b0dJvl9eDFJZ49LtS qbC8gclTa0EtsTmsLAXNdKBNPUStREnJC+Xiu1AUBfxCWfU0aJ/CajcAiVEEwRBiab7X 9g== Received: from sc-exch02.marvell.com ([199.233.58.182]) by mx0b-0016f401.pphosted.com with ESMTP id 2uhag20pah-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 21 Aug 2019 13:48:25 -0700 Received: from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Wed, 21 Aug 2019 13:48:23 -0700 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Wed, 21 Aug 2019 13:48:23 -0700 Received: from BG-LT7430.marvell.com (unknown [10.28.17.62]) by maili.marvell.com (Postfix) with ESMTP id F3E8F3F703F; Wed, 21 Aug 2019 13:48:12 -0700 (PDT) From: To: , , Ajit Khaparde , Somnath Kotur , Rahul Lakkireddy , Hemant Agrawal , Sachin Saxena , Wenzhuo Lu , John Daley , Hyong Youb Kim , Qi Zhang , Xiao Wang , Ziyang Xuan , Xiaoyun Wang , Guoyang Zhou , "Beilei Xing" , Jingjing Wu , "Qiming Yang" , Konstantin Ananyev , Shijith Thotton , Srisivasubramanian Srinivasan , Matan Azrad , Shahaf Shuler , Yongseok Koh , Viacheslav Ovsiienko , Stephen Hemminger , "K. Y. Srinivasan" , Haiyang Zhang , Alejandro Lucero , Nithin Dabilpuram , Kiran Kumar K , "Rasesh Mody" , Shahed Shaikh , Maciej Czekaj , Yong Wang CC: , Pavan Nikhilesh Date: Thu, 22 Aug 2019 02:17:52 +0530 Message-ID: <20190821204755.1990-5-pbhagavatula@marvell.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190821204755.1990-1-pbhagavatula@marvell.com> References: <20190821204755.1990-1-pbhagavatula@marvell.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:5.22.84,1.0.8 definitions=2019-08-21_06:2019-08-19,2019-08-21 signatures=0 Subject: [dpdk-dev] [PATCH v2 4/7] drivers/net: update Rx RSS hash offload capabilities 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Pavan Nikhilesh Add DEV_RX_OFFLOAD_RSS_HASH flag for all PMDs that support RSS hash delivery. Signed-off-by: Pavan Nikhilesh Acked-by: Jerin Jacob Acked-by: Ajit Khaparde --- drivers/net/bnxt/bnxt_ethdev.c | 3 ++- drivers/net/cxgbe/cxgbe.h | 3 ++- drivers/net/dpaa/dpaa_ethdev.c | 3 ++- drivers/net/dpaa2/dpaa2_ethdev.c | 3 ++- drivers/net/e1000/igb_rxtx.c | 3 ++- drivers/net/enic/enic_res.c | 3 ++- drivers/net/fm10k/fm10k_ethdev.c | 3 ++- drivers/net/hinic/hinic_pmd_ethdev.c | 3 ++- drivers/net/i40e/i40e_ethdev.c | 3 ++- drivers/net/iavf/iavf_ethdev.c | 3 ++- drivers/net/ice/ice_ethdev.c | 3 ++- drivers/net/ixgbe/ixgbe_rxtx.c | 3 ++- drivers/net/liquidio/lio_ethdev.c | 3 ++- drivers/net/mlx4/mlx4_rxq.c | 3 ++- drivers/net/mlx5/mlx5_rxq.c | 3 ++- drivers/net/netvsc/hn_rndis.c | 3 ++- drivers/net/nfp/nfp_net.c | 3 ++- drivers/net/octeontx2/otx2_ethdev.c | 3 ++- drivers/net/octeontx2/otx2_ethdev.h | 15 ++++++++------- drivers/net/qede/qede_ethdev.c | 3 ++- drivers/net/sfc/sfc_ef10_essb_rx.c | 2 +- drivers/net/sfc/sfc_ef10_rx.c | 3 ++- drivers/net/sfc/sfc_rx.c | 3 ++- drivers/net/thunderx/nicvf_ethdev.h | 3 ++- drivers/net/vmxnet3/vmxnet3_ethdev.c | 3 ++- 25 files changed, 55 insertions(+), 31 deletions(-) diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index 6685ee7d9..6c106baf7 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -160,7 +160,8 @@ static const struct rte_pci_id bnxt_pci_id_map[] = { DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM | \ DEV_RX_OFFLOAD_JUMBO_FRAME | \ DEV_RX_OFFLOAD_KEEP_CRC | \ - DEV_RX_OFFLOAD_TCP_LRO) + DEV_RX_OFFLOAD_TCP_LRO | \ + DEV_RX_OFFLOAD_RSS_HASH) static int bnxt_vlan_offload_set_op(struct rte_eth_dev *dev, int mask); static void bnxt_print_link_info(struct rte_eth_dev *eth_dev); diff --git a/drivers/net/cxgbe/cxgbe.h b/drivers/net/cxgbe/cxgbe.h index 3f97fa58b..22e61a55c 100644 --- a/drivers/net/cxgbe/cxgbe.h +++ b/drivers/net/cxgbe/cxgbe.h @@ -47,7 +47,8 @@ DEV_RX_OFFLOAD_UDP_CKSUM | \ DEV_RX_OFFLOAD_TCP_CKSUM | \ DEV_RX_OFFLOAD_JUMBO_FRAME | \ - DEV_RX_OFFLOAD_SCATTER) + DEV_RX_OFFLOAD_SCATTER | \ + DEV_RX_OFFLOAD_RSS_HASH) #define CXGBE_DEVARG_KEEP_OVLAN "keep_ovlan" diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index 7154fb9b4..18c7bd0d5 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -49,7 +49,8 @@ /* Supported Rx offloads */ static uint64_t dev_rx_offloads_sup = DEV_RX_OFFLOAD_JUMBO_FRAME | - DEV_RX_OFFLOAD_SCATTER; + DEV_RX_OFFLOAD_SCATTER | + DEV_RX_OFFLOAD_RSS_HASH; /* Rx offloads which cannot be disabled */ static uint64_t dev_rx_offloads_nodis = diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index dd6a78f9f..55a1c4455 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -38,7 +38,8 @@ static uint64_t dev_rx_offloads_sup = DEV_RX_OFFLOAD_TCP_CKSUM | DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM | DEV_RX_OFFLOAD_VLAN_FILTER | - DEV_RX_OFFLOAD_JUMBO_FRAME; + DEV_RX_OFFLOAD_JUMBO_FRAME | + DEV_RX_OFFLOAD_RSS_HASH; /* Rx offloads which cannot be disabled */ static uint64_t dev_rx_offloads_nodis = diff --git a/drivers/net/e1000/igb_rxtx.c b/drivers/net/e1000/igb_rxtx.c index c5606de5d..684fa4ad8 100644 --- a/drivers/net/e1000/igb_rxtx.c +++ b/drivers/net/e1000/igb_rxtx.c @@ -1646,7 +1646,8 @@ igb_get_rx_port_offloads_capa(struct rte_eth_dev *dev) DEV_RX_OFFLOAD_TCP_CKSUM | DEV_RX_OFFLOAD_JUMBO_FRAME | DEV_RX_OFFLOAD_KEEP_CRC | - DEV_RX_OFFLOAD_SCATTER; + DEV_RX_OFFLOAD_SCATTER | + DEV_RX_OFFLOAD_RSS_HASH; return rx_offload_capa; } diff --git a/drivers/net/enic/enic_res.c b/drivers/net/enic/enic_res.c index 9405e1933..607a085f8 100644 --- a/drivers/net/enic/enic_res.c +++ b/drivers/net/enic/enic_res.c @@ -198,7 +198,8 @@ int enic_get_vnic_config(struct enic *enic) DEV_RX_OFFLOAD_VLAN_STRIP | DEV_RX_OFFLOAD_IPV4_CKSUM | DEV_RX_OFFLOAD_UDP_CKSUM | - DEV_RX_OFFLOAD_TCP_CKSUM; + DEV_RX_OFFLOAD_TCP_CKSUM | + DEV_RX_OFFLOAD_RSS_HASH; enic->tx_offload_mask = PKT_TX_IPV6 | PKT_TX_IPV4 | diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c index db4d72129..ba9b174cf 100644 --- a/drivers/net/fm10k/fm10k_ethdev.c +++ b/drivers/net/fm10k/fm10k_ethdev.c @@ -1797,7 +1797,8 @@ static uint64_t fm10k_get_rx_port_offloads_capa(struct rte_eth_dev *dev) DEV_RX_OFFLOAD_UDP_CKSUM | DEV_RX_OFFLOAD_TCP_CKSUM | DEV_RX_OFFLOAD_JUMBO_FRAME | - DEV_RX_OFFLOAD_HEADER_SPLIT); + DEV_RX_OFFLOAD_HEADER_SPLIT | + DEV_RX_OFFLOAD_RSS_HASH); } static int diff --git a/drivers/net/hinic/hinic_pmd_ethdev.c b/drivers/net/hinic/hinic_pmd_ethdev.c index 044af9053..53bd2b9ae 100644 --- a/drivers/net/hinic/hinic_pmd_ethdev.c +++ b/drivers/net/hinic/hinic_pmd_ethdev.c @@ -680,7 +680,8 @@ hinic_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info) info->rx_offload_capa = DEV_RX_OFFLOAD_VLAN_STRIP | DEV_RX_OFFLOAD_IPV4_CKSUM | DEV_RX_OFFLOAD_UDP_CKSUM | - DEV_RX_OFFLOAD_TCP_CKSUM; + DEV_RX_OFFLOAD_TCP_CKSUM | + DEV_RX_OFFLOAD_RSS_HASH; info->tx_queue_offload_capa = 0; info->tx_offload_capa = DEV_TX_OFFLOAD_VLAN_INSERT | diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index 4e40b7ab5..7058e0213 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -3511,7 +3511,8 @@ i40e_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) DEV_RX_OFFLOAD_SCATTER | DEV_RX_OFFLOAD_VLAN_EXTEND | DEV_RX_OFFLOAD_VLAN_FILTER | - DEV_RX_OFFLOAD_JUMBO_FRAME; + DEV_RX_OFFLOAD_JUMBO_FRAME | + DEV_RX_OFFLOAD_RSS_HASH; dev_info->tx_queue_offload_capa = DEV_TX_OFFLOAD_MBUF_FAST_FREE; dev_info->tx_offload_capa = diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c index 8f3907378..aef91a79b 100644 --- a/drivers/net/iavf/iavf_ethdev.c +++ b/drivers/net/iavf/iavf_ethdev.c @@ -517,7 +517,8 @@ iavf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM | DEV_RX_OFFLOAD_SCATTER | DEV_RX_OFFLOAD_JUMBO_FRAME | - DEV_RX_OFFLOAD_VLAN_FILTER; + DEV_RX_OFFLOAD_VLAN_FILTER | + DEV_RX_OFFLOAD_RSS_HASH; dev_info->tx_offload_capa = DEV_TX_OFFLOAD_VLAN_INSERT | DEV_TX_OFFLOAD_QINQ_INSERT | diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c index 44a14cb8a..fc0f0003f 100644 --- a/drivers/net/ice/ice_ethdev.c +++ b/drivers/net/ice/ice_ethdev.c @@ -2133,7 +2133,8 @@ ice_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) DEV_RX_OFFLOAD_TCP_CKSUM | DEV_RX_OFFLOAD_QINQ_STRIP | DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM | - DEV_RX_OFFLOAD_VLAN_EXTEND; + DEV_RX_OFFLOAD_VLAN_EXTEND | + DEV_RX_OFFLOAD_RSS_HASH; dev_info->tx_offload_capa |= DEV_TX_OFFLOAD_QINQ_INSERT | DEV_TX_OFFLOAD_IPV4_CKSUM | diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c index edcfa60ce..fa572d184 100644 --- a/drivers/net/ixgbe/ixgbe_rxtx.c +++ b/drivers/net/ixgbe/ixgbe_rxtx.c @@ -2872,7 +2872,8 @@ ixgbe_get_rx_port_offloads(struct rte_eth_dev *dev) DEV_RX_OFFLOAD_KEEP_CRC | DEV_RX_OFFLOAD_JUMBO_FRAME | DEV_RX_OFFLOAD_VLAN_FILTER | - DEV_RX_OFFLOAD_SCATTER; + DEV_RX_OFFLOAD_SCATTER | + DEV_RX_OFFLOAD_RSS_HASH; if (hw->mac.type == ixgbe_mac_82598EB) offloads |= DEV_RX_OFFLOAD_VLAN_STRIP; diff --git a/drivers/net/liquidio/lio_ethdev.c b/drivers/net/liquidio/lio_ethdev.c index c25dab00c..ff118586e 100644 --- a/drivers/net/liquidio/lio_ethdev.c +++ b/drivers/net/liquidio/lio_ethdev.c @@ -406,7 +406,8 @@ lio_dev_info_get(struct rte_eth_dev *eth_dev, devinfo->rx_offload_capa = (DEV_RX_OFFLOAD_IPV4_CKSUM | DEV_RX_OFFLOAD_UDP_CKSUM | DEV_RX_OFFLOAD_TCP_CKSUM | - DEV_RX_OFFLOAD_VLAN_STRIP); + DEV_RX_OFFLOAD_VLAN_STRIP | + DEV_RX_OFFLOAD_RSS_HASH); devinfo->tx_offload_capa = (DEV_TX_OFFLOAD_IPV4_CKSUM | DEV_TX_OFFLOAD_UDP_CKSUM | DEV_TX_OFFLOAD_TCP_CKSUM | diff --git a/drivers/net/mlx4/mlx4_rxq.c b/drivers/net/mlx4/mlx4_rxq.c index f45c1ff85..4a6fbd922 100644 --- a/drivers/net/mlx4/mlx4_rxq.c +++ b/drivers/net/mlx4/mlx4_rxq.c @@ -685,7 +685,8 @@ mlx4_get_rx_queue_offloads(struct mlx4_priv *priv) { uint64_t offloads = DEV_RX_OFFLOAD_SCATTER | DEV_RX_OFFLOAD_KEEP_CRC | - DEV_RX_OFFLOAD_JUMBO_FRAME; + DEV_RX_OFFLOAD_JUMBO_FRAME | + DEV_RX_OFFLOAD_RSS_HASH; if (priv->hw_csum) offloads |= DEV_RX_OFFLOAD_CHECKSUM; diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c index a1fdeef2a..b5fd57693 100644 --- a/drivers/net/mlx5/mlx5_rxq.c +++ b/drivers/net/mlx5/mlx5_rxq.c @@ -368,7 +368,8 @@ mlx5_get_rx_queue_offloads(struct rte_eth_dev *dev) struct mlx5_dev_config *config = &priv->config; uint64_t offloads = (DEV_RX_OFFLOAD_SCATTER | DEV_RX_OFFLOAD_TIMESTAMP | - DEV_RX_OFFLOAD_JUMBO_FRAME); + DEV_RX_OFFLOAD_JUMBO_FRAME | + DEV_RX_OFFLOAD_RSS_HASH); if (config->hw_fcs_strip) offloads |= DEV_RX_OFFLOAD_KEEP_CRC; diff --git a/drivers/net/netvsc/hn_rndis.c b/drivers/net/netvsc/hn_rndis.c index a67bc7a79..2b4714042 100644 --- a/drivers/net/netvsc/hn_rndis.c +++ b/drivers/net/netvsc/hn_rndis.c @@ -897,7 +897,8 @@ int hn_rndis_get_offload(struct hn_data *hv, == HN_NDIS_LSOV2_CAP_IP6) dev_info->tx_offload_capa |= DEV_TX_OFFLOAD_TCP_TSO; - dev_info->rx_offload_capa = DEV_RX_OFFLOAD_VLAN_STRIP; + dev_info->rx_offload_capa = DEV_RX_OFFLOAD_VLAN_STRIP | + DEV_RX_OFFLOAD_RSS_HASH; if (hwcaps.ndis_csum.ndis_ip4_rxcsum & NDIS_RXCSUM_CAP_IP4) dev_info->rx_offload_capa |= DEV_RX_OFFLOAD_IPV4_CKSUM; diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c index f1a3ef2f9..230d64c8a 100644 --- a/drivers/net/nfp/nfp_net.c +++ b/drivers/net/nfp/nfp_net.c @@ -1226,7 +1226,8 @@ nfp_net_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) DEV_RX_OFFLOAD_UDP_CKSUM | DEV_RX_OFFLOAD_TCP_CKSUM; - dev_info->rx_offload_capa |= DEV_RX_OFFLOAD_JUMBO_FRAME; + dev_info->rx_offload_capa |= DEV_RX_OFFLOAD_JUMBO_FRAME | + DEV_RX_OFFLOAD_RSS_HASH; if (hw->cap & NFP_NET_CFG_CTRL_TXVLAN) dev_info->tx_offload_capa = DEV_TX_OFFLOAD_VLAN_INSERT; diff --git a/drivers/net/octeontx2/otx2_ethdev.c b/drivers/net/octeontx2/otx2_ethdev.c index b84128fef..2e88d1844 100644 --- a/drivers/net/octeontx2/otx2_ethdev.c +++ b/drivers/net/octeontx2/otx2_ethdev.c @@ -569,7 +569,8 @@ nix_rx_offload_flags(struct rte_eth_dev *eth_dev) struct rte_eth_rxmode *rxmode = &conf->rxmode; uint16_t flags = 0; - if (rxmode->mq_mode == ETH_MQ_RX_RSS) + if (rxmode->mq_mode == ETH_MQ_RX_RSS && + (dev->rx_offloads & DEV_RX_OFFLOAD_RSS_HASH)) flags |= NIX_RX_OFFLOAD_RSS_F; if (dev->rx_offloads & (DEV_RX_OFFLOAD_TCP_CKSUM | diff --git a/drivers/net/octeontx2/otx2_ethdev.h b/drivers/net/octeontx2/otx2_ethdev.h index 7b15d6bc8..0cca6746d 100644 --- a/drivers/net/octeontx2/otx2_ethdev.h +++ b/drivers/net/octeontx2/otx2_ethdev.h @@ -122,8 +122,8 @@ DEV_TX_OFFLOAD_MT_LOCKFREE | \ DEV_TX_OFFLOAD_VLAN_INSERT | \ DEV_TX_OFFLOAD_QINQ_INSERT | \ - DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM | \ - DEV_TX_OFFLOAD_OUTER_UDP_CKSUM | \ + DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM | \ + DEV_TX_OFFLOAD_OUTER_UDP_CKSUM | \ DEV_TX_OFFLOAD_TCP_CKSUM | \ DEV_TX_OFFLOAD_UDP_CKSUM | \ DEV_TX_OFFLOAD_SCTP_CKSUM | \ @@ -136,11 +136,12 @@ DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM | \ DEV_RX_OFFLOAD_SCATTER | \ DEV_RX_OFFLOAD_JUMBO_FRAME | \ - DEV_RX_OFFLOAD_OUTER_UDP_CKSUM | \ - DEV_RX_OFFLOAD_VLAN_STRIP | \ - DEV_RX_OFFLOAD_VLAN_FILTER | \ - DEV_RX_OFFLOAD_QINQ_STRIP | \ - DEV_RX_OFFLOAD_TIMESTAMP) + DEV_RX_OFFLOAD_OUTER_UDP_CKSUM | \ + DEV_RX_OFFLOAD_VLAN_STRIP | \ + DEV_RX_OFFLOAD_VLAN_FILTER | \ + DEV_RX_OFFLOAD_QINQ_STRIP | \ + DEV_RX_OFFLOAD_TIMESTAMP | \ + DEV_RX_OFFLOAD_RSS_HASH) #define NIX_DEFAULT_RSS_CTX_GROUP 0 #define NIX_DEFAULT_RSS_MCAM_IDX -1 diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c index 528b33e8c..da25b26df 100644 --- a/drivers/net/qede/qede_ethdev.c +++ b/drivers/net/qede/qede_ethdev.c @@ -1291,7 +1291,8 @@ qede_dev_info_get(struct rte_eth_dev *eth_dev, DEV_RX_OFFLOAD_SCATTER | DEV_RX_OFFLOAD_JUMBO_FRAME | DEV_RX_OFFLOAD_VLAN_FILTER | - DEV_RX_OFFLOAD_VLAN_STRIP); + DEV_RX_OFFLOAD_VLAN_STRIP | + DEV_RX_OFFLOAD_RSS_HASH); dev_info->rx_queue_offload_capa = 0; /* TX offloads are on a per-packet basis, so it is applicable diff --git a/drivers/net/sfc/sfc_ef10_essb_rx.c b/drivers/net/sfc/sfc_ef10_essb_rx.c index 63da807ea..220ef0e47 100644 --- a/drivers/net/sfc/sfc_ef10_essb_rx.c +++ b/drivers/net/sfc/sfc_ef10_essb_rx.c @@ -716,7 +716,7 @@ struct sfc_dp_rx sfc_ef10_essb_rx = { .features = SFC_DP_RX_FEAT_FLOW_FLAG | SFC_DP_RX_FEAT_FLOW_MARK, .dev_offload_capa = DEV_RX_OFFLOAD_CHECKSUM, - .queue_offload_capa = 0, + .queue_offload_capa = DEV_RX_OFFLOAD_RSS_HASH, .get_dev_info = sfc_ef10_essb_rx_get_dev_info, .pool_ops_supported = sfc_ef10_essb_rx_pool_ops_supported, .qsize_up_rings = sfc_ef10_essb_rx_qsize_up_rings, diff --git a/drivers/net/sfc/sfc_ef10_rx.c b/drivers/net/sfc/sfc_ef10_rx.c index f2fc6e70a..85b5df466 100644 --- a/drivers/net/sfc/sfc_ef10_rx.c +++ b/drivers/net/sfc/sfc_ef10_rx.c @@ -797,7 +797,8 @@ struct sfc_dp_rx sfc_ef10_rx = { SFC_DP_RX_FEAT_INTR, .dev_offload_capa = DEV_RX_OFFLOAD_CHECKSUM | DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM, - .queue_offload_capa = DEV_RX_OFFLOAD_SCATTER, + .queue_offload_capa = DEV_RX_OFFLOAD_SCATTER | + DEV_RX_OFFLOAD_RSS_HASH, .get_dev_info = sfc_ef10_rx_get_dev_info, .qsize_up_rings = sfc_ef10_rx_qsize_up_rings, .qcreate = sfc_ef10_rx_qcreate, diff --git a/drivers/net/sfc/sfc_rx.c b/drivers/net/sfc/sfc_rx.c index e6809bb64..695580b22 100644 --- a/drivers/net/sfc/sfc_rx.c +++ b/drivers/net/sfc/sfc_rx.c @@ -618,7 +618,8 @@ struct sfc_dp_rx sfc_efx_rx = { }, .features = SFC_DP_RX_FEAT_INTR, .dev_offload_capa = DEV_RX_OFFLOAD_CHECKSUM, - .queue_offload_capa = DEV_RX_OFFLOAD_SCATTER, + .queue_offload_capa = DEV_RX_OFFLOAD_SCATTER | + DEV_RX_OFFLOAD_RSS_HASH, .qsize_up_rings = sfc_efx_rx_qsize_up_rings, .qcreate = sfc_efx_rx_qcreate, .qdestroy = sfc_efx_rx_qdestroy, diff --git a/drivers/net/thunderx/nicvf_ethdev.h b/drivers/net/thunderx/nicvf_ethdev.h index c0bfbf848..391411799 100644 --- a/drivers/net/thunderx/nicvf_ethdev.h +++ b/drivers/net/thunderx/nicvf_ethdev.h @@ -41,7 +41,8 @@ DEV_RX_OFFLOAD_CHECKSUM | \ DEV_RX_OFFLOAD_VLAN_STRIP | \ DEV_RX_OFFLOAD_JUMBO_FRAME | \ - DEV_RX_OFFLOAD_SCATTER) + DEV_RX_OFFLOAD_SCATTER | \ + DEV_RX_OFFLOAD_RSS_HASH) #define NICVF_DEFAULT_RX_FREE_THRESH 224 #define NICVF_DEFAULT_TX_FREE_THRESH 224 diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c index 57feb3773..a1bdf3482 100644 --- a/drivers/net/vmxnet3/vmxnet3_ethdev.c +++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c @@ -58,7 +58,8 @@ DEV_RX_OFFLOAD_UDP_CKSUM | \ DEV_RX_OFFLOAD_TCP_CKSUM | \ DEV_RX_OFFLOAD_TCP_LRO | \ - DEV_RX_OFFLOAD_JUMBO_FRAME) + DEV_RX_OFFLOAD_JUMBO_FRAME | \ + DEV_RX_OFFLOAD_RSS_HASH) static int eth_vmxnet3_dev_init(struct rte_eth_dev *eth_dev); static int eth_vmxnet3_dev_uninit(struct rte_eth_dev *eth_dev); From patchwork Wed Aug 21 20:47:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavan Nikhilesh Bhagavatula X-Patchwork-Id: 57786 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C68B51BF30; Wed, 21 Aug 2019 22:48:33 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 294431BF29 for ; Wed, 21 Aug 2019 22:48:32 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x7LKj8WH014341; Wed, 21 Aug 2019 13:48:30 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0818; bh=1F0VjtKPwpWqoFmZi5b9mQJ1yItKfFOlOKDC+Dyx9XQ=; b=HgDiCUFX+NX9RboyMphSwlQPsLeGBjeECfumBWiumfbk3puXkkp+YLycnV5FVNtJfc24 qwwibpope4++2Ss9G4lLBhCXREjyMwDR0Dz6FBkqYuT4+/kwIrpb1+UAfONtskgoF+8T 1nI8gHOA0QbybOLCooqLRsLvaaagudnIFWaDgBHtGbNSWfJrF6tHW4piwKPSB9M0DPKS jjNX0hsBe++i9zReAQB22MZZc3bF/EjtmfSp6q0VlRe/PmEura8PbxYDipsAFYghAMYV 1avHWYhBtEFiZ7wAawcIxA7hNpKkALbzONM9AM2msmG3TW4RgKzSmy0gKR8so+J4e0oE pg== Received: from sc-exch02.marvell.com ([199.233.58.182]) by mx0b-0016f401.pphosted.com with ESMTP id 2uhag20pay-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 21 Aug 2019 13:48:30 -0700 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Wed, 21 Aug 2019 13:48:28 -0700 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Wed, 21 Aug 2019 13:48:28 -0700 Received: from BG-LT7430.marvell.com (unknown [10.28.17.62]) by maili.marvell.com (Postfix) with ESMTP id 154D43F703F; Wed, 21 Aug 2019 13:48:23 -0700 (PDT) From: To: , , Ajit Khaparde , Somnath Kotur , John Daley , Hyong Youb Kim , "Beilei Xing" , Qi Zhang , Jingjing Wu , Wenzhuo Lu , Qiming Yang , Konstantin Ananyev , Shahaf Shuler , Yongseok Koh , Viacheslav Ovsiienko , Nithin Dabilpuram , Kiran Kumar K CC: , Pavan Nikhilesh Date: Thu, 22 Aug 2019 02:17:53 +0530 Message-ID: <20190821204755.1990-6-pbhagavatula@marvell.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190821204755.1990-1-pbhagavatula@marvell.com> References: <20190821204755.1990-1-pbhagavatula@marvell.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:5.22.84,1.0.8 definitions=2019-08-21_06:2019-08-19,2019-08-21 signatures=0 Subject: [dpdk-dev] [PATCH v2 5/7] drivers/net: update Rx flow flag and mark capabilities 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Pavan Nikhilesh Add DEV_RX_OFFLOAD_FLOW_MARK flag for all PMDs that support flow action flag and mark. Signed-off-by: Pavan Nikhilesh --- drivers/net/bnxt/bnxt_ethdev.c | 3 ++- drivers/net/enic/enic_res.c | 3 ++- drivers/net/i40e/i40e_ethdev.c | 3 ++- drivers/net/iavf/iavf_ethdev.c | 3 ++- drivers/net/ice/ice_ethdev.c | 3 ++- drivers/net/ixgbe/ixgbe_rxtx.c | 3 ++- drivers/net/mlx5/mlx5_rxq.c | 3 ++- drivers/net/octeontx2/otx2_ethdev.h | 3 ++- drivers/net/octeontx2/otx2_flow_parse.c | 3 ++- drivers/net/sfc/sfc_ef10_essb_rx.c | 3 ++- drivers/net/sfc/sfc_rx.c | 3 ++- 11 files changed, 22 insertions(+), 11 deletions(-) diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index 6c106baf7..fd1fb7eda 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -161,7 +161,8 @@ static const struct rte_pci_id bnxt_pci_id_map[] = { DEV_RX_OFFLOAD_JUMBO_FRAME | \ DEV_RX_OFFLOAD_KEEP_CRC | \ DEV_RX_OFFLOAD_TCP_LRO | \ - DEV_RX_OFFLOAD_RSS_HASH) + DEV_RX_OFFLOAD_RSS_HASH | \ + DEV_RX_OFFLOAD_FLOW_MARK) static int bnxt_vlan_offload_set_op(struct rte_eth_dev *dev, int mask); static void bnxt_print_link_info(struct rte_eth_dev *eth_dev); diff --git a/drivers/net/enic/enic_res.c b/drivers/net/enic/enic_res.c index 607a085f8..3503d5d7e 100644 --- a/drivers/net/enic/enic_res.c +++ b/drivers/net/enic/enic_res.c @@ -199,7 +199,8 @@ int enic_get_vnic_config(struct enic *enic) DEV_RX_OFFLOAD_IPV4_CKSUM | DEV_RX_OFFLOAD_UDP_CKSUM | DEV_RX_OFFLOAD_TCP_CKSUM | - DEV_RX_OFFLOAD_RSS_HASH; + DEV_RX_OFFLOAD_RSS_HASH | + DEV_RX_OFFLOAD_FLOW_MARK; enic->tx_offload_mask = PKT_TX_IPV6 | PKT_TX_IPV4 | diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index 7058e0213..6311943be 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -3512,7 +3512,8 @@ i40e_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) DEV_RX_OFFLOAD_VLAN_EXTEND | DEV_RX_OFFLOAD_VLAN_FILTER | DEV_RX_OFFLOAD_JUMBO_FRAME | - DEV_RX_OFFLOAD_RSS_HASH; + DEV_RX_OFFLOAD_RSS_HASH | + DEV_RX_OFFLOAD_FLOW_MARK; dev_info->tx_queue_offload_capa = DEV_TX_OFFLOAD_MBUF_FAST_FREE; dev_info->tx_offload_capa = diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c index aef91a79b..7bdaa87b1 100644 --- a/drivers/net/iavf/iavf_ethdev.c +++ b/drivers/net/iavf/iavf_ethdev.c @@ -518,7 +518,8 @@ iavf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) DEV_RX_OFFLOAD_SCATTER | DEV_RX_OFFLOAD_JUMBO_FRAME | DEV_RX_OFFLOAD_VLAN_FILTER | - DEV_RX_OFFLOAD_RSS_HASH; + DEV_RX_OFFLOAD_RSS_HASH | + DEV_RX_OFFLOAD_FLOW_MARK; dev_info->tx_offload_capa = DEV_TX_OFFLOAD_VLAN_INSERT | DEV_TX_OFFLOAD_QINQ_INSERT | diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c index fc0f0003f..8b8d55e4a 100644 --- a/drivers/net/ice/ice_ethdev.c +++ b/drivers/net/ice/ice_ethdev.c @@ -2134,7 +2134,8 @@ ice_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) DEV_RX_OFFLOAD_QINQ_STRIP | DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM | DEV_RX_OFFLOAD_VLAN_EXTEND | - DEV_RX_OFFLOAD_RSS_HASH; + DEV_RX_OFFLOAD_RSS_HASH | + DEV_RX_OFFLOAD_FLOW_MARK; dev_info->tx_offload_capa |= DEV_TX_OFFLOAD_QINQ_INSERT | DEV_TX_OFFLOAD_IPV4_CKSUM | diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c index fa572d184..1481e2426 100644 --- a/drivers/net/ixgbe/ixgbe_rxtx.c +++ b/drivers/net/ixgbe/ixgbe_rxtx.c @@ -2873,7 +2873,8 @@ ixgbe_get_rx_port_offloads(struct rte_eth_dev *dev) DEV_RX_OFFLOAD_JUMBO_FRAME | DEV_RX_OFFLOAD_VLAN_FILTER | DEV_RX_OFFLOAD_SCATTER | - DEV_RX_OFFLOAD_RSS_HASH; + DEV_RX_OFFLOAD_RSS_HASH | + DEV_RX_OFFLOAD_FLOW_MARK; if (hw->mac.type == ixgbe_mac_82598EB) offloads |= DEV_RX_OFFLOAD_VLAN_STRIP; diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c index b5fd57693..1bf01bda3 100644 --- a/drivers/net/mlx5/mlx5_rxq.c +++ b/drivers/net/mlx5/mlx5_rxq.c @@ -369,7 +369,8 @@ mlx5_get_rx_queue_offloads(struct rte_eth_dev *dev) uint64_t offloads = (DEV_RX_OFFLOAD_SCATTER | DEV_RX_OFFLOAD_TIMESTAMP | DEV_RX_OFFLOAD_JUMBO_FRAME | - DEV_RX_OFFLOAD_RSS_HASH); + DEV_RX_OFFLOAD_RSS_HASH | + DEV_RX_OFFLOAD_FLOW_MARK); if (config->hw_fcs_strip) offloads |= DEV_RX_OFFLOAD_KEEP_CRC; diff --git a/drivers/net/octeontx2/otx2_ethdev.h b/drivers/net/octeontx2/otx2_ethdev.h index 0cca6746d..97c1a636a 100644 --- a/drivers/net/octeontx2/otx2_ethdev.h +++ b/drivers/net/octeontx2/otx2_ethdev.h @@ -141,7 +141,8 @@ DEV_RX_OFFLOAD_VLAN_FILTER | \ DEV_RX_OFFLOAD_QINQ_STRIP | \ DEV_RX_OFFLOAD_TIMESTAMP | \ - DEV_RX_OFFLOAD_RSS_HASH) + DEV_RX_OFFLOAD_RSS_HASH | \ + DEV_RX_OFFLOAD_FLOW_MARK) #define NIX_DEFAULT_RSS_CTX_GROUP 0 #define NIX_DEFAULT_RSS_MCAM_IDX -1 diff --git a/drivers/net/octeontx2/otx2_flow_parse.c b/drivers/net/octeontx2/otx2_flow_parse.c index 6670c1a70..6eb69a8b2 100644 --- a/drivers/net/octeontx2/otx2_flow_parse.c +++ b/drivers/net/octeontx2/otx2_flow_parse.c @@ -979,7 +979,8 @@ otx2_flow_parse_actions(struct rte_eth_dev *dev, if (mark) flow->npc_action |= (uint64_t)mark << 40; - if (rte_atomic32_read(&npc->mark_actions) == 1) { + if (rte_atomic32_read(&npc->mark_actions) == 1 && + (hw->rx_offloads & DEV_RX_OFFLOAD_FLOW_MARK)) { hw->rx_offload_flags |= NIX_RX_OFFLOAD_MARK_UPDATE_F; otx2_eth_set_rx_function(dev); diff --git a/drivers/net/sfc/sfc_ef10_essb_rx.c b/drivers/net/sfc/sfc_ef10_essb_rx.c index 220ef0e47..1887731e2 100644 --- a/drivers/net/sfc/sfc_ef10_essb_rx.c +++ b/drivers/net/sfc/sfc_ef10_essb_rx.c @@ -716,7 +716,8 @@ struct sfc_dp_rx sfc_ef10_essb_rx = { .features = SFC_DP_RX_FEAT_FLOW_FLAG | SFC_DP_RX_FEAT_FLOW_MARK, .dev_offload_capa = DEV_RX_OFFLOAD_CHECKSUM, - .queue_offload_capa = DEV_RX_OFFLOAD_RSS_HASH, + .queue_offload_capa = DEV_RX_OFFLOAD_RSS_HASH | + DEV_RX_OFFLOAD_FLOW_MARK, .get_dev_info = sfc_ef10_essb_rx_get_dev_info, .pool_ops_supported = sfc_ef10_essb_rx_pool_ops_supported, .qsize_up_rings = sfc_ef10_essb_rx_qsize_up_rings, diff --git a/drivers/net/sfc/sfc_rx.c b/drivers/net/sfc/sfc_rx.c index 695580b22..0f842e9e9 100644 --- a/drivers/net/sfc/sfc_rx.c +++ b/drivers/net/sfc/sfc_rx.c @@ -619,7 +619,8 @@ struct sfc_dp_rx sfc_efx_rx = { .features = SFC_DP_RX_FEAT_INTR, .dev_offload_capa = DEV_RX_OFFLOAD_CHECKSUM, .queue_offload_capa = DEV_RX_OFFLOAD_SCATTER | - DEV_RX_OFFLOAD_RSS_HASH, + DEV_RX_OFFLOAD_RSS_HASH | + DEV_RX_OFFLOAD_FLOW_MARK, .qsize_up_rings = sfc_efx_rx_qsize_up_rings, .qcreate = sfc_efx_rx_qcreate, .qdestroy = sfc_efx_rx_qdestroy, From patchwork Wed Aug 21 20:47:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavan Nikhilesh Bhagavatula X-Patchwork-Id: 57787 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C56F81BF39; Wed, 21 Aug 2019 22:48:35 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id A945E1BF36 for ; Wed, 21 Aug 2019 22:48:34 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x7LKiwnM030451; Wed, 21 Aug 2019 13:48:33 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0818; bh=oci9vRCcw67gxqv/GCHTlZ4fhr3HktelwK7d1Ee3QmM=; b=VKBUMnka+jbBNjh0Yfh/UB7PjDbdD3/l9UeSFFSk4Y4b7HMd2k5deoDLwEoFzOTrwMFc FOhs17blBZPC0CDZ06Q61wfqDUQvpCwF+pTWOTV5ZH0VcT3c2azG2G9l+S85eomPYbne fNSG+LO2SgGar4R+dfcNyLLP+8cvUrJX4nN91JQWJRHgiKzVngr4v938JJgLjzYvZq1P 26qwBDezTY9o6sYa0txQDrEZq6ARRGJkuuiVTP54XAPWDOUKMCu47zK2wZlmnV5qKXP9 /2CJkRRrzJeRiM9WVkl2p3moRni6ZYgyt66WSxg7fOXxTciLtBCXEeh8LcgoFZ6ChJ7g UA== Received: from sc-exch02.marvell.com ([199.233.58.182]) by mx0a-0016f401.pphosted.com with ESMTP id 2uhad3rssx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 21 Aug 2019 13:48:33 -0700 Received: from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Wed, 21 Aug 2019 13:48:32 -0700 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Wed, 21 Aug 2019 13:48:32 -0700 Received: from BG-LT7430.marvell.com (unknown [10.28.17.62]) by maili.marvell.com (Postfix) with ESMTP id C51043F703F; Wed, 21 Aug 2019 13:48:29 -0700 (PDT) From: To: , , Harry van Haaren CC: , Pavan Nikhilesh Date: Thu, 22 Aug 2019 02:17:54 +0530 Message-ID: <20190821204755.1990-7-pbhagavatula@marvell.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190821204755.1990-1-pbhagavatula@marvell.com> References: <20190821204755.1990-1-pbhagavatula@marvell.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:5.22.84,1.0.8 definitions=2019-08-21_06:2019-08-19,2019-08-21 signatures=0 Subject: [dpdk-dev] [PATCH v2 6/7] examples/eventdev_pipeline: add new Rx RSS hash offload 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Pavan Nikhilesh Since pipeline_generic uses `rte_mbuf::hash::rss` add the new Rx offload flag `DEV_RX_OFFLOAD_RSS_HASH` to inform PMD to copy the RSS hash result into the mbuf. Signed-off-by: Pavan Nikhilesh --- Currently, there is no means to retrieve set configuration from an ethdev without touching the internal structures of `rte_ethdev`. So, moving port configuration into specific pipeline models is the only way. examples/eventdev_pipeline/main.c | 113 ----------------- .../pipeline_worker_generic.c | 118 ++++++++++++++++++ .../eventdev_pipeline/pipeline_worker_tx.c | 114 +++++++++++++++++ 3 files changed, 232 insertions(+), 113 deletions(-) -- 2.22.0 diff --git a/examples/eventdev_pipeline/main.c b/examples/eventdev_pipeline/main.c index f4e57f541..a73b61d59 100644 --- a/examples/eventdev_pipeline/main.c +++ b/examples/eventdev_pipeline/main.c @@ -242,118 +242,6 @@ parse_app_args(int argc, char **argv) } } -/* - * Initializes a given port using global settings and with the RX buffers - * coming from the mbuf_pool passed as a parameter. - */ -static inline int -port_init(uint8_t port, struct rte_mempool *mbuf_pool) -{ - struct rte_eth_rxconf rx_conf; - static const struct rte_eth_conf port_conf_default = { - .rxmode = { - .mq_mode = ETH_MQ_RX_RSS, - .max_rx_pkt_len = RTE_ETHER_MAX_LEN, - }, - .rx_adv_conf = { - .rss_conf = { - .rss_hf = ETH_RSS_IP | - ETH_RSS_TCP | - ETH_RSS_UDP, - } - } - }; - const uint16_t rx_rings = 1, tx_rings = 1; - const uint16_t rx_ring_size = 512, tx_ring_size = 512; - struct rte_eth_conf port_conf = port_conf_default; - int retval; - uint16_t q; - struct rte_eth_dev_info dev_info; - struct rte_eth_txconf txconf; - - if (!rte_eth_dev_is_valid_port(port)) - return -1; - - rte_eth_dev_info_get(port, &dev_info); - if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE) - port_conf.txmode.offloads |= - DEV_TX_OFFLOAD_MBUF_FAST_FREE; - rx_conf = dev_info.default_rxconf; - rx_conf.offloads = port_conf.rxmode.offloads; - - port_conf.rx_adv_conf.rss_conf.rss_hf &= - dev_info.flow_type_rss_offloads; - if (port_conf.rx_adv_conf.rss_conf.rss_hf != - port_conf_default.rx_adv_conf.rss_conf.rss_hf) { - printf("Port %u modified RSS hash function based on hardware support," - "requested:%#"PRIx64" configured:%#"PRIx64"\n", - port, - port_conf_default.rx_adv_conf.rss_conf.rss_hf, - port_conf.rx_adv_conf.rss_conf.rss_hf); - } - - /* Configure the Ethernet device. */ - retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf); - if (retval != 0) - return retval; - - /* Allocate and set up 1 RX queue per Ethernet port. */ - for (q = 0; q < rx_rings; q++) { - retval = rte_eth_rx_queue_setup(port, q, rx_ring_size, - rte_eth_dev_socket_id(port), &rx_conf, - mbuf_pool); - if (retval < 0) - return retval; - } - - txconf = dev_info.default_txconf; - txconf.offloads = port_conf_default.txmode.offloads; - /* Allocate and set up 1 TX queue per Ethernet port. */ - for (q = 0; q < tx_rings; q++) { - retval = rte_eth_tx_queue_setup(port, q, tx_ring_size, - rte_eth_dev_socket_id(port), &txconf); - if (retval < 0) - return retval; - } - - /* Display the port MAC address. */ - struct rte_ether_addr addr; - rte_eth_macaddr_get(port, &addr); - printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8 - " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n", - (unsigned int)port, - addr.addr_bytes[0], addr.addr_bytes[1], - addr.addr_bytes[2], addr.addr_bytes[3], - addr.addr_bytes[4], addr.addr_bytes[5]); - - /* Enable RX in promiscuous mode for the Ethernet device. */ - rte_eth_promiscuous_enable(port); - - return 0; -} - -static int -init_ports(uint16_t num_ports) -{ - uint16_t portid; - - if (!cdata.num_mbuf) - cdata.num_mbuf = 16384 * num_ports; - - struct rte_mempool *mp = rte_pktmbuf_pool_create("packet_pool", - /* mbufs */ cdata.num_mbuf, - /* cache_size */ 512, - /* priv_size*/ 0, - /* data_room_size */ RTE_MBUF_DEFAULT_BUF_SIZE, - rte_socket_id()); - - RTE_ETH_FOREACH_DEV(portid) - if (port_init(portid, mp) != 0) - rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu16 "\n", - portid); - - return 0; -} static void do_capability_setup(uint8_t eventdev_id) @@ -501,7 +389,6 @@ main(int argc, char **argv) if (dev_id < 0) rte_exit(EXIT_FAILURE, "Error setting up eventdev\n"); - init_ports(num_ports); fdata->cap.adptr_setup(num_ports); /* Start the Ethernet port. */ diff --git a/examples/eventdev_pipeline/pipeline_worker_generic.c b/examples/eventdev_pipeline/pipeline_worker_generic.c index 766c8e958..aa1678fe7 100644 --- a/examples/eventdev_pipeline/pipeline_worker_generic.c +++ b/examples/eventdev_pipeline/pipeline_worker_generic.c @@ -271,6 +271,123 @@ setup_eventdev_generic(struct worker_data *worker_data) return dev_id; } +/* + * Initializes a given port using global settings and with the RX buffers + * coming from the mbuf_pool passed as a parameter. + */ +static inline int +port_init(uint8_t port, struct rte_mempool *mbuf_pool) +{ + struct rte_eth_rxconf rx_conf; + static const struct rte_eth_conf port_conf_default = { + .rxmode = { + .mq_mode = ETH_MQ_RX_RSS, + .max_rx_pkt_len = RTE_ETHER_MAX_LEN, + }, + .rx_adv_conf = { + .rss_conf = { + .rss_hf = ETH_RSS_IP | + ETH_RSS_TCP | + ETH_RSS_UDP, + } + } + }; + const uint16_t rx_rings = 1, tx_rings = 1; + const uint16_t rx_ring_size = 512, tx_ring_size = 512; + struct rte_eth_conf port_conf = port_conf_default; + int retval; + uint16_t q; + struct rte_eth_dev_info dev_info; + struct rte_eth_txconf txconf; + + if (!rte_eth_dev_is_valid_port(port)) + return -1; + + rte_eth_dev_info_get(port, &dev_info); + if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE) + port_conf.txmode.offloads |= + DEV_TX_OFFLOAD_MBUF_FAST_FREE; + + if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_RSS_HASH) + port_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH; + + rx_conf = dev_info.default_rxconf; + rx_conf.offloads = port_conf.rxmode.offloads; + + port_conf.rx_adv_conf.rss_conf.rss_hf &= + dev_info.flow_type_rss_offloads; + if (port_conf.rx_adv_conf.rss_conf.rss_hf != + port_conf_default.rx_adv_conf.rss_conf.rss_hf) { + printf("Port %u modified RSS hash function based on hardware support," + "requested:%#"PRIx64" configured:%#"PRIx64"\n", + port, + port_conf_default.rx_adv_conf.rss_conf.rss_hf, + port_conf.rx_adv_conf.rss_conf.rss_hf); + } + + /* Configure the Ethernet device. */ + retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf); + if (retval != 0) + return retval; + + /* Allocate and set up 1 RX queue per Ethernet port. */ + for (q = 0; q < rx_rings; q++) { + retval = rte_eth_rx_queue_setup(port, q, rx_ring_size, + rte_eth_dev_socket_id(port), &rx_conf, + mbuf_pool); + if (retval < 0) + return retval; + } + + txconf = dev_info.default_txconf; + txconf.offloads = port_conf_default.txmode.offloads; + /* Allocate and set up 1 TX queue per Ethernet port. */ + for (q = 0; q < tx_rings; q++) { + retval = rte_eth_tx_queue_setup(port, q, tx_ring_size, + rte_eth_dev_socket_id(port), &txconf); + if (retval < 0) + return retval; + } + + /* Display the port MAC address. */ + struct rte_ether_addr addr; + rte_eth_macaddr_get(port, &addr); + printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8 + " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n", + (unsigned int)port, + addr.addr_bytes[0], addr.addr_bytes[1], + addr.addr_bytes[2], addr.addr_bytes[3], + addr.addr_bytes[4], addr.addr_bytes[5]); + + /* Enable RX in promiscuous mode for the Ethernet device. */ + rte_eth_promiscuous_enable(port); + + return 0; +} + +static int +init_ports(uint16_t num_ports) +{ + uint16_t portid; + + if (!cdata.num_mbuf) + cdata.num_mbuf = 16384 * num_ports; + + struct rte_mempool *mp = rte_pktmbuf_pool_create("packet_pool", + /* mbufs */ cdata.num_mbuf, + /* cache_size */ 512, + /* priv_size*/ 0, + /* data_room_size */ RTE_MBUF_DEFAULT_BUF_SIZE, + rte_socket_id()); + + RTE_ETH_FOREACH_DEV(portid) + if (port_init(portid, mp) != 0) + rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu16 "\n", + portid); + + return 0; +} + static void init_adapters(uint16_t nb_ports) { @@ -297,6 +414,7 @@ init_adapters(uint16_t nb_ports) adptr_p_conf.enqueue_depth = dev_info.max_event_port_enqueue_depth; + init_ports(nb_ports); /* Create one adapter for all the ethernet ports. */ ret = rte_event_eth_rx_adapter_create(cdata.rx_adapter_id, evdev_id, &adptr_p_conf); diff --git a/examples/eventdev_pipeline/pipeline_worker_tx.c b/examples/eventdev_pipeline/pipeline_worker_tx.c index 8961cd656..52a1b4174 100644 --- a/examples/eventdev_pipeline/pipeline_worker_tx.c +++ b/examples/eventdev_pipeline/pipeline_worker_tx.c @@ -603,6 +603,119 @@ service_rx_adapter(void *arg) return 0; } +/* + * Initializes a given port using global settings and with the RX buffers + * coming from the mbuf_pool passed as a parameter. + */ +static inline int +port_init(uint8_t port, struct rte_mempool *mbuf_pool) +{ + struct rte_eth_rxconf rx_conf; + static const struct rte_eth_conf port_conf_default = { + .rxmode = { + .mq_mode = ETH_MQ_RX_RSS, + .max_rx_pkt_len = RTE_ETHER_MAX_LEN, + }, + .rx_adv_conf = { + .rss_conf = { + .rss_hf = ETH_RSS_IP | + ETH_RSS_TCP | + ETH_RSS_UDP, + } + } + }; + const uint16_t rx_rings = 1, tx_rings = 1; + const uint16_t rx_ring_size = 512, tx_ring_size = 512; + struct rte_eth_conf port_conf = port_conf_default; + int retval; + uint16_t q; + struct rte_eth_dev_info dev_info; + struct rte_eth_txconf txconf; + + if (!rte_eth_dev_is_valid_port(port)) + return -1; + + rte_eth_dev_info_get(port, &dev_info); + if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE) + port_conf.txmode.offloads |= + DEV_TX_OFFLOAD_MBUF_FAST_FREE; + rx_conf = dev_info.default_rxconf; + rx_conf.offloads = port_conf.rxmode.offloads; + + port_conf.rx_adv_conf.rss_conf.rss_hf &= + dev_info.flow_type_rss_offloads; + if (port_conf.rx_adv_conf.rss_conf.rss_hf != + port_conf_default.rx_adv_conf.rss_conf.rss_hf) { + printf("Port %u modified RSS hash function based on hardware support," + "requested:%#"PRIx64" configured:%#"PRIx64"\n", + port, + port_conf_default.rx_adv_conf.rss_conf.rss_hf, + port_conf.rx_adv_conf.rss_conf.rss_hf); + } + + /* Configure the Ethernet device. */ + retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf); + if (retval != 0) + return retval; + + /* Allocate and set up 1 RX queue per Ethernet port. */ + for (q = 0; q < rx_rings; q++) { + retval = rte_eth_rx_queue_setup(port, q, rx_ring_size, + rte_eth_dev_socket_id(port), &rx_conf, + mbuf_pool); + if (retval < 0) + return retval; + } + + txconf = dev_info.default_txconf; + txconf.offloads = port_conf_default.txmode.offloads; + /* Allocate and set up 1 TX queue per Ethernet port. */ + for (q = 0; q < tx_rings; q++) { + retval = rte_eth_tx_queue_setup(port, q, tx_ring_size, + rte_eth_dev_socket_id(port), &txconf); + if (retval < 0) + return retval; + } + + /* Display the port MAC address. */ + struct rte_ether_addr addr; + rte_eth_macaddr_get(port, &addr); + printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8 + " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n", + (unsigned int)port, + addr.addr_bytes[0], addr.addr_bytes[1], + addr.addr_bytes[2], addr.addr_bytes[3], + addr.addr_bytes[4], addr.addr_bytes[5]); + + /* Enable RX in promiscuous mode for the Ethernet device. */ + rte_eth_promiscuous_enable(port); + + return 0; +} + +static int +init_ports(uint16_t num_ports) +{ + uint16_t portid; + + if (!cdata.num_mbuf) + cdata.num_mbuf = 16384 * num_ports; + + struct rte_mempool *mp = rte_pktmbuf_pool_create("packet_pool", + /* mbufs */ cdata.num_mbuf, + /* cache_size */ 512, + /* priv_size*/ 0, + /* data_room_size */ RTE_MBUF_DEFAULT_BUF_SIZE, + rte_socket_id()); + + RTE_ETH_FOREACH_DEV(portid) + if (port_init(portid, mp) != 0) + rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu16 "\n", + portid); + + return 0; +} + static void init_adapters(uint16_t nb_ports) { @@ -621,6 +734,7 @@ init_adapters(uint16_t nb_ports) .new_event_threshold = 4096, }; + init_ports(nb_ports); if (adptr_p_conf.new_event_threshold > dev_info.max_num_events) adptr_p_conf.new_event_threshold = dev_info.max_num_events; if (adptr_p_conf.dequeue_depth > dev_info.max_event_port_dequeue_depth) From patchwork Wed Aug 21 20:47:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavan Nikhilesh Bhagavatula X-Patchwork-Id: 57788 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5206A1BF18; Wed, 21 Aug 2019 22:49:43 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id AE2B51BF16 for ; Wed, 21 Aug 2019 22:49:41 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x7LKj9nk014346; Wed, 21 Aug 2019 13:48:44 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0818; bh=vMcuL8srNqBzK4eZ6xiwQvN0yFUlhbp+5R8tosipXcI=; b=gxdhUN88/RtXsN+TTJ8ttOSmgdPs2fosfIniQIrK6imSSzL/kMkisvmkv6tcDnmeAifj 7JGo5oO6dcqHb5Gr39Wi+C3br8vrM5aRaMQ4MXCWWM5CPaulcgJUKdVAOICBBrreT1cl Sm7vHglud+u4ipJ6tDA4Vpdue/Bp7uPK8z6yGkq8yfxOoQi7FKuBKRPvfa5CCRRG1xTf WX2B73tGcFtA3B0J3G7gmDbqP6uoGphvIT1fSJ9X3Qzot1vyZTwuf4MWL3nXBMlm0si7 x/CWH1Mn6Wki85aQ2pqy4lTtKbAt7UELFvdVW2f4MzHonIkuxME/i/nWMzBUp9Gas4wh 9g== Received: from sc-exch04.marvell.com ([199.233.58.184]) by mx0b-0016f401.pphosted.com with ESMTP id 2uhag20pc8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 21 Aug 2019 13:48:43 -0700 Received: from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Wed, 21 Aug 2019 13:48:41 -0700 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Wed, 21 Aug 2019 13:48:41 -0700 Received: from BG-LT7430.marvell.com (unknown [10.28.17.62]) by maili.marvell.com (Postfix) with ESMTP id 8C9EB3F703F; Wed, 21 Aug 2019 13:48:33 -0700 (PDT) From: To: , , Nicolas Chautru , Chas Williams , David Hunt , Harry van Haaren , "Marko Kovacevic" , Ori Kam , "Bruce Richardson" , Pablo de Lara , Radu Nicolau , Akhil Goyal , Tomasz Kantecki , Bernard Iremonger , Cristian Dumitrescu , Konstantin Ananyev , Ferruh Yigit , "Declan Doherty" , Reshma Pattan , John McNamara , Xiaoyun Li , Jasvinder Singh , Byron Marohn , Maxime Coquelin , "Tiwei Bie" , Zhihong Wang CC: , Pavan Nikhilesh Date: Thu, 22 Aug 2019 02:17:55 +0530 Message-ID: <20190821204755.1990-8-pbhagavatula@marvell.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190821204755.1990-1-pbhagavatula@marvell.com> References: <20190821204755.1990-1-pbhagavatula@marvell.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:5.22.84,1.0.8 definitions=2019-08-21_06:2019-08-19,2019-08-21 signatures=0 Subject: [dpdk-dev] [PATCH v2 7/7] examples: disable Rx packet type parsing 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Pavan Nikhilesh Disable packet type parsing in examples that don't use `rte_mbuf::packet_type` by setting ptype_mask as 0 in `rte_eth_dev_set_supported_ptypes` Signed-off-by: Pavan Nikhilesh --- examples/bbdev_app/main.c | 1 + examples/bond/main.c | 2 ++ examples/distributor/Makefile | 1 + examples/distributor/main.c | 1 + examples/distributor/meson.build | 1 + examples/eventdev_pipeline/main.c | 1 + examples/eventdev_pipeline/meson.build | 1 + examples/exception_path/Makefile | 1 + examples/exception_path/main.c | 1 + examples/exception_path/meson.build | 1 + examples/flow_classify/flow_classify.c | 1 + examples/flow_filtering/Makefile | 1 + examples/flow_filtering/main.c | 1 + examples/flow_filtering/meson.build | 1 + examples/ip_pipeline/link.c | 1 + examples/ip_reassembly/Makefile | 1 + examples/ip_reassembly/main.c | 1 + examples/ip_reassembly/meson.build | 1 + examples/ipsec-secgw/ipsec-secgw.c | 1 + examples/ipv4_multicast/Makefile | 1 + examples/ipv4_multicast/main.c | 1 + examples/ipv4_multicast/meson.build | 1 + examples/kni/main.c | 1 + examples/l2fwd-cat/Makefile | 1 + examples/l2fwd-cat/l2fwd-cat.c | 1 + examples/l2fwd-cat/meson.build | 1 + examples/l2fwd-crypto/main.c | 1 + examples/l2fwd-jobstats/Makefile | 1 + examples/l2fwd-jobstats/main.c | 1 + examples/l2fwd-jobstats/meson.build | 1 + examples/l2fwd-keepalive/Makefile | 1 + examples/l2fwd-keepalive/main.c | 1 + examples/l2fwd-keepalive/meson.build | 1 + examples/l2fwd/Makefile | 1 + examples/l2fwd/main.c | 1 + examples/l2fwd/meson.build | 1 + examples/l3fwd-acl/Makefile | 1 + examples/l3fwd-acl/main.c | 1 + examples/l3fwd-acl/meson.build | 1 + examples/l3fwd-power/main.c | 1 + examples/l3fwd-vf/Makefile | 1 + examples/l3fwd-vf/main.c | 1 + examples/l3fwd-vf/meson.build | 1 + examples/link_status_interrupt/Makefile | 1 + examples/link_status_interrupt/main.c | 1 + examples/link_status_interrupt/meson.build | 1 + examples/load_balancer/Makefile | 1 + examples/load_balancer/init.c | 1 + examples/load_balancer/meson.build | 1 + examples/packet_ordering/Makefile | 1 + examples/packet_ordering/main.c | 1 + examples/packet_ordering/meson.build | 1 + examples/ptpclient/Makefile | 1 + examples/ptpclient/meson.build | 1 + examples/ptpclient/ptpclient.c | 1 + examples/qos_meter/Makefile | 1 + examples/qos_meter/main.c | 2 ++ examples/qos_meter/meson.build | 1 + examples/qos_sched/Makefile | 1 + examples/qos_sched/init.c | 1 + examples/qos_sched/meson.build | 1 + examples/quota_watermark/qw/Makefile | 1 + examples/quota_watermark/qw/init.c | 1 + examples/rxtx_callbacks/main.c | 1 + examples/server_node_efd/server/Makefile | 1 + examples/server_node_efd/server/init.c | 1 + examples/skeleton/Makefile | 1 + examples/skeleton/basicfwd.c | 1 + examples/skeleton/meson.build | 1 + examples/tep_termination/Makefile | 1 + examples/tep_termination/meson.build | 1 + examples/tep_termination/vxlan_setup.c | 1 + examples/vhost/Makefile | 1 + examples/vhost/main.c | 1 + examples/vm_power_manager/Makefile | 1 + examples/vm_power_manager/main.c | 1 + examples/vm_power_manager/meson.build | 1 + examples/vmdq/Makefile | 1 + examples/vmdq/main.c | 1 + examples/vmdq/meson.build | 1 + examples/vmdq_dcb/Makefile | 1 + examples/vmdq_dcb/main.c | 1 + examples/vmdq_dcb/meson.build | 1 + 83 files changed, 85 insertions(+) diff --git a/examples/bbdev_app/main.c b/examples/bbdev_app/main.c index 9acf666dc..8ae6e4972 100644 --- a/examples/bbdev_app/main.c +++ b/examples/bbdev_app/main.c @@ -478,6 +478,7 @@ initialize_ports(struct app_config_params *app_params, } rte_eth_promiscuous_enable(port_id); + rte_eth_dev_set_supported_ptypes(port_id, 0); rte_eth_macaddr_get(port_id, &bbdev_port_eth_addr); print_mac(port_id, &bbdev_port_eth_addr); diff --git a/examples/bond/main.c b/examples/bond/main.c index 1c0df9d46..ffb911fc5 100644 --- a/examples/bond/main.c +++ b/examples/bond/main.c @@ -195,6 +195,7 @@ slave_port_init(uint16_t portid, struct rte_mempool *mbuf_pool) rte_exit(retval, "port %u: TX queue 0 setup failed (res=%d)", portid, retval); + rte_eth_dev_set_supported_ptypes(portid, 0); retval = rte_eth_dev_start(portid); if (retval < 0) rte_exit(retval, @@ -271,6 +272,7 @@ bond_port_init(struct rte_mempool *mbuf_pool) rte_exit(retval, "port %u: TX queue 0 setup failed (res=%d)", BOND_PORT, retval); + rte_eth_dev_set_supported_ptypes(BOND_PORT, 0); retval = rte_eth_dev_start(BOND_PORT); if (retval < 0) rte_exit(retval, "Start port %d failed (res=%d)", BOND_PORT, retval); diff --git a/examples/distributor/Makefile b/examples/distributor/Makefile index bac8d5578..a2a477279 100644 --- a/examples/distributor/Makefile +++ b/examples/distributor/Makefile @@ -50,6 +50,7 @@ RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.conf include $(RTE_SDK)/mk/rte.vars.mk CFLAGS += $(WERROR_FLAGS) +CFLAGS += -DALLOW_EXPERIMENTAL_API # workaround for a gcc bug with noreturn attribute # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603 diff --git a/examples/distributor/main.c b/examples/distributor/main.c index 81d7ca61d..173e0a8b5 100644 --- a/examples/distributor/main.c +++ b/examples/distributor/main.c @@ -162,6 +162,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool) return retval; } + rte_eth_dev_set_supported_ptypes(port, 0); retval = rte_eth_dev_start(port); if (retval < 0) return retval; diff --git a/examples/distributor/meson.build b/examples/distributor/meson.build index 26f108d65..c2976f6bd 100644 --- a/examples/distributor/meson.build +++ b/examples/distributor/meson.build @@ -10,6 +10,7 @@ build = dpdk_conf.has('RTE_LIBRTE_POWER') deps += ['distributor', 'power'] +allow_experimental_apis = true sources = files( 'main.c' ) diff --git a/examples/eventdev_pipeline/main.c b/examples/eventdev_pipeline/main.c index a73b61d59..6e8fd8006 100644 --- a/examples/eventdev_pipeline/main.c +++ b/examples/eventdev_pipeline/main.c @@ -393,6 +393,7 @@ main(int argc, char **argv) /* Start the Ethernet port. */ RTE_ETH_FOREACH_DEV(portid) { + rte_eth_dev_set_supported_ptypes(portid, 0); err = rte_eth_dev_start(portid); if (err < 0) rte_exit(EXIT_FAILURE, "Error starting ethdev %d\n", diff --git a/examples/eventdev_pipeline/meson.build b/examples/eventdev_pipeline/meson.build index a54c35aa7..0fc916b05 100644 --- a/examples/eventdev_pipeline/meson.build +++ b/examples/eventdev_pipeline/meson.build @@ -7,6 +7,7 @@ # DPDK instance, use 'make' deps += 'eventdev' +allow_experimental_apis = true sources = files( 'main.c', 'pipeline_worker_generic.c', diff --git a/examples/exception_path/Makefile b/examples/exception_path/Makefile index 90c7f133a..a7c961276 100644 --- a/examples/exception_path/Makefile +++ b/examples/exception_path/Makefile @@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk CFLAGS += -O3 CFLAGS += $(WERROR_FLAGS) +CFLAGS += -DALLOW_EXPERIMENTAL_API include $(RTE_SDK)/mk/rte.extapp.mk diff --git a/examples/exception_path/main.c b/examples/exception_path/main.c index 0d79e5a24..1b190509a 100644 --- a/examples/exception_path/main.c +++ b/examples/exception_path/main.c @@ -464,6 +464,7 @@ init_port(uint16_t port) FATAL_ERROR("Could not setup up TX queue for port%u (%d)", port, ret); + rte_eth_dev_set_supported_ptypes(port, 0); ret = rte_eth_dev_start(port); if (ret < 0) FATAL_ERROR("Could not start port%u (%d)", port, ret); diff --git a/examples/exception_path/meson.build b/examples/exception_path/meson.build index c34e11e36..2b0a25036 100644 --- a/examples/exception_path/meson.build +++ b/examples/exception_path/meson.build @@ -6,6 +6,7 @@ # To build this example as a standalone application with an already-installed # DPDK instance, use 'make' +allow_experimental_apis = true sources = files( 'main.c' ) diff --git a/examples/flow_classify/flow_classify.c b/examples/flow_classify/flow_classify.c index bc7f43ea9..5140b0fed 100644 --- a/examples/flow_classify/flow_classify.c +++ b/examples/flow_classify/flow_classify.c @@ -231,6 +231,7 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool) } /* Start the Ethernet port. */ + rte_eth_dev_set_supported_ptypes(port, 0); retval = rte_eth_dev_start(port); if (retval < 0) return retval; diff --git a/examples/flow_filtering/Makefile b/examples/flow_filtering/Makefile index a63a75555..793a08fae 100644 --- a/examples/flow_filtering/Makefile +++ b/examples/flow_filtering/Makefile @@ -49,6 +49,7 @@ include $(RTE_SDK)/mk/rte.vars.mk CFLAGS += -O3 CFLAGS += $(WERROR_FLAGS) +CFLAGS += -DALLOW_EXPERIMENTAL_API include $(RTE_SDK)/mk/rte.extapp.mk diff --git a/examples/flow_filtering/main.c b/examples/flow_filtering/main.c index a0487be77..9802c8fe2 100644 --- a/examples/flow_filtering/main.c +++ b/examples/flow_filtering/main.c @@ -176,6 +176,7 @@ init_port(void) } rte_eth_promiscuous_enable(port_id); + rte_eth_dev_set_supported_ptypes(port_id, 0); ret = rte_eth_dev_start(port_id); if (ret < 0) { rte_exit(EXIT_FAILURE, diff --git a/examples/flow_filtering/meson.build b/examples/flow_filtering/meson.build index 407795c42..6f5d1b08a 100644 --- a/examples/flow_filtering/meson.build +++ b/examples/flow_filtering/meson.build @@ -6,6 +6,7 @@ # To build this example as a standalone application with an already-installed # DPDK instance, use 'make' +allow_experimental_apis = true sources = files( 'main.c', ) diff --git a/examples/ip_pipeline/link.c b/examples/ip_pipeline/link.c index 787eb866a..15a5a5715 100644 --- a/examples/ip_pipeline/link.c +++ b/examples/ip_pipeline/link.c @@ -205,6 +205,7 @@ link_create(const char *name, struct link_params *params) return NULL; } + rte_eth_dev_set_supported_ptypes(port_id, 0); /* Port start */ status = rte_eth_dev_start(port_id); if (status < 0) diff --git a/examples/ip_reassembly/Makefile b/examples/ip_reassembly/Makefile index 0b1a904e0..19c462388 100644 --- a/examples/ip_reassembly/Makefile +++ b/examples/ip_reassembly/Makefile @@ -52,6 +52,7 @@ include $(RTE_SDK)/mk/rte.vars.mk CFLAGS += -O3 CFLAGS += $(WERROR_FLAGS) +CFLAGS += -DALLOW_EXPERIMENTAL_API # workaround for a gcc bug with noreturn attribute # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603 diff --git a/examples/ip_reassembly/main.c b/examples/ip_reassembly/main.c index 38b39be6b..08b710cf6 100644 --- a/examples/ip_reassembly/main.c +++ b/examples/ip_reassembly/main.c @@ -1158,6 +1158,7 @@ main(int argc, char **argv) if ((enabled_port_mask & (1 << portid)) == 0) { continue; } + rte_eth_dev_set_supported_ptypes(portid, 0); /* Start device */ ret = rte_eth_dev_start(portid); if (ret < 0) diff --git a/examples/ip_reassembly/meson.build b/examples/ip_reassembly/meson.build index 8ebd48291..8a667c265 100644 --- a/examples/ip_reassembly/meson.build +++ b/examples/ip_reassembly/meson.build @@ -7,6 +7,7 @@ # DPDK instance, use 'make' deps += ['lpm', 'ip_frag'] +allow_experimental_apis = true sources = files( 'main.c' ) diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c index 0d1fd6af6..3de98d96c 100644 --- a/examples/ipsec-secgw/ipsec-secgw.c +++ b/examples/ipsec-secgw/ipsec-secgw.c @@ -2448,6 +2448,7 @@ main(int32_t argc, char **argv) if ((enabled_port_mask & (1 << portid)) == 0) continue; + rte_eth_dev_set_supported_ptypes(portid, 0); /* * Start device * note: device must be started before a flow rule diff --git a/examples/ipv4_multicast/Makefile b/examples/ipv4_multicast/Makefile index 5f8a67dd4..5171f7ab2 100644 --- a/examples/ipv4_multicast/Makefile +++ b/examples/ipv4_multicast/Makefile @@ -52,6 +52,7 @@ include $(RTE_SDK)/mk/rte.vars.mk CFLAGS += -O3 CFLAGS += $(WERROR_FLAGS) +CFLAGS += -DALLOW_EXPERIMENTAL_API # workaround for a gcc bug with noreturn attribute # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603 diff --git a/examples/ipv4_multicast/main.c b/examples/ipv4_multicast/main.c index 72eaadc51..69f88f066 100644 --- a/examples/ipv4_multicast/main.c +++ b/examples/ipv4_multicast/main.c @@ -765,6 +765,7 @@ main(int argc, char **argv) qconf->tx_queue_id[portid] = queueid; queueid++; } + rte_eth_dev_set_supported_ptypes(portid, 0); rte_eth_allmulticast_enable(portid); /* Start device */ ret = rte_eth_dev_start(portid); diff --git a/examples/ipv4_multicast/meson.build b/examples/ipv4_multicast/meson.build index d9e4c7c21..6969e2c54 100644 --- a/examples/ipv4_multicast/meson.build +++ b/examples/ipv4_multicast/meson.build @@ -7,6 +7,7 @@ # DPDK instance, use 'make' deps += 'hash' +allow_experimental_apis = true sources = files( 'main.c' ) diff --git a/examples/kni/main.c b/examples/kni/main.c index 4710d7176..c415dbc01 100644 --- a/examples/kni/main.c +++ b/examples/kni/main.c @@ -625,6 +625,7 @@ init_port(uint16_t port) rte_exit(EXIT_FAILURE, "Could not setup up TX queue for " "port%u (%d)\n", (unsigned)port, ret); + rte_eth_dev_set_supported_ptypes(port, 0); ret = rte_eth_dev_start(port); if (ret < 0) rte_exit(EXIT_FAILURE, "Could not start port%u (%d)\n", diff --git a/examples/l2fwd-cat/Makefile b/examples/l2fwd-cat/Makefile index c1960d6d3..d6a25e42a 100644 --- a/examples/l2fwd-cat/Makefile +++ b/examples/l2fwd-cat/Makefile @@ -66,6 +66,7 @@ endif EXTRA_CFLAGS += -O3 -g -Wfatal-errors CFLAGS += -I$(PQOS_INSTALL_PATH)/../include +CFLAGS += -DALLOW_EXPERIMENTAL_API LDLIBS += -L$(PQOS_INSTALL_PATH) LDLIBS += -lpqos diff --git a/examples/l2fwd-cat/l2fwd-cat.c b/examples/l2fwd-cat/l2fwd-cat.c index b34b40a00..dfffbbe38 100644 --- a/examples/l2fwd-cat/l2fwd-cat.c +++ b/examples/l2fwd-cat/l2fwd-cat.c @@ -67,6 +67,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool) return retval; } + rte_eth_dev_set_supported_ptypes(port, 0); /* Start the Ethernet port. */ retval = rte_eth_dev_start(port); if (retval < 0) diff --git a/examples/l2fwd-cat/meson.build b/examples/l2fwd-cat/meson.build index 4e2777a03..37c96040d 100644 --- a/examples/l2fwd-cat/meson.build +++ b/examples/l2fwd-cat/meson.build @@ -10,6 +10,7 @@ pqos = cc.find_library('pqos', required: false) build = pqos.found() ext_deps += pqos cflags += '-I/usr/local/include' # assume pqos lib installed in /usr/local +allow_experimental_apis = true sources = files( 'cat.c', 'l2fwd-cat.c' ) diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c index 3fe2ba725..2fb059073 100644 --- a/examples/l2fwd-crypto/main.c +++ b/examples/l2fwd-crypto/main.c @@ -2559,6 +2559,7 @@ initialize_ports(struct l2fwd_crypto_options *options) return -1; } + rte_eth_dev_set_supported_ptypes(portid, 0); /* Start device */ retval = rte_eth_dev_start(portid); if (retval < 0) { diff --git a/examples/l2fwd-jobstats/Makefile b/examples/l2fwd-jobstats/Makefile index 729a39e93..09834e979 100644 --- a/examples/l2fwd-jobstats/Makefile +++ b/examples/l2fwd-jobstats/Makefile @@ -52,6 +52,7 @@ include $(RTE_SDK)/mk/rte.vars.mk CFLAGS += -O3 CFLAGS += $(WERROR_FLAGS) +CFLAGS += -DALLOW_EXPERIMENTAL_API include $(RTE_SDK)/mk/rte.extapp.mk endif diff --git a/examples/l2fwd-jobstats/main.c b/examples/l2fwd-jobstats/main.c index 77e44dc82..34088982f 100644 --- a/examples/l2fwd-jobstats/main.c +++ b/examples/l2fwd-jobstats/main.c @@ -902,6 +902,7 @@ main(int argc, char **argv) "Cannot set error callback for tx buffer on port %u\n", portid); + rte_eth_dev_set_supported_ptypes(portid, 0); /* Start device */ ret = rte_eth_dev_start(portid); if (ret < 0) diff --git a/examples/l2fwd-jobstats/meson.build b/examples/l2fwd-jobstats/meson.build index 1ffd484e2..3653aa7ec 100644 --- a/examples/l2fwd-jobstats/meson.build +++ b/examples/l2fwd-jobstats/meson.build @@ -7,6 +7,7 @@ # DPDK instance, use 'make' deps += ['jobstats', 'timer'] +allow_experimental_apis = true sources = files( 'main.c' ) diff --git a/examples/l2fwd-keepalive/Makefile b/examples/l2fwd-keepalive/Makefile index 37de27a6f..584257ae2 100644 --- a/examples/l2fwd-keepalive/Makefile +++ b/examples/l2fwd-keepalive/Makefile @@ -53,6 +53,7 @@ include $(RTE_SDK)/mk/rte.vars.mk CFLAGS += -O3 CFLAGS += $(WERROR_FLAGS) +CFLAGS += -DALLOW_EXPERIMENTAL_API LDFLAGS += -lrt include $(RTE_SDK)/mk/rte.extapp.mk diff --git a/examples/l2fwd-keepalive/main.c b/examples/l2fwd-keepalive/main.c index 9831a4323..40bef617f 100644 --- a/examples/l2fwd-keepalive/main.c +++ b/examples/l2fwd-keepalive/main.c @@ -696,6 +696,7 @@ main(int argc, char **argv) "Cannot set error callback for tx buffer on port %u\n", portid); + rte_eth_dev_set_supported_ptypes(portid, 0); /* Start device */ ret = rte_eth_dev_start(portid); if (ret < 0) diff --git a/examples/l2fwd-keepalive/meson.build b/examples/l2fwd-keepalive/meson.build index 6f7b007e1..2dffffaaa 100644 --- a/examples/l2fwd-keepalive/meson.build +++ b/examples/l2fwd-keepalive/meson.build @@ -8,6 +8,7 @@ ext_deps += cc.find_library('rt') deps += 'timer' +allow_experimental_apis = true sources = files( 'main.c', 'shm.c' ) diff --git a/examples/l2fwd/Makefile b/examples/l2fwd/Makefile index 230352093..123e6161c 100644 --- a/examples/l2fwd/Makefile +++ b/examples/l2fwd/Makefile @@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk CFLAGS += -O3 CFLAGS += $(WERROR_FLAGS) +CFLAGS += -DALLOW_EXPERIMENTAL_API include $(RTE_SDK)/mk/rte.extapp.mk endif diff --git a/examples/l2fwd/main.c b/examples/l2fwd/main.c index 1e2b14297..1adda3f9e 100644 --- a/examples/l2fwd/main.c +++ b/examples/l2fwd/main.c @@ -694,6 +694,7 @@ main(int argc, char **argv) "Cannot set error callback for tx buffer on port %u\n", portid); + rte_eth_dev_set_supported_ptypes(portid, 0); /* Start device */ ret = rte_eth_dev_start(portid); if (ret < 0) diff --git a/examples/l2fwd/meson.build b/examples/l2fwd/meson.build index c34e11e36..2b0a25036 100644 --- a/examples/l2fwd/meson.build +++ b/examples/l2fwd/meson.build @@ -6,6 +6,7 @@ # To build this example as a standalone application with an already-installed # DPDK instance, use 'make' +allow_experimental_apis = true sources = files( 'main.c' ) diff --git a/examples/l3fwd-acl/Makefile b/examples/l3fwd-acl/Makefile index e2c989f71..df590f8e9 100644 --- a/examples/l3fwd-acl/Makefile +++ b/examples/l3fwd-acl/Makefile @@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk CFLAGS += -O3 CFLAGS += $(WERROR_FLAGS) +CFLAGS += -DALLOW_EXPERIMENTAL_API # workaround for a gcc bug with noreturn attribute # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603 diff --git a/examples/l3fwd-acl/main.c b/examples/l3fwd-acl/main.c index 0c44df767..d666176e2 100644 --- a/examples/l3fwd-acl/main.c +++ b/examples/l3fwd-acl/main.c @@ -2056,6 +2056,7 @@ main(int argc, char **argv) if ((enabled_port_mask & (1 << portid)) == 0) continue; + rte_eth_dev_set_supported_ptypes(portid, 0); /* Start device */ ret = rte_eth_dev_start(portid); if (ret < 0) diff --git a/examples/l3fwd-acl/meson.build b/examples/l3fwd-acl/meson.build index 7096e00c1..68cebd6ce 100644 --- a/examples/l3fwd-acl/meson.build +++ b/examples/l3fwd-acl/meson.build @@ -7,6 +7,7 @@ # DPDK instance, use 'make' deps += ['acl', 'lpm', 'hash'] +allow_experimental_apis = true sources = files( 'main.c' ) diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c index fd8d9528f..76c6a55cd 100644 --- a/examples/l3fwd-power/main.c +++ b/examples/l3fwd-power/main.c @@ -2426,6 +2426,7 @@ main(int argc, char **argv) if ((enabled_port_mask & (1 << portid)) == 0) { continue; } + rte_eth_dev_set_supported_ptypes(portid, 0); /* Start device */ ret = rte_eth_dev_start(portid); if (ret < 0) diff --git a/examples/l3fwd-vf/Makefile b/examples/l3fwd-vf/Makefile index 7b186a23c..db7f51f2f 100644 --- a/examples/l3fwd-vf/Makefile +++ b/examples/l3fwd-vf/Makefile @@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk CFLAGS += -O3 $(USER_FLAGS) CFLAGS += $(WERROR_FLAGS) +CFLAGS += -DALLOW_EXPERIMENTAL_API # workaround for a gcc bug with noreturn attribute # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603 diff --git a/examples/l3fwd-vf/main.c b/examples/l3fwd-vf/main.c index 572e74cf5..eace6c953 100644 --- a/examples/l3fwd-vf/main.c +++ b/examples/l3fwd-vf/main.c @@ -1051,6 +1051,7 @@ main(int argc, char **argv) if ((enabled_port_mask & (1 << portid)) == 0) { continue; } + rte_eth_dev_set_supported_ptypes(portid, 0); /* Start device */ ret = rte_eth_dev_start(portid); if (ret < 0) diff --git a/examples/l3fwd-vf/meson.build b/examples/l3fwd-vf/meson.build index 226286e74..00f3c38f4 100644 --- a/examples/l3fwd-vf/meson.build +++ b/examples/l3fwd-vf/meson.build @@ -7,6 +7,7 @@ # DPDK instance, use 'make' deps += ['lpm', 'hash'] +allow_experimental_apis = true sources = files( 'main.c' ) diff --git a/examples/link_status_interrupt/Makefile b/examples/link_status_interrupt/Makefile index 97e5a14a8..6ddedd4de 100644 --- a/examples/link_status_interrupt/Makefile +++ b/examples/link_status_interrupt/Makefile @@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk CFLAGS += -O3 CFLAGS += $(WERROR_FLAGS) +CFLAGS += -DALLOW_EXPERIMENTAL_API include $(RTE_SDK)/mk/rte.extapp.mk endif diff --git a/examples/link_status_interrupt/main.c b/examples/link_status_interrupt/main.c index 9cd4dc7a6..ef3e3126a 100644 --- a/examples/link_status_interrupt/main.c +++ b/examples/link_status_interrupt/main.c @@ -676,6 +676,7 @@ main(int argc, char **argv) rte_exit(EXIT_FAILURE, "Cannot set error callback for " "tx buffer on port %u\n", (unsigned) portid); + rte_eth_dev_set_supported_ptypes(portid, 0); /* Start device */ ret = rte_eth_dev_start(portid); if (ret < 0) diff --git a/examples/link_status_interrupt/meson.build b/examples/link_status_interrupt/meson.build index c34e11e36..2b0a25036 100644 --- a/examples/link_status_interrupt/meson.build +++ b/examples/link_status_interrupt/meson.build @@ -6,6 +6,7 @@ # To build this example as a standalone application with an already-installed # DPDK instance, use 'make' +allow_experimental_apis = true sources = files( 'main.c' ) diff --git a/examples/load_balancer/Makefile b/examples/load_balancer/Makefile index caae8a107..dcba9194c 100644 --- a/examples/load_balancer/Makefile +++ b/examples/load_balancer/Makefile @@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk CFLAGS += -O3 -g CFLAGS += $(WERROR_FLAGS) +CFLAGS += -DALLOW_EXPERIMENTAL_API # workaround for a gcc bug with noreturn attribute # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603 diff --git a/examples/load_balancer/init.c b/examples/load_balancer/init.c index 3ab7d0211..1fade7ccd 100644 --- a/examples/load_balancer/init.c +++ b/examples/load_balancer/init.c @@ -496,6 +496,7 @@ app_init_nics(void) } } + rte_eth_dev_set_supported_ptypes(port, 0); /* Start port */ ret = rte_eth_dev_start(port); if (ret < 0) { diff --git a/examples/load_balancer/meson.build b/examples/load_balancer/meson.build index 4f7ac3999..19708974c 100644 --- a/examples/load_balancer/meson.build +++ b/examples/load_balancer/meson.build @@ -7,6 +7,7 @@ # DPDK instance, use 'make' deps += 'lpm' +allow_experimental_apis = true sources = files( 'config.c', 'init.c', 'main.c', 'runtime.c' ) diff --git a/examples/packet_ordering/Makefile b/examples/packet_ordering/Makefile index 51acaf7eb..9ba3fa9e8 100644 --- a/examples/packet_ordering/Makefile +++ b/examples/packet_ordering/Makefile @@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk CFLAGS += -O3 CFLAGS += $(WERROR_FLAGS) +CFLAGS += -DALLOW_EXPERIMENTAL_API include $(RTE_SDK)/mk/rte.extapp.mk endif diff --git a/examples/packet_ordering/main.c b/examples/packet_ordering/main.c index 030e92299..efc5ef196 100644 --- a/examples/packet_ordering/main.c +++ b/examples/packet_ordering/main.c @@ -312,6 +312,7 @@ configure_eth_port(uint16_t port_id) return ret; } + rte_eth_dev_set_supported_ptypes(port_id, 0); ret = rte_eth_dev_start(port_id); if (ret < 0) return ret; diff --git a/examples/packet_ordering/meson.build b/examples/packet_ordering/meson.build index 6c2fccdcb..a3776946f 100644 --- a/examples/packet_ordering/meson.build +++ b/examples/packet_ordering/meson.build @@ -7,6 +7,7 @@ # DPDK instance, use 'make' deps += 'reorder' +allow_experimental_apis = true sources = files( 'main.c' ) diff --git a/examples/ptpclient/Makefile b/examples/ptpclient/Makefile index 89e2bacbd..f158d96b9 100644 --- a/examples/ptpclient/Makefile +++ b/examples/ptpclient/Makefile @@ -50,6 +50,7 @@ RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.conf include $(RTE_SDK)/mk/rte.vars.mk CFLAGS += -O3 +CFLAGS += -DALLOW_EXPERIMENTAL_API CFLAGS += $(WERROR_FLAGS) # workaround for a gcc bug with noreturn attribute diff --git a/examples/ptpclient/meson.build b/examples/ptpclient/meson.build index fa0cbe93c..d4171a218 100644 --- a/examples/ptpclient/meson.build +++ b/examples/ptpclient/meson.build @@ -6,6 +6,7 @@ # To build this example as a standalone application with an already-installed # DPDK instance, use 'make' +allow_experimental_apis = true sources = files( 'ptpclient.c' ) diff --git a/examples/ptpclient/ptpclient.c b/examples/ptpclient/ptpclient.c index 31778fd95..0c14ac763 100644 --- a/examples/ptpclient/ptpclient.c +++ b/examples/ptpclient/ptpclient.c @@ -227,6 +227,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool) return retval; } + rte_eth_dev_set_supported_ptypes(port, 0); /* Start the Ethernet port. */ retval = rte_eth_dev_start(port); if (retval < 0) diff --git a/examples/qos_meter/Makefile b/examples/qos_meter/Makefile index e5217cf7c..a1533d08f 100644 --- a/examples/qos_meter/Makefile +++ b/examples/qos_meter/Makefile @@ -52,6 +52,7 @@ RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.conf include $(RTE_SDK)/mk/rte.vars.mk CFLAGS += -O3 +CFLAGS += -DALLOW_EXPERIMENTAL_API CFLAGS += $(WERROR_FLAGS) # workaround for a gcc bug with noreturn attribute diff --git a/examples/qos_meter/main.c b/examples/qos_meter/main.c index da7afe8be..f73b48772 100644 --- a/examples/qos_meter/main.c +++ b/examples/qos_meter/main.c @@ -419,10 +419,12 @@ main(int argc, char **argv) rte_eth_tx_buffer_init(tx_buffer, PKT_TX_BURST_MAX); + rte_eth_dev_set_supported_ptypes(port_rx, 0); ret = rte_eth_dev_start(port_rx); if (ret < 0) rte_exit(EXIT_FAILURE, "Port %d start error (%d)\n", port_rx, ret); + rte_eth_dev_set_supported_ptypes(port_tx, 0); ret = rte_eth_dev_start(port_tx); if (ret < 0) rte_exit(EXIT_FAILURE, "Port %d start error (%d)\n", port_tx, ret); diff --git a/examples/qos_meter/meson.build b/examples/qos_meter/meson.build index ef7779f2f..10cd4bc79 100644 --- a/examples/qos_meter/meson.build +++ b/examples/qos_meter/meson.build @@ -7,6 +7,7 @@ # DPDK instance, use 'make' deps += 'meter' +allow_experimental_apis = true sources = files( 'main.c', 'rte_policer.c' ) diff --git a/examples/qos_sched/Makefile b/examples/qos_sched/Makefile index ce2d25371..7d3d3019f 100644 --- a/examples/qos_sched/Makefile +++ b/examples/qos_sched/Makefile @@ -58,6 +58,7 @@ else CFLAGS += -O3 CFLAGS += $(WERROR_FLAGS) +CFLAGS += -DALLOW_EXPERIMENTAL_API include $(RTE_SDK)/mk/rte.extapp.mk diff --git a/examples/qos_sched/init.c b/examples/qos_sched/init.c index b05206d5a..d9b7030d0 100644 --- a/examples/qos_sched/init.c +++ b/examples/qos_sched/init.c @@ -138,6 +138,7 @@ app_init_port(uint16_t portid, struct rte_mempool *mp) "rte_eth_tx_queue_setup: err=%d, port=%u queue=%d\n", ret, portid, 0); + rte_eth_dev_set_supported_ptypes(portid, 0); /* Start device */ ret = rte_eth_dev_start(portid); if (ret < 0) diff --git a/examples/qos_sched/meson.build b/examples/qos_sched/meson.build index 289b81ce8..5101652af 100644 --- a/examples/qos_sched/meson.build +++ b/examples/qos_sched/meson.build @@ -7,6 +7,7 @@ # DPDK instance, use 'make' deps += ['sched', 'cfgfile'] +allow_experimental_apis = true sources = files( 'app_thread.c', 'args.c', 'cfg_file.c', 'cmdline.c', 'init.c', 'main.c', 'stats.c' diff --git a/examples/quota_watermark/qw/Makefile b/examples/quota_watermark/qw/Makefile index 3f10f01c3..e06f4482b 100644 --- a/examples/quota_watermark/qw/Makefile +++ b/examples/quota_watermark/qw/Makefile @@ -18,5 +18,6 @@ SRCS-y := args.c init.c main.c CFLAGS += -O3 -DQW_SOFTWARE_FC CFLAGS += $(WERROR_FLAGS) +CFLAGS += -DALLOW_EXPERIMENTAL_API include $(RTE_SDK)/mk/rte.extapp.mk diff --git a/examples/quota_watermark/qw/init.c b/examples/quota_watermark/qw/init.c index 5a0f64f45..4f4e38fff 100644 --- a/examples/quota_watermark/qw/init.c +++ b/examples/quota_watermark/qw/init.c @@ -96,6 +96,7 @@ void configure_eth_port(uint16_t port_id) "Failed to setup hardware flow control on port %u (error %d)\n", (unsigned int) port_id, ret); + rte_eth_dev_set_supported_ptypes(port_id, 0); /* Start the port */ ret = rte_eth_dev_start(port_id); if (ret < 0) diff --git a/examples/rxtx_callbacks/main.c b/examples/rxtx_callbacks/main.c index dbcd9f4fc..ec550d4e4 100644 --- a/examples/rxtx_callbacks/main.c +++ b/examples/rxtx_callbacks/main.c @@ -152,6 +152,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool) return retval; } + rte_eth_dev_set_supported_ptypes(port, 0); retval = rte_eth_dev_start(port); if (retval < 0) return retval; diff --git a/examples/server_node_efd/server/Makefile b/examples/server_node_efd/server/Makefile index 4837bd3ea..acbd12ae2 100644 --- a/examples/server_node_efd/server/Makefile +++ b/examples/server_node_efd/server/Makefile @@ -25,5 +25,6 @@ INC := $(sort $(wildcard *.h)) CFLAGS += $(WERROR_FLAGS) -O3 CFLAGS += -I$(SRCDIR)/../shared +CFLAGS += -DALLOW_EXPERIMENTAL_API include $(RTE_SDK)/mk/rte.extapp.mk diff --git a/examples/server_node_efd/server/init.c b/examples/server_node_efd/server/init.c index af5a18e28..a584d6750 100644 --- a/examples/server_node_efd/server/init.c +++ b/examples/server_node_efd/server/init.c @@ -149,6 +149,7 @@ init_port(uint16_t port_num) rte_eth_promiscuous_enable(port_num); + rte_eth_dev_set_supported_ptypes(port_num, 0); retval = rte_eth_dev_start(port_num); if (retval < 0) return retval; diff --git a/examples/skeleton/Makefile b/examples/skeleton/Makefile index c5ac26029..0037d6b25 100644 --- a/examples/skeleton/Makefile +++ b/examples/skeleton/Makefile @@ -50,6 +50,7 @@ RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.conf include $(RTE_SDK)/mk/rte.vars.mk CFLAGS += $(WERROR_FLAGS) +CFLAGS += -DALLOW_EXPERIMENTAL_API # workaround for a gcc bug with noreturn attribute # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603 diff --git a/examples/skeleton/basicfwd.c b/examples/skeleton/basicfwd.c index a8a8e98f0..0d3d397f0 100644 --- a/examples/skeleton/basicfwd.c +++ b/examples/skeleton/basicfwd.c @@ -76,6 +76,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool) return retval; } + rte_eth_dev_set_supported_ptypes(port, 0); /* Start the Ethernet port. */ retval = rte_eth_dev_start(port); if (retval < 0) diff --git a/examples/skeleton/meson.build b/examples/skeleton/meson.build index 9bb9ec329..ef46b187e 100644 --- a/examples/skeleton/meson.build +++ b/examples/skeleton/meson.build @@ -6,6 +6,7 @@ # To build this example as a standalone application with an already-installed # DPDK instance, use 'make' +allow_experimental_apis = true sources = files( 'basicfwd.c' ) diff --git a/examples/tep_termination/Makefile b/examples/tep_termination/Makefile index 31165bd92..586838676 100644 --- a/examples/tep_termination/Makefile +++ b/examples/tep_termination/Makefile @@ -61,6 +61,7 @@ endif CFLAGS += -O3 CFLAGS += $(WERROR_FLAGS) CFLAGS += -Wno-deprecated-declarations +CFLAGS += -DALLOW_EXPERIMENTAL_API include $(RTE_SDK)/mk/rte.extapp.mk endif diff --git a/examples/tep_termination/meson.build b/examples/tep_termination/meson.build index f65d68980..f40b1c0b8 100644 --- a/examples/tep_termination/meson.build +++ b/examples/tep_termination/meson.build @@ -11,6 +11,7 @@ if not is_linux endif deps += ['hash', 'vhost'] cflags += '-Wno-deprecated-declarations' +allow_experimental_apis = true sources = files( 'main.c', 'vxlan.c', 'vxlan_setup.c' ) diff --git a/examples/tep_termination/vxlan_setup.c b/examples/tep_termination/vxlan_setup.c index 9a0880002..fc8c2d5fa 100644 --- a/examples/tep_termination/vxlan_setup.c +++ b/examples/tep_termination/vxlan_setup.c @@ -167,6 +167,7 @@ vxlan_port_init(uint16_t port, struct rte_mempool *mbuf_pool) return retval; } + rte_eth_dev_set_supported_ptypes(port, 0); /* Start the device. */ retval = rte_eth_dev_start(port); if (retval < 0) diff --git a/examples/vhost/Makefile b/examples/vhost/Makefile index f84b7f017..7722e81c7 100644 --- a/examples/vhost/Makefile +++ b/examples/vhost/Makefile @@ -62,6 +62,7 @@ else CFLAGS += -DALLOW_EXPERIMENTAL_API CFLAGS += -O2 -D_FILE_OFFSET_BITS=64 CFLAGS += $(WERROR_FLAGS) +CFLAGS += -DALLOW_EXPERIMENTAL_API include $(RTE_SDK)/mk/rte.extapp.mk diff --git a/examples/vhost/main.c b/examples/vhost/main.c index 0961db080..fce61d9ed 100644 --- a/examples/vhost/main.c +++ b/examples/vhost/main.c @@ -321,6 +321,7 @@ port_init(uint16_t port) } } + rte_eth_dev_set_supported_ptypes(port, 0); /* Start the device. */ retval = rte_eth_dev_start(port); if (retval < 0) { diff --git a/examples/vm_power_manager/Makefile b/examples/vm_power_manager/Makefile index 2fdb991d7..65c2ad179 100644 --- a/examples/vm_power_manager/Makefile +++ b/examples/vm_power_manager/Makefile @@ -28,6 +28,7 @@ endif CFLAGS += -O3 -I$(RTE_SDK)/lib/librte_power/ CFLAGS += $(WERROR_FLAGS) +CFLAGS += -DALLOW_EXPERIMENTAL_API LDLIBS += -lvirt diff --git a/examples/vm_power_manager/main.c b/examples/vm_power_manager/main.c index 54c704610..b5ad0d96b 100644 --- a/examples/vm_power_manager/main.c +++ b/examples/vm_power_manager/main.c @@ -99,6 +99,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool) return retval; } + rte_eth_dev_set_supported_ptypes(port, 0); /* Start the Ethernet port. */ retval = rte_eth_dev_start(port); if (retval < 0) diff --git a/examples/vm_power_manager/meson.build b/examples/vm_power_manager/meson.build index 20a4a05b3..54e2b584f 100644 --- a/examples/vm_power_manager/meson.build +++ b/examples/vm_power_manager/meson.build @@ -25,6 +25,7 @@ if dpdk_conf.has('RTE_LIBRTE_IXGBE_PMD') deps += ['pmd_ixgbe'] endif +allow_experimental_apis = true sources = files( 'channel_manager.c', 'channel_monitor.c', 'main.c', 'parse.c', 'power_manager.c', 'vm_power_cli.c' ) diff --git a/examples/vmdq/Makefile b/examples/vmdq/Makefile index 1557ee86b..2168747cc 100644 --- a/examples/vmdq/Makefile +++ b/examples/vmdq/Makefile @@ -50,6 +50,7 @@ RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.conf include $(RTE_SDK)/mk/rte.vars.mk CFLAGS += $(WERROR_FLAGS) +CFLAGS += -DALLOW_EXPERIMENTAL_API EXTRA_CFLAGS += -O3 diff --git a/examples/vmdq/main.c b/examples/vmdq/main.c index 7281ffd7f..675faaf17 100644 --- a/examples/vmdq/main.c +++ b/examples/vmdq/main.c @@ -258,6 +258,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool) } } + rte_eth_dev_set_supported_ptypes(port, 0); retval = rte_eth_dev_start(port); if (retval < 0) { printf("port %d start failed\n", port); diff --git a/examples/vmdq/meson.build b/examples/vmdq/meson.build index c34e11e36..2b0a25036 100644 --- a/examples/vmdq/meson.build +++ b/examples/vmdq/meson.build @@ -6,6 +6,7 @@ # To build this example as a standalone application with an already-installed # DPDK instance, use 'make' +allow_experimental_apis = true sources = files( 'main.c' ) diff --git a/examples/vmdq_dcb/Makefile b/examples/vmdq_dcb/Makefile index 391096cfb..ea1574d91 100644 --- a/examples/vmdq_dcb/Makefile +++ b/examples/vmdq_dcb/Makefile @@ -50,6 +50,7 @@ RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.conf include $(RTE_SDK)/mk/rte.vars.mk CFLAGS += $(WERROR_FLAGS) +CFLAGS += -DALLOW_EXPERIMENTAL_API # workaround for a gcc bug with noreturn attribute # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603 diff --git a/examples/vmdq_dcb/main.c b/examples/vmdq_dcb/main.c index 389000327..3300e0a1f 100644 --- a/examples/vmdq_dcb/main.c +++ b/examples/vmdq_dcb/main.c @@ -313,6 +313,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool) } } + rte_eth_dev_set_supported_ptypes(port, 0); retval = rte_eth_dev_start(port); if (retval < 0) { printf("port %d start failed\n", port); diff --git a/examples/vmdq_dcb/meson.build b/examples/vmdq_dcb/meson.build index c34e11e36..2b0a25036 100644 --- a/examples/vmdq_dcb/meson.build +++ b/examples/vmdq_dcb/meson.build @@ -6,6 +6,7 @@ # To build this example as a standalone application with an already-installed # DPDK instance, use 'make' +allow_experimental_apis = true sources = files( 'main.c' )