From: David Miller <davem@davemloft.net>
To: vakul.garg@nxp.com
Cc: netdev@vger.kernel.org, borisp@mellanox.com,
aviadye@mellanox.com, davejwatson@fb.com, doronrk@fb.com
Subject: Re: [PATCH net-next] strparser: Return if socket does not have required number of bytes
Date: Wed, 30 Jan 2019 21:59:50 -0800 (PST) [thread overview]
Message-ID: <20190130.215950.1443919738399463157.davem@davemloft.net> (raw)
In-Reply-To: <20190130072933.23281-1-vakul.garg@nxp.com>
From: Vakul Garg <vakul.garg@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.garg@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.
next prev parent reply other threads:[~2019-01-31 5:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-30 7:31 [PATCH net-next] strparser: Return if socket does not have required number of bytes Vakul Garg
2019-01-31 5:59 ` David Miller [this message]
2019-01-31 6:25 ` Vakul Garg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190130.215950.1443919738399463157.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=aviadye@mellanox.com \
--cc=borisp@mellanox.com \
--cc=davejwatson@fb.com \
--cc=doronrk@fb.com \
--cc=netdev@vger.kernel.org \
--cc=vakul.garg@nxp.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox