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]
Date:   Mon, 13 Jul 2020 15:18:55 -0700
From:   Jakub Kicinski <kuba@...nel.org>
To:     Claudiu Manoil <claudiu.manoil@....com>
Cc:     "David S . Miller" <davem@...emloft.net>, netdev@...r.kernel.org
Subject: Re: [PATCH net-next 4/6] enetc: Add interrupt coalescing support

On Mon, 13 Jul 2020 15:56:08 +0300 Claudiu Manoil wrote:
> +static int enetc_get_coalesce(struct net_device *ndev,
> +			      struct ethtool_coalesce *ic)
> +{
> +	struct enetc_ndev_priv *priv = netdev_priv(ndev);
> +	struct enetc_int_vector *v = priv->int_vector[0];
> +
> +	memset(ic, 0, sizeof(*ic));

nit: no need to zero this out

> +	ic->tx_coalesce_usecs = enetc_cycles_to_usecs(v->tx_ictt);
> +	ic->rx_coalesce_usecs = enetc_cycles_to_usecs(v->rx_ictt);
> +
> +	ic->tx_max_coalesced_frames = ENETC_TXIC_PKTTHR;
> +	ic->rx_max_coalesced_frames = ENETC_RXIC_PKTTHR;
> +
> +	return 0;
> +}
> +
> +static int enetc_set_coalesce(struct net_device *ndev,
> +			      struct ethtool_coalesce *ic)
> +{
> +	struct enetc_ndev_priv *priv = netdev_priv(ndev);
> +	u32 rx_ictt, tx_ictt;
> +	int i, ic_mode;
> +
> +	tx_ictt = enetc_usecs_to_cycles(ic->tx_coalesce_usecs);
> +	rx_ictt = enetc_usecs_to_cycles(ic->rx_coalesce_usecs);
> +
> +	if (!ic->rx_max_coalesced_frames)

Isn't it better to check != ENETC_RXIC_PKTTHR, rather than != 0?

> +		netif_warn(priv, hw, ndev, "rx-frames fixed to %d\n",
> +			   ENETC_RXIC_PKTTHR);
> +
> +	if (!ic->tx_max_coalesced_frames)
> +		netif_warn(priv, hw, ndev, "tx-frames fixed to %d\n",
> +			   ENETC_TXIC_PKTTHR);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ