IO-Uring Archive on lore.kernel.org
 help / color / Atom feed
From: Jonas Bonn <jonas@norrbonn.se>
To: axboe@kernel.dk, io-uring@vger.kernel.org
Subject: sendmsg fails when it 'blocks'
Date: Sun, 9 Feb 2020 10:25:02 +0100
Message-ID: <6b909e30-c31c-b7f0-fa3a-d30d287ce427@norrbonn.se> (raw)

Hi Jens,

I've been trying to use io_uring to flood a network link with UDP 
packets.  Essentially, the program just pushes a series of sendmsg() 
calls through the SQE ring and keeps topping it up with new calls as 
soon as the completions come in.

When the sendmsg() calls complete immediately then everything works 
fine; however, when the calls 'block' and get queued up in the kernel 
then the calls return either errno 97 or 22 when they're retried through 
the workqueue (effectively, bad address or invalid iovec length).

My gut-feeling is that there's some issue copying the msghdr struct so 
that the call that's retried isn't exactly the same one that was 
requested.  I looked into the kernel code a bit, but couldn't really 
make heads or tails of it so I though I'd ask for some input while I 
keep investigating.

I noticed that liburing has a simple test for sendmsg that sends a 
single message; the 'punted' case doesn't seem to be tested.  Is this 
something you've tried?

Tested on kernels 5.3 to 5.6-pre and the behaviour's pretty much the 
same with regards to the above.

Any help greatly appreciated.

Best regards,
Jonas

             reply index

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-09  9:25 Jonas Bonn [this message]
2020-02-09 16:40 ` Jens Axboe

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=6b909e30-c31c-b7f0-fa3a-d30d287ce427@norrbonn.se \
    --to=jonas@norrbonn.se \
    --cc=axboe@kernel.dk \
    --cc=io-uring@vger.kernel.org \
    /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

IO-Uring Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/io-uring/0 io-uring/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 io-uring io-uring/ https://lore.kernel.org/io-uring \
		io-uring@vger.kernel.org
	public-inbox-index io-uring

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.io-uring


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git