From patchwork Fri Jun 1 16:52:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salil Mehta X-Patchwork-Id: 137558 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp1177989lji; Fri, 1 Jun 2018 09:54:00 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLHCulS9nAQgDFRy+iyihCpc36yCogUF10YKBgUkSsLm2cP24K5vVejHOsE1zkT2Fqmbi5+ X-Received: by 2002:a63:6bc7:: with SMTP id g190-v6mr9475016pgc.230.1527872040748; Fri, 01 Jun 2018 09:54:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527872040; cv=none; d=google.com; s=arc-20160816; b=jxoFhaKWqZV04clnE4dziEe6Vy/6DgWZ+Wftw5DgFybKiLQhDttmG7jVJXSGeNveEY QiQESo8er/FEkYzRwTAsBn0YtdsuP1HWyvEXC2yBejUohUaDde+fyOeALn9OQyQT5OSS 0a2S/c+7tJTmI2XzyRJX7oaUjXsSIZ2xN7X8DjND/SF/XWaVYPrVuz1EUqo6r6gPcFmY 3+67u+k99FWJj+S7bqptTc5Y8/gZ2737yka6rEmsSEJi774aX9h4CbQXg8BCNQqr2TUw hpyPsdp2MTFzFiIrOOFgRBXIkTs+r150XUiGXODrloT2E/JNRdk7CS08wHU7aAZf2VSu 4+yA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=zsw3sx+27vhStJB64urAPQz1uJPQZIZpYrGfVDcT+cI=; b=ztlq+ZlvzrfsOJdwt45rZsMwGXzBoUQQb0ddsHbauctN+4prgjv6q0kOLLT18rAyGL HtJgWpojiDwkNQ3DbRAUpUoFMVOqKZFD3Im60mOjY8G6QWbRD0+mJVygkEDi+FR+WPD7 S9FMxmyK+wa7qJO4Ngas3aaJ5G1xa8pk/Vqi6T4IzzCSXilvB0+gCubtCbPLTXL4bt5D zD6aOORAP0xrXUniWbjE501sn/MZo2G3Q7naRdCIN50ZBTAyvBu8v5iOLeHk1UvT1aXT mGM/JKFETE3Egd5s56phRwWlcybIwFkFCTcJOPVBPhesm82lvpnQfFWo6u0ntskaTLFF GgjA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 13-v6si11954727pge.159.2018.06.01.09.54.00; Fri, 01 Jun 2018 09:54:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753271AbeFAQx6 (ORCPT + 9 others); Fri, 1 Jun 2018 12:53:58 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:8247 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751693AbeFAQxw (ORCPT ); Fri, 1 Jun 2018 12:53:52 -0400 Received: from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 2566DD2A6B364; Sat, 2 Jun 2018 00:53:36 +0800 (CST) Received: from S00293818-DELL1.china.huawei.com (10.202.227.234) by DGGEMS401-HUB.china.huawei.com (10.3.19.201) with Microsoft SMTP Server id 14.3.382.0; Sat, 2 Jun 2018 00:53:29 +0800 From: Salil Mehta To: CC: , , , , , , , Yunsheng Lin Subject: [PATCH net-next 01/11] net: hns3: Disable vf vlan filter when vf vlan table is full Date: Fri, 1 Jun 2018 17:52:01 +0100 Message-ID: <20180601165211.46372-2-salil.mehta@huawei.com> X-Mailer: git-send-email 2.8.3 In-Reply-To: <20180601165211.46372-1-salil.mehta@huawei.com> References: <20180601165211.46372-1-salil.mehta@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.202.227.234] X-CFilter-Loop: Reflected Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Yunsheng Lin This is only 128 entries for hardware's vf vlan table, when the vf table is full, the firmware will disable the vf vlan filter and return a resp_code of HCLGE_VF_VLAN_NO_ENTRY to driver. This patch checks the if resp_code from firmware is HCLGE_VF_VLAN_NO_ENTRY, if yes, then print a warning and return ok to the caller. Fixes: 46a3df9f9718 ("net: hns3: Add HNS3 Acceleration Engine & Compatibility Layer Support") Signed-off-by: Yunsheng Lin Signed-off-by: Peng Li Signed-off-by: Salil Mehta --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 7 +++++++ 1 file changed, 7 insertions(+) -- 2.7.4 diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index 6916685..4ca5318 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -4525,9 +4525,16 @@ static int hclge_set_vf_vlan_common(struct hclge_dev *hdev, int vfid, } if (!is_kill) { +#define HCLGE_VF_VLAN_NO_ENTRY 2 if (!req0->resp_code || req0->resp_code == 1) return 0; + if (req0->resp_code == HCLGE_VF_VLAN_NO_ENTRY) { + dev_warn(&hdev->pdev->dev, + "vf vlan table is full, vf vlan filter is disabled\n"); + return 0; + } + dev_err(&hdev->pdev->dev, "Add vf vlan filter fail, ret =%d.\n", req0->resp_code);