lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 06 Oct 2009 14:23:13 +0200
From:	Eric Dumazet <eric.dumazet@...il.com>
To:	Oliver Hartkopp <socketcan@...tkopp.net>
CC:	Neil Horman <nhorman@...driver.com>,
	David Miller <davem@...emloft.net>, netdev@...r.kernel.org
Subject: Re: [PATCH] af_packet: add interframe drop cmsg (v6)

Oliver Hartkopp a écrit :
> Eric Dumazet wrote:

>> Given that datagrams are usually lost by network before hitting your socket, I am not sure
>> it is useful at all. 
> 
> It is :-)
> 
> Usually the datagrams ('CAN frames') do not get lost on the media. The problem
> is, that userspace apps are scheduled. An on high CAN traffic load this may
> lead to drops in the receive path on socket level.
> 
> It helps to increase the sockets receivebufsize with
> 
>   setsockopt(s, SOL_SOCKET, SO_RCVBUF, ...)
> 
> but it never gives an answer whether any frames have been dropped.

OK

> 
>> But yes, we could do the following for free :
>>
>> Use existing sock->sk_drops total counter, and to store its value at time datagram 
>> is received and stored into socket queue (store sock->sk_drops into skb->mark)
>>
>> At recv() time, copy this saved value into a CMSG item if user set a given SOL_SOCKET option.
>>
>> (It would not be a relative gap, but absolute. Your application would have to compute
>> deltas itself)
>>
> 
> But this leads to two questions:
> 
> 1. AFAICS we would add a cmsg to *any* received datagram then. Would this have
> any remarkable impact to the performance?

I said "if user set a given SOL_SOCKET option". Cmsg addition should be avoided for
applications not caring about this drop count.

> 
> 2. If it is that easy: Does it still make sense for PF_PACKET to support a
> separate PACKET_GAPDATA interface to the user?
> 

No, since generic would be enough to handle Neil problem, we could revert Neil patch.

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ