[PATCH v3 1/4] net/hns3: refactor VF mailbox message struct
Ferruh Yigit
ferruh.yigit at amd.com
Thu Dec 7 13:47:59 CET 2023
On 12/7/2023 1:37 AM, Jie Hai wrote:
> From: Dengdui Huang <huangdengdui at huawei.com>
>
> The data region in VF to PF mbx message command is
> used to communicate with PF driver. And this data
> region exists as an array. As a result, some complicated
> feature commands, like setting promisc mode, map/unmap
> ring vector and setting VLAN id, have to use magic number
> to set them. This isn't good for maintenance of driver.
> So this patch refactors these messages by extracting an
> hns3_vf_to_pf_msg structure.
>
> In addition, the PF link change event message is reported
> by the firmware and is reported in hns3_mbx_vf_to_pf_cmd
> format, it also needs to be modified.
>
> Fixes: 463e748964f5 ("net/hns3: support mailbox")
> Cc: stable at dpdk.org
>
> Signed-off-by: Dengdui Huang <huangdengdui at huawei.com>
> Signed-off-by: Jie Hai <haijie1 at huawei.com>
<...>
> @@ -107,6 +106,48 @@ struct hns3_mbx_resp_status {
> uint8_t additional_info[HNS3_MBX_MAX_RESP_DATA_SIZE];
> };
>
> +struct hns3_ring_chain_param {
> + uint8_t ring_type;
> + uint8_t tqp_index;
> + uint8_t int_gl_index;
> +};
> +
> +#pragma pack(1)
> +struct hns3_mbx_vlan_filter {
> + uint8_t is_kill;
> + uint16_t vlan_id;
> + uint16_t proto;
> +};
> +#pragma pack()
> +
>
Please prefer '__rte_packed' instead of "#pragma pack()", as it is more
consisted way for same purpose.
But I see multiple instances of "#pragma pack()" already exists.
@Tyler,
as for as I understand '__attribute__((__packed__))' (__rte_packed) is
GCC way and "#pragma pack()" is Windows way.
Is __rte_packed causing problem with latest windows compilers?
And should we have an abstract __rte_packed that works for both windows
compiler and gcc?
More information about the dev
mailing list