* time stamps of skb packets in NF_HOOKS callbacks
@ 2006-08-17 14:37 John Que
2006-08-17 15:58 ` Evgeniy Polyakov
0 siblings, 1 reply; 5+ messages in thread
From: John Que @ 2006-08-17 14:37 UTC (permalink / raw)
To: netdev
Hello,
I am using NF_HOOKS (a "PRE_ROUTING" hook).
When I try to print the time stamps (sec and usec) of skb packets
which I recieve
in the hook callback I get 0. Other skb fileds are correct.
According to my understanding, the time stamp should be updated
when the packet is received. Isn't it so ? Any idea why am I getting
"0" for tstamp fields (tstamp is a field in sk_buff and is an intance
of skb_timeval).
(what I mean is that the values of skb->tstamp.off_sec and
skb>tstamp.off_usec are both 0 , for ongoing incoming packets)
Regards,
John
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: time stamps of skb packets in NF_HOOKS callbacks
2006-08-17 14:37 time stamps of skb packets in NF_HOOKS callbacks John Que
@ 2006-08-17 15:58 ` Evgeniy Polyakov
2006-08-18 5:40 ` John Que
2006-08-18 5:43 ` John Que
0 siblings, 2 replies; 5+ messages in thread
From: Evgeniy Polyakov @ 2006-08-17 15:58 UTC (permalink / raw)
To: John Que; +Cc: netdev
On Thu, Aug 17, 2006 at 05:37:15PM +0300, John Que (qwejohn@gmail.com) wrote:
> Hello,
> I am using NF_HOOKS (a "PRE_ROUTING" hook).
> When I try to print the time stamps (sec and usec) of skb packets
> which I recieve
> in the hook callback I get 0. Other skb fileds are correct.
> According to my understanding, the time stamp should be updated
> when the packet is received. Isn't it so ? Any idea why am I getting
> "0" for tstamp fields (tstamp is a field in sk_buff and is an intance
> of skb_timeval).
Timestamps are disabled by default, if you have sockets which enable
SO_TIMESTAMP or netfilter queue target and other agents which can enable
it, you will see updated values in skb->tstamp.
--
Evgeniy Polyakov
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: time stamps of skb packets in NF_HOOKS callbacks
2006-08-17 15:58 ` Evgeniy Polyakov
@ 2006-08-18 5:40 ` John Que
2006-08-18 5:43 ` John Que
1 sibling, 0 replies; 5+ messages in thread
From: John Que @ 2006-08-18 5:40 UTC (permalink / raw)
To: Evgeniy Polyakov; +Cc: netdev
Evgeniy,
Thnks, I appreciate your (quick) answer;
Following your answer I tried adding a call to net_enable_timestamp() in
a module I wrote which use NF_HOOKS.
This is what is done , for example, in ipq_rcv_skb(struct sk_buff *skb)
in linux-2.6.14 in net/ipv4/netfilter/ip_queue.c.
After doing so I get timestamps which are not 0.
what I wonder now is :
1) does this have ANY performance implication (when dealing with a
high network load which can get to 50,000 packets per second?
2) It does work as I said, but I want to be cautios: Am I permitted to
add this method ? are there any implications for adding this method
which can create troubles ?
I must say that I am NOT
On 8/17/06, Evgeniy Polyakov <johnpol@2ka.mipt.ru> wrote:
> On Thu, Aug 17, 2006 at 05:37:15PM +0300, John Que (qwejohn@gmail.com) wrote:
> > Hello,
> > I am using NF_HOOKS (a "PRE_ROUTING" hook).
> > When I try to print the time stamps (sec and usec) of skb packets
> > which I recieve
> > in the hook callback I get 0. Other skb fileds are correct.
> > According to my understanding, the time stamp should be updated
> > when the packet is received. Isn't it so ? Any idea why am I getting
> > "0" for tstamp fields (tstamp is a field in sk_buff and is an intance
> > of skb_timeval).
>
> Timestamps are disabled by default, if you have sockets which enable
> SO_TIMESTAMP or netfilter queue target and other agents which can enable
> it, you will see updated values in skb->tstamp.
>
> --
> Evgeniy Polyakov
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: time stamps of skb packets in NF_HOOKS callbacks
2006-08-17 15:58 ` Evgeniy Polyakov
2006-08-18 5:40 ` John Que
@ 2006-08-18 5:43 ` John Que
2006-08-18 6:58 ` Evgeniy Polyakov
1 sibling, 1 reply; 5+ messages in thread
From: John Que @ 2006-08-18 5:43 UTC (permalink / raw)
To: Evgeniy Polyakov; +Cc: netdev
Evgeniy,
Sorry ! ; last sentence in my reply was chopped so here is my message
again with this last sentence (complete this time)
Thnks, I appreciate your (quick) answer;
Following your answer I tried adding a call to net_enable_timestamp() in
a module I wrote which use NF_HOOKS.
This is what is done , for example, in ipq_rcv_skb(struct sk_buff *skb)
in linux-2.6.14 in net/ipv4/netfilter/ip_queue.c.
After doing so I get timestamps which are not 0.
what I wonder now is :
1) does this have ANY performance implication (when dealing with a
high network load which can get to 50,000 packets per second?
2) It does work as I said, but I want to be cautios: Am I permitted to
add this method ? are there any implications for adding this method
which can create troubles ?
I must say that I am NOT changing anywhere the timestamp; it's only
for statistics.
Regards,
John
On 8/17/06, Evgeniy Polyakov <johnpol@2ka.mipt.ru> wrote:
> On Thu, Aug 17, 2006 at 05:37:15PM +0300, John Que (qwejohn@gmail.com) wrote:
> > Hello,
> > I am using NF_HOOKS (a "PRE_ROUTING" hook).
> > When I try to print the time stamps (sec and usec) of skb packets
> > which I recieve
> > in the hook callback I get 0. Other skb fileds are correct.
> > According to my understanding, the time stamp should be updated
> > when the packet is received. Isn't it so ? Any idea why am I getting
> > "0" for tstamp fields (tstamp is a field in sk_buff and is an intance
> > of skb_timeval).
>
> Timestamps are disabled by default, if you have sockets which enable
> SO_TIMESTAMP or netfilter queue target and other agents which can enable
> it, you will see updated values in skb->tstamp.
>
> --
> Evgeniy Polyakov
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: time stamps of skb packets in NF_HOOKS callbacks
2006-08-18 5:43 ` John Que
@ 2006-08-18 6:58 ` Evgeniy Polyakov
0 siblings, 0 replies; 5+ messages in thread
From: Evgeniy Polyakov @ 2006-08-18 6:58 UTC (permalink / raw)
To: John Que; +Cc: netdev
On Fri, Aug 18, 2006 at 08:43:08AM +0300, John Que (qwejohn@gmail.com) wrote:
> Following your answer I tried adding a call to net_enable_timestamp() in
> a module I wrote which use NF_HOOKS.
> This is what is done , for example, in ipq_rcv_skb(struct sk_buff *skb)
> in linux-2.6.14 in net/ipv4/netfilter/ip_queue.c.
>
> After doing so I get timestamps which are not 0.
>
> what I wonder now is :
> 1) does this have ANY performance implication (when dealing with a
> high network load which can get to 50,000 packets per second?
Yes, it has. do_gettimeofday() is quite slow on some processors and is
not SMP-friendly.
> 2) It does work as I said, but I want to be cautios: Am I permitted to
> add this method ? are there any implications for adding this method
> which can create troubles ?
> I must say that I am NOT changing anywhere the timestamp; it's only
> for statistics.
If you add ata least on socket with SO_TIMESTAMP option, it will enable
timestamps for all skbs, so you have not created any wrong thing, except
that slowed down your network processing.
> Regards,
> John
--
Evgeniy Polyakov
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2006-08-18 7:00 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-17 14:37 time stamps of skb packets in NF_HOOKS callbacks John Que
2006-08-17 15:58 ` Evgeniy Polyakov
2006-08-18 5:40 ` John Que
2006-08-18 5:43 ` John Que
2006-08-18 6:58 ` Evgeniy Polyakov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).