Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3729010imm; Mon, 8 Oct 2018 08:36:35 -0700 (PDT) X-Google-Smtp-Source: ACcGV63CPJmFl5R/uajX+ALmoZnYKIGz7q8BetUHmLRqUETzuLpag8Rxa4qHRTwYyXfhDMkjE6H0 X-Received: by 2002:a63:8e43:: with SMTP id k64-v6mr21124525pge.75.1539012995627; Mon, 08 Oct 2018 08:36:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539012995; cv=none; d=google.com; s=arc-20160816; b=gX6WAHTpTWiZE9LxmjY7QoEZDiFbSURlIiQtKlJQmSmCMGNK5VaKLNHr4Z72Rjq7qe wU+Q9QA7fBYl7IPzU1YfE17N/v44vkb4LGhpE+yw4FaJ8V7vuppEytBWVI/EROVgn90G B4J88BvzmAPepVWZhf1AxhdSGtx7CRx4YhwjU1Dyk9NDqamwnBClXxHR+6qyxk/+uG6P 8iEJ7T96JQQrCsohkPEhgfYiMlyXi4pfTjPPp7GS217iULdH1KunzaNbVzcVEc8Yx4yj DzPDNqMLvZug6Oi+oYfY87X3NMY3z/V7dh6pYt77LxFHfrjZZamd3okslZ4XuNU5eqnZ z5YQ== 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=0Ec7rSx6JERGhnknu5Z8MlZ4cjKO5p47MXkUXOZR3R0=; b=dK0BagAxOiC0OxyPpWDiPfWkkEMVjszlZO4ur/F/UPEbjANW1IQC1fRVZa1nIMhrU/ QxB0Qyzhs2gArd8p/3XIWWzRkHUJW9n9E5Ls0+jRKxTqWd4RRwmS/y4i+0a0pYrsO21S AMeuH9V4ZyqLWHskZHRBWCSApvmOhk0KjoAAdxOxDgNRsqyf6TdZHpomkEIBcMlHODiU Xgku2kIX4BltmIaDNK4wyxLZa8x3wJYUkeeF4kkoi0vBir6XUz+fIk3nncOhZ0q0cpdx d2aNrmEhb2u8y3BWtzsTd/ihp7ZSj9lx8uam3z7UjAJoYa03V1LlSsbs40QBhWqs00bT wDbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=a+ZyFAVv; 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 g82-v6si24018747pfj.283.2018.10.08.08.36.20; Mon, 08 Oct 2018 08:36:35 -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=a+ZyFAVv; 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 S1728249AbeJHWsS (ORCPT + 99 others); Mon, 8 Oct 2018 18:48:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:56626 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727579AbeJHWiP (ORCPT ); Mon, 8 Oct 2018 18:38:15 -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 DC759214DA; Mon, 8 Oct 2018 15:25:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1539012360; bh=wLeI+vNwtQr21xsh6IHMSSObsGV/0aq84JZuclNUEQo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=a+ZyFAVvy5K8tymbytRHUconrX/vGckLBoo8m8zNBx40CvQhNRyZ2dx4JPR4Hw9ZX 2qNJSJRH//rr/Ni4/3j1Dt1YVRXrMvJZZi2qS4PKCSBPOme/Rs1xyCDDquKaoDjIJe VS5v1EKDGPVVAYNbvpxyu6WH1ztmBi23pbh4Wn0U= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Sudarsana Reddy Kalluru , Sudarsana Reddy Kalluru , Tomer Tayar , "David S . Miller" , Sasha Levin Subject: [PATCH AUTOSEL 4.18 35/58] qed: Do not add VLAN 0 tag to untagged frames in multi-function mode. Date: Mon, 8 Oct 2018 11:25:00 -0400 Message-Id: <20181008152523.70705-35-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: Sudarsana Reddy Kalluru [ Upstream commit 0216da9413afa546627a1b0d319dfd17fef34050 ] In certain multi-function switch dependent modes, firmware adds vlan tag 0 to the untagged frames. This leads to double tagging for the traffic if the dcbx is enabled, which is not the desired behavior. To avoid this, driver needs to set "dcb_dont_add_vlan0" flag. Fixes: cac6f691 ("qed: Add support for Unified Fabric Port") Signed-off-by: Sudarsana Reddy Kalluru Signed-off-by: Tomer Tayar Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/qlogic/qed/qed_dcbx.c | 9 ++++++++- drivers/net/ethernet/qlogic/qed/qed_dcbx.h | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/qlogic/qed/qed_dcbx.c b/drivers/net/ethernet/qlogic/qed/qed_dcbx.c index e0680ce91328..09ed0ba4225a 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_dcbx.c +++ b/drivers/net/ethernet/qlogic/qed/qed_dcbx.c @@ -190,6 +190,7 @@ qed_dcbx_dp_protocol(struct qed_hwfn *p_hwfn, struct qed_dcbx_results *p_data) static void qed_dcbx_set_params(struct qed_dcbx_results *p_data, + struct qed_hwfn *p_hwfn, struct qed_hw_info *p_info, bool enable, u8 prio, @@ -206,6 +207,11 @@ qed_dcbx_set_params(struct qed_dcbx_results *p_data, else p_data->arr[type].update = DONT_UPDATE_DCB_DSCP; + /* Do not add vlan tag 0 when DCB is enabled and port in UFP/OV mode */ + if ((test_bit(QED_MF_8021Q_TAGGING, &p_hwfn->cdev->mf_bits) || + test_bit(QED_MF_8021AD_TAGGING, &p_hwfn->cdev->mf_bits))) + p_data->arr[type].dont_add_vlan0 = true; + /* QM reconf data */ if (p_info->personality == personality) p_info->offload_tc = tc; @@ -233,7 +239,7 @@ qed_dcbx_update_app_info(struct qed_dcbx_results *p_data, personality = qed_dcbx_app_update[i].personality; name = qed_dcbx_app_update[i].name; - qed_dcbx_set_params(p_data, p_info, enable, + qed_dcbx_set_params(p_data, p_hwfn, p_info, enable, prio, tc, type, personality); } } @@ -956,6 +962,7 @@ static void qed_dcbx_update_protocol_data(struct protocol_dcb_data *p_data, p_data->dcb_enable_flag = p_src->arr[type].enable; p_data->dcb_priority = p_src->arr[type].priority; p_data->dcb_tc = p_src->arr[type].tc; + p_data->dcb_dont_add_vlan0 = p_src->arr[type].dont_add_vlan0; } /* Set pf update ramrod command params */ diff --git a/drivers/net/ethernet/qlogic/qed/qed_dcbx.h b/drivers/net/ethernet/qlogic/qed/qed_dcbx.h index 5feb90e049e0..d950d836858c 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_dcbx.h +++ b/drivers/net/ethernet/qlogic/qed/qed_dcbx.h @@ -55,6 +55,7 @@ struct qed_dcbx_app_data { u8 update; /* Update indication */ u8 priority; /* Priority */ u8 tc; /* Traffic Class */ + bool dont_add_vlan0; /* Do not insert a vlan tag with id 0 */ }; #define QED_DCBX_VERSION_DISABLED 0 -- 2.17.1