All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jerry Yu <jerryy@gmail.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Protocol handler using dev_add_pack
Date: Thu, 12 Jul 2012 15:05:59 -0300	[thread overview]
Message-ID: <CAP2AAQM-M87NatYG1+u4Z+OC49wVe6CHYNCu+O3HAvAZYGZOQA@mail.gmail.com> (raw)
In-Reply-To: <1342016239.3265.8007.camel@edumazet-glaptop>

Eric,

Thank you very much. Once I disabled scatter-gather on the NIC, the
issue disappeared. Now I just need to figure out how to access the
paged data if the scatter-gather I/O feature enabled. Seems that the
functions to map and unmap frag pages ( kmap_skb_frag and
kunmap_skb_frag) are removed from skbuff.h in 3.2.0-26. I may have to
create similar functions by myself.

Thanks again,

Jerry

On Wed, Jul 11, 2012 at 11:17 AM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> On Wed, 2012-07-11 at 10:38 -0300, Jerry Yu wrote:
>> I am working on a kernel module to monitor all TCP packets. I created a protocol
>> handler with protocol code ETH_P_ALL to handle all incoming and outgoing
>> TCP packets. The code worked fine on 2.6.14 kernel, but in current 3.2.0-26
>> kernel, I am no longer able to get the TCP payload for outgoing packets.
>> The data in TCP payload section of skb->data are mainly 0x00. I am still
>> able to get incoming TCP packets' payloads though.
>>
>> Is there any change in 3.2.0 or other early kernel versions that will cause
>> this issue?
>
> Maybe you make wrong assumptions in your code.
>
> skb->data doesnt exactly contains tcp payload of locally generated TCP
> packets, unless you disabled scatter-gather on the NIC
>
> ehtool -K eth0 sg off
>
>
>

      reply	other threads:[~2012-07-12 18:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-11 13:38 Protocol handler using dev_add_pack Jerry Yu
2012-07-11 14:17 ` Eric Dumazet
2012-07-12 18:05   ` Jerry Yu [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=CAP2AAQM-M87NatYG1+u4Z+OC49wVe6CHYNCu+O3HAvAZYGZOQA@mail.gmail.com \
    --to=jerryy@gmail.com \
    --cc=eric.dumazet@gmail.com \
    --cc=linux-kernel@vger.kernel.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.