From patchwork Tue Dec 12 00:51:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Chan X-Patchwork-Id: 13488259 X-Patchwork-Delegate: kuba@kernel.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="Yku+/dm/" Received: from mail-qt1-x833.google.com (mail-qt1-x833.google.com [IPv6:2607:f8b0:4864:20::833]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 68555A6 for ; Mon, 11 Dec 2023 16:51:50 -0800 (PST) Received: by mail-qt1-x833.google.com with SMTP id d75a77b69052e-425a2b4df7bso28950281cf.0 for ; Mon, 11 Dec 2023 16:51:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1702342309; x=1702947109; darn=vger.kernel.org; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=aelxwKrcpUovV+lrvFh8GS5TLlt4A+P3CdYnZDF2F/w=; b=Yku+/dm/cH+/hFoDnsKYhIIxs/e2XvQpHroMLXqozetr4dkjj1GQKzkMHUoAozHuia 7JjUS8/9+dcYepTPFQOlyohwTGpw81T+nBH/yk7xC10oLgkT81BiyonYoc6bE/MddAQ1 LfWxz1X+g+gsFuuEbLMmV2H+MPw+0ja9WwBJE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702342309; x=1702947109; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=aelxwKrcpUovV+lrvFh8GS5TLlt4A+P3CdYnZDF2F/w=; b=WMNakwdWuwWJ2fmp/Dqlo5MMKDDGm+r/in7YQW4A+q/VK/I8cHCl88Fp4ezuTL/Soo IQfTjehtp1LyqJidG+Yj94+ks09HOGRK1XoQQMPBEkHpl7Zdkt/v61DbUPrg7AullvBI tal0kjg4j8NGxkPE+CE98QkSYWvpiBYqoPeSLNXhva53AmupFk4YyMZimWAcpzcasorL MhBJlocjgAL914KPGsp7tcMMHEep3G4TBO99Oi34bXIr4wozmIbrc0nQc+zgUE9vjFBj AlFE2CN0W9as1IMZl27CTdnK6tnLyPni3I0++3P7DlKVnx/Am83hO/alHTALyJ6m0NBN AF0A== X-Gm-Message-State: AOJu0YxpAYyEkuDD+RnbgPYm3lpdbiDc3AgHVlPZgvuUY8oYqbVImWpJ HCBMBBRBmxdQv13fU72GI9eaXQ== X-Google-Smtp-Source: AGHT+IHH4KnZGqbhTxGq39hEVczEoou9+1LzRp/2NKu+++dNjSFt3phDOo+GwxdOFc1+tn15GVHsiw== X-Received: by 2002:ac8:7e88:0:b0:425:a282:71af with SMTP id w8-20020ac87e88000000b00425a28271afmr8195649qtj.35.1702342309504; Mon, 11 Dec 2023 16:51:49 -0800 (PST) Received: from lvnvda5233.lvn.broadcom.net ([192.19.161.250]) by smtp.gmail.com with ESMTPSA id r5-20020ac87945000000b00423ea1b31b3sm3619664qtt.66.2023.12.11.16.51.47 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Dec 2023 16:51:48 -0800 (PST) From: Michael Chan To: davem@davemloft.net Cc: netdev@vger.kernel.org, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, gospo@broadcom.com, Somnath Kotur , Andy Gospodarek , Hongguang Gao Subject: [PATCH net-next 04/13] bnxt_en: Prevent TX timeout with a very small TX ring Date: Mon, 11 Dec 2023 16:51:13 -0800 Message-Id: <20231212005122.2401-5-michael.chan@broadcom.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20231212005122.2401-1-michael.chan@broadcom.com> References: <20231212005122.2401-1-michael.chan@broadcom.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org If xmit_more condition is true, the driver may set the TX_BD_FLAGS_NO_CMPL flag. If after this packet, the TX ring can no longer hold a packet with maximum fragments, we will stop the TX queue. When this happens, we must clear the TX_BD_FLAGS_NO_CMPL flag on the last packet or there will be no completion and cause TX timeout. Fixes: c1056a59aee1 ("bnxt_en: Optimize xmit_more TX path") Reviewed-by: Somnath Kotur Reviewed-by: Andy Gospodarek Reviewed-by: Hongguang Gao Signed-off-by: Michael Chan --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index 83a47feaf869..cc6cab340423 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -666,8 +666,11 @@ static netdev_tx_t bnxt_start_xmit(struct sk_buff *skb, struct net_device *dev) tx_done: if (unlikely(bnxt_tx_avail(bp, txr) <= MAX_SKB_FRAGS + 1)) { - if (netdev_xmit_more() && !tx_buf->is_push) + if (netdev_xmit_more() && !tx_buf->is_push) { + txbd0->tx_bd_len_flags_type &= + cpu_to_le32(~TX_BD_FLAGS_NO_CMPL); bnxt_txr_db_kick(bp, txr, prod); + } netif_txq_try_stop(txq, bnxt_tx_avail(bp, txr), bp->tx_wake_thresh);