From patchwork Thu Feb 11 20:20:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 381546 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=-14.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_SANE_1 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 79FB5C433E0 for ; Thu, 11 Feb 2021 20:21:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3839A64E5B for ; Thu, 11 Feb 2021 20:21:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231437AbhBKUVg (ORCPT ); Thu, 11 Feb 2021 15:21:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59070 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230077AbhBKUU6 (ORCPT ); Thu, 11 Feb 2021 15:20:58 -0500 Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D169C061574 for ; Thu, 11 Feb 2021 12:20:18 -0800 (PST) Received: by mail-wr1-x42b.google.com with SMTP id l12so5457022wry.2 for ; Thu, 11 Feb 2021 12:20:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:message-id:date:user-agent:mime-version :content-language:content-transfer-encoding; bh=qUZPPTjxypuIsOSEwHiV1oADSOUC3Aajk7rQCjLylg8=; b=IMFFu2GIuGkBf3laXfXuM7qEF5I3e1BNnAxKjiPP2nJc9+FIAeTNFFaoRq9/9b+y6Z LI0O9Rr4LyTU5V0xeCYcxIPcqmAr7FaXwHZx0WgR8DYyXyWEN/nHSRNeBKv0tPbr46Zj TjT84pdXpLHCc/TQhpiDcpgkdeZEK2+tJNd1qUs6qvqKHyi2ym2mHmwTBOeTFvPraTbq mVdXDBLTdWtj34qcbaeqMlJ20lckL12qX2J6Tu6bkBUlLDOoE7qgNDQJoMVdj2BWxlbd pykDtgGZnJy1kqG21qY52ywTaOUVC5rO3Ql1Y4U+bxzzGAKuYnLZZn+sRGDmTxBT/EnZ OZ3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:message-id:date:user-agent :mime-version:content-language:content-transfer-encoding; bh=qUZPPTjxypuIsOSEwHiV1oADSOUC3Aajk7rQCjLylg8=; b=hHpddispClhkMvMWr0MJBaiy0Vvy5z2pSjJhWP9jK7RpreXnpk7B54KHPKz5Abwlpc UZwbS4Xz+X+xrx7LlJfKbAMsLXtSUP2YUA97k2J5bpQBJTdw/b/mqTW8YDOKn4/J+7NI PinIxhNG6dXCsO3WdeDbWvNkHV6QnEZuAxf6A1FNFtPpVpNlWLG7AABbB9J6Oh4YnjG5 2Ov4LRMMhRL8Uk6YillGXw8chzEiLYOXHv1GzI4AuLAk+eaMvU52SmjhacYAtTBbcJiP RF1+bF8wpPLTQz6ZmMmHiP2+G2fWCiLV7pgdoYjZ8QaCAukwB3FoeroONn5fyqbFKLAb xK8g== X-Gm-Message-State: AOAM531rvexdbpkW25DxSDqefsGT5toWJhno+f+KfLtyK6FFOLs3A2VP 3h5ZWnH1s9VVpkh96wYp9W2wGFz9ANmx+w== X-Google-Smtp-Source: ABdhPJyKwI0Vv7ZHwbT1BYaeqhmq7PjI58nCEQY/1QxjALvsYL+yP7AL4IwKGrusdFCtBBbu0eQyfQ== X-Received: by 2002:a5d:6c66:: with SMTP id r6mr7233202wrz.86.1613074816665; Thu, 11 Feb 2021 12:20:16 -0800 (PST) Received: from ?IPv6:2003:ea:8f1f:ad00:1524:b28c:2a1c:169e? (p200300ea8f1fad001524b28c2a1c169e.dip0.t-ipconnect.de. [2003:ea:8f1f:ad00:1524:b28c:2a1c:169e]) by smtp.googlemail.com with ESMTPSA id c11sm6499849wrs.28.2021.02.11.12.20.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 11 Feb 2021 12:20:16 -0800 (PST) From: Heiner Kallweit To: Jakub Kicinski , David Miller , Realtek linux nic maintainers Cc: "netdev@vger.kernel.org" Subject: [PATCH net-next] r8169: handle tx before rx in napi poll Message-ID: <5ef5322d-cc83-747b-5995-2e60f2c39d93@gmail.com> Date: Thu, 11 Feb 2021 21:20:08 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Cleaning up tx descriptors first increases the chance that rtl_rx() can allocate new skb's from the cache. Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/realtek/r8169_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c index de439db75..44a438bad 100644 --- a/drivers/net/ethernet/realtek/r8169_main.c +++ b/drivers/net/ethernet/realtek/r8169_main.c @@ -4588,10 +4588,10 @@ static int rtl8169_poll(struct napi_struct *napi, int budget) struct net_device *dev = tp->dev; int work_done; - work_done = rtl_rx(dev, tp, budget); - rtl_tx(dev, tp, budget); + work_done = rtl_rx(dev, tp, budget); + if (work_done < budget && napi_complete_done(napi, work_done)) rtl_irq_enable(tp);