From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=none (p=none dis=none) header.from=gibson.dropbear.id.au Authentication-Results: passt.top; dkim=pass (2048-bit key; secure) header.d=gibson.dropbear.id.au header.i=@gibson.dropbear.id.au header.a=rsa-sha256 header.s=202410 header.b=oeTT2dbb; dkim-atps=neutral Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id 449E05A004F for ; Mon, 14 Oct 2024 07:02:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202410; t=1728882164; bh=gsPj5kLeteDi2Bz0HFMWaAPSSWMPRq65NnjL/4nQrYc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=oeTT2dbbu4BdVNXNBJjiPgZ17Vc7L2VKxNBEqGlBWngRZjhxffrP+fEVOKb+6NyTD 1SpPPp6Cm/1rNaKABMhupiKhV0PtZydPxrlCZJpeqjyUPd6rX5B29f6xtZ4cp07+V2 oLPQeox//QRRC/I2OmcZhg60oIhpo6n8W2PiJKEhuXmg1usnEx7W9Rxci6dPljgoQO jbjn64KTjQLh0tWbuPOZco5qZvbcPPry66BjqJlx3PGu//akp03K5NLo7IolwPzdPH HDr9Tj0PRSBPwc+h18isKqtKA1pM0qH5uamdePlKAdOGMkCAkEdeRIMUyFaDbup1Hd QxwM8+XYYkUyg== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4XRlTw2lXBz4xFb; Mon, 14 Oct 2024 16:02:44 +1100 (AEDT) Date: Mon, 14 Oct 2024 15:29:39 +1100 From: David Gibson To: Laurent Vivier Subject: Re: [PATCH v8 5/8] tcp: Export headers functions Message-ID: References: <20241010122903.1188992-1-lvivier@redhat.com> <20241010122903.1188992-6-lvivier@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="1JmeBqNiT0GkVwG1" Content-Disposition: inline In-Reply-To: <20241010122903.1188992-6-lvivier@redhat.com> Message-ID-Hash: ZPYVUDEFVFZDW6ZOG33MEOVAIP55J6JN X-Message-ID-Hash: ZPYVUDEFVFZDW6ZOG33MEOVAIP55J6JN 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: 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: --1JmeBqNiT0GkVwG1 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Oct 10, 2024 at 02:28:59PM +0200, Laurent Vivier wrote: > Export tcp_fill_headers[4|6]() and tcp_update_check_tcp[4|6](). >=20 > They'll be needed by vhost-user. >=20 > Signed-off-by: Laurent Vivier Reviewed-by: David Gibson > --- > tcp.c | 30 +++++++++++++++--------------- > tcp_internal.h | 15 +++++++++++++++ > 2 files changed, 30 insertions(+), 15 deletions(-) >=20 > diff --git a/tcp.c b/tcp.c > index 9617b7ac2404..eae02b1647e3 100644 > --- a/tcp.c > +++ b/tcp.c > @@ -761,9 +761,9 @@ static void tcp_sock_set_bufsize(const struct ctx *c,= int s) > * @iov_cnt: Length of the array > * @l4offset: IPv4 payload offset in the iovec array > */ > -static void tcp_update_check_tcp4(const struct iphdr *iph, > - const struct iovec *iov, int iov_cnt, > - size_t l4offset) > +void tcp_update_check_tcp4(const struct iphdr *iph, > + const struct iovec *iov, int iov_cnt, > + size_t l4offset) > { > uint16_t l4len =3D ntohs(iph->tot_len) - sizeof(struct iphdr); > struct in_addr saddr =3D { .s_addr =3D iph->saddr }; > @@ -813,9 +813,9 @@ static void tcp_update_check_tcp4(const struct iphdr = *iph, > * @iov_cnt: Length of the array > * @l4offset: IPv6 payload offset in the iovec array > */ > -static void tcp_update_check_tcp6(const struct ipv6hdr *ip6h, > - const struct iovec *iov, int iov_cnt, > - size_t l4offset) > +void tcp_update_check_tcp6(const struct ipv6hdr *ip6h, > + const struct iovec *iov, int iov_cnt, > + size_t l4offset) > { > uint16_t l4len =3D ntohs(ip6h->payload_len); > size_t check_ofs; > @@ -982,11 +982,11 @@ static void tcp_fill_header(struct tcphdr *th, > * > * Return: The IPv4 payload length, host order > */ > -static size_t tcp_fill_headers4(const struct tcp_tap_conn *conn, > - struct tap_hdr *taph, > - struct iphdr *iph, struct tcp_payload_t *bp, > - size_t dlen, const uint16_t *check, > - uint32_t seq, bool no_tcp_csum) > +size_t tcp_fill_headers4(const struct tcp_tap_conn *conn, > + struct tap_hdr *taph, > + struct iphdr *iph, struct tcp_payload_t *bp, > + size_t dlen, const uint16_t *check, > + uint32_t seq, bool no_tcp_csum) > { > const struct flowside *tapside =3D TAPFLOW(conn); > const struct in_addr *src4 =3D inany_v4(&tapside->oaddr); > @@ -1034,10 +1034,10 @@ static size_t tcp_fill_headers4(const struct tcp_= tap_conn *conn, > * > * Return: The IPv6 payload length, host order > */ > -static size_t tcp_fill_headers6(const struct tcp_tap_conn *conn, > - struct tap_hdr *taph, > - struct ipv6hdr *ip6h, struct tcp_payload_t *bp, > - size_t dlen, uint32_t seq, bool no_tcp_csum) > +size_t tcp_fill_headers6(const struct tcp_tap_conn *conn, > + struct tap_hdr *taph, > + struct ipv6hdr *ip6h, struct tcp_payload_t *bp, > + size_t dlen, uint32_t seq, bool no_tcp_csum) > { > const struct flowside *tapside =3D TAPFLOW(conn); > size_t l4len =3D dlen + sizeof(bp->th); > diff --git a/tcp_internal.h b/tcp_internal.h > index 2f74ffeff8f3..8e87f98b470f 100644 > --- a/tcp_internal.h > +++ b/tcp_internal.h > @@ -118,6 +118,21 @@ void tcp_rst_do(const struct ctx *c, struct tcp_tap_= conn *conn); > tcp_rst_do(c, conn); \ > } while (0) > =20 > +void tcp_update_check_tcp4(const struct iphdr *iph, > + const struct iovec *iov, int iov_cnt, > + size_t l4offset); > +void tcp_update_check_tcp6(const struct ipv6hdr *ip6h, > + const struct iovec *iov, int iov_cnt, > + size_t l4offset); > +size_t tcp_fill_headers4(const struct tcp_tap_conn *conn, > + struct tap_hdr *taph, > + struct iphdr *iph, struct tcp_payload_t *bp, > + size_t dlen, const uint16_t *check, > + uint32_t seq, bool no_tcp_csum); > +size_t tcp_fill_headers6(const struct tcp_tap_conn *conn, > + struct tap_hdr *taph, > + struct ipv6hdr *ip6h, struct tcp_payload_t *bp, > + size_t dlen, uint32_t seq, bool no_tcp_csum); > size_t tcp_l2_buf_fill_headers(const struct tcp_tap_conn *conn, > struct iovec *iov, size_t dlen, > const uint16_t *check, uint32_t seq, --=20 David Gibson (he or they) | 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 --1JmeBqNiT0GkVwG1 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmcMnjIACgkQzQJF27ox 2GfEZQ/+PatH7ZtUlE6ibH2ORlXDw/Uo/boF15nVOrwsf1IVzWcxACQaWSRNg5zX FolREEmgRY5RCxDBGlrVDXz/XZWZ1Yjf1APTk4ItKUMZQ4fN7VWqH5COyXrq986y DfD2Xzj+BINz9FwdS+sZN9lId8fJ2TehB6Xm3dgLNrY83vDvJSd0cDf7ypABBpnx NlLViTK434TgCZYyO7biY390HFC32C3A+hD6bbKYnNVgKhmvAWmo3K4ks5MIOTzJ GBH90k2Cuwe5il7KF9t61ANAE8sxiTxJCgceN8Twde0NEs9MTcj+niB9bEQcZptD Nzw1yFL/ls4D1UXkAVVklE9sFouZFtfE1ttZRRZdCxSEPdy7hfF+YUKIhzC6Jp0J 8ingdAC45gCORl/wUOqLKliKX89nNSEWkSC0vIvDKy5LY4Qm6rE6MTp/qJ6ZgA7r 10udU7pcsiyNv50hMYyNsOOJWuPUuuaxY/hZPlBzCujAhRJKSWmWMN56/YqxxPYn aupXZigf7fCyiXS4cf6lK2uzgGk9/s8o4KzI/crBDRslGLe/CWHDg3d3+BhIYPxR efD1Xrn7R76ecYlHv0M+kIXSAUVDgpBKBJdmmmgzcskL3XFo07jMNR397uDrvoTr 2tMGWyX5cERkL8FR+l6y03myoXxOj+WdzZS5qN19GYW+nhgXcLQ= =dN0H -----END PGP SIGNATURE----- --1JmeBqNiT0GkVwG1--