]> git.droids-corp.org - dpdk.git/commitdiff
common/cnxk: fix mbox structs to avoid unaligned access
authorNithin Dabilpuram <ndabilpuram@marvell.com>
Thu, 16 Jun 2022 09:24:14 +0000 (14:54 +0530)
committerJerin Jacob <jerinj@marvell.com>
Mon, 20 Jun 2022 17:15:21 +0000 (19:15 +0200)
Fix mbox structs to avoid unaligned access as mbox
memory is from BAR space.

Fixes: 503b82de2cbf ("common/cnxk: add mbox request and response definitions")
Fixes: e746aec161cc ("common/cnxk: fix SQ flush sequence")
Cc: stable@dpdk.org
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
drivers/common/cnxk/roc_mbox.h
drivers/common/cnxk/roc_nix_inl.c

index 2c30f199049d23fa91347b2b7bc73c24d34f8103..965c704322a6955396ea62e6c1c1c5bcd3c41b72 100644 (file)
@@ -777,7 +777,7 @@ struct nix_lf_alloc_req {
        uint64_t __io way_mask;
 #define NIX_LF_RSS_TAG_LSB_AS_ADDER BIT_ULL(0)
 #define NIX_LF_LBK_BLK_SEL         BIT_ULL(1)
-       uint64_t flags;
+       uint64_t __io flags;
 };
 
 struct nix_lf_alloc_rsp {
@@ -798,7 +798,7 @@ struct nix_lf_alloc_rsp {
        uint8_t __io cgx_links;       /* No. of CGX links present in HW */
        uint8_t __io lbk_links;       /* No. of LBK links present in HW */
        uint8_t __io sdp_links;       /* No. of SDP links present in HW */
-       uint8_t tx_link;              /* Transmit channel link number */
+       uint8_t __io tx_link;         /* Transmit channel link number */
 };
 
 struct nix_lf_free_req {
@@ -1275,8 +1275,8 @@ struct ssow_lf_free_req {
 #define SSOW_INVAL_SELECTIVE_VER 0x1000
 struct ssow_lf_inv_req {
        struct mbox_msghdr hdr;
-       uint16_t nb_hws;                 /* Number of HWS to invalidate*/
-       uint16_t hws[MAX_RVU_BLKLF_CNT]; /* Array of HWS */
+       uint16_t __io nb_hws;                 /* Number of HWS to invalidate*/
+       uint16_t __io hws[MAX_RVU_BLKLF_CNT]; /* Array of HWS */
 };
 
 struct ssow_config_lsw {
@@ -1453,11 +1453,11 @@ struct cpt_sts_rsp {
 struct cpt_rxc_time_cfg_req {
        struct mbox_msghdr hdr;
        int blkaddr;
-       uint32_t step;
-       uint16_t zombie_thres;
-       uint16_t zombie_limit;
-       uint16_t active_thres;
-       uint16_t active_limit;
+       uint32_t __io step;
+       uint16_t __io zombie_thres;
+       uint16_t __io zombie_limit;
+       uint16_t __io active_thres;
+       uint16_t __io active_limit;
 };
 
 struct cpt_rx_inline_lf_cfg_msg {
index 39b9bec1ad224298070f1750d049e994fb5cb4c8..7da89382e9642a3a6ce83f9802bb265c0058bc7b 100644 (file)
@@ -246,6 +246,8 @@ roc_nix_reassembly_configure(uint32_t max_wait_time, uint16_t max_frags)
        struct roc_cpt_rxc_time_cfg cfg;
 
        PLT_SET_USED(max_frags);
+       if (idev == NULL)
+               return -ENOTSUP;
        roc_cpt = idev->cpt;
        if (!roc_cpt) {
                plt_err("Cannot support inline inbound, cryptodev not probed");