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 86B30249E4 for ; Fri, 26 Jan 2024 21:14:46 +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=1706303686; cv=none; b=bvZu4kWg7dEbD8UCE56PAdbsbM+UuecYE5MZByjlCBC3RR/Zv6Lk3eIkV8WDt1/2aIi84Qh/TdGRvfc7j5UjOIBzo2RmPMp2wvsRUDHF85hXNiBj9UXI33Ym9pWX6l95TwHGUOHi3FfDMOxpC1nO+FgL7NokOTgHL+yHrchEhV4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706303686; c=relaxed/simple; bh=ddgyhT5l8a4neWPXdkQQmIhRJQzuqcyyjo3CnbGfr5w=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=STpGzgAaXMeCbPCWw79vvdF63pGzFXSGmhMSuoWRQIp79e1F1qiEcTsLvnPQ+OvEbzFfOCqKRG/J4dRB+PIKDG6WMk10IUaShIPEwQcnEI5ju24DPtEVOw4h56S3sKDeJq68j15i3ap/s7fH7xfXQsbH9IHu/n1lh/Dv5DLUeKo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=t5c2XL7h; 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="t5c2XL7h" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 02D09C43394; Fri, 26 Jan 2024 21:14:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706303686; bh=ddgyhT5l8a4neWPXdkQQmIhRJQzuqcyyjo3CnbGfr5w=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=t5c2XL7h9VsfkT5jNccVWizIEAR6YjRJDYbaodzTn82njxdZl8Kzj2lT7rVCSlNEo af5dAqH0wA4QNUS87t9gL1E2vnBh/EeD3AqTSxDeimKvr4imeFYTID3EbtD+IK8mQT PF1+uD51DgyldhwTnSxTgtHzgi2uB9oBw3Wjbn6EM/h/5vvISBaMAkyZIGnN7biF7t aBktub+0Il0RhdBKBczC/VNwnTbnhTU3Ry7jeveIP5QCldqBSNzyzM6YthmrbGlgUM hw9tCZsqPf0Oqu+z3NoXC5dKfBkIcZp528eCeZvyhte8+sMk1HcHwP+iFZmF3AUBWI VCrJJr1vWLYiw== Date: Fri, 26 Jan 2024 21:14:41 +0000 From: Simon Horman To: Alessandro Marcolini Cc: jhs@mojatatu.com, xiyou.wangcong@gmail.com, jiri@resnulli.us, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org Subject: Re: [PATCH v3 net-next] taprio: validate TCA_TAPRIO_ATTR_FLAGS through policy instead of open-coding Message-ID: <20240126211441.GF401354@kernel.org> References: <20240125165942.37920-1-alessandromarcolini99@gmail.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240125165942.37920-1-alessandromarcolini99@gmail.com> On Thu, Jan 25, 2024 at 05:59:42PM +0100, Alessandro Marcolini wrote: > As of now, the field TCA_TAPRIO_ATTR_FLAGS is being validated by manually > checking its value, using the function taprio_flags_valid(). > > With this patch, the field will be validated through the netlink policy > NLA_POLICY_MASK, where the mask is defined by TAPRIO_SUPPORTED_FLAGS. > The mutual exclusivity of the two flags TCA_TAPRIO_ATTR_FLAG_FULL_OFFLOAD > and TCA_TAPRIO_ATTR_FLAG_TXTIME_ASSIST is still checked manually. > > Changes since RFC: > - fixed reversed xmas tree > - use NL_SET_ERR_MSG_MOD() for both invalid configuration > > Changes since v1: > - Changed NL_SET_ERR_MSG_MOD to NL_SET_ERR_MSG_ATTR when wrong flags > issued > - Changed __u32 to u32 > > Changes since v2: > - Added the missing parameter for NL_SET_ERR_MSG_ATTR (sorry again for > the noise) > > Signed-off-by: Alessandro Marcolini > --- Thanks for the updates. Reviewed-by: Simon Horman For reference, and I don't think it's probably not necessary to repost because of this, these days it is normal to put the Changes below the scissors (---). This means they don't end up in the git history. But now we have lore that seems to be less of an issue.