Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4779470ybb; Tue, 24 Mar 2020 05:16:01 -0700 (PDT) X-Google-Smtp-Source: ADFU+vv4O7tV+uKgpGLYjV9BYRJarUVNhZ3Ecf5uGIY1donkQaExcS7WHoC1xQK318LDOeYEZ8kS X-Received: by 2002:a05:6830:1251:: with SMTP id s17mr22613434otp.75.1585052161380; Tue, 24 Mar 2020 05:16:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585052161; cv=none; d=google.com; s=arc-20160816; b=aUY7xtC4pd0aWsf4hrrUyIk9NkPgZYRC1HX9y/mFRg59RRq6HuLkozekc1GKGFPP22 OhRyyZvhz1VZilb38gjDiBcuRsn2NrFbYb4r2LBsEK4uvA/UGE0cmHQJoaeq+TJzdXvs BCrcZD6EV5LG/5eLmJsrN02E9tFH8ai990ld6hpqeyn6XShBAUlJR92sewE3lO2NomJr MAsDl9NUHg4lulAAWRDPOXouhkZlw3dlhm7fHDK3ln+mBqssoEpwa/MaZYNPV7/AMFe6 TQzxuRT3mSbykTz9eh0QlzeS49cqEriJYFdgEgXwugcTB5iX7XYhYXIrUvlnEntYiPrx N1Xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=9cH/I+t9PFd3u2vbahwfiKP9qNEMIBaetJ3OV+SCdAE=; b=DBlR2c1OMxVcWn268ps6gSRpfCP8bCJBkVbQ06Lz2kyfQ8KaXvwcrXJ7PQLrkGvqoK xBkMy/UL4TcV7firTkb0EpsynFEdeaoqFgNJlA8Nt12eYRgj5gvij3tKMIOz7ipM/MXQ sbtdre2+CpbAOZi3xPIcvv23MYcunh9w3PNnRKO/6IlOFmvFB8YBlwbG+dJON/ngW5Rb gkHMnxzUYDICy6Bb7fuGafy0OmPsd0fR6NBw9xNCUvpQdfIJdaf/LLqLpWN8RfUZBtuE EHsKB/94RvPVEaziwmXJ19vqrNIw1IEh6EbIl4gGh9nTVmQXEyhIlghaU4PclgVzU7b3 LLZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@resnulli-us.20150623.gappssmtp.com header.s=20150623 header.b=N7KpoxrP; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d20si8500483otf.86.2020.03.24.05.15.48; Tue, 24 Mar 2020 05:16:01 -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; dkim=pass header.i=@resnulli-us.20150623.gappssmtp.com header.s=20150623 header.b=N7KpoxrP; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727555AbgCXMOd (ORCPT + 99 others); Tue, 24 Mar 2020 08:14:33 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:42108 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725767AbgCXMOd (ORCPT ); Tue, 24 Mar 2020 08:14:33 -0400 Received: by mail-wr1-f65.google.com with SMTP id h15so8909477wrx.9 for ; Tue, 24 Mar 2020 05:14:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=resnulli-us.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=9cH/I+t9PFd3u2vbahwfiKP9qNEMIBaetJ3OV+SCdAE=; b=N7KpoxrPz6E2B6wkVEQ8p7AzGW2dwOWElV7hmrCHCcUYwM6ghb4/uWMEO19/YbkS9v HbbnROsj57t+b7XNEhv0jG0oh4RiYpwkms+atnHpSKwVk4fr+CtlCHKr0dr5rctRT/FC z3ZNF55T1ggoQZVFkWDhJJ52gysV9yPhnc7ZfHsM9tLtskJ9yXSxy4kBfsmRQJpowdY3 Dmr+VLCe15KUnBfD4VlsNCFlcR/ads2IehfQOVYgL8J5HcHIRBdDo9NfHaRZ5um4PYhM kXKJVY7CwdXaWYUfgi/TzCKc7YW3JS88YrMr/ACtc3cNQsbISJOCneShks/8w3JzPh7X efKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=9cH/I+t9PFd3u2vbahwfiKP9qNEMIBaetJ3OV+SCdAE=; b=amdD++AmDS+GOJyimnGNGy54zKNdltPyo7AjnoFJcO6/QaAaqziQSJyK4+Mkt8ujJ0 DAs2jinpbVlKLFZfzRAQSpKq7ncKb3kAsXQFo2pTW2i3aj0utyn5vLT6xpbaNxsYwa9p lSV+jyQgX9BTwWHsouVfKbpzkznJdtO3bpdLgqjSnJCaNeFm9OXfhsfc1tNohPFSBoxu tXR6TQvk4bgjvg493xb3ILyJUT2GpGGSdT9vACnYc/J3Dkh3Y86NGhFsP1jylAW2I7gR fyIAAIl5ZRtYLULc/EuXUyKqZUMPO1012uB24C9mL66rAiU1swaY2tNnHrqyTTCjVPTT no0g== X-Gm-Message-State: ANhLgQ3JXFI/Z96oBvH99e9+IfVXvjvLb7Wowc3BXIZ0tbyqfuEqajen Je5XjyNsQMXOAoKfL8o+OPBqcg== X-Received: by 2002:a5d:6581:: with SMTP id q1mr20647675wru.17.1585052070328; Tue, 24 Mar 2020 05:14:30 -0700 (PDT) Received: from localhost (jirka.pirko.cz. [84.16.102.26]) by smtp.gmail.com with ESMTPSA id k15sm5741157wrm.55.2020.03.24.05.14.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Mar 2020 05:14:29 -0700 (PDT) Date: Tue, 24 Mar 2020 13:14:28 +0100 From: Jiri Pirko To: Po Liu Cc: davem@davemloft.net, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, vinicius.gomes@intel.com, claudiu.manoil@nxp.com, vladimir.oltean@nxp.com, alexandru.marginean@nxp.com, xiaoliang.yang_1@nxp.com, roy.zang@nxp.com, mingkai.hu@nxp.com, jerry.huang@nxp.com, leoyang.li@nxp.com, michael.chan@broadcom.com, vishal@chelsio.com, saeedm@mellanox.com, leon@kernel.org, jiri@mellanox.com, idosch@mellanox.com, alexandre.belloni@bootlin.com, UNGLinuxDriver@microchip.com, kuba@kernel.org, jhs@mojatatu.com, xiyou.wangcong@gmail.com, simon.horman@netronome.com, pablo@netfilter.org, moshe@mellanox.com, m-karicheri2@ti.com, andre.guedes@linux.intel.com, stephen@networkplumber.org Subject: Re: [v1,net-next 4/5] net: enetc: add hw tc hw offload features for PSPF capability Message-ID: <20200324121428.GT11304@nanopsycho.orion> References: <20200306125608.11717-11-Po.Liu@nxp.com> <20200324034745.30979-1-Po.Liu@nxp.com> <20200324034745.30979-5-Po.Liu@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200324034745.30979-5-Po.Liu@nxp.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Tue, Mar 24, 2020 at 04:47:42AM CET, Po.Liu@nxp.com wrote: [...] >@@ -289,9 +300,53 @@ int enetc_setup_tc_taprio(struct net_device *ndev, void *type_data); > void enetc_sched_speed_set(struct net_device *ndev); > int enetc_setup_tc_cbs(struct net_device *ndev, void *type_data); > int enetc_setup_tc_txtime(struct net_device *ndev, void *type_data); >+ >+static inline void enetc_get_max_cap(struct enetc_ndev_priv *priv) >+{ >+ u32 reg = 0; Pointless init. >+ >+ reg = enetc_port_rd(&priv->si->hw, ENETC_PSIDCAPR); >+ priv->psfp_cap.max_streamid = reg & ENETC_PSIDCAPR_MSK; >+ /* Port stream filter capability */ >+ reg = enetc_port_rd(&priv->si->hw, ENETC_PSFCAPR); >+ priv->psfp_cap.max_psfp_filter = reg & ENETC_PSFCAPR_MSK; >+ /* Port stream gate capability */ >+ reg = enetc_port_rd(&priv->si->hw, ENETC_PSGCAPR); >+ priv->psfp_cap.max_psfp_gate = (reg & ENETC_PSGCAPR_SGIT_MSK); >+ priv->psfp_cap.max_psfp_gatelist = (reg & ENETC_PSGCAPR_GCL_MSK) >> 16; >+ /* Port flow meter capability */ >+ reg = enetc_port_rd(&priv->si->hw, ENETC_PFMCAPR); >+ priv->psfp_cap.max_psfp_meter = reg & ENETC_PFMCAPR_MSK; >+} >+ >+static inline void enetc_psfp_enable(struct enetc_hw *hw) >+{ >+ enetc_wr(hw, ENETC_PPSFPMR, enetc_rd(hw, ENETC_PPSFPMR) >+ | ENETC_PPSFPMR_PSFPEN | ENETC_PPSFPMR_VS Hmm, I think it is better to have "|" at the end of the line". >+ | ENETC_PPSFPMR_PVC | ENETC_PPSFPMR_PVZC); >+} >+ >+static inline void enetc_psfp_disable(struct enetc_hw *hw) >+{ >+ enetc_wr(hw, ENETC_PPSFPMR, enetc_rd(hw, ENETC_PPSFPMR) >+ & ~ENETC_PPSFPMR_PSFPEN & ~ENETC_PPSFPMR_VS Same here. >+ & ~ENETC_PPSFPMR_PVC & ~ENETC_PPSFPMR_PVZC); >+} > #else > #define enetc_setup_tc_taprio(ndev, type_data) -EOPNOTSUPP > #define enetc_sched_speed_set(ndev) (void)0 > #define enetc_setup_tc_cbs(ndev, type_data) -EOPNOTSUPP > #define enetc_setup_tc_txtime(ndev, type_data) -EOPNOTSUPP [...]