[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190130.215950.1443919738399463157.davem@davemloft.net>
Date: Wed, 30 Jan 2019 21:59:50 -0800 (PST)
From: David Miller <davem@...emloft.net>
To: vakul.garg@....com
Cc: netdev@...r.kernel.org, borisp@...lanox.com, aviadye@...lanox.com,
davejwatson@...com, doronrk@...com
Subject: Re: [PATCH net-next] strparser: Return if socket does not have
required number of bytes
From: Vakul Garg <vakul.garg@....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.garg@....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.
Powered by blists - more mailing lists