From patchwork Thu Oct 22 09:42:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Rybchenko X-Patchwork-Id: 81771 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4FAD8A04DD; Thu, 22 Oct 2020 11:47:23 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2DBD4A9C5; Thu, 22 Oct 2020 11:43:38 +0200 (CEST) Received: from dispatch1-us1.ppe-hosted.com (dispatch1-us1.ppe-hosted.com [67.231.154.164]) by dpdk.org (Postfix) with ESMTP id 75319A975 for ; Thu, 22 Oct 2020 11:43:12 +0200 (CEST) Received: from mx1-us1.ppe-hosted.com (unknown [10.110.50.137]) by dispatch1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTP id 1D94B20078; Thu, 22 Oct 2020 09:43:11 +0000 (UTC) Received: from us4-mdac16-62.at1.mdlocal (unknown [10.110.50.155]) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTP id 1C8C86009B; Thu, 22 Oct 2020 09:43:11 +0000 (UTC) X-Virus-Scanned: Proofpoint Essentials engine Received: from mx1-us1.ppe-hosted.com (unknown [10.110.48.59]) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id A110222004D; Thu, 22 Oct 2020 09:43:10 +0000 (UTC) Received: from webmail.solarflare.com (uk.solarflare.com [193.34.186.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id 48D53380055; Thu, 22 Oct 2020 09:43:10 +0000 (UTC) Received: from ukex01.SolarFlarecom.com (10.17.10.4) by ukex01.SolarFlarecom.com (10.17.10.4) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 22 Oct 2020 10:43:06 +0100 Received: from opal.uk.solarflarecom.com (10.17.10.1) by ukex01.SolarFlarecom.com (10.17.10.4) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 22 Oct 2020 10:43:06 +0100 Received: from ukv-loginhost.uk.solarflarecom.com (ukv-loginhost.uk.solarflarecom.com [10.17.10.39]) by opal.uk.solarflarecom.com (8.13.8/8.13.8) with ESMTP id 09M9h6pj023569; Thu, 22 Oct 2020 10:43:06 +0100 Received: from ukv-loginhost.uk.solarflarecom.com (localhost [127.0.0.1]) by ukv-loginhost.uk.solarflarecom.com (Postfix) with ESMTP id 566571613A9; Thu, 22 Oct 2020 10:43:06 +0100 (BST) From: Andrew Rybchenko To: Ray Kinsella , Neil Horman , "Hemant Agrawal" , Sachin Saxena , "Wei Hu (Xavier)" , "Min Hu (Connor)" , Yisen Zhuang , Jeff Guo , Haiyue Wang , Rasesh Mody , Shahed Shaikh , Thomas Monjalon , Ferruh Yigit , "Andrew Rybchenko" CC: Date: Thu, 22 Oct 2020 10:42:37 +0100 Message-ID: <1603359758-13297-15-git-send-email-arybchenko@solarflare.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1603359758-13297-1-git-send-email-arybchenko@solarflare.com> References: <1603030152-13451-1-git-send-email-arybchenko@solarflare.com> <1603359758-13297-1-git-send-email-arybchenko@solarflare.com> MIME-Version: 1.0 X-TM-AS-Product-Ver: SMEX-12.5.0.1300-8.6.1012-25740.003 X-TM-AS-Result: No-0.168800-8.000000-10 X-TMASE-MatchedRID: U3pAK/eq+U7eG4FwcWqAS8ebIMlISwjbkaLYW/MsPMAda1Vk3RqxOIwW IRmLVWq53v4RdHcIbAVTvVffeIwvQ+fzx0Vh6/WW9cb9iRwZHB8/pOSL72dTfwdkFovAReUoilv Ab18i4hOtW4l6JM0m+HpV+0QoyPEV1GaOn1Q7N7gHXPih1Aq//AGZ/+APXW9kIEVurWhHQGZ7Mo GOLT7cXkEtwoxd3OQt+oYjuNvCLKBDfzRnCUwPHm6HurDH4PpPWw/S0HB7eoMJcJ9yue3AEcPmp 330HBHmI1uRVimIzhh39+PSB2W18PV1MnnwgooQzNIobH2DzGHqobkz1A0A7TLZyQk29Rf4/tIZ nklOUkj3CFtfJrElIK9+9utLQN+o1usOuFNYYc5IcJTn2HkqsbY6GIm8HMwtMPctwQ2vW/eLVFt k3Um5KDcIRtUfBaJiflBrDjfjUz/d2snq1AJbnvCoOvLLtsMhL1eX+z9B1QzXLRpcXl5f6IjrvR xd5202C7dsYCBYYXsoMSpqJmWSOCpp2rwzfydO8VqfAfqY2iwOHw/yNOkRgYoij12xHbPuSZ6KZ aBujporW7sCnBP/vIAy6p60ZV62fJ5/bZ6npdiujVRFkkVsm/cK+OHlMYAH9grEYj0Uf/LoK5qj hkFnpvcOAVv4z3Vb2Ojss+NANQaYyWR+IUBLqgAE7Ylc/le0YXQ6W1Bhbr12BsFh3BbhtvDsnHB TQS9kyoRE4tv/7I7j/Qm+fSvAAma0vgPD7M1vQP8wh/06uR0= X-TM-AS-User-Approved-Sender: Yes X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10-0.168800-8.000000 X-TMASE-Version: SMEX-12.5.0.1300-8.6.1012-25740.003 X-MDID: 1603359791-SBHvcsyVh4pM X-PPE-DISP: 1603359791;SBHvcsyVh4pM Subject: [dpdk-dev] [PATCH v2 14/14] ethdev: remove legacy filter API functions 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" The legacy filter API, including rte_eth_dev_filter_supported() and rte_eth_dev_filter_ctrl() is removed. Flow API should be used. Signed-off-by: Andrew Rybchenko --- v2: - remove RTE_ETH_FILTER_MAX - move remaining rte_filter_op and rte_filter_type to ethdev driver interface doc/guides/rel_notes/deprecation.rst | 7 ----- doc/guides/rel_notes/release_20_11.rst | 3 ++ drivers/net/dpaa2/dpaa2_ethdev.c | 4 --- drivers/net/hns3/hns3_ethdev.h | 1 + drivers/net/igc/igc_filter.h | 1 + drivers/net/qede/qede_filter.c | 1 - lib/librte_ethdev/rte_eth_ctrl.h | 34 --------------------- lib/librte_ethdev/rte_ethdev.c | 28 ------------------ lib/librte_ethdev/rte_ethdev.h | 41 -------------------------- lib/librte_ethdev/rte_ethdev_driver.h | 22 ++++++++++++++ lib/librte_ethdev/version.map | 2 -- 11 files changed, 27 insertions(+), 117 deletions(-) diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst index 9ef08e32b8..e9905c8d74 100644 --- a/doc/guides/rel_notes/deprecation.rst +++ b/doc/guides/rel_notes/deprecation.rst @@ -94,13 +94,6 @@ Deprecation Notices avoiding impact on vectorized implementation of the driver datapaths, while evaluating performance gains of a better use of the first cache line. - -* ethdev: the legacy filter API, including - ``rte_eth_dev_filter_supported()``, ``rte_eth_dev_filter_ctrl()`` - is superseded by the generic flow API (rte_flow) in - PMDs that implement the latter. - The legacy API will be removed in DPDK 20.11. - * ethdev: The flow director API, including ``rte_eth_conf.fdir_conf`` field, and the related structures (``rte_fdir_*`` and ``rte_eth_fdir_*``), will be removed in DPDK 20.11. diff --git a/doc/guides/rel_notes/release_20_11.rst b/doc/guides/rel_notes/release_20_11.rst index fa666e04fd..14f83f7206 100644 --- a/doc/guides/rel_notes/release_20_11.rst +++ b/doc/guides/rel_notes/release_20_11.rst @@ -468,6 +468,9 @@ API Changes As the data of ``uint8_t`` will be truncated when queue number under a TC is greater than 256. +* ethdev: Removed the legacy filter API, including + ``rte_eth_dev_filter_supported()`` and ``rte_eth_dev_filter_ctrl()``. + * vhost: Moved vDPA APIs from experimental to stable. * vhost: Add a new function ``rte_vhost_crypto_driver_start`` to be called diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index 04e60c56f2..44262c4b1f 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -91,10 +91,6 @@ static const struct rte_dpaa2_xstats_name_off dpaa2_xstats_strings[] = { }; static const enum rte_filter_op dpaa2_supported_filter_ops[] = { - RTE_ETH_FILTER_ADD, - RTE_ETH_FILTER_DELETE, - RTE_ETH_FILTER_UPDATE, - RTE_ETH_FILTER_FLUSH, RTE_ETH_FILTER_GET }; diff --git a/drivers/net/hns3/hns3_ethdev.h b/drivers/net/hns3/hns3_ethdev.h index da8aead2f3..31f49ba874 100644 --- a/drivers/net/hns3/hns3_ethdev.h +++ b/drivers/net/hns3/hns3_ethdev.h @@ -7,6 +7,7 @@ #include #include +#include #include "hns3_cmd.h" #include "hns3_mbx.h" diff --git a/drivers/net/igc/igc_filter.h b/drivers/net/igc/igc_filter.h index 79951504f5..877f51c88b 100644 --- a/drivers/net/igc/igc_filter.h +++ b/drivers/net/igc/igc_filter.h @@ -8,6 +8,7 @@ #include #include +#include #include #include "igc_ethdev.h" diff --git a/drivers/net/qede/qede_filter.c b/drivers/net/qede/qede_filter.c index 71c1f68b90..df5c07dfe5 100644 --- a/drivers/net/qede/qede_filter.c +++ b/drivers/net/qede/qede_filter.c @@ -1070,7 +1070,6 @@ int qede_dev_filter_ctrl(struct rte_eth_dev *eth_dev, *(const void **)arg = &qede_flow_ops; return 0; - case RTE_ETH_FILTER_MAX: default: DP_ERR(edev, "Unsupported filter type %d\n", filter_type); diff --git a/lib/librte_ethdev/rte_eth_ctrl.h b/lib/librte_ethdev/rte_eth_ctrl.h index 0ed2dad55d..012e8059ad 100644 --- a/lib/librte_ethdev/rte_eth_ctrl.h +++ b/lib/librte_ethdev/rte_eth_ctrl.h @@ -22,40 +22,6 @@ extern "C" { #endif -/** - * Feature filter types - */ -enum rte_filter_type { - RTE_ETH_FILTER_NONE = 0, - RTE_ETH_FILTER_ETHERTYPE, - RTE_ETH_FILTER_FLEXIBLE, - RTE_ETH_FILTER_SYN, - RTE_ETH_FILTER_NTUPLE, - RTE_ETH_FILTER_TUNNEL, - RTE_ETH_FILTER_FDIR, - RTE_ETH_FILTER_HASH, - RTE_ETH_FILTER_L2_TUNNEL, - RTE_ETH_FILTER_GENERIC, - RTE_ETH_FILTER_MAX -}; - -/** - * Generic operations on filters - */ -enum rte_filter_op { - /** used to check whether the type filter is supported */ - RTE_ETH_FILTER_NOP = 0, - RTE_ETH_FILTER_ADD, /**< add filter entry */ - RTE_ETH_FILTER_UPDATE, /**< update filter entry */ - RTE_ETH_FILTER_DELETE, /**< delete filter entry */ - RTE_ETH_FILTER_FLUSH, /**< flush all entries */ - RTE_ETH_FILTER_GET, /**< get filter entry */ - RTE_ETH_FILTER_SET, /**< configurations */ - RTE_ETH_FILTER_INFO, /**< retrieve information */ - RTE_ETH_FILTER_STATS, /**< retrieve statistics */ - RTE_ETH_FILTER_OP_MAX -}; - /** * Define all structures for ntuple Filter type. */ diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c index b12bb3854d..aa030fd4fc 100644 --- a/lib/librte_ethdev/rte_ethdev.c +++ b/lib/librte_ethdev/rte_ethdev.c @@ -4758,34 +4758,6 @@ rte_eth_dev_rx_intr_disable(uint16_t port_id, } -int -rte_eth_dev_filter_supported(uint16_t port_id, - enum rte_filter_type filter_type) -{ - struct rte_eth_dev *dev; - - RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); - - dev = &rte_eth_devices[port_id]; - RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->filter_ctrl, -ENOTSUP); - return (*dev->dev_ops->filter_ctrl)(dev, filter_type, - RTE_ETH_FILTER_NOP, NULL); -} - -int -rte_eth_dev_filter_ctrl(uint16_t port_id, enum rte_filter_type filter_type, - enum rte_filter_op filter_op, void *arg) -{ - struct rte_eth_dev *dev; - - RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); - - dev = &rte_eth_devices[port_id]; - RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->filter_ctrl, -ENOTSUP); - return eth_err(port_id, (*dev->dev_ops->filter_ctrl)(dev, filter_type, - filter_op, arg)); -} - const struct rte_eth_rxtx_callback * rte_eth_add_rx_callback(uint16_t port_id, uint16_t queue_id, rte_rx_callback_fn fn, void *user_param) diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h index e341a08817..c51faa9c5b 100644 --- a/lib/librte_ethdev/rte_ethdev.h +++ b/lib/librte_ethdev/rte_ethdev.h @@ -4057,47 +4057,6 @@ int rte_eth_dev_udp_tunnel_port_delete(uint16_t port_id, struct rte_eth_udp_tunnel *tunnel_udp); -/** - * Check whether the filter type is supported on an Ethernet device. - * All the supported filter types are defined in 'rte_eth_ctrl.h'. - * - * @param port_id - * The port identifier of the Ethernet device. - * @param filter_type - * Filter type. - * @return - * - (0) if successful. - * - (-ENOTSUP) if hardware doesn't support this filter type. - * - (-ENODEV) if *port_id* invalid. - * - (-EIO) if device is removed. - */ -__rte_deprecated -int rte_eth_dev_filter_supported(uint16_t port_id, - enum rte_filter_type filter_type); - -/** - * Take operations to assigned filter type on an Ethernet device. - * All the supported operations and filter types are defined in 'rte_eth_ctrl.h'. - * - * @param port_id - * The port identifier of the Ethernet device. - * @param filter_type - * Filter type. - * @param filter_op - * Type of operation. - * @param arg - * A pointer to arguments defined specifically for the operation. - * @return - * - (0) if successful. - * - (-ENOTSUP) if hardware doesn't support. - * - (-ENODEV) if *port_id* invalid. - * - (-EIO) if device is removed. - * - others depends on the specific operations implementation. - */ -__rte_deprecated -int rte_eth_dev_filter_ctrl(uint16_t port_id, enum rte_filter_type filter_type, - enum rte_filter_op filter_op, void *arg); - /** * Get DCB information on an Ethernet device. * diff --git a/lib/librte_ethdev/rte_ethdev_driver.h b/lib/librte_ethdev/rte_ethdev_driver.h index 7a54f0c81b..d830789ff6 100644 --- a/lib/librte_ethdev/rte_ethdev_driver.h +++ b/lib/librte_ethdev/rte_ethdev_driver.h @@ -476,6 +476,28 @@ typedef int (*eth_l2_tunnel_offload_set_t) uint8_t en); /**< @internal enable/disable the l2 tunnel offload functions */ +/** + * Feature filter types + */ +enum rte_filter_type { + RTE_ETH_FILTER_NONE = 0, + RTE_ETH_FILTER_ETHERTYPE, + RTE_ETH_FILTER_FLEXIBLE, + RTE_ETH_FILTER_SYN, + RTE_ETH_FILTER_NTUPLE, + RTE_ETH_FILTER_TUNNEL, + RTE_ETH_FILTER_FDIR, + RTE_ETH_FILTER_HASH, + RTE_ETH_FILTER_L2_TUNNEL, + RTE_ETH_FILTER_GENERIC, +}; + +/** + * Generic operations on filters + */ +enum rte_filter_op { + RTE_ETH_FILTER_GET, /**< get flow API ops */ +}; typedef int (*eth_filter_ctrl_t)(struct rte_eth_dev *dev, enum rte_filter_type filter_type, diff --git a/lib/librte_ethdev/version.map b/lib/librte_ethdev/version.map index 8ddda2547f..fe628736c0 100644 --- a/lib/librte_ethdev/version.map +++ b/lib/librte_ethdev/version.map @@ -15,8 +15,6 @@ DPDK_21 { rte_eth_dev_count_avail; rte_eth_dev_count_total; rte_eth_dev_default_mac_addr_set; - rte_eth_dev_filter_ctrl; - rte_eth_dev_filter_supported; rte_eth_dev_flow_ctrl_get; rte_eth_dev_flow_ctrl_set; rte_eth_dev_fw_version_get;