From patchwork Thu Jun 15 05:17:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Junfeng Guo X-Patchwork-Id: 128724 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0889642CC0; Thu, 15 Jun 2023 07:17:36 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 87F54427F2; Thu, 15 Jun 2023 07:17:31 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 6753B40DDA; Thu, 15 Jun 2023 07:17:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1686806249; x=1718342249; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=tyJWIH+bhyCO8CmL4tBvlHLpYA8x34z9skOYE0c9lxY=; b=X6iW/rfYzFfmg/gRnIrK+arlRlwM8ZJV3qqK1vtljYEGolF2ktfO6ULJ b27m5vnEtOVjJYjbsgloxTcH90OMicAT/5dfxK5DeUM0ixHI2vFzFfTUd WpIsoxL3htKTsIS0XhtRRVXir+t6obchtuNJ0swgQHSt5Uhp8asUcT4bE u+aiH4bQlOYCLUOCfUnHHQwGyiOyQch5Og0svVHDwPxg0ry/10NhDlIGM eJ5DEwNVstTbsUpr3I8I6Ywuycra2ysN0DaxLJyZHgxi6r8NLUazwruAF ghOMpkbYBjx6UQLcmnnuvHmln60lYKkZaK8MTckB0NU1MWv934j5I/GNY A==; X-IronPort-AV: E=McAfee;i="6600,9927,10741"; a="348482460" X-IronPort-AV: E=Sophos;i="6.00,244,1681196400"; d="scan'208";a="348482460" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Jun 2023 22:17:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10741"; a="1042491884" X-IronPort-AV: E=Sophos;i="6.00,244,1681196400"; d="scan'208";a="1042491884" Received: from dpdk-jf-ntb-v2.sh.intel.com ([10.67.119.19]) by fmsmga005.fm.intel.com with ESMTP; 14 Jun 2023 22:17:27 -0700 From: Junfeng Guo To: qi.z.zhang@intel.com, qiming.yang@intel.com Cc: dev@dpdk.org, stable@dpdk.org, ting.xu@intel.com, Junfeng Guo Subject: [PATCH 1/2] net/ice: fix variable type in pattern parsing for raw flow Date: Thu, 15 Jun 2023 13:17:16 +0800 Message-Id: <20230615051717.2906443-2-junfeng.guo@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230615051717.2906443-1-junfeng.guo@intel.com> References: <20230615051717.2906443-1-junfeng.guo@intel.com> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org In current pattern parsing function for protocol agnostic flow offloading (raw flow), some of the variables of packet length are defined as uint8_t, which are too small for some large-size packets, such as srv6 (Segment Routing over IPv6 dataplane) type. Change the type to uint16_t. Fixes: 25be39cc1760 ("net/ice: enable protocol agnostic flow offloading in FDIR") Fixes: 1b9c68120a1c ("net/ice: enable protocol agnostic flow offloading in RSS") Cc: stable@dpdk.org Signed-off-by: Ting Xu Signed-off-by: Junfeng Guo --- drivers/net/ice/ice_fdir_filter.c | 2 +- drivers/net/ice/ice_hash.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ice/ice_fdir_filter.c b/drivers/net/ice/ice_fdir_filter.c index 480b369af8..e8842bc242 100644 --- a/drivers/net/ice/ice_fdir_filter.c +++ b/drivers/net/ice/ice_fdir_filter.c @@ -1876,7 +1876,7 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad, (uint8_t *)(uintptr_t)raw_mask->pattern; uint8_t *tmp_spec, *tmp_mask; uint16_t tmp_val = 0; - uint8_t pkt_len = 0; + uint16_t pkt_len = 0; uint8_t tmp = 0; int i, j; diff --git a/drivers/net/ice/ice_hash.c b/drivers/net/ice/ice_hash.c index f35727856e..52646e9408 100644 --- a/drivers/net/ice/ice_hash.c +++ b/drivers/net/ice/ice_hash.c @@ -653,8 +653,8 @@ ice_hash_parse_raw_pattern(struct ice_adapter *ad, const struct rte_flow_item_raw *raw_spec, *raw_mask; struct ice_parser_profile prof; struct ice_parser_result rslt; + uint16_t spec_len, pkt_len; uint8_t *pkt_buf, *msk_buf; - uint8_t spec_len, pkt_len; uint8_t tmp_val = 0; uint8_t tmp_c = 0; int i, j; From patchwork Thu Jun 15 05:17:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Junfeng Guo X-Patchwork-Id: 128725 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 45B2342CC0; Thu, 15 Jun 2023 07:17:43 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EA29542D1D; Thu, 15 Jun 2023 07:17:32 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 234C541101; Thu, 15 Jun 2023 07:17:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1686806251; x=1718342251; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=136H3QVIn5MfUiTD98lboLhVoCuvDjyP+sp5QL8fjBM=; b=WfvUHr2+hoisJEoU43qcdZkqzenrp2NvGYGlxoLJlw9Y1hSKlVeyLJ/k BJvVVOxMyzQRhFimX+JQ9sze81V5UsiX6Ksk5LOYQ2ik+N8YG0j3bNgYY +S7rgf1POBuHY8XLcbW6gwABF6u11O2tgpQ8ephq25Npl0rUtDDdhLXOK XVU+hCBu077Ugc9EIRv4T0sUC6Zo1e71DwHHZrY8jXCuZlzmo7/5oRUvy VXl2YMdSO3xvGAxQThXQrYX+9rNylPgHoyEWRtiPVoprFqkuGoA+tpA59 0AqnHLwzT8VzyFq8Dj9q8NDTYKo0Vb+MeaYXs7+tQxIzBTt7P+eqjNX8L Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10741"; a="348482462" X-IronPort-AV: E=Sophos;i="6.00,244,1681196400"; d="scan'208";a="348482462" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Jun 2023 22:17:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10741"; a="1042491889" X-IronPort-AV: E=Sophos;i="6.00,244,1681196400"; d="scan'208";a="1042491889" Received: from dpdk-jf-ntb-v2.sh.intel.com ([10.67.119.19]) by fmsmga005.fm.intel.com with ESMTP; 14 Jun 2023 22:17:29 -0700 From: Junfeng Guo To: qi.z.zhang@intel.com, qiming.yang@intel.com Cc: dev@dpdk.org, stable@dpdk.org, ting.xu@intel.com, Junfeng Guo Subject: [PATCH 2/2] net/iavf: fix variable type in pattern parsing for raw flow Date: Thu, 15 Jun 2023 13:17:17 +0800 Message-Id: <20230615051717.2906443-3-junfeng.guo@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230615051717.2906443-1-junfeng.guo@intel.com> References: <20230615051717.2906443-1-junfeng.guo@intel.com> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org In current pattern parsing function for protocol agnostic flow offloading (raw flow), some of the variables of packet length are defined as uint8_t, which are too small for some large-size packets, such as srv6 (Segment Routing over IPv6 dataplane) type. Change the type to uint16_t. Fixes: bc0e85586eaf ("net/iavf: support VF RSS flow rule with raw pattern") Cc: stable@dpdk.org Signed-off-by: Ting Xu Signed-off-by: Junfeng Guo --- drivers/net/iavf/iavf_hash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/iavf/iavf_hash.c b/drivers/net/iavf/iavf_hash.c index ae6fb38594..cf4d677101 100644 --- a/drivers/net/iavf/iavf_hash.c +++ b/drivers/net/iavf/iavf_hash.c @@ -886,8 +886,8 @@ iavf_hash_parse_raw_pattern(const struct rte_flow_item *item, struct iavf_rss_meta *meta) { const struct rte_flow_item_raw *raw_spec, *raw_mask; + uint16_t spec_len, pkt_len; uint8_t *pkt_buf, *msk_buf; - uint8_t spec_len, pkt_len; uint8_t tmp_val = 0; uint8_t tmp_c = 0; int i, j;