DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Qi Zhang <qi.z.zhang@intel.com>, qiming.yang@intel.com
Cc: dev@dpdk.org, xiaolong.ye@intel.com,
	Wei Zhao <wei.zhao1@intel.com>,
	Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Subject: Re: [dpdk-dev] [PATCH 07/10] net/ice/base: get tunnel type for recipe
Date: Fri, 19 Jun 2020 15:33:36 +0100	[thread overview]
Message-ID: <ee07eb4c-39d3-fdc8-3c19-5196c4bc371b@intel.com> (raw)
In-Reply-To: <20200611084330.18301-8-qi.z.zhang@intel.com>

On 6/11/2020 9:43 AM, Qi Zhang wrote:
> This patch add support to get tunnel type of recipe
> after get recipe from fw. This will fix the issue in
> function ice_find_recp() for tunnel type comparing.
> 
> Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
> Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
> Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>

<...>

>  /**
> + * ice_get_tun_type_for_recipe - get tunnel type for the recipe
> + * @rid: recipe ID that we are populating
> + */
> +static enum ice_sw_tunnel_type ice_get_tun_type_for_recipe(u8 rid)
> +{
> +	u8 vxlan_profile[12] = {10, 11, 12, 16, 17, 18, 22, 23, 24, 25, 26, 27};
> +	u8 gre_profile[12] = {13, 14, 15, 19, 20, 21, 28, 29, 30, 31, 32, 33};
> +	u8 pppoe_profile[7] = {34, 35, 36, 37, 38, 39, 40};
> +	u8 non_tun_profile[6] = {4, 5, 6, 7, 8, 9};
> +	enum ice_sw_tunnel_type tun_type;
> +	u16 i, j, profile_num = 0;
> +	bool non_tun_valid = false;
> +	bool pppoe_valid = false;
> +	bool vxlan_valid = false;
> +	bool gre_valid = false;
> +	bool gtp_valid = false;
> +	bool flag_valid = false;
> +
> +	for (j = 0; j < ICE_MAX_NUM_PROFILES; j++) {
> +		if (!ice_is_bit_set(recipe_to_profile[rid], j))
> +			continue;
> +		else
> +			profile_num++;
> +
> +		for (i = 0; i < 12; i++) {
> +			if (gre_profile[i] == j)
> +				gre_valid = true;
> +		}
> +
> +		for (i = 0; i < 12; i++) {
> +			if (vxlan_profile[i] == j)
> +				vxlan_valid = true;
> +		}
> +
> +		for (i = 0; i < 7; i++) {
> +			if (pppoe_profile[i] == j)
> +				pppoe_valid = true;
> +		}
> +
> +		for (i = 0; i < 6; i++) {
> +			if (non_tun_profile[i] == j)
> +				non_tun_valid = true;
> +		}
> +
> +		if (j >= ICE_PROFID_IPV4_GTPC_TEID &&
> +		    j <= ICE_PROFID_IPV6_GTPU_IPV6_OTHER)
> +			gtp_valid = true;
> +
> +		if (j >= ICE_PROFID_IPV4_ESP &&
> +		    j <= ICE_PROFID_IPV6_PFCP_SESSION)
> +			flag_valid = true;
> +	}
> +
> +	if (!non_tun_valid && vxlan_valid)
> +		tun_type = ICE_SW_TUN_VXLAN;
> +	else if (!non_tun_valid && gre_valid)
> +		tun_type = ICE_SW_TUN_NVGRE;
> +	else if (!non_tun_valid && pppoe_valid)
> +		tun_type = ICE_SW_TUN_PPPOE;
> +	else if (!non_tun_valid && gtp_valid)
> +		tun_type = ICE_SW_TUN_GTP;
> +	else if ((non_tun_valid && vxlan_valid) ||
> +		 (non_tun_valid && gre_valid) ||
> +		 (non_tun_valid && gtp_valid) ||
> +		 (non_tun_valid && pppoe_valid))
> +		tun_type = ICE_SW_TUN_AND_NON_TUN;
> +	else if ((non_tun_valid && !vxlan_valid) ||
> +		 (non_tun_valid && !gre_valid) ||
> +		 (non_tun_valid && !gtp_valid) ||
> +		 (non_tun_valid && !pppoe_valid))
> +		tun_type = ICE_NON_TUN;
> +
> +	if (profile_num > 1 && tun_type == ICE_SW_TUN_PPPOE) {

This is giving 'tun_type' may be used uninitialized warning [1], fixing it
setting a default value [2] while merging.


[1]
.../dpdk/drivers/net/ice/base/ice_switch.c: In function ‘ice_find_recp’:
.../dpdk/drivers/net/ice/base/ice_switch.c:1100:22: error: ‘tun_type’ may be
used uninitialized in this function [-Werror=maybe-uninitialized]
 1100 |  if (profile_num > 1 && tun_type == ICE_SW_TUN_PPPOE) {
      |      ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.../dpdk/drivers/net/ice/base/ice_switch.c:1037:26: note: ‘tun_type’ was
declared here
 1037 |  enum ice_sw_tunnel_type tun_type;
      |                          ^~~~~~~~

[2]
 -       enum ice_sw_tunnel_type tun_type;
 +       enum ice_sw_tunnel_type tun_type = ICE_NON_TUN;

  reply	other threads:[~2020-06-19 14:33 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-11  8:43 [dpdk-dev] [PATCH 00/10] net/ice: base code update for 20.08 batch 2 Qi Zhang
2020-06-11  8:43 ` [dpdk-dev] [PATCH 01/10] net/ice/base: adjust profile id map locks Qi Zhang
2020-06-11  8:43 ` [dpdk-dev] [PATCH 02/10] net/ice/base: refactor to avoid need to retry Qi Zhang
2020-06-11  8:43 ` [dpdk-dev] [PATCH 03/10] net/ice/base: add FD support for outer IP of GTPU Qi Zhang
2020-06-11  8:43 ` [dpdk-dev] [PATCH 04/10] net/ice/base: add commands for system diagnostic Qi Zhang
2020-06-11  8:43 ` [dpdk-dev] [PATCH 05/10] net/ice/base: rename misleading variable Qi Zhang
2020-06-11  8:43 ` [dpdk-dev] [PATCH 06/10] net/ice/base: add FD support for GTPU with outer IPv6 Qi Zhang
2020-06-11  8:43 ` [dpdk-dev] [PATCH 07/10] net/ice/base: get tunnel type for recipe Qi Zhang
2020-06-19 14:33   ` Ferruh Yigit [this message]
2020-06-11  8:43 ` [dpdk-dev] [PATCH 08/10] net/ice/base: choose TCP dummy packet by protocol Qi Zhang
2020-06-11  8:43 ` [dpdk-dev] [PATCH 09/10] net/ice/base: fix the VSI ID mask to be 10 bit Qi Zhang
2020-06-11  8:43 ` [dpdk-dev] [PATCH 10/10] net/ice/base: replace RSS profile locks Qi Zhang
2020-06-18  6:04 ` [dpdk-dev] [PATCH 00/10] net/ice: base code update for 20.08 batch 2 Yang, Qiming
2020-06-19  4:24   ` Zhang, Qi Z
2020-06-23 10:15     ` Yang, Qiming

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=ee07eb4c-39d3-fdc8-3c19-5196c4bc371b@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=dev@dpdk.org \
    --cc=paul.m.stillwell.jr@intel.com \
    --cc=qi.z.zhang@intel.com \
    --cc=qiming.yang@intel.com \
    --cc=wei.zhao1@intel.com \
    --cc=xiaolong.ye@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).