From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E28B618EAB; Fri, 18 Oct 2024 11:46:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729252012; cv=none; b=gL612YlC9PxlYlR0hM32A/KHOVHfapanYC8KQCtuLMHxSCodnGSmI8gjIB25bIayXqVOPff2QQuS53vvRnrBj3+FYXFqOSELuWz9j+hKEV45bfhgGZi08mJK/NuX5xzApMXQnfeoo+9GwSZtrkhbu+OFJwgjmPavp09jKag50cc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729252012; c=relaxed/simple; bh=Tap+F2W3Ssi+cAWL9Ejxi1kzzg/rP6w5KM09ct5EJYY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=u7zOoSzKMdWv1IVuLQteOwJv7zIT2ycCFxOr/qoUpHzn++3EwW9bJ6GUHeOOedbY887P+65uMfyuaD/1XvQxPIXpnB90IVNwIbqk00cxQ+QsxGybI3hicAIMOaiJQyVyvGmBZth3v77dsHuwmm5BxxlmUWC0zLRRf62evVTgI/s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=OrGLoVyc; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="OrGLoVyc" Received: by smtp.kernel.org (Postfix) with ESMTPSA id EB50DC4CEDC; Fri, 18 Oct 2024 11:46:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1729252011; bh=Tap+F2W3Ssi+cAWL9Ejxi1kzzg/rP6w5KM09ct5EJYY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=OrGLoVycK0lj36hWTCjj9p5YXTzEVLmP7vMNIgvi3uNAXgtl+J/fGEARh7coIO+eE QxcaLAcvPokA0Edda1/HDBW5YEhLFOgwwBcN1AAJ5oPcBNp2TT7Dv286kVPEDoBJOL FnT//vVNWslz/xC70u9wAofjaNt8hdZ2shmSHsMLgktWZtKvQ3OGuR7bl0MZX3ouQS mTCh3LIEROTql6Xr5DsaYp1fNyVKW30M4ZLrVyEIyHTHr5XTtmbs5IbJFZbuki38da swmpVNqPsYbHTjNtDNWR2HWT1+l4LrUdNytQobCnMcK2kFDD/6TmoTCGDRhHkYT7d1 GAi2JYfCLhWFw== Date: Fri, 18 Oct 2024 12:46:46 +0100 From: Simon Horman To: =?utf-8?Q?Asbj=C3=B8rn_Sloth_T=C3=B8nnesen?= Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , David Ahern , Matthieu Baerts , Mat Martineau , Geliang Tang , Donald Hunter , netdev@vger.kernel.org, mptcp@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next v2] tools: ynl-gen: use big-endian netlink attribute types Message-ID: <20241018114646.GH1697@kernel.org> References: <20241017094704.3222173-1-ast@fiberby.net> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20241017094704.3222173-1-ast@fiberby.net> On Thu, Oct 17, 2024 at 09:47:02AM +0000, Asbjørn Sloth Tønnesen wrote: > Change ynl-gen-c.py to use NLA_BE16 and NLA_BE32 types to represent > big-endian u16 and u32 ynl types. > > Doing this enables those attributes to have range checks applied, as > the validator will then convert to host endianness prior to validation. > > The autogenerated kernel/uapi code have been regenerated by running: > ./tools/net/ynl/ynl-regen.sh -f > > This changes the policy types of the following attributes: > > FOU_ATTR_PORT (NLA_U16 -> NLA_BE16) > FOU_ATTR_PEER_PORT (NLA_U16 -> NLA_BE16) > These two are used with nla_get_be16/nla_put_be16(). > > MPTCP_PM_ADDR_ATTR_ADDR4 (NLA_U32 -> NLA_BE32) > This one is used with nla_get_in_addr/nla_put_in_addr(), > which uses nla_get_be32/nla_put_be32(). > > IOWs the generated changes are AFAICT aligned with their implementations. > > The generated userspace code remains identical, and have been verified > by comparing the output generated by the following command: > make -C tools/net/ynl/generated > > Signed-off-by: Asbjørn Sloth Tønnesen > > --- > Changelog: > > v2: > - Re-implement to avoid adding a new Type attribute (Requested by Jakub). > > v1: https://lore.kernel.org/netdev/20240913085555.134788-1-ast@fiberby.net/ Thanks for addressing Jakub's review of v1. Reviewed-by: Simon Horman