From: Roland Dreier <rdreier-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
To: Christoph Lameter <cl-vYTEC60ixJUAvxtiuMwx3w@public.gmane.org>
Cc: Roland Dreier <rolandd-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>,
linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Or Gerlitz <ogerlitz-smomgflXvOZWk0Htik3J/w@public.gmane.org>,
Jason Gunthorpe
<jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>,
Yossi Etigin <yosefe-smomgflXvOZWk0Htik3J/w@public.gmane.org>
Subject: Re: [IPoIB] Identify Multicast packets and fix IGMP breakage
Date: Thu, 26 Aug 2010 14:32:09 -0700 [thread overview]
Message-ID: <ada39u13vs6.fsf@cisco.com> (raw)
In-Reply-To: <alpine.DEB.2.00.1008261613160.24174-sBS69tsa9Uj/9pzu0YdTqQ@public.gmane.org> (Christoph Lameter's message of "Thu, 26 Aug 2010 16:17:08 -0500 (CDT)")
> > also it's not clear to me why it's OK to do this test of the DGID if the
> > packet didn't have a GRH -- presumably we are just looking at random
> > uninitialized memory so we might incorrectly say some packets are
> > multicast if that byte happens to be 0xff. (or does that not matter?
> > if so why can't we just always make everything PACKET_MULTICAST?)
> We will do an skb_pull to skip over the GRH next? The IP layer checks
> PACKET_HOST etc in various places so we may risk breakage in odd places
> like what already occurred here. It would be good to also have support
> for PACKET_BROADCAST but that would require a full MGID comparison.
I'm not sure I follow what you're saying. An IB UD packet may or may
not include a GRH on the wire. If it does, when it's received, the
adapter writes the GRH and then the packet data into the receive
buffer. If there is no GRH on the wire, then the adapter skips 40 bytes
(size of a GRH/ipv6 header) and then writes the packet data into the
receive buffer.
So in all cases, the real packet data starts 40 bytes into the receive
buffer and we have to do an skb_pull, but if there was no GRH on the
wire, then the 40 bytes we skipped is just uninitialized memory. The
wc_flags bit IB_WC_GRH tells you if there was a GRH on the wire or not.
It sounds like we want to get this right without random false positives,
so I think we need to test IB_WC_GRH. (And doing a full compare against
the broadcast MGID for multicast packets wouldn't be *too* bad -- it's
not much worse than what ethernet does)
> > It seems the check should be something like
> >
> > if ((wc->wc_flags & IB_WC_GRH) &&
> > IN6_IS_ADDR_MULTICAST(((struct ipv6hdr *) skb->data)->daddr))
>
> Hmmm... More IPV6 stuff slipping in.
I guess it would be at least as correct to cast to struct ib_grh and
check that the dgid is a multicast GID (we can add an inline function to
check this and as a cleanup we could then get rid of the open-coded
tests in ib_attach_mcast etc)
- 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
prev parent reply other threads:[~2010-08-26 21:32 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-23 17:16 IPoIB: Broken IGMP processing Christoph Lameter
[not found] ` <alpine.DEB.2.00.1008231210010.9840-sBS69tsa9Uj/9pzu0YdTqQ@public.gmane.org>
2010-08-23 17:41 ` Jason Gunthorpe
[not found] ` <20100823174110.GK26549-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2010-08-23 18:10 ` Christoph Lameter
[not found] ` <alpine.DEB.2.00.1008231254300.10719-sBS69tsa9Uj/9pzu0YdTqQ@public.gmane.org>
2010-08-23 18:28 ` Jason Gunthorpe
[not found] ` <20100823182859.GL26549-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2010-08-23 19:27 ` Christoph Lameter
[not found] ` <alpine.DEB.2.00.1008231427130.12815-sBS69tsa9Uj/9pzu0YdTqQ@public.gmane.org>
2010-08-23 19:34 ` Yossi Etigin
[not found] ` <7E95F01E94AB484F83061FCFA35B39F8013249-QfUkFaTmzUSUvQqKE/ONIwC/G2K4zDHf@public.gmane.org>
2010-08-23 19:45 ` Jason Gunthorpe
[not found] ` <20100823194555.GN26549-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2010-08-23 19:50 ` Yossi Etigin
[not found] ` <7E95F01E94AB484F83061FCFA35B39F801324A-QfUkFaTmzUSUvQqKE/ONIwC/G2K4zDHf@public.gmane.org>
2010-08-25 14:43 ` Christoph Lameter
2010-08-23 19:59 ` Christoph Lameter
[not found] ` <alpine.DEB.2.00.1008231454230.12815-sBS69tsa9Uj/9pzu0YdTqQ@public.gmane.org>
2010-08-24 18:49 ` Jason Gunthorpe
2010-08-23 18:19 ` Christoph Lameter
[not found] ` <alpine.DEB.2.00.1008231317150.10719-sBS69tsa9Uj/9pzu0YdTqQ@public.gmane.org>
2010-08-23 18:30 ` Jason Gunthorpe
[not found] ` <20100823183044.GM26549-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2010-08-26 19:55 ` [IPoIB] Identify Multicast packets and fix IGMP breakage Christoph Lameter
[not found] ` <alpine.DEB.2.00.1008261453510.21466-sBS69tsa9Uj/9pzu0YdTqQ@public.gmane.org>
2010-08-26 20:49 ` Roland Dreier
[not found] ` <adapqx5rtez.fsf-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
2010-08-26 21:17 ` Christoph Lameter
[not found] ` <alpine.DEB.2.00.1008261613160.24174-sBS69tsa9Uj/9pzu0YdTqQ@public.gmane.org>
2010-08-26 21:29 ` Jason Gunthorpe
2010-08-26 21:31 ` [IPoIB] Identify multicast packets and fix IGMP breakage V2 Christoph Lameter
[not found] ` <alpine.DEB.2.00.1008261629440.24174-sBS69tsa9Uj/9pzu0YdTqQ@public.gmane.org>
2010-08-26 22:15 ` David Miller
[not found] ` <20100826.151553.242147157.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2010-08-26 22:21 ` Jason Gunthorpe
[not found] ` <20100826222146.GA23025-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2010-08-26 23:26 ` [IPoIB] Identify multicast packets and fix IGMP breakage V3 Christoph Lameter
[not found] ` <alpine.DEB.2.00.1008261825490.26351-sBS69tsa9Uj/9pzu0YdTqQ@public.gmane.org>
2010-08-26 23:43 ` Jason Gunthorpe
2010-08-26 23:57 ` Christoph Lameter
[not found] ` <alpine.DEB.2.00.1008261856090.29657-sBS69tsa9Uj/9pzu0YdTqQ@public.gmane.org>
2010-08-27 0:07 ` David Miller
2010-08-27 2:24 ` Christoph Lameter
[not found] ` <20100826234342.GA24333-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2010-08-27 0:02 ` Yossi Etigin
[not found] ` <7E95F01E94AB484F83061FCFA35B39F89BE276-QfUkFaTmzUSUvQqKE/ONIwC/G2K4zDHf@public.gmane.org>
2010-08-27 0:17 ` Jason Gunthorpe
2010-08-27 13:29 ` Christoph Lameter
2010-09-14 7:27 ` Or Gerlitz
[not found] ` <4C8F23DB.2040105-smomgflXvOZWk0Htik3J/w@public.gmane.org>
2010-09-14 14:02 ` Christoph Lameter
[not found] ` <alpine.DEB.2.00.1008270827280.11792-sBS69tsa9Uj/9pzu0YdTqQ@public.gmane.org>
2010-09-28 18:09 ` Roland Dreier
2010-08-26 21:32 ` Roland Dreier [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=ada39u13vs6.fsf@cisco.com \
--to=rdreier-fyb4gu1cfyuavxtiumwx3w@public.gmane.org \
--cc=cl-vYTEC60ixJUAvxtiuMwx3w@public.gmane.org \
--cc=jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=ogerlitz-smomgflXvOZWk0Htik3J/w@public.gmane.org \
--cc=rolandd-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org \
--cc=yosefe-smomgflXvOZWk0Htik3J/w@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