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 9D7635A027A for ; Wed, 29 Nov 2023 14:58:50 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1701266329; 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=vd3KodOk4quLXdhhYn576JmkU1FcCA2sGUk7Nhl5q1s=; b=dZk8ic3CBRwoLPc6ILbvlpsnd3I7bpqTuJ9k/fOIGv/LdY3d73dY7TgU7k0X34QP7z2AN+ 87MSpAALkj2brcJBxLacnS9RXNTGtacQVSRl8gXRyPh8znMhQqBGoH5NY8djjDT83GaDdn oRv6CnBVmMNbvN4kkE6pCP8PAhwgDKc= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-651-FMVYHMfPPe2QOAUrmLx_Eg-1; Wed, 29 Nov 2023 08:58:46 -0500 X-MC-Unique: FMVYHMfPPe2QOAUrmLx_Eg-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7E9791C0BB43; Wed, 29 Nov 2023 13:58:46 +0000 (UTC) Received: from elisabeth (unknown [10.39.208.34]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7B09540C6EBF; Wed, 29 Nov 2023 13:58:44 +0000 (UTC) Date: Wed, 29 Nov 2023 14:58:42 +0100 From: Stefano Brivio To: David Gibson Subject: Re: [PATCH 3/4] tcp, tcp_splice: CONN_IDX subtraction of pointers isn't always long Message-ID: <20231129145842.5ed82f48@elisabeth> In-Reply-To: <20231129134610.3796809-4-sbrivio@redhat.com> References: <20231129134610.3796809-1-sbrivio@redhat.com> <20231129134610.3796809-4-sbrivio@redhat.com> Organization: Red Hat MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: FTXN2HHW2OQEDRDHCICZOAPAPLWPKIH7 X-Message-ID-Hash: FTXN2HHW2OQEDRDHCICZOAPAPLWPKIH7 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: lemmi@nerd2nerd.org, 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 Wed, 29 Nov 2023 14:46:09 +0100 Stefano Brivio wrote: > On 32-bit architectures, it's a regular int. C99 introduced ptrdiff_t > for this case, with a matching length modifier, 't'. > > Signed-off-by: Stefano Brivio > --- > tcp.c | 39 +++++++++++++++++++++------------------ > tcp_splice.c | 14 +++++++------- > 2 files changed, 28 insertions(+), 25 deletions(-) > > diff --git a/tcp.c b/tcp.c > index 44468ca..c32c9cb 100644 > --- a/tcp.c > +++ b/tcp.c > @@ -727,7 +727,7 @@ static void tcp_timer_ctl(const struct ctx *c, struct tcp_tap_conn *conn) > it.it_value.tv_sec = ACT_TIMEOUT; > } > > - debug("TCP: index %li, timer expires in %lu.%03lus", CONN_IDX(conn), > + debug("TCP: index %ti, timer expires in %lu.%03lus", CONN_IDX(conn), > > [...] Oops, I just realised this clashes with your "[PATCH v2 03/11] flow, tcp: Consolidate flow pointer<->index helpers". There, however, I guess that the new flow_idx() should return ptrdiff_t, which is signed. I can drop this patch if you re-spin it (assuming it makes sense to you), or I can adapt it on top of your patch -- whatever is most convenient for you. -- Stefano