From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gandalf.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id 883AC5A027A for ; Thu, 30 Nov 2023 01:55:10 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=201602; t=1701305703; bh=7MiVBWhDvviwCJO8auACD73cz2tXMEwG/BchlWiiVZg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=I21gVQ6ljzPRCAz8WFlF1DA3KVnCtjjcXXbwPLVv9hlOX6qtoBGUdnLoZR21OoAKs dpYOi+hQPZ5Ht5lCdfNlxnmB01ZkPTzAlTaX1oLHI8zbYyw6QA5AaZUrMT5JfkZq4l vCWNU8fYRoniSij1fa1+nLs1Zxgc3cW6Oo5DRnu0= Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4Sgd5M3X4zz4xWH; Thu, 30 Nov 2023 11:55:03 +1100 (AEDT) Date: Thu, 30 Nov 2023 11:27:21 +1100 From: David Gibson To: Stefano Brivio Subject: Re: [PATCH 3/4] tcp, tcp_splice: CONN_IDX subtraction of pointers isn't always long Message-ID: References: <20231129134610.3796809-1-sbrivio@redhat.com> <20231129134610.3796809-4-sbrivio@redhat.com> <20231129145842.5ed82f48@elisabeth> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="vJM8T+W0BU8r40u5" Content-Disposition: inline In-Reply-To: <20231129145842.5ed82f48@elisabeth> Message-ID-Hash: CKXPOAEMZN5UBCCXJSRLVMC3ISO2TK6Y X-Message-ID-Hash: CKXPOAEMZN5UBCCXJSRLVMC3ISO2TK6Y X-MailFrom: dgibson@gandalf.ozlabs.org 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: --vJM8T+W0BU8r40u5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Nov 29, 2023 at 02:58:42PM +0100, Stefano Brivio wrote: > On Wed, 29 Nov 2023 14:46:09 +0100 > Stefano Brivio wrote: >=20 > > On 32-bit architectures, it's a regular int. C99 introduced ptrdiff_t > > for this case, with a matching length modifier, 't'. > >=20 > > Signed-off-by: Stefano Brivio > > --- > > tcp.c | 39 +++++++++++++++++++++------------------ > > tcp_splice.c | 14 +++++++------- > > 2 files changed, 28 insertions(+), 25 deletions(-) > >=20 > > 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, stru= ct tcp_tap_conn *conn) > > it.it_value.tv_sec =3D ACT_TIMEOUT; > > } > > =20 > > - debug("TCP: index %li, timer expires in %lu.%03lus", CONN_IDX(conn), > > + debug("TCP: index %ti, timer expires in %lu.%03lus", CONN_IDX(conn), > > > > [...] >=20 > Oops, I just realised this clashes with your "[PATCH v2 03/11] flow, > tcp: Consolidate flow pointer<->index helpers". And then a bunch will be obsoleted by "flow, tcp: Add logging helpers for connection related messages". > There, however, I guess that the new flow_idx() should return ptrdiff_t, > which is signed. Actually, no, I don't think so. Yes the expression that generates it is naturally of type ptrdiff_t. But it's a bug to call flow_idx() on something not in the flow table, and places where we want to pass *in* a flow table index it makes more sense for it to be unsigned. So I think flow indices should be unsigned throughout. > 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. I have a couple of reasons to re-spin anyway. So how about you drop this, and I'll double check that I get the format specifiers sane after my series? --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --vJM8T+W0BU8r40u5 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmVn1ugACgkQzQJF27ox 2GfuFhAAngl0bkG7cG4ncQwfc9b09GtSo9LwO2FLpxfa7+n9/44NWkAQv0sgnyZ3 BAINq22DN/OeejPUuCVhEfv4OCQc+ANcvDYiqYfbo/bkKgIJ1aOS2gHvmponrVf9 NaGeK90ke9GR5ABfTR2lDOGRr9Qjq87cy8FM5+m96uqBVzpo3WzdN5t2h6JxN6Ny ZrGBSXWFOmd8Wo2DAcqMcReqGStcv2HzuQ4pEigaJqsMmTTjea4KDRsMHmZRidnj LTmUzAvTX/YV4w5SEg4Dy0u6L2E+ZWszd3G/SdOSTdm+CRPJvpMMkmjWn5WRrmYa qRr+CpWptCsVQ81GHD43C4KuwDsJnmsYqQIADRMWaZxzTFCvTj3/5jmGhiAmLtzB WVwGlDQZ+azUCAq69UCBP5m57mxHhU6pcvp5KsTywgBpinptLtEbeOBGP4Ysr495 dBw815IsLp3dJQQ27TPkrsqWA3mOPJsSzCIRL8pbsyFLPhe4H5BTQ65aKL43NP5c mmLoHwF8rcaEBCONY//GHnfLGkPgDOcRyUY+MPo63GBfPCJOqIsUbaFLS4wx5mHX S8SnfNfDTQgwM7qcPUCWaYaX2qRFfHXCq1jDEz1BIMycE/5A7GHzZgM+xb9E9QCy eGsC0Nvwkj+EyImiRXLgXJlplONlww0itNeZOqpK7KpcV5839uA= =kYDz -----END PGP SIGNATURE----- --vJM8T+W0BU8r40u5--