From patchwork Fri Mar 6 09:36:13 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jingjing Wu X-Patchwork-Id: 3910 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id ACE115A7A; Fri, 6 Mar 2015 10:36:34 +0100 (CET) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id E2A8F11C5 for ; Fri, 6 Mar 2015 10:36:32 +0100 (CET) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP; 06 Mar 2015 01:31:24 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,351,1422950400"; d="scan'208";a="676074808" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by fmsmga001.fm.intel.com with ESMTP; 06 Mar 2015 01:36:32 -0800 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id t269aSTZ008235; Fri, 6 Mar 2015 17:36:28 +0800 Received: from shecgisg004.sh.intel.com (localhost [127.0.0.1]) by shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id t269aPBc008074; Fri, 6 Mar 2015 17:36:27 +0800 Received: (from wujingji@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id t269aP25008070; Fri, 6 Mar 2015 17:36:25 +0800 From: Jingjing Wu To: dev@dpdk.org Date: Fri, 6 Mar 2015 17:36:13 +0800 Message-Id: <1425634574-8033-2-git-send-email-jingjing.wu@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1425634574-8033-1-git-send-email-jingjing.wu@intel.com> References: <1425634574-8033-1-git-send-email-jingjing.wu@intel.com> Subject: [dpdk-dev] [PATCH 1/2] ixgbe: correct the flow types supported X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Ixgbe doesn't support the ipv4-frag and ipv6-frag flow types, remove them. Ixgbe doesn't support configure flex mask on each kind of flow type, this patch uses RTE_ETH_FLOW_UNKNOWN to specify global flex mask setting. This patch also changes the string "raw" to "none" to indicate flex mask setting unrelated with flow type in testpmd for ixgbe. Signed-off-by: Jingjing Wu --- app/test-pmd/cmdline.c | 18 +++++++++++++++--- lib/librte_pmd_ixgbe/ixgbe_fdir.c | 8 +++----- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index c8312be..dce6e4b 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -661,8 +661,7 @@ static void cmd_help_long_parsed(void *parsed_result, " Set flow director mask.\n\n" "flow_director_flex_mask (port_id)" - " flow (raw|ip4|ip4-frag|tcp4|udp4|sctp4|ip6|ip6-frag|tcp6|udp6|sctp6|all)" - " flow (raw|ipv4-other|ipv4-frag|ipv4-tcp|ipv4-udp|ipv4-sctp|" + " flow (none|ipv4-other|ipv4-frag|ipv4-tcp|ipv4-udp|ipv4-sctp|" "ipv6-other|ipv6-frag|ipv6-tcp|ipv6-udp|ipv6-sctp|all)" " (mask)\n" " Configure mask of flex payload.\n\n" @@ -8198,6 +8197,19 @@ cmd_flow_director_flex_mask_parsed(void *parsed_result, 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; + (void)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) { @@ -8235,7 +8247,7 @@ cmdline_parse_token_string_t cmd_flow_director_flexmask_flow = 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, "raw#ipv4-other#ipv4-frag#ipv4-tcp#ipv4-udp#ipv4-sctp#" + flow_type, "none#ipv4-other#ipv4-frag#ipv4-tcp#ipv4-udp#ipv4-sctp#" "ipv6-other#ipv6-frag#ipv6-tcp#ipv6-udp#ipv6-sctp#all"); cmdline_parse_token_string_t cmd_flow_director_flexmask_mask = TOKEN_STRING_INITIALIZER(struct cmd_flow_director_flex_mask_result, diff --git a/lib/librte_pmd_ixgbe/ixgbe_fdir.c b/lib/librte_pmd_ixgbe/ixgbe_fdir.c index bab1bc9..afc53cb 100644 --- a/lib/librte_pmd_ixgbe/ixgbe_fdir.c +++ b/lib/librte_pmd_ixgbe/ixgbe_fdir.c @@ -69,12 +69,10 @@ #define IXGBE_FDIRCMD_CMD_INTERVAL_US 10 #define IXGBE_FDIR_FLOW_TYPES ( \ - (1 << RTE_ETH_FLOW_FRAG_IPV4) | \ (1 << RTE_ETH_FLOW_NONFRAG_IPV4_UDP) | \ (1 << RTE_ETH_FLOW_NONFRAG_IPV4_TCP) | \ (1 << RTE_ETH_FLOW_NONFRAG_IPV4_SCTP) | \ (1 << RTE_ETH_FLOW_NONFRAG_IPV4_OTHER) | \ - (1 << RTE_ETH_FLOW_FRAG_IPV4) | \ (1 << RTE_ETH_FLOW_NONFRAG_IPV6_UDP) | \ (1 << RTE_ETH_FLOW_NONFRAG_IPV6_TCP) | \ (1 << RTE_ETH_FLOW_NONFRAG_IPV6_SCTP) | \ @@ -410,8 +408,8 @@ ixgbe_set_fdir_flex_conf(struct rte_eth_dev *dev, for (i = 0; i < conf->nb_flexmasks; i++) { flex_mask = &conf->flex_mask[i]; - if (flex_mask->flow_type != RTE_ETH_FLOW_RAW) { - PMD_DRV_LOG(ERR, "unsupported flow type."); + if (flex_mask->flow_type != RTE_ETH_FLOW_UNKNOWN) { + PMD_DRV_LOG(ERR, "flexmask should be set globally."); return -EINVAL; } flexbytes = (uint16_t)(((flex_mask->mask[0] << 8) & 0xFF00) | @@ -1030,7 +1028,7 @@ ixgbe_fdir_info_get(struct rte_eth_dev *dev, struct rte_eth_fdir_info *fdir_info fdir_info->flex_conf.flex_set[0].src_offset[0] = offset; fdir_info->flex_conf.flex_set[0].src_offset[1] = offset + 1; fdir_info->flex_conf.nb_flexmasks = 1; - fdir_info->flex_conf.flex_mask[0].flow_type = RTE_ETH_FLOW_RAW; + fdir_info->flex_conf.flex_mask[0].flow_type = RTE_ETH_FLOW_UNKNOWN; fdir_info->flex_conf.flex_mask[0].mask[0] = (uint8_t)(info->mask.flex_bytes_mask & 0x00FF); fdir_info->flex_conf.flex_mask[0].mask[1] =