From patchwork Thu Oct 17 12:02:38 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: 61373 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 E2CF21E8A6; Thu, 17 Oct 2019 14:02:55 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 9967E1DFE7 for ; Thu, 17 Oct 2019 14:02:53 +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 x9HBtj3d008134; Thu, 17 Oct 2019 05:02:52 -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=+Fj3SJRRoWV3WBKqwrTmfj1h2Ob7fFJTNnz0e1VNCYo=; b=TDB162AdGatZTu1XH6OwdhDuyDpJ1k2Mj6bEVg1QpJnyn7DHpDbWET/5F8nzwYMN/Bzc MXRLRg/5GCY9HVC6TYWlnZMWiAmdKcf7+iwckwrtptN4Te+zmHvbz5vnnyQNhkcOWxG9 LR8clXa5UgwDKay71iNYqLj+tYP2Xe6acI7xSJmUTFIdEavLPQcwwuYTsh3GZlTUUPCJ cVd/lNhQ7C5R2RjYLf3qi990anqiLhV1DaiNr6e1fo91GB3JdtWCZP3+ZIn0JWl+eaOJ 8topAMlIQ84Q9cZuInAAmPzIX77Lod4Cd5Hqi06AvJtZPvMjygrvgpi6+ch4SMnhwVlL 2g== Received: from sc-exch03.marvell.com ([199.233.58.183]) by mx0a-0016f401.pphosted.com with ESMTP id 2vnpmbqgtr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 17 Oct 2019 05:02:52 -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, 17 Oct 2019 05:02:51 -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, 17 Oct 2019 05:02:51 -0700 Received: from BG-LT7430.marvell.com (bg-lt7430.marvell.com [10.28.10.255]) by maili.marvell.com (Postfix) with ESMTP id 376943F703F; Thu, 17 Oct 2019 05:02:48 -0700 (PDT) From: To: , , , John McNamara , "Marko Kovacevic" , Thomas Monjalon CC: , Pavan Nikhilesh Date: Thu, 17 Oct 2019 17:32:38 +0530 Message-ID: <20191017120245.984-2-pbhagavatula@marvell.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191017120245.984-1-pbhagavatula@marvell.com> References: <20191010105130.3382-1-pbhagavatula@marvell.com> <20191017120245.984-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-17_04:2019-10-17,2019-10-17 signatures=0 Subject: [dpdk-dev] [PATCH v12 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 | 87 +++++++++++++++++++++++- lib/librte_ethdev/rte_ethdev.h | 37 ++++++++++ lib/librte_ethdev/rte_ethdev_core.h | 19 ++++++ lib/librte_ethdev/rte_ethdev_version.map | 1 + 6 files changed, 157 insertions(+), 3 deletions(-) diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst index d96696801..35cbcd88c 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 9c3de8374..e16060ea0 100644 --- a/doc/guides/rel_notes/release_19_11.rst +++ b/doc/guides/rel_notes/release_19_11.rst @@ -152,6 +152,14 @@ New Features * Added a console command to testpmd app, ``show port (port_id) ptypes`` which gives ability to print port supported ptypes in different protocol layers. +* **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 750bc9d02..9974c43fe 100644 --- a/lib/librte_ethdev/rte_ethdev.c +++ b/lib/librte_ethdev/rte_ethdev.c @@ -2729,6 +2729,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; +} + int rte_eth_macaddr_get(uint16_t port_id, struct rte_ether_addr *mac_addr) { @@ -2741,7 +2827,6 @@ rte_eth_macaddr_get(uint16_t port_id, struct rte_ether_addr *mac_addr) return 0; } - int rte_eth_dev_get_mtu(uint16_t port_id, uint16_t *mtu) { diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h index ec95f9b19..eef07c2b7 100644 --- a/lib/librte_ethdev/rte_ethdev.h +++ b/lib/librte_ethdev/rte_ethdev.h @@ -2506,6 +2506,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 392aea8e6..d5245a7d0 100644 --- a/lib/librte_ethdev/rte_ethdev_core.h +++ b/lib/librte_ethdev/rte_ethdev_core.h @@ -234,6 +234,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. */ @@ -550,6 +567,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 e59d51648..f511294d2 100644 --- a/lib/librte_ethdev/rte_ethdev_version.map +++ b/lib/librte_ethdev/rte_ethdev_version.map @@ -288,4 +288,5 @@ EXPERIMENTAL { rte_eth_rx_burst_mode_get; rte_eth_tx_burst_mode_get; rte_eth_burst_mode_option_name; + rte_eth_dev_set_supported_ptypes; }; From patchwork Thu Oct 17 12:02:39 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: 61374 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 C6D501E8AC; Thu, 17 Oct 2019 14:03:06 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id A4C3A1E54A for ; Thu, 17 Oct 2019 14:02:58 +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 x9HBu40m008160; Thu, 17 Oct 2019 05:02:57 -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=hGwEBE+QHTqr+1kc+pCzgOOVcgeFxcYeGJYhlss/qdg=; b=cbWCooPX3gaCXmDThzr7l0PP303v1EyXtQ/2p3dokzizrHUqD/Im2DIJyqaP/6rwfAZk gJ9bvs3CTayWG3S6Gaf94YuQ4iJu63N7w+UOcC4Pz07X5bTUQx2cI0bzWLB6TF7UqvTP nMLRmi5W8jmiTMzhs2W6WU+xsOgooNkhZOexWYNPuB3JcfHZKSk8iy6r1fFXHwI+ue9V W9AREFF7yDPXsrqYQPzT/9GUpTKMdERwMUfKHQopayi3gSuRQ9DMw5DbdBXDxS5zby9F ryEYKtYa4aSH4xCY5AGOu1UJsl3ByeoMVBpeYz42zH/KX8vaxbUb/QT2+ZkKfXqMSLB/ kQ== Received: from sc-exch02.marvell.com ([199.233.58.182]) by mx0a-0016f401.pphosted.com with ESMTP id 2vnpmbqgu2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 17 Oct 2019 05:02:55 -0700 Received: from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Thu, 17 Oct 2019 05:02:54 -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, 17 Oct 2019 05:02:54 -0700 Received: from BG-LT7430.marvell.com (bg-lt7430.marvell.com [10.28.10.255]) by maili.marvell.com (Postfix) with ESMTP id 7DF083F703F; Thu, 17 Oct 2019 05:02:52 -0700 (PDT) From: To: , , , John McNamara , "Marko Kovacevic" , Thomas Monjalon CC: , Pavan Nikhilesh Date: Thu, 17 Oct 2019 17:32:39 +0530 Message-ID: <20191017120245.984-3-pbhagavatula@marvell.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191017120245.984-1-pbhagavatula@marvell.com> References: <20191010105130.3382-1-pbhagavatula@marvell.com> <20191017120245.984-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-17_04:2019-10-17,2019-10-17 signatures=0 Subject: [dpdk-dev] [PATCH v12 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 35cbcd88c..1653e5b9d 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 e16060ea0..498fdfcdf 100644 --- a/doc/guides/rel_notes/release_19_11.rst +++ b/doc/guides/rel_notes/release_19_11.rst @@ -160,6 +160,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 9974c43fe..685b6a9be 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 eef07c2b7..68b2a4ba8 100644 --- a/lib/librte_ethdev/rte_ethdev.h +++ b/lib/librte_ethdev/rte_ethdev.h @@ -1015,6 +1015,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 17 12:02:40 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: 61375 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 9041D1E8F2; Thu, 17 Oct 2019 14:03:08 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 563511E569 for ; Thu, 17 Oct 2019 14:03:01 +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 x9HBtatg006934; Thu, 17 Oct 2019 05:03:00 -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=JoieeGxl7WVDu/17jm9GdDN49ubzA6GInX/zYmgWcI4=; b=KnusVdhhJSimPXpyUI09PfIe3Y9FyK0+wS423dzJhvRQEcl8L1SnGHhi3admvyACVbVW r2qgTmnxk8ir4HNGo2UGtCq9p9E99j+dszbi3al01GwN2fwdFFPz4xehiQD3OBzaI1+G Ei2m2T+PYNrUEPIruB2JHz6om9FVnhGWOKQSJCMltstB4UdRB53dyZiJ/1ZRg1g4xBiU MCQQSPssiRpIXciDbxstMO4KGdl8vxiGNLKnQpXy7Bw8HxST+woQhGlgdPSvSCZ9o3Qa vDi6nQrj2vnLUZu4dhjU5YFBztkBeCzXp90dgUpdHWyhqD9JVbdUYJGZO57DFPKlibRY Yw== Received: from sc-exch04.marvell.com ([199.233.58.184]) by mx0b-0016f401.pphosted.com with ESMTP id 2vpj9bs21k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 17 Oct 2019 05:03:00 -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, 17 Oct 2019 05:02: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, 17 Oct 2019 05:02:58 -0700 Received: from BG-LT7430.marvell.com (bg-lt7430.marvell.com [10.28.10.255]) by maili.marvell.com (Postfix) with ESMTP id BC3D13F703F; Thu, 17 Oct 2019 05:02:55 -0700 (PDT) From: To: , , , John McNamara , "Marko Kovacevic" , Thomas Monjalon , Adrien Mazarguil CC: , Pavan Nikhilesh Date: Thu, 17 Oct 2019 17:32:40 +0530 Message-ID: <20191017120245.984-4-pbhagavatula@marvell.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191017120245.984-1-pbhagavatula@marvell.com> References: <20191010105130.3382-1-pbhagavatula@marvell.com> <20191017120245.984-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-17_04:2019-10-17,2019-10-17 signatures=0 Subject: [dpdk-dev] [PATCH v12 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 1653e5b9d..3780cf4dd 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 498fdfcdf..cb280d15b 100644 --- a/doc/guides/rel_notes/release_19_11.rst +++ b/doc/guides/rel_notes/release_19_11.rst @@ -167,6 +167,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 685b6a9be..f8090fd6f 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 68b2a4ba8..249303c90 100644 --- a/lib/librte_ethdev/rte_ethdev.h +++ b/lib/librte_ethdev/rte_ethdev.h @@ -1016,6 +1016,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 bcfc06cdc..5c71b9ef4 100644 --- a/lib/librte_ethdev/rte_flow.h +++ b/lib/librte_ethdev/rte_flow.h @@ -1509,7 +1509,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. */ @@ -1517,7 +1518,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 17 12:02:41 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: 61377 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 2962C1E979; Thu, 17 Oct 2019 14:03:21 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 852391E97C for ; Thu, 17 Oct 2019 14:03:15 +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 x9HBswmk006339; Thu, 17 Oct 2019 05:03: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=GjblpVklnooGQIa2V3f/a8vFG4ppNJ0Kp6WQ0sFCJCs=; b=uHNW3HhvhmCQRMBtS0F1jax4xPH0Zskmhmmq5Kfzi/S3Y1CN4L/CEMS8Db28c9GCLln0 LGdnEGhbubf7PQeEAjCOlxoT9YvvweYJnCTVsTyAXeth0fFfAoA93eonFIb1BOjnBEdK +FPRHFEAwzoaaf7eeMxwcsX/9Hpqc7UEcvRAshuqoC6meKhSwoT/6S8uoke+dlOLsw1N GUVxAFJ+d2lJildFHZmwPMgWVCLBKTaYJqIJYrBfNW6fM39QP8BALDWn8q8ry+IFetHL jDLI6zW+YvABHsKm+Uc0s8/fLqEBs5K7CPlh4B9XuU2Sjzxv46AZPoWNmYBV+Tn+U3Pi 0g== Received: from sc-exch02.marvell.com ([199.233.58.182]) by mx0b-0016f401.pphosted.com with ESMTP id 2vpj9bs22j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 17 Oct 2019 05:03:11 -0700 Received: from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Thu, 17 Oct 2019 05:03:09 -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, 17 Oct 2019 05:03:08 -0700 Received: from BG-LT7430.marvell.com (bg-lt7430.marvell.com [10.28.10.255]) by maili.marvell.com (Postfix) with ESMTP id 64CE53F7040; Thu, 17 Oct 2019 05:02:59 -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, 17 Oct 2019 17:32:41 +0530 Message-ID: <20191017120245.984-5-pbhagavatula@marvell.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191017120245.984-1-pbhagavatula@marvell.com> References: <20191010105130.3382-1-pbhagavatula@marvell.com> <20191017120245.984-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-17_04:2019-10-17,2019-10-17 signatures=0 Subject: [dpdk-dev] [PATCH v12 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 e7ec99e15..5586d23da 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -117,7 +117,8 @@ static const struct rte_pci_id bnxt_pci_id_map[] = { DEV_RX_OFFLOAD_KEEP_CRC | \ DEV_RX_OFFLOAD_VLAN_EXTEND | \ DEV_RX_OFFLOAD_TCP_LRO | \ - DEV_RX_OFFLOAD_SCATTER) + DEV_RX_OFFLOAD_SCATTER | \ + 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 ed1be3559..6c1f73ac4 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) /* Common PF and VF devargs */ diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index caf255d67..e24204744 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 6a683fef4..9e983f6ae 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -41,7 +41,8 @@ static uint64_t dev_rx_offloads_sup = DEV_RX_OFFLOAD_VLAN_STRIP | DEV_RX_OFFLOAD_VLAN_FILTER | DEV_RX_OFFLOAD_JUMBO_FRAME | - DEV_RX_OFFLOAD_TIMESTAMP; + DEV_RX_OFFLOAD_TIMESTAMP | + 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 f403a0b66..7c3c270a2 100644 --- a/drivers/net/enic/enic_res.c +++ b/drivers/net/enic/enic_res.c @@ -205,7 +205,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 99c4366e4..8af133295 100644 --- a/drivers/net/fm10k/fm10k_ethdev.c +++ b/drivers/net/fm10k/fm10k_ethdev.c @@ -1805,7 +1805,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 9f37a404b..7f1a27680 100644 --- a/drivers/net/hinic/hinic_pmd_ethdev.c +++ b/drivers/net/hinic/hinic_pmd_ethdev.c @@ -740,7 +740,8 @@ hinic_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info) DEV_RX_OFFLOAD_VLAN_FILTER | DEV_RX_OFFLOAD_SCATTER | DEV_RX_OFFLOAD_JUMBO_FRAME | - DEV_RX_OFFLOAD_TCP_LRO; + DEV_RX_OFFLOAD_TCP_LRO | + 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 77a46832c..3bdde9bb1 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -3613,7 +3613,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 64037e11d..8f170810d 100644 --- a/drivers/net/iavf/iavf_ethdev.c +++ b/drivers/net/iavf/iavf_ethdev.c @@ -527,7 +527,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 dc4d1e6c7..b7d726cbd 100644 --- a/drivers/net/ice/ice_ethdev.c +++ b/drivers/net/ice/ice_ethdev.c @@ -2613,7 +2613,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 ec01343f1..b1b873d54 100644 --- a/drivers/net/liquidio/lio_ethdev.c +++ b/drivers/net/liquidio/lio_ethdev.c @@ -412,7 +412,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 0db065a22..ecc1b9be4 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 22a8b2d19..2b91b5aca 100644 --- a/drivers/net/nfp/nfp_net.c +++ b/drivers/net/nfp/nfp_net.c @@ -1236,7 +1236,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 4a60f9f74..011800e82 100644 --- a/drivers/net/octeontx2/otx2_ethdev.c +++ b/drivers/net/octeontx2/otx2_ethdev.c @@ -575,7 +575,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 33fa0c60b..4879a8a03 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 | \ @@ -140,11 +140,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 53fdfde9a..a26d0ca56 100644 --- a/drivers/net/qede/qede_ethdev.c +++ b/drivers/net/qede/qede_ethdev.c @@ -1302,7 +1302,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 d1faeaa81..5e3689248 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 17 12:02:42 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: 61378 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 B953E1E985; Thu, 17 Oct 2019 14:03:29 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id BB7E01E8DB for ; Thu, 17 Oct 2019 14:03:18 +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 x9HBti5O008131; Thu, 17 Oct 2019 05:03:16 -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=4xEMUdShG7PFJewJFNu8aX5Dj9XHdZc+Qmuj0YkDCaU=; b=EsLVTq2WQNNB9wuJTTPfGau7gsnh1ZpZ0bxlkg8fq5rKZM+rOF3dzKnYmRGmUVS3vKLc xWYhDI1NOAWm57x03MF7MDi9XZasF2Y75GiyE0sQKs9e4WRgbD91uydV7FuNjxO01B5v tPvyI2VkGGthXm87k60/Lq/iDS/BPGtAdXvSqNEhhTSqRzXG/sNXNtyNBS7N554EI7mm /e/OHJ0bHN3auVqbxwe+qmbDXRa1nVXsE0P8dmpiubtk9Nu1lDBfpn16981J9TBBwAqx qwQQYiO2G2QaIB0YfKc8hZhLzQlcZJtVQ5PbNv7mMj+JErrQ4arzlxj+XFL4wt8YOj8Y Tw== Received: from sc-exch02.marvell.com ([199.233.58.182]) by mx0a-0016f401.pphosted.com with ESMTP id 2vnpmbqgwb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 17 Oct 2019 05:03:16 -0700 Received: from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Thu, 17 Oct 2019 05:03:15 -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, 17 Oct 2019 05:03:15 -0700 Received: from BG-LT7430.marvell.com (bg-lt7430.marvell.com [10.28.10.255]) by maili.marvell.com (Postfix) with ESMTP id 0B3D13F7040; Thu, 17 Oct 2019 05:03:09 -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, 17 Oct 2019 17:32:42 +0530 Message-ID: <20191017120245.984-6-pbhagavatula@marvell.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191017120245.984-1-pbhagavatula@marvell.com> References: <20191010105130.3382-1-pbhagavatula@marvell.com> <20191017120245.984-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-17_04:2019-10-17,2019-10-17 signatures=0 Subject: [dpdk-dev] [PATCH v12 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 5586d23da..08dbd127e 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -118,7 +118,8 @@ static const struct rte_pci_id bnxt_pci_id_map[] = { DEV_RX_OFFLOAD_VLAN_EXTEND | \ DEV_RX_OFFLOAD_TCP_LRO | \ DEV_RX_OFFLOAD_SCATTER | \ - 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 7c3c270a2..96a3db528 100644 --- a/drivers/net/enic/enic_res.c +++ b/drivers/net/enic/enic_res.c @@ -206,7 +206,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 3bdde9bb1..75e5213b5 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -3614,7 +3614,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 8f170810d..06eccbd58 100644 --- a/drivers/net/iavf/iavf_ethdev.c +++ b/drivers/net/iavf/iavf_ethdev.c @@ -528,7 +528,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 b7d726cbd..02ee26864 100644 --- a/drivers/net/ice/ice_ethdev.c +++ b/drivers/net/ice/ice_ethdev.c @@ -2614,7 +2614,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 ecc1b9be4..cf46b1fab 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 4879a8a03..07a276c6e 100644 --- a/drivers/net/octeontx2/otx2_ethdev.h +++ b/drivers/net/octeontx2/otx2_ethdev.h @@ -145,7 +145,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 2cba0a447..44f1b0cac 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 17 12:02:43 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: 61379 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 047E71E9A3; Thu, 17 Oct 2019 14:03:32 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 5A88A1E8DB for ; Thu, 17 Oct 2019 14:03:20 +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 x9HBtmng008141; Thu, 17 Oct 2019 05:03:19 -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=uiKHl4p3AnUMidxsjMiMG9jOW3QHfCz56YYvGI7X9E8=; b=bAtBSvx+QqXsQpxlN5s3LcZLsuOdNkPpNKYOcb3OldeyQgQNQW+jcGT2UuRYfV4F+cVj JLW5YJGqG4cLAA+DKzf6qk0YGrr7ooAchUuzXvryXau4CpfxZj0GApwm0vqE3L3N4bYJ JlOBgNlDz408s59n4NSCWBQbt0U+fsowoqO9C8Vt8FMAmJKRcUbmjYOwtVVh98y1/fA6 ETv2caVEPOQnT1szy7oRGPAqK9vTj+FJ7hGWP3zri3X6/c0uA1jw9XGImb+wFe/eCApN BrbzwmzhAsHkyAwGQnp6mpX1qnsUF7O9SgX2yNMKMFrd+Ktr6NrgLoYl8/wN3C8O1dnu TA== Received: from sc-exch04.marvell.com ([199.233.58.184]) by mx0a-0016f401.pphosted.com with ESMTP id 2vnpmbqgwj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 17 Oct 2019 05:03:19 -0700 Received: from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Thu, 17 Oct 2019 05:03:18 -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, 17 Oct 2019 05:03:18 -0700 Received: from BG-LT7430.marvell.com (bg-lt7430.marvell.com [10.28.10.255]) by maili.marvell.com (Postfix) with ESMTP id 353393F703F; Thu, 17 Oct 2019 05:03:15 -0700 (PDT) From: To: , , , Harry van Haaren CC: , Pavan Nikhilesh Date: Thu, 17 Oct 2019 17:32:43 +0530 Message-ID: <20191017120245.984-7-pbhagavatula@marvell.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191017120245.984-1-pbhagavatula@marvell.com> References: <20191010105130.3382-1-pbhagavatula@marvell.com> <20191017120245.984-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-17_04:2019-10-17,2019-10-17 signatures=0 Subject: [dpdk-dev] [PATCH v12 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 | 128 ----------------- .../pipeline_worker_generic.c | 132 ++++++++++++++++++ .../eventdev_pipeline/pipeline_worker_tx.c | 128 +++++++++++++++++ 3 files changed, 260 insertions(+), 128 deletions(-) diff --git a/examples/eventdev_pipeline/main.c b/examples/eventdev_pipeline/main.c index f77830282..d3ff1bbe4 100644 --- a/examples/eventdev_pipeline/main.c +++ b/examples/eventdev_pipeline/main.c @@ -242,133 +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; - retval = rte_eth_macaddr_get(port, &addr); - if (retval != 0) { - printf("Failed to get MAC address (port %u): %s\n", - port, rte_strerror(-retval)); - return retval; - } - - 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. */ - retval = rte_eth_promiscuous_enable(port); - if (retval != 0) - return retval; - - 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) { @@ -515,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..42ff4eeb9 100644 --- a/examples/eventdev_pipeline/pipeline_worker_generic.c +++ b/examples/eventdev_pipeline/pipeline_worker_generic.c @@ -271,6 +271,137 @@ 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; + retval = rte_eth_macaddr_get(port, &addr); + if (retval != 0) { + printf("Failed to get MAC address (port %u): %s\n", + port, rte_strerror(-retval)); + return retval; + } + + 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. */ + retval = rte_eth_promiscuous_enable(port); + if (retval != 0) + return retval; + + 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 +428,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..f381e1caf 100644 --- a/examples/eventdev_pipeline/pipeline_worker_tx.c +++ b/examples/eventdev_pipeline/pipeline_worker_tx.c @@ -603,6 +603,133 @@ 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; + retval = rte_eth_macaddr_get(port, &addr); + if (retval != 0) { + printf("Failed to get MAC address (port %u): %s\n", + port, rte_strerror(-retval)); + return retval; + } + + 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. */ + retval = rte_eth_promiscuous_enable(port); + if (retval != 0) + return retval; + + 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 +748,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 17 12:02:44 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: 61380 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 322881E8A0; Thu, 17 Oct 2019 14:03:41 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id E0F6A1E99D for ; Thu, 17 Oct 2019 14:03:30 +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 x9HBti5P008131; Thu, 17 Oct 2019 05:03:28 -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=ZPRO3v4hJ0ULUGN/T+TyVr6pFV7DmMpKB8FOq7c7z4Y=; b=pG+bOaMGdWd6JEItY+ldWrt918OiRhz0Zgmc8LwE5Am3FKO47dlkTBSD3In1sVzO2KlL Ib21mZE8X4x5QlFczrydZSMrVCmwutAGqV596wUg3KvYjZg1M7rlMcTeGd+0YCWf+nLy +jT4CtDFtaOl9+oFgrW93TkXQ2Z3sEoq7gGl94NC4uxETiG+b2tKZW+bpVkLuK+Z4ARV UxemnR5fwDL/SpPj9jE7PF8JtaZrK6yYzjvthgQlTGzylWskaoQwB/XJlet7qnJyRwyr fgdwHjsWtZKKQ/TEA+OFJtTnbSNfD08U48o6jC/YmwOG/YNv8pFXj6tY5crPsikEN2lm 4g== Received: from sc-exch03.marvell.com ([199.233.58.183]) by mx0a-0016f401.pphosted.com with ESMTP id 2vnpmbqgxb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 17 Oct 2019 05:03:28 -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, 17 Oct 2019 05:03:26 -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, 17 Oct 2019 05:03:26 -0700 Received: from BG-LT7430.marvell.com (bg-lt7430.marvell.com [10.28.10.255]) by maili.marvell.com (Postfix) with ESMTP id 515093F703F; Thu, 17 Oct 2019 05:03:19 -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 , 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, 17 Oct 2019 17:32:44 +0530 Message-ID: <20191017120245.984-8-pbhagavatula@marvell.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191017120245.984-1-pbhagavatula@marvell.com> References: <20191010105130.3382-1-pbhagavatula@marvell.com> <20191017120245.984-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-17_04:2019-10-17,2019-10-17 signatures=0 Subject: [dpdk-dev] [PATCH v12 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 | 2 ++ 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 | 2 ++ 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 | 3 +++ 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, 99 insertions(+) diff --git a/examples/bbdev_app/main.c b/examples/bbdev_app/main.c index fb38dc3a7..7798a6a03 100644 --- a/examples/bbdev_app/main.c +++ b/examples/bbdev_app/main.c @@ -499,6 +499,8 @@ initialize_ports(struct app_config_params *app_params, print_mac(port_id, &bbdev_port_eth_addr); + rte_eth_dev_set_supported_ptypes(port_id, RTE_PTYPE_UNKNOWN, NULL, 0); + return 0; } diff --git a/examples/bond/main.c b/examples/bond/main.c index ee8fa2d27..ce681b6fd 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, @@ -286,6 +287,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 567c5e989..75d42a1eb 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 85dbd7ec7..7ee2213b2 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 1c12bbb2f..2e9dfd157 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 cc9e7e780..5a816c0d4 100644 --- a/examples/flow_filtering/main.c +++ b/examples/flow_filtering/main.c @@ -190,6 +190,8 @@ init_port(void) ":: promiscuous mode enable failed: err=%s, port=%u\n", rte_strerror(-ret), 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 16bcffe35..68609cd7c 100644 --- a/examples/ip_pipeline/link.c +++ b/examples/ip_pipeline/link.c @@ -209,6 +209,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 d59e6d02f..55b4ddc3f 100644 --- a/examples/ip_reassembly/main.c +++ b/examples/ip_reassembly/main.c @@ -1178,6 +1178,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 f52ca5297..38fd16929 100644 --- a/examples/ipsec-secgw/ipsec-secgw.c +++ b/examples/ipsec-secgw/ipsec-secgw.c @@ -2468,6 +2468,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 63333b5b6..67617a56c 100644 --- a/examples/ipv4_multicast/main.c +++ b/examples/ipv4_multicast/main.c @@ -788,6 +788,9 @@ main(int argc, char **argv) rte_exit(EXIT_FAILURE, "rte_eth_allmulticast_enable: err=%d, port=%d\n", ret, 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/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 c576fc767..d8781f29f 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 6838f288c..5a459937a 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 61d78295d..04aad839e 100644 --- a/examples/l2fwd-crypto/main.c +++ b/examples/l2fwd-crypto/main.c @@ -2574,6 +2574,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 f975aa12d..47007d1bc 100644 --- a/examples/l2fwd-jobstats/main.c +++ b/examples/l2fwd-jobstats/main.c @@ -921,6 +921,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 b36834974..d5c3e7981 100644 --- a/examples/l2fwd-keepalive/main.c +++ b/examples/l2fwd-keepalive/main.c @@ -715,6 +715,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 d7bcbfae7..b2fee8d86 100644 --- a/examples/l2fwd/main.c +++ b/examples/l2fwd/main.c @@ -713,6 +713,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 fa92a2829..d9390cf2c 100644 --- a/examples/l3fwd-acl/main.c +++ b/examples/l3fwd-acl/main.c @@ -2085,6 +2085,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 ff6c9e2f1..f2e9ef2bd 100644 --- a/examples/l3fwd-vf/main.c +++ b/examples/l3fwd-vf/main.c @@ -1056,6 +1056,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 a924aa231..4a73b9e4e 100644 --- a/examples/link_status_interrupt/main.c +++ b/examples/link_status_interrupt/main.c @@ -704,6 +704,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 762226754..ade737b5e 100644 --- a/examples/load_balancer/init.c +++ b/examples/load_balancer/init.c @@ -513,6 +513,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 b397b318e..d8857bf59 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 a1a7ae699..5cd9307fe 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 e8112c83a..3f6da6352 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 32e6e1ba2..e954130de 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 5ebcc83ac..3289afc16 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 07e95e8d1..50e08b691 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 00e2e4059..60603a415 100644 --- a/examples/server_node_efd/server/init.c +++ b/examples/server_node_efd/server/init.c @@ -154,6 +154,7 @@ init_port(uint16_t port_num) if (retval != 0) return retval; + 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 73d313b84..ff213568f 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 f9f857c09..9a6796afe 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 ab649bf14..04240a782 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 d39f044c1..9842a73dd 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 6e6fc91ec..4cde9d1d8 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 594c4f195..f3d1934f2 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' )