[dpdk-dev] net/i40e: fix PF notify issue when VF not up

Message ID 1500921763-115209-1-git-send-email-xiaoyun.li@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Ferruh Yigit
Headers

Checks

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

Commit Message

Li, Xiaoyun July 24, 2017, 6:42 p.m. UTC
  This patch modifies PF notify error to warning when not
starting up VF.

Fixes: 4861cde46116 ("i40e: new poll mode driver")
Cc: stable@dpdk.org

Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
---
 drivers/net/i40e/i40e_pf.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
  

Comments

Qiming Yang July 26, 2017, 6:14 a.m. UTC | #1
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Xiaoyun Li
> Sent: Tuesday, July 25, 2017 2:43 AM
> To: dev@dpdk.org
> Cc: Wu, Jingjing <jingjing.wu@intel.com>; Li, Xiaoyun <xiaoyun.li@intel.com>;
> stable@dpdk.org
> Subject: [dpdk-dev] [PATCH] net/i40e: fix PF notify issue when VF not up
> 
> This patch modifies PF notify error to warning when not starting up VF.
> 
> Fixes: 4861cde46116 ("i40e: new poll mode driver")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
> ---
>  drivers/net/i40e/i40e_pf.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/i40e/i40e_pf.c b/drivers/net/i40e/i40e_pf.c index
> b4cf57f..2a29f1a 100644
> --- a/drivers/net/i40e/i40e_pf.c
> +++ b/drivers/net/i40e/i40e_pf.c
> @@ -267,8 +267,12 @@ i40e_pf_host_send_msg_to_vf(struct i40e_pf_vf *vf,
>  	ret = i40e_aq_send_msg_to_vf(hw, abs_vf_id, opcode, retval,
>  						msg, msglen, NULL);
>  	if (ret) {
> -		PMD_INIT_LOG(ERR, "Fail to send message to VF, err %u",
> -			     hw->aq.asq_last_status);
> +		if (vf->state == I40E_VF_INACTIVE)
> +			PMD_DRV_LOG(WARNING, "Warning! VF %u is inactive
> now!",
> +				abs_vf_id);
> +		else
> +			PMD_INIT_LOG(ERR, "Fail to send message to VF,
> err %u",
> +				hw->aq.asq_last_status);
>  	}
> 
>  	return ret;
> --
> 2.7.4
Reviewed-by: Qiming Yang <Qiming.yang@intel.com>
  

Patch

diff --git a/drivers/net/i40e/i40e_pf.c b/drivers/net/i40e/i40e_pf.c
index b4cf57f..2a29f1a 100644
--- a/drivers/net/i40e/i40e_pf.c
+++ b/drivers/net/i40e/i40e_pf.c
@@ -267,8 +267,12 @@  i40e_pf_host_send_msg_to_vf(struct i40e_pf_vf *vf,
 	ret = i40e_aq_send_msg_to_vf(hw, abs_vf_id, opcode, retval,
 						msg, msglen, NULL);
 	if (ret) {
-		PMD_INIT_LOG(ERR, "Fail to send message to VF, err %u",
-			     hw->aq.asq_last_status);
+		if (vf->state == I40E_VF_INACTIVE)
+			PMD_DRV_LOG(WARNING, "Warning! VF %u is inactive now!",
+				abs_vf_id);
+		else
+			PMD_INIT_LOG(ERR, "Fail to send message to VF, err %u",
+				hw->aq.asq_last_status);
 	}
 
 	return ret;