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: <20160308.142422.1791364638495761357.davem@davemloft.net>
Date:	Tue, 08 Mar 2016 14:24:22 -0500 (EST)
From:	David Miller <davem@...emloft.net>
To:	brouer@...hat.com
Cc:	netdev@...r.kernel.org, eugenia@...lanox.com,
	alexander.duyck@...il.com, alexei.starovoitov@...il.com,
	saeedm@...lanox.com, gerlitz.or@...il.com
Subject: Re: [net-next PATCH 2/7] mlx4: use napi_consume_skb API to get
 bulk free operations

From: Jesper Dangaard Brouer <brouer@...hat.com>
Date: Fri, 04 Mar 2016 14:01:33 +0100

> @@ -276,7 +276,8 @@ static void mlx4_en_stamp_wqe(struct mlx4_en_priv *priv,
>  
>  static u32 mlx4_en_free_tx_desc(struct mlx4_en_priv *priv,
>  				struct mlx4_en_tx_ring *ring,
> -				int index, u8 owner, u64 timestamp)
> +				int index, u8 owner, u64 timestamp,
> +				int napi_mode)
>  {
>  	struct mlx4_en_tx_info *tx_info = &ring->tx_info[index];
>  	struct mlx4_en_tx_desc *tx_desc = ring->buf + index * TXBB_SIZE;
> @@ -347,7 +348,11 @@ static u32 mlx4_en_free_tx_desc(struct mlx4_en_priv *priv,
>  			}
>  		}
>  	}
> -	dev_consume_skb_any(skb);
> +	if (unlikely(napi_mode < 0))
> +		dev_consume_skb_any(skb); /* none-NAPI via mlx4_en_stop_port */
> +	else
> +		napi_consume_skb(skb, napi_mode);
> +
>  	return tx_info->nr_txbb;
>  }

If '0' is the signal that napi_consume_skb() uses to detect the case where we
can't bulk, just pass that instead of having a special test here on yet another
special value "-1".

If it makes any nicer, you can define a NAPI_BUDGET_FROM_NETPOLL macro
or similar.

I also wonder if passing the budget around all the way down to
napi_consume_skb() is the cleanest thing to do, as we just want to
know if bulk freeing is possible or not.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ