From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id F0F77A00E6 for ; Tue, 11 Jun 2019 04:35:34 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C34611C224; Tue, 11 Jun 2019 04:35:34 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 503141C223 for ; Tue, 11 Jun 2019 04:35:33 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Jun 2019 19:35:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,577,1557212400"; d="scan'208";a="183641171" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga002.fm.intel.com with ESMTP; 10 Jun 2019 19:35:32 -0700 Received: from fmsmsx111.amr.corp.intel.com (10.18.116.5) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 10 Jun 2019 19:35:31 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx111.amr.corp.intel.com (10.18.116.5) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 10 Jun 2019 19:35:31 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.137]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.187]) with mapi id 14.03.0415.000; Tue, 11 Jun 2019 10:35:30 +0800 From: "Xu, Rosen" To: "Pei, Andy" , "dev@dpdk.org" CC: "Zhang, Roy Fan" , "Zhang, Qi Z" , "Wu, Jingjing" , "Xing, Beilei" , "Yigit, Ferruh" Thread-Topic: [PATCH] net/i40e: i40e rework for ipn3ke Thread-Index: AQHVEUjJ1L1jCoz7ekeOapBGuuSOYqZ5dm0AgBsOR/CAAVVU4A== Date: Tue, 11 Jun 2019 02:35:29 +0000 Message-ID: <0E78D399C70DA940A335608C6ED296D73A7DE0FE@SHSMSX104.ccr.corp.intel.com> References: <1558602875-429451-1-git-send-email-andy.pei@intel.com> <0E78D399C70DA940A335608C6ED296D73A7781F5@SHSMSX104.ccr.corp.intel.com> <5941F446C088714A85408FA3132CFCBB010283EB@SHSMSX105.ccr.corp.intel.com> In-Reply-To: <5941F446C088714A85408FA3132CFCBB010283EB@SHSMSX105.ccr.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZmRhYjBjZTgtOWQ3NS00MDBjLWI3NjYtZmZlMzIzY2Y4N2NkIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiWnNRUFlXS2JyQXBCZG5uT05LM0N3dk9uRE5ReTZwdGtKOXI3U1hmOW9wQ2NDWFdcL1gxdmNzUTVcL0o1cmpNTDB4In0= x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] net/i40e: i40e rework for ipn3ke X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Andy, > -----Original Message----- > From: Pei, Andy > Sent: Monday, June 10, 2019 14:15 > To: Xu, Rosen ; dev@dpdk.org > Cc: Zhang, Roy Fan ; Zhang, Qi Z > ; Wu, Jingjing ; Xing, Beile= i > ; Yigit, Ferruh > Subject: RE: [PATCH] net/i40e: i40e rework for ipn3ke >=20 > Hi, Rosen >=20 >=20 > Your ACK is needed if there is no other issue except the CC list >=20 >=20 > -----Original Message----- > From: Xu, Rosen > Sent: Friday, May 24, 2019 9:05 AM > To: Pei, Andy ; dev@dpdk.org > Cc: Zhang, Roy Fan ; Zhang, Qi Z > ; Wu, Jingjing ; Xing, Beile= i > ; Yigit, Ferruh > Subject: RE: [PATCH] net/i40e: i40e rework for ipn3ke >=20 > Hi, >=20 > > -----Original Message----- > > From: Pei, Andy > > Sent: Thursday, May 23, 2019 17:15 > > To: dev@dpdk.org > > Cc: Pei, Andy ; Zhang, Roy Fan > > ; Zhang, Qi Z ; Wu, > > Jingjing ; Xing, Beilei > > ; Yigit, Ferruh ; Xu, > > Rosen > > Subject: [PATCH] net/i40e: i40e rework for ipn3ke >=20 > > 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. > > > > Fixes: c60869e2b742 ("net/i40e: fix link status update") > > Cc: roy.fan.zhang@intel.com > > Cc: qi.z.zhang@intel.com > > Cc: jingjing.wu@intel.com > > Cc: beilei.xing@intel.com > > Cc: ferruh.yigit@intel.com > > Cc: rosen.xu@intel.com >=20 > My understanding cc people should add in git send-email not in patch. >=20 > > Signed-off-by: Andy Pei > > --- > > drivers/net/i40e/i40e_ethdev.c | 128 > > +++++++++++++++++++++++++++++++++++++++-- > > 1 file changed, 122 insertions(+), 6 deletions(-) > > > > diff --git a/drivers/net/i40e/i40e_ethdev.c > > b/drivers/net/i40e/i40e_ethdev.c index cab440f..9873ea0 100644 > > --- a/drivers/net/i40e/i40e_ethdev.c > > +++ b/drivers/net/i40e/i40e_ethdev.c > > @@ -39,11 +39,12 @@ > > #include "i40e_regs.h" > > #include "rte_pmd_i40e.h" > > > > -#define ETH_I40E_FLOATING_VEB_ARG "enable_floating_veb" > > -#define ETH_I40E_FLOATING_VEB_LIST_ARG "floating_veb_list" > > -#define ETH_I40E_SUPPORT_MULTI_DRIVER "support-multi-driver" > > -#define ETH_I40E_QUEUE_NUM_PER_VF_ARG "queue-num-per-vf" > > -#define ETH_I40E_USE_LATEST_VEC "use-latest-supported-vec" > > +#define ETH_I40E_FLOATING_VEB_ARG "enable_floating_veb" > > +#define ETH_I40E_FLOATING_VEB_LIST_ARG "floating_veb_list" > > +#define ETH_I40E_SUPPORT_MULTI_DRIVER "support-multi-driver" > > +#define ETH_I40E_QUEUE_NUM_PER_VF_ARG "queue-num-per-vf" > > +#define ETH_I40E_USE_LATEST_VEC "use-latest-supported-vec" > > +#define ETH_I40E_SWITCH_MODE_ARG "switch_mode" > > > > #define I40E_CLEAR_PXE_WAIT_MS 200 > > > > @@ -410,6 +411,7 @@ static int i40e_sw_tunnel_filter_insert(struct > > i40e_pf *pf, > > ETH_I40E_SUPPORT_MULTI_DRIVER, > > ETH_I40E_QUEUE_NUM_PER_VF_ARG, > > ETH_I40E_USE_LATEST_VEC, > > + ETH_I40E_SWITCH_MODE_ARG, > > NULL}; > > > > static const struct rte_pci_id pci_id_i40e_map[] =3D { @@ -2784,6 > > +2786,80 @@ void i40e_flex_payload_reg_set_default(struct i40e_hw *hw) > > } > > } > > > > +static int > > +i40e_pf_parse_switch_mode(const char *key __rte_unused, > > + const char *value, void *extra_args) { > > + if (!value || !extra_args) > > + return -EINVAL; > > + > > + *(char **)extra_args =3D strdup(value); > > + > > + if (!*(char **)extra_args) > > + return -ENOMEM; > > + > > + return 0; > > +} > > + > > +static void > > +i40e_pf_switch_mode_link_update(const char *cfg_str, > > + struct rte_eth_dev **switch_ethdev) > > +{ > > + char switch_name[RTE_ETH_NAME_MAX_LEN] =3D {0}; > > + char port_name[RTE_ETH_NAME_MAX_LEN] =3D {0}; > > + char switch_ethdev_name[RTE_ETH_NAME_MAX_LEN] =3D {0}; > > + uint16_t port_id; > > + const char *p_src; > > + char *p_dst; > > + int ret =3D -1; > > + > > + /* An example of cfg_str is "IPN3KE_0@b3:00.0_0" */ > > + if (!strncmp(cfg_str, "IPN3KE", strlen("IPN3KE"))) { > > + p_src =3D cfg_str; > > + PMD_DRV_LOG(DEBUG, "cfg_str is %s", cfg_str); > > + > > + /* move over "IPN3KE" */ > > + while ((*p_src !=3D '_') && (*p_src)) > > + p_src++; > > + > > + /* move over the first underline */ > > + p_src++; > > + > > + p_dst =3D switch_name; > > + while ((*p_src !=3D '_') && (*p_src)) { > > + if (*p_src =3D=3D '@') { > > + *p_dst++ =3D '|'; > > + p_src++; > > + } else > > + *p_dst++ =3D *p_src++; > > + } > > + *p_dst =3D 0; > > + PMD_DRV_LOG(DEBUG, "switch_name is %s", switch_name); > > + > > + /* move over the second underline */ > > + p_src++; > > + > > + p_dst =3D port_name; > > + while (*p_src) > > + *p_dst++ =3D *p_src++; > > + *p_dst =3D 0; > > + PMD_DRV_LOG(DEBUG, "port_name is %s", port_name); > > + > > + snprintf(switch_ethdev_name, sizeof(switch_ethdev_name), > > + "net_%s_representor_%s", switch_name, > > port_name); > > + PMD_DRV_LOG(DEBUG, "switch_ethdev_name is %s", > > + switch_ethdev_name); > > + > > + ret =3D rte_eth_dev_get_port_by_name(switch_ethdev_name, > > + &port_id); > > + if (ret) > > + *switch_ethdev =3D NULL; > > + else > > + *switch_ethdev =3D &rte_eth_devices[port_id]; > > + } else > > + *switch_ethdev =3D NULL; > > +} > > + > > int > > i40e_dev_link_update(struct rte_eth_dev *dev, > > int wait_to_complete) > > @@ -2792,6 +2868,11 @@ void i40e_flex_payload_reg_set_default(struct > > i40e_hw *hw) > > struct rte_eth_link link; > > bool enable_lse =3D dev->data->dev_conf.intr_conf.lsc ? true : false; > > int ret; > > + struct rte_devargs *devargs; > > + struct rte_kvargs *kvlist =3D NULL; > > + struct rte_pci_device *pci_dev =3D RTE_ETH_DEV_TO_PCI(dev); > > + struct rte_eth_dev *switch_ethdev; > > + char *switch_cfg_str =3D NULL; > > > > memset(&link, 0, sizeof(link)); > > > > @@ -2805,6 +2886,40 @@ void i40e_flex_payload_reg_set_default(struct > > i40e_hw *hw) > > else > > update_link_aq(hw, &link, enable_lse, wait_to_complete); > > > > + devargs =3D pci_dev->device.devargs; > > + if (devargs) { > > + kvlist =3D rte_kvargs_parse(devargs->args, valid_keys); > > + if (kvlist !=3D NULL) { > > + if (rte_kvargs_count(kvlist, > > ETH_I40E_SWITCH_MODE_ARG) > > + =3D=3D 1) { > > + if (!rte_kvargs_process(kvlist, > > + ETH_I40E_SWITCH_MODE_ARG, > > + &i40e_pf_parse_switch_mode, > > + &switch_cfg_str)) { > > + > > + i40e_pf_switch_mode_link_update( > > + switch_cfg_str, > > + &switch_ethdev); > > + > > + if (switch_ethdev) { > > + rte_eth_linkstatus_get( > > + switch_ethdev, > > + &link); > > + } else { > > + link.link_duplex =3D > > + > > ETH_LINK_FULL_DUPLEX; > > + link.link_autoneg =3D > > + > > ETH_LINK_SPEED_FIXED; > > + link.link_speed =3D > > + > > ETH_SPEED_NUM_25G; > > + link.link_status =3D 0; > > + } > > + } > > + } > > + rte_kvargs_free(kvlist); > > + } > > + } > > + > > ret =3D rte_eth_linkstatus_set(dev, &link); > > i40e_notify_all_vfs_link_status(dev); > > > > @@ -12790,4 +12905,5 @@ struct i40e_customized_pctype* > > ETH_I40E_FLOATING_VEB_LIST_ARG "=3D" > > ETH_I40E_QUEUE_NUM_PER_VF_ARG > "=3D1|2|4|8|16" > > ETH_I40E_SUPPORT_MULTI_DRIVER "=3D1" > > - ETH_I40E_USE_LATEST_VEC "=3D0|1"); > > + ETH_I40E_USE_LATEST_VEC "=3D0|1" > > + ETH_I40E_SWITCH_MODE_ARG "=3DIPN3KE"); > > -- > > 1.8.3.1 Acked-by: Rosen Xu