From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EF7325372D4; Thu, 17 Sep 2026 17:02:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789664557; cv=none; b=Eo364XMTdCem+/Zme2crTH0UHSoMw9zqsX78xVwYwsLdzOqdJzuO8ci1Gr48mPoZctI+ZH1tyHd8hKO6T1dUdIhBLpaqcF5aT9bN4zmaVnYPVr5RYNhOnCyRmY5tkTrmklqrr2pFPTLTba+nNLpOeNSzCKcfXeGMIk6NZTVL/No= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789664557; c=relaxed/simple; bh=YtslD1NvKopIcvh6K92NJdV/k4X63AkiE6XQeBBKci4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=P19+4+4Vz7gNPdDScFzqQ4O8ngaCV8CYpfxG1qCnH+ry1eyLztdKZehpNkPYGT8tgWYLd2yXTBZEkeTd3dh3lOGRdR9TYf/9L5b07NjgYqJOaLElTDnqvmKE4VayvGNyxtzZx67blmi+85P13gNltkwW4+1zSpx+y/80QPoxGZY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=iIYAs9V2; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="iIYAs9V2" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 03BA11F0089A; Thu, 17 Sep 2026 17:02:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789664555; bh=1QxygpTGJkv1iWgbBY1aWRUK6V3taHmriZH+rcU1FaQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=iIYAs9V2aeFh1THlySSVJsPxgByDB+8oeZWYQ4oyNBiOQs2EXrXyqhcDHYQ47+8FG 6tEu+D1wAJQwNrY3+DHd6Epk1MkoV9rhm16UIOwnGYb6QTEK7j2ctTngwvRm1/vVjG Gyl90nAVGNZVDG6Krt2uR1gkOwjbwr6XvkeQWvXA= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Jijie Shao , Jakub Kicinski , Sasha Levin Subject: [PATCH 6.18 0411/1250] net: hns3: improve the unused_tuple parameter setting Date: Thu, 17 Sep 2026 16:03:26 +0100 Message-ID: <20260917151603.164396131@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260917151551.901433442@linuxfoundation.org> References: <20260917151551.901433442@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jijie Shao [ Upstream commit 1ad6f1ff3e96c7ee888475740c8acdaf822e0813 ] Currently, when the tc tool is used to set flow table rules, the IP address and MAC address can be configured separately, for example, src_xx or dst_xx can be configured separately. Therefore, the driver needs to check whether the mask is all zero in keys, such as FLOW_DISSECTOR_KEY_IPV4_ADDRS, FLOW_DISSECTOR_KEY_IPV6_ADDRS, and FLOW_DISSECTOR_KEY_ETH_ADDRS. If the mask is all zero, the tuple is not configured. In this case, the driver adds the tuple to unused_tuple. Signed-off-by: Jijie Shao Link: https://patch.msgid.link/20260610060618.834987-3-shaojijie@huawei.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- .../net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index 02fee71c20886..f6fa60f3126f5 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -7261,6 +7261,10 @@ static void hclge_get_cls_key_mac(const struct flow_rule *flow, ether_addr_copy(rule->tuples_mask.dst_mac, match.mask->dst); ether_addr_copy(rule->tuples.src_mac, match.key->src); ether_addr_copy(rule->tuples_mask.src_mac, match.mask->src); + if (is_zero_ether_addr(match.mask->dst)) + rule->unused_tuple |= BIT(INNER_DST_MAC); + if (is_zero_ether_addr(match.mask->src)) + rule->unused_tuple |= BIT(INNER_SRC_MAC); } else { rule->unused_tuple |= BIT(INNER_DST_MAC); rule->unused_tuple |= BIT(INNER_SRC_MAC); @@ -7309,6 +7313,10 @@ static int hclge_get_cls_key_ip(const struct flow_rule *flow, rule->tuples.dst_ip[IPV4_INDEX] = be32_to_cpu(match.key->dst); rule->tuples_mask.dst_ip[IPV4_INDEX] = be32_to_cpu(match.mask->dst); + if (!match.mask->src) + rule->unused_tuple |= BIT(INNER_SRC_IP); + if (!match.mask->dst) + rule->unused_tuple |= BIT(INNER_DST_IP); } else if (addr_type == FLOW_DISSECTOR_KEY_IPV6_ADDRS) { struct flow_match_ipv6_addrs match; @@ -7321,6 +7329,10 @@ static int hclge_get_cls_key_ip(const struct flow_rule *flow, match.key->dst.s6_addr32); ipv6_addr_be32_to_cpu(rule->tuples_mask.dst_ip, match.mask->dst.s6_addr32); + if (ipv6_addr_any(&match.mask->src)) + rule->unused_tuple |= BIT(INNER_SRC_IP); + if (ipv6_addr_any(&match.mask->dst)) + rule->unused_tuple |= BIT(INNER_DST_IP); } else { rule->unused_tuple |= BIT(INNER_SRC_IP); rule->unused_tuple |= BIT(INNER_DST_IP); -- 2.53.0