Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp10644841rwd; Thu, 22 Jun 2023 02:52:08 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ56qW+8qMOiN6SpshITJu6NHHOj2M9HH9RKl465BbwxaDSGyfhrSVUlwpGZds7byakWtzki X-Received: by 2002:a17:90a:1b0a:b0:25e:ff04:4fb with SMTP id q10-20020a17090a1b0a00b0025eff0404fbmr10695134pjq.23.1687427527666; Thu, 22 Jun 2023 02:52:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687427527; cv=none; d=google.com; s=arc-20160816; b=aNzBb4xmyE42fyzss+pBjJyz+W5Lq9xnsqnElu+tF0GgkvW4cSkI+cfC8EMzBDu8/q 6vFVwqJBGZ9k4lOBIQntl4lxa3xnbqU1ruXxfYRfvjAeftLgO4LOGQrOduNjXbowuFXA Dovlbc6/RAIn8aRI4jNvMYP7SAhG27inYcch94qB9E7Vn8wPjhkyurM7hW02Gjlk59W3 /EoZXmVUcp89aIw7vFwKc4eAEkVnWQXceWV7Ms96sYHQK7is5b5IqCC8+bYrVraWwv4S tejRM6e88VVph9yQP7g7mZYZnGJfDVhz+iNkONSj/3DmsbMmS0MkcuU17pt9/KDXUHDU NFLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=Rder2OAzgtZd3D78Lyy1oE9ERfYSQk2vWQvPHgIJsIA=; b=0QwftM/+5gSrq/3Fh+5tuh9Qb5R41xMIg0NgJwghzNGTxuL96jjeIWeIF5saXxr9ND QdELOnP1HtrXvsunHgY/zd0m+GrKOYoQ8HdNCfK1qF7yfbA7PN9wLbPauMNusSA1BaoK foz9mHku3ipnatFtgVaKq5OT1UZKWbJRAkWSfxXMINZxRYTBXOCquJkMn+vWlJd9zcNT JkwGFWItCyXcm2l0SKNgcxCi9jCa8YqcjQVuJajeWL8IqpIWYny4ztSsQQAcs+lffFgn QfB1d/PQB3e7BIGNdF8hPpaGNRUYh50crJ57ogcBsNWAqpLoGQxC0V3mrxAV4Lw5XaIV IYFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=T27vHxiX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=marvell.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mi15-20020a17090b4b4f00b00247101dd0c1si2327679pjb.15.2023.06.22.02.51.55; Thu, 22 Jun 2023 02:52:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=T27vHxiX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=marvell.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230384AbjFVJdz (ORCPT + 99 others); Thu, 22 Jun 2023 05:33:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38532 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232380AbjFVJdM (ORCPT ); Thu, 22 Jun 2023 05:33:12 -0400 Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 05EEA1BEA; Thu, 22 Jun 2023 02:26:37 -0700 (PDT) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 35M5mTLI020479; Thu, 22 Jun 2023 01:57:00 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=pfpt0220; bh=Rder2OAzgtZd3D78Lyy1oE9ERfYSQk2vWQvPHgIJsIA=; b=T27vHxiXglUV5sCW/F8XgqFkW2mnSQWBRaemy5Qw9LehmNuP+5tEH+xiD0sTMr3keW2t vMXkv9XeW7d7k3+Ui4Nztszt2iGSfYY30HwZbOeI9fd1ZegcnYlhWwHyuWyJ7va9jUCj 6eCeDEuCgHvjShwjHRYgSSPNEC8m6IJy+Aprt32m9HjjuA13JBfSKD5hK0bCVaQcWX6y aCWHWADmcVAI6+UghPSc+pYKCBq3tYCbRW3gWyrIJfGhEbcBdEIDn+Rl4U11b2I0UXJa GkuddFTD1GgfJ0yo11k6WTYKLSIr4HLxZOCHBZ0Z1gD66wC1MWSWPZsC38onOMQmUwfF og== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3rc97dhe4w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 22 Jun 2023 01:57:00 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Thu, 22 Jun 2023 01:56:58 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.48 via Frontend Transport; Thu, 22 Jun 2023 01:56:58 -0700 Received: from hyd1soter3.marvell.com (unknown [10.29.37.12]) by maili.marvell.com (Postfix) with ESMTP id 8F2273F7073; Thu, 22 Jun 2023 01:56:52 -0700 (PDT) From: Hariprasad Kelam To: , CC: , , , , , , , , , , , , , , , , , , Subject: [net-next Patch 2/3] sch_htb: Allow HTB quantum parameter in offload mode Date: Thu, 22 Jun 2023 14:26:37 +0530 Message-ID: <20230622085638.3509-3-hkelam@marvell.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230622085638.3509-1-hkelam@marvell.com> References: <20230622085638.3509-1-hkelam@marvell.com> MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-GUID: nbSKvtba8b_3rdl7zEhh-8t3BADEWlPE X-Proofpoint-ORIG-GUID: nbSKvtba8b_3rdl7zEhh-8t3BADEWlPE X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-06-22_05,2023-06-16_01,2023-05-22_02 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Naveen Mamindlapalli The current implementation of HTB offload returns the EINVAL error for quantum parameter. This patch removes the error returning checks for 'quantum' parameter and populates its value to tc_htb_qopt_offload structure such that driver can use the same. Add quantum parameter check in mlx5 driver, as mlx5 devices are not capable of supporting the quantum parameter when htb offload is used. Report error if quantum parameter is set to a non-default value. Signed-off-by: Naveen Mamindlapalli Signed-off-by: Hariprasad Kelam --- drivers/net/ethernet/mellanox/mlx5/core/en/qos.c | 4 ++-- include/net/pkt_cls.h | 1 + net/sched/sch_htb.c | 7 +++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/qos.c b/drivers/net/ethernet/mellanox/mlx5/core/en/qos.c index 1874c2f0587f..244bc15a42ab 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/qos.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/qos.c @@ -379,9 +379,9 @@ int mlx5e_htb_setup_tc(struct mlx5e_priv *priv, struct tc_htb_qopt_offload *htb_ if (!htb && htb_qopt->command != TC_HTB_CREATE) return -EINVAL; - if (htb_qopt->prio) { + if (htb_qopt->prio || htb_qopt->quantum) { NL_SET_ERR_MSG_MOD(htb_qopt->extack, - "prio parameter is not supported by device with HTB offload enabled."); + "prio and quantum parameters are not supported by device with HTB offload enabled."); return -EOPNOTSUPP; } diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h index a2ea45c7b53e..139cd09828af 100644 --- a/include/net/pkt_cls.h +++ b/include/net/pkt_cls.h @@ -866,6 +866,7 @@ struct tc_htb_qopt_offload { u32 parent_classid; u16 classid; u16 qid; + u32 quantum; u64 rate; u64 ceil; u8 prio; diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c index 325c29041c7d..333800a7d4eb 100644 --- a/net/sched/sch_htb.c +++ b/net/sched/sch_htb.c @@ -1810,10 +1810,6 @@ static int htb_change_class(struct Qdisc *sch, u32 classid, NL_SET_ERR_MSG(extack, "HTB offload doesn't support the mpu parameter"); goto failure; } - if (hopt->quantum) { - NL_SET_ERR_MSG(extack, "HTB offload doesn't support the quantum parameter"); - goto failure; - } } /* Keeping backward compatible with rate_table based iproute2 tc */ @@ -1910,6 +1906,7 @@ static int htb_change_class(struct Qdisc *sch, u32 classid, .rate = max_t(u64, hopt->rate.rate, rate64), .ceil = max_t(u64, hopt->ceil.rate, ceil64), .prio = hopt->prio, + .quantum = hopt->quantum, .extack = extack, }; err = htb_offload(dev, &offload_opt); @@ -1931,6 +1928,7 @@ static int htb_change_class(struct Qdisc *sch, u32 classid, .rate = max_t(u64, hopt->rate.rate, rate64), .ceil = max_t(u64, hopt->ceil.rate, ceil64), .prio = hopt->prio, + .quantum = hopt->quantum, .extack = extack, }; err = htb_offload(dev, &offload_opt); @@ -2017,6 +2015,7 @@ static int htb_change_class(struct Qdisc *sch, u32 classid, .rate = max_t(u64, hopt->rate.rate, rate64), .ceil = max_t(u64, hopt->ceil.rate, ceil64), .prio = hopt->prio, + .quantum = hopt->quantum, .extack = extack, }; err = htb_offload(dev, &offload_opt); -- 2.17.1