cifsd-team / ksmbd-tools

ksmbd kernel server userspace utilities
GNU General Public License v2.0
92 stars 27 forks source link

smb3 encryption causing buffering issues google tv chromecast VLC player on 4k movies #279

Closed syleishere closed 1 year ago

syleishere commented 2 years ago

Removing smb3 encryption option or setting to no fixes the issue.

Steps to reproduce: Any large 4k movie such as: https://katcr.to/thor-love-and-thunder-2022-2160p-web-dl-ddp5-1-atmos-hdr-hevc-cmrg-tgx-t5379561.html enabling smb3 encryption will constantly cause buffer issues.

Plays fine across NFS, or with smb3 encryption option removed.

namjaejeon commented 2 years ago

Ah, What is buffer issue ? NFS has data encryption support ?

syleishere commented 2 years ago

No, I just have a linux server in basement that acts as a router and fileserver running NFS and samba. NFS is just NFS, no encryption, I've used it as backup for any samba issues. For most part I prefer samba because of the speed, haven't tried RDMA as of yet. I'm not sure what the google tv chromecast issue is, where would I find the debug log? I see with ksmbd.control how to enable it but not sure where log would be.

I have no issues on my windows 11 PCIE 4.0 desktop upstairs, so I assume the device is just underpowered to begin with. Still the recommendation is for everyone to enable it out of the box, so figured there must be millions of people worldwide that do same thing, so would be nice if it's just a simple fix like increasing buffer sizes to see if it would resolve the issues, but be hard to know without looking at system calls from debug file.

All in all I do a lot of testing with samba as I've liked the idea of inbuilt kernel ksmbd for performance. Before that I was just using a KVM of FreeBSD with ZFS to do the file serving. It's been a bit of a headache always adding in ZFS support to linux kernel manually, as it never seems to support latest kernels, always having to run 5.15 series till next release, but I guess that is Linus for you.

Regardless, if there is an easy fix that would help millions, I'd be willing to help look into it.

namjaejeon commented 2 years ago

You say samba and ksmbd together, so I'm confused. samba and ksmbd are server implementations that implement the smb protocol, but are different open source. While samba is a server implemented in userspace, ksmbd is an implementation of it in kernel space. Is there no problem if you use encryption using samba? Because SMB encryption encrypts data (payload), So read/write performance decreases by 20-30%. Also, the cpu usage increases. I think the buffer issue is a simple performance problem. Right ? Because you told me there is no issue if you don't use smb encryption.

syleishere commented 2 years ago

No just running ksmbd alone along with wsdd so that windows 11 can see the share. Yeah it makes sense, the google tv chromecast CPU is most likely overwhelmed by the encryption causing the buffering issues is my guess. So at this point I'm just going to go against Microsoft's recommendation of enabling it, to support these low powered CPU devices.

namjaejeon commented 2 years ago

Okay, Please let me know if I can help you further. If not, let's close this issue...

syleishere commented 1 year ago

Can close it for now. I've gone back to freebsd with samba as a result of ksmbd exploits that were reported, I just don't want to constantly hack at kernel to support zfs either.

Interesting enough zfs team released freenas scale supporting Linux on Debian with zfs. So might be a more viable option for people looking for zfs and ksmbd in future.

syleishere commented 1 year ago

I would recommend ksmbd be rewritten in rust to avoid those issues :)

namjaejeon commented 1 year ago

Okay. Closed.