From patchwork Thu Oct 22 09:42:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Rybchenko X-Patchwork-Id: 81770 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 5B060A04DD; Thu, 22 Oct 2020 11:47:08 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2DF3EA9C1; Thu, 22 Oct 2020 11:43:36 +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 2DD43A96F for ; Thu, 22 Oct 2020 11:43:12 +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 CC4B020054; Thu, 22 Oct 2020 09:43:10 +0000 (UTC) Received: from us4-mdac16-26.at1.mdlocal (unknown [10.110.49.208]) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTP id CBB988009B; Thu, 22 Oct 2020 09:43:10 +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 3C5D340061; 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 0285A380055; 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:05 +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:05 +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 09M9h5E8023516; Thu, 22 Oct 2020 10:43:05 +0100 Received: from ukv-loginhost.uk.solarflarecom.com (localhost [127.0.0.1]) by ukv-loginhost.uk.solarflarecom.com (Postfix) with ESMTP id AA6841613A9; Thu, 22 Oct 2020 10:43:05 +0100 (BST) From: Andrew Rybchenko To: Wenzhuo Lu , Beilei Xing , Bernard Iremonger CC: Date: Thu, 22 Oct 2020 10:42:36 +0100 Message-ID: <1603359758-13297-14-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-4.368500-8.000000-10 X-TMASE-MatchedRID: WiPkV5CcqGBW3uCK//k4ajVUc/h8Ki+CP6Tki+9nU38HZBaLwEXlKGlF 7OhYLlctv20OVThfBOtO6zzc/l/QbQTsy5Ctk/aj2Dbo5O4d8Sn7At+An9uo85z2ZypjxOSY5o3 RmsiWkPZimH15vIurw2Umx2NZ7u16PFM7QyjD4jb805SSvoAPN6Iik2/euMx1pzG+Ju2gKrdSXT dIhjp97bhIXhfWVf/k4lRmdWp+YFKNIS7touunKU95wQijrwBL4SkIdSwphgYg2yVdj3LARGfj+ cxYnUGbt3iZlwIB6lXhEUfJKIQEwfoLRFtw/0CmL1wE1KWC9ircVi8qZmJWc96WKRs8d3ce+rEc 9YP7ZaPi8zVgXoAltsIJ+4gwXrEtWBd6ltyXuvtsvp/zUZEYHoxp/+b5Vth1s574dM9DW2lDDYW 29m+58XRG7jkEdbZ37akeQZxFevKBZ1tyqVPaN11ovXSxVCcyKkwGjWBHmpu9Tbikt9AWZ0CBSG S7bIBtA1B/p1SzcogrKiD/U8b7SYci0ewgZmW0ftwZ3X11IV0= X-TM-AS-User-Approved-Sender: Yes X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--4.368500-8.000000 X-TMASE-Version: SMEX-12.5.0.1300-8.6.1012-25740.003 X-MDID: 1603359790-xbvDK6vhay8N X-PPE-DISP: 1603359790;xbvDK6vhay8N Subject: [dpdk-dev] [PATCH v2 13/14] app/testpmd: remove command to set FDIR flexible filter mask 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 command uses FDIR filter information get API which is not supported any more. Signed-off-by: Andrew Rybchenko --- app/test-pmd/cmdline.c | 162 -------------------- doc/guides/testpmd_app_ug/testpmd_funcs.rst | 16 -- 2 files changed, 178 deletions(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index 719797b48d..2a363be41f 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -981,12 +981,6 @@ static void cmd_help_long_parsed(void *parsed_result, " tunnel-id (tunnel_id_value)\n" " Set flow director Tunnel mask.\n\n" - "flow_director_flex_mask (port_id)" - " flow (none|ipv4-other|ipv4-frag|ipv4-tcp|ipv4-udp|ipv4-sctp|" - "ipv6-other|ipv6-frag|ipv6-tcp|ipv6-udp|ipv6-sctp|l2_payload|all)" - " (mask)\n" - " Configure mask of flex payload.\n\n" - "flow_director_flex_payload (port_id)" " (raw|l2|l3|l4) (config)\n" " Configure flex payload selection.\n\n" @@ -10100,44 +10094,6 @@ cmdline_parse_inst_t cmd_show_queue_region_info_all = { /* *** Filters Control *** */ -static inline int -parse_flexbytes(const char *q_arg, uint8_t *flexbytes, uint16_t max_num) -{ - char s[256]; - const char *p, *p0 = q_arg; - char *end; - unsigned long int_fld; - char *str_fld[max_num]; - int i; - unsigned size; - int ret = -1; - - p = strchr(p0, '('); - if (p == NULL) - return -1; - ++p; - p0 = strchr(p, ')'); - if (p0 == NULL) - return -1; - - size = p0 - p; - if (size >= sizeof(s)) - return -1; - - snprintf(s, sizeof(s), "%.*s", size, p); - ret = rte_strsplit(s, sizeof(s), str_fld, max_num, ','); - if (ret < 0 || ret > max_num) - return -1; - for (i = 0; i < ret; i++) { - errno = 0; - int_fld = strtoul(str_fld[i], &end, 0); - if (errno != 0 || *end != '\0' || int_fld > UINT8_MAX) - return -1; - flexbytes[i] = (uint8_t)int_fld; - } - return ret; -} - static uint16_t str2flowtype(char *string) { @@ -10551,123 +10507,6 @@ cmdline_parse_inst_t cmd_set_flow_director_tunnel_mask = { }, }; -/* *** deal with flow director mask on flexible payload *** */ -struct cmd_flow_director_flex_mask_result { - cmdline_fixed_string_t flow_director_flexmask; - portid_t port_id; - cmdline_fixed_string_t flow; - cmdline_fixed_string_t flow_type; - cmdline_fixed_string_t mask; -}; - -static void -cmd_flow_director_flex_mask_parsed(void *parsed_result, - __rte_unused struct cmdline *cl, - __rte_unused void *data) -{ - struct cmd_flow_director_flex_mask_result *res = parsed_result; - struct rte_eth_fdir_info fdir_info; - struct rte_eth_fdir_flex_mask flex_mask; - struct rte_port *port; - uint64_t flow_type_mask; - uint16_t i; - int ret; - - port = &ports[res->port_id]; - /** Check if the port is not started **/ - if (port->port_status != RTE_PORT_STOPPED) { - printf("Please stop port %d first\n", res->port_id); - return; - } - - memset(&flex_mask, 0, sizeof(struct rte_eth_fdir_flex_mask)); - ret = parse_flexbytes(res->mask, - flex_mask.mask, - RTE_ETH_FDIR_MAX_FLEXLEN); - if (ret < 0) { - printf("error: Cannot parse mask input.\n"); - return; - } - - memset(&fdir_info, 0, sizeof(fdir_info)); - ret = rte_eth_dev_filter_ctrl(res->port_id, RTE_ETH_FILTER_FDIR, - RTE_ETH_FILTER_INFO, &fdir_info); - if (ret < 0) { - printf("Cannot get FDir filter info\n"); - return; - } - - if (!strcmp(res->flow_type, "none")) { - /* means don't specify the flow type */ - flex_mask.flow_type = RTE_ETH_FLOW_UNKNOWN; - for (i = 0; i < RTE_ETH_FLOW_MAX; i++) - memset(&port->dev_conf.fdir_conf.flex_conf.flex_mask[i], - 0, sizeof(struct rte_eth_fdir_flex_mask)); - port->dev_conf.fdir_conf.flex_conf.nb_flexmasks = 1; - rte_memcpy(&port->dev_conf.fdir_conf.flex_conf.flex_mask[0], - &flex_mask, - sizeof(struct rte_eth_fdir_flex_mask)); - cmd_reconfig_device_queue(res->port_id, 1, 1); - return; - } - flow_type_mask = fdir_info.flow_types_mask[0]; - if (!strcmp(res->flow_type, "all")) { - if (!flow_type_mask) { - printf("No flow type supported\n"); - return; - } - for (i = RTE_ETH_FLOW_UNKNOWN; i < RTE_ETH_FLOW_MAX; i++) { - if (flow_type_mask & (1ULL << i)) { - flex_mask.flow_type = i; - fdir_set_flex_mask(res->port_id, &flex_mask); - } - } - cmd_reconfig_device_queue(res->port_id, 1, 1); - return; - } - flex_mask.flow_type = str2flowtype(res->flow_type); - if (!(flow_type_mask & (1ULL << flex_mask.flow_type))) { - printf("Flow type %s not supported on port %d\n", - res->flow_type, res->port_id); - return; - } - fdir_set_flex_mask(res->port_id, &flex_mask); - cmd_reconfig_device_queue(res->port_id, 1, 1); -} - -cmdline_parse_token_string_t cmd_flow_director_flexmask = - TOKEN_STRING_INITIALIZER(struct cmd_flow_director_flex_mask_result, - flow_director_flexmask, - "flow_director_flex_mask"); -cmdline_parse_token_num_t cmd_flow_director_flexmask_port_id = - TOKEN_NUM_INITIALIZER(struct cmd_flow_director_flex_mask_result, - port_id, UINT16); -cmdline_parse_token_string_t cmd_flow_director_flexmask_flow = - TOKEN_STRING_INITIALIZER(struct cmd_flow_director_flex_mask_result, - flow, "flow"); -cmdline_parse_token_string_t cmd_flow_director_flexmask_flow_type = - TOKEN_STRING_INITIALIZER(struct cmd_flow_director_flex_mask_result, - flow_type, "none#ipv4-other#ipv4-frag#ipv4-tcp#ipv4-udp#ipv4-sctp#" - "ipv6-other#ipv6-frag#ipv6-tcp#ipv6-udp#ipv6-sctp#l2_payload#all"); -cmdline_parse_token_string_t cmd_flow_director_flexmask_mask = - TOKEN_STRING_INITIALIZER(struct cmd_flow_director_flex_mask_result, - mask, NULL); - -cmdline_parse_inst_t cmd_set_flow_director_flex_mask = { - .f = cmd_flow_director_flex_mask_parsed, - .data = NULL, - .help_str = "flow_director_flex_mask ... : " - "Set flow director's flex mask on NIC", - .tokens = { - (void *)&cmd_flow_director_flexmask, - (void *)&cmd_flow_director_flexmask_port_id, - (void *)&cmd_flow_director_flexmask_flow, - (void *)&cmd_flow_director_flexmask_flow_type, - (void *)&cmd_flow_director_flexmask_mask, - NULL, - }, -}; - /* *** deal with flow director flexible payload configuration *** */ struct cmd_flow_director_flexpayload_result { cmdline_fixed_string_t flow_director_flexpayload; @@ -17659,7 +17498,6 @@ cmdline_parse_ctx_t main_ctx[] = { (cmdline_parse_inst_t *)&cmd_set_flow_director_ip_mask, (cmdline_parse_inst_t *)&cmd_set_flow_director_mac_vlan_mask, (cmdline_parse_inst_t *)&cmd_set_flow_director_tunnel_mask, - (cmdline_parse_inst_t *)&cmd_set_flow_director_flex_mask, (cmdline_parse_inst_t *)&cmd_set_flow_director_flex_payload, (cmdline_parse_inst_t *)&cmd_flow, (cmdline_parse_inst_t *)&cmd_show_port_meter_cap, diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst index 7f01864779..1564c25f5e 100644 --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst @@ -3245,22 +3245,6 @@ Example, to set flow director mask on port 0:: dst_mask 255.255.255.255 \ FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF 0xFFFF -flow_director_flex_mask -~~~~~~~~~~~~~~~~~~~~~~~ - -set masks of flow director's flexible payload based on certain flow type:: - - testpmd> flow_director_flex_mask (port_id) \ - flow (none|ipv4-other|ipv4-frag|ipv4-tcp|ipv4-udp|ipv4-sctp| \ - ipv6-other|ipv6-frag|ipv6-tcp|ipv6-udp|ipv6-sctp| \ - l2_payload|all) (mask) - -Example, to set flow director's flex mask for all flow type on port 0:: - - testpmd> flow_director_flex_mask 0 flow all \ - (0xff,0xff,0,0,0,0,0,0,0,0,0,0,0,0,0,0) - - flow_director_flex_payload ~~~~~~~~~~~~~~~~~~~~~~~~~~