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 v3] net/i40e: i40e get link status update from ipn3ke
Date: Mon, 8 Jul 2019 05:56:09 +0000 [thread overview]
Message-ID: <039ED4275CED7440929022BC67E7061153D613B5@SHSMSX105.ccr.corp.intel.com> (raw)
In-Reply-To: <1562223367-292259-1-git-send-email-andy.pei@intel.com>
Hi Andy:
> -----Original Message-----
> From: Pei, Andy
> Sent: Thursday, July 4, 2019 2:56 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 v3] 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 switch_ethdev to rte_eth_dev_data to track the bind switch device.
> Try to bind i40e pf to switch device when i40e device is probed. If it fail to find
> correct switch device, bind will occur again when update i40e device link
> status.
>
......
> int
> i40e_dev_link_update(struct rte_eth_dev *dev,
> int wait_to_complete)
> @@ -2786,6 +2905,8 @@ void i40e_flex_payload_reg_set_default(struct
> i40e_hw *hw)
> struct i40e_hw *hw =
> I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private);
> struct rte_eth_link link;
> bool enable_lse = dev->data->dev_conf.intr_conf.lsc ? true : false;
> + struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
> + struct rte_devargs *devargs;
> int ret;
>
> memset(&link, 0, sizeof(link));
> @@ -2800,6 +2921,16 @@ void i40e_flex_payload_reg_set_default(struct
> i40e_hw *hw)
> else
> update_link_aq(hw, &link, enable_lse, wait_to_complete);
>
> + if (!dev->data->switch_ethdev) {
> + devargs = pci_dev->device.devargs;
> + if (devargs)
> + dev->data->switch_ethdev =
> + i40e_get_switch_ethdev_from_devargs(
> + pci_dev->device.devargs);
> + }
For regular mode, switch_ethdev is always null, seems above code did unnecessary devargs parsing for every link_update call
Can we add an intermediate flag (add a field in i40e_pf indicate if switch mode is required like other devargs ) so during probe this flag can be initialized, and it can be reused later.
So all switch mode related code can be braces with that flag.
If (xxx_flag)
{
.....
}
> + i40e_pf_linkstatus_get_from_switch_ethdev(dev->data->switch_ethdev,
> + &link);
Why i40e_pf_linkstatus_get_from_switch_ethdev is always be called?, should we do
If (dev->data->switch_ethdev)
i40e_pf_linkstatus_get_from_switch_ethdev(dev->data->switch_ethdev, &link);
next prev parent reply other threads:[~2019-07-08 5:56 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
2019-07-10 9:41 ` [dpdk-dev] [PATCH v6 2/2] doc: add switch mode devargs Andy Pei
2019-07-08 5:56 ` Zhang, Qi Z [this message]
2019-07-08 8:59 ` [dpdk-dev] [PATCH v3] net/i40e: i40e get link status update from ipn3ke 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=039ED4275CED7440929022BC67E7061153D613B5@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).