Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3730321imm; Mon, 8 Oct 2018 08:37:44 -0700 (PDT) X-Google-Smtp-Source: ACcGV63t1MNapkscAIyNXqLklilSEQjVptxw75MCDhrUOmkZc5I2Ynm2ep/7EwA1EAcO81KekgOH X-Received: by 2002:a62:ca4d:: with SMTP id n74-v6mr20954437pfg.10.1539013064851; Mon, 08 Oct 2018 08:37:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539013064; cv=none; d=google.com; s=arc-20160816; b=HcXBhH9Yejd7ryTaI27xduoWfdCVqwwj3JAosxAZl/GrOHCGhRdOGpLcVV1kkMkmpj UI1/UaSWsO8jyGveKN9AWIgfXfr7wZtTUfFAchT0pAjjuDc8nY3uQRxRTZI9/ba1Inoy rTkyOz06on/nRy6fXp1yBHj8uupIi0cM9G8+QBC5C6bn3Q6Gca5l8iJg4VRVM22kKCXy /q4tW22DqKbmBs1MRyqJC2+ri8ilvC7cf8bf2yKBEpkXLFvsUf7m3SZQDSOJO56CwSsJ E5PGEVBnrKvbNyhnfVELhJviybh48rdNME2gECqlEDZzYizaSl6h/Z1hOqbI5wFUtDqz sJBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=GKCPeGlN8f1uT3Ixv/llXoH2VR3kUSMEnoFBHud1zMk=; b=zJ2PMaZNq/W+wcHGzof+KnvhrRkUHbfSN06LsLABc+LkQ2TiMWvVn08aWv6M9vKExb bKPhBIgLq79p1EfQon/vjzZyRaVzJXXkBbG5iSNScaBLaB3ICLC+r7oPl/PWP4Pi5doZ EyEkEkc/uukbJsI3AWHb7yfXkNdvffm17b3ZpC6oHBjoGTvg4T2fANwm+DA76qdO37oe POjW5uqGWukHHe14nJcdyI1lGZv+A+GPI62q0jeICbdW4e3RwHwKo5zO0fDu6d+u+cDX Kj+2s9NFjuftXXmmsn1SrNO6o0P3PDzQPKG5AxATwf1ieSW7oUE1B+go/WEKPQp0bnj1 KgEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Z8JvGsGH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q9-v6si19301138pfk.27.2018.10.08.08.37.30; Mon, 08 Oct 2018 08:37:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Z8JvGsGH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727693AbeJHWiS (ORCPT + 99 others); Mon, 8 Oct 2018 18:38:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:56658 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727524AbeJHWiQ (ORCPT ); Mon, 8 Oct 2018 18:38:16 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E05FC2150B; Mon, 8 Oct 2018 15:26:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1539012361; bh=UO17doN27zD4wNlp4kxchSOx+VKjfO5lNoqF12sT0Fs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Z8JvGsGHM+hhB4fzwuVy9e15JvRznXa5LadxADTWt1jsfRlbrwli+7CKKcL/EaeHN RqWiD3Vu/q+DWxfmlzLvXn6U9jxb1E7z/eLvVBoVKKUGtL3a//hLjxwmHCKFHm5GFk lU90yZwNPn8jXWm17D+6liVcRAOvz3sdSuWnNJi4= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Davide Caratti , "David S . Miller" , Sasha Levin Subject: [PATCH AUTOSEL 4.18 36/58] bnxt_en: don't try to offload VLAN 'modify' action Date: Mon, 8 Oct 2018 11:25:01 -0400 Message-Id: <20181008152523.70705-36-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181008152523.70705-1-sashal@kernel.org> References: <20181008152523.70705-1-sashal@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Davide Caratti [ Upstream commit 8c6ec3613e7b0aade20a3196169c0bab32ed3e3f ] bnxt offload code currently supports only 'push' and 'pop' operation: let .ndo_setup_tc() return -EOPNOTSUPP if VLAN 'modify' action is configured. Fixes: 2ae7408fedfe ("bnxt_en: bnxt: add TC flower filter offload support") Signed-off-by: Davide Caratti Acked-by: Sathya Perla Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c index 491bd40a254d..c4c9df029466 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c @@ -75,17 +75,23 @@ static int bnxt_tc_parse_redir(struct bnxt *bp, return 0; } -static void bnxt_tc_parse_vlan(struct bnxt *bp, - struct bnxt_tc_actions *actions, - const struct tc_action *tc_act) +static int bnxt_tc_parse_vlan(struct bnxt *bp, + struct bnxt_tc_actions *actions, + const struct tc_action *tc_act) { - if (tcf_vlan_action(tc_act) == TCA_VLAN_ACT_POP) { + switch (tcf_vlan_action(tc_act)) { + case TCA_VLAN_ACT_POP: actions->flags |= BNXT_TC_ACTION_FLAG_POP_VLAN; - } else if (tcf_vlan_action(tc_act) == TCA_VLAN_ACT_PUSH) { + break; + case TCA_VLAN_ACT_PUSH: actions->flags |= BNXT_TC_ACTION_FLAG_PUSH_VLAN; actions->push_vlan_tci = htons(tcf_vlan_push_vid(tc_act)); actions->push_vlan_tpid = tcf_vlan_push_proto(tc_act); + break; + default: + return -EOPNOTSUPP; } + return 0; } static int bnxt_tc_parse_tunnel_set(struct bnxt *bp, @@ -136,7 +142,9 @@ static int bnxt_tc_parse_actions(struct bnxt *bp, /* Push/pop VLAN */ if (is_tcf_vlan(tc_act)) { - bnxt_tc_parse_vlan(bp, actions, tc_act); + rc = bnxt_tc_parse_vlan(bp, actions, tc_act); + if (rc) + return rc; continue; } -- 2.17.1