lkml.org 
[lkml]   [2018]   [Feb]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC PATCH v2] ptr_ring: linked list fallback
From
Date


On 2018年02月28日 12:09, Michael S. Tsirkin wrote:
>>> Or we can add plist to a union:
>>>
>>>
>>> struct sk_buff {
>>> union {
>>> struct {
>>> /* These two members must be first. */
>>> struct sk_buff *next;
>>> struct sk_buff *prev;
>>> union {
>>> struct net_device *dev;
>>> /* Some protocols might use this space to store information,
>>> * while device pointer would be NULL.
>>> * UDP receive path is one user.
>>> */
>>> unsigned long dev_scratch;
>>> };
>>> };
>>> struct rb_node rbnode; /* used in netem & tcp stack */
>>> + struct plist plist; /* For use with ptr_ring */
>>> };
>>>
>> This look ok.
>>
>>>> For XDP, we need to embed plist in struct xdp_buff too,
>>> Right - that's pretty straightforward, isn't it?
>> Yes, it's not clear to me this is really needed for XDP consider the lock
>> contention it brings.
>>
>> Thanks
> The contention is only when the ring overflows into the list though.
>

Right, but there's usually a mismatch of speed between producer and
consumer. In case of a fast producer, we may get this contention very
frequently.

Thanks

\
 
 \ /
  Last update: 2018-02-28 07:28    [W:0.530 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site