DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Zhang, Qi Z" <qi.z.zhang@intel.com>
To: "Zhang, AlvinX" <alvinx.zhang@intel.com>,
	"Xing, Beilei" <beilei.xing@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
	"Zhang, AlvinX" <alvinx.zhang@intel.com>,
	"stable@dpdk.org" <stable@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] net/iavf: fix virtual channel RSS command error handling
Date: Sun, 25 Jul 2021 10:09:51 +0000	[thread overview]
Message-ID: <39d4dda4c17f4de3b64d022a74b45ba2@intel.com> (raw)
In-Reply-To: <20210721063209.9724-1-alvinx.zhang@intel.com>



> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Alvin Zhang
> Sent: Wednesday, July 21, 2021 2:32 PM
> To: Xing, Beilei <beilei.xing@intel.com>
> Cc: dev@dpdk.org; Zhang, AlvinX <alvinx.zhang@intel.com>; stable@dpdk.org
> Subject: [dpdk-dev] [PATCH] net/iavf: fix virtual channel RSS command error
> handling
> 
> Kernel PF may not respond to virtual channel commands
> VIRTCHNL_OP_GET_RSS_HENA_CAPS and VIRTCHNL_OP_SET_RSS_HENA,
> which will cause VF to fail to start.
> 
> RSS offload type configuration is not a necessary feature for VF, so in order to
> improve VF compatibility, in this patch the PMD will ignore the error result of
> above two commands and will print warnings instead.
> 
> Fixes: 5a038d19962d ("net/iavf: fix RSS configuration on i40e VF")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
> ---
>  drivers/net/iavf/iavf_ethdev.c | 26 ++++++++++++++------------
>  1 file changed, 14 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c index
> 41382c6..162f55d 100644
> --- a/drivers/net/iavf/iavf_ethdev.c
> +++ b/drivers/net/iavf/iavf_ethdev.c
> @@ -259,7 +259,7 @@ struct rte_iavf_xstats_name_off {
>  	return err;
>  }
> 
> -static int
> +static void
>  iavf_config_rss_hf(struct iavf_adapter *adapter, uint64_t rss_hf)  {
>  	static const uint64_t map_hena_rss[] = { @@ -319,8 +319,12 @@ struct
> rte_iavf_xstats_name_off {
>  	int ret;
> 
>  	ret = iavf_get_hena_caps(adapter, &caps);
> -	if (ret)
> -		return ret;
> +	if (ret) {
> +		PMD_DRV_LOG(WARNING,
> +			    "fail to get supported RSS caps, lack PF support");

This is misleading, the failure reason is not necessary be "lack PF support', it could be any other reason
So better just print the error code here, or simply ignore if a meaningful failure message will already be printed inside iavf_get_hena_caps.

> +		return;
> +	}
> +
>  	/**
>  	 * ETH_RSS_IPV4 and ETH_RSS_IPV6 can be considered as 2
>  	 * generalizations of all other IPv4 and IPv6 RSS types.
> @@ -343,8 +347,11 @@ struct rte_iavf_xstats_name_off {
>  	}
> 
>  	ret = iavf_set_hena(adapter, hena);
> -	if (ret)
> -		return ret;
> +	if (ret) {
> +		PMD_DRV_LOG(WARNING,
> +			    "fail to clean existing RSS, lack PF support");

Actually this is not the case to "clean" but "overwrite", also the "lack PF support" should be refined base on previous comments.

> +		return;
> +	}
> 
>  	if (valid_rss_hf & ipv4_rss)
>  		valid_rss_hf |= rss_hf & ETH_RSS_IPV4; @@ -357,7 +364,6 @@
> struct rte_iavf_xstats_name_off {
>  			    rss_hf & ~valid_rss_hf);
> 
>  	vf->rss_hf = valid_rss_hf;
> -	return 0;
>  }
> 
>  static int
> @@ -409,9 +415,7 @@ struct rte_iavf_xstats_name_off {
>  			return ret;
>  		}
>  	} else {
> -		ret = iavf_config_rss_hf(adapter, rss_conf->rss_hf);
> -		if (ret != -ENOTSUP)
> -			return ret;
> +		iavf_config_rss_hf(adapter, rss_conf->rss_hf);
>  	}
> 
>  	return 0;
> @@ -1400,9 +1404,7 @@ static int iavf_config_rx_queues_irqs(struct
> rte_eth_dev *dev,
>  			return ret;
>  		}
>  	} else {
> -		ret = iavf_config_rss_hf(adapter, rss_conf->rss_hf);
> -		if (ret != -ENOTSUP)
> -			return ret;
> +		iavf_config_rss_hf(adapter, rss_conf->rss_hf);
>  	}
> 
>  	return 0;
> --
> 1.8.3.1


  reply	other threads:[~2021-07-25 10:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-21  6:32 Alvin Zhang
2021-07-25 10:09 ` Zhang, Qi Z [this message]
2021-07-26  9:17 ` [dpdk-dev] [PATCH v2] " Alvin Zhang
2021-07-27 11:54   ` Zhang, Qi Z

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=39d4dda4c17f4de3b64d022a74b45ba2@intel.com \
    --to=qi.z.zhang@intel.com \
    --cc=alvinx.zhang@intel.com \
    --cc=beilei.xing@intel.com \
    --cc=dev@dpdk.org \
    --cc=stable@dpdk.org \
    /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).