Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp3682251rwb; Tue, 20 Sep 2022 03:14:01 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4EF19XQs2oOR/1Zs2rTBP8PoLz+4tgaso9/K2Rjr0+6/PU7QzdI9SViHKcpWEnKOEal697 X-Received: by 2002:a05:6402:3408:b0:43c:2dd3:d86b with SMTP id k8-20020a056402340800b0043c2dd3d86bmr19540474edc.108.1663668841732; Tue, 20 Sep 2022 03:14:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663668841; cv=none; d=google.com; s=arc-20160816; b=oKIM9cMmefeDu1wb7TX1nvxmskWKVH7EA6SzPEJUchc4WQ7twhOhGYwpe3JZvaZntZ SJUl2rkO3WCcyOuBDncz0826gXt1Ckro33ByJDW7AMBeQtVR1TJMbAvTRLjM7BGf2Ph/ MnAkblLTDBJWN4kUIuDjgNqK9PqwLPOWrV0fn00VnFv5pj+cYXC5uunyT/SHwmwmOMGX hx+Y7BTgfqefJaUksbgt3ddLtj2o5sEG13CkAHlVTwALBuW4Fj2stOkXQoKvUn31Yp7O sd7Bl0bXT7bBXOM7sGv/ktGVA1BV375UzZPfnYJMpW/EDXnNMdVTbMy+LD4p8iw1Hra1 P64w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=2Fl9EdATDnlafnKqF0KXOo7UtkhfgKpuDpThipzkclY=; b=ABfhqEobL2kNhm5DMT1lxIUvGbWA+USM/P3qkPXnLTYEBXO/kGBhcuy4UwMrekVT1M PHmLbfLxPx8CNP/EHXM9MXY0oVE9FGNodbQuMhkkGT/Ju9XChuqrIfgVLDHi1c3nvt0X KwWmcKrVoH/BKLM8vpxx9wMzmzWRuQDNbELHGWTnIQOfBHPfbyDXV62oScSBO7hPl0Nk Zd4eBKhKg3XnYxTXLKZRHjxNMUizexi9wvJzNNDy+LjawC07e5EzwuW8ZFjnaVqUkIFG Wj24dwUE1K68CQnQFQqk1sZB1QJU8dcokNT0jXFAHxkD7QkuedCTKyeU9GgDjjejr2/P 8usw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=lpS094vr; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f13-20020a0564021e8d00b0043a9bb390d3si1461297edf.278.2022.09.20.03.13.35; Tue, 20 Sep 2022 03:14:01 -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=@microchip.com header.s=mchp header.b=lpS094vr; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230423AbiITKFa (ORCPT + 99 others); Tue, 20 Sep 2022 06:05:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59710 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230122AbiITKF1 (ORCPT ); Tue, 20 Sep 2022 06:05:27 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC8714D176; Tue, 20 Sep 2022 03:05:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1663668325; x=1695204325; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Qbukx3qf1IM8ITrfV7Uk6zZZN+zzo2s2msSilYCaRxw=; b=lpS094vrj9S6vXFINqzvGuv5MyoTnjfwVc7V9y0SfAs3VvepPIg/kT/F zv44SoWDrzGcGeCiYTlQwnkl88q53Jc8QtVbfBSTUUKYWkLQgmIQZiZx2 ANyNNfnQxTgdu4Di6vdsKzmpgg7YJZ3NyoA0Zw3JsPgFbJ1eKl+cjX2yC sTvPrChcEj8yZJNiqWv8lW7mWJwXPfbCk24Mdgl0/7oD8/WGtM4kNi9Eu zLSyErMGoqx1olKDwrPWlQ/5wk0EVmI66RuIg+/4IUtMYmceqgtVkeTS1 c/Ra1yOSDI6Z6Eh7IsZxJ9WGh5lPwoAvZQkn+PR+fngbWFrBaMQjc9nEk Q==; X-IronPort-AV: E=Sophos;i="5.93,330,1654585200"; d="scan'208";a="191591341" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa1.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 20 Sep 2022 03:05:25 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.87.72) by chn-vm-ex02.mchp-main.com (10.10.87.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.12; Tue, 20 Sep 2022 03:05:24 -0700 Received: from DEN-LT-70577.microchip.com (10.10.115.15) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.2507.12 via Frontend Transport; Tue, 20 Sep 2022 03:05:22 -0700 From: Daniel Machon To: CC: , , , , , , , , , , , , Steen Hegelund Subject: [PATCH net-next v2 1/5] net: microchip: sparx5: add tc setup hook Date: Tue, 20 Sep 2022 12:14:28 +0200 Message-ID: <20220920101432.139323-2-daniel.machon@microchip.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220920101432.139323-1-daniel.machon@microchip.com> References: <20220920101432.139323-1-daniel.machon@microchip.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS 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 Add tc setup hook for QoS features. Signed-off-by: Daniel Machon Signed-off-by: Steen Hegelund --- .../net/ethernet/microchip/sparx5/Makefile | 2 +- .../ethernet/microchip/sparx5/sparx5_netdev.c | 2 ++ .../net/ethernet/microchip/sparx5/sparx5_tc.c | 19 +++++++++++++++++++ .../net/ethernet/microchip/sparx5/sparx5_tc.h | 15 +++++++++++++++ 4 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 drivers/net/ethernet/microchip/sparx5/sparx5_tc.c create mode 100644 drivers/net/ethernet/microchip/sparx5/sparx5_tc.h diff --git a/drivers/net/ethernet/microchip/sparx5/Makefile b/drivers/net/ethernet/microchip/sparx5/Makefile index 4402c3ed1dc5..1d21d8ef891a 100644 --- a/drivers/net/ethernet/microchip/sparx5/Makefile +++ b/drivers/net/ethernet/microchip/sparx5/Makefile @@ -8,4 +8,4 @@ obj-$(CONFIG_SPARX5_SWITCH) += sparx5-switch.o sparx5-switch-objs := sparx5_main.o sparx5_packet.o \ sparx5_netdev.o sparx5_phylink.o sparx5_port.o sparx5_mactable.o sparx5_vlan.o \ sparx5_switchdev.o sparx5_calendar.o sparx5_ethtool.o sparx5_fdma.o \ - sparx5_ptp.o sparx5_pgid.o + sparx5_ptp.o sparx5_pgid.o sparx5_tc.o diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_netdev.c b/drivers/net/ethernet/microchip/sparx5/sparx5_netdev.c index af4d3e1f1a6d..c1a357f45a06 100644 --- a/drivers/net/ethernet/microchip/sparx5/sparx5_netdev.c +++ b/drivers/net/ethernet/microchip/sparx5/sparx5_netdev.c @@ -7,6 +7,7 @@ #include "sparx5_main_regs.h" #include "sparx5_main.h" #include "sparx5_port.h" +#include "sparx5_tc.h" /* The IFH bit position of the first VSTAX bit. This is because the * VSTAX bit positions in Data sheet is starting from zero. @@ -228,6 +229,7 @@ static const struct net_device_ops sparx5_port_netdev_ops = { .ndo_get_stats64 = sparx5_get_stats64, .ndo_get_port_parent_id = sparx5_get_port_parent_id, .ndo_eth_ioctl = sparx5_port_ioctl, + .ndo_setup_tc = sparx5_port_setup_tc, }; bool sparx5_netdevice_check(const struct net_device *dev) diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_tc.c b/drivers/net/ethernet/microchip/sparx5/sparx5_tc.c new file mode 100644 index 000000000000..1bafca0be795 --- /dev/null +++ b/drivers/net/ethernet/microchip/sparx5/sparx5_tc.c @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* Microchip Sparx5 Switch driver + * + * Copyright (c) 2022 Microchip Technology Inc. and its subsidiaries. + */ + +#include "sparx5_tc.h" +#include "sparx5_main.h" + +int sparx5_port_setup_tc(struct net_device *ndev, enum tc_setup_type type, + void *type_data) +{ + switch (type) { + default: + return -EOPNOTSUPP; + } + + return 0; +} diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_tc.h b/drivers/net/ethernet/microchip/sparx5/sparx5_tc.h new file mode 100644 index 000000000000..5b55e11b77e1 --- /dev/null +++ b/drivers/net/ethernet/microchip/sparx5/sparx5_tc.h @@ -0,0 +1,15 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* Microchip Sparx5 Switch driver + * + * Copyright (c) 2022 Microchip Technology Inc. and its subsidiaries. + */ + +#ifndef __SPARX5_TC_H__ +#define __SPARX5_TC_H__ + +#include + +int sparx5_port_setup_tc(struct net_device *ndev, enum tc_setup_type type, + void *type_data); + +#endif /* __SPARX5_TC_H__ */ -- 2.34.1