Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1331719ybt; Thu, 2 Jul 2020 02:48:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzxtvXFGc2gB4/k+LsOdzuztuODN96AXgeVc1r2SuKLSWDoR8m4dzTPAttyeCWy4xJk7MZx X-Received: by 2002:aa7:d692:: with SMTP id d18mr32435044edr.73.1593683311966; Thu, 02 Jul 2020 02:48:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593683311; cv=none; d=google.com; s=arc-20160816; b=O5w9ZbdbuY2qkTzZn14ldAfv8raVyFxdA9OoIqyEDzAZgxlgpePVJKnX5W/xOZ6ctJ L5Mbt++qQjdmWAunoF+9rWvrPvdFD7ep/sO5h9EqBIb+Cv0UB7rkPkkYPRsa7ALAKpap rBtvB+R9HFsL36+H4Hh7AHsQYZ8mogMAJXp11g/FoD+vrMFBKZ2YDjrPS+hYL01InLs/ ueiKNG3/m+nixcuKM0FkfTUu6+494GlY6WFeDJpfjN91WsobDmekYh38te/dIkUpN5ZZ aeS1urgquwDNJ12mmbrBCVR0ZCvZyMpEWRaPWerA6zOz9nLFOSBifvHazP1VYJ+vRYBz 7PeA== 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:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature; bh=Wm49XITAa3YU5qe3fjMCfJ04QxbXtAJzXaKHQsj4bIU=; b=BEwNexvbyir6dGQTJpj67bCx/JcZz56UBhYmRlPUnBKBhWGfxPaNffYdd262CO+jy8 8FPf/baJTiVWWMnQ4O1umAzOqHDWAj3WrlnxX5xqbT+QRN9RMBdahtvd1ZUumMQdhyDB Nrl4zPWN+PG2P76Sn48gUPNFAPLXsoePsuSt0XwzP2lu7L7a8XTppmMdHdY/ZIUt1/K/ 5b3wMTe85mDiJW2HVn3iclXmW9w5kKda5gHJMHqYJ6MTApZj/ZYHVih9Piwuhlwu85Ml UXEMw0CeMfDgmI91z77+FB3O/q1+X6th/uCKdrl5R7m2ogkol/UzuGzbPlUVweg0LODT WiNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="PqLv/VbG"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c11si5265073edy.498.2020.07.02.02.48.09; Thu, 02 Jul 2020 02:48:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="PqLv/VbG"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728241AbgGBJqE (ORCPT + 99 others); Thu, 2 Jul 2020 05:46:04 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:20807 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727860AbgGBJqD (ORCPT ); Thu, 2 Jul 2020 05:46:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593683162; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Wm49XITAa3YU5qe3fjMCfJ04QxbXtAJzXaKHQsj4bIU=; b=PqLv/VbGm/sHavli/L4DDUouxBi/+q2fflzx21lePep0dbk5hxrYAwWrpCDeo2Y5FR2xei FyyAf/AuvWd2qnm3JPx9st3MBPe73gAMi5roYgEc5ESFC7RZWVZ7xeAGl06I2/Fjw/UuXF wuofc+UZY0XLt9NpjRyCNDnCezdB91g= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-34--t6KF_-cMS-AJaekxw4-BA-1; Thu, 02 Jul 2020 05:45:58 -0400 X-MC-Unique: -t6KF_-cMS-AJaekxw4-BA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4FF731005513; Thu, 2 Jul 2020 09:45:56 +0000 (UTC) Received: from ovpn-115-71.ams2.redhat.com (ovpn-115-71.ams2.redhat.com [10.36.115.71]) by smtp.corp.redhat.com (Postfix) with ESMTP id 235FB78120; Thu, 2 Jul 2020 09:45:53 +0000 (UTC) Message-ID: <500b4843cb7c425ea5449fe199095edd5f7feb0c.camel@redhat.com> Subject: Re: Packet gets stuck in NOLOCK pfifo_fast qdisc From: Paolo Abeni To: Jonas Bonn , Cong Wang , Josh Hunt Cc: Michael Zhivich , David Miller , John Fastabend , LKML , Linux Kernel Network Developers Date: Thu, 02 Jul 2020 11:45:52 +0200 In-Reply-To: <7fd86d97-6785-0b5f-1e95-92bc1da9df35@netrounds.com> References: <465a540e-5296-32e7-f6a6-79942dfe2618@netrounds.com> <20200623134259.8197-1-mzhivich@akamai.com> <1849b74f-163c-8cfa-baa5-f653159fefd4@akamai.com> <7fd86d97-6785-0b5f-1e95-92bc1da9df35@netrounds.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.3 (3.36.3-1.fc32) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi all, On Thu, 2020-07-02 at 08:14 +0200, Jonas Bonn wrote: > Hi Cong, > > On 01/07/2020 21:58, Cong Wang wrote: > > On Wed, Jul 1, 2020 at 9:05 AM Cong Wang wrote: > > > On Tue, Jun 30, 2020 at 2:08 PM Josh Hunt wrote: > > > > Do either of you know if there's been any development on a fix for this > > > > issue? If not we can propose something. > > > > > > If you have a reproducer, I can look into this. > > > > Does the attached patch fix this bug completely? > > It's easier to comment if you inline the patch, but after taking a quick > look it seems too simplistic. > > i) Are you sure you haven't got the return values on qdisc_run reversed? qdisc_run() returns true if it was able to acquire the seq lock. We need to take special action in the opposite case, so Cong's patch LGTM from a functional PoV. > ii) There's a "bypass" path that skips the enqueue/dequeue operation if > the queue is empty; that needs a similar treatment: after releasing > seqlock it needs to ensure that another packet hasn't been enqueued > since it last checked. That has been reverted with commit 379349e9bc3b42b8b2f8f7a03f64a97623fff323 --- > diff --git a/net/core/dev.c b/net/core/dev.c > index 90b59fc50dc9..c7e48356132a 100644 > --- a/net/core/dev.c > +++ b/net/core/dev.c > @@ -3744,7 +3744,8 @@ static inline int __dev_xmit_skb(struct sk_buff *skb, struct Qdisc *q, > > if (q->flags & TCQ_F_NOLOCK) { > rc = q->enqueue(skb, q, &to_free) & NET_XMIT_MASK; > - qdisc_run(q); > + if (!qdisc_run(q) && rc == NET_XMIT_SUCCESS) > + __netif_schedule(q); I fear the __netif_schedule() call may cause performance regression to the point of making a revert of TCQ_F_NOLOCK preferable. I'll try to collect some data. Thanks! Paolo