From: Bart Van Assche <bvanassche-HInyCGIudOg@public.gmane.org>
To: Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org
Subject: Re: [PATCH] ipoib: fix hard_header return value
Date: Tue, 26 Mar 2013 17:40:00 +0100 [thread overview]
Message-ID: <5151CF60.3010100@acm.org> (raw)
In-Reply-To: <3fde29b99442969e59a7a9cf4f63a26858f00a0a.1364315061.git.dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
On 03/26/13 17:24, Doug Ledford wrote:
> If you have a patched up dhcp server (and dhclient), they will use
> AF_PACKET/SOCK_DGRAM pair to send dhcp packets over IPoIB. This has
> worked since forever if you use OFED kernels or one of the distribution
> kernels. However, when testing an upstream kernel, it has been broken
> for a very long time (I tested 2.6.34, 2.6.38, 3.0, 3.1, 3.8, HEAD).
>
> It turns out that the hard_header routine in ipoib is not following
> the API and is returning 0 even when it pushed data onto the skb. This
> then causes af_packet.c to overwrite the header just pushed with data
> from user space. This header is immediately referenced in the
> ipoib_start_xmit routine, so I'm wondering how this ever worked in
> distro/ofed kernels that also have this bug, but fixing the bug here
> makes things work in upstream kernels.
>
> Signed-off-by: Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> ---
> drivers/infiniband/ulp/ipoib/ipoib_main.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c
> index 8534afd..31dd2a7 100644
> --- a/drivers/infiniband/ulp/ipoib/ipoib_main.c
> +++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c
> @@ -828,7 +828,7 @@ static int ipoib_hard_header(struct sk_buff *skb,
> */
> memcpy(cb->hwaddr, daddr, INFINIBAND_ALEN);
>
> - return 0;
> + return sizeof *header;
> }
>
> static void ipoib_set_mcast_list(struct net_device *dev)
Checkpatch recommends since some time to use sizeof(e) instead of sizeof
e, isn't it ?
Bart.
--
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
next prev parent reply other threads:[~2013-03-26 16:40 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-26 16:24 [PATCH] ipoib: fix hard_header return value Doug Ledford
[not found] ` <3fde29b99442969e59a7a9cf4f63a26858f00a0a.1364315061.git.dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2013-03-26 16:40 ` Bart Van Assche [this message]
[not found] ` <5151CF60.3010100-HInyCGIudOg@public.gmane.org>
2013-03-26 16:46 ` Roland Dreier
[not found] ` <CAG4TOxPa+B1=N8DUPf4E1AT-a__Yx=3d83d1xA6H5pPW=9TabA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-03-26 16:52 ` Doug Ledford
2013-03-26 18:16 ` Jason Gunthorpe
[not found] ` <20130326181634.GB22775-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2013-03-27 14:04 ` Doug Ledford
2013-04-01 21:25 ` Or Gerlitz
[not found] ` <CAJZOPZKFT6QT_=bfzp0BN42hxgd4A-t0s7d_TBxD=u=Bgcuvgw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-04-23 16:22 ` Doug Ledford
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=5151CF60.3010100@acm.org \
--to=bvanassche-hinycgiudog@public.gmane.org \
--cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=roland-DgEjT+Ai2ygdnm+yROfE0A@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.