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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F074CCA0EC6 for ; Mon, 11 Sep 2023 22:45:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378673AbjIKWg3 (ORCPT ); Mon, 11 Sep 2023 18:36:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44448 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240967AbjIKO60 (ORCPT ); Mon, 11 Sep 2023 10:58:26 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6974D1B9 for ; Mon, 11 Sep 2023 07:58:22 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B7BEEC433C8; Mon, 11 Sep 2023 14:58:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1694444302; bh=VDV8+2IrKuRhEfBw9rwEOsU/woqgO7tD6cWih1lxahU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=A3NAoOiEwsssEYJl+/F9pm7FpJpeXA0ElZ4GmY3qDIcMkmbdEtWe4xYS9sMkuemNI hTccBx486v1SuI0zW1Duhx8VTD3IMCpPNKSwO7gmUTf8Tb8vZ9YN5jinsAN7q+Qp/x 0A7TZf9q05Xi0ZEXJKClDm9XbINvWkNBSQetBfQc= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Yuan Y Lu , Logan Gunthorpe , Dave Jiang , Jon Mason Subject: [PATCH 6.4 682/737] ntb: Drop packets when qp link is down Date: Mon, 11 Sep 2023 15:49:01 +0200 Message-ID: <20230911134709.587921852@linuxfoundation.org> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230911134650.286315610@linuxfoundation.org> References: <20230911134650.286315610@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org 6.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Dave Jiang commit f195a1a6fe416882984f8bd6c61afc1383171860 upstream. Currently when the transport receive packets after netdev has closed the transport returns error and triggers tx errors to be incremented and carrier to be stopped. There is no reason to return error if the device is already closed. Drop the packet and return 0. Fixes: e26a5843f7f5 ("NTB: Split ntb_hw_intel and ntb_transport drivers") Reported-by: Yuan Y Lu Tested-by: Yuan Y Lu Reviewed-by: Logan Gunthorpe Signed-off-by: Dave Jiang Signed-off-by: Jon Mason Signed-off-by: Greg Kroah-Hartman --- drivers/ntb/ntb_transport.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) --- a/drivers/ntb/ntb_transport.c +++ b/drivers/ntb/ntb_transport.c @@ -2276,9 +2276,13 @@ int ntb_transport_tx_enqueue(struct ntb_ struct ntb_queue_entry *entry; int rc; - if (!qp || !qp->link_is_up || !len) + if (!qp || !len) return -EINVAL; + /* If the qp link is down already, just ignore. */ + if (!qp->link_is_up) + return 0; + entry = ntb_list_rm(&qp->ntb_tx_free_q_lock, &qp->tx_free_q); if (!entry) { qp->tx_err_no_buf++;