From patchwork Thu Oct 10 10:51:23 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: 60875 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 1A0D01E994; Thu, 10 Oct 2019 12:51:44 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 80AD61E986 for ; Thu, 10 Oct 2019 12:51:38 +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 x9AAoWMt007654; Thu, 10 Oct 2019 03:51:37 -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=k8F490i308AhPfPdMBxuc9MnjMcjvi+TkWjF+LJ7X1I=; b=hobPh8x2Y4ijvL08GQxIfoW+O/AgA3UNiUvnNk1eKFw9ggDbbv8W3ohIgAKKN0nR3AQP PT+p1j3jIRtX9Ek5JQ8BHbaU3KrRKE8VAovPA/+qZ2frLWWl/KYDMDXGkZnnwxc9iweN ryMRyq+l5BKIduTAoVoTbAdOZ2XR4nFRzZNOPOgs1Dp1oaAhwWoFwLtKw956jQrpwvI5 ENndThqDIvT2et1mCJe27bPXzFHwo9FylRjP8bH5elyghbfCoYooQ5t3sC24llm7cKJ4 HnyEp7pigDv6xCspKnnspK0wz6qiX6QzcQ1S5W6+tP1tOehx3MpaUUDOzjxc4b4VNjYi Og== Received: from sc-exch01.marvell.com ([199.233.58.181]) by mx0a-0016f401.pphosted.com with ESMTP id 2vh5rqphgf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 10 Oct 2019 03:51:37 -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; Thu, 10 Oct 2019 03:51:35 -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; Thu, 10 Oct 2019 03:51:36 -0700 Received: from BG-LT7430.marvell.com (bg-lt7430.marvell.com [10.28.10.255]) by maili.marvell.com (Postfix) with ESMTP id AB4093F703F; Thu, 10 Oct 2019 03:51:33 -0700 (PDT) From: To: , , John McNamara , Marko Kovacevic , Thomas Monjalon , Ferruh Yigit CC: , Pavan Nikhilesh Date: Thu, 10 Oct 2019 16:21:23 +0530 Message-ID: <20191010105130.3382-2-pbhagavatula@marvell.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191010105130.3382-1-pbhagavatula@marvell.com> References: <20191009153357.926-1-pbhagavatula@marvell.com> <20191010105130.3382-1-pbhagavatula@marvell.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,1.0.8 definitions=2019-10-10_04:2019-10-10,2019-10-10 signatures=0 Subject: [dpdk-dev] [PATCH v11 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, NULL, 0)` and PMD may skip packet type processing and set rte_mbuf::packet_type to RTE_PTYPE_UNKNOWN. -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, NULL, 0)`. Suggested-by: Konstantin Ananyev Signed-off-by: Pavan Nikhilesh Reviewed-by: Andrew Rybchenko --- doc/guides/nics/features.rst | 8 ++- doc/guides/rel_notes/release_19_11.rst | 8 +++ lib/librte_ethdev/rte_ethdev.c | 86 ++++++++++++++++++++++++ lib/librte_ethdev/rte_ethdev.h | 37 ++++++++++ lib/librte_ethdev/rte_ethdev_core.h | 19 ++++++ lib/librte_ethdev/rte_ethdev_version.map | 3 + 6 files changed, 159 insertions(+), 2 deletions(-) diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst index c4e128d2f..1756fa73a 100644 --- a/doc/guides/nics/features.rst +++ b/doc/guides/nics/features.rst @@ -583,9 +583,13 @@ Packet type parsing ------------------- 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``. -* **[related] API**: ``rte_eth_dev_get_supported_ptypes()``. +* **[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 02fc8fbd3..39b191117 100644 --- a/doc/guides/rel_notes/release_19_11.rst +++ b/doc/guides/rel_notes/release_19_11.rst @@ -85,6 +85,14 @@ New Features Added stateful decompression support in the Intel QuickAssist Technology PMD. Please note that stateful compression is not supported. +* **Added ethdev API to set supported packet types** + + * Added new API ``rte_eth_dev_set_supported_ptypes`` that allows an + application to inform PMD about packet types classification the application + is interested in + * 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 30b0c7803..30b873389 100644 --- a/lib/librte_ethdev/rte_ethdev.c +++ b/lib/librte_ethdev/rte_ethdev.c @@ -2619,6 +2619,92 @@ rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask, return j; } +int +rte_eth_dev_set_supported_ptypes(uint16_t port_id, uint32_t ptype_mask, + uint32_t *set_ptypes, unsigned int num) +{ + const uint32_t valid_ptype_masks[] = { + RTE_PTYPE_L2_MASK, + RTE_PTYPE_L3_MASK, + RTE_PTYPE_L4_MASK, + RTE_PTYPE_TUNNEL_MASK, + RTE_PTYPE_INNER_L2_MASK, + RTE_PTYPE_INNER_L3_MASK, + RTE_PTYPE_INNER_L4_MASK, + }; + const uint32_t *all_ptypes; + struct rte_eth_dev *dev; + uint32_t unused_mask; + unsigned int i, j; + int ret; + + RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); + dev = &rte_eth_devices[port_id]; + + if (num > 0 && set_ptypes == NULL) + return -EINVAL; + + if (*dev->dev_ops->dev_supported_ptypes_get == NULL || + *dev->dev_ops->dev_supported_ptypes_set == NULL) { + ret = 0; + goto ptype_unknown; + } + + if (ptype_mask == 0) { + ret = (*dev->dev_ops->dev_supported_ptypes_set)(dev, + ptype_mask); + goto ptype_unknown; + } + + unused_mask = ptype_mask; + for (i = 0; i < RTE_DIM(valid_ptype_masks); i++) { + uint32_t mask = ptype_mask & valid_ptype_masks[i]; + if (mask && mask != valid_ptype_masks[i]) { + ret = -EINVAL; + goto ptype_unknown; + } + unused_mask &= ~valid_ptype_masks[i]; + } + + if (unused_mask) { + ret = -EINVAL; + goto ptype_unknown; + } + + all_ptypes = (*dev->dev_ops->dev_supported_ptypes_get)(dev); + if (all_ptypes == NULL) { + ret = 0; + goto ptype_unknown; + } + + /* + * Accodommodate as many set_ptypes as possible. If the supplied + * set_ptypes array is insufficient fill it partially. + */ + for (i = 0, j = 0; set_ptypes != NULL && + (all_ptypes[i] != RTE_PTYPE_UNKNOWN); ++i) { + if (ptype_mask & all_ptypes[i]) { + if (j < num - 1) { + set_ptypes[j] = all_ptypes[i]; + j++; + continue; + } + break; + } + } + + if (set_ptypes != NULL && j < num) + set_ptypes[j] = RTE_PTYPE_UNKNOWN; + + return (*dev->dev_ops->dev_supported_ptypes_set)(dev, ptype_mask); + +ptype_unknown: + if (num > 0) + set_ptypes[0] = RTE_PTYPE_UNKNOWN; + + return ret; +} + 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 475dbdae1..8247b37f6 100644 --- a/lib/librte_ethdev/rte_ethdev.h +++ b/lib/librte_ethdev/rte_ethdev.h @@ -2435,6 +2435,43 @@ 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); +/** + * @warning + * @b EXPERIMENTAL: this API may change without prior notice. + * + * Inform Ethernet device of the packet types classification the recipient is + * interested in. + * + * 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. + * + * The function accepts an array `set_ptypes` allocated by the caller to + * store the packet types set by the driver, the last element of the array + * is set to RTE_PTYPE_UNKNOWN. The size of the `set_ptype` array should be + * `rte_eth_dev_get_supported_ptypes() + 1` else it might only be filled + * partially. + * + * @param port_id + * The port identifier of the Ethernet device. + * @param ptype_mask + * The ptype family that application is interested in should be bitwise OR of + * RTE_PTYPE_*_MASK or 0. + * @param set_ptypes + * An array pointer to store set packet types, allocated by caller. The + * function marks the end of array with RTE_PTYPE_UNKNOWN. + * @param num + * Size of the array pointed by param ptypes. + * Should be rte_eth_dev_get_supported_ptypes() + 1 to accommodate the + * set ptypes. + * @return + * - (0) if Success. + * - (-ENODEV) if *port_id* invalid. + * - (-EINVAL) if *ptype_mask* is invalid (or) set_ptypes is NULL and + * num > 0. + */ +__rte_experimental +int rte_eth_dev_set_supported_ptypes(uint16_t port_id, uint32_t ptype_mask, + uint32_t *set_ptypes, unsigned int num); /** * 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 2394b32c8..37bb57247 100644 --- a/lib/librte_ethdev/rte_ethdev_core.h +++ b/lib/librte_ethdev/rte_ethdev_core.h @@ -110,6 +110,23 @@ typedef int (*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. */ +/** + * @internal + * Inform an Ethernet device about packet types classifications the recipient + * is interested in. + * + * @param dev + * The Ethernet device identifier. + * @param ptype_mask + * The ptype family that application is interested in should be bitwise OR of + * RTE_PTYPE_*_MASK or 0. + * @return + * - (0) if Success. + * - (-EINVAL) if *ptype_mask* is invalid. + */ +typedef int (*eth_dev_supported_ptypes_set_t)(struct rte_eth_dev *dev, + uint32_t ptype_mask); + 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 +438,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 Ethernet device about packet types the recipient is interested in. */ 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 Thu Oct 10 10:51:24 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: 60876 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 6410E1E99D; Thu, 10 Oct 2019 12:51:46 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id DAAFC1E993 for ; Thu, 10 Oct 2019 12:51: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 x9AAnwSN007183; Thu, 10 Oct 2019 03:51:41 -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=pzLbDtsON5brznlncTldrrRcPanE5ahNiOKuQ0f+isQ=; b=aGCGgWdaiW0B46uCpCeSAQkqPQ6RZ0L5yqpG6L61Bznu4lFedAKL9T129GUJ/vr0qSRw /VOUtmJD1UaPSOhSNYiaHjCG3ZWLqARtHfR1DXlJ2fBLDCTU98B51qagbLh066gZI5br Ant/HFx3MC+FDijilbIO7fBypMo5l4j9NFLO8PAzZ50h68zQYbHVk55S3XLgfOq4f3wP 1Wfq0ET/K39bDzBszS0b9b8Hw+yGVGm87LmM9u4A1N/T0ngoA5tnNDzuYDmYFSPFMPU2 yRWP7j5M5Rr3K6LNdiMO7Lm1JfAp+/geh1aDGKeUHZziA4we3s3xRWoHXL6uS3efQVAX nQ== Received: from sc-exch01.marvell.com ([199.233.58.181]) by mx0b-0016f401.pphosted.com with ESMTP id 2vhdxbvjhp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 10 Oct 2019 03:51:41 -0700 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Thu, 10 Oct 2019 03:51:39 -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; Thu, 10 Oct 2019 03:51:39 -0700 Received: from BG-LT7430.marvell.com (bg-lt7430.marvell.com [10.28.10.255]) by maili.marvell.com (Postfix) with ESMTP id DC4A53F7040; Thu, 10 Oct 2019 03:51:36 -0700 (PDT) From: To: , , John McNamara , Marko Kovacevic , Thomas Monjalon , Ferruh Yigit CC: , Pavan Nikhilesh Date: Thu, 10 Oct 2019 16:21:24 +0530 Message-ID: <20191010105130.3382-3-pbhagavatula@marvell.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191010105130.3382-1-pbhagavatula@marvell.com> References: <20191009153357.926-1-pbhagavatula@marvell.com> <20191010105130.3382-1-pbhagavatula@marvell.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,1.0.8 definitions=2019-10-10_04:2019-10-10,2019-10-10 signatures=0 Subject: [dpdk-dev] [PATCH v11 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 ++ doc/guides/rel_notes/release_19_11.rst | 7 +++++++ lib/librte_ethdev/rte_ethdev.c | 1 + lib/librte_ethdev/rte_ethdev.h | 1 + 4 files changed, 11 insertions(+) diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst index 1756fa73a..f7c6d918f 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/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst index 39b191117..9cf61a748 100644 --- a/doc/guides/rel_notes/release_19_11.rst +++ b/doc/guides/rel_notes/release_19_11.rst @@ -93,6 +93,13 @@ New Features * This scheme will allow PMDs to avoid lookup to internal ptype table on Rx and thereby improve Rx performance if application wishes do so. +* **Added Rx offload flag to enable or disable RSS update** + + * Added 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 application + by enabling `PKT_RX_RSS_HASH ` flag in `rte_mbuf::ol_flags`. + Removed Items ------------- diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c index 30b873389..116478d46 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 8247b37f6..fb696baed 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 Thu Oct 10 10:51:25 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: 60877 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 1C14E1E9AA; Thu, 10 Oct 2019 12:51:51 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 60DF31E984 for ; Thu, 10 Oct 2019 12:51:45 +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 x9AAnuPd007164; Thu, 10 Oct 2019 03:51: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=yZ0RhZKSZVo9kQyR5ErzoqqIEJPs4aTrcV+uSpY3FrY=; b=nYg9YIw3/WZa3UN+2NeYvt2z39/cjTl95cqz8EyTm0pY2dfRV3kY5noxZq71tZgYJpZo 6US9HTRK3rSISqfkoo3N5VOSuYVPcUxt37DFDCZ18Bt7dVMV2Co2Qwn5AHU1uGCBZWbu Hjk8z7xao53zPKFtCgOSLXobXJjE8CuoScMBGjfce1naXXLPuduKcEiR+QQ1S1f8w2zm xFPkfg6Vs8E+hiONyUQEfBqsO+VkulikcMbCLh5AmKz5NaCRaX9q1WCUU4SETRxP6/Yj Q5pig7LI2Jo8Iz9TXShWKTiBkj/1N57waDGbL1pfN42/QXdJyviyI0RCBfKT8BW3L226 iA== Received: from sc-exch03.marvell.com ([199.233.58.183]) by mx0b-0016f401.pphosted.com with ESMTP id 2vhdxbvjhw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 10 Oct 2019 03:51:44 -0700 Received: from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Thu, 10 Oct 2019 03:51:42 -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; Thu, 10 Oct 2019 03:51:42 -0700 Received: from BG-LT7430.marvell.com (bg-lt7430.marvell.com [10.28.10.255]) by maili.marvell.com (Postfix) with ESMTP id 1FA0A3F7040; Thu, 10 Oct 2019 03:51:39 -0700 (PDT) From: To: , , John McNamara , Marko Kovacevic , Thomas Monjalon , Ferruh Yigit , Adrien Mazarguil CC: , Pavan Nikhilesh Date: Thu, 10 Oct 2019 16:21:25 +0530 Message-ID: <20191010105130.3382-4-pbhagavatula@marvell.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191010105130.3382-1-pbhagavatula@marvell.com> References: <20191009153357.926-1-pbhagavatula@marvell.com> <20191010105130.3382-1-pbhagavatula@marvell.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,1.0.8 definitions=2019-10-10_04:2019-10-10,2019-10-10 signatures=0 Subject: [dpdk-dev] [PATCH v11 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 ++++++++++++ doc/guides/rel_notes/release_19_11.rst | 9 +++++++++ lib/librte_ethdev/rte_ethdev.c | 1 + lib/librte_ethdev/rte_ethdev.h | 1 + lib/librte_ethdev/rte_flow.h | 6 ++++-- 5 files changed, 27 insertions(+), 2 deletions(-) diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst index f7c6d918f..9737ff7a1 100644 --- a/doc/guides/nics/features.rst +++ b/doc/guides/nics/features.rst @@ -594,6 +594,18 @@ Allows 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/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst index 9cf61a748..33d4f428d 100644 --- a/doc/guides/rel_notes/release_19_11.rst +++ b/doc/guides/rel_notes/release_19_11.rst @@ -100,6 +100,15 @@ New Features * PMDs notify the validity of `rte_mbuf::hash:rss` to the application by enabling `PKT_RX_RSS_HASH ` flag in `rte_mbuf::ol_flags`. +* **Added Rx offload flag to enable or disable flow action type update** + + * 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 application + by enabling `PKT_RX_FDIR_ID` flag in `rte_mbuf::ol_flags`. + Removed Items ------------- diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c index 116478d46..5b1800f00 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 fb696baed..39e84358e 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 354cb1dd0..5d62686c0 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 enabled. * * 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 enabled. * * No associated configuration structure. */ From patchwork Thu Oct 10 10:51:26 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: 60880 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 E4B711E9C9; Thu, 10 Oct 2019 12:52:11 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id E49B51E9C9 for ; Thu, 10 Oct 2019 12:52:09 +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 x9AAotkq007930; Thu, 10 Oct 2019 03:51:55 -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=iGYKLEmqmjroefP8OQBi5ytKWs+EQkkWB0wFsqQajB4=; b=ij9Vaw97G9QH8DW7tKnKDkAMVjmmXFJPx242dRuDNM4kjxFl1sOSACwqz9tteOkGMS/B 5xbSMLXNs6EYNtkOR3RmCkloDTq3H8vgeZBSQBHPXaPUQjHUWImLBkcnHYnDrbXxeu8E TsygF4LlJYA/YhyBQt78z2u1BA4QLCVLxOQlQumvAXXS74fBYUjCsUUoCY5zkq7ePGOU Puj9i6i9mZZS4jGpaG55pJqlkepjSNZ5xSS7T0whIpOiEeVo984Dnur22bdgSkBnWWkx DOvri7nNORS88TInIpDfnulMX13XHQ3hsv9alTuLyVq7E6EeBQYldkZyfVcmyM8j0uDM vA== Received: from sc-exch04.marvell.com ([199.233.58.184]) by mx0b-0016f401.pphosted.com with ESMTP id 2vhdxbvjja-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 10 Oct 2019 03:51:54 -0700 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Thu, 10 Oct 2019 03:51:52 -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; Thu, 10 Oct 2019 03:51:52 -0700 Received: from BG-LT7430.marvell.com (bg-lt7430.marvell.com [10.28.10.255]) by maili.marvell.com (Postfix) with ESMTP id BB1C33F7040; Thu, 10 Oct 2019 03:51:43 -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 , "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, 10 Oct 2019 16:21:26 +0530 Message-ID: <20191010105130.3382-5-pbhagavatula@marvell.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191010105130.3382-1-pbhagavatula@marvell.com> References: <20191009153357.926-1-pbhagavatula@marvell.com> <20191010105130.3382-1-pbhagavatula@marvell.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,1.0.8 definitions=2019-10-10_04:2019-10-10,2019-10-10 signatures=0 Subject: [dpdk-dev] [PATCH v11 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 Reviewed-by: Andrew Rybchenko Reviewed-by: Hemant Agrawal 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 b521a7296..034814a35 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 25deadb94..7ba4c0e53 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 879bbc120..be02646d7 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 8cb7337ea..27b4850e3 100644 --- a/drivers/net/fm10k/fm10k_ethdev.c +++ b/drivers/net/fm10k/fm10k_ethdev.c @@ -1799,7 +1799,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 17a3625d6..83ed6a98e 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 390cb2196..62ae976cd 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 99b1f43b8..bae807ceb 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 3214ed601..df30a975e 100644 --- a/drivers/net/ice/ice_ethdev.c +++ b/drivers/net/ice/ice_ethdev.c @@ -2275,7 +2275,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 d97e357e3..4a1bce58f 100644 --- a/drivers/net/liquidio/lio_ethdev.c +++ b/drivers/net/liquidio/lio_ethdev.c @@ -407,7 +407,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 3d5b99c94..d92fbb169 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 5de0a1d4d..81cce03bf 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 d2e3d36d6..509cc2f0e 100644 --- a/drivers/net/qede/qede_ethdev.c +++ b/drivers/net/qede/qede_ethdev.c @@ -1288,7 +1288,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 3ed34f825..5ebe3f6a5 100644 --- a/drivers/net/vmxnet3/vmxnet3_ethdev.c +++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c @@ -56,7 +56,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 Thu Oct 10 10:51:27 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: 60878 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 88D3C1E9B3; Thu, 10 Oct 2019 12:52:03 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 106551E9A5 for ; Thu, 10 Oct 2019 12:52:01 +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 x9AAoYE7007688; Thu, 10 Oct 2019 03:51:59 -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=GW8VrRA3iPTQtN4Q33xorzOI8wEot3ih6wS+mqy4nlw=; b=k8AQttFxQqhz+FBUsWDVnUk39Id9I6HX8rTudQdvJwVaCN6LGiAQi38r3S1gEMpfiWGU acE7bJ69xvyhgWQB21ggb01V8uJ2Mp3KfWhiynQQlqfihClC1+j3SMnWAj/VeqkBHsGv zK+UIrCnw+ycZTUH6DRTWg4a+d4mcJfiSptv4Scmv2UJodyfUwGynRtv77ZygnQM5fT+ +UOTzOEpsTQ3PXkH+RheSBAzOC0BUflssRlhDbpKVuInCS2FwkYb281+Z4lzZsRKyZDE W+45WicIoSIWngug82xBmqxwD8XteEqawWbXE/4Vt07TT0Z4cibvwwbE+R2gXafRgmN5 Pw== Received: from sc-exch02.marvell.com ([199.233.58.182]) by mx0a-0016f401.pphosted.com with ESMTP id 2vh5rqphhq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 10 Oct 2019 03:51:59 -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; Thu, 10 Oct 2019 03:51:58 -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; Thu, 10 Oct 2019 03:51:58 -0700 Received: from BG-LT7430.marvell.com (bg-lt7430.marvell.com [10.28.10.255]) by maili.marvell.com (Postfix) with ESMTP id 9CBFF3F7040; Thu, 10 Oct 2019 03:51:53 -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 , Matan Azrad , Shahaf Shuler , Viacheslav Ovsiienko , Nithin Dabilpuram , Kiran Kumar K CC: , Pavan Nikhilesh Date: Thu, 10 Oct 2019 16:21:27 +0530 Message-ID: <20191010105130.3382-6-pbhagavatula@marvell.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191010105130.3382-1-pbhagavatula@marvell.com> References: <20191009153357.926-1-pbhagavatula@marvell.com> <20191010105130.3382-1-pbhagavatula@marvell.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,1.0.8 definitions=2019-10-10_04:2019-10-10,2019-10-10 signatures=0 Subject: [dpdk-dev] [PATCH v11 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 Reviewed-by: Andrew Rybchenko Acked-by: Jerin Jacob --- 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.c | 9 ++------- drivers/net/octeontx2/otx2_flow.h | 1 - drivers/net/octeontx2/otx2_flow_parse.c | 5 +---- drivers/net/sfc/sfc_ef10_essb_rx.c | 3 ++- 12 files changed, 21 insertions(+), 21 deletions(-) diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index 034814a35..924bdda00 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 62ae976cd..c23a245f7 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 bae807ceb..6680b1948 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 df30a975e..8f8b1852d 100644 --- a/drivers/net/ice/ice_ethdev.c +++ b/drivers/net/ice/ice_ethdev.c @@ -2276,7 +2276,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 81cce03bf..7884153ce 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.c b/drivers/net/octeontx2/otx2_flow.c index bdbf123a9..ea4e380b1 100644 --- a/drivers/net/octeontx2/otx2_flow.c +++ b/drivers/net/octeontx2/otx2_flow.c @@ -524,11 +524,8 @@ otx2_flow_destroy(struct rte_eth_dev *dev, NIX_RX_ACT_MATCH_MASK; if (match_id && match_id < OTX2_FLOW_ACTION_FLAG_DEFAULT) { - if (rte_atomic32_read(&npc->mark_actions) == 0) - return -EINVAL; - - /* Clear mark offload flag if there are no more mark actions */ - if (rte_atomic32_sub_return(&npc->mark_actions, 1) == 0) { + /* Clear mark offload flag if there is no more mark action */ + if (hw->rx_offloads & DEV_RX_OFFLOAD_FLOW_MARK) { hw->rx_offload_flags &= ~NIX_RX_OFFLOAD_MARK_UPDATE_F; otx2_eth_set_rx_function(dev); } @@ -821,8 +818,6 @@ otx2_flow_init(struct otx2_eth_dev *hw) return rc; } - rte_atomic32_init(&npc->mark_actions); - npc->mcam_entries = NPC_MCAM_TOT_ENTRIES >> npc->keyw[NPC_MCAM_RX]; /* Free, free_rev, live and live_rev entries */ bmap_sz = rte_bitmap_get_memory_footprint(npc->mcam_entries); diff --git a/drivers/net/octeontx2/otx2_flow.h b/drivers/net/octeontx2/otx2_flow.h index ab068b088..85129cc9d 100644 --- a/drivers/net/octeontx2/otx2_flow.h +++ b/drivers/net/octeontx2/otx2_flow.h @@ -160,7 +160,6 @@ TAILQ_HEAD(otx2_flow_list, rte_flow); /* Accessed from ethdev private - otx2_eth_dev */ struct otx2_npc_flow_info { - rte_atomic32_t mark_actions; uint32_t keyx_supp_nmask[NPC_MAX_INTF];/* nibble mask */ uint32_t keyx_len[NPC_MAX_INTF]; /* per intf key len in bits */ uint32_t datax_len[NPC_MAX_INTF]; /* per intf data len in bits */ diff --git a/drivers/net/octeontx2/otx2_flow_parse.c b/drivers/net/octeontx2/otx2_flow_parse.c index 6670c1a70..541479445 100644 --- a/drivers/net/octeontx2/otx2_flow_parse.c +++ b/drivers/net/octeontx2/otx2_flow_parse.c @@ -761,7 +761,6 @@ otx2_flow_parse_actions(struct rte_eth_dev *dev, struct rte_flow *flow) { struct otx2_eth_dev *hw = dev->data->dev_private; - struct otx2_npc_flow_info *npc = &hw->npc_flow; const struct rte_flow_action_count *act_count; const struct rte_flow_action_mark *act_mark; const struct rte_flow_action_queue *act_q; @@ -795,13 +794,11 @@ otx2_flow_parse_actions(struct rte_eth_dev *dev, } mark = act_mark->id + 1; req_act |= OTX2_FLOW_ACT_MARK; - rte_atomic32_inc(&npc->mark_actions); break; case RTE_FLOW_ACTION_TYPE_FLAG: mark = OTX2_FLOW_FLAG_VAL; req_act |= OTX2_FLOW_ACT_FLAG; - rte_atomic32_inc(&npc->mark_actions); break; case RTE_FLOW_ACTION_TYPE_COUNT: @@ -979,7 +976,7 @@ 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 (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, From patchwork Thu Oct 10 10:51:28 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: 60879 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 25D831E9B4; Thu, 10 Oct 2019 12:52:07 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 9165B1E9B4 for ; Thu, 10 Oct 2019 12:52:03 +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 x9AAoIin007564; Thu, 10 Oct 2019 03:52:02 -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=B8VAHaxhXBMlfBTWt3V9hekLomuQYAYlUzDqVubOI/E=; b=wsbU6MEErKiMitXmku0SxSf4bRqE1m8JS3HCRm6+TtIRWOMPAdT/iE34SSHN/ymaT0fe KMYByzn9IHImiL2kGGuVeDPXzPw58z+CPdt9rl6z02C6n9E6aAMcFkifsBCXssZZrjiZ +1tgQPbuBQxG/C3bxm+cL6wBQNwi8q6nXGmutmuXs2nCp35NEDsFuPROF6jTAdFw/4FX ghc67SobbVy7uj5/2RAMglulgLPh4+WUQ2uJEXo/eYSYYVfaSmWseis+UKkPwwtQL75/ moMM4UzyNQIr2IJbRkgwyyCs+ZGU/faGWuysSbuEGYBGsRJkhdfXrCkUYDh2sSOyGtx7 lw== Received: from sc-exch04.marvell.com ([199.233.58.184]) by mx0a-0016f401.pphosted.com with ESMTP id 2vh5rqphhw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 10 Oct 2019 03:52:02 -0700 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Thu, 10 Oct 2019 03:52:01 -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; Thu, 10 Oct 2019 03:52:01 -0700 Received: from BG-LT7430.marvell.com (bg-lt7430.marvell.com [10.28.10.255]) by maili.marvell.com (Postfix) with ESMTP id 6CC233F7040; Thu, 10 Oct 2019 03:51:59 -0700 (PDT) From: To: , , Harry van Haaren CC: , Pavan Nikhilesh Date: Thu, 10 Oct 2019 16:21:28 +0530 Message-ID: <20191010105130.3382-7-pbhagavatula@marvell.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191010105130.3382-1-pbhagavatula@marvell.com> References: <20191009153357.926-1-pbhagavatula@marvell.com> <20191010105130.3382-1-pbhagavatula@marvell.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,1.0.8 definitions=2019-10-10_04:2019-10-10,2019-10-10 signatures=0 Subject: [dpdk-dev] [PATCH v11 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 --- examples/eventdev_pipeline/main.c | 120 ----------------- .../pipeline_worker_generic.c | 124 ++++++++++++++++++ .../eventdev_pipeline/pipeline_worker_tx.c | 120 +++++++++++++++++ 3 files changed, 244 insertions(+), 120 deletions(-) diff --git a/examples/eventdev_pipeline/main.c b/examples/eventdev_pipeline/main.c index 3789fbfd7..d3ff1bbe4 100644 --- a/examples/eventdev_pipeline/main.c +++ b/examples/eventdev_pipeline/main.c @@ -242,125 +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; - - retval = rte_eth_dev_info_get(port, &dev_info); - if (retval != 0) { - printf("Error during getting device (port %u) info: %s\n", - port, strerror(-retval)); - return retval; - } - - 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) { @@ -507,7 +388,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..6bc9203ec 100644 --- a/examples/eventdev_pipeline/pipeline_worker_generic.c +++ b/examples/eventdev_pipeline/pipeline_worker_generic.c @@ -271,6 +271,129 @@ 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; + + retval = rte_eth_dev_info_get(port, &dev_info); + if (retval != 0) { + printf("Error during getting device (port %u) info: %s\n", + port, strerror(-retval)); + return retval; + } + + 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 +420,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..03ff762b3 100644 --- a/examples/eventdev_pipeline/pipeline_worker_tx.c +++ b/examples/eventdev_pipeline/pipeline_worker_tx.c @@ -603,6 +603,125 @@ 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; + + retval = rte_eth_dev_info_get(port, &dev_info); + if (retval != 0) { + printf("Error during getting device (port %u) info: %s\n", + port, strerror(-retval)); + return retval; + } + + 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 +740,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 Thu Oct 10 10:51:29 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: 60881 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 8C0D11E9CF; Thu, 10 Oct 2019 12:52:15 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id A54141E9CF for ; Thu, 10 Oct 2019 12:52:13 +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 x9AAoDHo007487; Thu, 10 Oct 2019 03:52:11 -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=S6c4JEtKMy7FqNWj+s3QMzMjOZpoBLlv9KILe+hTDrg=; b=VGWGvIpVEpnUAXpjQlWof2N+YYMFhh21MArd0mQW9wl1GK2sAFvZfVcBG6R+mDTBwT5c amnPpf29gf8FCn1xfwq/zU6mPP+PnOTFIlie2dGgvB44rnZhR8IhTi76VHEfbSzWtAoG 1NHoJgrunBgvgr48/ibPsPPMNn2Hg6+WcfK0tRup5SHGqFrBgVA+VKivIhC5zRGsmcbA sQD0kpzIhPt3JWxb8JbtANMBFPMSXjkzeayYtMkvT/tUx3dRqzUpWAoqriV8JY2IHixS W5ht8vr0ftjs8vPkaqPxa/jobsn5WVzDxuev/9HMeNZSAg/jKwCIEZ/uwJua59zSdHd+ ig== Received: from sc-exch02.marvell.com ([199.233.58.182]) by mx0a-0016f401.pphosted.com with ESMTP id 2vh5rqphjs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 10 Oct 2019 03:52:11 -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; Thu, 10 Oct 2019 03:52:09 -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; Thu, 10 Oct 2019 03:52:09 -0700 Received: from BG-LT7430.marvell.com (bg-lt7430.marvell.com [10.28.10.255]) by maili.marvell.com (Postfix) with ESMTP id 42ADA3F7044; Thu, 10 Oct 2019 03:52:02 -0700 (PDT) From: To: , , Nicolas Chautru , Chas Williams , David Hunt , Harry van Haaren , "Marko Kovacevic" , Ori Kam , "Bruce Richardson" , 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 , Yipeng Wang , "Maxime Coquelin" , Tiwei Bie , Zhihong Wang CC: , Pavan Nikhilesh Date: Thu, 10 Oct 2019 16:21:29 +0530 Message-ID: <20191010105130.3382-8-pbhagavatula@marvell.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191010105130.3382-1-pbhagavatula@marvell.com> References: <20191009153357.926-1-pbhagavatula@marvell.com> <20191010105130.3382-1-pbhagavatula@marvell.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,1.0.8 definitions=2019-10-10_04:2019-10-10,2019-10-10 signatures=0 Subject: [dpdk-dev] [PATCH v11 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 | 2 ++ 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 | 2 ++ examples/ip_reassembly/meson.build | 1 + examples/ipsec-secgw/ipsec-secgw.c | 2 ++ examples/ipv4_multicast/Makefile | 1 + examples/ipv4_multicast/main.c | 2 ++ 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 | 2 ++ examples/l2fwd-jobstats/Makefile | 1 + examples/l2fwd-jobstats/main.c | 2 ++ examples/l2fwd-jobstats/meson.build | 1 + examples/l2fwd-keepalive/Makefile | 1 + examples/l2fwd-keepalive/main.c | 2 ++ examples/l2fwd-keepalive/meson.build | 1 + examples/l2fwd/Makefile | 1 + examples/l2fwd/main.c | 2 ++ examples/l2fwd/meson.build | 1 + examples/l3fwd-acl/Makefile | 1 + examples/l3fwd-acl/main.c | 2 ++ examples/l3fwd-acl/meson.build | 1 + examples/l3fwd-vf/Makefile | 1 + examples/l3fwd-vf/main.c | 2 ++ examples/l3fwd-vf/meson.build | 1 + examples/link_status_interrupt/Makefile | 1 + examples/link_status_interrupt/main.c | 2 ++ examples/link_status_interrupt/meson.build | 1 + examples/load_balancer/Makefile | 1 + examples/load_balancer/init.c | 2 ++ 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 + 82 files changed, 96 insertions(+) diff --git a/examples/bbdev_app/main.c b/examples/bbdev_app/main.c index 9acf666dc..277725a6b 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, RTE_PTYPE_UNKNOWN, NULL, 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 be62c1713..30c54c35c 100644 --- a/examples/bond/main.c +++ b/examples/bond/main.c @@ -200,6 +200,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, RTE_PTYPE_UNKNOWN, NULL, 0); retval = rte_eth_dev_start(portid); if (retval < 0) rte_exit(retval, @@ -281,6 +282,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, RTE_PTYPE_UNKNOWN, NULL, 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 8942f3607..c1f34908b 100644 --- a/examples/distributor/main.c +++ b/examples/distributor/main.c @@ -168,6 +168,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool) return retval; } + rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 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 d3ff1bbe4..4c7700795 100644 --- a/examples/eventdev_pipeline/main.c +++ b/examples/eventdev_pipeline/main.c @@ -392,6 +392,8 @@ main(int argc, char **argv) /* Start the Ethernet port. */ RTE_ETH_FOREACH_DEV(portid) { + rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN, + NULL, 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 d7f3598af..cbacc5c28 100644 --- a/examples/exception_path/main.c +++ b/examples/exception_path/main.c @@ -469,6 +469,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, RTE_PTYPE_UNKNOWN, NULL, 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 2130c13d8..2b54175f4 100644 --- a/examples/flow_classify/flow_classify.c +++ b/examples/flow_classify/flow_classify.c @@ -237,6 +237,7 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool) } /* Start the Ethernet port. */ + rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 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 fe064fa02..dad603e39 100644 --- a/examples/flow_filtering/main.c +++ b/examples/flow_filtering/main.c @@ -181,6 +181,7 @@ init_port(void) } rte_eth_promiscuous_enable(port_id); + rte_eth_dev_set_supported_ptypes(port_id, RTE_PTYPE_UNKNOWN, NULL, 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 4e3a40b5a..bcd2a941c 100644 --- a/examples/ip_pipeline/link.c +++ b/examples/ip_pipeline/link.c @@ -206,6 +206,7 @@ link_create(const char *name, struct link_params *params) return NULL; } + rte_eth_dev_set_supported_ptypes(port_id, RTE_PTYPE_UNKNOWN, NULL, 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 87d4b5c01..c3f9b2b72 100644 --- a/examples/ip_reassembly/main.c +++ b/examples/ip_reassembly/main.c @@ -1163,6 +1163,8 @@ main(int argc, char **argv) if ((enabled_port_mask & (1 << portid)) == 0) { continue; } + rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN, + NULL, 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 5ed41312e..b6df263ce 100644 --- a/examples/ipsec-secgw/ipsec-secgw.c +++ b/examples/ipsec-secgw/ipsec-secgw.c @@ -2455,6 +2455,8 @@ main(int32_t argc, char **argv) if ((enabled_port_mask & (1 << portid)) == 0) continue; + rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN, + NULL, 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 1ee3b61d1..6cd8c5ba5 100644 --- a/examples/ipv4_multicast/main.c +++ b/examples/ipv4_multicast/main.c @@ -770,6 +770,8 @@ main(int argc, char **argv) qconf->tx_queue_id[portid] = queueid; queueid++; } + rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN, + NULL, 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 e43f17447..cc8a087fa 100644 --- a/examples/kni/main.c +++ b/examples/kni/main.c @@ -631,6 +631,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, RTE_PTYPE_UNKNOWN, NULL, 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..a54a1ed25 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, RTE_PTYPE_UNKNOWN, NULL, 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 9a370f2de..dd13825e6 100644 --- a/examples/l2fwd-crypto/main.c +++ b/examples/l2fwd-crypto/main.c @@ -2566,6 +2566,8 @@ initialize_ports(struct l2fwd_crypto_options *options) return -1; } + rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN, + NULL, 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 5fcba5c88..7eb7c1156 100644 --- a/examples/l2fwd-jobstats/main.c +++ b/examples/l2fwd-jobstats/main.c @@ -908,6 +908,8 @@ main(int argc, char **argv) "Cannot set error callback for tx buffer on port %u\n", portid); + rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN, + NULL, 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 a05139068..b35a8fc85 100644 --- a/examples/l2fwd-keepalive/main.c +++ b/examples/l2fwd-keepalive/main.c @@ -702,6 +702,8 @@ main(int argc, char **argv) "Cannot set error callback for tx buffer on port %u\n", portid); + rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN, + NULL, 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 8d4c53981..390510f9e 100644 --- a/examples/l2fwd/main.c +++ b/examples/l2fwd/main.c @@ -700,6 +700,8 @@ main(int argc, char **argv) "Cannot set error callback for tx buffer on port %u\n", portid); + rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN, + NULL, 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 60531ce0e..47ace9037 100644 --- a/examples/l3fwd-acl/main.c +++ b/examples/l3fwd-acl/main.c @@ -2072,6 +2072,8 @@ main(int argc, char **argv) if ((enabled_port_mask & (1 << portid)) == 0) continue; + rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN, + NULL, 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-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..5bf70f52d 100644 --- a/examples/l3fwd-vf/main.c +++ b/examples/l3fwd-vf/main.c @@ -1051,6 +1051,8 @@ main(int argc, char **argv) if ((enabled_port_mask & (1 << portid)) == 0) { continue; } + rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN, + NULL, 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 0c3dfc691..a175964f5 100644 --- a/examples/link_status_interrupt/main.c +++ b/examples/link_status_interrupt/main.c @@ -682,6 +682,8 @@ 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, RTE_PTYPE_UNKNOWN, + NULL, 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 660f5a8ed..7dd4de274 100644 --- a/examples/load_balancer/init.c +++ b/examples/load_balancer/init.c @@ -501,6 +501,8 @@ app_init_nics(void) } } + rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, + NULL, 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 a99961f82..71e3b4015 100644 --- a/examples/packet_ordering/main.c +++ b/examples/packet_ordering/main.c @@ -318,6 +318,7 @@ configure_eth_port(uint16_t port_id) return ret; } + rte_eth_dev_set_supported_ptypes(port_id, RTE_PTYPE_UNKNOWN, NULL, 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 bc427a526..040bb8355 100644 --- a/examples/ptpclient/ptpclient.c +++ b/examples/ptpclient/ptpclient.c @@ -234,6 +234,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool) return retval; } + rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 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 13c85e940..7e4cc6e0c 100644 --- a/examples/qos_meter/main.c +++ b/examples/qos_meter/main.c @@ -431,10 +431,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, RTE_PTYPE_UNKNOWN, NULL, 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, RTE_PTYPE_UNKNOWN, NULL, 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 cf9e8f4ac..4ec6ab445 100644 --- a/examples/qos_sched/init.c +++ b/examples/qos_sched/init.c @@ -144,6 +144,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, RTE_PTYPE_UNKNOWN, NULL, 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..4753eb900 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, RTE_PTYPE_UNKNOWN, NULL, 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 9fd4b8efd..8995557f2 100644 --- a/examples/rxtx_callbacks/main.c +++ b/examples/rxtx_callbacks/main.c @@ -159,6 +159,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool) return retval; } + rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 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 773780b4d..995fc125e 100644 --- a/examples/server_node_efd/server/init.c +++ b/examples/server_node_efd/server/init.c @@ -152,6 +152,7 @@ init_port(uint16_t port_num) rte_eth_promiscuous_enable(port_num); + rte_eth_dev_set_supported_ptypes(port_num, RTE_PTYPE_UNKNOWN, NULL, 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 171ebde7b..54cc1921f 100644 --- a/examples/skeleton/basicfwd.c +++ b/examples/skeleton/basicfwd.c @@ -82,6 +82,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool) return retval; } + rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 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 8d6514dd8..37b9f3d34 100644 --- a/examples/tep_termination/vxlan_setup.c +++ b/examples/tep_termination/vxlan_setup.c @@ -171,6 +171,7 @@ vxlan_port_init(uint16_t port, struct rte_mempool *mbuf_pool) return retval; } + rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 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 794d12ba7..6a88d62a3 100644 --- a/examples/vhost/main.c +++ b/examples/vhost/main.c @@ -328,6 +328,7 @@ port_init(uint16_t port) } } + rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 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 0f48ae926..be9342f92 100644 --- a/examples/vm_power_manager/main.c +++ b/examples/vm_power_manager/main.c @@ -105,6 +105,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool) return retval; } + rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 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 91f9a9904..7e337f92c 100644 --- a/examples/vmdq/main.c +++ b/examples/vmdq/main.c @@ -270,6 +270,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool) } } + rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 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 2122e41f5..1e3c490e1 100644 --- a/examples/vmdq_dcb/main.c +++ b/examples/vmdq_dcb/main.c @@ -327,6 +327,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool) } } + rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 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' )