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 5052A5A0275 for ; Mon, 11 Mar 2024 12:02:14 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1710154933; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KtI6WyGnmOfksFcBpf1ctbmCcy2R9PBhGVK2KY8P2Pk=; b=Y/GPkrvcsJ7GiJvIcia21bdIx7yrYX5NomgoEKVZNoMZcY4Sh0gBypIajMAxlopzYLi+6r lAPpM0wxSc874t+ZqYCLQ2a1lvZPw2isx0sgoe/SosM0QAbAvoxYcphbeyrwrKCPG951Es FRnA37i27dPlOSpcoubes5ylb++zVGs= Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-284-QUc0_2qOMTG4CXtnR3R3qQ-1; Mon, 11 Mar 2024 07:02:11 -0400 X-MC-Unique: QUc0_2qOMTG4CXtnR3R3qQ-1 Received: by mail-qk1-f198.google.com with SMTP id af79cd13be357-7881a1ce399so427159485a.2 for ; Mon, 11 Mar 2024 04:02:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710154931; x=1710759731; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=KtI6WyGnmOfksFcBpf1ctbmCcy2R9PBhGVK2KY8P2Pk=; b=snXlrys1getms8Mke9iENJi0+zO/kQj2rlqMsBVDWeUo4dLW1RqC5ZOaOwD22mAAI0 AOH9DltztJFHQANVGypqiZvKGZwv/j+es05LzCxbMYyB5TwajvOAcFowdREUQA6mTy2w QeO3uYOf+z13supRmTROFR2oC7ctBHOlmmKNUYqiaP09nKP+Yh1CWaOlLA/Wxof09F+d uHCpFK0sCT7xpGmBnHuwXahJcJ/rXM8R9ZFSnldfsMQfHWLcqP4aQhQKd6M7DF4kuyz0 XL9VkCLRNoGDA4CIxoUXqx7vgBlhfGXco0DzNl34VvbqpqU4YEFMMv6bdiDM+jqUL7wM 8ANA== X-Forwarded-Encrypted: i=1; AJvYcCXb5kag8moEFudT/C0jGF5O+ZvIqKPlMF4NLmToFoWfg4Yie+xxsrptVV/D70QB3/VYvhviCun6ydKw4459miYiuvoZ X-Gm-Message-State: AOJu0YykwDIf55sMh51cOFHWw/rDmVmTd3sLk7jxzoAFHR9UBk3uXUB2 79koUasojQHHIO33g845dZpyt+vSwjZN5MT3LEnazdcWyQqbdR0XxC9jf55+RheNnpiaIzJWRPr FfFBi4yfnRIL3JW4zKs5yCHdu+Tm+6uytWH6d6wb8MWUguP/wdg== X-Received: by 2002:a05:620a:136f:b0:788:27f9:7769 with SMTP id d15-20020a05620a136f00b0078827f97769mr7636202qkl.20.1710154931416; Mon, 11 Mar 2024 04:02:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHelGdHq/xoWg8lx1gb9j6PhtIiBbPimBc9qTBVBcxyG4kY5Pd0pxDy4ahp64BST851DZsGUw== X-Received: by 2002:a05:620a:136f:b0:788:27f9:7769 with SMTP id d15-20020a05620a136f00b0078827f97769mr7636185qkl.20.1710154931153; Mon, 11 Mar 2024 04:02:11 -0700 (PDT) Received: from [192.168.100.30] ([82.142.8.70]) by smtp.gmail.com with ESMTPSA id 26-20020a05620a04da00b0078838695dfasm2557376qks.59.2024.03.11.04.02.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 11 Mar 2024 04:02:10 -0700 (PDT) Message-ID: Date: Mon, 11 Mar 2024 12:02:08 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 0/4] Some improvements to the tap send path To: David Gibson References: <20240308065325.2181322-1-david@gibson.dropbear.id.au> <348a52c9-7c07-4150-b594-4743c7775be6@redhat.com> From: Laurent Vivier In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Message-ID-Hash: T2FB3DHV2DLWEILLWA6UGBKTSYVNK73Z X-Message-ID-Hash: T2FB3DHV2DLWEILLWA6UGBKTSYVNK73Z 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: Stefano Brivio , passt-dev@passt.top 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: On 3/8/24 13:42, David Gibson wrote: > On Fri, Mar 08, 2024 at 09:18:48AM +0100, Laurent Vivier wrote: >> On 3/8/24 07:53, David Gibson wrote: >>> This series has a handful of small improvements to the tap send path. >>> See individual commit messages for the details. >>> >>> I expect this will conflict with Laurent's upcoming work. I hope the >>> conflicts won't be too bad, and indeed will set us up for less >>> duplication there in the end. >> >> I'm working on patch that devides TCP buffers in several buffers pointed out >> by an IOV arrays and then provided to tap_send_frames(). I'm going to base >> my patch on this series. >> >> The idea is: >> >> A frame is made with 4 iovecs: >> >> #define TCP_IOV_VNET 0 >> #define TCP_IOV_ETH 1 >> #define TCP_IOV_IP 2 >> #define TCP_IOV_PAYLOAD 3 >> #define TCP_IOV_NUM 4 >> typedef struct iovec tap_iovec_t[TCP_IOV_NUM]; > > General concept seems good. Unless you have a specific reason to do > so, I'd suggest keeping VNET and ETH - i.e. L2 and everything below it > - together. As well as just making one less buffer for each frame, I > think that will make life easier if we want to add an L2 interface > with non-Ethernet framing (e.g. "tun" instead of "tap"). > In fact keeping vnet header separated from eth header makes easier to remove it from the list to pass the iovec array to pcap functions and to pasta send function (can use iovec[1] and iovcount - 1). Thanks, Laurent