Skip to content

Commit

Permalink
driver/linux_onload: remove wrong sendpage assertion
Browse files Browse the repository at this point in the history
Onload used to assert that a memory chunk passed to sendpage handler
is always within one page.  It was true at the time when the assertion
was added.  It is not true any more.

If a user runs two splice() calls: OS socket -> OS pipe -> Onload
socket, then Onload's sendpage handler gets a whole memory-continuous
packet as it was received by the NIC.  Such a packet tend to be a part
of a compound page, and it may cross the bounds of an ordinary page.

The real sense of this assertion was "ensure that we are handling
a continuous chunk".  This is still true.  But the assertion is bad for
linux>=6.1 and for some updates of older kernels.

OL-Redmine-Id: 12010
Co-developed-by: Sergey Nikitin <sergey.nikitin@oktetlabs.ru>
Signed-off-by: Sergey Nikitin <sergey.nikitin@oktetlabs.ru>
Signed-off-by: Alexandra Kossovsky <alexandra.kossovsky@oktetlabs.ru>
Reviewed-by: Sergey Nikitin <sergey.nikitin@oktetlabs.ru>
  • Loading branch information
ol-alexandra authored and ivatet-amd committed Dec 4, 2023
1 parent 4d3ea18 commit 9ef9f19
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/driver/linux_onload/tcp_sendpage.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ ssize_t linux_tcp_helper_fop_sendpage(struct file* filp, struct page* page,
ci_assert(page);
ci_assert_ge(offset, 0);
ci_assert_gt(size, 0);
ci_assert_le(offset + size, CI_PAGE_SIZE);

#ifndef MSG_SENDPAGE_NOTLAST
/* "flags" is really "more". Convert it. */
Expand Down

0 comments on commit 9ef9f19

Please sign in to comment.