From patchwork Sat Apr 15 07:20:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 13212314 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C300BC77B71 for ; Sat, 15 Apr 2023 07:24:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229625AbjDOHYV (ORCPT ); Sat, 15 Apr 2023 03:24:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42468 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229491AbjDOHYU (ORCPT ); Sat, 15 Apr 2023 03:24:20 -0400 Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B6FDD3A9C for ; Sat, 15 Apr 2023 00:24:17 -0700 (PDT) Received: by mail-ej1-x62f.google.com with SMTP id qb20so50775745ejc.6 for ; Sat, 15 Apr 2023 00:24:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1681543456; x=1684135456; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=+VAYy4x1VW7GQjpcDHqlJKO18XulsfdzrpJC5dPxENk=; b=Uwe82IP25ZLJx6RcMRjmaz4B00nH2WVSEXxHCbeToeyWsOXYjpvRNq3ZYUg34HMDT8 df1aTl+zMh4df9g4OtZ/pEf+iVbo6D8fr+lYfuEdvdL/bJ2RQzpfJZ5xA5RBK96D41P+ CPwEfb7EY20mW4RX887jDB1Srcxc2HksfxNTSifEIOBXwfrE06G5y1mnON6Fi68GoOAi znVgDD6x5EnoTdPu6MfP3KJkP1yw/YGWJIovu/yg9KzrZgzZncNWLsxgRw+2wXoe3y3Z amhF9uIgEW/qt6je4LWO0B/FaGeUQ7rxwuYA0QIjdHmqEh4XBsSC1QuwgnoJwUiVxiQS camQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681543456; x=1684135456; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=+VAYy4x1VW7GQjpcDHqlJKO18XulsfdzrpJC5dPxENk=; b=B5DgmA36P6DdFrnf2yx+N19Zy2KiXBW3G7Cynlk6FbrTqnpZL52p75FPGMLiDw0C1w 0uK1OtQJqSS6cYalKoHcThljjLXbbOOch7P3C37axiZTIVJuV/yW3q0QqHx86/CC0Rvr Bs6gYP8waZkfW6DGBMGZYPUTC1LEHltsjs5e46olLwavyNhjp/XoXhK9cTpOTbt0sK9l kLH7Gd8vFOOLxltq8jF9e0LLtoxeKeYhr/DQJEobAR29kXqokEE44cKEXCqj28UP/g0c cGnV9gMSMK1fD+yhBsipJSKAyawKH9hdVqk85IbGpVyqrhSjuv7q4WRVSdTSIQxnI2yK mBrQ== X-Gm-Message-State: AAQBX9ew2UxzD/azY6DLanMn0VPqwIt6rz3c4B/vYNUdscfQKyC3YDZk tKy9Tzgh3D/nlBteTTcN9pYIHFjTU/U= X-Google-Smtp-Source: AKy350aYqCggtcWKslreX6ui5iJrWISf3kMbMjakjgzSJfDk/WpVf+6Tijk6kF6owubhIEn3fBt4OQ== X-Received: by 2002:a17:907:3ad1:b0:933:868:413a with SMTP id fi17-20020a1709073ad100b009330868413amr1247444ejc.15.1681543456095; Sat, 15 Apr 2023 00:24:16 -0700 (PDT) Received: from ?IPV6:2a01:c22:76c9:5300:c449:604e:39a7:3bce? (dynamic-2a01-0c22-76c9-5300-c449-604e-39a7-3bce.c22.pool.telefonica.de. [2a01:c22:76c9:5300:c449:604e:39a7:3bce]) by smtp.googlemail.com with ESMTPSA id u11-20020aa7d98b000000b004ad601533a3sm2980846eds.55.2023.04.15.00.24.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 15 Apr 2023 00:24:15 -0700 (PDT) Message-ID: <85e0616f-76ac-26c0-b650-11bb7f0b9824@gmail.com> Date: Sat, 15 Apr 2023 09:20:18 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: [PATCH net-next v2 1/3] net: add macro netif_subqueue_completed_wake Content-Language: en-US From: Heiner Kallweit To: Jakub Kicinski , David Miller , Paolo Abeni , Eric Dumazet , Realtek linux nic maintainers Cc: "netdev@vger.kernel.org" References: In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Add netif_subqueue_completed_wake, complementing the subqueue versions netif_subqueue_try_stop and netif_subqueue_maybe_stop. Reviewed-by: Jacob Keller Signed-off-by: Heiner Kallweit --- include/net/netdev_queues.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/net/netdev_queues.h b/include/net/netdev_queues.h index b26fdb441..d68b0a483 100644 --- a/include/net/netdev_queues.h +++ b/include/net/netdev_queues.h @@ -160,4 +160,14 @@ netdev_txq_completed_mb(struct netdev_queue *dev_queue, netif_txq_maybe_stop(txq, get_desc, stop_thrs, start_thrs); \ }) +#define netif_subqueue_completed_wake(dev, idx, pkts, bytes, \ + get_desc, start_thrs) \ + ({ \ + struct netdev_queue *txq; \ + \ + txq = netdev_get_tx_queue(dev, idx); \ + netif_txq_completed_wake(txq, pkts, bytes, \ + get_desc, start_thrs); \ + }) + #endif From patchwork Sat Apr 15 07:22:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 13212315 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 67429C7619A for ; Sat, 15 Apr 2023 07:24:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229717AbjDOHYW (ORCPT ); Sat, 15 Apr 2023 03:24:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229546AbjDOHYU (ORCPT ); Sat, 15 Apr 2023 03:24:20 -0400 Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com [IPv6:2a00:1450:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DFAF159E7 for ; Sat, 15 Apr 2023 00:24:18 -0700 (PDT) Received: by mail-ej1-x632.google.com with SMTP id dm2so51287317ejc.8 for ; Sat, 15 Apr 2023 00:24:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1681543457; x=1684135457; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=RK28hzg8zR/EJQwiFtx4DmL6CkIIAfbAnzEygXZr6i4=; b=QnLVFJREcDej01wZXmrrCEqVP5PMHc1tKeS11ZKOMEgvFL/HZeCFGERcGzbyNiD05N tKB5R85dO5m8qgKGj3EwXlCmTSv0VMHofs25aNIDUhbvDwTKrcX+MzUKXHvDwhYo7ewR ukuJTZczkW9sr/OvTFodhsy+8X73ZF6krR4cA0NL8ZVzV0eFmj/6/SwC7b654UpQT//V yGsPT/iEPxfV+AxzxW81RJSRWM3b9JbATm5gAF2EedxUx5LIqRZFT/b8Q1Z1WC1oY9lH 4SDHCw3RWLXDQcf11Lz7NEbJeBBThO7KaGInBNucaAZ8KoyjOBa7/RuazL/yZaPUylYU iYaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681543457; x=1684135457; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=RK28hzg8zR/EJQwiFtx4DmL6CkIIAfbAnzEygXZr6i4=; b=Wh2psmN/q+/1ig6T7738ALhBLzZwcRbrOTZASV8kk5qaIk1JC7C5/5kNYYSUobD7Qa 9GZ2a4kEwVkSAH8JhspamcUQ5w5+FhFZBjUbT1WOhGSe1aJZrGPFO3ciSacjYk9Ia/YD 78WNHaYi4BddvDxvQc56pX0svALuRbRMy3aZT+jorOtYmoXwhGsl6JN9RwMmzySX27oW MJRw/O/X6XK+g3WbbOj4zLcBQWD8FdlWfCfNwI8tVGtmWmov/w5yu0ZF+pi1XMp6PJNY mhC9OUQgze/RG22zGMaCsGyy9orB5D3I6z1Tc2vzarL5Q9+pKnjTcL6eZ0mSW3l8ubrq abtQ== X-Gm-Message-State: AAQBX9f+RZBywp/1pgkFuNp8My6iAgVBUfGOTELP+q6xSTV1ZPqWYHTC Sp8x9xRHMGAW0M90SA3MMwU= X-Google-Smtp-Source: AKy350bb37QeeBiKl0snsAU32aINK4zbm5Ud5au+djjkhOJcvyvDu2eTfYDAyoa2PtGwU5wj/WeVFw== X-Received: by 2002:a17:906:a84d:b0:93b:1c78:5796 with SMTP id dx13-20020a170906a84d00b0093b1c785796mr1373373ejb.43.1681543457209; Sat, 15 Apr 2023 00:24:17 -0700 (PDT) Received: from ?IPV6:2a01:c22:76c9:5300:c449:604e:39a7:3bce? (dynamic-2a01-0c22-76c9-5300-c449-604e-39a7-3bce.c22.pool.telefonica.de. [2a01:c22:76c9:5300:c449:604e:39a7:3bce]) by smtp.googlemail.com with ESMTPSA id p3-20020a17090635c300b0094ed14a5b75sm2327049ejb.51.2023.04.15.00.24.16 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 15 Apr 2023 00:24:16 -0700 (PDT) Message-ID: <69c2eec2-d82c-290a-d6ce-fba64afb32c6@gmail.com> Date: Sat, 15 Apr 2023 09:22:11 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: [PATCH net-next v2 2/3] r8169: use new macro netif_subqueue_maybe_stop in rtl8169_start_xmit Content-Language: en-US From: Heiner Kallweit To: Jakub Kicinski , David Miller , Paolo Abeni , Eric Dumazet , Realtek linux nic maintainers Cc: "netdev@vger.kernel.org" References: In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Use new net core macro netif_subqueue_maybe_stop in the start_xmit path to simplify the code. Whilst at it, set the tx queue start threshold to twice the stop threshold. Before values were the same, resulting in stopping/starting the queue more often than needed. v2: - ring doorbell if queue was stopped Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/realtek/r8169_main.c | 39 +++++++---------------- 1 file changed, 11 insertions(+), 28 deletions(-) diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c index 9f8357bbc..fff44d46b 100644 --- a/drivers/net/ethernet/realtek/r8169_main.c +++ b/drivers/net/ethernet/realtek/r8169_main.c @@ -30,6 +30,7 @@ #include #include #include +#include #include "r8169.h" #include "r8169_firmware.h" @@ -68,6 +69,8 @@ #define NUM_RX_DESC 256 /* Number of Rx descriptor registers */ #define R8169_TX_RING_BYTES (NUM_TX_DESC * sizeof(struct TxDesc)) #define R8169_RX_RING_BYTES (NUM_RX_DESC * sizeof(struct RxDesc)) +#define R8169_TX_STOP_THRS (MAX_SKB_FRAGS + 1) +#define R8169_TX_START_THRS (2 * R8169_TX_STOP_THRS) #define OCP_STD_PHY_BASE 0xa400 @@ -4162,13 +4165,9 @@ static bool rtl8169_tso_csum_v2(struct rtl8169_private *tp, return true; } -static bool rtl_tx_slots_avail(struct rtl8169_private *tp) +static unsigned int rtl_tx_slots_avail(struct rtl8169_private *tp) { - unsigned int slots_avail = READ_ONCE(tp->dirty_tx) + NUM_TX_DESC - - READ_ONCE(tp->cur_tx); - - /* A skbuff with nr_frags needs nr_frags+1 entries in the tx queue */ - return slots_avail > MAX_SKB_FRAGS; + return READ_ONCE(tp->dirty_tx) + NUM_TX_DESC - READ_ONCE(tp->cur_tx); } /* Versions RTL8102e and from RTL8168c onwards support csum_v2 */ @@ -4245,27 +4244,10 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb, WRITE_ONCE(tp->cur_tx, tp->cur_tx + frags + 1); - stop_queue = !rtl_tx_slots_avail(tp); - if (unlikely(stop_queue)) { - /* Avoid wrongly optimistic queue wake-up: rtl_tx thread must - * not miss a ring update when it notices a stopped queue. - */ - smp_wmb(); - netif_stop_queue(dev); - /* Sync with rtl_tx: - * - publish queue status and cur_tx ring index (write barrier) - * - refresh dirty_tx ring index (read barrier). - * May the current thread have a pessimistic view of the ring - * status and forget to wake up queue, a racing rtl_tx thread - * can't. - */ - smp_mb__after_atomic(); - if (rtl_tx_slots_avail(tp)) - netif_start_queue(dev); - door_bell = true; - } - - if (door_bell) + stop_queue = !netif_subqueue_maybe_stop(dev, 0, rtl_tx_slots_avail(tp), + R8169_TX_STOP_THRS, + R8169_TX_START_THRS); + if (door_bell || stop_queue) rtl8169_doorbell(tp); return NETDEV_TX_OK; @@ -4400,7 +4382,8 @@ static void rtl_tx(struct net_device *dev, struct rtl8169_private *tp, * ring status. */ smp_store_mb(tp->dirty_tx, dirty_tx); - if (netif_queue_stopped(dev) && rtl_tx_slots_avail(tp)) + if (netif_queue_stopped(dev) && + rtl_tx_slots_avail(tp) >= R8169_TX_START_THRS) netif_wake_queue(dev); /* * 8168 hack: TxPoll requests are lost when the Tx packets are From patchwork Sat Apr 15 07:23:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 13212316 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C2567C77B71 for ; Sat, 15 Apr 2023 07:24:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229760AbjDOHYY (ORCPT ); Sat, 15 Apr 2023 03:24:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42476 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229689AbjDOHYV (ORCPT ); Sat, 15 Apr 2023 03:24:21 -0400 Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [IPv6:2a00:1450:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DCCF859EA for ; Sat, 15 Apr 2023 00:24:19 -0700 (PDT) Received: by mail-ej1-x635.google.com with SMTP id dm2so51287371ejc.8 for ; Sat, 15 Apr 2023 00:24:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1681543458; x=1684135458; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=tRUb1jq6dyRB1byqY/bTgCFESHTySsZnF7VVr6Rsffk=; b=AwrsagBmpdIfSywXpBoc17BZ4+5wH97ixx9QnT/VGUsQJbYu5S5Mnjvw5MrL8rih0F RkKJZM6UoCxwkbyfKAJTWvmhYMqpGGVqAV3JeWbLYx/0vs36SIoSZ/uAIBbauR3GDtXd FqZyQp58sgjIli0J9AzVl/0WgNH4MbQjL9bAWj24wHKGc5AIIGydg1WcDaiObk1j2HWY Zzgt2xbwvVv4IvdH0zYgaQdb2y/1qFM/5Hrutp8w8H6urDCojdbOVraDDpV8EsW22T7Q BvADI0fae/306hM88FoAyRbpJk1tyrofGliO7MYSimnlt45xS+ETiAF3eEp2TXArGRLG n7sA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681543458; x=1684135458; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=tRUb1jq6dyRB1byqY/bTgCFESHTySsZnF7VVr6Rsffk=; b=khgaDXVEih744+/C5unDAZNQA0SE4u7bFZaDBbjqHooer1RbO/VR0IUp1qcuDELwYg Tmd4TLS1butyf8K9kDBO8MvFtgWiyoaQfmrlAmsbkIUlmNt6fydAd/aefdBwglCq5h9D bqglRp6/GmHORy8UJmHgRKulzFpdqt8Jkb6SeEVh1FIvE9LEnuj2vvx53DsqTmH/3Efy nNUt5NAvbtoIVlVtFDkvnovxh/04fX2VVZMUZEXR49SWSAVyYuHxt4/q/0Jtp6ngRexc wAqrurzAfeYm62ft1XMvk/YZ7ELzm3skcRh0pGdeR9NAyzyLKFHamOObStLuuSwZfH2g YYqg== X-Gm-Message-State: AAQBX9fNG3l789+UOp5YqropbUBtq4Udw8VeGXocADiqjvmaB54iLW40 P0fPpj8MrvEhbLU+sgsb90s= X-Google-Smtp-Source: AKy350ZugidO6GPKzviXfcR3ew30QCdfFDwgI2/Oir0PMym9+G6iB78+q28uCOTs1IvW7vH5TlBI7Q== X-Received: by 2002:a17:906:af9a:b0:94e:e6b9:fef2 with SMTP id mj26-20020a170906af9a00b0094ee6b9fef2mr1460279ejb.67.1681543458265; Sat, 15 Apr 2023 00:24:18 -0700 (PDT) Received: from ?IPV6:2a01:c22:76c9:5300:c449:604e:39a7:3bce? (dynamic-2a01-0c22-76c9-5300-c449-604e-39a7-3bce.c22.pool.telefonica.de. [2a01:c22:76c9:5300:c449:604e:39a7:3bce]) by smtp.googlemail.com with ESMTPSA id r7-20020aa7cb87000000b0050687ca0c92sm1161685edt.84.2023.04.15.00.24.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 15 Apr 2023 00:24:18 -0700 (PDT) Message-ID: Date: Sat, 15 Apr 2023 09:23:29 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: [PATCH net-next v2 3/3] r8169: use new macro netif_subqueue_completed_wake in the tx cleanup path Content-Language: en-US From: Heiner Kallweit To: Jakub Kicinski , David Miller , Paolo Abeni , Eric Dumazet , Realtek linux nic maintainers Cc: "netdev@vger.kernel.org" References: In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Use new net core macro netif_subqueue_completed_wake to simplify the code of the tx cleanup path. Reviewed-by: Jacob Keller Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/realtek/r8169_main.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c index fff44d46b..a7e376e7e 100644 --- a/drivers/net/ethernet/realtek/r8169_main.c +++ b/drivers/net/ethernet/realtek/r8169_main.c @@ -4371,20 +4371,12 @@ static void rtl_tx(struct net_device *dev, struct rtl8169_private *tp, } if (tp->dirty_tx != dirty_tx) { - netdev_completed_queue(dev, pkts_compl, bytes_compl); dev_sw_netstats_tx_add(dev, pkts_compl, bytes_compl); + WRITE_ONCE(tp->dirty_tx, dirty_tx); - /* Sync with rtl8169_start_xmit: - * - publish dirty_tx ring index (write barrier) - * - refresh cur_tx ring index and queue status (read barrier) - * May the current thread miss the stopped queue condition, - * a racing xmit thread can only have a right view of the - * ring status. - */ - smp_store_mb(tp->dirty_tx, dirty_tx); - if (netif_queue_stopped(dev) && - rtl_tx_slots_avail(tp) >= R8169_TX_START_THRS) - netif_wake_queue(dev); + netif_subqueue_completed_wake(dev, 0, pkts_compl, bytes_compl, + rtl_tx_slots_avail(tp), + R8169_TX_START_THRS); /* * 8168 hack: TxPoll requests are lost when the Tx packets are * too close. Let's kick an extra TxPoll request when a burst