From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 29405A05A0; Tue, 21 Apr 2020 22:08:48 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 36AB61D55A; Tue, 21 Apr 2020 22:07:46 +0200 (CEST) Received: from rnd-relay.smtp.broadcom.com (rnd-relay.smtp.broadcom.com [192.19.229.170]) by dpdk.org (Postfix) with ESMTP id AF2461C2F8; Tue, 21 Apr 2020 22:07:30 +0200 (CEST) Received: from mail-irv-17.broadcom.com (mail-irv-17.lvn.broadcom.net [10.75.242.48]) by rnd-relay.smtp.broadcom.com (Postfix) with ESMTP id 3D9B530C138; Tue, 21 Apr 2020 12:55:54 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.10.3 rnd-relay.smtp.broadcom.com 3D9B530C138 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1587498954; bh=g5taBqkFayodh46Rlqsx3dvYvFYCZIPfh6Hk4j5FR8c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uUtZPgvYvEQhR87QSLLELJMgLpJeKeB7llBl/kCJpvLz8Fu59lDBh+As/uYg5kD2K PTpU5qCKmDDhWsczT/wTMijl0IPgKWTc/SIBP2wZZjuoFJojPQ9aR1ezktEzqhtio0 P3WykFDdsR9pYSpTCb3BAYYrDN0HwTOD7We3ASYg= Received: from localhost.localdomain (unknown [10.230.185.215]) by mail-irv-17.broadcom.com (Postfix) with ESMTP id 8A97D14008E; Tue, 21 Apr 2020 13:07:29 -0700 (PDT) From: Ajit Khaparde To: dev@dpdk.org Cc: Kalesh AP , stable@dpdk.org, Venkat Duvvuru Date: Tue, 21 Apr 2020 13:07:17 -0700 Message-Id: <20200421200720.81151-8-ajit.khaparde@broadcom.com> X-Mailer: git-send-email 2.21.1 (Apple Git-122.3) In-Reply-To: <20200421200720.81151-1-ajit.khaparde@broadcom.com> References: <20200421091257.8089-1-kalesh-anakkur.purayil@broadcom.com> <20200421200720.81151-1-ajit.khaparde@broadcom.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v2 07/10] net/bnxt: fix vlan add when port is stopped X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Kalesh AP Driver destroys the vnic when the port is brought down. When user tries to add a vlan when port is stopped, driver issues HWRM command to FW with invalid vnic_id and it fails. Fixed to return an error while setting vlan when port is not started. Fixes: b4e190d55c25 ("net/bnxt: fix MAC/VLAN filter allocation") Cc: stable@dpdk.org Signed-off-by: Kalesh AP Reviewed-by: Venkat Duvvuru Reviewed-by: Ajit Khaparde --- drivers/net/bnxt/bnxt_ethdev.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index 206111db5..589190b37 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -2082,6 +2082,11 @@ static int bnxt_vlan_filter_set_op(struct rte_eth_dev *eth_dev, if (rc) return rc; + if (!eth_dev->data->dev_started) { + PMD_DRV_LOG(ERR, "port must be started before setting vlan\n"); + return -EINVAL; + } + /* These operations apply to ALL existing MAC/VLAN filters */ if (on) return bnxt_add_vlan_filter(bp, vlan_id); -- 2.21.1 (Apple Git-122.3)