netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Disabling timestamps on AF_PACKET sockets
@ 2007-07-31 16:24 Unai Uribarri
  0 siblings, 0 replies; only message in thread
From: Unai Uribarri @ 2007-07-31 16:24 UTC (permalink / raw)
  To: netdev

[-- Attachment #1: Type: text/plain, Size: 937 bytes --]

Hello,

I want to capture huge amounts of packets without timestamps, since the
machine the program is running on has a very slow clock that only yields
200,000 timestamps per second and uses 70% of CPU. But tpacket_rcv
reenables the timestamps every time it receives a packet at af_packet.c:643

if (skb->tstamp.tv64 == 0) {
	__net_timestamp(skb);
	sock_enable_timestamp(sk);
}

I suppose that a patch that just removes that four lines won't be
accepted, since breaks an userspace interface. Isn't it?

So I've tried to enable timestamp when you setup the ring (to not affect
other programs) and disabling it latter from user space clearing the
SO_TIMESTAMP option. But it doesn't work, since timestamps can't be
disabled until the socket is closed.

If enabling SO_TIMESTAMP socket option sets SOCK_RCVTSTAMP and calls
sock_enable_timestamp, why disabling it just clears SOCK_RCVTSTAMP and
don't call sock_disable_timestamp?

Thanks.


[-- Attachment #2: unai.uribarri.vcf --]
[-- Type: text/x-vcard, Size: 458 bytes --]

begin:vcard
fn;quoted-printable:Unai Uribarri Rodr=C3=ADguez
n;quoted-printable:Uribarri Rodr=C3=ADguez;Unai
org:Optenet;Research & Development
adr;quoted-printable;quoted-printable:Calle Jos=C3=A9 Echegaray 8;;Parque Empresarial Alvia;Las Rozas;Madrid;28232;Espa=C3=B1a
email;internet:unai.uribarri@optenet.com
tel;work:+34 902 154 604
tel;home:+34 913 575 433
tel;cell:+34 609 54 91 61
x-mozilla-html:TRUE
url:http://www.optenet.com
version:2.1
end:vcard


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-07-31 16:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-31 16:24 Disabling timestamps on AF_PACKET sockets Unai Uribarri

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