Subject: Re: [PATCH next-next v2] net:mctp: fix setting mctp hdr ver reserved field cause data dropped

From: Jakub Kicinski <[email-masked]>
Date: Fri, 10 Apr 2026 14:43:39 -0700

On Fri, 10 Apr 2026 14:33:34 +0800 wit_yuan wrote:
> From: Yuan Zhaoming <[email-masked]>
> 
> from spec dsp0236_1.2.1.pdf page 26, the mctp header contains the
> RSVD(4bit) and Hdr version(4 bit).
> 
> mctp_pkttype_receive invoke mctp_hdr, and get mh->ver whole byte 
> compare the MCTP_VER_MIN, MCTP_VER_MAX. the reserver bits may be by 
> misleading used.
> 
> one type hba card will set pcie vdm header Pad Len the same with RSVD
> bit, this will not work on mctp kernel solution.

We ask that:
 - new patches are not posted in reply to old ones
 - at least 24h passes before new version is posted

> +	if (((mh->ver & MCTP_HDR_VER_MASK)) < MCTP_VER_MIN || (mh->ver & MCTP_HDR_VER_MASK) > MCTP_VER_MAX)
>  		goto out;

Please save the masked version to a variable and compare that extracted
variable. This line is unnecessarily long (max line length is 80 in
networking).
-- 
pw-bot: cr