return (mlx5_wq_cyc_ctr2ix(wq, cc - pc) >= n) || (cc == pc);
 }
 
-static inline void mlx5e_sq_fetch_wqe(struct mlx5e_txqsq *sq,
-                                     struct mlx5e_tx_wqe **wqe,
-                                     u16 *pi)
+static inline void *
+mlx5e_sq_fetch_wqe(struct mlx5e_txqsq *sq, size_t size, u16 *pi)
 {
        struct mlx5_wq_cyc *wq = &sq->wq;
+       void *wqe;
 
        *pi  = mlx5_wq_cyc_ctr2ix(wq, sq->pc);
-       *wqe = mlx5_wq_cyc_get_wqe(wq, *pi);
-       memset(*wqe, 0, sizeof(**wqe));
+       wqe = mlx5_wq_cyc_get_wqe(wq, *pi);
+       memset(wqe, 0, size);
+
+       return wqe;
 }
 
 static inline struct mlx5e_tx_wqe *
 
        mlx5e_tls_complete_sync_skb(skb, nskb, tcp_seq, headln,
                                    cpu_to_be64(info.rcd_sn));
        mlx5e_sq_xmit(sq, nskb, *wqe, *pi, true);
-       mlx5e_sq_fetch_wqe(sq, wqe, pi);
+       *wqe = mlx5e_sq_fetch_wqe(sq, sizeof(**wqe), pi);
        return skb;
 
 err_out:
 
                struct mlx5_wqe_eth_seg cur_eth = wqe->eth;
 #endif
                mlx5e_fill_sq_frag_edge(sq, wq, pi, contig_wqebbs_room);
-               mlx5e_sq_fetch_wqe(sq, &wqe, &pi);
+               wqe = mlx5e_sq_fetch_wqe(sq, sizeof(*wqe), &pi);
 #ifdef CONFIG_MLX5_EN_IPSEC
                wqe->eth = cur_eth;
 #endif
        u16 pi;
 
        sq = priv->txq2sq[skb_get_queue_mapping(skb)];
-       mlx5e_sq_fetch_wqe(sq, &wqe, &pi);
+       wqe = mlx5e_sq_fetch_wqe(sq, sizeof(*wqe), &pi);
 
        /* might send skbs and update wqe and pi */
        skb = mlx5e_accel_handle_tx(skb, sq, dev, &wqe, &pi);