Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933344AbbFVLtl (ORCPT ); Mon, 22 Jun 2015 07:49:41 -0400 Received: from mout.gmx.net ([212.227.15.19]:56775 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932979AbbFVLtc (ORCPT ); Mon, 22 Jun 2015 07:49:32 -0400 Message-ID: <5587F647.4000105@gmx.at> Date: Mon, 22 Jun 2015 13:49:27 +0200 From: Manfred Schlaegl User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Icedove/31.7.0 MIME-Version: 1.0 To: Oliver Hartkopp , netdev@vger.kernel.org, davem@davemloft.net, linux-kernel@vger.kernel.org, mkl@pengutronix.de Subject: Re: [PATCH - regression 4.1-rc8] can: fix loss of CAN frames in raw_rcv References: <1434905444-11438-1-git-send-email-socketcan@hartkopp.net> <5587DF06.3010509@gmx.at> <5587E4BC.3080608@hartkopp.net> In-Reply-To: <5587E4BC.3080608@hartkopp.net> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:i/ZbsUellCdk0AnYyu5E8yBuNY81CJWH6gAkwoO4scY/wmmdht3 RzxvxNgC+RpwnWFsldRUEx5FMIpUS1DjFg7dBLXssGWozvzluBZIGTwcEhLLPgp4zCEtjbc I3KrQNqjPTmyReQH8SDJkfDu7EEp5XY2fnRN4g+l1ngsPcrvXSiPC6B3MkNO1W4VwAo5jMU kfV2s4yQ/rv4mB6DzLLWw== X-UI-Out-Filterresults: notjunk:1;V01:K0:jlc3rMEEUf8=:0CL+nGiTP/oeiFl4JOE1gI arEZtFMX9nS7Sb/uDs/GFni8eTSkFzEzm+PQf2hDdMvMmQofLmTurNAJm0s5DJALX+2eEADhx YCoZJklKgDzBwsmpP9Tl27KavJNYhRzW/nS6IDPwzhB64VB6+zCNlVOrqOxNDPRjniZojHzmf dewV0CiLdMJLfIFg5dZvUE9PJZ8rTLBl9B7EEo0x69gC6ZbKYOiBVS8I57VbrDrYcgNTj6WjM 2/b8aogYZPOC2l1lqaHT2CBVXArsckHkUAcnGFMdP6zETOMks+gbLDn+7JwBanLmSAusGfT34 ovF4U3zXwd89TBarwsGajePiNXWl0mcFGk4osjMrL7YZfz38H4DM7AqUb1TW8UruygUdsE8i1 cTacuLLb8be+9OJrbl04xGV8S7N10ZTyzLhLOWKNXgDOxNvqIP1WFbhLn+I3ZS7jIiBZzv041 fhWnR08UpOMsPF6W+dwIxXum05C3V9ivxhYE232/Qtkbs/TuGB1z6ARwEWkxz3xfub9yqKVbO LZlCacna0k0S5EA4BKhOWTDvsrv7Xz6r4Hv1EfC834xc1tuOxSa5m0XwgPyNqA65VQzm/+P1j ixNy5xiQpNzDP7Wcxq5/WPj7AFrWMSMuWMvmPy+7O3IU83mE1prCzKxnZvYnjz1sHd3y6rKhX sBtmDio0w/Idle1mEzCQAokvwIdzC3Lx8EAR+yXQvxG9ijUgWbQiCMXTDUx84HdySgQQ= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2687 Lines: 50 Hello Oliver, On 2015-06-22 12:34, Oliver Hartkopp wrote: > Hello Manfred, > > On 22.06.2015 12:10, Manfred Schlaegl wrote: >> On 2015-06-21 18:50, Oliver Hartkopp wrote: >>> As reported by Manfred Schlaegl here >>> >>> http://marc.info/?l=linux-netdev&m=143482089824232&w=2 >>> >>> commit 514ac99c64b "can: fix multiple delivery of a single CAN frame for >>> overlapping CAN filters" requires the skb->tstamp to be set to check for >>> identical CAN skbs. >>> >>> As net timestamping is influenced by several players (netstamp_needed and >>> netdev_tstamp_prequeue) Manfred missed a proper timestamp which leads to >>> CAN frame loss. >>> >>> As skb timestamping became now mandatory for CAN related skbs this patch >>> makes sure that received CAN skbs always have a proper timestamp set. >>> Maybe there's a better solution in the future but this patch fixes the >>> CAN frame loss so far. >>> >> >> I'm not sure, but maybe this patch (and also my original one) opens a new potential issue with timestamps. >> >> If the timestamp is set at allocation time, this cancels setting the timestamp at delivery (by net_timestamp_check in, for example, netif_receive_skb_internal.) -> So it changes the behavior of timestamping (http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/networking/timestamping.txt?id=b953c0d234bc72e8489d3bf51a276c5c4ec85345) generally. > > The only change is that the timestamps for CAN skbs are generated always. > The idea behind the timestamping by user control is to omit the timestamping when it's not needed. There's no user visible change in behaviour when the timestamp is set in the CAN skbs all time. > >> Hypothetical example: If timestamping is enabled by the user and there is a significant delay between allocation and delivery of a skb (early allocation in driver or something) the timestamp does not reflect the reception time anymore. > > The change only affects CAN skbs. > These skbs are allocated at CAN frame reception time, filled with content and then sent to the network layer. > > AFAICS the timestamp becomes more precise for CAN related skbs. > I did not see any case of 'early allocation' in linux/drivers/net/can, did you? No, I also did not find this case in current driver implementations -- because of that I gave the hypothetical example. I just was worried about that this may be a potential latent issue for future driver implementations and wanted to indicate this. But I trust your expertise, so if you are fine with it, I'm too. ;-) Best regards, Manfred -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in Please read the FAQ at http://www.tux.org/lkml/