Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4630287pxj; Wed, 12 May 2021 09:36:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwIV84cUAlXcq56I3G77jB7CAZFx9nG+h/PbuCcbXP5yTlA3hjrGPGusSBnvMGfNqejRnKH X-Received: by 2002:ac2:5289:: with SMTP id q9mr24863454lfm.141.1620837396279; Wed, 12 May 2021 09:36:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620837396; cv=none; d=google.com; s=arc-20160816; b=SClCcyDxuqdDm21MZcXWo0DqxOYVdUcZiwux2LlemhWbXldRPhvEK6Oic+9kMf0bte HRzGkB+H88UI9CCVzLDS0R2zvk2SF2APRvk+/2zLrcPPJGTCYHwFL/nIQ+fQHBXBExyz X0bKFYh3ilY1HtKluOZ071XJQLSFLWPWNSknmgtTC/JopCL25a/luxOfnPfKbJKi/JPe MxbVG4BA4JFZ0fV9bWDjsitjRiI97bToA4yOMeZGBF6RUXupOrsUFpArHy3HX3zKE2dz uAVdKepZpLZYfJndeiNFl76CJm/gHxWq8tX5b75H8VgV1k4Mq5nKrSH+rda8M0qnc7Kc bbTw== 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=jQR9mWhvnls3kwbz7hQgd86NnlDUSeRjO5vPtMnOypU=; b=d3spOaEgFJMVnh1g1oMatdHLVe7RRGyaGkfK0eiPng+I3fn/bOTZ9LwVLEt90KRJsD jZsh4Wxgvb/fVijKSnyQP9xOzaFTopIvw85Rs8bTyXGCxjE2a7/ixB9CFpRpf3aqIupE A9nETAV/8iA225DXeTslt2ucDEJVTTwCCDaIVfc92juLQ3VVebQK+Kmqw3c1teU1eo+T sXPQ8+QxSAFSkEg5u8zPVl2QMQY+MD/gwl8v2BPRptHCC7xZeg1WWrCCJ2arHu9PrQI5 2q6Ui5dVe779pt787HlUgND5fCKtxmMFqLAKAz3XFC6bxGPPKgFDyce4XzaO0ZZ+4w0m RlSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jZbXwfgs; 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 r6si346197ljj.7.2021.05.12.09.36.06; Wed, 12 May 2021 09:36:36 -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=jZbXwfgs; 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 S238685AbhELQcu (ORCPT + 99 others); Wed, 12 May 2021 12:32:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:58064 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231396AbhELPlL (ORCPT ); Wed, 12 May 2021 11:41:11 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 40D07619A0; Wed, 12 May 2021 15:21:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620832887; bh=enQoi6Li1Y7vY7ysnuR+wvZMpy5gbxe2fzE+iaF6Qhs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jZbXwfgsvXESMMdjHiUOiM9mh3jNmr+OThHF451gNP3UYxmmlWcPqI1el1AtF/Tw+ LS5J9rHHw3uEGH9Uqxei1013BIUkMcTZ1VTH1K3ssThwXJiWQGbLLCyHYx5KyN87Cx mYzjxFVNgzq/l05G/yUzRqgFVUGpmHGMHXmabluM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pablo Neira Ayuso , Sasha Levin Subject: [PATCH 5.10 463/530] netfilter: nft_payload: fix C-VLAN offload support Date: Wed, 12 May 2021 16:49:33 +0200 Message-Id: <20210512144834.982223079@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210512144819.664462530@linuxfoundation.org> References: <20210512144819.664462530@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: Pablo Neira Ayuso [ Upstream commit 14c20643ef9457679cc6934d77adc24296505214 ] - add another struct flow_dissector_key_vlan for C-VLAN - update layer 3 dependency to allow to match on IPv4/IPv6 Fixes: 89d8fd44abfb ("netfilter: nft_payload: add C-VLAN offload support") Signed-off-by: Pablo Neira Ayuso Signed-off-by: Sasha Levin --- include/net/netfilter/nf_tables_offload.h | 1 + net/netfilter/nft_payload.c | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/include/net/netfilter/nf_tables_offload.h b/include/net/netfilter/nf_tables_offload.h index 1d34fe154fe0..b4d080061399 100644 --- a/include/net/netfilter/nf_tables_offload.h +++ b/include/net/netfilter/nf_tables_offload.h @@ -45,6 +45,7 @@ struct nft_flow_key { struct flow_dissector_key_ports tp; struct flow_dissector_key_ip ip; struct flow_dissector_key_vlan vlan; + struct flow_dissector_key_vlan cvlan; struct flow_dissector_key_eth_addrs eth_addrs; struct flow_dissector_key_meta meta; } __aligned(BITS_PER_LONG / 8); /* Ensure that we can do comparisons as longs. */ diff --git a/net/netfilter/nft_payload.c b/net/netfilter/nft_payload.c index 47d4e0e21651..e43863a1761f 100644 --- a/net/netfilter/nft_payload.c +++ b/net/netfilter/nft_payload.c @@ -241,7 +241,7 @@ static int nft_payload_offload_ll(struct nft_offload_ctx *ctx, if (!nft_payload_offload_mask(reg, priv->len, sizeof(__be16))) return -EOPNOTSUPP; - NFT_OFFLOAD_MATCH(FLOW_DISSECTOR_KEY_CVLAN, vlan, + NFT_OFFLOAD_MATCH(FLOW_DISSECTOR_KEY_CVLAN, cvlan, vlan_tci, sizeof(__be16), reg); break; case offsetof(struct vlan_ethhdr, h_vlan_encapsulated_proto) + @@ -249,8 +249,9 @@ static int nft_payload_offload_ll(struct nft_offload_ctx *ctx, if (!nft_payload_offload_mask(reg, priv->len, sizeof(__be16))) return -EOPNOTSUPP; - NFT_OFFLOAD_MATCH(FLOW_DISSECTOR_KEY_CVLAN, vlan, + NFT_OFFLOAD_MATCH(FLOW_DISSECTOR_KEY_CVLAN, cvlan, vlan_tpid, sizeof(__be16), reg); + nft_offload_set_dependency(ctx, NFT_OFFLOAD_DEP_NETWORK); break; default: return -EOPNOTSUPP; -- 2.30.2