From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Borkmann Subject: Re: [PATCH] net-packet: tx timestamping on tpacket ring Date: Sun, 14 Apr 2013 07:16:29 +0200 Message-ID: <516A3BAD.40201@redhat.com> References: <1365879412-9541-1-git-send-email-willemb@google.com> <5169D9C8.8010504@redhat.com> <20130413.184727.1419644906707693070.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: David Miller , Daniel Borkmann , Paul Chavent , Richard Cochran , Eric Dumazet , daniel.borkmann@alumni.ethz.ch, xemul@parallels.com, ebiederm@xmission.com, netdev@vger.kernel.org To: Willem de Bruijn Return-path: Received: from mx1.redhat.com ([209.132.183.28]:13240 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750766Ab3DNFRD (ORCPT ); Sun, 14 Apr 2013 01:17:03 -0400 In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: On 04/14/2013 02:49 AM, Willem de Bruijn wrote: > On Sat, Apr 13, 2013 at 8:16 PM, Willem de Bruijn wrote: >> On Sat, Apr 13, 2013 at 8:04 PM, Willem de Bruijn wrote: >>> On Sat, Apr 13, 2013 at 6:47 PM, David Miller wrote: >>>> From: Daniel Borkmann >>>> Date: Sun, 14 Apr 2013 00:18:48 +0200 >>>> >>>>>> + flush_dcache_page(pgv_to_page(&h1->tp_sec)); >>>>>> + flush_dcache_page(pgv_to_page(&h1->tp_usec)); >>>>> >>>>> Hmm, not sure, but could we also flush the dcache only once? >>>> >>>> Indeed, I truly hope that headers never straddle pages. >>> >>> I should have checked the alignment restrictions on frames. Frames >>> must be a multiple of 16 B as well as larger than the header (obviously), >>> so this can indeed never happen. >> >> Actually, 48 B is a multiple of 16, so should be accepted, and 85 >> frames on a page leaves half a frame for the next. I'll check whether >> this is right. Even if so, it would still not matter for these time >> offsets, as they start at 16 or 20 B offset from the start of the >> frame. > > 48 B is too small (Because less than TPACKET_HDRLEN), but it can > be triggered with 80 B frames. Daniel, thanks for submitting the > selftest: both the timestamp and this alignment question were now very > easy to test by just changing a few lines in your code. Feel free to further extend it. :-)