From mboxrd@z Thu Jan 1 00:00:00 1970 From: Roland Dreier Subject: Re: [PATCH] mlx4: remove limitation on LSO header size Date: Wed, 07 Oct 2009 15:45:16 -0700 Message-ID: References: <20090930090701.GA2385@mtls03> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: In-Reply-To: <20090930090701.GA2385@mtls03> (Eli Cohen's message of "Wed, 30 Sep 2009 11:07:01 +0200") List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: ewg-bounces-ZwoEplunGu1OwGhvXhtEPSCwEArCW2h5@public.gmane.org Errors-To: ewg-bounces-ZwoEplunGu1OwGhvXhtEPSCwEArCW2h5@public.gmane.org To: Eli Cohen Cc: Linux RDMA list , ewg , general-list List-Id: linux-rdma@vger.kernel.org > + *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.