From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Sriharsha Basavapatna <sriharsha.basavapatna@emulex.com>,
netdev@vger.kernel.org
Subject: Re: [PATCH net-next 4/4] be2net: Add a few inline functions to test TXQ conditions
Date: Sun, 15 Feb 2015 15:37:49 +0300 [thread overview]
Message-ID: <54E0931D.4090008@cogentembedded.com> (raw)
In-Reply-To: <1423986327-10069-5-git-send-email-sriharsha.basavapatna@emulex.com>
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@emulex.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
prev parent reply other threads:[~2015-02-15 12:37 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-15 7:45 [PATCH net-next 0/4] be2net patch-set Sriharsha Basavapatna
2015-02-15 7:45 ` [PATCH net-next 1/4] be2net: Refactor wrb_fill_hdr() routine Sriharsha Basavapatna
2015-02-15 7:45 ` [PATCH net-next 2/4] be2net: Refactor be_xmit_enqueue() routine Sriharsha Basavapatna
2015-02-15 7:45 ` [PATCH net-next 3/4] be2net: Minor code cleanup in tx completion process Sriharsha Basavapatna
2015-02-15 7:45 ` [PATCH net-next 4/4] be2net: Add a few inline functions to test TXQ conditions Sriharsha Basavapatna
2015-02-15 12:37 ` Sergei Shtylyov [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54E0931D.4090008@cogentembedded.com \
--to=sergei.shtylyov@cogentembedded.com \
--cc=netdev@vger.kernel.org \
--cc=sriharsha.basavapatna@emulex.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).