From: Jie Liu <[email protected]>
The sxe2_drv_cmd.h command structures must match the layout
used by historical SXE2 kernel versions so the same firmware
command ABI is shared. Several structures were declared with
__rte_packed_begin/__rte_packed_end and extra rsv padding that
the kernel layout does not have:
- sxe2_drv_link_info_resp: drop rsv[3] padding
- sxe2_tm_res: drop rsv[2] padding and packed attribute
- sxe2_tm_info: drop packed attribute
- sxe2_drv_sfp_req: drop packed attribute
- sxe2_drv_sfp_resp: drop packed attribute
sxe2_tm_add_mid_msg and sxe2_tm_add_queue_msg keep the packed
attribute so the firmware command wire offsets (tm info offset,
tm queue info offset) are preserved.
Keep the structure members as-is so the command ABI is
compatible with the historical kernel driver.
Fixes: 9c894f75113f ("net/sxe2: support TM hierarchy and shaping")
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Jie Liu <[email protected]>
---
drivers/net/sxe2/sxe2_drv_cmd.h | 18 ++++++++----------
1 file changed, 8 insertions(+), 10 deletions(-)
diff --git a/drivers/net/sxe2/sxe2_drv_cmd.h b/drivers/net/sxe2/sxe2_drv_cmd.h
index cc71e2364e..5274b59a6a 100644
--- a/drivers/net/sxe2/sxe2_drv_cmd.h
+++ b/drivers/net/sxe2/sxe2_drv_cmd.h
@@ -230,7 +230,6 @@ struct __rte_aligned(4) __rte_packed_begin
sxe2_drv_vsi_info_get_resp {
struct __rte_aligned(4) __rte_packed_begin sxe2_drv_link_info_resp {
uint32_t speed;
uint8_t status;
- uint8_t rsv[3];
} __rte_packed_end;
struct __rte_aligned(4) __rte_packed_begin sxe2_switchdev_info {
@@ -348,18 +347,17 @@ struct __rte_aligned(4) __rte_packed_begin
sxe2_rss_hf_req {
uint8_t rsv1[3];
} __rte_packed_end;
-struct __rte_aligned(4) __rte_packed_begin sxe2_tm_res {
+struct sxe2_tm_res {
uint16_t teid;
- uint8_t rsv[2];
-} __rte_packed_end;
+};
-struct __rte_aligned(4) __rte_packed_begin sxe2_tm_info {
+struct sxe2_tm_info {
uint32_t committed;
uint32_t peak;
uint8_t priority;
uint8_t reserve;
uint16_t weight;
-} __rte_packed_end;
+};
struct __rte_aligned(4) __rte_packed_begin sxe2_tm_add_mid_msg {
uint16_t parent_teid;
@@ -633,7 +631,7 @@ struct __rte_aligned(4) __rte_packed_begin
sxe2_drv_udp_tunnel_resp {
uint8_t rsv;
} __rte_packed_end;
-struct __rte_aligned(4) __rte_packed_begin sxe2_drv_sfp_req {
+struct sxe2_drv_sfp_req {
uint8_t is_wr;
uint8_t is_qsfp;
uint16_t bus_addr;
@@ -642,14 +640,14 @@ struct __rte_aligned(4) __rte_packed_begin
sxe2_drv_sfp_req {
uint16_t data_len;
uint16_t rvd;
uint8_t data[];
-} __rte_packed_end;
+};
-struct __rte_aligned(4) __rte_packed_begin sxe2_drv_sfp_resp {
+struct sxe2_drv_sfp_resp {
uint8_t is_wr;
uint8_t is_qsfp;
uint16_t data_len;
uint8_t data[];
-} __rte_packed_end;
+};
enum sxe2_fc_type {
SXE2_FC_T_DIS = 0,
--
2.52.0