From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8186AA04B0; Sun, 18 Oct 2020 16:11:56 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 41F45E24A; Sun, 18 Oct 2020 16:09:39 +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 6A4BFC87C for ; Sun, 18 Oct 2020 16:09:27 +0200 (CEST) Received: from mx1-us1.ppe-hosted.com (unknown [10.110.50.143]) by dispatch1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTP id F0CC9200AD; Sun, 18 Oct 2020 14:09:25 +0000 (UTC) Received: from us4-mdac16-49.at1.mdlocal (unknown [10.110.50.132]) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTP id EEACF800A4; Sun, 18 Oct 2020 14:09:25 +0000 (UTC) X-Virus-Scanned: Proofpoint Essentials engine Received: from mx1-us1.ppe-hosted.com (unknown [10.110.50.12]) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id 79E3740061; Sun, 18 Oct 2020 14:09:25 +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 3FBAB4005B; Sun, 18 Oct 2020 14:09:25 +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; Sun, 18 Oct 2020 15:09:20 +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; Sun, 18 Oct 2020 15:09:20 +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 09IE9Kom002041; Sun, 18 Oct 2020 15:09:20 +0100 Received: from ukv-loginhost.uk.solarflarecom.com (localhost [127.0.0.1]) by ukv-loginhost.uk.solarflarecom.com (Postfix) with ESMTP id 2882E1613A9; Sun, 18 Oct 2020 15:09:20 +0100 (BST) From: Andrew Rybchenko To: Wenzhuo Lu , Beilei Xing , Bernard Iremonger , Ray Kinsella , Neil Horman , Jeff Guo , Haiyue Wang , Rasesh Mody , Shahed Shaikh , Andrew Rybchenko , Thomas Monjalon , Ferruh Yigit CC: Date: Sun, 18 Oct 2020 15:09:03 +0100 Message-ID: <1603030152-13451-7-git-send-email-arybchenko@solarflare.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1603030152-13451-1-git-send-email-arybchenko@solarflare.com> References: <1603030152-13451-1-git-send-email-arybchenko@solarflare.com> MIME-Version: 1.0 Content-Type: text/plain X-TM-AS-Product-Ver: SMEX-12.5.0.1300-8.6.1012-25732.003 X-TM-AS-Result: No-19.056900-8.000000-10 X-TMASE-MatchedRID: OOcoWEKA1AP0gpEqM7fvYXv15w39S8ARY/L2/AZJAWSYkF7ZtFfCU4wW IRmLVWq5NNN0dk/lb45w5T4Iaj538mJZXQNDzktSGjzBgnFZvQ5vV3/OnMClWpGhAvBSa2i/rb7 fjT66q20DNmKZmmNto35AB484XXHDuCdzuwD0Lf9Owmo0laDRbMMA9JsxaUa3y5rJ0Rc+qSbp4z 9wZIUHUpq7+DtMdYiVfrEHG1yRCvUj8X63nijPy9+G9ND+fWcZEDnDEqNPduoIRf0AkrYwxeUpg UflHOa/TFCBKUeKNXi4m5J7BMcDnTbcsMCH+ZLFOPcOK0ijAH0TA7ACF0jdA0dmDSBYfnJR9YoZ OFDapk2pL2EAa1GV49oGu15bvOh/be+aQbMzCjP4KPASpfWnuWtNZoZ5+7ekBCzD0Dc8iUtHKow siP9YDRET+8LEBbdcouiEt5eHf2Suyr/sGF0bIMebIMlISwjbnQkHrAHoKqaeH01vXw3W4LERMp uIU2oepZfmyx21mKmJQ9wVn0iA85lfGONdv0wWqjZ865FPtpq/yN2q8U674ncbjcm3iAEjo8WMk QWv6iXBcIE78YqRWo6HM5rqDwqtlExlQIQeRG0= X-TM-AS-User-Approved-Sender: Yes X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--19.056900-8.000000 X-TMASE-Version: SMEX-12.5.0.1300-8.6.1012-25732.003 X-MDID: 1603030166-bRxULzHwAuJq X-PPE-DISP: 1603030166;bRxULzHwAuJq Subject: [dpdk-dev] [PATCH 06/14] ethdev: remove legacy SYN filter type support 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" RTE flow API should be used for filtering. Move corresponding definitions to ethdev internal driver API since it is used by drivers internally. Preserve RTE_ETH_FILTER_SYN because of it as well. Signed-off-by: Andrew Rybchenko --- app/test-pmd/cmdline.c | 95 --------------------------- doc/guides/rel_notes/deprecation.rst | 2 +- drivers/net/e1000/igb_ethdev.c | 70 -------------------- drivers/net/ixgbe/ixgbe_ethdev.c | 66 ------------------- drivers/net/qede/qede_filter.c | 1 - drivers/net/sfc/sfc_ethdev.c | 3 - lib/librte_ethdev/rte_eth_ctrl.h | 11 ---- lib/librte_ethdev/rte_ethdev_driver.h | 10 +++ 8 files changed, 11 insertions(+), 247 deletions(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index e7e85cf304..bf3fdd8609 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -990,9 +990,6 @@ static void cmd_help_long_parsed(void *parsed_result, " priority (prio_value) queue (queue_id)\n" " Add/Del a 5tuple filter.\n\n" - "syn_filter (port_id) (add|del) priority (high|low) queue (queue_id)" - " Add/Del syn filter.\n\n" - "flow_director_filter (port_id) mode IP (add|del|update)" " flow (ipv4-other|ipv4-frag|ipv6-other|ipv6-frag)" " src (src_ip_address) dst (dst_ip_address)" @@ -9982,97 +9979,6 @@ cmdline_parse_inst_t cmd_dump_one = { }, }; -/* *** Add/Del syn filter *** */ -struct cmd_syn_filter_result { - cmdline_fixed_string_t filter; - portid_t port_id; - cmdline_fixed_string_t ops; - cmdline_fixed_string_t priority; - cmdline_fixed_string_t high; - cmdline_fixed_string_t queue; - uint16_t queue_id; -}; - -static void -cmd_syn_filter_parsed(void *parsed_result, - __rte_unused struct cmdline *cl, - __rte_unused void *data) -{ - struct cmd_syn_filter_result *res = parsed_result; - struct rte_eth_syn_filter syn_filter; - int ret = 0; - - ret = rte_eth_dev_filter_supported(res->port_id, - RTE_ETH_FILTER_SYN); - if (ret < 0) { - printf("syn filter is not supported on port %u.\n", - res->port_id); - return; - } - - memset(&syn_filter, 0, sizeof(syn_filter)); - - if (!strcmp(res->ops, "add")) { - if (!strcmp(res->high, "high")) - syn_filter.hig_pri = 1; - else - syn_filter.hig_pri = 0; - - syn_filter.queue = res->queue_id; - ret = rte_eth_dev_filter_ctrl(res->port_id, - RTE_ETH_FILTER_SYN, - RTE_ETH_FILTER_ADD, - &syn_filter); - } else - ret = rte_eth_dev_filter_ctrl(res->port_id, - RTE_ETH_FILTER_SYN, - RTE_ETH_FILTER_DELETE, - &syn_filter); - - if (ret < 0) - printf("syn filter programming error: (%s)\n", - strerror(-ret)); -} - -cmdline_parse_token_string_t cmd_syn_filter_filter = - TOKEN_STRING_INITIALIZER(struct cmd_syn_filter_result, - filter, "syn_filter"); -cmdline_parse_token_num_t cmd_syn_filter_port_id = - TOKEN_NUM_INITIALIZER(struct cmd_syn_filter_result, - port_id, UINT16); -cmdline_parse_token_string_t cmd_syn_filter_ops = - TOKEN_STRING_INITIALIZER(struct cmd_syn_filter_result, - ops, "add#del"); -cmdline_parse_token_string_t cmd_syn_filter_priority = - TOKEN_STRING_INITIALIZER(struct cmd_syn_filter_result, - priority, "priority"); -cmdline_parse_token_string_t cmd_syn_filter_high = - TOKEN_STRING_INITIALIZER(struct cmd_syn_filter_result, - high, "high#low"); -cmdline_parse_token_string_t cmd_syn_filter_queue = - TOKEN_STRING_INITIALIZER(struct cmd_syn_filter_result, - queue, "queue"); -cmdline_parse_token_num_t cmd_syn_filter_queue_id = - TOKEN_NUM_INITIALIZER(struct cmd_syn_filter_result, - queue_id, UINT16); - -cmdline_parse_inst_t cmd_syn_filter = { - .f = cmd_syn_filter_parsed, - .data = NULL, - .help_str = "syn_filter add|del priority high|low queue " - ": Add/Delete syn filter", - .tokens = { - (void *)&cmd_syn_filter_filter, - (void *)&cmd_syn_filter_port_id, - (void *)&cmd_syn_filter_ops, - (void *)&cmd_syn_filter_priority, - (void *)&cmd_syn_filter_high, - (void *)&cmd_syn_filter_queue, - (void *)&cmd_syn_filter_queue_id, - NULL, - }, -}; - /* *** queue region set *** */ struct cmd_queue_region_result { cmdline_fixed_string_t set; @@ -19636,7 +19542,6 @@ cmdline_parse_ctx_t main_ctx[] = { (cmdline_parse_inst_t *)&cmd_config_rss_hash_key, (cmdline_parse_inst_t *)&cmd_dump, (cmdline_parse_inst_t *)&cmd_dump_one, - (cmdline_parse_inst_t *)&cmd_syn_filter, (cmdline_parse_inst_t *)&cmd_2tuple_filter, (cmdline_parse_inst_t *)&cmd_5tuple_filter, (cmdline_parse_inst_t *)&cmd_add_del_ip_flow_director, diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst index 4ed78809c0..8a7839152e 100644 --- a/doc/guides/rel_notes/deprecation.rst +++ b/doc/guides/rel_notes/deprecation.rst @@ -108,7 +108,7 @@ Deprecation Notices * ethdev: the legacy filter API, including ``rte_eth_dev_filter_supported()``, ``rte_eth_dev_filter_ctrl()`` as well - as filter types SYN, NTUPLE, TUNNEL, FDIR, + as filter types NTUPLE, TUNNEL, FDIR, HASH and L2_TUNNEL, 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. diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c index db67bcb7f9..7e2c77d356 100644 --- a/drivers/net/e1000/igb_ethdev.c +++ b/drivers/net/e1000/igb_ethdev.c @@ -186,11 +186,6 @@ static int eth_igb_rss_reta_query(struct rte_eth_dev *dev, struct rte_eth_rss_reta_entry64 *reta_conf, uint16_t reta_size); -static int eth_igb_syn_filter_get(struct rte_eth_dev *dev, - struct rte_eth_syn_filter *filter); -static int eth_igb_syn_filter_handle(struct rte_eth_dev *dev, - enum rte_filter_op filter_op, - void *arg); static int igb_add_2tuple_filter(struct rte_eth_dev *dev, struct rte_eth_ntuple_filter *ntuple_filter); static int igb_remove_2tuple_filter(struct rte_eth_dev *dev, @@ -3670,68 +3665,6 @@ eth_igb_syn_filter_set(struct rte_eth_dev *dev, return 0; } -static int -eth_igb_syn_filter_get(struct rte_eth_dev *dev, - struct rte_eth_syn_filter *filter) -{ - struct e1000_hw *hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private); - uint32_t synqf, rfctl; - - synqf = E1000_READ_REG(hw, E1000_SYNQF(0)); - if (synqf & E1000_SYN_FILTER_ENABLE) { - rfctl = E1000_READ_REG(hw, E1000_RFCTL); - filter->hig_pri = (rfctl & E1000_RFCTL_SYNQFP) ? 1 : 0; - filter->queue = (uint8_t)((synqf & E1000_SYN_FILTER_QUEUE) >> - E1000_SYN_FILTER_QUEUE_SHIFT); - return 0; - } - - return -ENOENT; -} - -static int -eth_igb_syn_filter_handle(struct rte_eth_dev *dev, - enum rte_filter_op filter_op, - void *arg) -{ - struct e1000_hw *hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private); - int ret; - - MAC_TYPE_FILTER_SUP(hw->mac.type); - - if (filter_op == RTE_ETH_FILTER_NOP) - return 0; - - if (arg == NULL) { - PMD_DRV_LOG(ERR, "arg shouldn't be NULL for operation %u", - filter_op); - return -EINVAL; - } - - switch (filter_op) { - case RTE_ETH_FILTER_ADD: - ret = eth_igb_syn_filter_set(dev, - (struct rte_eth_syn_filter *)arg, - TRUE); - break; - case RTE_ETH_FILTER_DELETE: - ret = eth_igb_syn_filter_set(dev, - (struct rte_eth_syn_filter *)arg, - FALSE); - break; - case RTE_ETH_FILTER_GET: - ret = eth_igb_syn_filter_get(dev, - (struct rte_eth_syn_filter *)arg); - break; - default: - PMD_DRV_LOG(ERR, "unsupported operation %u", filter_op); - ret = -EINVAL; - break; - } - - return ret; -} - /* translate elements in struct rte_eth_ntuple_filter to struct e1000_2tuple_filter_info*/ static inline int ntuple_filter_to_2tuple(struct rte_eth_ntuple_filter *filter, @@ -4748,9 +4681,6 @@ eth_igb_filter_ctrl(struct rte_eth_dev *dev, case RTE_ETH_FILTER_NTUPLE: ret = igb_ntuple_filter_handle(dev, filter_op, arg); break; - case RTE_ETH_FILTER_SYN: - ret = eth_igb_syn_filter_handle(dev, filter_op, arg); - break; case RTE_ETH_FILTER_GENERIC: if (filter_op != RTE_ETH_FILTER_GET) return -EINVAL; diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index 28a088a71b..f75725b433 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -300,11 +300,6 @@ static int ixgbevf_add_mac_addr(struct rte_eth_dev *dev, static void ixgbevf_remove_mac_addr(struct rte_eth_dev *dev, uint32_t index); static int ixgbevf_set_default_mac_addr(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr); -static int ixgbe_syn_filter_get(struct rte_eth_dev *dev, - struct rte_eth_syn_filter *filter); -static int ixgbe_syn_filter_handle(struct rte_eth_dev *dev, - enum rte_filter_op filter_op, - void *arg); static int ixgbe_add_5tuple_filter(struct rte_eth_dev *dev, struct ixgbe_5tuple_filter *filter); static void ixgbe_remove_5tuple_filter(struct rte_eth_dev *dev, @@ -6404,64 +6399,6 @@ ixgbe_syn_filter_set(struct rte_eth_dev *dev, return 0; } -static int -ixgbe_syn_filter_get(struct rte_eth_dev *dev, - struct rte_eth_syn_filter *filter) -{ - struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private); - uint32_t synqf = IXGBE_READ_REG(hw, IXGBE_SYNQF); - - if (synqf & IXGBE_SYN_FILTER_ENABLE) { - filter->hig_pri = (synqf & IXGBE_SYN_FILTER_SYNQFP) ? 1 : 0; - filter->queue = (uint16_t)((synqf & IXGBE_SYN_FILTER_QUEUE) >> 1); - return 0; - } - return -ENOENT; -} - -static int -ixgbe_syn_filter_handle(struct rte_eth_dev *dev, - enum rte_filter_op filter_op, - void *arg) -{ - struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private); - int ret; - - MAC_TYPE_FILTER_SUP(hw->mac.type); - - if (filter_op == RTE_ETH_FILTER_NOP) - return 0; - - if (arg == NULL) { - PMD_DRV_LOG(ERR, "arg shouldn't be NULL for operation %u", - filter_op); - return -EINVAL; - } - - switch (filter_op) { - case RTE_ETH_FILTER_ADD: - ret = ixgbe_syn_filter_set(dev, - (struct rte_eth_syn_filter *)arg, - TRUE); - break; - case RTE_ETH_FILTER_DELETE: - ret = ixgbe_syn_filter_set(dev, - (struct rte_eth_syn_filter *)arg, - FALSE); - break; - case RTE_ETH_FILTER_GET: - ret = ixgbe_syn_filter_get(dev, - (struct rte_eth_syn_filter *)arg); - break; - default: - PMD_DRV_LOG(ERR, "unsupported operation %u", filter_op); - ret = -EINVAL; - break; - } - - return ret; -} - static inline enum ixgbe_5tuple_protocol convert_protocol_type(uint8_t protocol_value) @@ -6974,9 +6911,6 @@ ixgbe_dev_filter_ctrl(struct rte_eth_dev *dev, case RTE_ETH_FILTER_NTUPLE: ret = ixgbe_ntuple_filter_handle(dev, filter_op, arg); break; - case RTE_ETH_FILTER_SYN: - ret = ixgbe_syn_filter_handle(dev, filter_op, arg); - break; case RTE_ETH_FILTER_FDIR: ret = ixgbe_fdir_ctrl_func(dev, filter_op, arg); break; diff --git a/drivers/net/qede/qede_filter.c b/drivers/net/qede/qede_filter.c index 28dc9d2234..f3da5ecd92 100644 --- a/drivers/net/qede/qede_filter.c +++ b/drivers/net/qede/qede_filter.c @@ -1561,7 +1561,6 @@ int qede_dev_filter_ctrl(struct rte_eth_dev *eth_dev, *(const void **)arg = &qede_flow_ops; return 0; - case RTE_ETH_FILTER_SYN: case RTE_ETH_FILTER_HASH: case RTE_ETH_FILTER_L2_TUNNEL: case RTE_ETH_FILTER_MAX: diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c index d976a57f2a..13f4355cf1 100644 --- a/drivers/net/sfc/sfc_ethdev.c +++ b/drivers/net/sfc/sfc_ethdev.c @@ -1748,9 +1748,6 @@ sfc_dev_filter_ctrl(struct rte_eth_dev *dev, enum rte_filter_type filter_type, case RTE_ETH_FILTER_NONE: sfc_err(sa, "Global filters configuration not supported"); break; - case RTE_ETH_FILTER_SYN: - sfc_err(sa, "SYN filters not supported"); - break; case RTE_ETH_FILTER_NTUPLE: sfc_err(sa, "NTUPLE filters not supported"); break; diff --git a/lib/librte_ethdev/rte_eth_ctrl.h b/lib/librte_ethdev/rte_eth_ctrl.h index c5e33bec31..48515818dd 100644 --- a/lib/librte_ethdev/rte_eth_ctrl.h +++ b/lib/librte_ethdev/rte_eth_ctrl.h @@ -56,17 +56,6 @@ enum rte_filter_op { RTE_ETH_FILTER_OP_MAX }; -/** - * A structure used to define the TCP syn filter entry - * to support RTE_ETH_FILTER_SYN with RTE_ETH_FILTER_ADD, - * RTE_ETH_FILTER_DELETE and RTE_ETH_FILTER_GET operations. - */ -struct rte_eth_syn_filter { - uint8_t hig_pri; /**< 1 - higher priority than other filters, - 0 - lower priority. */ - uint16_t queue; /**< Queue assigned to when match */ -}; - /** * Define all structures for ntuple Filter type. */ diff --git a/lib/librte_ethdev/rte_ethdev_driver.h b/lib/librte_ethdev/rte_ethdev_driver.h index 67a83dacc7..436e7ead9c 100644 --- a/lib/librte_ethdev/rte_ethdev_driver.h +++ b/lib/librte_ethdev/rte_ethdev_driver.h @@ -1365,6 +1365,16 @@ struct rte_eth_ethertype_filter { uint16_t queue; /**< Queue assigned to when match*/ }; +/** + * A structure used to define the TCP syn filter entry + * to support RTE_ETH_FILTER_SYN data representation. + */ +struct rte_eth_syn_filter { + /** 1 - higher priority than other filters, 0 - lower priority. */ + uint8_t hig_pri; + uint16_t queue; /**< Queue assigned to when match */ +}; + #ifdef __cplusplus } #endif -- 2.17.1