Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3423797pxf; Mon, 29 Mar 2021 01:39:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyjoElAStXtgu6YnFMKOqeIxfkXovBhSQAsTlobFoYR+5cNhtmUhKNXMCQXq6/q3CObC4IQ X-Received: by 2002:a05:6402:34c4:: with SMTP id w4mr28295077edc.367.1617007171557; Mon, 29 Mar 2021 01:39:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617007171; cv=none; d=google.com; s=arc-20160816; b=uquBicmzcpaWRKWtRGyO46GuUSx9c0lxtgn2GRghOENY8238npcBhmlazrlOa76znO sUQRmX1CsoeYNkx/qn93hio/qC6xVSDMW/B1kFDLXSICmRA14R3ezIVfqKkn52KHPgSQ fhY5tBRhK35wovBeQ/N4SZD+9/TVyLjtRT5SooeSadYZs1zwOmYp3gEVNDlqdWot7H5+ xWe6DiLCFewDIOyMg1+pwZ21Boyvnys4WvT7rc6UWAfNRjMwNX38aTC5UdmPZ5oBGXwu OFx7ZkhXXGorZZrq2F0QIzPmuOOdigcg12rNGMmd4yTFm60HW0jF0kMCjo3d53ZsgNtC ONyw== 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=FsqpCXZIwk8THL+aPtzwMnehs+ijVSTfko4pvo4TCMg=; b=gMCeve0aIeBO+VUFvXmjaIO1wpvaX2yphDYPazWTAPs9vArnfiXp+HoVsI3F4snLSB px5v7dNKwRvSI0lKlv9jHu3zsZhfxBRAu011kFzGPBdagLW9R4Nmj7KkqOQIpSYi3xex gl/60UQXI3P/n0slK6bz4pWkOAruL/t3fFhZI0+3p8DGFD6adShhtMiEYoMdxKYVAWrP ZGT7Y5F8aeqFTfllQoRzXdJMsIhHPOHqtN+PCFmk7nzEQxywzO2+xjFQn06uqqbxoKWI Bsi040t4JTbkoNW1nP35vph2Cwr8QTXMWza4HHFlBCPDkKA6Fcs8MRoTy0OZ/uuwY3v2 3y3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Cgyts4gm; 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 y3si12775920ejo.374.2021.03.29.01.39.09; Mon, 29 Mar 2021 01:39:31 -0700 (PDT) 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=Cgyts4gm; 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 S233778AbhC2Igq (ORCPT + 99 others); Mon, 29 Mar 2021 04:36:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:39358 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233923AbhC2IWg (ORCPT ); Mon, 29 Mar 2021 04:22:36 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id CA43A61554; Mon, 29 Mar 2021 08:22:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617006156; bh=gPcEVq23ZcHljHYJI94dgaVJ7RvY85qJGeXSIOVsoOA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Cgyts4gmh71KsbHLzTaka3Uv2DyJt78sSdClNTPOfjsO0OcvkNqwtmZf6OHvrD7B5 SXl1xnAbSVt34jymqGZRxZri82b/b4kYjjFmgJdzY2G0btziUPjgUVPMV9q1TffDxX PbB8ZuWosVdaB6fDXGWvhD58Wv4OihHY3poV00RY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Louis Peens , Simon Horman , "David S. Miller" , Sasha Levin Subject: [PATCH 5.10 137/221] nfp: flower: add ipv6 bit to pre_tunnel control message Date: Mon, 29 Mar 2021 09:57:48 +0200 Message-Id: <20210329075633.753358228@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210329075629.172032742@linuxfoundation.org> References: <20210329075629.172032742@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: Louis Peens [ Upstream commit 5c4f5e19d6a8e159127b9d653bb67e0dc7a28047 ] Differentiate between ipv4 and ipv6 flows when configuring the pre_tunnel table to prevent them trampling each other in the table. Fixes: 783461604f7e ("nfp: flower: update flow merge code to support IPv6 tunnels") Signed-off-by: Louis Peens Signed-off-by: Simon Horman Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- .../ethernet/netronome/nfp/flower/tunnel_conf.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/netronome/nfp/flower/tunnel_conf.c b/drivers/net/ethernet/netronome/nfp/flower/tunnel_conf.c index 7248d248f604..d19c02e99114 100644 --- a/drivers/net/ethernet/netronome/nfp/flower/tunnel_conf.c +++ b/drivers/net/ethernet/netronome/nfp/flower/tunnel_conf.c @@ -16,8 +16,9 @@ #define NFP_FL_MAX_ROUTES 32 #define NFP_TUN_PRE_TUN_RULE_LIMIT 32 -#define NFP_TUN_PRE_TUN_RULE_DEL 0x1 -#define NFP_TUN_PRE_TUN_IDX_BIT 0x8 +#define NFP_TUN_PRE_TUN_RULE_DEL BIT(0) +#define NFP_TUN_PRE_TUN_IDX_BIT BIT(3) +#define NFP_TUN_PRE_TUN_IPV6_BIT BIT(7) /** * struct nfp_tun_pre_run_rule - rule matched before decap @@ -1268,6 +1269,7 @@ int nfp_flower_xmit_pre_tun_flow(struct nfp_app *app, { struct nfp_flower_priv *app_priv = app->priv; struct nfp_tun_offloaded_mac *mac_entry; + struct nfp_flower_meta_tci *key_meta; struct nfp_tun_pre_tun_rule payload; struct net_device *internal_dev; int err; @@ -1290,6 +1292,15 @@ int nfp_flower_xmit_pre_tun_flow(struct nfp_app *app, if (!mac_entry) return -ENOENT; + /* Set/clear IPV6 bit. cpu_to_be16() swap will lead to MSB being + * set/clear for port_idx. + */ + key_meta = (struct nfp_flower_meta_tci *)flow->unmasked_data; + if (key_meta->nfp_flow_key_layer & NFP_FLOWER_LAYER_IPV6) + mac_entry->index |= NFP_TUN_PRE_TUN_IPV6_BIT; + else + mac_entry->index &= ~NFP_TUN_PRE_TUN_IPV6_BIT; + payload.port_idx = cpu_to_be16(mac_entry->index); /* Copy mac id and vlan to flow - dev may not exist at delete time. */ -- 2.30.1