Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp402217pxb; Wed, 3 Mar 2021 06:16:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJyjht7IC72ZVwssPdfAeIa3BLtIxErtThgum//D2LRzVhAXTxv1WP//sWM05yxGE5sjIyLr X-Received: by 2002:a17:906:4c8b:: with SMTP id q11mr26058856eju.270.1614780994176; Wed, 03 Mar 2021 06:16:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614780994; cv=none; d=google.com; s=arc-20160816; b=sLOVbEiZ+Sru6Eg67RuUxIDaCDyWedup+E+0azdwNH7gcyyqIuNygdYEo9KCH6BTHu xWCsDhvReMEFCF7mgAITtE3yfFlfplHxXpga4AXV/T1xYS74eWfKwkETxN2cXns8KkII OZNLS1Cq2vB3vwB9mZKGjA3L12nNtf2fotxMAIJCloPqVnfQNxdmnqfLtSPJx3GikuHT 0vFzy3WV0YtryCjW+i51V0gcBdLkh9ozePaf0OXB5PggRSxdD3ZSJwB7BJ4uTI8pJDSw lLIA+Yu0GMbYljQ2R3XCDN340bPLEmOYvxzuC44ECGvv4zgHQd1WyiFamVE/s3t6EQ5+ 3aTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=fPOEBF/dm+NbxpJ7ew9EDz3t5OVTSQYm30e+ThXWCe0=; b=mHe4GOK9LUOZNn7njf+isUORl+BhcLd14Jm1JjdUW3gbwYV18yZCjalHmivc+hh6bl zvsRYbxtx865izn4VMR2ED6x3rmREfXbI5SzTTVsWULZHKpplwEAa5mCCpONy6FdT5pu /GCMapJpqVQTGIk8RXZW0nrlthQc8UfrzKBB3ggMPSJqlEJT4NphCglnEnzcfqI2q4ZG OuNXKyrifWs0w20IiqgqUZtVRVzd8DD2tGeNs86g+U7QTy6g56Q8iXZG5xryYBfsQJNF elJomHt49ajfgCpEvy7s1fD7fk8JAu1uDjJ5EzCD3ReEHMi5iW96RnuKy0Jy7pYu5CzX 2EFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=g+0NM3na; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bx20si7501951edb.215.2021.03.03.06.15.04; Wed, 03 Mar 2021 06:16:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=g+0NM3na; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242942AbhCAU4v (ORCPT + 99 others); Mon, 1 Mar 2021 15:56:51 -0500 Received: from mail.kernel.org ([198.145.29.99]:37620 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235194AbhCARLQ (ORCPT ); Mon, 1 Mar 2021 12:11:16 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id B591264EDF; Mon, 1 Mar 2021 16:43:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1614616997; bh=9bMnPOGzmc23aS82m0fL4j4VldHY6TPq+i2Db5GkAXM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=g+0NM3naJdtIGCBlws+WaIf75OC9TiNJ/0tXZzDWMshNta7oQxAVjCVnpkWn/PPZJ Rbu4ESvfa0JU+bV7BuBi6hJswurx0Bwg8UVaLx67l5mgKwV0qp2DMeacm42LP/wk4P vCZJcRynSQZUW7PtL76htEOtpX58d34/7fFC1XV4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Grzegorz Szczurek , Mateusz Palczewski , Jaroslaw Gawin , Tony Brelinski , Tony Nguyen , Sasha Levin Subject: [PATCH 4.19 167/247] i40e: Fix add TC filter for IPv6 Date: Mon, 1 Mar 2021 17:13:07 +0100 Message-Id: <20210301161039.834105603@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210301161031.684018251@linuxfoundation.org> References: <20210301161031.684018251@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mateusz Palczewski [ Upstream commit 61c1e0eb8375def7c891bfe857bb795a57090526 ] Fix insufficient distinction between IPv4 and IPv6 addresses when creating a filter. IPv4 and IPv6 are kept in the same memory area. If IPv6 is added, then it's caught by IPv4 check, which leads to err -95. Fixes: 2f4b411a3d67 ("i40e: Enable cloud filters via tc-flower") Signed-off-by: Grzegorz Szczurek Signed-off-by: Mateusz Palczewski Reviewed-by: Jaroslaw Gawin Tested-by: Tony Brelinski Signed-off-by: Tony Nguyen Signed-off-by: Sasha Levin --- drivers/net/ethernet/intel/i40e/i40e_main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c index eba6f7b118a9b..fe9da568ee196 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_main.c +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c @@ -7071,7 +7071,8 @@ int i40e_add_del_cloud_filter_big_buf(struct i40e_vsi *vsi, return -EOPNOTSUPP; /* adding filter using src_port/src_ip is not supported at this stage */ - if (filter->src_port || filter->src_ipv4 || + if (filter->src_port || + (filter->src_ipv4 && filter->n_proto != ETH_P_IPV6) || !ipv6_addr_any(&filter->ip.v6.src_ip6)) return -EOPNOTSUPP; @@ -7100,7 +7101,7 @@ int i40e_add_del_cloud_filter_big_buf(struct i40e_vsi *vsi, cpu_to_le16(I40E_AQC_ADD_CLOUD_FILTER_MAC_VLAN_PORT); } - } else if (filter->dst_ipv4 || + } else if ((filter->dst_ipv4 && filter->n_proto != ETH_P_IPV6) || !ipv6_addr_any(&filter->ip.v6.dst_ip6)) { cld_filter.element.flags = cpu_to_le16(I40E_AQC_ADD_CLOUD_FILTER_IP_PORT); -- 2.27.0