Lines Matching +full:tcon +full:- +full:channel
1 // SPDX-License-Identifier: GPL-2.0-or-later
44 smb->Command, smb->Status.CifsError, smb->Flags, in cifs_dump_detail()
45 smb->Flags2, smb->Mid, smb->Pid, smb->WordCount); in cifs_dump_detail()
46 if (!server->ops->check_message(buf, server->total_read, server)) { in cifs_dump_detail()
48 server->ops->calc_smb_size(smb)); in cifs_dump_detail()
62 spin_lock(&server->mid_lock); in cifs_dump_mids()
63 list_for_each_entry(mid_entry, &server->pending_mid_q, qhead) { in cifs_dump_mids()
65 mid_entry->mid_state, in cifs_dump_mids()
66 le16_to_cpu(mid_entry->command), in cifs_dump_mids()
67 mid_entry->pid, in cifs_dump_mids()
68 mid_entry->callback_data, in cifs_dump_mids()
69 mid_entry->mid); in cifs_dump_mids()
72 mid_entry->large_buf, in cifs_dump_mids()
73 mid_entry->resp_buf, in cifs_dump_mids()
74 mid_entry->when_received, in cifs_dump_mids()
78 mid_entry->multiRsp, mid_entry->multiEnd); in cifs_dump_mids()
79 if (mid_entry->resp_buf) { in cifs_dump_mids()
80 cifs_dump_detail(mid_entry->resp_buf, server); in cifs_dump_mids()
82 mid_entry->resp_buf, 62); in cifs_dump_mids()
85 spin_unlock(&server->mid_lock); in cifs_dump_mids()
90 static void cifs_debug_tcon(struct seq_file *m, struct cifs_tcon *tcon) in cifs_debug_tcon() argument
92 __u32 dev_type = le32_to_cpu(tcon->fsDevInfo.DeviceType); in cifs_debug_tcon()
94 seq_printf(m, "%s Mounts: %d ", tcon->tree_name, tcon->tc_count); in cifs_debug_tcon()
95 if (tcon->nativeFileSystem) in cifs_debug_tcon()
96 seq_printf(m, "Type: %s ", tcon->nativeFileSystem); in cifs_debug_tcon()
98 le32_to_cpu(tcon->fsDevInfo.DeviceCharacteristics), in cifs_debug_tcon()
99 le32_to_cpu(tcon->fsAttrInfo.Attributes), in cifs_debug_tcon()
100 le32_to_cpu(tcon->fsAttrInfo.MaxPathNameComponentLength), in cifs_debug_tcon()
101 tcon->status); in cifs_debug_tcon()
109 seq_printf(m, "Serial Number: 0x%x", tcon->vol_serial_number); in cifs_debug_tcon()
111 if ((tcon->seal) || in cifs_debug_tcon()
112 (tcon->ses->session_flags & SMB2_SESSION_FLAG_ENCRYPT_DATA) || in cifs_debug_tcon()
113 (tcon->share_flags & SHI1005_FLAGS_ENCRYPT_DATA)) in cifs_debug_tcon()
115 if (tcon->nocase) in cifs_debug_tcon()
117 if (tcon->unix_ext) in cifs_debug_tcon()
119 if (tcon->ses->server->ops->dump_share_caps) in cifs_debug_tcon()
120 tcon->ses->server->ops->dump_share_caps(m, tcon); in cifs_debug_tcon()
121 if (tcon->use_witness) in cifs_debug_tcon()
123 if (tcon->broken_sparse_sup) in cifs_debug_tcon()
125 if (tcon->need_reconnect) in cifs_debug_tcon()
127 spin_lock(&tcon->tc_lock); in cifs_debug_tcon()
128 if (tcon->origin_fullpath) { in cifs_debug_tcon()
130 tcon->origin_fullpath); in cifs_debug_tcon()
132 spin_unlock(&tcon->tc_lock); in cifs_debug_tcon()
139 struct TCP_Server_Info *server = chan->server; in cifs_dump_channel()
151 i+1, server->conn_id, in cifs_dump_channel()
152 server->credits, in cifs_dump_channel()
153 server->echo_credits, in cifs_dump_channel()
154 server->oplock_credits, in cifs_dump_channel()
155 server->dialect, in cifs_dump_channel()
156 server->tcpStatus, in cifs_dump_channel()
157 server->reconnect_instance, in cifs_dump_channel()
158 server->srv_count, in cifs_dump_channel()
159 server->sec_mode, in cifs_dump_channel()
161 atomic_read(&server->in_send), in cifs_dump_channel()
162 atomic_read(&server->num_waiters)); in cifs_dump_channel()
164 if (server->net) in cifs_dump_channel()
165 seq_printf(m, " Net namespace: %u ", server->net->ns.inum); in cifs_dump_channel()
215 struct sockaddr_in *ipv4 = (struct sockaddr_in *)&iface->sockaddr; in cifs_dump_iface()
216 struct sockaddr_in6 *ipv6 = (struct sockaddr_in6 *)&iface->sockaddr; in cifs_dump_iface()
218 seq_printf(m, "\tSpeed: %s\n", smb_speed_to_str(iface->speed)); in cifs_dump_iface()
220 if (iface->rdma_capable) in cifs_dump_iface()
222 if (iface->rss_capable) in cifs_dump_iface()
224 if (!iface->rdma_capable && !iface->rss_capable) in cifs_dump_iface()
227 if (iface->sockaddr.ss_family == AF_INET) in cifs_dump_iface()
228 seq_printf(m, "\t\tIPv4: %pI4\n", &ipv4->sin_addr); in cifs_dump_iface()
229 else if (iface->sockaddr.ss_family == AF_INET6) in cifs_dump_iface()
230 seq_printf(m, "\t\tIPv6: %pI6\n", &ipv6->sin6_addr); in cifs_dump_iface()
231 if (!iface->is_active) in cifs_dump_iface()
232 seq_puts(m, "\t\t[for-cleanup]\n"); in cifs_dump_iface()
239 struct cifs_tcon *tcon; in cifs_debug_files_proc_show() local
252 list_for_each_entry(ses, &server->smb_ses_list, smb_ses_list) { in cifs_debug_files_proc_show()
253 list_for_each_entry(tcon, &ses->tcon_list, tcon_list) { in cifs_debug_files_proc_show()
254 spin_lock(&tcon->open_file_lock); in cifs_debug_files_proc_show()
255 list_for_each_entry(cfile, &tcon->openFileList, tlist) { in cifs_debug_files_proc_show()
258 tcon->tid, in cifs_debug_files_proc_show()
259 ses->Suid, in cifs_debug_files_proc_show()
260 cfile->fid.persistent_fid, in cifs_debug_files_proc_show()
261 cfile->f_flags, in cifs_debug_files_proc_show()
262 cfile->count, in cifs_debug_files_proc_show()
263 cfile->pid, in cifs_debug_files_proc_show()
264 from_kuid(&init_user_ns, cfile->uid), in cifs_debug_files_proc_show()
265 cfile->dentry); in cifs_debug_files_proc_show()
267 seq_printf(m, " %llu\n", cfile->fid.mid); in cifs_debug_files_proc_show()
272 spin_unlock(&tcon->open_file_lock); in cifs_debug_files_proc_show()
287 struct cifs_tcon *tcon; in cifs_debug_data_proc_show() local
295 "---------------------------------------------------\n"); in cifs_debug_data_proc_show()
342 /* channel info will be printed as a part of sessions below */ in cifs_debug_data_proc_show()
348 c, server->conn_id); in cifs_debug_data_proc_show()
350 spin_lock(&server->srv_lock); in cifs_debug_data_proc_show()
351 if (server->hostname) in cifs_debug_data_proc_show()
352 seq_printf(m, "Hostname: %s ", server->hostname); in cifs_debug_data_proc_show()
353 seq_printf(m, "\nClientGUID: %pUL", server->client_guid); in cifs_debug_data_proc_show()
354 spin_unlock(&server->srv_lock); in cifs_debug_data_proc_show()
356 if (!server->rdma) in cifs_debug_data_proc_show()
359 if (!server->smbd_conn) { in cifs_debug_data_proc_show()
366 server->smbd_conn->protocol, in cifs_debug_data_proc_show()
367 server->smbd_conn->transport_status); in cifs_debug_data_proc_show()
370 server->smbd_conn->receive_credit_max, in cifs_debug_data_proc_show()
371 server->smbd_conn->send_credit_target, in cifs_debug_data_proc_show()
372 server->smbd_conn->max_send_size); in cifs_debug_data_proc_show()
375 server->smbd_conn->max_fragmented_recv_size, in cifs_debug_data_proc_show()
376 server->smbd_conn->max_fragmented_send_size, in cifs_debug_data_proc_show()
377 server->smbd_conn->max_receive_size); in cifs_debug_data_proc_show()
380 server->smbd_conn->keep_alive_interval, in cifs_debug_data_proc_show()
381 server->smbd_conn->max_readwrite_size, in cifs_debug_data_proc_show()
382 server->smbd_conn->rdma_readwrite_threshold); in cifs_debug_data_proc_show()
385 server->smbd_conn->count_get_receive_buffer, in cifs_debug_data_proc_show()
386 server->smbd_conn->count_put_receive_buffer, in cifs_debug_data_proc_show()
387 server->smbd_conn->count_send_empty); in cifs_debug_data_proc_show()
394 server->smbd_conn->count_reassembly_queue, in cifs_debug_data_proc_show()
395 server->smbd_conn->count_enqueue_reassembly_queue, in cifs_debug_data_proc_show()
396 server->smbd_conn->count_dequeue_reassembly_queue, in cifs_debug_data_proc_show()
397 server->smbd_conn->fragment_reassembly_remaining, in cifs_debug_data_proc_show()
398 server->smbd_conn->reassembly_data_length, in cifs_debug_data_proc_show()
399 server->smbd_conn->reassembly_queue_length); in cifs_debug_data_proc_show()
402 atomic_read(&server->smbd_conn->send_credits), in cifs_debug_data_proc_show()
403 atomic_read(&server->smbd_conn->receive_credits), in cifs_debug_data_proc_show()
404 server->smbd_conn->receive_credit_target); in cifs_debug_data_proc_show()
406 atomic_read(&server->smbd_conn->send_pending)); in cifs_debug_data_proc_show()
409 server->smbd_conn->count_receive_queue, in cifs_debug_data_proc_show()
410 server->smbd_conn->count_empty_packet_queue); in cifs_debug_data_proc_show()
413 server->smbd_conn->responder_resources, in cifs_debug_data_proc_show()
414 server->smbd_conn->max_frmr_depth, in cifs_debug_data_proc_show()
415 server->smbd_conn->mr_type); in cifs_debug_data_proc_show()
417 atomic_read(&server->smbd_conn->mr_ready_count), in cifs_debug_data_proc_show()
418 atomic_read(&server->smbd_conn->mr_used_count)); in cifs_debug_data_proc_show()
422 server->credits, in cifs_debug_data_proc_show()
423 server->echo_credits, in cifs_debug_data_proc_show()
424 server->oplock_credits, in cifs_debug_data_proc_show()
425 server->dialect); in cifs_debug_data_proc_show()
426 if (server->compress_algorithm == SMB3_COMPRESS_LZNT1) in cifs_debug_data_proc_show()
428 else if (server->compress_algorithm == SMB3_COMPRESS_LZ77) in cifs_debug_data_proc_show()
430 else if (server->compress_algorithm == SMB3_COMPRESS_LZ77_HUFF) in cifs_debug_data_proc_show()
432 if (server->sign) in cifs_debug_data_proc_show()
434 if (server->posix_ext_supported) in cifs_debug_data_proc_show()
436 if (server->nosharesock) in cifs_debug_data_proc_show()
439 if (server->rdma) in cifs_debug_data_proc_show()
443 server->tcpStatus, in cifs_debug_data_proc_show()
444 server->reconnect_instance, in cifs_debug_data_proc_show()
445 server->srv_count, in cifs_debug_data_proc_show()
446 server->sec_mode, in_flight(server)); in cifs_debug_data_proc_show()
448 if (server->net) in cifs_debug_data_proc_show()
449 seq_printf(m, " Net namespace: %u ", server->net->ns.inum); in cifs_debug_data_proc_show()
453 atomic_read(&server->in_send), in cifs_debug_data_proc_show()
454 atomic_read(&server->num_waiters)); in cifs_debug_data_proc_show()
456 if (server->leaf_fullpath) { in cifs_debug_data_proc_show()
458 server->leaf_fullpath); in cifs_debug_data_proc_show()
463 list_for_each_entry(ses, &server->smb_ses_list, smb_ses_list) { in cifs_debug_data_proc_show()
464 spin_lock(&ses->ses_lock); in cifs_debug_data_proc_show()
465 if (ses->ses_status == SES_EXITING) { in cifs_debug_data_proc_show()
466 spin_unlock(&ses->ses_lock); in cifs_debug_data_proc_show()
470 if ((ses->serverDomain == NULL) || in cifs_debug_data_proc_show()
471 (ses->serverOS == NULL) || in cifs_debug_data_proc_show()
472 (ses->serverNOS == NULL)) { in cifs_debug_data_proc_show()
474 i, ses->ip_addr, ses->ses_count, in cifs_debug_data_proc_show()
475 ses->capabilities, ses->ses_status); in cifs_debug_data_proc_show()
476 if (ses->session_flags & SMB2_SESSION_FLAG_IS_GUEST) in cifs_debug_data_proc_show()
478 else if (ses->session_flags & SMB2_SESSION_FLAG_IS_NULL) in cifs_debug_data_proc_show()
485 i, ses->ip_addr, ses->serverDomain, in cifs_debug_data_proc_show()
486 ses->ses_count, ses->serverOS, ses->serverNOS, in cifs_debug_data_proc_show()
487 ses->capabilities, ses->ses_status); in cifs_debug_data_proc_show()
489 spin_unlock(&ses->ses_lock); in cifs_debug_data_proc_show()
492 get_security_type_str(server->ops->select_sectype(server, ses->sectype))); in cifs_debug_data_proc_show()
495 seq_printf(m, " SessionId: 0x%llx", ses->Suid); in cifs_debug_data_proc_show()
496 if (ses->session_flags & SMB2_SESSION_FLAG_ENCRYPT_DATA) { in cifs_debug_data_proc_show()
499 if (server->cipher_type == SMB2_ENCRYPTION_AES256_GCM) in cifs_debug_data_proc_show()
502 if (ses->sign) in cifs_debug_data_proc_show()
506 from_kuid(&init_user_ns, ses->linux_uid), in cifs_debug_data_proc_show()
507 from_kuid(&init_user_ns, ses->cred_uid)); in cifs_debug_data_proc_show()
509 if (ses->dfs_root_ses) { in cifs_debug_data_proc_show()
511 ses->dfs_root_ses->Suid); in cifs_debug_data_proc_show()
514 spin_lock(&ses->chan_lock); in cifs_debug_data_proc_show()
516 seq_puts(m, "\tPrimary channel: DISCONNECTED "); in cifs_debug_data_proc_show()
520 if (ses->chan_count > 1) { in cifs_debug_data_proc_show()
522 ses->chan_count-1); in cifs_debug_data_proc_show()
523 for (j = 1; j < ses->chan_count; j++) { in cifs_debug_data_proc_show()
524 cifs_dump_channel(m, j, &ses->chans[j]); in cifs_debug_data_proc_show()
531 spin_unlock(&ses->chan_lock); in cifs_debug_data_proc_show()
537 if (ses->tcon_ipc) in cifs_debug_data_proc_show()
538 cifs_debug_tcon(m, ses->tcon_ipc); in cifs_debug_data_proc_show()
542 list_for_each_entry(tcon, &ses->tcon_list, tcon_list) { in cifs_debug_data_proc_show()
545 cifs_debug_tcon(m, tcon); in cifs_debug_data_proc_show()
548 spin_lock(&ses->iface_lock); in cifs_debug_data_proc_show()
549 if (ses->iface_count) in cifs_debug_data_proc_show()
552 ses->iface_count, in cifs_debug_data_proc_show()
553 (jiffies - ses->iface_last_update) / HZ); in cifs_debug_data_proc_show()
555 last_iface = list_last_entry(&ses->iface_list, in cifs_debug_data_proc_show()
558 iface_min_speed = last_iface->speed; in cifs_debug_data_proc_show()
561 list_for_each_entry(iface, &ses->iface_list, in cifs_debug_data_proc_show()
566 iface_weight = iface->speed / iface_min_speed; in cifs_debug_data_proc_show()
569 iface->weight_fulfilled, in cifs_debug_data_proc_show()
571 iface->num_channels); in cifs_debug_data_proc_show()
576 spin_unlock(&ses->iface_lock); in cifs_debug_data_proc_show()
579 spin_lock(&ses->chan_lock); in cifs_debug_data_proc_show()
580 for (j = 0; j < ses->chan_count; j++) { in cifs_debug_data_proc_show()
581 chan_server = ses->chans[j].server; in cifs_debug_data_proc_show()
585 if (list_empty(&chan_server->pending_mid_q)) in cifs_debug_data_proc_show()
589 chan_server->conn_id); in cifs_debug_data_proc_show()
590 spin_lock(&chan_server->mid_lock); in cifs_debug_data_proc_show()
591 list_for_each_entry(mid_entry, &chan_server->pending_mid_q, qhead) { in cifs_debug_data_proc_show()
593 mid_entry->mid_state, in cifs_debug_data_proc_show()
594 le16_to_cpu(mid_entry->command), in cifs_debug_data_proc_show()
595 mid_entry->pid, in cifs_debug_data_proc_show()
596 mid_entry->callback_data, in cifs_debug_data_proc_show()
597 mid_entry->mid); in cifs_debug_data_proc_show()
599 spin_unlock(&chan_server->mid_lock); in cifs_debug_data_proc_show()
601 spin_unlock(&ses->chan_lock); in cifs_debug_data_proc_show()
602 seq_puts(m, "\n--\n"); in cifs_debug_data_proc_show()
625 struct cifs_tcon *tcon; in cifs_stats_proc_write() local
644 server->max_in_flight = 0; in cifs_stats_proc_write()
647 atomic_set(&server->num_cmds[i], 0); in cifs_stats_proc_write()
648 atomic_set(&server->smb2slowcmd[i], 0); in cifs_stats_proc_write()
649 server->time_per_cmd[i] = 0; in cifs_stats_proc_write()
650 server->slowest_cmd[i] = 0; in cifs_stats_proc_write()
651 server->fastest_cmd[0] = 0; in cifs_stats_proc_write()
654 list_for_each_entry(ses, &server->smb_ses_list, smb_ses_list) { in cifs_stats_proc_write()
655 list_for_each_entry(tcon, &ses->tcon_list, tcon_list) { in cifs_stats_proc_write()
656 atomic_set(&tcon->num_smbs_sent, 0); in cifs_stats_proc_write()
657 spin_lock(&tcon->stat_lock); in cifs_stats_proc_write()
658 tcon->bytes_read = 0; in cifs_stats_proc_write()
659 tcon->bytes_written = 0; in cifs_stats_proc_write()
660 spin_unlock(&tcon->stat_lock); in cifs_stats_proc_write()
661 if (server->ops->clear_stats) in cifs_stats_proc_write()
662 server->ops->clear_stats(tcon); in cifs_stats_proc_write()
682 struct cifs_tcon *tcon; in cifs_stats_proc_show() local
711 seq_printf(m, "\nMax requests in flight: %d", server->max_in_flight); in cifs_stats_proc_show()
716 seq_puts(m, " --------\t------\t----------\t-------\t-------\n"); in cifs_stats_proc_show()
719 atomic_read(&server->num_cmds[j]), in cifs_stats_proc_show()
720 server->time_per_cmd[j], in cifs_stats_proc_show()
721 server->fastest_cmd[j], in cifs_stats_proc_show()
722 server->slowest_cmd[j]); in cifs_stats_proc_show()
724 if (atomic_read(&server->smb2slowcmd[j])) { in cifs_stats_proc_show()
725 spin_lock(&server->srv_lock); in cifs_stats_proc_show()
727 atomic_read(&server->smb2slowcmd[j]), in cifs_stats_proc_show()
728 server->hostname, j); in cifs_stats_proc_show()
729 spin_unlock(&server->srv_lock); in cifs_stats_proc_show()
732 list_for_each_entry(ses, &server->smb_ses_list, smb_ses_list) { in cifs_stats_proc_show()
733 list_for_each_entry(tcon, &ses->tcon_list, tcon_list) { in cifs_stats_proc_show()
735 seq_printf(m, "\n%d) %s", i, tcon->tree_name); in cifs_stats_proc_show()
736 if (tcon->need_reconnect) in cifs_stats_proc_show()
739 atomic_read(&tcon->num_smbs_sent)); in cifs_stats_proc_show()
740 if (server->ops->print_stats) in cifs_stats_proc_show()
741 server->ops->print_stats(m, tcon); in cifs_stats_proc_show()
916 cifsFYI = (int) (c[0] - '0'); /* see cifs_debug.h for meanings */ in cifsFYI_proc_write()
918 return -EINVAL; in cifsFYI_proc_write()
1064 return -EINVAL; in cifs_security_flags_proc_write()
1069 return -EFAULT; in cifs_security_flags_proc_write()
1079 return -EINVAL; in cifs_security_flags_proc_write()
1095 return -EINVAL; in cifs_security_flags_proc_write()
1101 return -EINVAL; in cifs_security_flags_proc_write()
1106 /* flags look ok - update the global security flags for cifs module */ in cifs_security_flags_proc_write()
1133 for (p = smb3_fs_parameters; p->name; p++) { in cifs_mount_params_proc_show()
1135 if (!p->type) { in cifs_mount_params_proc_show()
1136 if (p->flags == fs_param_neg_with_no) in cifs_mount_params_proc_show()
1140 } else if (p->type == fs_param_is_bool) in cifs_mount_params_proc_show()
1142 else if (p->type == fs_param_is_u32) in cifs_mount_params_proc_show()
1144 else if (p->type == fs_param_is_u64) in cifs_mount_params_proc_show()
1146 else if (p->type == fs_param_is_string) in cifs_mount_params_proc_show()
1151 seq_printf(m, "%s:%s\n", p->name, type); in cifs_mount_params_proc_show()