From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: passt.top; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=I8Sm7zIb; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by passt.top (Postfix) with ESMTPS id C195F5A0282 for ; Mon, 02 Jun 2025 15:35:59 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1748871358; 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=MA10tmmxFHju0i1OgOMWheGqA6g8rmNomPlXxm6Ox4Q=; b=I8Sm7zIbF9AAXI9WJpdA6alSlE/F+L40xlO4u6d4RcqDLPuPgvWfGatCzUqa7tI7C+7+fA OoirbLC+PELnHhXoJ8n7wwA56ipfWInftmZGb3dBjerknbHvGqZcXUCJ2nh0mly8RnADKa 7XVl5aBep2bFwGLwSD1o8Mj/fmnmacU= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-636-ETz_2lNwOGCCxCACboRgPQ-1; Mon, 02 Jun 2025 09:35:57 -0400 X-MC-Unique: ETz_2lNwOGCCxCACboRgPQ-1 X-Mimecast-MFC-AGG-ID: ETz_2lNwOGCCxCACboRgPQ_1748871356 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-450cb8f8b1bso11030215e9.3 for ; Mon, 02 Jun 2025 06:35:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748871356; x=1749476156; 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=MA10tmmxFHju0i1OgOMWheGqA6g8rmNomPlXxm6Ox4Q=; b=En19ifCu4k5JOhNfDOTM7QTMFVSer7c7xdZYJQZ/owXj+oprWrzinIxPWxNhQq8hoO VG3mAS0q+yrRQPWGlumxq+WZi7QnK7Ru4tOBbSlz79VcXbbR8h1bmjT4Q9qdPDBlC8pn GBEoPuFJbS33oA2UITsrChuofWqSyNLIk6UO7Nqzwz/LaTtFNQ0kMGYH9exiTo9sR/OC obplG3HU/mAb7b+kfHJm27uvRCaMJxrt/OCRWMHF8K+WPQLRw1SH99LIb3HTj5xRFhDp NpS/6ockwTvMG0hYpciCwzrBQeiHy1qMpoW8zpSQkbMCKx8rCVn0buo3qoy+HychLNne VhYA== X-Gm-Message-State: AOJu0YwOMe73ZNBBvOyPq/Tt2pmBngefkRW3uxfBoY6yKXmL4yL6CKCk ZB3/ziEBjLm7eWvXLvVsUYRR/NtBh/88A8tSce6HoYAK0a88j2e/3iRP/IDjxNtB1yoQvaWLoBh DQqBODJ1moS3ROCnPTlXupF5ZBYbMEJ7MpHq8Sx/KcxzXtL1EMGOhSjD3hwXgfvV3Xl5C9Yzeoy ACZs7ojsxX9q4NvXqktCrodfQI3bXSeA8etuWM X-Gm-Gg: ASbGncuvOdfDNYKStFMQ4/nXMt9CZm+yn5GSUUnUAzcd0+uhafT0/EFsPxwREpSb8Zl uaOXdQbMz3WwL+9WgZYJdUAKsQ8t74MSzziyz7y+nTKH2OvAWA0+8iyz0FfXO+ie1RVMsPs6Gvy 2YCJ2+pyrBbcLpdbwF8zoyPl6Xd6BNwzqJ/zzHh8JneD5efEO+AvHbFmroGDniLyJ5MQGQULyqv 1bCu9vln9NWVvDdyVzbgAhypu9XZGSRxcSQDgbXvqRfYJHVgiDuP5YeZ1VFsua5MrxRHl6y5iV4 v/YFdcXdFn698ZG/LYacXsc= X-Received: by 2002:a05:600c:3f08:b0:43d:17f1:2640 with SMTP id 5b1f17b1804b1-4511edf2926mr62457605e9.26.1748871355839; Mon, 02 Jun 2025 06:35:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFrjH6js6+kx+7UPwJ6/LWWW6zZsAOTRFM86uALimAA0AJiYBZQoRC0xRvSxMm6At5kJVzBYQ== X-Received: by 2002:a05:600c:3f08:b0:43d:17f1:2640 with SMTP id 5b1f17b1804b1-4511edf2926mr62457385e9.26.1748871355412; Mon, 02 Jun 2025 06:35:55 -0700 (PDT) Received: from maya.myfinge.rs (ifcgrfdd.trafficplex.cloud. [2a10:fc81:a806:d6a9::1]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a4efe73f3csm14700103f8f.42.2025.06.02.06.35.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Jun 2025 06:35:55 -0700 (PDT) Date: Mon, 2 Jun 2025 15:35:53 +0200 From: Stefano Brivio To: Laurent Vivier Subject: Re: [PATCH v5 02/29] iov: Introduce iov_slice(), iov_tail_slice() and iov_tail_drop(). Message-ID: <20250602153553.7c7336fb@elisabeth> In-Reply-To: References: <20250417165136.2688884-1-lvivier@redhat.com> <20250417165136.2688884-3-lvivier@redhat.com> <20250526161903.170771ca@elisabeth> Organization: Red Hat X-Mailer: Claws Mail 4.2.0 (GTK 3.24.49; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: fHxcLkGcrF29Ebg6xgKtI3bwpp7XEe-0xyffxqeYx_s_1748871356 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: RG2YMOD4SZVKCWYJAPJ5IDWIGBJDDSSU X-Message-ID-Hash: RG2YMOD4SZVKCWYJAPJ5IDWIGBJDDSSU 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 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 Mon, 26 May 2025 17:20:58 +0200 Laurent Vivier wrote: > On 26/05/2025 16:19, Stefano Brivio wrote: > >> + * @dst_iov_cnt: Maximum number of elements in the destination iov array. > >> + * @iov: Pointer to the source array of struct iovec describing > >> + * the scatter/gather I/O vector to copy from. > >> + * @iov_cnt: Maximum number of elements in the source iov array. > >> + * @offset: Offset within the source iov from where copying should start. > > I would mention explicitly this is only for the first iov, otherwise it > > might look like it's a fixed offset that applies to all elements > > (...until you find the offset = 0 assignment below), say: > > It's not an offset for the first iov, it's offset in the entire data. ...well, yes, that's what I meant, in the entire data, but not _for each element_ (that is, if the source iov has two items, and @offset is 5, we skip 5 bytes in total, not 10 bytes). Given that the first iov is the first iov of the entire data, one could also say that it applies to the first iov (assuming we mean the same thing). Hence the possible confusion. However: > We skip this offset using: > > i = iov_skip_bytes(iov, iov_cnt, offset, &offset); > > so we skip all iov entries until 'i' and then we apply the remaining offset to entry 'i'. > > Perhaps: > > @offset: Data offset within the source iov array from where copying should start that's much clearer and I'd say unambiguous, yes. -- Stefano