From: rohit maheshwari <rohitm@chelsio.com>
To: Jakub Kicinski <kuba@kernel.org>,
"David S. Miller" <davem@davemloft.net>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Cc: vakul.garg@nxp.com, secdev <secdev@chelsio.com>
Subject: Re: Re: [PATCH net] net/tls: sendfile fails with ktls offload
Date: Sun, 27 Sep 2020 00:13:31 +0530 [thread overview]
Message-ID: <439f7a6f-fdbd-8c6e-129d-c25f803e3e5e@chelsio.com> (raw)
In-Reply-To: <b7afc12f-92a5-c2a9-087e-b826eb74194f@chelsio.com>
>> > -----Original Message-----
>> > From: Jakub Kicinski <kuba@kernel.org>
>> > Sent: Friday, September 25, 2020 3:27 AM
>> > To: Rohit Maheshwari <rohitm@chelsio.com>
>> > Cc: netdev@vger.kernel.org; davem@davemloft.net;
>> vakul.garg@nxp.com; secdev <secdev@chelsio.com>
>> > Subject: Re: [PATCH net] net/tls: sendfile fails with ktls offload
>> >
>
>> > Also shouldn't we update this field or destroy the record before
>> the break on line 478? If more is set, and payload is lesser than the
>> max size, then we need to
>> hold on to get next sendpage and continue adding frags in the same
>> record.
>> So I don't think we need to do any update or destroy the record. Please
>> correct me if I am wrong here.
>
> Agreed, if more is set we should continue appending.
>
> What I'm saying is that we may exit the loop on line 478 or 525 without
> updating pending_open_record_frags. So if pending_open_record_frags is
> set, we'd be in a position where there is no data in the record, yet
> pending_open_record_frags is set. Won't subsequent cmsg send not cause
> a zero length record to be generated?
> Exit on line 478 can get triggered if sk_page_frag_refill() fails, and
> then by
Exit on line 478 can get triggered if sk_page_frag_refill() fails,
and then by exiting, it will hit line 529 and will return 'rc =
orig_size - size', so I am sure we don't need to do anything else
there. Exit on line 525 will be, due to do_tcp_sendpage(), and I
think pending_open_record_frags won't be set if this is the last
record. And if it is not the last record, do_tcp_sendpage will be
failing for a complete and correct record, that doesn't need to be
destroyed and at this very moment pending_open_record_frags
will suggest that there is more data (unrelated to current failing
record), which actually is correct. I think, there won't be cmsg if
pending_open_record_frags is set.
next prev parent reply other threads:[~2020-09-26 18:43 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-24 7:50 [PATCH net] net/tls: sendfile fails with ktls offload Rohit Maheshwari
2020-09-24 21:57 ` Jakub Kicinski
[not found] ` <BY5PR12MB40041504C9BB0C49546C9CE6EE360@BY5PR12MB4004.namprd12.prod.outlook.com>
2020-09-25 14:02 ` FW: " rohit maheshwari
2020-09-25 23:52 ` Jakub Kicinski
[not found] ` <b7afc12f-92a5-c2a9-087e-b826eb74194f@chelsio.com>
2020-09-26 18:43 ` rohit maheshwari [this message]
2020-09-28 21:13 ` Jakub Kicinski
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=439f7a6f-fdbd-8c6e-129d-c25f803e3e5e@chelsio.com \
--to=rohitm@chelsio.com \
--cc=davem@davemloft.net \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=secdev@chelsio.com \
--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;
as well as URLs for NNTP newsgroup(s).