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.129.124]) by passt.top (Postfix) with ESMTP id DFA135A026F for ; Tue, 27 Feb 2024 15:24:36 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1709043875; 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=36HcZSH46L/pVjU7KWkcE1YYfFqobw3Nz+t17MTFShI=; b=i1QIH9Ep9OKP6mOLGSrhCRiz/IsqsyR2a3Dzzi8nb/BqwpwlmJsFVz7aN6YO/b8+mWfbMX G+1pFSD814JUE+x+AvnUSPztoMMkBnKZnvb5FYHprTXToBQClXoqHS2dM+18ApB+CkKeN0 IdhMprZQpoFZN/DWdAAAzofUOG66f8s= Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-389-KzXcaEJaPiqbRQiTSWpOgA-1; Tue, 27 Feb 2024 09:24:34 -0500 X-MC-Unique: KzXcaEJaPiqbRQiTSWpOgA-1 Received: by mail-ej1-f70.google.com with SMTP id a640c23a62f3a-a3f84b660b8so280447966b.0 for ; Tue, 27 Feb 2024 06:24:34 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709043872; x=1709648672; h=content-transfer-encoding:mime-version:organization:references :in-reply-to:message-id:subject:cc:to:from:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=36HcZSH46L/pVjU7KWkcE1YYfFqobw3Nz+t17MTFShI=; b=FjcUI5/dX5cyQRELEbADFN2dqS2NC2kzxicO+nXnUN7kLz0I8EukpsLVpNtUsGFKmz k9FlM4xl5IQg5yOOHexY2TRpy7zKGPNZCJ81enAJJ2RUwECQM6Pe00f1B2WOc5EYRdLg 6FszH2x1QbO38RUiew5s/ul9YlSeZVCQZDrsj3kwhLofYEGq0T8iList9uAqJ4Pn3xDF q/axaEir/wj9+DdWxkfva/dg4PpvmiiaHhqaeQXmKNRwEzJvC2n/Ug9PnwSpMBhZzIok GLIHhhuZOpdQxuxCajyIiHhqvbnWIlElkkOBc7MB0AfqJ6Fv5L+BMFvd9UncmMtqmjxe S4ig== X-Gm-Message-State: AOJu0YxHi/3W6orOMTa22ZSqmxMnHHdzkyRvLCLBhDCIDiDmluZReWCd sIgvfXXF7s3sNwmkNYywgdEGPRWWaubRmK1fQM47570OpA4SrFd6Frc7kx0nOkFnnwJ8hQzrhSX h+idNKpWeUUarl7kOWr2bwqHB6iURJCwhyL1g3wXwUnHm4HwNwcliFFFvfhXK X-Received: by 2002:a17:906:6895:b0:a43:7252:4017 with SMTP id n21-20020a170906689500b00a4372524017mr2953623ejr.77.1709043872803; Tue, 27 Feb 2024 06:24:32 -0800 (PST) X-Google-Smtp-Source: AGHT+IGy1332B7mlNxhcUzE5h3DVRn3pc3v1mK92njHHyy1BqXzUT8JSGZn7BoRKRtJKAZM3+UMmWQ== X-Received: by 2002:a17:906:6895:b0:a43:7252:4017 with SMTP id n21-20020a170906689500b00a4372524017mr2953613ejr.77.1709043872586; Tue, 27 Feb 2024 06:24:32 -0800 (PST) Received: from maya.cloud.tilaa.com (maya.cloud.tilaa.com. [164.138.29.33]) by smtp.gmail.com with ESMTPSA id vu11-20020a170907a64b00b00a43d4730679sm184725ejc.47.2024.02.27.06.24.31 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Feb 2024 06:24:32 -0800 (PST) Date: Tue, 27 Feb 2024 15:23:58 +0100 From: Stefano Brivio To: David Gibson Subject: Re: [PATCH 2/6] pcap: Update pcap_frame() to take an iovec and offset Message-ID: <20240227152358.4550cbfa@elisabeth> In-Reply-To: <20240222055602.1872516-3-david@gibson.dropbear.id.au> References: <20240222055602.1872516-1-david@gibson.dropbear.id.au> <20240222055602.1872516-3-david@gibson.dropbear.id.au> Organization: Red Hat X-Mailer: Claws Mail 4.2.0 (GTK 3.24.36; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: FJZGUYXWPGASPSMDZI2RC62IZJLFABXW X-Message-ID-Hash: FJZGUYXWPGASPSMDZI2RC62IZJLFABXW X-MailFrom: sbrivio@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: passt-dev@passt.top, Laurent Vivier 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 Thu, 22 Feb 2024 16:55:58 +1100 David Gibson wrote: > Update the low-level helper pcap_frame() to take a struct iovec and > offset within it, rather than an explicit pointer and length for the > frame. This moves the handling of an offset (to skip vnet_len) from > pcap_multiple() to pcap_frame(). > > This doesn't accomplish a great deal immediately, but will make > subsequent changes easier. > > Signed-off-by: David Gibson > --- > pcap.c | 29 ++++++++++++----------------- > 1 file changed, 12 insertions(+), 17 deletions(-) > > diff --git a/pcap.c b/pcap.c > index 501d52d4..8876a051 100644 > --- a/pcap.c > +++ b/pcap.c > @@ -67,24 +67,25 @@ struct pcap_pkthdr { > > /** > * pcap_frame() - Capture a single frame to pcap file with given timestamp > - * @pkt: Pointer to data buffer, including L2 headers > - * @len: L2 packet length > + * @iov: iovec referencing buffer containing frame (with L2 headers) For consistency with, say, 1/6: "IO vector" -- Stefano