Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Socket recvfrom and sendto missing? #397

Open
ioquatix opened this issue Aug 5, 2021 · 8 comments
Open

Socket recvfrom and sendto missing? #397

ioquatix opened this issue Aug 5, 2021 · 8 comments

Comments

@ioquatix
Copy link
Contributor

ioquatix commented Aug 5, 2021

I see there was a patch discussed here but it does not seem to be merged?

https://www.spinics.net/lists/io-uring/msg03217.html

What was the outcome of this patch/discussion?

@ammarfaizi2
Copy link
Contributor

Not sure what happened, I just dug up the old thread here https://lore.kernel.org/io-uring/[email protected]/

I think it requires Ack from David S. Miller as it touches net files.

@axboe
Copy link
Owner

axboe commented Oct 16, 2021

We could probably get the ack, I think it mostly stalled on people saying it's just a subset of what is already supported. What is nice about recvfrom/sendto though is that less state needs to be retained to keep the submission side stable. If someone else would be interested in picking up this work, then that would be great.

@HowHsu
Copy link

HowHsu commented Oct 25, 2021

We could probably get the ack, I think it mostly stalled on people saying it's just a subset of what is already supported. What is nice about recvfrom/sendto though is that less state needs to be retained to keep the submission side stable. If someone else would be interested in picking up this work, then that would be great.

Glad to look into this, a rough glance told me that it needs to be rebased and re-think about data structure.

ammarfaizi2 added a commit to ammarfaizi2/linux-block that referenced this issue Dec 30, 2021
This adds sendto(2) and recvfrom(2) support for io_uring.

New opcodes:
  IORING_OP_SENDTO
  IORING_OP_RECVFROM

Cc: Nugra <[email protected]>
Link: axboe/liburing#397
Signed-off-by: Ammar Faizi <[email protected]>
@ammarfaizi2
Copy link
Contributor

I submitted an RFC for this. I would like to get some comments.

Link: [RFC PATCH v2 0/3] io_uring: Add sendto(2) and recvfrom(2) support

ammarfaizi2 added a commit to ammarfaizi2/linux-block that referenced this issue Dec 30, 2021
This adds sendto(2) and recvfrom(2) support for io_uring.

New opcodes:
  IORING_OP_SENDTO
  IORING_OP_RECVFROM

Cc: Nugra <[email protected]>
Link: axboe/liburing#397
Tested-by: Nugra <[email protected]>
Signed-off-by: Ammar Faizi <[email protected]>
---

v3:
  - Fix build error when CONFIG_NET is undefined should be done in
    the first patch, not this patch.

  - Add Tested-by tag from Nugra.

v2:
  - In `io_recvfrom()`, mark the error check of `move_addr_to_user()`
    call as unlikely.

  - Fix build error when CONFIG_NET is undefined.

  - Added Nugra to CC list (tester).
ammarfaizi2 added a commit to ammarfaizi2/linux-block that referenced this issue Jan 6, 2022
This adds sendto(2) and recvfrom(2) support for io_uring.

New opcodes:
  IORING_OP_SENDTO
  IORING_OP_RECVFROM

Cc: Nugra <[email protected]>
Link: axboe/liburing#397
Tested-by: Nugra <[email protected]>
Signed-off-by: Ammar Faizi <[email protected]>
---
v4:
  - Rebased the work (sync with "for-next" branch in Jens' tree).

v3:
  - Fix build error when CONFIG_NET is undefined should be done in
    the first patch, not this patch.

  - Add Tested-by tag from Nugra.

v2:
  - In `io_recvfrom()`, mark the error check of `move_addr_to_user()`
    call as unlikely.

  - Fix build error when CONFIG_NET is undefined.

  - Added Nugra to CC list (tester).
ammarfaizi2 added a commit to ammarfaizi2/linux-block that referenced this issue Jan 6, 2022
This adds sendto(2) and recvfrom(2) support for io_uring.

New opcodes:
  IORING_OP_SENDTO
  IORING_OP_RECVFROM

Cc: Nugra <[email protected]>
Cc: Praveen Kumar <[email protected]>
Link: axboe/liburing#397
Signed-off-by: Ammar Faizi <[email protected]>
---

v4:
  - Rebase the work (sync with "for-next" branch in Jens' tree).

  - Remove Tested-by tag from Nugra as this patch changes.

  - (Address Praveen's comment) Zero `sendto_addr_len` and
    `recvfrom_addr_len` on prep when the `req->opcode` is not
    `IORING_OP_{SENDTO,RECVFROM}`.

v3:
  - Fix build error when CONFIG_NET is undefined should be done in
    the first patch, not this patch.

  - Add Tested-by tag from Nugra.

v2:
  - In `io_recvfrom()`, mark the error check of `move_addr_to_user()`
    call as unlikely.

  - Fix build error when CONFIG_NET is undefined.

  - Added Nugra to CC list (tester).

---
ammarfaizi2 added a commit to ammarfaizi2/linux-block that referenced this issue Jan 6, 2022
This adds sendto(2) and recvfrom(2) support for io_uring.

New opcodes:
  IORING_OP_SENDTO
  IORING_OP_RECVFROM

Cc: Nugra <[email protected]>
Cc: Praveen Kumar <[email protected]>
Link: axboe/liburing#397
Signed-off-by: Ammar Faizi <[email protected]>
---

v4:
  - Rebase the work (sync with "for-next" branch in Jens' tree).

  - Remove Tested-by tag from Nugra as this patch changes.

  - (Address Praveen's comment) Zero `sendto_addr_len` and
    `recvfrom_addr_len` on prep when the `req->opcode` is not
    `IORING_OP_{SENDTO,RECVFROM}`.

v3:
  - Fix build error when CONFIG_NET is undefined should be done in
    the first patch, not this patch.

  - Add Tested-by tag from Nugra.

v2:
  - In `io_recvfrom()`, mark the error check of `move_addr_to_user()`
    call as unlikely.

  - Fix build error when CONFIG_NET is undefined.

  - Added Nugra to CC list (tester).

---
fengguang pushed a commit to 0day-ci/linux that referenced this issue Jan 7, 2022
This adds sendto(2) and recvfrom(2) support for io_uring.

New opcodes:
  IORING_OP_SENDTO
  IORING_OP_RECVFROM

Cc: Nugra <[email protected]>
Cc: Praveen Kumar <[email protected]>
Link: axboe/liburing#397
Signed-off-by: Ammar Faizi <[email protected]>
ammarfaizi2 added a commit to ammarfaizi2/linux-block that referenced this issue Jan 29, 2022
This adds sendto(2) and recvfrom(2) support for io_uring.

New opcodes:
  IORING_OP_SENDTO
  IORING_OP_RECVFROM

Cc: Nugra <[email protected]>
Cc: Praveen Kumar <[email protected]>
Cc: Alviro Iskandar Setiawan <[email protected]>
Link: axboe/liburing#397
Signed-off-by: Ammar Faizi <[email protected]>
---
v1:
  - Add Alviro Iskandar Setiawan to CC list (tester).

RFC v4:
  - Rebase the work (sync with "for-next" branch in Jens' tree).
  - Remove Tested-by tag from Nugra as this patch changes.
  - (Address Praveen's comment) Zero `sendto_addr_len` and
    `recvfrom_addr_len` on prep when the `req->opcode` is not
    `IORING_OP_{SENDTO,RECVFROM}`.

RFC v3:
  - Fix build error when CONFIG_NET is undefined should be done in
    the first patch, not this patch.

  - Add Tested-by tag from Nugra.

RFC v2:
  - In `io_recvfrom()`, mark the error check of `move_addr_to_user()`
    call as unlikely.
  - Fix build error when CONFIG_NET is undefined.
  - Added Nugra to CC list (tester).
---
ammarfaizi2 added a commit to ammarfaizi2/linux-block that referenced this issue Jan 29, 2022
This adds sendto(2) and recvfrom(2) support for io_uring.

New opcodes:
  IORING_OP_SENDTO
  IORING_OP_RECVFROM

Cc: Nugra <[email protected]>
Cc: Praveen Kumar <[email protected]>
Cc: Alviro Iskandar Setiawan <[email protected]>
Link: axboe/liburing#397
Signed-off-by: Ammar Faizi <[email protected]>
---
v1:
  - Add Alviro Iskandar Setiawan to CC list (tester).

RFC v4:
  - Rebase the work (sync with "for-next" branch in Jens' tree).
  - Remove Tested-by tag from Nugra as this patch changes.
  - (Address Praveen's comment) Zero `sendto_addr_len` and
    `recvfrom_addr_len` on prep when the `req->opcode` is not
    `IORING_OP_{SENDTO,RECVFROM}`.

RFC v3:
  - Fix build error when CONFIG_NET is undefined should be done in
    the first patch, not this patch.

  - Add Tested-by tag from Nugra.

RFC v2:
  - In `io_recvfrom()`, mark the error check of `move_addr_to_user()`
    call as unlikely.
  - Fix build error when CONFIG_NET is undefined.
  - Added Nugra to CC list (tester).
---
ammarfaizi2 added a commit to ammarfaizi2/linux-block that referenced this issue Jan 29, 2022
This adds sendto(2) and recvfrom(2) support for io_uring.

New opcodes:
  IORING_OP_SENDTO
  IORING_OP_RECVFROM

Cc: Nugra <[email protected]>
Cc: Praveen Kumar <[email protected]>
Cc: Alviro Iskandar Setiawan <[email protected]>
Link: axboe/liburing#397
Signed-off-by: Ammar Faizi <[email protected]>
---
v1:
  - Add BUILD_BUG_SQE_ELEM(48, __u64,  addr3); for compile time
    assertion.
  - Add Alviro Iskandar Setiawan to CC list (tester).

RFC v4:
  - Rebase the work (sync with "for-next" branch in Jens' tree).
  - Remove Tested-by tag from Nugra as this patch changes.
  - (Address Praveen's comment) Zero `sendto_addr_len` and
    `recvfrom_addr_len` on prep when the `req->opcode` is not
    `IORING_OP_{SENDTO,RECVFROM}`.

RFC v3:
  - Fix build error when CONFIG_NET is undefined should be done in
    the first patch, not this patch.
  - Add Tested-by tag from Nugra.

RFC v2:
  - In `io_recvfrom()`, mark the error check of `move_addr_to_user()`
    call as unlikely.
  - Fix build error when CONFIG_NET is undefined.
  - Added Nugra to CC list (tester).
---
@illiliti
Copy link

Any progress?

@GalaxySnail
Copy link
Contributor

AFAIK sendto is available since torvalds/linux@516e82f (landed in Linux 6.1), its userspace helper is io_uring_prep_send_set_addr(3).

@illiliti
Copy link

Great. Can't wait to see recvfrom support.

@serzhiio
Copy link

Any updates on recvfrom() implementation?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants