From patchwork Fri May 18 21:15:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 136371 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp1727966lji; Fri, 18 May 2018 14:16:33 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpyKMsp9XGvIzsuMFLaAL0Ioh5K8Yc9yNey8CUn3iLUWXU6MehNHjuU/P/t1OwCfXrNWxvn X-Received: by 2002:a17:902:8c83:: with SMTP id t3-v6mr11098724plo.357.1526678193678; Fri, 18 May 2018 14:16:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526678193; cv=none; d=google.com; s=arc-20160816; b=exPbJX6n863nzY4Lv5RucC8j/5btJpdmVI1t8Zjl0bGomSeTU0lFD+7GboQ0FG/Xaf jCXDHfRvPKJDdyUd5qYvB8KlSq16S92gn0bdMABgedyaz5ZhxyJzlu0cYCGquvoKrJf9 oomOr9MrRHDpXHFdJPnbPuCBaWADL4Dc7cTdJIVaHszcNgP4ZCcVnmF2/YCppqRzLxcX HYiHbIeJmNGEbcdkKg+NIvqbz5n4oxIwa8TmaFjZYye7ccXoKoghdNRgLLJu71zLTahl LbpWAP/KvbS+BZ/5CYKlwkndTuGkWM0IeseS4qlfrZrKlmdkGCm5vjYCeAimVlqmMRJq btXw== 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:arc-authentication-results; bh=2goMSuJTLIPVP1LiUGCXld9OtWQKdUTdKAVqXRx0QZ8=; b=Wgx2KgogAQ++MsnL16FWFcbRZ2Xb74gMKSJMzvMX7C0ccc4ynQTcKh71zrfGYL50TR JTLXtFuvsJhHvtvgSoGHkzQygoZ6f/9H0AWIsFfwtnh1gxWaoLBP3Dj2I+vNatuC7CkK zX195PZUbIHpm2GqJdDyXDwbHY1zAHoqDQq4WU7nVesYRt80HP7wjPg39txLl5KpmTf6 PpKcXg01532OmOA33MGn4iWSWOcmC/QslAjvnRGplh7wxMl9ZTO5cuofEaYSbzvAuiCO QpyJPebAZflL3N7sIdSKAIgEaNQLh1mn6fi95PCDFzt4lOJKF2KMObnQOocTXFSKDUZ6 UZ5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=J1+jkHPH; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m2-v6si8463423pfb.259.2018.05.18.14.16.33; Fri, 18 May 2018 14:16:33 -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; dkim=pass header.i=@linaro.org header.s=google header.b=J1+jkHPH; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752561AbeERVQa (ORCPT + 9 others); Fri, 18 May 2018 17:16:30 -0400 Received: from mail-lf0-f67.google.com ([209.85.215.67]:37161 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751906AbeERVPW (ORCPT ); Fri, 18 May 2018 17:15:22 -0400 Received: by mail-lf0-f67.google.com with SMTP id r2-v6so15913088lff.4 for ; Fri, 18 May 2018 14:15:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2goMSuJTLIPVP1LiUGCXld9OtWQKdUTdKAVqXRx0QZ8=; b=J1+jkHPHNpEdUckB4dTrFUnod3h3Gp3RQxZhxJdqAdiWnlb6OZNIMfDkYzQgsH0eM9 ++H2XIT8FVye68gMoW3yCnDeJmcBa2M7XsKLfKA19b3pV0DL84EWDFYkNGm5DtgbHYhy /7Rnddnt4VtQnQH2V+UBpaOZwknIlc4h4z+MQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=2goMSuJTLIPVP1LiUGCXld9OtWQKdUTdKAVqXRx0QZ8=; b=YGh0m2twl11qBHM32xrddSGkpacR3/Xg6/Y80ISxBgj5NHjk3OHqZ/hHvUxaI7BWUQ 7iTlPp2C2Cy3uy/4wz6jBXDoDlR/Dy8aLfNTi8F+ISJ/1by7xx7ygFUOv9K+a+SXfxYw MeTceoNWGFrHBdbqh87yxw/pZ36tZgUlcG3E7buj92PQjo95aizW1qMcE9UMF09ZumPs TmVa2vuxgAFHOnNgrbngiP2Bynu2/+KGjOfVCLzSZzJC8EWirxEjSjXfH+flOICdmmkC rSgu7zM7iZ/vKBmSnsHwR6kSzrfJseNVZhj4oOfVX59CkSYpl9jfUxshDRkDRML7jbz1 EQXA== X-Gm-Message-State: ALKqPwdF8V4rEMbZn8K012jd3c6WA+Dw8x9CCB+9b0LxFpm1FwH0J4R5 00K3N7Rwpj/w8KknXcRRPGfp9w== X-Received: by 2002:a19:7906:: with SMTP id u6-v6mr21249412lfc.34.1526678120005; Fri, 18 May 2018 14:15:20 -0700 (PDT) Received: from localhost.localdomain (59-201-94-178.pool.ukrtel.net. [178.94.201.59]) by smtp.gmail.com with ESMTPSA id g20-v6sm2045991lfk.39.2018.05.18.14.15.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 May 2018 14:15:19 -0700 (PDT) From: Ivan Khoronzhuk To: grygorii.strashko@ti.com, davem@davemloft.net Cc: corbet@lwn.net, akpm@linux-foundation.org, netdev@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, vinicius.gomes@intel.com, henrik@austad.us, jesus.sanchez-palencia@intel.com, Ivan Khoronzhuk Subject: [RFC PATCH 3/6] net: ethernet: ti: cpsw: add MQPRIO Qdisc offload Date: Sat, 19 May 2018 00:15:07 +0300 Message-Id: <20180518211510.13341-4-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180518211510.13341-1-ivan.khoronzhuk@linaro.org> References: <20180518211510.13341-1-ivan.khoronzhuk@linaro.org> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org That's possible to offload vlan to tc priority mapping with assumption sk_prio == L2 prio. Example: $ ethtool -L eth0 rx 1 tx 4 $ qdisc replace dev eth0 handle 100: parent root mqprio num_tc 3 \ map 2 2 1 0 2 2 2 2 2 2 2 2 2 2 2 2 queues 1@0 1@1 2@2 hw 1 $ tc -g class show dev eth0 +---(100:ffe2) mqprio |    +---(100:3) mqprio |    +---(100:4) mqprio |     +---(100:ffe1) mqprio |    +---(100:2) mqprio |     +---(100:ffe0) mqprio     +---(100:1) mqprio Here, 100:1 is txq0, 100:2 is txq1, 100:3 is txq2, 100:4 is txq3 txq0 belongs to tc0, txq1 to tc1, txq2 and txq3 to tc2 The offload part only maps L2 prio to classes of traffic, but not to transmit queues, so to direct traffic to traffic class vlan has to be created with appropriate egress map. Signed-off-by: Ivan Khoronzhuk --- drivers/net/ethernet/ti/cpsw.c | 82 ++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) -- 2.17.0 diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c index 9bd615da04d3..4b232cda5436 100644 --- a/drivers/net/ethernet/ti/cpsw.c +++ b/drivers/net/ethernet/ti/cpsw.c @@ -39,6 +39,7 @@ #include #include +#include #include "cpsw.h" #include "cpsw_ale.h" @@ -153,6 +154,8 @@ do { \ #define IRQ_NUM 2 #define CPSW_MAX_QUEUES 8 #define CPSW_CPDMA_DESCS_POOL_SIZE_DEFAULT 256 +#define CPSW_TC_NUM 4 +#define CPSW_FIFO_SHAPERS_NUM (CPSW_TC_NUM - 1) #define CPSW_RX_VLAN_ENCAP_HDR_PRIO_SHIFT 29 #define CPSW_RX_VLAN_ENCAP_HDR_PRIO_MSK GENMASK(2, 0) @@ -453,6 +456,7 @@ struct cpsw_priv { u8 mac_addr[ETH_ALEN]; bool rx_pause; bool tx_pause; + bool mqprio_hw; u32 emac_port; struct cpsw_common *cpsw; }; @@ -1577,6 +1581,14 @@ static void cpsw_slave_stop(struct cpsw_slave *slave, struct cpsw_common *cpsw) soft_reset_slave(slave); } +static int cpsw_tc_to_fifo(int tc, int num_tc) +{ + if (tc == num_tc - 1) + return 0; + + return CPSW_FIFO_SHAPERS_NUM - tc; +} + static int cpsw_ndo_open(struct net_device *ndev) { struct cpsw_priv *priv = netdev_priv(ndev); @@ -2190,6 +2202,75 @@ static int cpsw_ndo_set_tx_maxrate(struct net_device *ndev, int queue, u32 rate) return ret; } +static int cpsw_set_tc(struct net_device *ndev, void *type_data) +{ + struct tc_mqprio_qopt_offload *mqprio = type_data; + struct cpsw_priv *priv = netdev_priv(ndev); + struct cpsw_common *cpsw = priv->cpsw; + int fifo, num_tc, count, offset; + struct cpsw_slave *slave; + u32 tx_prio_map = 0; + int i, tc, ret; + + num_tc = mqprio->qopt.num_tc; + if (num_tc > CPSW_TC_NUM) + return -EINVAL; + + if (mqprio->mode != TC_MQPRIO_MODE_DCB) + return -EINVAL; + + ret = pm_runtime_get_sync(cpsw->dev); + if (ret < 0) { + pm_runtime_put_noidle(cpsw->dev); + return ret; + } + + if (num_tc) { + for (i = 0; i < 8; i++) { + tc = mqprio->qopt.prio_tc_map[i]; + fifo = cpsw_tc_to_fifo(tc, num_tc); + tx_prio_map |= fifo << (4 * i); + } + + netdev_set_num_tc(ndev, num_tc); + for (i = 0; i < num_tc; i++) { + count = mqprio->qopt.count[i]; + offset = mqprio->qopt.offset[i]; + netdev_set_tc_queue(ndev, i, count, offset); + } + } + + if (!mqprio->qopt.hw) { + /* restore default configuration */ + netdev_reset_tc(ndev); + tx_prio_map = TX_PRIORITY_MAPPING; + } + + priv->mqprio_hw = mqprio->qopt.hw; + + offset = cpsw->version == CPSW_VERSION_1 ? + CPSW1_TX_PRI_MAP : CPSW2_TX_PRI_MAP; + + slave = &cpsw->slaves[cpsw_slave_index(cpsw, priv)]; + slave_write(slave, tx_prio_map, offset); + + pm_runtime_put_sync(cpsw->dev); + + return 0; +} + +static int cpsw_ndo_setup_tc(struct net_device *ndev, enum tc_setup_type type, + void *type_data) +{ + switch (type) { + case TC_SETUP_QDISC_MQPRIO: + return cpsw_set_tc(ndev, type_data); + + default: + return -EOPNOTSUPP; + } +} + static const struct net_device_ops cpsw_netdev_ops = { .ndo_open = cpsw_ndo_open, .ndo_stop = cpsw_ndo_stop, @@ -2205,6 +2286,7 @@ static const struct net_device_ops cpsw_netdev_ops = { #endif .ndo_vlan_rx_add_vid = cpsw_ndo_vlan_rx_add_vid, .ndo_vlan_rx_kill_vid = cpsw_ndo_vlan_rx_kill_vid, + .ndo_setup_tc = cpsw_ndo_setup_tc, }; static int cpsw_get_regs_len(struct net_device *ndev) From patchwork Fri May 18 21:15:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 136369 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp1727466lji; Fri, 18 May 2018 14:16:04 -0700 (PDT) X-Google-Smtp-Source: AB8JxZopDtcSkbTFClXnyeOvBJC04b6jcyx0IsOqMw1bA0g8auws4HVPKxpkmrHWMiVV3CmsfKjS X-Received: by 2002:a17:902:d707:: with SMTP id w7-v6mr6560498ply.142.1526678163911; Fri, 18 May 2018 14:16:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526678163; cv=none; d=google.com; s=arc-20160816; b=fTr8mK+qcW02rnnOMZvwPMhF9LWR5HbMNqesVhGZRCF37wcjvf3YwBnyQolTg7anF7 zTFdt2bFQZfsqjMvm5Liv9HSobfSzo6kk6jeDtomzAqUC28vdW6n6xpPuANB49DNL5r4 IGtdWCJU+5mFI/ruoeeSi5CoLB7m8dzNXLgXZverqisubewkAo9IRjmLkmtXztxC/SlB erU/f/+6hG+IgkNDl/FxqwhyehTv6RCDDLlJzIgqvUMXXLPXTkw25bGyyKwH3IaApBsw C2HUN7c8dOf7+pYEKu9F4uucjErXOcLQ6OIHV7poQ7b3UbaVxHDD7gkmuY76qopcAT0a bdCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=ipc/qNQrKTE3lp0xIgbG2YftOJpAgeq9/oT0QY88PVM=; b=Zw6w8xmOf2slkb0YFofgUKse0hFWvYa80+4YQtQGxGHH7f3jH55UqFmR0BAO+q/zh/ SkXsbGPZ3rExXIQXalOzXKDbZYchb2HJHIcBxAEvVEo50UR4j/ukygSGrUbw2sanlZfO UDgxkZ45bZ27LxkDKvA5ifvOE+BmwmUfgNJFyrO8tNbLcfTCquxWvjicPg3xARGgW2YE UJxceRfYN09f54obxl/oXqnaDiBOA5uVhqbA/5pbKdVUvonlo68mpNZ6S23yWGwBEtP2 fu9IeKOO7NKzIW3qWPTPv5D3QCuOLEjQS9YTIba+xbrKYaGM63P++b2FVErZtMBJQ0FA 1wqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cYLg6nVg; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y67-v6si8392080pfi.195.2018.05.18.14.16.03; Fri, 18 May 2018 14:16:03 -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; dkim=pass header.i=@linaro.org header.s=google header.b=cYLg6nVg; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752522AbeERVQC (ORCPT + 9 others); Fri, 18 May 2018 17:16:02 -0400 Received: from mail-lf0-f66.google.com ([209.85.215.66]:42658 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752218AbeERVPY (ORCPT ); Fri, 18 May 2018 17:15:24 -0400 Received: by mail-lf0-f66.google.com with SMTP id b18-v6so15881915lfa.9 for ; Fri, 18 May 2018 14:15:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ipc/qNQrKTE3lp0xIgbG2YftOJpAgeq9/oT0QY88PVM=; b=cYLg6nVgAizCZaRcHDYMwkNLbvsEl/X3OuHR7MGL8URg4qSyVubNI3Y0DkGjdn+Fzw E3Ul2yLZQhINnJ/dIdmQiCrxlhbaFBFtUdck2yNIVLu1AGed2j0Px3K5L580JZ2GiRiJ v/oKeeE+LtPsjf38SVUjT9EPCnlOfSp/y+1lc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ipc/qNQrKTE3lp0xIgbG2YftOJpAgeq9/oT0QY88PVM=; b=aAGMpmgxi5z3c5Odj7v06LDbnfI3tRynAyRmPWMeqKF7tHW2OdMefGjUMm/435ENNw hXUYtid7IJm1ciTjnfICwMsIo/V6VLm/GFmBmoxQUMFQ3v2Q7fSl95QNambrSs3DNcjD /U2Z0w0qRtmU5S3T5VL63mXfgaJ83NUegGsJGlF6dcMFR815Na9W1fQ26ETto0xhl+z6 PaClUTLjxJ1hYI63n7vMYAGZwIyfxph53xQyXI/SZQz4Obw0YvdkOvnKmRaV8j5vAtOj oqVpp1LQouKPhEWJAvCTpQm64jk46CcUHjWs4Kqf5ksJWKSlx9KFVxH5Lu/KcU4Itm9F IXeg== X-Gm-Message-State: ALKqPwe0FEJDthdDP8MILLAvhIZAxcmJLkV4ROG1rOLMvEBZ/fiUE7cZ RI041lL5SHo+n4YNZfIYoXszqQ== X-Received: by 2002:a19:e10c:: with SMTP id y12-v6mr19149717lfg.9.1526678122503; Fri, 18 May 2018 14:15:22 -0700 (PDT) Received: from localhost.localdomain (59-201-94-178.pool.ukrtel.net. [178.94.201.59]) by smtp.gmail.com with ESMTPSA id g20-v6sm2045991lfk.39.2018.05.18.14.15.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 May 2018 14:15:21 -0700 (PDT) From: Ivan Khoronzhuk To: grygorii.strashko@ti.com, davem@davemloft.net Cc: corbet@lwn.net, akpm@linux-foundation.org, netdev@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, vinicius.gomes@intel.com, henrik@austad.us, jesus.sanchez-palencia@intel.com, Ivan Khoronzhuk Subject: [RFC PATCH 5/6] net: ethernet: ti: cpsw: restore shaper configuration while down/up Date: Sat, 19 May 2018 00:15:09 +0300 Message-Id: <20180518211510.13341-6-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180518211510.13341-1-ivan.khoronzhuk@linaro.org> References: <20180518211510.13341-1-ivan.khoronzhuk@linaro.org> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Need to restore shapers configuration after interface was down/up. This is needed as appropriate configuration is still replicated in kernel settings. This only shapers context restore, so vlan configuration should be restored by user if needed, especially for devices with one port where vlan frames are sent via ALE. Signed-off-by: Ivan Khoronzhuk --- drivers/net/ethernet/ti/cpsw.c | 47 ++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) -- 2.17.0 diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c index c7710b0e1c17..c3e88be36c1b 100644 --- a/drivers/net/ethernet/ti/cpsw.c +++ b/drivers/net/ethernet/ti/cpsw.c @@ -1807,6 +1807,51 @@ static int cpsw_set_cbs(struct net_device *ndev, return ret; } +static void cpsw_cbs_resume(struct cpsw_slave *slave, struct cpsw_priv *priv) +{ + int fifo, bw; + + for (fifo = CPSW_FIFO_SHAPERS_NUM; fifo > 0; fifo--) { + bw = priv->fifo_bw[fifo]; + if (!bw) + continue; + + cpsw_set_fifo_rlimit(priv, fifo, bw); + } +} + +static void cpsw_mqprio_resume(struct cpsw_slave *slave, struct cpsw_priv *priv) +{ + struct cpsw_common *cpsw = priv->cpsw; + u32 tx_prio_map = 0; + int i, tc, fifo; + u32 tx_prio_rg; + + if (!priv->mqprio_hw) + return; + + for (i = 0; i < 8; i++) { + tc = netdev_get_prio_tc_map(priv->ndev, i); + fifo = CPSW_FIFO_SHAPERS_NUM - tc; + tx_prio_map |= fifo << (4 * i); + } + + tx_prio_rg = cpsw->version == CPSW_VERSION_1 ? + CPSW1_TX_PRI_MAP : CPSW2_TX_PRI_MAP; + + slave_write(slave, tx_prio_map, tx_prio_rg); +} + +/* restore resources after port reset */ +static void cpsw_restore(struct cpsw_priv *priv) +{ + /* restore MQPRIO offload */ + for_each_slave(priv, cpsw_mqprio_resume, priv); + + /* restore CBS offload */ + for_each_slave(priv, cpsw_cbs_resume, priv); +} + static int cpsw_ndo_open(struct net_device *ndev) { struct cpsw_priv *priv = netdev_priv(ndev); @@ -1886,6 +1931,8 @@ static int cpsw_ndo_open(struct net_device *ndev) } + cpsw_restore(priv); + /* Enable Interrupt pacing if configured */ if (cpsw->coal_intvl != 0) { struct ethtool_coalesce coal;