public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Roland Dreier <rdreier-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
To: Eli Cohen <eli-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org>
Cc: Linux RDMA list
	<linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	ewg <ewg-ZwoEplunGu1OwGhvXhtEPSCwEArCW2h5@public.gmane.org>,
	general-list
	<general-ZwoEplunGu1OwGhvXhtEPSCwEArCW2h5@public.gmane.org>
Subject: Re: [PATCH] mlx4: remove limitation on LSO header size
Date: Wed, 07 Oct 2009 15:45:16 -0700	[thread overview]
Message-ID: <adaocoiombn.fsf@cisco.com> (raw)
In-Reply-To: <20090930090701.GA2385@mtls03> (Eli Cohen's message of "Wed, 30 Sep 2009 11:07:01 +0200")


 > +	*blh = unlikely(halign > 64) ? 1 : 0;

This idiom of "(boolean condition) ? 1 : 0" looks odd to me... doesn't
(halign > 64) already evaluate to 1 or 0 anyway?  Does the unlikely()
actually affect code generation here?

With that said, see below...

 > +	int blh = 0;

I assume this initialization is to avoid a compiler warning.  But the
code is actually correct without initializing blh -- so I think that we
save a tiny bit of code by doing uninitialized_var() instead?

 > +			(blh ? cpu_to_be32(1 << 6) : 0);

...given that the only use of blh is as a flag to decide what constant
to use here, does it generate better code to make blh be __be32 and set
the value directly in build_lso_seg, ie do:

	*blh = unlikely(halign > 64) ? cpu_to_be32(1 << 6) : 0;

and then use blh without ?: in mlx4_ib_post_send...

 - R.

  reply	other threads:[~2009-10-07 22:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-30  9:07 [PATCH] mlx4: remove limitation on LSO header size Eli Cohen
2009-10-07 22:45 ` Roland Dreier [this message]
     [not found]   ` <adaocoiombn.fsf-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
2009-10-11 10:00     ` Eli Cohen
2009-10-12 17:03       ` Roland Dreier
     [not found] ` <4AC858E0.2010506@voltaire.com>
     [not found]   ` <4AC858E0.2010506-smomgflXvOZWk0Htik3J/w@public.gmane.org>
2009-10-11  9:47     ` [ewg] " Eli Cohen

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=adaocoiombn.fsf@cisco.com \
    --to=rdreier-fyb4gu1cfyuavxtiumwx3w@public.gmane.org \
    --cc=eli-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org \
    --cc=ewg-ZwoEplunGu1OwGhvXhtEPSCwEArCW2h5@public.gmane.org \
    --cc=general-ZwoEplunGu1OwGhvXhtEPSCwEArCW2h5@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /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