From patchwork Thu Aug 4 14:20:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Begunkov X-Patchwork-Id: 12936433 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D976AC19F2D for ; Thu, 4 Aug 2022 14:21:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234846AbiHDOVb (ORCPT ); Thu, 4 Aug 2022 10:21:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232047AbiHDOVb (ORCPT ); Thu, 4 Aug 2022 10:21:31 -0400 Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5BDD41F2E7 for ; Thu, 4 Aug 2022 07:21:30 -0700 (PDT) Received: by mail-ed1-x533.google.com with SMTP id z2so15156144edc.1 for ; Thu, 04 Aug 2022 07:21:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=s0E5++4w/wKc0IHpdLr69LGiYg5m4f2WbebsnhEa8aU=; b=T1KcProPY2Xt90dNg0xUoGEzwRemoaiOWhwR8pxED2XUd2meat8i7tPJdJAX+jd+PO vkjpQ/y4v3YgtMan6YtWourOpwdhITL79A0dDppB07F++6f7eODVTY6bnu+vd0hh0zzO L9kggrawUNKQubFnjXSlDrTVkzOizRLc/4VAYKqDLQJ+bhQvi3bSvHlH9MQvLGtT0Qil dXKVz5ZreSMWUnebjHMI1TfC0WIloNQX3I9UTif3+Hn2zMJj5ojcsMHHDR/Hf5i0vyEU wUznoBlVTfqrfvl9T8YAkHqD6t8uvKzCax/5haWfwGAuwQ0lDGcorGi098W9Lt5dPiTY 8X2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=s0E5++4w/wKc0IHpdLr69LGiYg5m4f2WbebsnhEa8aU=; b=eXJbpd0XWXplQ6/pSlN36anJs+YNeOIAqS4kEVe9wLTnY5M6dB5hu5PyLNSus72mCI C5tBxddNuHsR2KJUTI6czdkyUa+UHLNH04U5y/PTI3K2FUqC50NZ0rkEP5UAI6A9FZ2T J9UinOUpnxhPMe99WZvmoFYRZqUdhtFXWmxFPRJrpoPqlrZQNwqMmquI48Bnuae7RbX4 dIXwjRIu3HNwkf1oE3LKQYZrRYljzSafVPRGHRLT+vYH7WQUqMdIVdC22G9kASbnvbc/ fg5VVCyi5OQvu4wXdafcyz3LnSONlEXpaE7VAqyN5nb6dwxXhdA0mS5UcMZuwVjNsiPd nrjA== X-Gm-Message-State: ACgBeo3/WNZHWvjPLhkHRSx5YiQxxdn6Ns/yhlKneBJpKeDkpxk/MUUN aQesbPu3y1cYFs/2rAYQa8rF8ITROW4= X-Google-Smtp-Source: AA6agR4KceXeKnFGJSNIV+/j6Ddt42/TvUzby33m5A6SyGpbVZ8Np+K4sgIKLVoG0IRAzFs//ComCg== X-Received: by 2002:a05:6402:5247:b0:43e:cf46:45b3 with SMTP id t7-20020a056402524700b0043ecf4645b3mr1083074edd.153.1659622888585; Thu, 04 Aug 2022 07:21:28 -0700 (PDT) Received: from 127.0.0.1localhost (188.28.126.24.threembb.co.uk. [188.28.126.24]) by smtp.gmail.com with ESMTPSA id r10-20020aa7c14a000000b0043bc33530ddsm727945edp.32.2022.08.04.07.21.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Aug 2022 07:21:28 -0700 (PDT) From: Pavel Begunkov To: io-uring@vger.kernel.org Cc: Jens Axboe , asml.silence@gmail.com Subject: [PATCH liburing 1/6] test/zc: improve error messages Date: Thu, 4 Aug 2022 15:20:20 +0100 Message-Id: <094a2939de904ea81e65277e10662a1db6e2a068.1659622771.git.asml.silence@gmail.com> X-Mailer: git-send-email 2.37.0 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org Signed-off-by: Pavel Begunkov --- test/send-zerocopy.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/test/send-zerocopy.c b/test/send-zerocopy.c index 6fa0535..c04e905 100644 --- a/test/send-zerocopy.c +++ b/test/send-zerocopy.c @@ -676,7 +676,7 @@ static int do_test_inet_send(struct io_uring *ring, int sock_client, int sock_se ret = io_uring_submit(ring); if (ret != nr_reqs) { - fprintf(stderr, "submit failed %i expected %i\n", ret, nr_reqs); + fprintf(stderr, "submit failed, got %i expected %i\n", ret, nr_reqs); return 1; } @@ -704,14 +704,15 @@ static int do_test_inet_send(struct io_uring *ring, int sock_client, int sock_se ret = recv(sock_server, rx_buffer, send_size, 0); if (ret != send_size) { - fprintf(stderr, "recv less than expected or recv failed %i\n", ret); + fprintf(stderr, "recv less than expected or recv failed, " + "got %i, errno %i\n", ret, errno); return 1; } for (i = 0; i < send_size; i++) { if (buf[i] != rx_buffer[i]) { - fprintf(stderr, "botched data, first byte %i, %u vs %u\n", - i, buf[i], rx_buffer[i]); + fprintf(stderr, "botched data, first mismated byte %i, " + "%u vs %u\n", i, buf[i], rx_buffer[i]); } } return 0; From patchwork Thu Aug 4 14:20:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Begunkov X-Patchwork-Id: 12936434 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 098B2C19F2A for ; Thu, 4 Aug 2022 14:21:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239162AbiHDOVd (ORCPT ); Thu, 4 Aug 2022 10:21:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232047AbiHDOVc (ORCPT ); Thu, 4 Aug 2022 10:21:32 -0400 Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7480733E27 for ; Thu, 4 Aug 2022 07:21:31 -0700 (PDT) Received: by mail-ed1-x52d.google.com with SMTP id a89so25561534edf.5 for ; Thu, 04 Aug 2022 07:21:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=4fptWbivLL1R+OXMw15N9MuMx5z4TS9dJyEvA2bJdhU=; b=ZdZaFYHjisbQdTkDWSnAw4OcmUDBoO6M9V3wSeZMiMdIrpNsKPKv64oku6pHUyJu6t L5od8tdOkjtzartgGs8w9D04PwrFHYlY2JtX2idIB+Z/fVd73ONfQuJd60/EuVvB2nW8 2BpAGL7np/nYTinczjM6QtvSeZ1GUwxcyJGYIcTlmeploFBzokvXpgo/Q1vtlvu7ZA+s GIrnElKZC2pIYFuX/R5LUONjlci81JCUl+w+iYT4ZDIMUTvJ3TYjjWS45tpz+WQipKFo LPYmzr9qcmfm0yT47B8E9JK7eS05j2Tboz+ONSesgdAvYBVNtTOTL6P84zVOYTWfsrP/ HObg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=4fptWbivLL1R+OXMw15N9MuMx5z4TS9dJyEvA2bJdhU=; b=fmGOswfYKHNH3oWEH7h8iZ+nGInt2XFNItZPcMGiJKqFZ1CBTe46voPFhSvt58NsOW /paX5htR65QcbZZp2Bfq1Y551320zZFf3o0clEDP5xCq+E9Vv4Nb6OgVbrZfEF+PAi4I QLUJlussDjEAGlbd10yzBGF7LIP5aGYiddtyRAEv7YNU66MjpB9g5RgG5mT8h/oswkz9 wY/apsSy0BPhz+84m5Z8dW5nR7k9WfwrwO4Ek+2LUaKVUGuApkQ8Qsg94WqzX9LWNrGc 1oZR3RzraEB5QGKhF+wtnRvIJnW6cKj1dikljrFgg6YK738VsqLXKOuIBjkMFcaF8NnB OQtQ== X-Gm-Message-State: ACgBeo0ttJEBI/ebhDecCYNWEry3aBnJJBt2l1ngi6EsPYCcoLlCmkt3 TU2bG/msnVgU+SBrvx8XDlf9q3tv4E8= X-Google-Smtp-Source: AA6agR7PEHng5IxxVd2HvqTdPhpw3zSANP2MZRuw+/HK0A2UUo5Nb7KhJ4evGDnG1bDs4nrEoSrlqQ== X-Received: by 2002:a05:6402:5cb:b0:434:eb48:754f with SMTP id n11-20020a05640205cb00b00434eb48754fmr2324125edx.421.1659622889751; Thu, 04 Aug 2022 07:21:29 -0700 (PDT) Received: from 127.0.0.1localhost (188.28.126.24.threembb.co.uk. [188.28.126.24]) by smtp.gmail.com with ESMTPSA id r10-20020aa7c14a000000b0043bc33530ddsm727945edp.32.2022.08.04.07.21.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Aug 2022 07:21:29 -0700 (PDT) From: Pavel Begunkov To: io-uring@vger.kernel.org Cc: Jens Axboe , asml.silence@gmail.com Subject: [PATCH liburing 2/6] tests/zc: test tcp Date: Thu, 4 Aug 2022 15:20:21 +0100 Message-Id: <29a52de00c6cc1bebc9d8fd70afd698746cc91c1.1659622771.git.asml.silence@gmail.com> X-Mailer: git-send-email 2.37.0 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org Add tests for TCP zerocopy send Signed-off-by: Pavel Begunkov --- test/send-zerocopy.c | 53 +++++++++++++++++++++++++++++++++++--------- 1 file changed, 42 insertions(+), 11 deletions(-) diff --git a/test/send-zerocopy.c b/test/send-zerocopy.c index c04e905..7999f46 100644 --- a/test/send-zerocopy.c +++ b/test/send-zerocopy.c @@ -550,10 +550,12 @@ static int test_registration(int sock_tx, int sock_rx) } static int prepare_ip(struct sockaddr_storage *addr, int *sock_client, int *sock_server, - bool ipv6, bool client_connect, bool msg_zc) + bool ipv6, bool client_connect, bool msg_zc, bool tcp) { int family, addr_size; int ret, val; + int listen_sock = -1; + int sock; memset(addr, 0, sizeof(*addr)); if (ipv6) { @@ -574,18 +576,29 @@ static int prepare_ip(struct sockaddr_storage *addr, int *sock_client, int *sock } /* server sock setup */ - *sock_server = socket(family, SOCK_DGRAM, 0); - if (*sock_server < 0) { + if (tcp) { + sock = listen_sock = socket(family, SOCK_STREAM, IPPROTO_TCP); + } else { + sock = *sock_server = socket(family, SOCK_DGRAM, 0); + } + if (sock < 0) { perror("socket"); return 1; } val = 1; - setsockopt(*sock_server, SOL_SOCKET, SO_REUSEADDR, &val, sizeof(val)); - ret = bind(*sock_server, (struct sockaddr *)addr, addr_size); + setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &val, sizeof(val)); + val = 1; + setsockopt(sock, SOL_SOCKET, SO_REUSEPORT, &val, sizeof(val)); + + ret = bind(sock, (struct sockaddr *)addr, addr_size); if (ret < 0) { perror("bind"); return 1; } + if (tcp) { + ret = listen(sock, 128); + assert(ret != -1); + } if (ipv6) { struct sockaddr_in6 *saddr = (struct sockaddr_in6 *)addr; @@ -598,7 +611,12 @@ static int prepare_ip(struct sockaddr_storage *addr, int *sock_client, int *sock } /* client sock setup */ - *sock_client = socket(family, SOCK_DGRAM, 0); + if (tcp) { + *sock_client = socket(family, SOCK_STREAM, IPPROTO_TCP); + assert(client_connect); + } else { + *sock_client = socket(family, SOCK_DGRAM, 0); + } if (*sock_client < 0) { perror("socket"); return 1; @@ -617,6 +635,14 @@ static int prepare_ip(struct sockaddr_storage *addr, int *sock_client, int *sock return 1; } } + if (tcp) { + *sock_server = accept(listen_sock, NULL, NULL); + if (!*sock_server) { + fprintf(stderr, "can't accept\n"); + return 1; + } + close(listen_sock); + } return 0; } @@ -721,17 +747,20 @@ static int do_test_inet_send(struct io_uring *ring, int sock_client, int sock_se static int test_inet_send(struct io_uring *ring) { struct sockaddr_storage addr; - int sock_client, sock_server; - int ret, j; - __u64 i; + int sock_client = -1, sock_server = -1; + int ret, j, i; - for (j = 0; j < 8; j++) { + for (j = 0; j < 16; j++) { bool ipv6 = j & 1; bool client_connect = j & 2; bool msg_zc_set = j & 4; + bool tcp = j & 8; + + if (tcp && !client_connect) + continue; ret = prepare_ip(&addr, &sock_client, &sock_server, ipv6, - client_connect, msg_zc_set); + client_connect, msg_zc_set, tcp); if (ret) { fprintf(stderr, "sock prep failed %d\n", ret); return 1; @@ -746,6 +775,8 @@ static int test_inet_send(struct io_uring *ring) bool aligned = i & 32; int buf_idx = aligned ? 0 : 1; + if (tcp && cork) + continue; if (mix_register && (!cork || fixed_buf)) continue; if (!client_connect && addr_arg == NULL) From patchwork Thu Aug 4 14:20:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Begunkov X-Patchwork-Id: 12936435 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A2E58C19F2D for ; Thu, 4 Aug 2022 14:21:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239754AbiHDOVg (ORCPT ); Thu, 4 Aug 2022 10:21:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239672AbiHDOVf (ORCPT ); Thu, 4 Aug 2022 10:21:35 -0400 Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D15E33E35 for ; Thu, 4 Aug 2022 07:21:32 -0700 (PDT) Received: by mail-ed1-x534.google.com with SMTP id s11so14142138edd.13 for ; Thu, 04 Aug 2022 07:21:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=zckFU/3r31KwkLbdteztPMNAFUqqjvC/+Xlbru31XI4=; b=h9AySY89mXZtQ0076t67TR+GL1UA5X5w4fddynVA+tXxShfp1mf0YGdDnluxsT79xO 1c9HmvcVyqBUQVLpUi95t8Nb2hgCFnixMBODPSBlAU4cnKASDkbKooJWQ99+TaCk96Da vnTwRpcZLBcEQr6fAw/k1//xis2DLX6uc2k4WlEyCkI+JxbQJqhPqMAjMt5FhJ6pbj6p Or50ojrL8v/CjNIC+3vrREijKOCQK1ltSkZzesAAV0rbdZlS0sugep4tKadeRS6UDNWz 3itrtI/vBoi99ezg9dmGkxcKdilx4VF3/LWqCRXmW5673D4ZcctCoDAUkJ4yfc7JAxvE jVtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=zckFU/3r31KwkLbdteztPMNAFUqqjvC/+Xlbru31XI4=; b=dvpyyjgw6/iHiA0RKKSkto1e3IcjSP05KBi+UiU2oX174UitB90nPv4PtHYqAj0hPb 4V5E67vHI6d89cWLu2uCIBwDeFUv0U4GNaavWrFs6saaWamTLDyGm9kETomFYJTITWBE ss2nbxmEE9TCYfJLKrO7iLHzybF2+LuAsJPA/o4jEoxBNqfQsIvNw+N+6b+hbkGb2gMH 838+br/c6gqofpQuLsvUO4R7GEi2gDpBEaCkObRG6XZnhOT4hm90LxgBzg5pYBArd1Nf So1hALC+wyHCnTxZWg8ClTHRMlYrl1GynFBj6Vt2x0v0kQC8ZZkYKP2dsgfSliLcW8E0 QjGw== X-Gm-Message-State: ACgBeo2aakWI8bCkyY9QECnNsr+s1BQnQJ0b0A0cPTvGbTYreFaI0kZw HOL/c0ek8NbrhLtsupK8IUWpvKSaLXM= X-Google-Smtp-Source: AA6agR7gjAkkVkCNSkTh4BqY/IRTkcF2y+vOqM+87eT9CbVSWXMpBgV7hh5M3dTcLpfJmOTC4ovd9Q== X-Received: by 2002:a05:6402:428a:b0:42e:8f7e:1638 with SMTP id g10-20020a056402428a00b0042e8f7e1638mr2279955edc.228.1659622890806; Thu, 04 Aug 2022 07:21:30 -0700 (PDT) Received: from 127.0.0.1localhost (188.28.126.24.threembb.co.uk. [188.28.126.24]) by smtp.gmail.com with ESMTPSA id r10-20020aa7c14a000000b0043bc33530ddsm727945edp.32.2022.08.04.07.21.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Aug 2022 07:21:30 -0700 (PDT) From: Pavel Begunkov To: io-uring@vger.kernel.org Cc: Jens Axboe , asml.silence@gmail.com Subject: [PATCH liburing 3/6] test/zc: allocate buffers dynamically Date: Thu, 4 Aug 2022 15:20:22 +0100 Message-Id: <55d91cebef205ca8bf9c004980f36eca06dae966.1659622771.git.asml.silence@gmail.com> X-Mailer: git-send-email 2.37.0 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org A prep patch, allocate receive and transfer buffers dynamically. Signed-off-by: Pavel Begunkov --- test/send-zerocopy.c | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/test/send-zerocopy.c b/test/send-zerocopy.c index 7999f46..a572407 100644 --- a/test/send-zerocopy.c +++ b/test/send-zerocopy.c @@ -46,7 +46,6 @@ #define NR_SLOTS 5 #define ZC_TAG 10000 -#define MAX_PAYLOAD 8195 #define BUFFER_OFFSET 41 #ifndef ARRAY_SIZE @@ -54,14 +53,8 @@ #endif static int seqs[NR_SLOTS]; -static char tx_buffer[MAX_PAYLOAD] __attribute__((aligned(4096))); -static char rx_buffer[MAX_PAYLOAD] __attribute__((aligned(4096))); -static struct iovec buffers_iov[] = { - { .iov_base = tx_buffer, - .iov_len = sizeof(tx_buffer), }, - { .iov_base = tx_buffer + BUFFER_OFFSET, - .iov_len = sizeof(tx_buffer) - BUFFER_OFFSET - 13, }, -}; +static char *tx_buffer, *rx_buffer; +static struct iovec buffers_iov[2]; static inline bool tag_userdata(__u64 user_data) { @@ -662,7 +655,7 @@ static int do_test_inet_send(struct io_uring *ring, int sock_client, int sock_se char *buf = buffers_iov[buf_idx].iov_base; assert(send_size <= buffers_iov[buf_idx].iov_len); - memset(rx_buffer, 0, sizeof(rx_buffer)); + memset(rx_buffer, 0, send_size); for (i = 0; i < nr_reqs; i++) { bool cur_fixed_buf = fixed_buf; @@ -804,10 +797,23 @@ int main(int argc, char *argv[]) { struct io_uring ring; int i, ret, sp[2]; + size_t len = 8096; if (argc > 1) return T_EXIT_SKIP; + tx_buffer = aligned_alloc(4096, len); + rx_buffer = aligned_alloc(4096, len); + if (!tx_buffer || !rx_buffer) { + fprintf(stderr, "can't allocate buffers\n"); + return T_EXIT_FAIL; + } + + buffers_iov[0].iov_base = tx_buffer; + buffers_iov[0].iov_len = len; + buffers_iov[1].iov_base = tx_buffer + BUFFER_OFFSET; + buffers_iov[1].iov_len = len - BUFFER_OFFSET - 13; + ret = io_uring_queue_init(32, &ring, 0); if (ret) { fprintf(stderr, "queue init failed: %d\n", ret); @@ -824,8 +830,9 @@ int main(int argc, char *argv[]) } srand((unsigned)time(NULL)); - for (i = 0; i < sizeof(tx_buffer); i++) + for (i = 0; i < len; i++) tx_buffer[i] = i; + memset(rx_buffer, 0, len); if (socketpair(AF_UNIX, SOCK_DGRAM, 0, sp) != 0) { perror("Failed to create Unix-domain socket pair\n"); From patchwork Thu Aug 4 14:20:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Begunkov X-Patchwork-Id: 12936436 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 17D4AC19F2B for ; Thu, 4 Aug 2022 14:21:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232047AbiHDOVg (ORCPT ); Thu, 4 Aug 2022 10:21:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239487AbiHDOVf (ORCPT ); Thu, 4 Aug 2022 10:21:35 -0400 Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F3093AB17 for ; Thu, 4 Aug 2022 07:21:33 -0700 (PDT) Received: by mail-ed1-x52d.google.com with SMTP id x21so12814256edd.3 for ; Thu, 04 Aug 2022 07:21:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=Q8bh0yHRmnGsPs8d8XIQ89fzl0kLwyc+bl0Zuu0VtdU=; b=odYfBBvn5DX7Sppl6VZz4tc/A08YdObOKDpmbtnvDFO/e1VyOYXSgrCHwqx0gPgBcY BGultPMPIXIUvwEDR9l7UasFePUZSY2UFF9CvcXyeZdGW4Tj15BF4jIkso9DhCZ79+Cx c4sbtcDxmRxEndCFRfpzvQ2vf4VxX2GLiq0dwcdJnQ78/ntrdKbaxlctzJyz8cyzZzSp KbTYX2WUTFJNTDVZFdv29AyytUZS50EGc/uHGzKWxDUGl/16gcPabOVpmsE0G5Xu/CMH hTPRBF5g2F0dxI0Aiq1byGzpPyFFRCHG+laBeTN1cgwEc0TmN07f0360st1jyijJbx10 jcXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=Q8bh0yHRmnGsPs8d8XIQ89fzl0kLwyc+bl0Zuu0VtdU=; b=tMPi8r28CMq8BW7Pgrmy9AEbdcfjGK3c5oqVPZBr9fwy7nVU0m9O3DDc5RNCJak8ca NeiQe5yTeECnbrNTV0NOzurYGZTbp5gjje8U180nuB8CG/DJ/LgBe19FR7vL6VHlhtas n+9iI5mYxgEkaP82ZO5rLvFx6OHdL/3HkKmSvL3vYO4OXyhL7G2SrACrjmQuEi8w9Ui2 W9uh/2VOk70ST5csOwf7pBN86NRBHWhu7BbkfPeVDFD68ncN8F6GT1J+6/1G099204OT DvrcrwqAwD0m5vbz5kk6Y0N+P8HSudcQ1doMzEkWZaosIUYXy5LbiLj0SzKP8sR5/7WS uTHA== X-Gm-Message-State: ACgBeo2GARlT4RXp3b5L4Ilz4zhYmqIkm5YmIfMW8UhKS49RveNK+vsV mD/sVdm8NTaCoP6oKZBmC8Gqkp7ok1k= X-Google-Smtp-Source: AA6agR7PS7PSl23sxJb0IcFvWljmnSEQz3VSssbx2HCLvd3OGafGZGuFwwSKyXB8DHwivJoxy81MBg== X-Received: by 2002:aa7:d597:0:b0:43d:5bcf:f251 with SMTP id r23-20020aa7d597000000b0043d5bcff251mr2272600edq.15.1659622891951; Thu, 04 Aug 2022 07:21:31 -0700 (PDT) Received: from 127.0.0.1localhost (188.28.126.24.threembb.co.uk. [188.28.126.24]) by smtp.gmail.com with ESMTPSA id r10-20020aa7c14a000000b0043bc33530ddsm727945edp.32.2022.08.04.07.21.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Aug 2022 07:21:31 -0700 (PDT) From: Pavel Begunkov To: io-uring@vger.kernel.org Cc: Jens Axboe , asml.silence@gmail.com Subject: [PATCH liburing 4/6] test/zc: handle short rx Date: Thu, 4 Aug 2022 15:20:23 +0100 Message-Id: X-Mailer: git-send-email 2.37.0 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org After a send we receive and check buffers, make sure that we also handle short receives. Signed-off-by: Pavel Begunkov --- test/send-zerocopy.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/test/send-zerocopy.c b/test/send-zerocopy.c index a572407..d0f5931 100644 --- a/test/send-zerocopy.c +++ b/test/send-zerocopy.c @@ -653,6 +653,7 @@ static int do_test_inet_send(struct io_uring *ring, int sock_client, int sock_se size_t chunk_size = send_size / nr_reqs; size_t chunk_size_last = send_size - chunk_size * (nr_reqs - 1); char *buf = buffers_iov[buf_idx].iov_base; + size_t bytes_received = 0; assert(send_size <= buffers_iov[buf_idx].iov_len); memset(rx_buffer, 0, send_size); @@ -699,6 +700,18 @@ static int do_test_inet_send(struct io_uring *ring, int sock_client, int sock_se return 1; } + while (bytes_received != send_size) { + ret = recv(sock_server, + rx_buffer + bytes_received, + send_size - bytes_received, 0); + if (ret <= 0) { + fprintf(stderr, "recv failed, got %i, errno %i\n", + ret, errno); + return 1; + } + bytes_received += ret; + } + for (i = 0; i < nr_reqs; i++) { int expected = chunk_size; @@ -721,13 +734,6 @@ static int do_test_inet_send(struct io_uring *ring, int sock_client, int sock_se io_uring_cqe_seen(ring, cqe); } - ret = recv(sock_server, rx_buffer, send_size, 0); - if (ret != send_size) { - fprintf(stderr, "recv less than expected or recv failed, " - "got %i, errno %i\n", ret, errno); - return 1; - } - for (i = 0; i < send_size; i++) { if (buf[i] != rx_buffer[i]) { fprintf(stderr, "botched data, first mismated byte %i, " From patchwork Thu Aug 4 14:20:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Begunkov X-Patchwork-Id: 12936437 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B37B1C19F2A for ; Thu, 4 Aug 2022 14:21:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239487AbiHDOVg (ORCPT ); Thu, 4 Aug 2022 10:21:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39616 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239700AbiHDOVg (ORCPT ); Thu, 4 Aug 2022 10:21:36 -0400 Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D8E4647BAA for ; Thu, 4 Aug 2022 07:21:34 -0700 (PDT) Received: by mail-ed1-x52c.google.com with SMTP id w3so9894558edc.2 for ; Thu, 04 Aug 2022 07:21:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=40GIJeWXkRh0CCXmtErKQ4+wmKT1qUseLdNeN4jDS1I=; b=NjP+nxe7kjbf2fOOEa2DjEngm5PAj8nLlkiBWwDx/q6MUPfhCdFB3sTm6p+acK4qqN 38rWsL/75p9q4LuyVDnISoLw8E1FLX0bilWuZe0Hevm2YtqEv0xRMavw60VlMH6yOJqv Vtg80zXhJfaWU0uFmWDxEtMRTggPFVK8WE26Od49cHmgGB59wVLTEHjWuf+j72METX0Q 5ljSOr8Kkre/pbjfEa1vkLK5wDnTvhiDA7J9+ipWk7JB72RCTzlwXB0vsPb27T1B9LFf IQs4/JhNjEEaa/nWAxT5O1smF1FOqUrIpUYvDKwrAf6NWyM41a4wVMtcqSs2cz1/tpou huPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=40GIJeWXkRh0CCXmtErKQ4+wmKT1qUseLdNeN4jDS1I=; b=udZj4apaA7cSGTVhCqEKK5/+fjohBsbExVao7DDEifa5lMkd4KT8Os0b0Ow5c/qLYb 6DFtamc3ag3U1eg6rJFCEy7CGgiPONWazTsb3HPiEdBS2Nq87FGyA8krf9v624vh2Yj1 66PBDNk7mbVPGQU0lGmVPnaGXSJT+o5OA2DcTA5PvRL+CMC+79OFJ5H2cDrMtAmw9jwY YyTIZFuLyPC+HnINcJgGctvAxiwgD/39gSCn0mnCCgW1cCcNi0K+KhKGNC3Pl6jMh2Yu 9upSz7xmLd3HTgqg+MKOjL7KnUnMA/rr/Gz/l9zohKL17NXnaI44oQ/fEp/GD3+iL0pm Ibwg== X-Gm-Message-State: ACgBeo0GktwQWr4PprXM9T4kUehaOyNfjSCawe4stmGefPteCBkvAqny UAdLJrwdhGud15IHqE3mMLcodEnGa/k= X-Google-Smtp-Source: AA6agR48q/IlnYTgigRQnjYMLb+fwhDnI+ThTJYycHHxdsDvRD7Ad/5c3fskJrIDCa1LuSzcLIv6Kg== X-Received: by 2002:a05:6402:40ce:b0:43d:f8a0:9c4f with SMTP id z14-20020a05640240ce00b0043df8a09c4fmr2295319edb.95.1659622893062; Thu, 04 Aug 2022 07:21:33 -0700 (PDT) Received: from 127.0.0.1localhost (188.28.126.24.threembb.co.uk. [188.28.126.24]) by smtp.gmail.com with ESMTPSA id r10-20020aa7c14a000000b0043bc33530ddsm727945edp.32.2022.08.04.07.21.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Aug 2022 07:21:32 -0700 (PDT) From: Pavel Begunkov To: io-uring@vger.kernel.org Cc: Jens Axboe , asml.silence@gmail.com Subject: [PATCH liburing 5/6] test/zc: recv asynchronously Date: Thu, 4 Aug 2022 15:20:24 +0100 Message-Id: X-Mailer: git-send-email 2.37.0 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org Receive in a separate task to avoid locking up in case of short sends. Signed-off-by: Pavel Begunkov --- test/send-zerocopy.c | 56 ++++++++++++++++++++++++++++++++------------ 1 file changed, 41 insertions(+), 15 deletions(-) diff --git a/test/send-zerocopy.c b/test/send-zerocopy.c index d0f5931..617e7a0 100644 --- a/test/send-zerocopy.c +++ b/test/send-zerocopy.c @@ -653,7 +653,8 @@ static int do_test_inet_send(struct io_uring *ring, int sock_client, int sock_se size_t chunk_size = send_size / nr_reqs; size_t chunk_size_last = send_size - chunk_size * (nr_reqs - 1); char *buf = buffers_iov[buf_idx].iov_base; - size_t bytes_received = 0; + pid_t p; + int wstatus; assert(send_size <= buffers_iov[buf_idx].iov_len); memset(rx_buffer, 0, send_size); @@ -700,16 +701,35 @@ static int do_test_inet_send(struct io_uring *ring, int sock_client, int sock_se return 1; } - while (bytes_received != send_size) { - ret = recv(sock_server, - rx_buffer + bytes_received, - send_size - bytes_received, 0); - if (ret <= 0) { - fprintf(stderr, "recv failed, got %i, errno %i\n", - ret, errno); - return 1; + p = fork(); + if (p == -1) { + fprintf(stderr, "fork() failed\n"); + return 1; + } + + if (p == 0) { + size_t bytes_received = 0; + + while (bytes_received != send_size) { + ret = recv(sock_server, + rx_buffer + bytes_received, + send_size - bytes_received, 0); + if (ret <= 0) { + fprintf(stderr, "recv failed, got %i, errno %i\n", + ret, errno); + exit(1); + } + bytes_received += ret; } - bytes_received += ret; + + for (i = 0; i < send_size; i++) { + if (buf[i] != rx_buffer[i]) { + fprintf(stderr, "botched data, first mismated byte %i, " + "%u vs %u\n", i, buf[i], rx_buffer[i]); + exit(1); + } + } + exit(0); } for (i = 0; i < nr_reqs; i++) { @@ -734,11 +754,17 @@ static int do_test_inet_send(struct io_uring *ring, int sock_client, int sock_se io_uring_cqe_seen(ring, cqe); } - for (i = 0; i < send_size; i++) { - if (buf[i] != rx_buffer[i]) { - fprintf(stderr, "botched data, first mismated byte %i, " - "%u vs %u\n", i, buf[i], rx_buffer[i]); - } + if (waitpid(p, &wstatus, 0) == (pid_t)-1) { + perror("waitpid()"); + return 1; + } + if (!WIFEXITED(wstatus)) { + fprintf(stderr, "child failed %i\n", WEXITSTATUS(wstatus)); + return 1; + } + if (WEXITSTATUS(wstatus)) { + fprintf(stderr, "child failed\n"); + return 1; } return 0; } From patchwork Thu Aug 4 14:20:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Begunkov X-Patchwork-Id: 12936438 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9F6CDC19F2D for ; Thu, 4 Aug 2022 14:21:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239068AbiHDOVi (ORCPT ); Thu, 4 Aug 2022 10:21:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239672AbiHDOVh (ORCPT ); Thu, 4 Aug 2022 10:21:37 -0400 Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com [IPv6:2a00:1450:4864:20::532]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D30533E27 for ; Thu, 4 Aug 2022 07:21:36 -0700 (PDT) Received: by mail-ed1-x532.google.com with SMTP id e13so6605502edj.12 for ; Thu, 04 Aug 2022 07:21:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=pJ6Nu6ke0tEeP4WGcPqc987CZlnioHDjGxMs6lV8f9E=; b=Dh4YVCEZ1/4ZsfBf39hKqqutmVilRgOMFeTSi9BAv0py0b65OX3Dcyfc5Fi46BSBa1 yIWVTIaV8MYyHWnj6LxWUJHmPlWU5jCKfxTQIMvP5qCladOqPqgu7IE7qstBjAXYhqUv iBwvA9sfoSsDBia8GAzu84hKBQqg2cLi3Os9fircBao3Vf4Pz8N5KUAtyRrKMmpS796v /jzD90nz5qtclnAT5XBtd32AM06BFG75WMiHKcYBiVTH6URJrMrqJPyqojgpQA74Oizp BhyFzMFUL/qJxlIhWzaSU8k5WPd/sJvLx8IFKY13vQrm5sKbstbawkcxNqkUyv1M5+79 S4kA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=pJ6Nu6ke0tEeP4WGcPqc987CZlnioHDjGxMs6lV8f9E=; b=Y4G/6nQAqsSBN+cGOC/RhfmLcgm7pRyGlfFTvlAnTAmvsT1HnqX26L1n9wAQBydoxS Gq2zJ+7NWXjSLyC0HNOzff4MViJRYfGY4CfRCTtozdBQX1NJBHoqhkmAd1DxDnruBish 3Zpd8J9xwF7ma8tk/xJnRmCx2E07/z+NWLdr7cqM2tR1zZCRkUa4MXLKFUWl/LEjyu57 V25DJvg3jozuGEJr1UgighyES+1KYdXhytFX9O9w5Db6gfRhIRncKKOaTFSdEgDSq1j1 IzVb7Tn7TeWcBt8/7GDJQqeCnZlhupANBjukSCjjtUtNpaeN5BUuQkCqRagsRT26bBnx 5YmA== X-Gm-Message-State: ACgBeo0pbu1Ho4yAPu4/Cx3TmI9+GM7DAyvQZPoge1hAbygXDY6wJLDb WEF3Rys2/+jfi0Pceyt8xPeNu7pDOs4= X-Google-Smtp-Source: AA6agR4Jf6cAWJmRxZWXJAKkGZcUmDj5pU9rcJVMpTatG/Mhkci4gjpgX6IUOKYifkYAKRHj4Lwjmw== X-Received: by 2002:a05:6402:27c6:b0:43d:6fab:146e with SMTP id c6-20020a05640227c600b0043d6fab146emr2241308ede.376.1659622894256; Thu, 04 Aug 2022 07:21:34 -0700 (PDT) Received: from 127.0.0.1localhost (188.28.126.24.threembb.co.uk. [188.28.126.24]) by smtp.gmail.com with ESMTPSA id r10-20020aa7c14a000000b0043bc33530ddsm727945edp.32.2022.08.04.07.21.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Aug 2022 07:21:33 -0700 (PDT) From: Pavel Begunkov To: io-uring@vger.kernel.org Cc: Jens Axboe , asml.silence@gmail.com Subject: [PATCH liburing 6/6] test/zc: test short zc send Date: Thu, 4 Aug 2022 15:20:25 +0100 Message-Id: <6ee389d6b720356ec2a8c677a34a852c761c1627.1659622771.git.asml.silence@gmail.com> X-Mailer: git-send-email 2.37.0 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org Zerocopy send should hide short writes for stream sockets, test it. Signed-off-by: Pavel Begunkov --- test/send-zerocopy.c | 34 ++++++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/test/send-zerocopy.c b/test/send-zerocopy.c index 617e7a0..307c114 100644 --- a/test/send-zerocopy.c +++ b/test/send-zerocopy.c @@ -54,7 +54,7 @@ static int seqs[NR_SLOTS]; static char *tx_buffer, *rx_buffer; -static struct iovec buffers_iov[2]; +static struct iovec buffers_iov[3]; static inline bool tag_userdata(__u64 user_data) { @@ -662,7 +662,7 @@ static int do_test_inet_send(struct io_uring *ring, int sock_client, int sock_se for (i = 0; i < nr_reqs; i++) { bool cur_fixed_buf = fixed_buf; size_t cur_size = chunk_size; - int msg_flags = 0; + int msg_flags = MSG_WAITALL; if (mix_register) cur_fixed_buf = rand() & 1; @@ -791,15 +791,26 @@ static int test_inet_send(struct io_uring *ring) return 1; } - for (i = 0; i < 64; i++) { + for (i = 0; i < 128; i++) { bool fixed_buf = i & 1; struct sockaddr_storage *addr_arg = (i & 2) ? &addr : NULL; size_t size = (i & 4) ? 137 : 4096; bool cork = i & 8; bool mix_register = i & 16; bool aligned = i & 32; + bool large_buf = i & 64; int buf_idx = aligned ? 0 : 1; + if (!tcp || !large_buf) + continue; + if (large_buf) { + buf_idx = 2; + size = buffers_iov[buf_idx].iov_len; + if (!aligned || !tcp) + continue; + } + if (!buffers_iov[buf_idx].iov_base) + continue; if (tcp && cork) continue; if (mix_register && (!cork || fixed_buf)) @@ -829,22 +840,33 @@ int main(int argc, char *argv[]) { struct io_uring ring; int i, ret, sp[2]; - size_t len = 8096; + size_t len; if (argc > 1) return T_EXIT_SKIP; + len = 1U << 25; /* 32MB, should be enough to trigger a short send */ tx_buffer = aligned_alloc(4096, len); rx_buffer = aligned_alloc(4096, len); + if (tx_buffer && rx_buffer) { + buffers_iov[2].iov_base = tx_buffer; + buffers_iov[2].iov_len = len; + } else { + printf("skip large buffer tests, can't alloc\n"); + + len = 8192; + tx_buffer = aligned_alloc(4096, len); + rx_buffer = aligned_alloc(4096, len); + } if (!tx_buffer || !rx_buffer) { fprintf(stderr, "can't allocate buffers\n"); return T_EXIT_FAIL; } buffers_iov[0].iov_base = tx_buffer; - buffers_iov[0].iov_len = len; + buffers_iov[0].iov_len = 8192; buffers_iov[1].iov_base = tx_buffer + BUFFER_OFFSET; - buffers_iov[1].iov_len = len - BUFFER_OFFSET - 13; + buffers_iov[1].iov_len = 8192 - BUFFER_OFFSET - 13; ret = io_uring_queue_init(32, &ring, 0); if (ret) {