From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 515D0C07542 for ; Mon, 27 May 2019 05:15:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2EFC4216FD for ; Mon, 27 May 2019 05:15:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726144AbfE0FP5 (ORCPT ); Mon, 27 May 2019 01:15:57 -0400 Received: from shards.monkeyblade.net ([23.128.96.9]:50736 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726046AbfE0FP5 (ORCPT ); Mon, 27 May 2019 01:15:57 -0400 Received: from localhost (unknown [IPv6:2601:601:9f80:35cd::3d8]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id 876F6149027E0; Sun, 26 May 2019 22:15:56 -0700 (PDT) Date: Sun, 26 May 2019 22:15:56 -0700 (PDT) Message-Id: <20190526.221556.885075788672387642.davem@davemloft.net> To: Igor.Russkikh@aquantia.com Cc: netdev@vger.kernel.org Subject: Re: [PATCH net 1/4] net: aquantia: tx clean budget logic error From: David Miller In-Reply-To: References: X-Mailer: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Sun, 26 May 2019 22:15:56 -0700 (PDT) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Igor Russkikh Date: Sat, 25 May 2019 09:57:59 +0000 > In case no other traffic happening on the ring, full tx cleanup > may not be completed. That may cause socket buffer to overflow > and tx traffic to stuck until next activity on the ring happens. > > This is due to logic error in budget variable decrementor. > Variable is compared with zero, and then post decremented, > causing it to become MAX_INT. Solution is remove decrementor > from the `for` statement and rewrite it in a clear way. > > Fixes: b647d3980948e ("net: aquantia: Add tx clean budget and valid budget handling logic") > Signed-off-by: Igor Russkikh I think the TX clean budget is a very bad idea. You should always do as much TX clean work as there is TODO.