From patchwork Tue Nov 17 20:34:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 11913527 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 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 F03E1C63777 for ; Tue, 17 Nov 2020 20:34:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 917CD221FB for ; Tue, 17 Nov 2020 20:34:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="RIfi44lH" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726938AbgKQUeT (ORCPT ); Tue, 17 Nov 2020 15:34:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42140 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726156AbgKQUeT (ORCPT ); Tue, 17 Nov 2020 15:34:19 -0500 Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF530C0613CF for ; Tue, 17 Nov 2020 12:34:18 -0800 (PST) Received: by mail-wr1-x443.google.com with SMTP id d12so24692575wrr.13 for ; Tue, 17 Nov 2020 12:34: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-transfer-encoding; bh=1x1A5YcgE3vN+WCnlxjTX+2mKo29bnhZoWw/xtIYX/s=; b=RIfi44lHlhqwc9jeIHiEF9w1J+7tX1FucH0/ihnpd7YWH1lVyWJUQVChDaX+/nr1pQ 5DOUbXR5Q5MS6ssJO24KuR78uVG6CIg1otChfyHw/MwEWj+szUbZ5925R9nNJMzphcsN KgKAxWcsW5p5leJr1xqAmqQSF1BUNgjboMkRszeTJCeTVUuTwTAUzO6QTOfTVsNhrSIc txYEAZoRJTtfvlhGPgkphl53qLXur4WQqlce3la82YfJbScco0u/3DHsN0oZEJYWKQSp 9dGT+R+0Ed86D+GNGXMhIp0ww3p6tEb4OWY2wd1lmWQxJgnyby3ZpK7+iZMhle7wMADW /wfw== 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-transfer-encoding; bh=1x1A5YcgE3vN+WCnlxjTX+2mKo29bnhZoWw/xtIYX/s=; b=Wh/SPIaui/W7rcWK3Vwtaak37Y2gXZqth+quXErj0RelH8riW/yTtGQiynduSIfO6j 2xlh1/HuRKgl9a5DS1Lf1GY4rOMlt3KD8OeneM3jgkuB/uwisuG62cP6xGt79RgzGxoJ lwcZEwW1/D0+xLLMbqmoapn8PM/BSt9rmXh+7vPYBT3qk6dYQvj8GY8OnTQWapULc5kt +cOpmwRnAeMcMnD3r49LgoX0MhQCWwIxhjqJOuP6a7NLOmLpxMsoVArYHwGkQh/Lr5NZ bkUkIwYHBWs6rPo/IkKf++bmXZNKPVymBFVqQKevE8kSZi9ha++Un6zGtIOhHzh8ROXn onHw== X-Gm-Message-State: AOAM532yMinzej7UQA/gyx7dhDR14RZPiu7xWkujCgGyftr1/VE9NIEc jbs7TxwJH+MRBXg51COn6A++Of81+oWZxg== X-Google-Smtp-Source: ABdhPJxewW2aku01PQfHJ4edY/5SKlWujDyV9+4x38xPPBpkOfgqcPX+6QrIWA5NnM7LChI/YOwvqQ== X-Received: by 2002:adf:f9c6:: with SMTP id w6mr1277707wrr.273.1605645257381; Tue, 17 Nov 2020 12:34:17 -0800 (PST) Received: from ?IPv6:2003:ea:8f23:2800:44e4:5b02:13:99de? (p200300ea8f23280044e45b02001399de.dip0.t-ipconnect.de. [2003:ea:8f23:2800:44e4:5b02:13:99de]) by smtp.googlemail.com with ESMTPSA id u81sm6107074wmb.27.2020.11.17.12.34.16 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 17 Nov 2020 12:34: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: remove not needed check in rtl8169_start_xmit Message-ID: <6965d665-6c50-90c5-70e6-0bb335d4ea47@gmail.com> Date: Tue, 17 Nov 2020 21:34:09 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.4.3 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org In rtl_tx() the released descriptors are zero'ed by rtl8169_unmap_tx_skb(). And in the beginning of rtl8169_start_xmit() we check that enough descriptors are free, therefore there's no way the DescOwn bit can be set here. Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/realtek/r8169_main.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c index e05df043c..5766d191f 100644 --- a/drivers/net/ethernet/realtek/r8169_main.c +++ b/drivers/net/ethernet/realtek/r8169_main.c @@ -4180,17 +4180,12 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb, bool stop_queue, door_bell; u32 opts[2]; - txd_first = tp->TxDescArray + entry; - if (unlikely(!rtl_tx_slots_avail(tp))) { if (net_ratelimit()) netdev_err(dev, "BUG! Tx Ring full when queue awake!\n"); goto err_stop_0; } - if (unlikely(le32_to_cpu(txd_first->opts1) & DescOwn)) - goto err_stop_0; - opts[1] = rtl8169_tx_vlan_tag(skb); opts[0] = 0; @@ -4203,6 +4198,8 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb, entry, false))) goto err_dma_0; + txd_first = tp->TxDescArray + entry; + if (frags) { if (rtl8169_xmit_frags(tp, skb, opts, entry)) goto err_dma_1;