sk_buff modification problem

Wolfgang Wegner (ww@kt.e-technik.uni-dortmund.de)
Sun, 26 May 2002 01:00:25 +0200


Hi,

as my first post was a bit confused maybe, I try again - hopefully
more specific...

i am trying to do a modification in the kernel to get a more precise
timestamp directly from a modified network driver, and am having some
difficulty (or maybe misunderstanding) with sk_buff's... Kernel used
is 2.4.18.

Here's a list what I modified:

- struct sk_buff has a new member, struct ww_timestamp rcvtime, containing
the actual timestamp and a flag is_valid. The flag is initialized to
"0" in alloc_skb as well as skb_headerinit, and the complete struct
is copied in skb_clone and copy_skb_header.
- the driver (currently orinoco.c from pcmcia_cs) is modified to fill
the my_timestamp struct and sets is_valid.
- when passing the packet to a socket, this new timestamp is evaluated
(in sock_recv_timestamp, where both sk_buff _and_ sock are known)

The problem is: in sock_recv_timestamp, is_valid is reset to 0 - and i
have no idea why. To track it down I tried to put some printk's in the
sk_buff handling functions and sock_recv_timestamp, but it seems there
is not even any copying done (as "&skb" is the same in orinoco.c and
sock_recv_timestamp):

> May 24 08:55:43 licht kernel: skb_head_from_pool, skb=cfaa6d80
> May 24 08:55:43 licht kernel: orinoco.c: skb=cfaa6d80
> May 24 08:55:43 licht kernel: skb=cfaa6d80, timestamp.is_valid=0!
> May 24 08:55:43 licht kernel: skb_head_from_pool, skb=cfaa6d80
> May 24 08:55:43 licht kernel: skb_head_from_pool, skb=cf0fa200

In case somebody wants to look at it, the patch is at
http://www-kt.e-technik.uni-dortmund.de/m_ww/l-k/patch-2.4.18-ww3.gz
and the orinoco_ev_rx part of orinoco.c is at
http://www-kt.e-technik.uni-dortmund.de/m_ww/l-k/orinoco.c

I am really out of ideas here, especially I do not know how to
debug it, because I do not see any further possibility where (and
why) the value gets overwritten.

Thanks,
Wolfgang

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/