From patchwork Thu Feb 27 21:09:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Simmons X-Patchwork-Id: 11409867 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CB245138D for ; Thu, 27 Feb 2020 21:24:25 +0000 (UTC) Received: from pdx1-mailman02.dreamhost.com (pdx1-mailman02.dreamhost.com [64.90.62.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B3B2E246A0 for ; Thu, 27 Feb 2020 21:24:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B3B2E246A0 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lustre-devel-bounces@lists.lustre.org Received: from pdx1-mailman02.dreamhost.com (localhost [IPv6:::1]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id DFE0D348C35; Thu, 27 Feb 2020 13:22:10 -0800 (PST) X-Original-To: lustre-devel@lists.lustre.org Delivered-To: lustre-devel-lustre.org@pdx1-mailman02.dreamhost.com Received: from smtp3.ccs.ornl.gov (smtp3.ccs.ornl.gov [160.91.203.39]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id 8015E21FA79 for ; Thu, 27 Feb 2020 13:18:50 -0800 (PST) Received: from star.ccs.ornl.gov (star.ccs.ornl.gov [160.91.202.134]) by smtp3.ccs.ornl.gov (Postfix) with ESMTP id 8AA961037; Thu, 27 Feb 2020 16:18:14 -0500 (EST) Received: by star.ccs.ornl.gov (Postfix, from userid 2004) id 893FB468; Thu, 27 Feb 2020 16:18:14 -0500 (EST) From: James Simmons To: Andreas Dilger , Oleg Drokin , NeilBrown Date: Thu, 27 Feb 2020 16:09:39 -0500 Message-Id: <1582838290-17243-112-git-send-email-jsimmons@infradead.org> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1582838290-17243-1-git-send-email-jsimmons@infradead.org> References: <1582838290-17243-1-git-send-email-jsimmons@infradead.org> Subject: [lustre-devel] [PATCH 111/622] lnet: lnd: Clean up logging X-BeenThere: lustre-devel@lists.lustre.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "For discussing Lustre software development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Amir Shehata , Lustre Development List MIME-Version: 1.0 Errors-To: lustre-devel-bounces@lists.lustre.org Sender: "lustre-devel" From: Amir Shehata No need to output error in ksocknal_tx_done() as this error is tracked in lnet. No need to keep a cookie in the connection. It's always set to the message. This will allow us to set the msg's health status properly before calling lnet_finalize() WC-bug-id: https://jira.whamcloud.com/browse/LU-11309 Lustre-commit: cdf462b19345 ("LU-11309 lnd: Clean up logging") Signed-off-by: Amir Shehata Reviewed-on: https://review.whamcloud.com/33096 Reviewed-by: Doug Oucharek Reviewed-by: Sonia Sharma Reviewed-by: James Simmons Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- net/lnet/klnds/socklnd/socklnd.c | 5 ++++- net/lnet/klnds/socklnd/socklnd.h | 3 +-- net/lnet/klnds/socklnd/socklnd_cb.c | 10 +++++----- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/net/lnet/klnds/socklnd/socklnd.c b/net/lnet/klnds/socklnd/socklnd.c index 891d3bd..72ecf80 100644 --- a/net/lnet/klnds/socklnd/socklnd.c +++ b/net/lnet/klnds/socklnd/socklnd.c @@ -1680,7 +1680,10 @@ struct ksock_peer * &conn->ksnc_ipaddr, conn->ksnc_port, iov_iter_count(&conn->ksnc_rx_to), conn->ksnc_rx_nob_left, ktime_get_seconds() - last_rcv); - lnet_finalize(conn->ksnc_cookie, -EIO); + if (conn->ksnc_lnet_msg) + conn->ksnc_lnet_msg->msg_health_status = + LNET_MSG_STATUS_REMOTE_ERROR; + lnet_finalize(conn->ksnc_lnet_msg, -EIO); break; case SOCKNAL_RX_LNET_HEADER: if (conn->ksnc_rx_started) diff --git a/net/lnet/klnds/socklnd/socklnd.h b/net/lnet/klnds/socklnd/socklnd.h index 48884cf..c8d8acf 100644 --- a/net/lnet/klnds/socklnd/socklnd.h +++ b/net/lnet/klnds/socklnd/socklnd.h @@ -355,8 +355,7 @@ struct ksock_conn { u32 ksnc_rx_csum; /* partial checksum for incoming * data */ - void *ksnc_cookie; /* rx lnet_finalize passthru arg - */ + struct lnet_msg *ksnc_lnet_msg; /* rx lnet_finalize arg */ struct ksock_msg ksnc_msg; /* incoming message buffer: * V2.x message takes the * whole struct diff --git a/net/lnet/klnds/socklnd/socklnd_cb.c b/net/lnet/klnds/socklnd/socklnd_cb.c index 057c7f3..10a1934 100644 --- a/net/lnet/klnds/socklnd/socklnd_cb.c +++ b/net/lnet/klnds/socklnd/socklnd_cb.c @@ -344,9 +344,6 @@ struct ksock_tx * ksocknal_free_tx(tx); if (lnetmsg) { /* KSOCK_MSG_NOOP go without lnetmsg */ - if (rc) - CERROR("tx failure rc = %d, hstatus = %d\n", rc, - hstatus); lnetmsg->msg_health_status = hstatus; lnet_finalize(lnetmsg, rc); } @@ -1266,7 +1263,10 @@ struct ksock_route * le64_to_cpu(lhdr->src_nid) != id->nid); } - lnet_finalize(conn->ksnc_cookie, rc); + if (rc && conn->ksnc_lnet_msg) + conn->ksnc_lnet_msg->msg_health_status = + LNET_MSG_STATUS_REMOTE_ERROR; + lnet_finalize(conn->ksnc_lnet_msg, rc); if (rc) { ksocknal_new_packet(conn, 0); @@ -1300,7 +1300,7 @@ struct ksock_route * LASSERT(iov_iter_count(to) <= rlen); LASSERT(to->nr_segs <= LNET_MAX_IOV); - conn->ksnc_cookie = msg; + conn->ksnc_lnet_msg = msg; conn->ksnc_rx_nob_left = rlen; conn->ksnc_rx_to = *to;