diff mbox series

[23/31] net/bnxt: check for invalid vnic id

Message ID 20180619213058.12273-24-ajit.khaparde@broadcom.com (mailing list archive)
State Changes Requested, archived
Delegated to: Ferruh Yigit
Headers show
Series bnxt patchset | expand

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Ajit Khaparde June 19, 2018, 9:30 p.m. UTC
From: Jay Ding <jay.ding@broadcom.com>

Add checking for VNIC id before sending message to firmware in
bnxt_hwrm_vnic_plcmode_cfg().

Signed-off-by: Jay Ding <jay.ding@broadcom.com>
Reviewed-by: Randy Schacher <stuart.schacher@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_hwrm.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Ferruh Yigit June 26, 2018, 3:30 p.m. UTC | #1
On 6/19/2018 10:30 PM, Ajit Khaparde wrote:
> From: Jay Ding <jay.ding@broadcom.com>
> 
> Add checking for VNIC id before sending message to firmware in
> bnxt_hwrm_vnic_plcmode_cfg().

Can you please add more information, when fw_vnic_id == INVALID_HW_RING_ID, what
does it mean to have fw_vnic_id == INVALID_HW_RING_ID, what is the expected
result without this check?

If this is fixing an issue please update commit according with proper
Fixex/stable tags that patch can be backported to stable trees.

> 
> Signed-off-by: Jay Ding <jay.ding@broadcom.com>
> Reviewed-by: Randy Schacher <stuart.schacher@broadcom.com>
> Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
> ---
>  drivers/net/bnxt/bnxt_hwrm.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
> index 64687a69b..910129f12 100644
> --- a/drivers/net/bnxt/bnxt_hwrm.c
> +++ b/drivers/net/bnxt/bnxt_hwrm.c
> @@ -1560,6 +1560,11 @@ int bnxt_hwrm_vnic_plcmode_cfg(struct bnxt *bp,
>  	struct hwrm_vnic_plcmodes_cfg_output *resp = bp->hwrm_cmd_resp_addr;
>  	uint16_t size;
>  
> +	if (vnic->fw_vnic_id == INVALID_HW_RING_ID) {
> +		PMD_DRV_LOG(DEBUG, "VNIC ID %x\n", vnic->fw_vnic_id);
> +		return rc;
> +	}
> +
>  	HWRM_PREP(req, VNIC_PLCMODES_CFG);
>  
>  	req.flags = rte_cpu_to_le_32(
>
diff mbox series

Patch

diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index 64687a69b..910129f12 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -1560,6 +1560,11 @@  int bnxt_hwrm_vnic_plcmode_cfg(struct bnxt *bp,
 	struct hwrm_vnic_plcmodes_cfg_output *resp = bp->hwrm_cmd_resp_addr;
 	uint16_t size;
 
+	if (vnic->fw_vnic_id == INVALID_HW_RING_ID) {
+		PMD_DRV_LOG(DEBUG, "VNIC ID %x\n", vnic->fw_vnic_id);
+		return rc;
+	}
+
 	HWRM_PREP(req, VNIC_PLCMODES_CFG);
 
 	req.flags = rte_cpu_to_le_32(