Received: by 10.213.65.68 with SMTP id h4csp519625imn; Tue, 13 Mar 2018 11:37:43 -0700 (PDT) X-Google-Smtp-Source: AG47ELu7JRLtXB4Pl4SXHQYkATeQWmhV81nzKR0OGbfPnXJdNV9Dv5Rn4T8nKWNgHZ94jZu09qMI X-Received: by 2002:a17:902:52c1:: with SMTP id a59-v6mr1469312pli.37.1520966263002; Tue, 13 Mar 2018 11:37:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520966262; cv=none; d=google.com; s=arc-20160816; b=NE2DMrCw6qVhTshAsAq6lVrmTa6PtClnd8Sdm0TkbMdrCUzTNwuigK3Lc2XlwNja00 3B2qY7jSVOJ61tE3DocnQrXFOJGWRO03h84p6dgCDc9Ryc4C21+eo0AM8AWKfMfVdKoW 16CxH4DOSyGDoRJXdXpychOM3T/y8kF8xdnmAwOZ95tJp2nCAyvednI29KfeMetMn1r+ P17OmpXB/ON6rWIKiCz8oNRE5lYwU/7dQQkPPcIKJJoVPM3gKNc1uSPNvY6CHz1XhrQv ExF7gTgMUYGO/xGCExxAJx+KwpthQ7LhJRNTgP8fsAh6XgCGuNAyZgqBo19fiHdmR+yk EHoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:references:in-reply-to:mime-version :dkim-signature:arc-authentication-results; bh=8FLHqUxY81SIx0jti9bjYaji/mgpvfY1YG/ULMJBzG4=; b=hoX3UDbarmf6BAKXLhDTc9QOxzIlt78CZhm2CYopX8x/zIwJAqE48tVdtXFydYvkaa gP69CJ8PlQa47W6LQOooen8sPMHAGRcWjHQRIIvlsmKQqespx/5BKJeojC8nfxcWS21z Npu1zJXdHx9KCh7/1kF762lf0OIL5UHoRXRX+Wt6j8IEOMltPl0JmoJE7q29RUSV8Y+c 5tsnnmGhceH54/SRjS56IpuD0wSPHodO78C23bx3PYx4CRPfjn+twdF788XDVvOpLU5r RHusnlGe8OS/E9SmkPiHNMwOMEL8UtEM6zmmhHFxhp0EA8BCun9TjRP0cZZcVOvCJF8y 62Pg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=oULKaOC5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h14si555389pfd.404.2018.03.13.11.37.27; Tue, 13 Mar 2018 11:37:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=oULKaOC5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752814AbeCMSfu (ORCPT + 99 others); Tue, 13 Mar 2018 14:35:50 -0400 Received: from mail-qt0-f194.google.com ([209.85.216.194]:40813 "EHLO mail-qt0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751984AbeCMSfr (ORCPT ); Tue, 13 Mar 2018 14:35:47 -0400 Received: by mail-qt0-f194.google.com with SMTP id y6so702303qtm.7; Tue, 13 Mar 2018 11:35:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=8FLHqUxY81SIx0jti9bjYaji/mgpvfY1YG/ULMJBzG4=; b=oULKaOC5PPIg9PnpbMRwlkb5sRBXIkRy5bpdhNTVF+lyZU9d9s08nZOSq1oye2Kfxq KYAHV+9GFsEKcNLrfx937PjS7Hw94hLF6+lLimuTvzOl6nx1ypPOqiBA0uOk1vUx33n+ cHKFRPI3IAQZpqiiyzFmH68c/CDKjn1ISnju4mTT8t8miZgNWurcJ/4CuMsk3Qtti955 +3U4ZfPq2Pm0iho2eL3F3pV+5b5Hjnc0dr1HGb+8Qx8iSAxEwNnAWZ6QV5fnINTiHaOj JhRm7y6LI/3usUg99tqxzRYKKbtKlHfiSubvptgdKZs6nii3Apje21rMBP7cjygN2VEl rx3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=8FLHqUxY81SIx0jti9bjYaji/mgpvfY1YG/ULMJBzG4=; b=CSzx9aO+d1i2oa58b2N1mgcP8LhJWNm9DmA6xaHvKMwoWoA/1mE8c4S730D993LcZ1 FL6myXhXx7OtLj/0053ozxF2dRg/qdk82zvsxgxbfodAoNGtxCZsZNFgbfzHqZC8ma6F zrd4nCkGgsUHIAbwvSLmZ+ZJ8pcaOLnH5Krd85Npy27SFjfJT1YqOBazXuWDnBERhRi/ FQ+TRv+0jFOVAlMNd8yUOErN6iGOAYxmp+efK+JLNYiTYX0LnovemH2Cypj38yDz3BGO 0C3cbF5Z33t9HcgvJqTq5Vf1JzABUpP8q2aPwNqKZLjxG1q4A5cRb6m+EHZrzVRtvur1 tGiQ== X-Gm-Message-State: AElRT7H58xU5DkZGGb+1Mjo1YvgTrjeXFesZXbxyENHm/HxpDPmpIGFf x2UOi2EXFr3H5MdtKKLRGEtqpYhvqlvRMb+hn38= X-Received: by 10.200.33.251 with SMTP id 56mr2504603qtz.1.1520966146894; Tue, 13 Mar 2018 11:35:46 -0700 (PDT) MIME-Version: 1.0 Received: by 10.12.191.15 with HTTP; Tue, 13 Mar 2018 11:35:46 -0700 (PDT) In-Reply-To: <946dbe16-a2eb-eca8-8069-468859ccc78d@theobroma-systems.com> References: <946dbe16-a2eb-eca8-8069-468859ccc78d@theobroma-systems.com> From: Dave Taht Date: Tue, 13 Mar 2018 11:35:46 -0700 Message-ID: Subject: Re: [bug, bisected] pfifo_fast causes packet reordering To: Jakob Unterwurzacher Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, John Fastabend , "David S. Miller" , "linux-can@vger.kernel.org" , Martin Elshuber Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 13, 2018 at 11:24 AM, Jakob Unterwurzacher wrote: > During stress-testing our "ucan" USB/CAN adapter SocketCAN driver on Linu= x > v4.16-rc4-383-ged58d66f60b3 we observed that a small fraction of packets = are > delivered out-of-order. > > We have tracked the problem down to the driver interface level, and it se= ems > that the driver's net_device_ops.ndo_start_xmit() function gets the packe= ts > handed over in the wrong order. > > This behavior was not observed on Linux v4.15 and I have bisected the > problem down to this patch: > >> commit c5ad119fb6c09b0297446be05bd66602fa564758 >> Author: John Fastabend >> Date: Thu Dec 7 09:58:19 2017 -0800 >> >> net: sched: pfifo_fast use skb_array >> >> This converts the pfifo_fast qdisc to use the skb_array data structur= e >> and set the lockless qdisc bit. pfifo_fast is the first qdisc to >> support >> the lockless bit that can be a child of a qdisc requiring locking. So >> we add logic to clear the lock bit on initialization in these cases >> when >> the qdisc graft operation occurs. >> >> This also removes the logic used to pick the next band to dequeue fro= m >> and instead just checks a per priority array for packets from top >> priority >> to lowest. This might need to be a bit more clever but seems to work >> for now. >> >> Signed-off-by: John Fastabend >> Signed-off-by: David S. Miller > > > The patch does not revert cleanly, but moving to one commit earlier makes > the problem go away. > > Selecting the "fq" scheduler instead of "pfifo_fast" makes the problem go > away as well. I am of course, a fan of obsoleting pfifo_fast. There's no good reason for it anymore. > > Is this an unintended side-effect of the patch or is there something the > driver has to do to request in-order delivery? > > Thanks, > Jakob --=20 Dave T=C3=A4ht CEO, TekLibre, LLC http://www.teklibre.com Tel: 1-669-226-2619