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 D048E1B3BB for ; Tue, 4 Dec 2018 05:41:02 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Dec 2018 20:41:01 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,312,1539673200"; d="scan'208";a="256584792" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga004.jf.intel.com with ESMTP; 03 Dec 2018 20:41:01 -0800 Received: from fmsmsx120.amr.corp.intel.com (10.18.124.208) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 3 Dec 2018 20:41:01 -0800 Received: from bgsmsx105.gar.corp.intel.com (10.223.43.197) by fmsmsx120.amr.corp.intel.com (10.18.124.208) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 3 Dec 2018 20:41:00 -0800 Received: from bgsmsx101.gar.corp.intel.com ([169.254.1.234]) by BGSMSX105.gar.corp.intel.com ([169.254.3.64]) with mapi id 14.03.0415.000; Tue, 4 Dec 2018 10:10:57 +0530 From: "Varghese, Vipin" To: "Lu, Wenzhuo" , "dev@dpdk.org" CC: "Lu, Wenzhuo" , "Yang, Qiming" , "Li, Xiaoyun" , "Wu, Jingjing" Thread-Topic: [dpdk-dev] [PATCH v2 02/20] net/ice: support device initialization Thread-Index: AQHUitZGtxdD52Cel0muTmHuUQSTKaVt/qlg Date: Tue, 4 Dec 2018 04:40:57 +0000 Message-ID: <4C9E0AB70F954A408CC4ADDBF0F8FA7D4D2C452C@BGSMSX101.gar.corp.intel.com> References: <1542956179-80951-1-git-send-email-wenzhuo.lu@intel.com> <1543820821-108122-1-git-send-email-wenzhuo.lu@intel.com> <1543820821-108122-3-git-send-email-wenzhuo.lu@intel.com> In-Reply-To: <1543820821-108122-3-git-send-email-wenzhuo.lu@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNmQzYjAzZTQtMTliZi00ZDMzLWI0ZWEtNzQ4MTRjYzk1N2U1IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiY2d3QmRYTmxaV05ma0hOM3VmZEhKK1NQQWZWTkwrMEtvZHFydjVYN28zUm9FbEZUQVd4R2U1WkU4c3hhcEhrRSJ9 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 v2 02/20] 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: Tue, 04 Dec 2018 04:41:03 -0000 Snipped > + /* Set the info.ingress_table and info.egress_table > + * for UP translate table. Now just set it to 1:1 map by default > + * -- 0b 111 110 101 100 011 010 001 000 =3D=3D 0xFAC688 > + */ > + info->ingress_table =3D rte_cpu_to_le_32(0x00FAC688); > + info->egress_table =3D rte_cpu_to_le_32(0x00FAC688); > + info->outer_up_table =3D rte_cpu_to_le_32(0x00FAC688); Can we use MACRO instead of exact values for ingress, egress and outer_up t= able. > + return 0; > +} > + snipped > +static int > +ice_dev_init(struct rte_eth_dev *dev) > +{ > + struct rte_pci_device *pci_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); > + int ret; > + > + dev->dev_ops =3D &ice_eth_dev_ops; > + > + pci_dev =3D RTE_DEV_TO_PCI(dev->device); > + > + rte_eth_copy_pci_info(dev, pci_dev); > + pf->adapter =3D ICE_DEV_PRIVATE_TO_ADAPTER(dev->data- > >dev_private); > + pf->adapter->eth_dev =3D dev; > + pf->dev_data =3D dev->data; > + hw->back =3D pf->adapter; > + hw->hw_addr =3D (uint8_t *)pci_dev->mem_resource[0].addr; > + hw->vendor_id =3D pci_dev->id.vendor_id; > + hw->device_id =3D pci_dev->id.device_id; > + hw->subsystem_vendor_id =3D pci_dev->id.subsystem_vendor_id; > + hw->subsystem_device_id =3D pci_dev->id.subsystem_device_id; > + hw->bus.device =3D pci_dev->addr.devid; > + hw->bus.func =3D pci_dev->addr.function; > + > + ice_init_controlq_parameter(hw); > + > + ret =3D ice_init_hw(hw); > + if (ret) { > + PMD_INIT_LOG(ERR, "Failed to initialize HW"); > + return -EINVAL; > + } Definition for ice_init_hw in patch 01/20 does not check for primary-second= ary. Are we allowing secondary to invoke ice_init_hw if it is initialized b= y primary? > + > + 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); > + Snipped > + > +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); > + > + ICE_PROC_SECONDARY_CHECK_RET_0; Should not we check if primary is alive and NIC is used or initialized by p= rimary then ' ICE_PROC_SECONDARY_CHECK_RET_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; > +} > + snipped > +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); > + > + ICE_PROC_SECONDARY_CHECK_NO_ERR; > + I am just wondering in a multi process (primary-secondary) if primary is ki= lled or exited, then if we try to stop the secondary due to this check the = vsi, pool and shutdown is not called. Should not we check if primary is sti= ll alive, if yes then=20 ICE_PROC_SECONDARY_CHECK_NO_ERR? > + ice_res_pool_destroy(&pf->msix_pool); > + ice_release_vsi(pf->main_vsi); > + > + ice_shutdown_all_ctrlq(hw); > +} snipped