From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 9AF741B675 for ; Mon, 26 Nov 2018 06:22:38 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Nov 2018 21:22:37 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,280,1539673200"; d="scan'208";a="276821509" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga005.jf.intel.com with ESMTP; 25 Nov 2018 21:22:37 -0800 Received: from fmsmsx126.amr.corp.intel.com (10.18.125.43) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.408.0; Sun, 25 Nov 2018 21:22:36 -0800 Received: from bgsmsx103.gar.corp.intel.com (10.223.4.130) by FMSMSX126.amr.corp.intel.com (10.18.125.43) with Microsoft SMTP Server (TLS) id 14.3.408.0; Sun, 25 Nov 2018 21:22:36 -0800 Received: from bgsmsx101.gar.corp.intel.com ([169.254.1.234]) by BGSMSX103.gar.corp.intel.com ([169.254.4.92]) with mapi id 14.03.0415.000; Mon, 26 Nov 2018 10:52:32 +0530 From: "Varghese, Vipin" To: "Li, Xiaoyun" , "Lu, Wenzhuo" , "dev@dpdk.org" CC: "Lu, Wenzhuo" , "Yang, Qiming" , "Wu, Jingjing" Thread-Topic: [dpdk-dev] [PATCH 02/19] net/ice: support device initialization Thread-Index: AQHUgvki3YcBhEmMsEqUdE3fb9WGSqVc/GAQgAQt7ICAAF0ZUP//pYmAgABc/qA= Date: Mon, 26 Nov 2018 05:22:32 +0000 Message-ID: <4C9E0AB70F954A408CC4ADDBF0F8FA7D4D2C20AB@BGSMSX101.gar.corp.intel.com> References: <1542956179-80951-1-git-send-email-wenzhuo.lu@intel.com> <1542956179-80951-3-git-send-email-wenzhuo.lu@intel.com> <4C9E0AB70F954A408CC4ADDBF0F8FA7D4D2C1870@BGSMSX101.gar.corp.intel.com> <4C9E0AB70F954A408CC4ADDBF0F8FA7D4D2C2091@BGSMSX101.gar.corp.intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMjMwMzNmMGQtMjdmNS00YjFkLTg2MjktZDViYmRlZGNkYjQ5IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiQzFRQmwyUzdDdVByYW1sY2Y5c3VqT1cyeks4b1BWQmVKZHdWU25MTldzVHZuOGJBdllQMitQbGV1RVlibXRnNCJ9 dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [10.223.10.10] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH 02/19] net/ice: support device initialization 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: , X-List-Received-Date: Mon, 26 Nov 2018 05:22:39 -0000 Thank you, will wait for updated documentation and release notes. > -----Original Message----- > From: Li, Xiaoyun > Sent: Monday, November 26, 2018 10:49 AM > To: Varghese, Vipin ; Lu, Wenzhuo > ; dev@dpdk.org > Cc: Lu, Wenzhuo ; Yang, Qiming > ; Wu, Jingjing > Subject: RE: [dpdk-dev] [PATCH 02/19] net/ice: support device initializat= ion >=20 > Yes. >=20 > > -----Original Message----- > > From: Varghese, Vipin > > Sent: Monday, November 26, 2018 13:14 > > To: Li, Xiaoyun ; Lu, Wenzhuo > > ; dev@dpdk.org > > Cc: Lu, Wenzhuo ; Yang, Qiming > > ; Wu, Jingjing > > Subject: RE: [dpdk-dev] [PATCH 02/19] net/ice: support device > > initialization > > > > Thanks for the update, so we can assume all functions are available in > secondary. > > If not supported it will return right error code and documentation is > > updated for the limitation too. > > > > > -----Original Message----- > > > From: Li, Xiaoyun > > > Sent: Monday, November 26, 2018 10:40 AM > > > To: Varghese, Vipin ; Lu, Wenzhuo > > > ; dev@dpdk.org > > > Cc: Lu, Wenzhuo ; Yang, Qiming > > > ; Wu, Jingjing > > > Subject: RE: [dpdk-dev] [PATCH 02/19] net/ice: support device > > > initialization > > > > > > Hi > > > > > > > Do we check if process is secondary and ICE PMD is already is > > > > initialized? If we do not check will we run to multi process reinit= ilization? > > > > > > Yes. We check. It is in [PATCH 16/19] net/ice: support basic RX/TX. > > > Please see that. > > > We roughly split the ice codes in different patch. So the file in > > > only one patch is not complete. > > > > > > > > > > > > + ret =3D ice_init_hw(hw); > > > > > + if (ret) { > > > > > + PMD_INIT_LOG(ERR, "Failed to initialize HW"); > > > > > + return -EINVAL; > > > > > + } > > > > > + > > > > > + PMD_INIT_LOG(INFO, "FW %d.%d.%05d API %d.%d", > > > > > + hw->fw_maj_ver, hw->fw_min_ver, hw->fw_build, > > > > > + hw->api_maj_ver, hw->api_min_ver); > > > > > + > > > > > + ice_pf_sw_init(dev); > > > > > + ret =3D ice_init_mac_address(dev); > > > > > + if (ret) { > > > > > + PMD_INIT_LOG(ERR, "Failed to initialize mac address"); > > > > > + goto err_init_mac; > > > > > + } > > > > > > > > Assuming in secondary multi process this will be skipped if > > > > primary has already initialized. Is this understanding correct? > > > > > > > > > + > > > > > + ret =3D ice_res_pool_init(&pf->msix_pool, 1, > > > > > + hw- > > > > > >func_caps.common_cap.num_msix_vectors - 1); > > > > > + if (ret) { > > > > > + PMD_INIT_LOG(ERR, "Failed to init MSIX pool"); > > > > > + goto err_msix_pool_init; > > > > > + } > > > > > + > > > > > + ret =3D ice_pf_setup(pf); > > > > > + if (ret) { > > > > > + PMD_INIT_LOG(ERR, "Failed to setup PF"); > > > > > + goto err_pf_setup; > > > > > + } > > > > > > > > Pool init and pf setup also for secondary skip if primary is done? > > > > > > > > > + > > > > > + return 0; > > > > > + > > > > > +err_pf_setup: > > > > > + ice_res_pool_destroy(&pf->msix_pool); > > > > > +err_msix_pool_init: > > > > > + rte_free(dev->data->mac_addrs); > > > > > +err_init_mac: > > > > > + ice_sched_cleanup_all(hw); > > > > > + rte_free(hw->port_info); > > > > > + ice_shutdown_all_ctrlq(hw); > > > > > + > > > > > + return ret; > > > > > +} > > > > > + > > > > > +static int > > > > > +ice_release_vsi(struct ice_vsi *vsi) { > > > > > + struct ice_hw *hw; > > > > > + struct ice_vsi_ctx vsi_ctx; > > > > > + enum ice_status ret; > > > > > + > > > > > + if (!vsi) > > > > > + return 0; > > > > > > > > Should we check if process is secondary and primary sees the port, > > > > then skip the destroy? > > > > > > > > > + > > > > > + hw =3D ICE_VSI_TO_HW(vsi); > > > > > + > > > > > + memset(&vsi_ctx, 0, sizeof(vsi_ctx)); > > > > > + > > > > > + vsi_ctx.vsi_num =3D vsi->vsi_id; > > > > > + vsi_ctx.info =3D vsi->info; > > > > > + ret =3D ice_free_vsi(hw, vsi->idx, &vsi_ctx, false, NULL); > > > > > + if (ret !=3D ICE_SUCCESS) { > > > > > + PMD_INIT_LOG(ERR, "Failed to free vsi by aq, %u", vsi- > >vsi_id); > > > > > + rte_free(vsi); > > > > > + return -1; > > > > > + } > > > > > + > > > > > + rte_free(vsi); > > > > > + return 0; > > > > > +} > > > > > + > > > > > +static int > > > > > +ice_dev_uninit(struct rte_eth_dev *dev) { > > > > > + struct ice_hw *hw =3D ICE_DEV_PRIVATE_TO_HW(dev->data- > > > > > >dev_private); > > > > > + struct ice_pf *pf =3D > > > > > +ICE_DEV_PRIVATE_TO_PF(dev->data->dev_private); > > > > > + > > > > > + if (rte_eal_process_type() =3D=3D RTE_PROC_SECONDARY) > > > > > + return 0; > > > > > + > > > > > > > > Here we have check for secondary, but if the port is added in > > > > secondary and not primary is it valid to return 0? > > > > > > > > > + ice_dev_close(dev); > > > > > + > > > > > + dev->dev_ops =3D NULL; > > > > > + dev->rx_pkt_burst =3D NULL; > > > > > + dev->tx_pkt_burst =3D NULL; > > > > > + > > > > > + rte_free(dev->data->mac_addrs); > > > > > + dev->data->mac_addrs =3D NULL; > > > > > + > > > > > + ice_release_vsi(pf->main_vsi); > > > > > + ice_sched_cleanup_all(hw); > > > > > + rte_free(hw->port_info); > > > > > + ice_shutdown_all_ctrlq(hw); > > > > > + > > > > > + return 0; > > > > > +} > > > > > + > > > > > > > > > > > > > > > > > +static void > > > > > +ice_dev_close(struct rte_eth_dev *dev) { > > > > > + struct ice_pf *pf =3D ICE_DEV_PRIVATE_TO_PF(dev->data- > >dev_private); > > > > > + struct ice_hw *hw =3D ICE_DEV_PRIVATE_TO_HW(dev->data- > > > > > >dev_private); > > > > > + > > > > > + if (rte_eal_process_type() =3D=3D RTE_PROC_SECONDARY) > > > > > + return; > > > > > + > > > > > > > > Same as previous comment, if port is started in secondary it will > > > > not be seen in primary. Hence is it right to return 0 without check= ing? > > > > > > > > > + ice_res_pool_destroy(&pf->msix_pool); > > > > > + ice_release_vsi(pf->main_vsi); > > > > > + > > > > > + ice_shutdown_all_ctrlq(hw); > > > > > +} > > > > > > > >