From patchwork Fri Feb 14 12:43:05 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: aman1cifs@gmail.com X-Patchwork-Id: 13974839 Received: from mail-il1-f182.google.com (mail-il1-f182.google.com [209.85.166.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 689FF263F25 for ; Fri, 14 Feb 2025 12:43:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739537011; cv=none; b=Mq8th6xGiA4cHJOrT7t9iveLZUFM1l+e5kbw1oDlSpC1Jral1FWZ6dI/VYJ5I2dJCl8Nj61qb5+wnZOIc9QWTckqEfw/H6QEc82TBdpPShMkGWI9lv+35OCvB7WDgf4fi+vBUXoUhwHcswlzZAMBn0JlNPZvv+UHPI/mXJ0TGcY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739537011; c=relaxed/simple; bh=MZ+VdqlRD6k15vCaswscsbYcvyxtTvj5vR/ZpiGv3VU=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Ez/r0YduJtPqIt/czhNsJXkETjVJbq86nGJeAM//7NHa4LOnydU9E49Ndv2vjrqjiI7QS2h6uSevZs6alhF5Duy/Ahj9q4rVTtwaxGrp285ve2bo8WOrRmL2vsWm+BhsadTiIdIa4enMf35qFReWLZWdfMsyEum7A+pJv2eZTrI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=eFPojC+P; arc=none smtp.client-ip=209.85.166.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="eFPojC+P" Received: by mail-il1-f182.google.com with SMTP id e9e14a558f8ab-3d19d214f0aso5385125ab.1 for ; Fri, 14 Feb 2025 04:43:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1739537009; x=1740141809; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=yEv0BAIFY+ZXCq6s+ViTi0GSgjctCzh7oVYkrs6HivQ=; b=eFPojC+Pm4aVDp+kY1rJuBQUlLjnp9zI3utxi5wv7O38LKtI0BOWT33V9lEfs4Fmvj 5Lh7FusKDnragwykkbC8/Gb7MN6CoxhyKxSBbbn5Ytxl3bMgHLtwPILohgJhh/Cinu6F qwI9S3WJRtb3YxW/X2xwpZ4Qi25o5MDAlWWHYCAlzAfy0OaSOYCuCT3fcD7qlNYjiShj 6WMZG273IvCUYIm9pCG5mn3ggUdLYgTRQm4PLbil0Ea2gJ6c5CoVDfGt9qQfvEwF4USK yGDP288TeLoDNFKRgWdHceTkgq1fHPuW0gTqWJuZvbFX5ES1jYqziNUiNrC9EnemN05X 9w+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739537009; x=1740141809; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=yEv0BAIFY+ZXCq6s+ViTi0GSgjctCzh7oVYkrs6HivQ=; b=MBY37orbsZkHgpsTMk+WakmGB76FxhIJxaxdZBOlDFXun1QWV/ZEBqiUdfQvPe5y0i /8GsV7bab3ZwImdk054s6UiLo5IcNdbUTxsTMd+m/8Q5j/gHsJsYKBG5FUHtN3wcLZMX XKgEMJ0ZR9AMAsMq2BZrctTKba4m5dQfWr0lCeJXsHbDqnvHH8gYhQPmG2+ms6JrhKJF hycry491kRgu2vYJoeIOewS5in0MxI9N1++V/8oXzYasgYryTdSqb12A9CQsXav+Y5Qt MyD5uHCPGR/yLjuFT7ifLjk7Gs5PtbZ6YRtQA99QQ5a+QcSllAin2pIWWQJ6RnTnZLdi s7pw== X-Gm-Message-State: AOJu0YyllThmz4Wnz7itPdwYEbbrm1NDujzAwfDz+yAvj9mCIAC60oWz HdgnCQtz3Yz5EdCdsMeUZFjm0EIy2k8gy0jgwd3luwgJzdmTLVnmrmV6F37A X-Gm-Gg: ASbGncvgglxgZ5fiQ0Hz5xlLp7C7rm6/9s8saoSC9E432kQb979pAryCYbThVbp45oa PQhgDfJzZJNUDD8TUO2nT4tP7SE21XMzVVXkzChIRYZQ1JvgaYT1FsUltV7MUq6dN2hClzyA4ck oAV07c3VfGeIb6lFo9YuEMXnwZ4TtkrC6jKhtwDHgmpIwCzzvhR0EuKZ20sQ3oKZad4pjYf96Bv +TxljCE/COERHfzIplCl+3pg7Jl+yQfjslfptSAKCZJmrNpL+RwEWW4GwSu98j+ZCsIP1pfeJ8V Kmn3aRIP3/3Ni23eL97Sc/ZNQkGh4fbek8G+lto/WJDjJhNcH8M1VgLTnWtx/TlHJLv+93TGehH 6aQ== X-Google-Smtp-Source: AGHT+IEWoU0PXeglFWcNK60ktFp3o3vr18N3sFiTM6OYSCot4cZkAfufNtJFMVFXBu2g2BSO6io1FQ== X-Received: by 2002:a05:6e02:1fc9:b0:3d0:fe8:607e with SMTP id e9e14a558f8ab-3d17bfddde8mr83510835ab.14.1739537009331; Fri, 14 Feb 2025 04:43:29 -0800 (PST) Received: from linuxbox.oloxx3b4wsrernbskgt3tooxxe.gx.internal.cloudapp.net ([74.249.180.8]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ed281487c5sm795162173.13.2025.02.14.04.43.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Feb 2025 04:43:29 -0800 (PST) From: aman1cifs@gmail.com To: linux-cifs@vger.kernel.org, sfrench@samba.org, pc@manguebit.com, sprasad@microsoft.com, tom@talpey.com, ronniesahlberg@gmail.com, bharathsm@microsoft.com Cc: Aman Subject: [PATCH 1/2] CIFS: Propagate min offload along with other parameters from primary to secondary channels. Date: Fri, 14 Feb 2025 12:43:05 +0000 Message-ID: <20250214124306.498808-1-aman1cifs@gmail.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-cifs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Aman In a multichannel setup, it was observed that a few fields were not being copied over to the secondary channels, which impacted performance in cases where these options were relevant but not properly synchronized. To address this, this patch introduces copying the following parameters from the primary channel to the secondary channels: - min_offload - compression.requested - dfs_conn - ignore_signature - leaf_fullpath - noblockcnt - retrans - sign By copying these parameters, we ensure consistency across channels and prevent performance degradation due to missing or outdated settings. Signed-off-by: Aman --- fs/smb/client/connect.c | 1 + fs/smb/client/sess.c | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/fs/smb/client/connect.c b/fs/smb/client/connect.c index eaa6be445..eb82458eb 100644 --- a/fs/smb/client/connect.c +++ b/fs/smb/client/connect.c @@ -1721,6 +1721,7 @@ cifs_get_tcp_session(struct smb3_fs_context *ctx, /* Grab netns reference for this server. */ cifs_set_net_ns(tcp_ses, get_net(current->nsproxy->net_ns)); + tcp_ses->sign = ctx->sign; tcp_ses->conn_id = atomic_inc_return(&tcpSesNextId); tcp_ses->noblockcnt = ctx->rootfs; tcp_ses->noblocksnd = ctx->noblocksnd || ctx->rootfs; diff --git a/fs/smb/client/sess.c b/fs/smb/client/sess.c index 91d4d409c..fdbd32a13 100644 --- a/fs/smb/client/sess.c +++ b/fs/smb/client/sess.c @@ -522,6 +522,16 @@ cifs_ses_add_channel(struct cifs_ses *ses, ctx->sockopt_tcp_nodelay = ses->server->tcp_nodelay; ctx->echo_interval = ses->server->echo_interval / HZ; ctx->max_credits = ses->server->max_credits; + ctx->min_offload = ses->server->min_offload; + ctx->compress = ses->server->compression.requested; + ctx->dfs_conn = ses->server->dfs_conn; + ctx->ignore_signature = ses->server->ignore_signature; + + if (ses->server->leaf_fullpath) + ctx->leaf_fullpath = kstrdup(ses->server->leaf_fullpath, GFP_KERNEL); + + ctx->rootfs = ses->server->noblockcnt; + ctx->retrans = ses->server->retrans; /* * This will be used for encoding/decoding user/domain/pw From patchwork Fri Feb 14 12:43:06 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: aman1cifs@gmail.com X-Patchwork-Id: 13974840 Received: from mail-il1-f169.google.com (mail-il1-f169.google.com [209.85.166.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 54CA3263F25 for ; Fri, 14 Feb 2025 12:43:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739537018; cv=none; b=pFixMqmBNw2ZeCXeTBgHLoS8UwYCwqgIJW8xeYZtzFLjyBJSY3zGMafEcDbftXfNrtkQUoqSti+PXdo2Nn5m+oeK+ttu62nzL9hpjc4J0Pzjkrew6bCW9xHuwAFFKWkFhqWq2vNkkO300HppPL+l4Om9eqqiHsJx58UOAAR+Lkw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739537018; c=relaxed/simple; bh=G3guDaBjJgsPJ3oBaGYFMvKewZ96n4/UDqyUnqjk+dM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=EwJw1EUReaN5MkNrddR/S5uCOW1b9HRJpKWKR1UA+n4xULxD3cUoHveNDSVHx/GcK1cFb9yIU4O/A0rrDH++AUJohr2NqmKT15fg5WG2yP3XLFpmdEj0xwUorsCKL8AZF/RQTvNFEu/xSP2mZ2OInT3QAAmnqq1TB/t9FrNWVW0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Co6CMPC9; arc=none smtp.client-ip=209.85.166.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Co6CMPC9" Received: by mail-il1-f169.google.com with SMTP id e9e14a558f8ab-3d19f5ce8a0so1382375ab.1 for ; Fri, 14 Feb 2025 04:43:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1739537016; x=1740141816; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=54XIk6tW7SSLZXAC8fkcpYxaagxEO9/7LylwU0etiw0=; b=Co6CMPC9YD1WiD1RoP05W1bCXQ5LhBuFZWcNV4Y0/fKJp8G9067OlmeRi1dqhLY7W3 3V4O7lcHQwFZ6GOWjeLjx5nvP7YMpMjsCmCsLp1eY01nE7C1SfuUyozGSj2szddkSJ4x J4EPVwvgE++i9DGWS/5lYJOtQHfaxRx5zbQHUH090eqs+u15TJ9CO/6fQEm1S9TmkG1H 0v4gRPR0qOQl5tyj84PaUMc8W73fRT6a0VAHlg3GctGIpesouKiBNOmJqtqx3HCSB+BZ QUCLZqw8zYxofwwzpg1TRpAb0hJgkfHRJMwvvw44nsgkm7GEEPI8nWIUJpMz+lq1iJHM 9DMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739537016; x=1740141816; h=content-transfer-encoding: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=54XIk6tW7SSLZXAC8fkcpYxaagxEO9/7LylwU0etiw0=; b=guqw1+4LI/IuWpZEyTdr9dCw368jB9U7dlFiw75PgiIx13CA9KYPEt5FC/15ZpIEwE azaOzevGbh7ySyvOEvNnh6dqpC1XonglQ+QtR/G6ZRD1ecH93ly3NQjGm39Qf5w28O8W sE/gtHI+jJXG5NbOXR7wndlTtNVeKxua8MV0ZF3pJhuQEjWRbANZQ/AIEnukAp4KrwZs ksjJXNw24+6sh7Kok9ZB283LNKSOS6jv6fT5K0vDOjQ5BYYS1/OFyQPtNw8fcq/Q2GUN MhO6K0e7VU5TY9IWqBav3rMOqoyH7Lg03LuU7tKx7XiLqDlXyQgzIbVfozxWbnojpcsH PF6g== X-Gm-Message-State: AOJu0YyT5uN1NeNrnfrJxsEh7gtkBSnpn4sBFLPXruzB93pFj6mADZMJ sTfYplgNC8lXMg2HdtuBVp4G4Fni3TPnbQhWKyO4CK7nW7h3YmR8PB7KKJxo X-Gm-Gg: ASbGncsgP9GkWaITMbIfsGOKjh8T4wu8Yq6RsqhRHcL6C99pwvqnNhuV1yw042ZP20M I9wc0Gf+Yton/mOl0QFAhxxnz6GveC3dht4cjMc9a0Lz/6dATHbWvxLyUH7JMZSXJ2qbtFWFWYG UGqcarUgeZcgIO1e1dDomzdvtQYSIBldaoMNK2ZTx/x8ebWI4lI4KEbzRkehepSCBPBFoWfvtYX 9ay1HkcW5608RjCxx7A2Xl1SIZd2238ax+y+/lNlT/DB2MZmKiYaFyfCKFkI8in27URrOhKARFL e7T+SpizBMHkRVhzA3vLF0w+NDEv2Uy6p3ybiU0wS5hp3YMpi9bIE4rQzYdgJybBG8R0puE0QlW BVQ== X-Google-Smtp-Source: AGHT+IGQ0cBl54t0FsyormrAQjr+gCDUdEmNQewTOW7ReFRGgaZ6hS7Y3OXwQLyhDUcpAjk+3GmCPg== X-Received: by 2002:a05:6e02:2161:b0:3d1:15c9:c15f with SMTP id e9e14a558f8ab-3d18cd2671bmr42967375ab.11.1739537016306; Fri, 14 Feb 2025 04:43:36 -0800 (PST) Received: from linuxbox.oloxx3b4wsrernbskgt3tooxxe.gx.internal.cloudapp.net ([74.249.180.8]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ed281487c5sm795162173.13.2025.02.14.04.43.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Feb 2025 04:43:36 -0800 (PST) From: aman1cifs@gmail.com To: linux-cifs@vger.kernel.org, sfrench@samba.org, pc@manguebit.com, sprasad@microsoft.com, tom@talpey.com, ronniesahlberg@gmail.com, bharathsm@microsoft.com Cc: Aman Subject: [PATCH 2/2] CIFS: adds min_offload and other params to cifs_debug Date: Fri, 14 Feb 2025 12:43:06 +0000 Message-ID: <20250214124306.498808-2-aman1cifs@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250214124306.498808-1-aman1cifs@gmail.com> References: <20250214124306.498808-1-aman1cifs@gmail.com> Precedence: bulk X-Mailing-List: linux-cifs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Aman This change adds more parameters for debugging into the status of all channels. It adds the following TCP server parameters to cifs_debug.c - min_offload - compression.requested - dfs_conn - ignore_signature - leaf_fullpath - retrans - noblockcnt - noblocksnd - sign - max_credits This is a logical follow up to a previous patch titled: "[PATCH] CIFS: Propagate min offload along with other parameters from primary to secondary channels", however this has been tested and applies independently. Signed-off-by: Aman --- fs/smb/client/cifs_debug.c | 47 +++++++++++++++++++++++++++++++++++--- 1 file changed, 44 insertions(+), 3 deletions(-) diff --git a/fs/smb/client/cifs_debug.c b/fs/smb/client/cifs_debug.c index e03c890de..64a565c46 100644 --- a/fs/smb/client/cifs_debug.c +++ b/fs/smb/client/cifs_debug.c @@ -147,8 +147,16 @@ cifs_dump_channel(struct seq_file *m, int i, struct cifs_chan *chan) "\n\t\tNumber of credits: %d,%d,%d Dialect 0x%x" "\n\t\tTCP status: %d Instance: %d" "\n\t\tLocal Users To Server: %d SecMode: 0x%x Req On Wire: %d" - "\n\t\tIn Send: %d In MaxReq Wait: %d", - i+1, server->conn_id, + "\n\t\tIn Send: %d In MaxReq Wait: %d" + "\n\t\tCompression Requested: %s" + "\n\t\tdfs_conn: %s" + "\n\t\tIgnore Signature: %s" + "\n\t\tretrans: %d" + "\n\t\tUse non-blocking connect: %s" + "\n\t\tUse non-blocking sendmsg: %s" + "\n\t\tSigning Enabled: %s" + "\n\t\tMin Offload: %d Max Credits: %d", + i, server->conn_id, server->credits, server->echo_credits, server->oplock_credits, @@ -159,7 +167,22 @@ cifs_dump_channel(struct seq_file *m, int i, struct cifs_chan *chan) server->sec_mode, in_flight(server), atomic_read(&server->in_send), - atomic_read(&server->num_waiters)); + atomic_read(&server->num_waiters), + str_yes_no(server->compression.requested), + str_yes_no(server->dfs_conn), + str_yes_no(server->ignore_signature), + server->retrans, + str_yes_no(server->noblockcnt), + str_yes_no(server->noblocksnd), + str_yes_no(server->sign), + server->min_offload, + server->max_credits); + + if (server->leaf_fullpath) { + seq_printf(m, "\n\t\tDFS leaf full path: %s", + server->leaf_fullpath); + } + #ifdef CONFIG_NET_NS if (server->net) seq_printf(m, " Net namespace: %u ", server->net->ns.inum); @@ -487,6 +510,24 @@ static int cifs_debug_data_proc_show(struct seq_file *m, void *v) else seq_puts(m, "disabled (not supported by this server)"); + seq_printf(m, "\nCompression Requested: %s" + "\ndfs_conn: %s" + "\nIgnore Signature: %s" + "\nretrans: %d" + "\nUse non-blocking connect: %s" + "\nUse non-blocking sendmsg: %s" + "\nSigning Enabled: %s" + "\nMin Offload: %d Max Credits: %d", + str_yes_no(server->compression.requested), + str_yes_no(server->dfs_conn), + str_yes_no(server->ignore_signature), + server->retrans, + str_yes_no(server->noblockcnt), + str_yes_no(server->noblocksnd), + str_yes_no(server->sign), + server->min_offload, + server->max_credits); + seq_printf(m, "\n\n\tSessions: "); i = 0; list_for_each_entry(ses, &server->smb_ses_list, smb_ses_list) {