From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 68248A0A0E for ; Mon, 10 May 2021 18:13:02 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 61B8440140; Mon, 10 May 2021 18:13:02 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2085.outbound.protection.outlook.com [40.107.223.85]) by mails.dpdk.org (Postfix) with ESMTP id 2438540140 for ; Mon, 10 May 2021 18:13:00 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GcD3EFWKeDBZtRJbZdipZOUp7vsGwKnqWCIooM0JIZkerb717Sp7FAiQ2B1qSS9NyBJbjhAsxIJID2ka9v8ciBVQSfMSNN7L6yjKDoBtkgnGnUhDUVUNvfHqXwYVhtG9N7Xr38VFV1P837wbz2Esh72TxMqllFP0AOG1gx8KU1RItfs8qntQ++YP/Qt85AKYypyOIDfexPapW981WypRD3p+tXrJcwVY+uf2LDwtVPcBKOgIte5NurupZSNruiZPLQBDpOAGRA5MxNoS9HfMwQyYA9YdoqUW0PBihHS+kXsDRy2MZUOuLctyh4YKzFv6B2hD6FsQJUEUAFLh6/H7Ug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tEEr7LMeXPLgB0MUc6aLV9clzz5cYLHQrtY1x8LTh38=; b=TImG2thK4V7GvuaVKukXmHD0LG3Z/JJxHddRfzDz2Zdzl+RxdxhcBrTPxtGLUZ7ecFni+W0NY//VyLPH9FhAGfoTuQQ4m23pkAIoeSRe2j2BhFC7B9qzD7dF8Pw44j2BP7sjaORTzWCcKN5u1myYsNsfndD0hcEL57pm5qf9XOQbr+ckvqTW6FQag/dAKTvJKqLj3+3ZBzIXG5MQppMNxyc9QBnwrQbKe56A1kHwlv5RVZwpRyeDcgBdII7BCJ1PJ7JGC1ouh5eO6asMUB2QDxm4Iuh4X6gukViNANVuVNr052V+g92DiBBr1bI0pVE8SW+7KEIotar4W4h8Je9B1A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=intel.com smtp.mailfrom=nvidia.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tEEr7LMeXPLgB0MUc6aLV9clzz5cYLHQrtY1x8LTh38=; b=cEy6o4AyuhlaYXBsXSBkGIBb3OmxOtWERdN5etF4jU8j5lIHM7XGY3lemQcSGZm5mAg7uVZzoUWZZrNLrigUSLmbLGbLKA1KBLRpd4eJNRf0D9erFMiupY6Ry4HjMI/ARVvDn7ycsL8y4NGz1Ucu6fXCIXQw5l/X729+5VeOaLODaA5Tf3JUeAjxIwmV/dxuNZannUK6/JfZk2ai3qpaPs/yo9Rqd3ooMcP37Tv0oHTSD4ls4pz3IoXb+FdxXfyfJ2U3MC7LZ4mFtul1N3dQc1zIpeSu1wPSYRNy04TEATBSUt65FpPgooLvazKQTeeQ+MZoijLkttp2pOnxhpYFMA== Received: from CO2PR04CA0005.namprd04.prod.outlook.com (2603:10b6:102:1::15) by BY5PR12MB4322.namprd12.prod.outlook.com (2603:10b6:a03:20a::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.26; Mon, 10 May 2021 16:12:58 +0000 Received: from CO1NAM11FT004.eop-nam11.prod.protection.outlook.com (2603:10b6:102:1:cafe::b6) by CO2PR04CA0005.outlook.office365.com (2603:10b6:102:1::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.24 via Frontend Transport; Mon, 10 May 2021 16:12:58 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by CO1NAM11FT004.mail.protection.outlook.com (10.13.175.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4108.25 via Frontend Transport; Mon, 10 May 2021 16:12:58 +0000 Received: from nvidia.com (172.20.145.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 10 May 2021 16:12:56 +0000 From: Xueming Li To: Alvin Zhang CC: Luca Boccassi , Lingli Chen , dpdk stable Date: Tue, 11 May 2021 00:00:48 +0800 Message-ID: <20210510160258.30982-99-xuemingl@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210510160258.30982-1-xuemingl@nvidia.com> References: <20210510160258.30982-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.145.6] X-ClientProxiedBy: HQMAIL111.nvidia.com (172.20.187.18) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b0f86774-0eb0-42f2-1e56-08d913ce7a5c X-MS-TrafficTypeDiagnostic: BY5PR12MB4322: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4714; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Ducrgi+qBEs/T/9h3RBy+YspP6ggYuf92jvcx30LlgAW2gFDqi7yJZalPbQjH0hIpA6zoqgZ9fWUVnY1eTbBjMeN+0hrksXZdATKnAljSrPYOs+rXWx9LxE2x/NKYh8U1NSYW2Wa83IUjBztqkn1evP6dD9sgyDqNyVNi0SSQ6jjEHL0scsz9hcu9J1RToQOgH6Ziiv4+3gWg8esTc26nnzTvHSEvgPWfjIcCuI79VwsrfoVFp6mQVMGOmV78Nb5LfO4i5dD93i1Nb1pgVTtbheIarYVI2l+XRamtIQVLx7ElVYms2KFtWiUFiRss+AzBQMPoYlPl7yezqy65uj0QcvCokr6DT3tGuleEDam4p8ghQXu3h5LOcQnf1piS4IK7PmN3y4xC8NWaPFBTnp1FKxvQ68rPhTnnZtk1xe89o6IcY9SVt6FU11wLAmULBvAoLO0g9s74n6rPBvrxjAR/ev9H+GHotjNaJURWz+aa9qHzhabP0iF5CnZfTRnyVrxUX3JvyFNytoe5mPJlOmEdkOasyruVNzRwpg4Yyso2UW9YklVY9KheJwbdMSvqlCd7D33cphth+9ckaM2GNKxijDE2fRUxn6pC27VbSmlsitFHbujAhRnFzg6KXsVNTgGH8h4huZgAOTHzt6yVD08DAbJ+AUEAHr/D2WQiGFWFgYoG2HnAp7frdc34MgCpl9+soL2XqkVmBVcT8IC06BXJjRp/F34eA3bQYvVvkOIGNltqycjpBiftTy3mbRi0GThU3NBc4ZEYimNDILBT3cPYQ== X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(396003)(346002)(136003)(39860400002)(376002)(46966006)(36840700001)(1076003)(26005)(186003)(4326008)(30864003)(16526019)(356005)(82310400003)(8936002)(316002)(82740400003)(36906005)(47076005)(54906003)(6286002)(36756003)(55016002)(83380400001)(2906002)(966005)(70586007)(70206006)(336012)(36860700001)(86362001)(53546011)(478600001)(7696005)(2616005)(8676002)(6916009)(6666004)(426003)(7636003)(5660300002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 May 2021 16:12:58.5234 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b0f86774-0eb0-42f2-1e56-08d913ce7a5c X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT004.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4322 Subject: [dpdk-stable] patch 'net/i40e: fix input set field mask' has been queued to stable release 20.11.2 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to stable release 20.11.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 05/12/21. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/steevenlee/dpdk This queued commit can be viewed at: https://github.com/steevenlee/dpdk/commit/fe1461f8b60c40b33d611c81cf90e2c91c0b136e Thanks. Xueming Li --- >From fe1461f8b60c40b33d611c81cf90e2c91c0b136e Mon Sep 17 00:00:00 2001 From: Alvin Zhang Date: Mon, 1 Mar 2021 15:06:07 +0800 Subject: [PATCH] net/i40e: fix input set field mask Cc: Luca Boccassi [ upstream commit 2a2fd19d46e598a6816be8f81aa62ec372fd495d ] The absolute field offsets of IPv4 or IPv6 header are related to hardware configuration. The X710 and X722 have different hardware configurations, and users can even modify the hardware configuration. Therefore, The default values cannot be used when calculating mask offset. The following flows can be created on X722 NIC, but the packet will not enter the queue 3: flow create 0 ingress pattern eth / ipv4 proto is 255 / end actions queue index 3 / end pkt = Ether()/IP(ttl=63, proto=255)/Raw('X'*40) flow create 0 ingress pattern eth / ipv4 tos is 50 / udp / end actions queue index 3 / end pkt = Ether()/IP(tos=50)/UDP()/Raw('X'*40) flow create 0 ingress pattern eth / ipv6 tc is 12 / udp / end actions queue index 3 / end pkt = Ether()/IPv6(tc=12,hlim=34,fl=0x98765)/UDP()/Raw('X'*40) flow create 0 ingress pattern eth / ipv6 hop is 34 / end actions queue index 3 / end pkt = Ether()/IPv6(tc=12,hlim=34,fl=0x98765)/Raw('X'*40) This patch read the field offsets from the NIC and return the mask register value. Fixes: 98f055707685 ("i40e: configure input fields for RSS or flow director") Fixes: 92cf7f8ec082 ("i40e: allow filtering on more IP header fields") Signed-off-by: Alvin Zhang Tested-by: Lingli Chen --- drivers/net/i40e/i40e_ethdev.c | 158 +++++++++++++++++++++++++-------- drivers/net/i40e/i40e_ethdev.h | 4 +- drivers/net/i40e/i40e_flow.c | 2 +- 3 files changed, 125 insertions(+), 39 deletions(-) diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index ef4f28fe53..572bd96471 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -202,12 +202,12 @@ #define I40E_TRANSLATE_INSET 0 #define I40E_TRANSLATE_REG 1 -#define I40E_INSET_IPV4_TOS_MASK 0x0009FF00UL -#define I40E_INSET_IPv4_TTL_MASK 0x000D00FFUL -#define I40E_INSET_IPV4_PROTO_MASK 0x000DFF00UL -#define I40E_INSET_IPV6_TC_MASK 0x0009F00FUL -#define I40E_INSET_IPV6_HOP_LIMIT_MASK 0x000CFF00UL -#define I40E_INSET_IPV6_NEXT_HDR_MASK 0x000C00FFUL +#define I40E_INSET_IPV4_TOS_MASK 0x0000FF00UL +#define I40E_INSET_IPV4_TTL_MASK 0x000000FFUL +#define I40E_INSET_IPV4_PROTO_MASK 0x0000FF00UL +#define I40E_INSET_IPV6_TC_MASK 0x0000F00FUL +#define I40E_INSET_IPV6_HOP_LIMIT_MASK 0x0000FF00UL +#define I40E_INSET_IPV6_NEXT_HDR_MASK 0x000000FFUL /* PCI offset for querying capability */ #define PCI_DEV_CAP_REG 0xA4 @@ -220,6 +220,25 @@ /* Bit mask of Extended Tag enable/disable */ #define PCI_DEV_CTRL_EXT_TAG_MASK (1 << PCI_DEV_CTRL_EXT_TAG_SHIFT) +#define I40E_GLQF_PIT_IPV4_START 2 +#define I40E_GLQF_PIT_IPV4_COUNT 2 +#define I40E_GLQF_PIT_IPV6_START 4 +#define I40E_GLQF_PIT_IPV6_COUNT 2 + +#define I40E_GLQF_PIT_SOURCE_OFF_GET(a) \ + (((a) & I40E_GLQF_PIT_SOURCE_OFF_MASK) >> \ + I40E_GLQF_PIT_SOURCE_OFF_SHIFT) + +#define I40E_GLQF_PIT_DEST_OFF_GET(a) \ + (((a) & I40E_GLQF_PIT_DEST_OFF_MASK) >> \ + I40E_GLQF_PIT_DEST_OFF_SHIFT) + +#define I40E_GLQF_PIT_FSIZE_GET(a) (((a) & I40E_GLQF_PIT_FSIZE_MASK) >> \ + I40E_GLQF_PIT_FSIZE_SHIFT) + +#define I40E_GLQF_PIT_BUILD(off, mask) (((off) << 16) | (mask)) +#define I40E_FDIR_FIELD_OFFSET(a) ((a) >> 1) + static int eth_i40e_dev_init(struct rte_eth_dev *eth_dev, void *init_params); static int eth_i40e_dev_uninit(struct rte_eth_dev *eth_dev); static int i40e_dev_configure(struct rte_eth_dev *dev); @@ -9487,49 +9506,116 @@ i40e_translate_input_set_reg(enum i40e_mac_type type, uint64_t input) return val; } +static int +i40e_get_inset_field_offset(struct i40e_hw *hw, uint32_t pit_reg_start, + uint32_t pit_reg_count, uint32_t hdr_off) +{ + const uint32_t pit_reg_end = pit_reg_start + pit_reg_count; + uint32_t field_off = I40E_FDIR_FIELD_OFFSET(hdr_off); + uint32_t i, reg_val, src_off, count; + + for (i = pit_reg_start; i < pit_reg_end; i++) { + reg_val = i40e_read_rx_ctl(hw, I40E_GLQF_PIT(i)); + + src_off = I40E_GLQF_PIT_SOURCE_OFF_GET(reg_val); + count = I40E_GLQF_PIT_FSIZE_GET(reg_val); + + if (src_off <= field_off && (src_off + count) > field_off) + break; + } + + if (i >= pit_reg_end) { + PMD_DRV_LOG(ERR, + "Hardware GLQF_PIT configuration does not support this field mask"); + return -1; + } + + return I40E_GLQF_PIT_DEST_OFF_GET(reg_val) + field_off - src_off; +} + int -i40e_generate_inset_mask_reg(uint64_t inset, uint32_t *mask, uint8_t nb_elem) +i40e_generate_inset_mask_reg(struct i40e_hw *hw, uint64_t inset, + uint32_t *mask, uint8_t nb_elem) { - uint8_t i, idx = 0; - uint64_t inset_need_mask = inset; + static const uint64_t mask_inset[] = { + I40E_INSET_IPV4_PROTO | I40E_INSET_IPV4_TTL, + I40E_INSET_IPV6_NEXT_HDR | I40E_INSET_IPV6_HOP_LIMIT }; static const struct { uint64_t inset; uint32_t mask; - } inset_mask_map[] = { - {I40E_INSET_IPV4_TOS, I40E_INSET_IPV4_TOS_MASK}, - {I40E_INSET_IPV4_PROTO | I40E_INSET_IPV4_TTL, 0}, - {I40E_INSET_IPV4_PROTO, I40E_INSET_IPV4_PROTO_MASK}, - {I40E_INSET_IPV4_TTL, I40E_INSET_IPv4_TTL_MASK}, - {I40E_INSET_IPV6_TC, I40E_INSET_IPV6_TC_MASK}, - {I40E_INSET_IPV6_NEXT_HDR | I40E_INSET_IPV6_HOP_LIMIT, 0}, - {I40E_INSET_IPV6_NEXT_HDR, I40E_INSET_IPV6_NEXT_HDR_MASK}, - {I40E_INSET_IPV6_HOP_LIMIT, I40E_INSET_IPV6_HOP_LIMIT_MASK}, + uint32_t offset; + } inset_mask_offset_map[] = { + { I40E_INSET_IPV4_TOS, I40E_INSET_IPV4_TOS_MASK, + offsetof(struct rte_ipv4_hdr, type_of_service) }, + + { I40E_INSET_IPV4_PROTO, I40E_INSET_IPV4_PROTO_MASK, + offsetof(struct rte_ipv4_hdr, next_proto_id) }, + + { I40E_INSET_IPV4_TTL, I40E_INSET_IPV4_TTL_MASK, + offsetof(struct rte_ipv4_hdr, time_to_live) }, + + { I40E_INSET_IPV6_TC, I40E_INSET_IPV6_TC_MASK, + offsetof(struct rte_ipv6_hdr, vtc_flow) }, + + { I40E_INSET_IPV6_NEXT_HDR, I40E_INSET_IPV6_NEXT_HDR_MASK, + offsetof(struct rte_ipv6_hdr, proto) }, + + { I40E_INSET_IPV6_HOP_LIMIT, I40E_INSET_IPV6_HOP_LIMIT_MASK, + offsetof(struct rte_ipv6_hdr, hop_limits) }, }; - if (!inset || !mask || !nb_elem) + uint32_t i; + int idx = 0; + + assert(mask); + if (!inset) return 0; - for (i = 0, idx = 0; i < RTE_DIM(inset_mask_map); i++) { + for (i = 0; i < RTE_DIM(mask_inset); i++) { /* Clear the inset bit, if no MASK is required, * for example proto + ttl */ - if ((inset & inset_mask_map[i].inset) == - inset_mask_map[i].inset && inset_mask_map[i].mask == 0) - inset_need_mask &= ~inset_mask_map[i].inset; - if (!inset_need_mask) - return 0; + if ((mask_inset[i] & inset) == mask_inset[i]) { + inset &= ~mask_inset[i]; + if (!inset) + return 0; + } } - for (i = 0, idx = 0; i < RTE_DIM(inset_mask_map); i++) { - if ((inset_need_mask & inset_mask_map[i].inset) == - inset_mask_map[i].inset) { - if (idx >= nb_elem) { - PMD_DRV_LOG(ERR, "exceed maximal number of bitmasks"); - return -EINVAL; - } - mask[idx] = inset_mask_map[i].mask; - idx++; + + for (i = 0; i < RTE_DIM(inset_mask_offset_map); i++) { + uint32_t pit_start, pit_count; + int offset; + + if (!(inset_mask_offset_map[i].inset & inset)) + continue; + + if (inset_mask_offset_map[i].inset & + (I40E_INSET_IPV4_TOS | I40E_INSET_IPV4_PROTO | + I40E_INSET_IPV4_TTL)) { + pit_start = I40E_GLQF_PIT_IPV4_START; + pit_count = I40E_GLQF_PIT_IPV4_COUNT; + } else { + pit_start = I40E_GLQF_PIT_IPV6_START; + pit_count = I40E_GLQF_PIT_IPV6_COUNT; + } + + offset = i40e_get_inset_field_offset(hw, pit_start, pit_count, + inset_mask_offset_map[i].offset); + + if (offset < 0) + return -EINVAL; + + if (idx >= nb_elem) { + PMD_DRV_LOG(ERR, + "Configuration of inset mask out of range %u", + nb_elem); + return -ERANGE; } + + mask[idx] = I40E_GLQF_PIT_BUILD((uint32_t)offset, + inset_mask_offset_map[i].mask); + idx++; } return idx; @@ -9583,7 +9669,7 @@ i40e_filter_input_set_init(struct i40e_pf *pf) input_set = i40e_get_default_input_set(pctype); - num = i40e_generate_inset_mask_reg(input_set, mask_reg, + num = i40e_generate_inset_mask_reg(hw, input_set, mask_reg, I40E_INSET_MASK_NUM_REG); if (num < 0) return; @@ -9688,7 +9774,7 @@ i40e_hash_filter_inset_select(struct i40e_hw *hw, inset_reg |= i40e_read_rx_ctl(hw, I40E_GLQF_HASH_INSET(0, pctype)); input_set |= pf->hash_input_set[pctype]; } - num = i40e_generate_inset_mask_reg(input_set, mask_reg, + num = i40e_generate_inset_mask_reg(hw, input_set, mask_reg, I40E_INSET_MASK_NUM_REG); if (num < 0) return -EINVAL; diff --git a/drivers/net/i40e/i40e_ethdev.h b/drivers/net/i40e/i40e_ethdev.h index 20d051db8b..7d203a7816 100644 --- a/drivers/net/i40e/i40e_ethdev.h +++ b/drivers/net/i40e/i40e_ethdev.h @@ -1439,8 +1439,8 @@ bool is_i40evf_supported(struct rte_eth_dev *dev); int i40e_validate_input_set(enum i40e_filter_pctype pctype, enum rte_filter_type filter, uint64_t inset); -int i40e_generate_inset_mask_reg(uint64_t inset, uint32_t *mask, - uint8_t nb_elem); +int i40e_generate_inset_mask_reg(struct i40e_hw *hw, uint64_t inset, + uint32_t *mask, uint8_t nb_elem); uint64_t i40e_translate_input_set_reg(enum i40e_mac_type type, uint64_t input); void i40e_check_write_reg(struct i40e_hw *hw, uint32_t addr, uint32_t val); void i40e_check_write_global_reg(struct i40e_hw *hw, diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c index 5bef8c76a7..15c6464703 100644 --- a/drivers/net/i40e/i40e_flow.c +++ b/drivers/net/i40e/i40e_flow.c @@ -2269,7 +2269,7 @@ i40e_flow_set_fdir_inset(struct i40e_pf *pf, !memcmp(&pf->fdir.input_set[pctype], &input_set, sizeof(uint64_t))) return 0; - num = i40e_generate_inset_mask_reg(input_set, mask_reg, + num = i40e_generate_inset_mask_reg(hw, input_set, mask_reg, I40E_INSET_MASK_NUM_REG); if (num < 0) return -EINVAL; -- 2.25.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-05-10 23:59:29.178202700 +0800 +++ 0100-net-i40e-fix-input-set-field-mask.patch 2021-05-10 23:59:26.480000000 +0800 @@ -1 +1 @@ -From 2a2fd19d46e598a6816be8f81aa62ec372fd495d Mon Sep 17 00:00:00 2001 +From fe1461f8b60c40b33d611c81cf90e2c91c0b136e Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Luca Boccassi + +[ upstream commit 2a2fd19d46e598a6816be8f81aa62ec372fd495d ] @@ -35 +37,0 @@ -Cc: stable@dpdk.org @@ -46 +48 @@ -index 9b86bcdc69..09a1402a3f 100644 +index ef4f28fe53..572bd96471 100644 @@ -94 +96 @@ -@@ -9424,49 +9443,116 @@ i40e_translate_input_set_reg(enum i40e_mac_type type, uint64_t input) +@@ -9487,49 +9506,116 @@ i40e_translate_input_set_reg(enum i40e_mac_type type, uint64_t input) @@ -239 +241 @@ -@@ -9520,7 +9606,7 @@ i40e_filter_input_set_init(struct i40e_pf *pf) +@@ -9583,7 +9669,7 @@ i40e_filter_input_set_init(struct i40e_pf *pf) @@ -248 +250 @@ -@@ -9600,7 +9686,7 @@ i40e_set_hash_inset(struct i40e_hw *hw, uint64_t input_set, +@@ -9688,7 +9774,7 @@ i40e_hash_filter_inset_select(struct i40e_hw *hw, @@ -258 +260 @@ -index 1e8f5d3a87..faf6896fbc 100644 +index 20d051db8b..7d203a7816 100644 @@ -261,2 +263,2 @@ -@@ -1458,8 +1458,8 @@ void i40e_set_symmetric_hash_enable_per_port(struct i40e_hw *hw, - uint8_t enable); +@@ -1439,8 +1439,8 @@ bool is_i40evf_supported(struct rte_eth_dev *dev); + @@ -273 +275 @@ -index 3e514d5f38..1ee8959e56 100644 +index 5bef8c76a7..15c6464703 100644