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] [day] [month] [year] [list]
Message-ID: <54E0931D.4090008@cogentembedded.com>
Date:	Sun, 15 Feb 2015 15:37:49 +0300
From:	Sergei Shtylyov <sergei.shtylyov@...entembedded.com>
To:	Sriharsha Basavapatna <sriharsha.basavapatna@...lex.com>,
	netdev@...r.kernel.org
Subject: Re: [PATCH net-next 4/4] be2net: Add a few inline functions to test
 TXQ conditions

Hello.

On 2/15/2015 10:45 AM, Sriharsha Basavapatna wrote:

> - Check qfull condition
> - Check qwake condition
> - Check pkts pending completion

> Signed-off-by: Sriharsha Basavapatna <sriharsha.basavapatna@...lex.com>
> ---
>   drivers/net/ethernet/emulex/benet/be_main.c | 23 +++++++++++++++++++----
>   1 file changed, 19 insertions(+), 4 deletions(-)

> diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
> index b37b099..028b093 100644
> --- a/drivers/net/ethernet/emulex/benet/be_main.c
> +++ b/drivers/net/ethernet/emulex/benet/be_main.c
> @@ -728,6 +728,22 @@ static u16 skb_ip_proto(struct sk_buff *skb)
>   		ip_hdr(skb)->protocol : ipv6_hdr(skb)->nexthdr;
>   }
>
> +static inline bool be_is_txq_full(struct be_tx_obj *txo)
> +{
> +	return ((atomic_read(&txo->q.used) + BE_MAX_TX_FRAG_COUNT) >=
> +		 txo->q.len);
> +}
> +
> +static inline bool be_can_txq_wake(struct be_tx_obj *txo)
> +{
> +	return (atomic_read(&txo->q.used) < txo->q.len / 2);
> +}
> +
> +static inline bool be_is_tx_compl_pending(struct be_tx_obj *txo)
> +{
> +	return (atomic_read(&txo->q.used) > txo->pend_wrb_cnt);
> +}
> +

    Parens not needed around the *return* expressions.

[...]

WBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ