All of lore.kernel.org
 help / color / mirror / Atom feed
* sk_buff misunderstanding?
@ 2002-05-24  8:04 Wolfgang Wegner
  2002-05-24  7:52 ` David S. Miller
  2002-05-25 23:00 ` sk_buff modification problem Wolfgang Wegner
  0 siblings, 2 replies; 6+ messages in thread
From: Wolfgang Wegner @ 2002-05-24  8:04 UTC (permalink / raw)
  To: linux-kernel

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


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

end of thread, other threads:[~2002-05-26 19:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-05-24  8:04 sk_buff misunderstanding? Wolfgang Wegner
2002-05-24  7:52 ` David S. Miller
2002-05-24  8:11   ` Wolfgang Wegner
2002-05-25 23:00 ` sk_buff modification problem Wolfgang Wegner
2002-05-26 17:35   ` sk_buff modification problem -> (almost) solved Wolfgang Wegner
2002-05-26 19:52     ` kuznet

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.