Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp150954ybb; Fri, 27 Mar 2020 18:18:42 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtKVDM0XY9SyBQAk4IttVuR6rDKYsO/oMBlTN2dKkxbW2vOJ9YTuKReiZMpeIbQryH2GTFY X-Received: by 2002:a4a:e144:: with SMTP id p4mr1779661oot.55.1585358322159; Fri, 27 Mar 2020 18:18:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585358322; cv=none; d=google.com; s=arc-20160816; b=BBQdTDmvH3r1+5RPdzUaeahtYUwpEC7EVub56r6QDQaLsQ/3xRRfpZ8pXH9VO11MXt szOg1QYwJO3qUh36T+1rSYBnH0szOyqpf2Vcsfj4wdqoqzxYY/JmQfsBg4H2gP/0CAKD N56QvyMxuLSDSzLKkmh0kH9pmfVzdIMN85agHE6q52o33ArkTAuyX9ZNyBljf1HjepUB ALBSL7hmKDdQ2k1rXJr+PAm0w1QsdFgdRSQ+wWVtYM/KlIFvevW8a118VcE2XRZmoKys SZFaCuKYPdUbOVyBvwQCkNjBlmoBL5X8pbTZq7kWvMYTxxv3Biz4VtSqehsOzVoywA4e 006Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:to:from; bh=ChdsifEtgKz6DM0NOGvdm+u+PwExZgfuQSPL4SLgDoM=; b=YgeE7nJ5IRBblAAwnQZPEdu1X/R3Vv98bDLa6vZUDpdKEHacs3vRYuADU5MWbCtNGV lTLkqppH+qH7Y5anWE6X9M28aNAmKzK5Vnu2+n6iIGH85B+xv7nemXfckEZpLkX/4ZVZ yz7VG7/3C1+XjtGQEHDtCLAk90RzZC7C4eTlfWWMCJNtUKJroy/w9DJvtT8vxShiXNrf 24IqVw6V86LWT/v+onULJFjK9DiiPWfwqCmU6QNaW+hJzosudHjBxzoyE3RmrUGwWGiQ boS+pdXkOqwjEX1FzZSlBXvoJyXo72nZsIU4wDeJfVICY8WkJeeSVIWzkhCUtCzM08po 72sA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r67si1218930oib.237.2020.03.27.18.18.28; Fri, 27 Mar 2020 18:18:42 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727101AbgC1BRw (ORCPT + 99 others); Fri, 27 Mar 2020 21:17:52 -0400 Received: from inva021.nxp.com ([92.121.34.21]:53570 "EHLO inva021.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726212AbgC1BRv (ORCPT ); Fri, 27 Mar 2020 21:17:51 -0400 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 9BF112003B9; Sat, 28 Mar 2020 02:17:49 +0100 (CET) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 73854200069; Sat, 28 Mar 2020 02:17:43 +0100 (CET) Received: from localhost.localdomain (mega.ap.freescale.net [10.192.208.232]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 316B94028F; Sat, 28 Mar 2020 09:17:36 +0800 (SGT) From: Xiaoliang Yang To: xiaoliang.yang_1@nxp.com, Jose.Abreu@synopsys.com, davem@davemloft.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, olteanv@gmail.com, ivan.khoronzhuk@linaro.org, alexandre.belloni@bootlin.com, andrew@lunn.ch, vivien.didelot@gmail.com, po.liu@nxp.com, leoyang.li@nxp.com Subject: [net-next,v1] net: stmmac: support for tc mqprio offload Date: Sat, 28 Mar 2020 09:14:14 +0800 Message-Id: <20200328011414.42401-1-xiaoliang.yang_1@nxp.com> X-Mailer: git-send-email 2.17.1 X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch add support for tc mqprio offload to configure multiple prioritized TX traffic classes with mqprio. Signed-off-by: Xiaoliang Yang --- .../net/ethernet/stmicro/stmmac/stmmac_main.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 0e8c80f23557..b9dcd109a282 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -4214,6 +4214,21 @@ static int stmmac_setup_tc_block_cb(enum tc_setup_type type, void *type_data, static LIST_HEAD(stmmac_block_cb_list); +static int stmmac_tc_setup_mqprio(struct net_device *ndev, void *type_data) +{ + struct tc_mqprio_qopt *mqprio = type_data; + u8 num_tc; + int i; + + num_tc = mqprio->num_tc; + netif_set_real_num_tx_queues(ndev, num_tc); + netdev_set_num_tc(ndev, num_tc); + for (i = 0; i < num_tc; i++) + netdev_set_tc_queue(ndev, i, 1, i); + + return 0; +} + static int stmmac_setup_tc(struct net_device *ndev, enum tc_setup_type type, void *type_data) { @@ -4229,6 +4244,8 @@ static int stmmac_setup_tc(struct net_device *ndev, enum tc_setup_type type, return stmmac_tc_setup_cbs(priv, priv, type_data); case TC_SETUP_QDISC_TAPRIO: return stmmac_tc_setup_taprio(priv, priv, type_data); + case TC_SETUP_QDISC_MQPRIO: + return stmmac_tc_setup_mqprio(ndev, type_data); case TC_SETUP_QDISC_ETF: return stmmac_tc_setup_etf(priv, priv, type_data); default: -- 2.17.1