sk_buff misunderstanding?

Wolfgang Wegner (ww@kt.e-technik.uni-dortmund.de)
Fri, 24 May 2002 10:04:34 +0200


Hi all,

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

- struct sk_buff has a new member, struct ww_timestamp rcvtime, containing
the actual timestamp and a flag is_valid
- 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.

Here are the last relevant lines in orinoco.c: (orinoco_ev_rx)
/* WW_TIMESTAMP stuff */
skb->rcvtime=rcvtime;
printk("orinoco.c: skb=%p\n",skb);

skb->rcvtime.is_valid=1;
/* Pass the packet to the networking stack */
netif_rx(skb);

Here is include/net/sock.h (tsbucket is an extension i made)
static __inline__ void
sock_recv_timestamp(struct msghdr *msg, struct sock *sk, struct sk_buff *skb)
{
if (sk->rcvtstamp)
put_cmsg(msg, SOL_SOCKET, SO_TIMESTAMP, sizeof(skb->stamp), &skb
->stamp);
else
sk->stamp = skb->stamp;
if((sk->tsbucket))
printk("skb=%p, timestamp.is_valid=%d!\n",skb,skb->rcvtime.is_valid);

My first idea was that maybe the skb is copied around before, so i put
some printk in skb_head_from_pool - but this seems not to be the case.
Here is what the kernel says: (no lines left out!)

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

I am out of ideas - anybody else?
(This must be some really stupid bug or misunderstanding of mine, i guess,
but i really have no idea what i overlooked.)

Any help is appreciated.

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/