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-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
Cc: RDMA list <linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCHv10 03/12] ib_core: IBoE UD packet packing support
Date: Thu, 14 Oct 2010 13:12:52 -0700	[thread overview]
Message-ID: <adazkugildn.fsf@cisco.com> (raw)
In-Reply-To: <20100826141756.GD8795@mtldesk30> (Eli Cohen's message of "Thu, 26 Aug 2010 17:17:56 +0300")

 > +	if (lrh_present) {
 > +		header->lrh.link_version     = 0;
 > +		header->lrh.link_next_header =
 > +			grh_present ? IB_LNH_IBA_GLOBAL : IB_LNH_IBA_LOCAL;
 > +		packet_length = IB_LRH_BYTES;
 > +	}
 > +
 > +	if (eth_present)
 > +		packet_length += IB_ETH_BYTES;

How does this code in ib_ud_header_init() work if lrh_present == 0 and
eth_present == 1?  It seems packet_length is never initialized in that
case, or am I missing something?

Anyway I changed the patch in my tree to do

	packet_length = IB_ETH_BYTES

if eth_present is set.

I'm assuming lrh_present and eth_present are exclusive; in fact it might
be a better interface to ib_ud_header_init() if we passed in a link
layer type instead of requiring the caller to do it... that would save
from everyone having to do

+	ib_ud_header_init(send_size, !is_eth, is_eth, is_grh, 0, &sqp->ud_header);

as ends up later in the patch series.

This could be a future cleanup if we care.

 - R.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2010-10-14 20:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-26 14:17 [PATCHv10 03/12] ib_core: IBoE UD packet packing support Eli Cohen
2010-10-14 20:12 ` Roland Dreier [this message]
     [not found]   ` <adazkugildn.fsf-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
2010-10-14 21:26     ` Eli Cohen
2010-10-14 21:43       ` Roland Dreier
     [not found]         ` <adapqvcih6l.fsf-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
2010-10-14 21:57           ` Eli Cohen
2010-10-14 22:34             ` Ralph Campbell
     [not found]               ` <35AAF1E4A771E142979F27B51793A488873ABE0767-HolNjIBXvBOXx9kJd3VG2h2eb7JE58TQ@public.gmane.org>
2010-10-15  4:27                 ` Roland Dreier

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=adazkugildn.fsf@cisco.com \
    --to=rdreier-fyb4gu1cfyuavxtiumwx3w@public.gmane.org \
    --cc=eli-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@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