Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5237732rdb; Wed, 13 Dec 2023 03:07:59 -0800 (PST) X-Google-Smtp-Source: AGHT+IH2lcwI9v1QKpwswtCZQDkXTJp6ntxWIoLB+z/zEUSt+il3gMFQPRlMPZQErEkA0mIlO5Np X-Received: by 2002:a17:903:2613:b0:1d3:531e:3fa1 with SMTP id jd19-20020a170903261300b001d3531e3fa1mr532431plb.54.1702465679544; Wed, 13 Dec 2023 03:07:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702465679; cv=none; d=google.com; s=arc-20160816; b=WUd4qQYnDxiPR29rtnrvGvb9n82WMzNOFmSzlTg7IeyYuGHU6neMj5KBfosnLzh6R8 M90Q0H9nf5BnyeoffXq99KL7dHMgXmXNofBr+VqGKgJroZl7hxzJd5fdLAi98ZdF1Hc6 Br8wSie9J7avIVoDkDllMEoubLO8b5xNwPCcn12Z4ysoDJc6uCvvDgw9bH8MeYPAq61z OlzKCPZKWpR4hiriZWlj+yTP4Js9FXY7ZASQirLTIMPk0w34DQOGDqACxkx376EChR1k OZH5jlSKM0J+OQQSAkhZlfzZCq0WKBu3OXhR/849B/PaHrpm4nWBrWXt68qc5vZFOTfp dv7A== 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=W0/ZPhX479ETURR+0KsAkvtV5blyfzy9aLKAjSOU4ck=; fh=asmpGj2YxYe8/ji4bMUZUZytUYtbGpU9WbAkliy8rO0=; b=CakRYYi/wiHOVBYHEldKB1RlSfuEO4sBKqWN/+LK41zkbqgqjtIWC9UC2S5ZrjeML9 PKLVzElzZaGyxfcCGTz1sF9mKojZV5hDyXXhCq6RS5w51FF6iwbYl9Zu/XrdY+ddgzNF GUuCz83R3bEmErn5FBV1EfiNF1fOCb8RDcOzvsgd5PEhurJ2quJ2fTiA3+Os4TLua11E PPSkT+ygYDADzwv0sZPo4kkDbbR+MLT18ZAPmZNFnzMsIOw5rpJ6BWSdwIHek5leCN0V 6xv7WIjW3oFyoZwE2Z5Ob5HZItseUSKeNc1E8c/mnkdB8KlgP9eoiIAyn80Rfe4aAA4t 39OA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZSYFysQB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id q4-20020a170902dac400b001d344a4e98dsi1913796plx.607.2023.12.13.03.07.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 03:07:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZSYFysQB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 224DC81EB445; Wed, 13 Dec 2023 03:07:57 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378592AbjLMLHh (ORCPT + 99 others); Wed, 13 Dec 2023 06:07:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53334 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378636AbjLMLHf (ORCPT ); Wed, 13 Dec 2023 06:07:35 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E1C54F4 for ; Wed, 13 Dec 2023 03:07:40 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E951DC433CB; Wed, 13 Dec 2023 11:07:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702465660; bh=52ReVQRfMYa8eSEYp3Q551Bgs6BSsEBuYjMXwOgtZDI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZSYFysQB/jy7zZzwqlcMAbLLpBmLbquAsKPm4x6KMzPwIgQkNbfwPcfvGuxGksHa+ 75QsTM/swmTMq/q3E9uWMpLYhcfIopVw6y5v6RtN018LzD+tZvGvZlWrkwgqEBJMPb f7ZHMd8k9MA5yBov3Rj6Lib7g73iKOyiI3OVy6a+Qpe4KsDoTACyRDej0gdBSA6f21 VfJrOJREZWn2FT1USknqInEbjjjFa0DJuf2C86xXZCKeRvlCP9msXY+FvULZ1xkg5l i15yf656KZfMOpQS8+beYL6JVle6LSruzCtGeacQzdbpnQm4/hGDyVQGIfe2IZ+k42 6F9sVqYu7puEg== From: Roger Quadros To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, shuah@kernel.org, vladimir.oltean@nxp.com Cc: s-vadapalli@ti.com, r-gunasekaran@ti.com, vigneshr@ti.com, srk@ti.com, horms@kernel.org, p-varis@ti.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, rogerq@kernel.org Subject: [PATCH v8 net-next 03/11] net: ethernet: am65-cpsw: Build am65-cpsw-qos only if required Date: Wed, 13 Dec 2023 13:07:13 +0200 Message-Id: <20231213110721.69154-4-rogerq@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231213110721.69154-1-rogerq@kernel.org> References: <20231213110721.69154-1-rogerq@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Wed, 13 Dec 2023 03:07:57 -0800 (PST) Build am65-cpsw-qos only if CONFIG_TI_AM65_CPSW_TAS is enabled. Signed-off-by: Roger Quadros --- drivers/net/ethernet/ti/Makefile | 3 ++- drivers/net/ethernet/ti/am65-cpsw-qos.c | 12 ------------ drivers/net/ethernet/ti/am65-cpsw-qos.h | 26 +++++++++++++++++++++++++ 3 files changed, 28 insertions(+), 13 deletions(-) Changelog: v8: no change v7: no change v6: initial commit diff --git a/drivers/net/ethernet/ti/Makefile b/drivers/net/ethernet/ti/Makefile index 27de1d697134..9d7cd84d1e2d 100644 --- a/drivers/net/ethernet/ti/Makefile +++ b/drivers/net/ethernet/ti/Makefile @@ -26,7 +26,8 @@ keystone_netcp_ethss-y := netcp_ethss.o netcp_sgmii.o netcp_xgbepcsr.o cpsw_ale. obj-$(CONFIG_TI_K3_CPPI_DESC_POOL) += k3-cppi-desc-pool.o obj-$(CONFIG_TI_K3_AM65_CPSW_NUSS) += ti-am65-cpsw-nuss.o -ti-am65-cpsw-nuss-y := am65-cpsw-nuss.o cpsw_sl.o am65-cpsw-ethtool.o cpsw_ale.o am65-cpsw-qos.o +ti-am65-cpsw-nuss-y := am65-cpsw-nuss.o cpsw_sl.o am65-cpsw-ethtool.o cpsw_ale.o +ti-am65-cpsw-nuss-$(CONFIG_TI_AM65_CPSW_TAS) += am65-cpsw-qos.o ti-am65-cpsw-nuss-$(CONFIG_TI_K3_AM65_CPSW_SWITCHDEV) += am65-cpsw-switchdev.o obj-$(CONFIG_TI_K3_AM65_CPTS) += am65-cpts.o diff --git a/drivers/net/ethernet/ti/am65-cpsw-qos.c b/drivers/net/ethernet/ti/am65-cpsw-qos.c index 9ac2ff05d501..4bc611cc4aad 100644 --- a/drivers/net/ethernet/ti/am65-cpsw-qos.c +++ b/drivers/net/ethernet/ti/am65-cpsw-qos.c @@ -571,9 +571,6 @@ static int am65_cpsw_setup_taprio(struct net_device *ndev, void *type_data) taprio->cmd != TAPRIO_CMD_DESTROY) return -EOPNOTSUPP; - if (!IS_ENABLED(CONFIG_TI_AM65_CPSW_TAS)) - return -ENODEV; - if (!netif_running(ndev)) { dev_err(&ndev->dev, "interface is down, link speed unknown\n"); return -ENETDOWN; @@ -599,9 +596,6 @@ static int am65_cpsw_tc_query_caps(struct net_device *ndev, void *type_data) case TC_SETUP_QDISC_TAPRIO: { struct tc_taprio_caps *caps = base->caps; - if (!IS_ENABLED(CONFIG_TI_AM65_CPSW_TAS)) - return -EOPNOTSUPP; - caps->gate_mask_per_txq = true; return 0; @@ -806,9 +800,6 @@ void am65_cpsw_qos_link_up(struct net_device *ndev, int link_speed) { struct am65_cpsw_port *port = am65_ndev_to_port(ndev); - if (!IS_ENABLED(CONFIG_TI_AM65_CPSW_TAS)) - return; - am65_cpsw_est_link_up(ndev, link_speed); port->qos.link_down_time = 0; } @@ -817,9 +808,6 @@ void am65_cpsw_qos_link_down(struct net_device *ndev) { struct am65_cpsw_port *port = am65_ndev_to_port(ndev); - if (!IS_ENABLED(CONFIG_TI_AM65_CPSW_TAS)) - return; - if (!port->qos.link_down_time) port->qos.link_down_time = ktime_get(); diff --git a/drivers/net/ethernet/ti/am65-cpsw-qos.h b/drivers/net/ethernet/ti/am65-cpsw-qos.h index 0cc2a3b3d7f9..898f13a4a112 100644 --- a/drivers/net/ethernet/ti/am65-cpsw-qos.h +++ b/drivers/net/ethernet/ti/am65-cpsw-qos.h @@ -31,11 +31,37 @@ struct am65_cpsw_qos { struct am65_cpsw_ale_ratelimit ale_mc_ratelimit; }; +#if IS_ENABLED(CONFIG_TI_AM65_CPSW_TAS) int am65_cpsw_qos_ndo_setup_tc(struct net_device *ndev, enum tc_setup_type type, void *type_data); void am65_cpsw_qos_link_up(struct net_device *ndev, int link_speed); void am65_cpsw_qos_link_down(struct net_device *ndev); int am65_cpsw_qos_ndo_tx_p0_set_maxrate(struct net_device *ndev, int queue, u32 rate_mbps); void am65_cpsw_qos_tx_p0_rate_init(struct am65_cpsw_common *common); +#else +static inline int am65_cpsw_qos_ndo_setup_tc(struct net_device *ndev, + enum tc_setup_type type, + void *type_data) +{ + return -EOPNOTSUPP; +} + +static inline void am65_cpsw_qos_link_up(struct net_device *ndev, + int link_speed) +{ } + +static inline void am65_cpsw_qos_link_down(struct net_device *ndev) +{ } + +static inline int am65_cpsw_qos_ndo_tx_p0_set_maxrate(struct net_device *ndev, + int queue, + u32 rate_mbps) +{ + return 0; +} + +static inline void am65_cpsw_qos_tx_p0_rate_init(struct am65_cpsw_common *common) +{ } +#endif #endif /* AM65_CPSW_QOS_H_ */ -- 2.34.1