DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Zhang, Qi Z" <qi.z.zhang@intel.com>
To: "Pei, Andy" <andy.pei@intel.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: "Wu, Jingjing" <jingjing.wu@intel.com>,
	"Xing, Beilei" <beilei.xing@intel.com>,
	"Yigit, Ferruh" <ferruh.yigit@intel.com>,
	"Xu, Rosen" <rosen.xu@intel.com>,
	"Ye, Xiaolong" <xiaolong.ye@intel.com>,
	"Zhang, Roy Fan" <roy.fan.zhang@intel.com>,
	"stable@dpdk.org" <stable@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH v7] net/i40e: i40e get link status update from ipn3ke
Date: Thu, 11 Jul 2019 08:45:33 +0000	[thread overview]
Message-ID: <039ED4275CED7440929022BC67E7061153D64FAE@SHSMSX105.ccr.corp.intel.com> (raw)
In-Reply-To: <1562827163-199199-1-git-send-email-andy.pei@intel.com>



> -----Original Message-----
> From: Pei, Andy
> Sent: Thursday, July 11, 2019 2:39 PM
> To: dev@dpdk.org
> Cc: Pei, Andy <andy.pei@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>; Wu,
> Jingjing <jingjing.wu@intel.com>; Xing, Beilei <beilei.xing@intel.com>; Yigit,
> Ferruh <ferruh.yigit@intel.com>; Xu, Rosen <rosen.xu@intel.com>; Ye,
> Xiaolong <xiaolong.ye@intel.com>; Zhang, Roy Fan
> <roy.fan.zhang@intel.com>; stable@dpdk.org
> Subject: [PATCH v7] net/i40e: i40e get link status update from ipn3ke
> 
> Add switch_mode argument for i40e PF to specify the specific FPGA that i40e
> PF is connected to. i40e PF get link status update via the connected FPGA.
> Add bool switch_ethdev_support_flag to struct i40e_pf to specify if there are
> switch_mode argues in cmd.
> Add switch_ethdev to struct i40e_pf to track the bind switch device.
> Try to bind i40e pf to switch device when i40e device is initialized.
> If it fail to find correct switch device, bind will occur again when update i40e
> device link status.
> 
> Signed-off-by: Andy Pei <andy.pei@intel.com>
....
> +	/* An example of cfg_str is "IPN3KE_0@b3:00.0_0" */

My understanding, in above example you want to have

Swtich_name = "0|b3:00.0" and port_name = "0", right?

> +	if (!strncmp(cfg_str, "IPN3KE", strlen("IPN3KE"))) {
> +		p_src = cfg_str;
> +		PMD_DRV_LOG(DEBUG, "cfg_str is %s", cfg_str);
> +
> +		/* move over "IPN3KE" */
> +		while ((*p_src != '_') && (*p_src))
> +			p_src++;

p_src = strchr(p_src, '_') should do the same thing?

> +
> +		/* move over the first underline */
> +		p_src++;

What if *p_src == null ?, error handle needed.

> +
> +		p_dst = switch_name;
> +		while ((*p_src != '_') && (*p_src)) {
> +			if (*p_src == '@') {
> +				*p_dst++ = '|';

Are you replace '@' to '|"? why not define the expected argument as "IPN3KE_0|b3:00.0_0", so can simply do strncpy here.

> +				p_src++;
> +			} else {
> +				*p_dst++ = *p_src++;
> +			}
> +		}
> +		*p_dst = 0;
> +		PMD_DRV_LOG(DEBUG, "switch_name is %s", switch_name);
> +
> +		/* move over the second underline */
> +		p_src++;

Same as above, error handle.

> +
> +		p_dst = port_name;
> +		while (*p_src)
> +			*p_dst++ = *p_src++;
> +		*p_dst = 0;

Use strncpy.

...

  reply	other threads:[~2019-07-11  8:45 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-23  9:14 [dpdk-dev] [PATCH] net/i40e: i40e rework for ipn3ke Andy Pei
2019-05-24  1:05 ` Xu, Rosen
2019-05-24 13:12   ` Ferruh Yigit
2019-05-27  1:42     ` Pei, Andy
2019-06-10  6:14   ` Pei, Andy
2019-06-11  2:35     ` Xu, Rosen
2019-06-25  9:06       ` Pei, Andy
2019-06-26 15:33 ` Ye Xiaolong
2019-06-27  1:20   ` Pei, Andy
2019-06-28  8:33 ` [dpdk-dev] [PATCH v2] net/i40e: i40e get link status update from ipn3ke Andy Pei
2019-06-30  0:35   ` Zhang, Qi Z
2019-07-04  7:03     ` Pei, Andy
2019-07-04  6:56   ` [dpdk-dev] [PATCH v3] " Andy Pei
2019-07-08  3:03     ` [dpdk-dev] [PATCH v4] " Andy Pei
2019-07-08  7:27       ` Zhang, Qi Z
2019-07-09  6:43       ` [dpdk-dev] [PATCH v5] " Andy Pei
2019-07-10  9:41         ` [dpdk-dev] [PATCH v6 1/2] " Andy Pei
2019-07-11  4:36           ` Zhang, Qi Z
2019-07-11  5:56             ` Pei, Andy
2019-07-11  6:05             ` Pei, Andy
2019-07-11  6:39           ` [dpdk-dev] [PATCH v7] " Andy Pei
2019-07-11  8:45             ` Zhang, Qi Z [this message]
2019-07-10  9:41         ` [dpdk-dev] [PATCH v6 2/2] doc: add switch mode devargs Andy Pei
2019-07-08  5:56     ` [dpdk-dev] [PATCH v3] net/i40e: i40e get link status update from ipn3ke Zhang, Qi Z
2019-07-08  8:59       ` Pei, Andy

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=039ED4275CED7440929022BC67E7061153D64FAE@SHSMSX105.ccr.corp.intel.com \
    --to=qi.z.zhang@intel.com \
    --cc=andy.pei@intel.com \
    --cc=beilei.xing@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=jingjing.wu@intel.com \
    --cc=rosen.xu@intel.com \
    --cc=roy.fan.zhang@intel.com \
    --cc=stable@dpdk.org \
    --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).