All of lore.kernel.org
 help / color / mirror / Atom feed
* Protocol handler using dev_add_pack
@ 2012-07-11 13:38 Jerry Yu
  2012-07-11 14:17 ` Eric Dumazet
  0 siblings, 1 reply; 3+ messages in thread
From: Jerry Yu @ 2012-07-11 13:38 UTC (permalink / raw)
  To: linux-kernel

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?

Thanks,

Jerry

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Protocol handler using dev_add_pack
  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
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Dumazet @ 2012-07-11 14:17 UTC (permalink / raw)
  To: Jerry Yu; +Cc: linux-kernel

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




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Protocol handler using dev_add_pack
  2012-07-11 14:17 ` Eric Dumazet
@ 2012-07-12 18:05   ` Jerry Yu
  0 siblings, 0 replies; 3+ messages in thread
From: Jerry Yu @ 2012-07-12 18:05 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: linux-kernel

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
>
>
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-07-12 18:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 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.