Re: [PATCH net-next v2 05/14] octeontx2-af: Add support for CPT second pass

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jun 18, 2025 at 04:59:59PM +0530, Tanmay Jagdale wrote:
> From: Rakesh Kudurumalla <rkudurumalla@xxxxxxxxxxx>
> 
> Implemented mailbox to add mechanism to allocate a
> rq_mask and apply to nixlf to toggle RQ context fields
> for CPT second pass packets.
> 
> Signed-off-by: Rakesh Kudurumalla <rkudurumalla@xxxxxxxxxxx>
> Signed-off-by: Tanmay Jagdale <tanmay@xxxxxxxxxxx>

...

>  void rvu_apr_block_cn10k_init(struct rvu *rvu)
> diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c

...

> +int
> +rvu_mbox_handler_nix_lf_inline_rq_cfg(struct rvu *rvu,
> +				      struct nix_rq_cpt_field_mask_cfg_req *req,
> +				      struct msg_rsp *rsp)
> +{
> +	struct rvu_hwinfo *hw = rvu->hw;
> +	struct nix_hw *nix_hw;
> +	int blkaddr, nixlf;
> +	int rq_mask, err;
> +
> +	err = nix_get_nixlf(rvu, req->hdr.pcifunc, &nixlf, &blkaddr);
> +	if (err)
> +		return err;
> +
> +	nix_hw = get_nix_hw(rvu->hw, blkaddr);
> +	if (!nix_hw)
> +		return NIX_AF_ERR_INVALID_NIXBLK;
> +
> +	if (!hw->cap.second_cpt_pass)
> +		return NIX_AF_ERR_INVALID_NIXBLK;
> +
> +	if (req->ipsec_cfg1.rq_mask_enable) {

If this condition is not met...

> +		rq_mask = nix_inline_rq_mask_alloc(rvu, req, nix_hw, blkaddr);
> +		if (rq_mask < 0)
> +			return NIX_AF_ERR_RQ_CPT_MASK;
> +	}
> +

... then rq_mask is used uninitialised on the following line.

Flagged by clang 20.1.7 with -Wsometimes-uninitialized, and Smatch.

> +	configure_rq_mask(rvu, blkaddr, nixlf, rq_mask,
> +			  req->ipsec_cfg1.rq_mask_enable);
> +	configure_spb_cpt(rvu, blkaddr, nixlf, req,
> +			  req->ipsec_cfg1.spb_cpt_enable);
> +	return 0;
> +}

...




[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]
  Powered by Linux