# \[PATCH v2\] Add payload to be 32-bit aligned to fix dropped packets

- From: Jakub Kicinski \<kuba@kernel.org\>
- Date: 2021-10-19 14:52:44 
- List: linux-aspeed
- Page: https://ratatoskr.run/linux-aspeed/2021/10/11213875
- Thread: https://ratatoskr.run/netdev/2021/10/11213873/t.md

```text
On Tue, 19 Oct 2021 20:11:27 +0530 Kumar Thangavel wrote:
>  	len += sizeof(struct ncsi_cmd_pkt_hdr) + 4;
> -	if (nca->payload < 26)
> +	payload = ALIGN(nca->payload, 4)
> +	if (payload < 26)
>  		len += 26;
>  	else
> -		len += nca->payload;
> +		len += payload;

You round up to 4 and then add 26 if the result is smaller.  26 is not
a multiple of 4. Is this intentional?

Also you can write this on one line:

	len += max(payload, 26);
```
