From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gandalf.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id 12F655A026F for ; Wed, 6 Mar 2024 04:23:39 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202312; t=1709695414; bh=WyAmNqLUCXMDEGAp9R6UKeRUWu5eb7Kp20FR6O7vOag=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=gw6iuclRtbQybZbx053BXuefW8p+soK6t0tNKtwEV493PQaD1O6Dd8UEv1GKt8t4V pg75NbCuBWl75sQ+zMUNJu0oAFa5EwTphyk3JizIy4HlSEkmNVrK/HqtgQY3A2/7Zo 4lE6xZNDLs/WodXj8zb8Y0gUfS0bpSiq5BjDbpznv2wT0gB3cHRmRa8Mox+3D/WkP9 jrYLAEKoMRcGTtLdEr8OVQ5cctsCg3erPKsn0aHnpoRzngY1/WW+6VCrrjtkVeD8/u s0zDH+vwEpUyfitJunprGGbS2ZhSOrKmwZAastkTQl3RGYAdN9ZsmwC/cZkFcRMMP6 gsHlbW8FlSNqw== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4TqHny5TKCz4wcF; Wed, 6 Mar 2024 14:23:34 +1100 (AEDT) Date: Wed, 6 Mar 2024 14:22:44 +1100 From: David Gibson To: Stefano Brivio Subject: Re: [PATCH v5 0/9] Add vhost-user support to passt (part 1) Message-ID: References: <20240303135114.1023026-1-lvivier@redhat.com> <20240305231218.149e80a1@elisabeth> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="juWq9nXwsex72myH" Content-Disposition: inline In-Reply-To: <20240305231218.149e80a1@elisabeth> Message-ID-Hash: 7CKPEGORZXRKOK7KYKOIPWX73CN2ROTM X-Message-ID-Hash: 7CKPEGORZXRKOK7KYKOIPWX73CN2ROTM 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: Laurent Vivier , 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: --juWq9nXwsex72myH Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Mar 05, 2024 at 11:12:18PM +0100, Stefano Brivio wrote: > On Sun, 3 Mar 2024 14:51:05 +0100 > Laurent Vivier wrote: >=20 > > v5: > > - add a patch to cleanup before change: > > udp: little cleanup in udp_update_hdrX() to prepare future changes > > - see detailed v5 history log in each patch >=20 > I'm about to apply this, but cppcheck (2.10) tells me (with make > cppcheck): >=20 > checksum.c:195:33: style: inconclusive: Function 'csum_icmp4' argument 1 = names different: declaration 'ih' definition 'icmp4hr'. [funcArgNamesDiffer= ent] > void csum_icmp4(struct icmphdr *icmp4hr, const void *payload, size_t len) > ^ > checksum.h:23:33: note: Function 'csum_icmp4' argument 1 names different:= declaration 'ih' definition 'icmp4hr'. > void csum_icmp4(struct icmphdr *ih, const void *payload, size_t len); > ^ > checksum.c:195:33: note: Function 'csum_icmp4' argument 1 names different= : declaration 'ih' definition 'icmp4hr'. > void csum_icmp4(struct icmphdr *icmp4hr, const void *payload, size_t len) > ^ > pcap.c:145:47: style: inconclusive: Function 'pcap_iov' argument 2 names = different: declaration 'n' definition 'iovcnt'. [funcArgNamesDifferent] > void pcap_iov(const struct iovec *iov, size_t iovcnt) > ^ > pcap.h:12:47: note: Function 'pcap_iov' argument 2 names different: decla= ration 'n' definition 'iovcnt'. > void pcap_iov(const struct iovec *iov, size_t n); > ^ > pcap.c:145:47: note: Function 'pcap_iov' argument 2 names different: decl= aration 'n' definition 'iovcnt'. > void pcap_iov(const struct iovec *iov, size_t iovcnt) > ^ > tcp.c:947:45: error: Expression 'tlen,IPPROTO_TCP,(struct in_addr){.s_add= r=3Diph->saddr},(struct in_addr){.s_addr=3Diph->daddr}' depends on order of= evaluation of side effects [unknownEvaluationOrder] > (struct in_addr){ .s_addr =3D iph->saddr }, > ^ > checksum.c:506:0: style: The function 'csum_iov' is never used. [unusedFu= nction] > uint16_t csum_iov(struct iovec *iov, size_t n, uint32_t init) > ^ > pcap.c:145:0: style: The function 'pcap_iov' is never used. [unusedFuncti= on] > void pcap_iov(const struct iovec *iov, size_t iovcnt) > ^ > iov.c:150:0: information: Unmatched suppression: unusedFunction [unmatche= dSuppression] > size_t iov_size(const struct iovec *iov, size_t iov_cnt) > ^ >=20 > they are almost all trivial and I plan to fix them up on merge, but I > still have to look into the initialisation in tcp_update_check_tcp4() > (tcp.c:947:45). I'm pretty sure this is a false positive from cppcheck: I think it's misinterpreting this (initializer in struct literal) as an assignment expression. Since there are then two apparent assignments to the same apparent target, we have that warning. The obvious workaround to me is to introduce a couple of struct in_addr typed temporaries, instead of using struct literals. I think that's kind of more readable anyway. --=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 --juWq9nXwsex72myH Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmXn4X8ACgkQzQJF27ox 2GesZA/8CGZ66R8BKz7ze7zrfHJ9tJvgI/3FVEYzL4ArPwuQqSHW5mdWOCf6G97A 72zrytae6MvsBTiaJ1k1AnPG9AgalFcvhwQWEIIK3OCwgfFI8AQ9DbTxKGJBcQWo LS7T9/xbe53RHDXCGxS9W0N5tAbw515BQLmy5rDLojWu4wiuMALcZ52L2X2DztAi jUm3jdjHQeEP2OJ46tB+egtXiL6Uh1ETabJ9nzfPOATGjnm2r86SR82WDHinYMup 7UWv0ebbEL7bO6rUnI0qP9fp1o+N0nI5yo8P0pMHUFD5ah+gFHbpIFmD3aomlHOp mMDWpERS53P1AGWOOHnF8Fey1yi3vC0e+oZ7BOpIhXD9X71j4UC0P0Mly+ps9e8G Cy92FRYZCGzZgRtiOajFJeAFlWQCA8ZwiYmu7jJSjoGHt1aIuhtgscTasEBqoCID gFr04SZA50v045/ZPkTiJiqinGRKxVblhnbrtPyl8Z3bMy2RzoDjbVQAdXFzEHa8 fAseDvlPWgFejjVtg3qqYf/4aYKh7RbMA7uiARxM8nux8Xnpz83DXAMvENhaHjZw hQZ8S8MuYPQdaqeup13YY84TjPBCDyAF552TIhz3SxpdnkUmyh4kd57FfcEKqboJ LmcBCm9Eq61jdqFDA50yl1E/ehKFGO+WPVrlGhqI61iW53ZLD5M= =xSQG -----END PGP SIGNATURE----- --juWq9nXwsex72myH--