[PATCH net v4] net: airoha: Add missing filed to ppe_mbox_data struct

Jacob Keller jacob.e.keller at intel.com
Tue Apr 29 13:09:38 PDT 2025



On 4/29/2025 7:17 AM, Lorenzo Bianconi wrote:
> The official Airoha EN7581 firmware requires adding max_packet filed in
> ppe_mbox_data struct while the unofficial one used to develop the Airoha
> EN7581 flowtable support does not require this field.
> This patch does not introduce any real backwards compatible issue since
> EN7581 fw is not publicly available in linux-firmware or other
> repositories (e.g. OpenWrt) yet and the official fw version will use this
> new layout. For this reason this change needs to be backported.
> Moreover, add __packed attribute to ppe_mbox_data struct definition and
> make the fw layout padding explicit in init_info struct.
> At the same time use u32 instead of int for init_info and set_info
> struct definitions in ppe_mbox_data struct.
> 
> Fixes: 23290c7bc190d ("net: airoha: Introduce Airoha NPU support")
> Reviewed-by: Simon Horman <horms at kernel.org>
> Reviewed-by: Jacob Keller <jacob.e.keller at intel.com>
> Signed-off-by: Lorenzo Bianconi <lorenzo at kernel.org>
> ---
> Changes in v4:
> - use u32 instead of int in ppe_mbox_data struct
> - add __packed attribute to struct definitions and make the fw layout
>   padding explicit in init_info struct
> - Link to v3: https://lore.kernel.org/r/20250422-airoha-en7581-fix-ppe_mbox_data-v3-1-87dd50d2956e@kernel.org
> 
> Changes in v3:
> - resend targeting net tree
> - Link to v2: https://lore.kernel.org/r/20250417-airoha-en7581-fix-ppe_mbox_data-v2-1-43433cfbe874@kernel.org
> 
> Changes in v2:
> - Add more details to commit log
> - Link to v1: https://lore.kernel.org/r/20250415-airoha-en7581-fix-ppe_mbox_data-v1-1-4408c60ba964@kernel.org
> ---
>  drivers/net/ethernet/airoha/airoha_npu.c | 16 +++++++++-------
>  1 file changed, 9 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/net/ethernet/airoha/airoha_npu.c b/drivers/net/ethernet/airoha/airoha_npu.c
> index 7a5710f9ccf6a4a4f555ab63d67cb6b318de9b52..c81e25139d5ff4b6c52ce8802dd9c9b9b6c8c721 100644
> --- a/drivers/net/ethernet/airoha/airoha_npu.c
> +++ b/drivers/net/ethernet/airoha/airoha_npu.c
> @@ -104,17 +104,19 @@ struct ppe_mbox_data {
>  			u8 xpon_hal_api;
>  			u8 wan_xsi;
>  			u8 ct_joyme4;
> -			int ppe_type;
> -			int wan_mode;
> -			int wan_sel;
> -		} init_info;
> +			u8 max_packet;
> +			u8 rsv[3]; /* align to fw layout */
> +			u32 ppe_type;
> +			u32 wan_mode;
> +			u32 wan_sel;
> +		} __packed init_info;
>  		struct {
> -			int func_id;
> +			u32 func_id;
>  			u32 size;
>  			u32 data;
> -		} set_info;
> +		} __packed set_info;
>  	};
> -};
> +} __packed;
>  
>  

Content makes sense, and I appreciate the padding and layout being explicit.

With or without the typo fix in the subject:

Reviewed-by: Jacob Keller <jacob.e.keller at intel.com>



More information about the Linux-mediatek mailing list