From: Vakul Garg <vakul.g...@nxp.com> Date: Wed, 30 Jan 2019 07:31:44 +0000
> Function strp_data_ready() should peek the associated socket to check > whether it has the required number of bytes available before queueing > work or initiating socket read via strp_read_sock(). This saves cpu > cycles because strp_read_sock() is called only when required amount of > data is available. > > Signed-off-by: Vakul Garg <vakul.g...@nxp.com> You can't do this, I think. It's racy and the user socket owned check is absolutely necessary before you do the need bytes check.