lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200324121428.GT11304@nanopsycho.orion>
Date:   Tue, 24 Mar 2020 13:14:28 +0100
From:   Jiri Pirko <jiri@...nulli.us>
To:     Po Liu <Po.Liu@....com>
Cc:     davem@...emloft.net, linux-kernel@...r.kernel.org,
        netdev@...r.kernel.org, vinicius.gomes@...el.com,
        claudiu.manoil@....com, vladimir.oltean@....com,
        alexandru.marginean@....com, xiaoliang.yang_1@....com,
        roy.zang@....com, mingkai.hu@....com, jerry.huang@....com,
        leoyang.li@....com, michael.chan@...adcom.com, vishal@...lsio.com,
        saeedm@...lanox.com, leon@...nel.org, jiri@...lanox.com,
        idosch@...lanox.com, alexandre.belloni@...tlin.com,
        UNGLinuxDriver@...rochip.com, kuba@...nel.org, jhs@...atatu.com,
        xiyou.wangcong@...il.com, simon.horman@...ronome.com,
        pablo@...filter.org, moshe@...lanox.com, m-karicheri2@...com,
        andre.guedes@...ux.intel.com, stephen@...workplumber.org
Subject: Re: [v1,net-next  4/5] net: enetc: add hw tc hw offload features for
 PSPF capability

Tue, Mar 24, 2020 at 04:47:42AM CET, Po.Liu@....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

[...]

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ