DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Zhang, Qi Z" <qi.z.zhang@intel.com>
To: "Wu, Yanglong" <yanglong.wu@intel.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: "Xu, Rosen" <rosen.xu@intel.com>, "Wang, Dong1" <dong1.wang@intel.com>
Subject: Re: [dpdk-dev] [PATCH] net/ixgbe: fix ixgbevf link status
Date: Thu, 6 Sep 2018 05:33:45 +0000	[thread overview]
Message-ID: <039ED4275CED7440929022BC67E7061153281BC6@SHSMSX103.ccr.corp.intel.com> (raw)
In-Reply-To: <20180810081000.4454-1-yanglong.wu@intel.com>

Hi Yanglong:

> -----Original Message-----
> From: Wu, Yanglong
> Sent: Friday, August 10, 2018 4:10 PM
> To: dev@dpdk.org
> Cc: Xu, Rosen <rosen.xu@intel.com>; Wang, Dong1 <dong1.wang@intel.com>;
> Zhang, Qi Z <qi.z.zhang@intel.com>; Wu, Yanglong <yanglong.wu@intel.com>
> Subject: [PATCH] net/ixgbe: fix ixgbevf link status
> 
> For ixgbevf kernel driver, link status changes from down to up will trigger vf
> kernel driver send IXGBE_VF_RESET message to pf kernel driver, after this, vf
> kernel driver will disable and enable it self. By these series operations, the vf
> kernel driver report link up. Besides, all these operations handles in kernel
> thread.
> For DPDK user space driver, it only gets link status changes from down to up,
> but miss IXGBE_VF_RESET message sending and reset itself.
> If we will add fully implementation of link status change for DPDK user space
> driver, we need take much more modification. We have aligned that for link
> status changes from down to up we only notify link is up, users need to reset
> vf port.

OK, the commit log described the gap between kernel driver and DPDK driver, and the workaround which require proper change in application.
But what is the problem the patch is going to fix?, what's the relationship between the fix and commit log, I can't figure out.
Basically the patch remove the no_pflink_check branch, so it will always check with PF for the link status. I guess this help to guarantee that application can always get correct link status, but why we need that commit log here? would you explain more?

> 
> Fixes: dc66e5fd01b9 ("net/ixgbe: improve link state check on VF")
> 
> Signed-off-by: Rosen Xu <rosen.xu@intel.com>
> Signed-off-by: Yanglong Wu <yanglong.wu@intel.com>
> ---
>  drivers/net/ixgbe/ixgbe_ethdev.c | 14 ++------------
>  1 file changed, 2 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c
> b/drivers/net/ixgbe/ixgbe_ethdev.c
> index 26b192737..4d5f4441b 100644
> --- a/drivers/net/ixgbe/ixgbe_ethdev.c
> +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
> @@ -3865,13 +3865,12 @@ ixgbevf_dev_info_get(struct rte_eth_dev *dev,
> 
>  static int
>  ixgbevf_check_link(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
> -		   int *link_up, int wait_to_complete)
> +		   int *link_up, __attribute__((unused)) int wait_to_complete)

I think we can just remove "wait_to_complete", right?

>  {
>  	/**
>  	 * for a quick link status checking, wait_to_compelet == 0,
>  	 * skip PF link status checking
>  	 */
> -	bool no_pflink_check = wait_to_complete == 0;
>  	struct ixgbe_mbx_info *mbx = &hw->mbx;
>  	struct ixgbe_mac_info *mac = &hw->mac;
>  	uint32_t links_reg, in_msg;
> @@ -3931,15 +3930,6 @@ ixgbevf_check_link(struct ixgbe_hw *hw,
> ixgbe_link_speed *speed,
>  	default:
>  		*speed = IXGBE_LINK_SPEED_UNKNOWN;
>  	}
> -
> -	if (no_pflink_check) {
> -		if (*speed == IXGBE_LINK_SPEED_UNKNOWN)
> -			mac->get_link_status = true;
> -		else
> -			mac->get_link_status = false;
> -
> -		goto out;
> -	}
>  	/* if the read failed it could just be a mailbox collision, best wait
>  	 * until we are called again and don't report an error
>  	 */
> @@ -3949,7 +3939,7 @@ ixgbevf_check_link(struct ixgbe_hw *hw,
> ixgbe_link_speed *speed,
>  	if (!(in_msg & IXGBE_VT_MSGTYPE_CTS)) {
>  		/* msg is not CTS and is NACK we must have lost CTS status */
>  		if (in_msg & IXGBE_VT_MSGTYPE_NACK)
> -			ret_val = -1;
> +			mac->get_link_status = false;
>  		goto out;
>  	}
> 
> --
> 2.11.0

  reply	other threads:[~2018-09-06  5:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-10  8:10 Yanglong Wu
2018-09-06  5:33 ` Zhang, Qi Z [this message]
2018-10-26  6:10   ` Wu, Yanglong
2018-11-13  6:34 ` [dpdk-dev] [PATCH v2] " Yanglong Wu
2018-11-13 19:27   ` Zhang, Qi Z
2018-11-14  5:14   ` Wang, Dong1
2019-12-17  6:12 [dpdk-dev] [PATCH] " Lunyuan Cui
2019-12-18  2:35 ` Ye Xiaolong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=039ED4275CED7440929022BC67E7061153281BC6@SHSMSX103.ccr.corp.intel.com \
    --to=qi.z.zhang@intel.com \
    --cc=dev@dpdk.org \
    --cc=dong1.wang@intel.com \
    --cc=rosen.xu@intel.com \
    --cc=yanglong.wu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).