From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by passt.top (Postfix) with ESMTP id 45BA15A0272 for ; Tue, 26 Mar 2024 11:19:28 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711448367; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=kEZIhka7/U1DvESFaKNkvWYZN0Z7VnWNnj/wyF1gn5I=; b=JGVqeHZdQxC9ESbBRKSCxWu4DazkLAeLTrgFzZFALgsAl4d3hBnrE9KdzkbC8rscxAsmuo 8bKw3//EnHaG4QYrFpNdOzuwWQla/0aJDku79jY+lj7qq34pIFXYSEEtPcDMP9YmcMh12x /3UOxdOxG0B7HWvVEtD6vlKydxhZ4Kk= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-204-ZYwUeBzvPfinVWKTBO21Bw-1; Tue, 26 Mar 2024 06:19:25 -0400 X-MC-Unique: ZYwUeBzvPfinVWKTBO21Bw-1 Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-33ed0a8beb5so2881841f8f.1 for ; Tue, 26 Mar 2024 03:19:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711448364; x=1712053164; h=in-reply-to:autocrypt:from:references:cc:to:content-language :subject:user-agent:mime-version:date:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=D1mlWjU1WP9YV++x0e36Whha6zGaX38oEUqZ86Ps5vE=; b=lYG++oUlTN39uwYmQmiVE/CSVkSnfThBTMFSswPHNmKk7lKhbqrQOfoDDOLr8d/9WE RtdxF34tKs7k7wUIq5uv1Hm76i39WJFVFELApWq5Ku2CV8r9moKxH+0jWAtuNFYyY1hO dJ/gQDrxkKDc+FkkFiG/Pq8kdYr05Mw8DPQuTJ1kSZIGFy0gHkOpufSSQkJlh+FRZYX4 JgVfjW7fRYzvv+R4dZ1kJfhBKU126oHdeAvdrgoVLR4JtUlPfPFE1oSeSw83sL0yYveV ANzj8Q8P7+1iHT9ed57aHLvadoQEWb+EjV7JlSiLU8A6mCDuxuhU9EkebamcvPjGJIqH XM+Q== X-Gm-Message-State: AOJu0YyoQI4MoRoSg4O/GwsdTNwPgejXe9LoUJPdXdksHo2KDmOUvvkl u34tPZ3BcQfLk/IEsiPjjXjSvliD6oQ/U+PFNd3fi4v4OpMBrMgb7JW/b+DYyMp0IBOhkAayNNd Dehe05zwXDhP4jXfAZN37YiiQ7Xl9m5hRT1bRxdOKsXjy4sFetnw580BN9HauV90vlYGABrWuuc TD0gCtuzRB9yCSfNeue4HHP78q72N4yqwQ X-Received: by 2002:adf:ea4c:0:b0:33d:277d:a2c7 with SMTP id j12-20020adfea4c000000b0033d277da2c7mr6207108wrn.16.1711448364053; Tue, 26 Mar 2024 03:19:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHvObSGHzPL1Jvtez8dvizzEAUjLERaiQ29HkWxC9vcTiUWR+5LyRkmTFcsUqSbeg2tQ+0oXA== X-Received: by 2002:adf:ea4c:0:b0:33d:277d:a2c7 with SMTP id j12-20020adfea4c000000b0033d277da2c7mr6207084wrn.16.1711448363547; Tue, 26 Mar 2024 03:19:23 -0700 (PDT) Received: from ?IPV6:2a01:e0a:e10:ef90:4c84:58cb:a1ef:8b78? ([2a01:e0a:e10:ef90:4c84:58cb:a1ef:8b78]) by smtp.gmail.com with ESMTPSA id az7-20020adfe187000000b00341ce80ea66sm4584923wrb.82.2024.03.26.03.19.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 26 Mar 2024 03:19:23 -0700 (PDT) Message-ID: <91c44be3-7643-407c-a58d-41476a721d59@redhat.com> Date: Tue, 26 Mar 2024 11:19:22 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC v4] tcp: Replace TCP buffer structure by an iovec array To: passt-dev@passt.top References: <20240321102655.2003763-1-lvivier@redhat.com> From: Laurent Vivier Autocrypt: addr=lvivier@redhat.com; keydata= xsFNBFYFJhkBEAC2me7w2+RizYOKZM+vZCx69GTewOwqzHrrHSG07MUAxJ6AY29/+HYf6EY2 WoeuLWDmXE7A3oJoIsRecD6BXHTb0OYS20lS608anr3B0xn5g0BX7es9Mw+hV/pL+63EOCVm SUVTEQwbGQN62guOKnJJJfphbbv82glIC/Ei4Ky8BwZkUuXd7d5NFJKC9/GDrbWdj75cDNQx UZ9XXbXEKY9MHX83Uy7JFoiFDMOVHn55HnncflUncO0zDzY7CxFeQFwYRbsCXOUL9yBtqLer Ky8/yjBskIlNrp0uQSt9LMoMsdSjYLYhvk1StsNPg74+s4u0Q6z45+l8RAsgLw5OLtTa+ePM JyS7OIGNYxAX6eZk1+91a6tnqfyPcMbduxyBaYXn94HUG162BeuyBkbNoIDkB7pCByed1A7q q9/FbuTDwgVGVLYthYSfTtN0Y60OgNkWCMtFwKxRaXt1WFA5ceqinN/XkgA+vf2Ch72zBkJL RBIhfOPFv5f2Hkkj0MvsUXpOWaOjatiu0fpPo6Hw14UEpywke1zN4NKubApQOlNKZZC4hu6/ 8pv2t4HRi7s0K88jQYBRPObjrN5+owtI51xMaYzvPitHQ2053LmgsOdN9EKOqZeHAYG2SmRW LOxYWKX14YkZI5j/TXfKlTpwSMvXho+efN4kgFvFmP6WT+tPnwARAQABzSNMYXVyZW50IFZp dmllciA8bHZpdmllckByZWRoYXQuY29tPsLBeAQTAQIAIgUCVgVQgAIbAwYLCQgHAwIGFQgC CQoLBBYCAwECHgECF4AACgkQ8ww4vT8vvjwpgg//fSGy0Rs/t8cPFuzoY1cex4limJQfReLr SJXCANg9NOWy/bFK5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Z5IoHWuPkn7uZGBrKIHmBunTco1+cKSuRiSCYpBIXZMHCzPgVDjk4viP brV9NwRkmaOxVvye0vctJeWvJ6KA7NoAURplIGCqkCRwg0MmLrfoZnK/gRqVJ/f6adhU1oo6 z4p2/z3PemA0C0ANatgHgBb90cd16AUxpdEQmOCmdNnNJF/3Zt3inzF+NFzHoM5Vwq6rc1JP jfC3oqRLJzqAEHBDjQFlqNR3IFCIAo4SYQRBdAHBCzkM4rWyRhuVABEBAAHCwV8EGAECAAkF AlYFJhkCGwwACgkQ8ww4vT8vvjwg9w//VQrcnVg3TsjEybxDEUBm8dBmnKqcnTBFmxN5FFtI WlEuY8+YMiWRykd8Ln9RJ/98/ghABHz9TN8TRo2b6WimV64FmlVn17Ri6FgFU3xNt9TTEChq AcNg88eYryKsYpFwegGpwUlaUaaGh1m9OrTzcQy+klVfZWaVJ9Nw0keoGRGb8j4XjVpL8+2x OhXKrM1fzzb8JtAuSbuzZSQPDwQEI5CKKxp7zf76J21YeRrEW4WDznPyVcDTa+tz++q2S/Bp P4W98bXCBIuQgs2m+OflERv5c3Ojldp04/S4NEjXEYRWdiCxN7ca5iPml5gLtuvhJMSy36gl U6IW9kn30IWuSoBpTkgV7rLUEhh9Ms82VWW/h2TxL8enfx40PrfbDtWwqRID3WY8jLrjKfTd R3LW8BnUDNkG+c4FzvvGUs8AvuqxxyHbXAfDx9o/jXfPHVRmJVhSmd+hC3mcQ+4iX5bBPBPM oDqSoLt5w9GoQQ6gDVP2ZjTWqwSRMLzNr37rJjZ1pt0DCMMTbiYIUcrhX8eveCJtY7NGWNyx FCRkhxRuGcpwPmRVDwOl39MB3iTsRighiMnijkbLXiKoJ5CDVvX5yicNqYJPKh5MFXN1bvsB kmYiStMRbrD0HoY1kx5/VozBtc70OU0EB8Wrv9hZD+Ofp0T3KOr1RUHvCZoLURfFhSQ= In-Reply-To: <20240321102655.2003763-1-lvivier@redhat.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: multipart/mixed; boundary="------------UzylOsOmzjR4v7ZYVj5lBW2u" Content-Language: en-US Message-ID-Hash: VST423OAH3PJNSAC2YKL23XFCPOHGTAY X-Message-ID-Hash: VST423OAH3PJNSAC2YKL23XFCPOHGTAY X-MailFrom: lvivier@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: David Gibson X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: This is a multi-part message in MIME format. --------------UzylOsOmzjR4v7ZYVj5lBW2u Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi, I compared perf result using this patch and a patch changing tap_send_frames_passt() to: static size_t tap_send_frames_passt(const struct ctx *c, const struct iovec *iov, size_t bufs_per_frame, size_t nframes) { struct msghdr mh = { .msg_iovlen = bufs_per_frame, }; size_t buf_offset; unsigned int i; ssize_t sent; for (i = 0; i < nframes; i++) { unsigned int j; if (bufs_per_frame > 1) { /* if we have more than 1 iovec, the first one is vnet_len */ uint32_t *p = iov[i * bufs_per_frame].iov_base; uint32_t vnet_len = 0; for (j = 1; j < bufs_per_frame; j++) vnet_len += iov[i * bufs_per_frame + j].iov_len; vnet_len = htonl(vnet_len); *p = vnet_len; } mh.msg_iov = (void *)&iov[i * bufs_per_frame]; sent = sendmsg(c->fd_tap, &mh, MSG_NOSIGNAL | MSG_DONTWAIT); if (sent < 0) return i; /* Check for any partial frames due to short send */ j = iov_skip_bytes(&iov[i * bufs_per_frame], bufs_per_frame, sent, &buf_offset); if (buf_offset && j < bufs_per_frame) { if (write_remainder(c->fd_tap, &iov[i * bufs_per_frame + j], bufs_per_frame - j, buf_offset) < 0) { err("tap: partial frame send: %s", strerror(errno)); return i; } } } return i; } And the result of 'perf record -e cache-misses' gives: slow 83.95% passt.avx2 passt.avx2 [.] csum_avx2 4.39% passt.avx2 passt.avx2 [.] tap4_handler 2.37% passt.avx2 libc.so.6 [.] __printf_buffer 0.84% passt.avx2 passt.avx2 [.] udp_timer fast 22.15% passt.avx2 passt.avx2 [.] csum_avx2 14.91% passt.avx2 passt.avx2 [.] udp_timer 7.60% passt.avx2 libc.so.6 [.] __printf_buffer 5.10% passt.avx2 passt.avx2 [.] ffsl Thanks, Laurent --------------UzylOsOmzjR4v7ZYVj5lBW2u Content-Type: text/x-patch; charset=UTF-8; name="0001-tap-compute-vnet_len-inside-tap_send_frames_passt.patch" Content-Disposition: attachment; filename*0="0001-tap-compute-vnet_len-inside-tap_send_frames_passt.patch" Content-Transfer-Encoding: base64 RnJvbSBkNGIzZTEyMTMyY2VhZjU0ODRkZTIxNWU5Yzg0Y2JlZGNiYmI4MTg4IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBMYXVyZW50IFZpdmllciA8bHZpdmllckByZWRoYXQuY29tPgpE YXRlOiBUdWUsIDE5IE1hciAyMDI0IDE4OjIwOjIwICswMTAwClN1YmplY3Q6IFtQQVRDSF0gdGFw OiBjb21wdXRlIHZuZXRfbGVuIGluc2lkZSB0YXBfc2VuZF9mcmFtZXNfcGFzc3QoKQoKU2lnbmVk LW9mZi1ieTogTGF1cmVudCBWaXZpZXIgPGx2aXZpZXJAcmVkaGF0LmNvbT4KLS0tCiB0YXAuYyB8 IDQ5ICsrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKy0tLS0tLS0tLS0tLS0tLS0KIHRj cC5jIHwgMzkgKysrKysrKysrKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCiAyIGZpbGVz IGNoYW5nZWQsIDQzIGluc2VydGlvbnMoKyksIDQ1IGRlbGV0aW9ucygtKQoKZGlmZiAtLWdpdCBh L3RhcC5jIGIvdGFwLmMKaW5kZXggMTNlNGRhNzlkNjkwLi4xMDk2Mj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