Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp113478ybg; Mon, 8 Jun 2020 17:59:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzZM1tux1pslIs4JYkFTZ+k8eMXfKJNKfqBwh+7Qn+Jul2Cjr98Sg4JJ3LDt8k55LZnJpWY X-Received: by 2002:a50:9fc2:: with SMTP id c60mr25384046edf.319.1591664378985; Mon, 08 Jun 2020 17:59:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591664378; cv=none; d=google.com; s=arc-20160816; b=NvHecjB7n8ghbwVERED70ZASy0urSoioDinpOxwmit3BqO19rB8Y0j7f1dHpODTM8M gOi8atRsXa441ZUzGo6Y+I0rvHQt4ilXMlL3/YxVrtb03k0o/Ck34c5/jLx/nXCromtw 7OQHFLPzR8A8cOWlOBlxwdV59r7DWJ2/fEUR5gQnWH2vGBCkEedss6zjVdgwvtOU8+Dt knbnFmWRTveifgL865tiTQCivyJBZdchomH1ejlOdzCSf3tenKv8Fa07KA0vp4KJ2SXl n9wZTOW5J884/7pr0qU8QtqdrrkB4m1P/ndn43GVTtujrLNySPbJp/1kuiIpTFHiGZkw sfTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=XXiUENj9xLC51a3hmF/OJdyyVZvQ29UMSLM4xwFF7QQ=; b=KcPXxCfzbcsUrxjWMH9f1+Ou6XdzGvk0kKwXmQfFL03MR4UIMo6Igobf349D8Ti2DQ hMGmhVY1IJ76Rbs5xYOX6lwl5zPx5NfGDC6KZuQx3B6HMv2732MO4FlS40LM4dtlw7BO z8/4J9b4ErjN0OXXAO8/1T1RZpmaQEPIlKyEw8pEc0VI8ohKC8c+6s1gjuv+RLfKet1F RLn4NZH/cM32FefUQ9UJZJTVwdskAzKZEUbqkVgIQ9S62fJgqr5vqUwnTofBRMdJy/2J MFiwuuZYmQcibKv7f1dtUO5wrdYhJwya6G7yFyGXU834pbRIvdoScoENShAoNNJOJFUL PDpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=oCDWNenV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id v5si9646955ejj.410.2020.06.08.17.59.16; Mon, 08 Jun 2020 17:59:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=oCDWNenV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1728677AbgFIA5j (ORCPT + 99 others); Mon, 8 Jun 2020 20:57:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:54334 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728256AbgFHXIt (ORCPT ); Mon, 8 Jun 2020 19:08:49 -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 E2A5E20890; Mon, 8 Jun 2020 23:08:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591657728; bh=PUyU3U9isDmaYsYKg2rpQuCuvr/2DQIyf+WB6GzmRyQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oCDWNenV3khRsXaTAPT50HJksh3vDUleuUpZFjq3ZTRvU/fKbDps/Pp5kuTr41S9E nMXTeeZi6/LMatBmpceTfaxp4DG+JRxlnKaawoAG2rJ7/he/Eulynp8uVOJQZQlDhp Uw6ERkJ3JyzYPvGxi/SnGVQ8O2njKxiR7rYGRf9Q= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Jesper Dangaard Brouer , Ioana Ciornei , "David S . Miller" , Sasha Levin , netdev@vger.kernel.org Subject: [PATCH AUTOSEL 5.7 120/274] dpaa2-eth: fix return codes used in ndo_setup_tc Date: Mon, 8 Jun 2020 19:03:33 -0400 Message-Id: <20200608230607.3361041-120-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200608230607.3361041-1-sashal@kernel.org> References: <20200608230607.3361041-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jesper Dangaard Brouer [ Upstream commit b89c1e6bdc73f5775e118eb2ab778e75b262b30c ] Drivers ndo_setup_tc call should return -EOPNOTSUPP, when it cannot support the qdisc type. Other return values will result in failing the qdisc setup. This lead to qdisc noop getting assigned, which will drop all TX packets on the interface. Fixes: ab1e6de2bd49 ("dpaa2-eth: Add mqprio support") Signed-off-by: Jesper Dangaard Brouer Tested-by: Ioana Ciornei Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c index d97c320a2dc0..569e06d2bab2 100644 --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c @@ -2018,7 +2018,7 @@ static int dpaa2_eth_setup_tc(struct net_device *net_dev, int i; if (type != TC_SETUP_QDISC_MQPRIO) - return -EINVAL; + return -EOPNOTSUPP; mqprio->hw = TC_MQPRIO_HW_OFFLOAD_TCS; num_queues = dpaa2_eth_queue_count(priv); @@ -2030,7 +2030,7 @@ static int dpaa2_eth_setup_tc(struct net_device *net_dev, if (num_tc > dpaa2_eth_tc_count(priv)) { netdev_err(net_dev, "Max %d traffic classes supported\n", dpaa2_eth_tc_count(priv)); - return -EINVAL; + return -EOPNOTSUPP; } if (!num_tc) { -- 2.25.1