Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp209038ybh; Thu, 12 Mar 2020 00:14:36 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtMHuqKUDwwU9bHRss4UnP+SzI/rm2AJOd+G5sDzdvoFrltqq2ytDy3DrX7zmV81eaJs/to X-Received: by 2002:a9d:6358:: with SMTP id y24mr2261832otk.49.1583997276191; Thu, 12 Mar 2020 00:14:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583997276; cv=none; d=google.com; s=arc-20160816; b=zYCeJq7GlhCr+KdPu6OiHRfv7W1UGXSXaGBfgPxovTlEykvSfHh4ehOpGY6XBn9VWm zqJYalcKmBVL+PrJg7yRJb0YFYrhGQHyhBuTywFVIhu+naMMD4NLTcr/AGrconw4ucd7 V9+NDxf/HFVWESInVWhDSsYzSRSUODH8zumQhNRFwsol6SgGw+UpwVM53a6T2HMikgie 1WNzvJn5979yyGW0jhPRaOXmOGHUDxkpvHRYeK+BqrAySretDnJSAQMU7F3BY32Rq34w J1/EgVtHemNM3bK1Sl0El5/V4TNe5/cZEj6MQ0zJX10aND5qoYD7YjDv1bra5+dKwVTC m4RA== 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; bh=7nsSsRB00UNlYaR+HxBcCWz6ZjFdAMJOAURw+dA7Nrw=; b=OlYerhdg8iKhzScGHeoJu63alUktONhBCrBJo4sxjs4UFI0VCDWWybKcLrhiQuiH0b ALVJU3rlSO/mYgd8ErEo2hTjY5sb6Rsxj332okjTKMN77YnBDjVSYmf5HbxwKdhNWsHT +6VP2JodTrtnTOMEQ50SIlMO/JUND0fJBLyZMgYrL6baC+Ztk3UrvZiUesi99cqGRUX1 C8zsSMNZDbBVI6zja9UlTyen9R7hFEKAxA5NAFdit9hrpNtYGUFyI/7k66yjBAC7pq4g nhC+UgyiQ5B+elt629BElSggsE8s09WzAWyzmOxzUZ1rbMgXCrkYP8QXZqK9rCTjGacf bHuQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c203si2323398oib.273.2020.03.12.00.14.23; Thu, 12 Mar 2020 00:14:36 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388124AbgCLHMT (ORCPT + 99 others); Thu, 12 Mar 2020 03:12:19 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:11634 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2388083AbgCLHMR (ORCPT ); Thu, 12 Mar 2020 03:12:17 -0400 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 0F84D167B5C93E76AC93; Thu, 12 Mar 2020 15:12:14 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.487.0; Thu, 12 Mar 2020 15:12:06 +0800 From: Huazhong Tan To: CC: , , , , , , Yonglong Liu , Huazhong Tan Subject: [PATCH net 1/4] net: hns3: fix "tc qdisc del" failed issue Date: Thu, 12 Mar 2020 15:11:03 +0800 Message-ID: <1583997066-24773-2-git-send-email-tanhuazhong@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1583997066-24773-1-git-send-email-tanhuazhong@huawei.com> References: <1583997066-24773-1-git-send-email-tanhuazhong@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yonglong Liu The HNS3 driver supports to configure TC numbers and TC to priority map via "tc" tool. But when delete the rule, will fail, because the HNS3 driver needs at least one TC, but the "tc" tool sets TC number to zero when delete. This patch makes sure that the TC number is at least one. Fixes: 30d240dfa2e8 ("net: hns3: Add mqprio hardware offload support in hns3 driver") Signed-off-by: Yonglong Liu Signed-off-by: Huazhong Tan --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c index acb796c..a7f40aa 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c @@ -1711,7 +1711,7 @@ static int hns3_setup_tc(struct net_device *netdev, void *type_data) netif_dbg(h, drv, netdev, "setup tc: num_tc=%u\n", tc); return (kinfo->dcb_ops && kinfo->dcb_ops->setup_tc) ? - kinfo->dcb_ops->setup_tc(h, tc, prio_tc) : -EOPNOTSUPP; + kinfo->dcb_ops->setup_tc(h, tc ? tc : 1, prio_tc) : -EOPNOTSUPP; } static int hns3_nic_setup_tc(struct net_device *dev, enum tc_setup_type type, -- 2.7.4