From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20077.outbound.protection.outlook.com [40.107.2.77]) by dpdk.org (Postfix) with ESMTP id 225191B742 for ; Mon, 9 Apr 2018 09:34:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=bqsDAhr0/u1p9lBnlFADn89GcnYkgLABgTA4njxZOR4=; b=xP0piPaOrsn6HfHxUI4p2YwhXQ4EqKyFW5o6w1gjTKjNhQCPHj+z18IOnXBVMvNOfi0NGvb4iCiecgVB7ilmMCUBalj7gYZibt9kgBhL7gR+54uGHr/ImIWNGSBd7ZWi7/n3G9j3u1vKCyomz+XLbd87piv2VTidgCsH5mWon+Q= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=shreyansh.jain@nxp.com; Received: from [10.232.14.39] (14.142.187.166) by AM5PR0402MB2771.eurprd04.prod.outlook.com (2603:10a6:203:98::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.653.12; Mon, 9 Apr 2018 07:34:05 +0000 To: "Burakov, Anatoly" Cc: dev@dpdk.org References: <20180405141414.11146-1-shreyansh.jain@nxp.com> <1040d76d-a000-93ed-1cae-34f76007d97f@intel.com> From: Shreyansh Jain Message-ID: <8660ae8a-61bb-56c4-fd6f-9a70d9b41d3c@nxp.com> Date: Mon, 9 Apr 2018 13:19:18 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <1040d76d-a000-93ed-1cae-34f76007d97f@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [14.142.187.166] X-ClientProxiedBy: PN1PR0101CA0017.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:e::27) To AM5PR0402MB2771.eurprd04.prod.outlook.com (2603:10a6:203:98::13) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 74ee59e2-4fe2-459f-fa72-08d59dec46ac X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:AM5PR0402MB2771; X-Microsoft-Exchange-Diagnostics: 1; AM5PR0402MB2771; 3:9ilHla3kW45EwuvRg2xt7A82KtylBsuKY2cHFnuBJw0cE9Xbhs3TNf7IDOR154GTQBHhYx/aolyNWtZmeqyBa6uJ+RZ8g+DbQYISrrPp2PJEY/Zuew9bYnv8oDZXkZJzuIB5n/qIP5etwGX/TW6pfmEwUrzCZ2gqDSapL8oxJCzkfGlcV9TAWxLjkhpSjtcsXP1L4CzKKJjc0O//wS13crBjrYEECAjYJ68AiuZxa0mnJ0EviD/RJ9mORyfM8edn; 25:FqErxvTxdBL1UcuLNkFpi/ateURGeb1BRq4J5FQTRzmaFlDwIrqAKXQiPV3au7gow1j6oBv5QyyOiMzkEFlr5LxKdx6T2NR1Kkr682Aex7dYnIPV7AvdAEFlHi1lbGTKVQqfPvXlzAo4P04Hr+0DQCX2sCxw4JpHXWQPymWLHAmnm3hhEyb8B72i2sySPn+tuLiKDzWXzQA+q/afqM4XI+6/O3VvsAJCxWRa79zZFzGP+UAKokoca84Xo4w+4dU4J2HN3nO/AGIHGmkar4bsDJ31PvCSZiqDETFpIQwblvdD7vdNwztWflIjnXCN5/PpI+gAg/T7ulgU8+Lr01eBVA==; 31:Du9ZxCRS5dU4Xs72SqolVl107Qwbfy8Z3/LoTdYuhiKNIw/G6WMP0D45zlz4Dl7Y3rjB76chav85y5GrD980kuI64acuAyTC1iGu6/1Hiwx0MhIDeM7hf5Jw+ffHtn4PiTr85sWuLj9AhAEpxfKuepY7zj7KuK4aS7+DA0G8VPgUR0IB2Soc+ENpxxj7kgdmvVU8z7UeTetXURQR7jE3JcKMUXoXUT0aJngtqRSU2Sw= X-MS-TrafficTypeDiagnostic: AM5PR0402MB2771: X-Microsoft-Exchange-Diagnostics: 1; AM5PR0402MB2771; 20:/LO9Ivmj7tgEHy7whROQUCGnO35XpFZHI1yV+lEeshP0tHJPbVCbxAiEEuIDSFec/sWvLD8AR5MMLqg0erdoCyJdFLe/ssbTktB4da1DDMtO4+FSP04BzEPJ6Qk/0vHv6F0E+T2oWGSALSjpRy7gcAMHw14QWtwDAyfh7Ctx+S96icojdADHg08ogqaqogSFKZX5EcL0o6mfVLh4+hjOwy80434Kcuavb15/a+uifEKTP0dE+Ffo4c1POwmbWUr+YUgS0/WYw9zW0F3vGFPnzLAOdEObQ4HgCuLQRzqel98LjOlsdowm6hlC2rx1uRjev/uQRrxABcSW8rGskGgkkkniqtwMEVRRpvXe/d2NqU97PZbKOkadC/5tKXwTBnctO+6uooAjxZJ/HnRFLjVOTLsiEXZ9OTCt7k1BbcE3JopCkLUqUvRqQFgbe+mROGWlBfe/i1/4Fomjlmt5L4GUshadFPg0Ma5H0/pEGwOuILWfzqmebTOkTq8rRXyyEhip; 4:QEhkm3gxNScYZNK7vVkxckMYQWht3oix9PTk/P+H5i4DXlvmuD0Qd5IBA6uhfuYtGHcHcENpjkwaeNHEi2EcOwj8GdWm4vyE4arUQgMyJiTU9j89ThJDjK8xejg26X00bU5qKMEN/QYqpjJVt3Uae67Jj80142U/Yi4pnqx04XheeoYp8Ay5XNQh/wq3vcpr9D7lBYfx4eJB11sTagKRHqgQKRlyrq8FupLg7xYpaC4MqZQmzqrxREI4Zm9Q5jiBvSXB1CIcvFRHUb961edeeaSRd9CkEhjNgu+n1KBBKqb3ILYLtw0kxVn2NF9TnhqCRVTBTaadZjo1hoP5RaQMkHc5BnEPeVuqIFa6CLn1LEQ= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(211171220733660); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231221)(944501327)(52105095)(3002001)(10201501046)(93006095)(93001095)(6055026)(6041310)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(6072148)(201708071742011); SRVR:AM5PR0402MB2771; BCL:0; PCL:0; RULEID:; SRVR:AM5PR0402MB2771; X-Forefront-PRVS: 0637FCE711 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6049001)(366004)(396003)(39380400002)(39860400002)(376002)(346002)(189003)(199004)(52314003)(23676004)(5890100001)(956004)(68736007)(77096007)(2486003)(6916009)(52146003)(16526019)(6666003)(52116002)(186003)(26005)(105586002)(58126008)(316002)(50466002)(64126003)(16576012)(106356001)(65806001)(386003)(55236004)(229853002)(65956001)(86362001)(53546011)(575784001)(31696002)(478600001)(59450400001)(67846002)(76176011)(11346002)(486006)(6486002)(5009440100003)(66066001)(7736002)(8676002)(47776003)(53936002)(8936002)(2906002)(4326008)(305945005)(65826007)(2870700001)(31686004)(3846002)(25786009)(6246003)(81166006)(446003)(97736004)(5660300001)(81156014)(2616005)(36756003)(476003)(6116002)(110426004); DIR:OUT; SFP:1101; SCL:1; SRVR:AM5PR0402MB2771; H:[10.232.14.39]; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtBTTVQUjA0MDJNQjI3NzE7MjM6RWNsQlBnMjNpSzNhd2E0ZkxyVjJiMDJr?= =?utf-8?B?bzB0SWR6NDdjNTRFS1dHcmxDanlyTmM5aUFodktLcmxneklXdk54Z0laNjNi?= =?utf-8?B?S1RFV1ROSlZ6NmV1WEJqTjZGU2VWME5jUS9vZW9ZNTBieGdsVjZIMFo5SXRN?= =?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+vFiC7kkBTZdWP6m9aVgG+Ri3s1oqvNbFqQcO7AWtEd41vGg/G8XQ/FZrBQE5U8O2u1j4LDDqJADgw9cl0moPn3/WiXCZMRaKb4FNitGNBESpuTOSVYX7YA=; 24:f2afxzAwLkEtTa9eGA5G/fnxwivXuH6UtYzAodJxt5h4XiarPComIp5b3UZsTa70DJMQ7WyUKMN80qy6EZ5MWZnLgZTUtFM9xe/i0ynhI08= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM5PR0402MB2771; 7:zJqPLSzYXsQ2nmDDxAd6yW8fgOPXPmnqqA5uupovQLOL9SVwu3TGRW2Osmkk3dq2tJXvJJGSb9yRAsiuVYR7kGgFuyjOHj/OAuMicpb1autkOvwqq/qyBYwR8Ho/4K64IMkKAWK2sNzNfeDtCQDuGuyN2ANs8E0IGaHdmEFK15P7bqA2KK3MyjqNOIDagTgwZevC2FT7Wxo7IlUYpC8tssTq4x3+CgluvDC9P3ZD0Z5YVgxRo55UOVlPjBSKC+3R X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Apr 2018 07:34:05.9814 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 74ee59e2-4fe2-459f-fa72-08d59dec46ac X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0402MB2771 Subject: Re: [dpdk-dev] [PATCH] bus/fslmc: support for hotplugging of memory 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, 09 Apr 2018 07:34:08 -0000 Hello Anatoly, On Sunday 08 April 2018 10:44 PM, Burakov, Anatoly wrote: > On 05-Apr-18 3:14 PM, Shreyansh Jain wrote: >> Restructure VFIO DMA code for handling hotplug memory events >> (callbacks) and --legacy case. >> >> Signed-off-by: Shreyansh Jain >> --- >> >> ### >> This is based on the 16fbfef04a3 github repository. This is assuming >> that changes already exists as done in patch 26/68. >> Though, this can be a standalone, replacing 26/88. Though, the Makefile >> changes don't exist in this. >> Also, this just a first draft. I will push any review changes after this >> incrementally over v4. >> ### > > Hi Shreyansh, > > I think we can keep the 26/68 as it still works within the context of > the patchset. I would like to add these changes closer to the end, where > we enable support for callbacks in VFIO (this could/should come as the > next patch). But then it would also mean that dpaa2 would be broken within the memory hotplug patches? I think it would be broken once the memseg ceases to be continuous physical sets. > > That said, i took some liberties when integrating this patch, hopefully > for the better. I know you mentioned it's a draft, so you can post any > comments for the inevitable v4 :) > >> >>   drivers/bus/fslmc/fslmc_bus.c    |  15 ++++ >>   drivers/bus/fslmc/fslmc_vfio.c   | 161 >> +++++++++++++++++++++++++++++++++++---- >>   drivers/bus/fslmc/fslmc_vfio.h   |   1 + >>   drivers/net/dpaa2/dpaa2_ethdev.c |   1 - >>   4 files changed, 163 insertions(+), 15 deletions(-) >> >> diff --git a/drivers/bus/fslmc/fslmc_bus.c >> b/drivers/bus/fslmc/fslmc_bus.c >> index 5ee0beb85..50884ff3a 100644 >> --- a/drivers/bus/fslmc/fslmc_bus.c >> +++ b/drivers/bus/fslmc/fslmc_bus.c >> @@ -266,6 +266,21 @@ rte_fslmc_probe(void) >>           return 0; >>       } >> +    if (rte_log_get_global_level() >= RTE_LOG_DEBUG) >> +        rte_dump_physmem_layout(stdout); > > Presumably, this is not needed - just debug leftovers? Yes, and can be removed. > >> + >> +    /* Map existing segments as well as, in case of hotpluggable memory, >> +     * install callback handler. >> +     */ >> +    ret = rte_fslmc_vfio_dmamap(); >> +    if (ret) { >> +        FSLMC_BUS_LOG(ERR, "Unable to DMA map existing VAs: (%d)", >> +                  ret); >> +        /* Not continuing ahead */ >> +        FSLMC_BUS_LOG(ERR, "FSLMC VFIO Mapping failed"); >> +        return 0; >> +    } >> + > > What happens if there are no devices on the bus that can be used by > DPDK? As far as i can tell, it would return error, which may or may not > be desirable (failing to map anything because there aren't any fslmc > devices is not an error?). ## If no devices found on the bus: Call wouldn't have reached here. There is a jump out in rte_fslmc_probe in case no devices were scanned on the bus. --->8--- rte_fslmc_probe() --- ... if (TAILQ_EMPTY(&rte_fslmc_bus.device_list)) return 0; ... --->8--- ## Assuming you are pointing to 'return 0': So, the rte_eal_scan/probe doesn't expect to be interrupted just because one of the buses had issues (whether no devices found, not a real issue). It would continue ahead with scan/probe. But, I think error should be returned so that rte_eal_probe can dump to logs the error and continue ahead normally. I will fix this. > > For "regular" VFIO, the container is an empty shell unless you add > groups into it - does fslmc VFIO support work differently, and container > is already working/initialized by the time we reach this point? FSLMC VFIO Container is not much different from generic container. But, at this point in code, the container is already initialized (group is connected to it, and relevant device fds extracted). Only thing pending beyond this point is to look into the container and initialize various fslmc specific devices contained *within* the group. And, dma mapping of regions which is done using the newly introduced code. > > Anyway, i'll leave this as is. OK. > >>       ret = fslmc_vfio_process_group(); >>       if (ret) { >>           FSLMC_BUS_LOG(ERR, "Unable to setup devices %d", ret); >> diff --git a/drivers/bus/fslmc/fslmc_vfio.c >> b/drivers/bus/fslmc/fslmc_vfio.c >> index 31831e3ce..60725fb70 100644 >> --- a/drivers/bus/fslmc/fslmc_vfio.c >> +++ b/drivers/bus/fslmc/fslmc_vfio.c >> @@ -30,6 +30,7 @@ >>   #include >>   #include >>   #include >> +#include > > <...> > >> +} >> + >>   static int >> -fslmc_vfio_map(const struct rte_memseg_list *msl __rte_unused, >> -        const struct rte_memseg *ms, void *arg) >> +#ifdef RTE_LIBRTE_DPAA2_USE_PHYS_IOVA >> +fslmc_map_dma(uint64_t vaddr, rte_iova_t iovaddr, size_t len) >> +#else >> +fslmc_map_dma(uint64_t vaddr, rte_iova_t iovaddr __rte_unused, size_t >> len) >> +#endif > > I think i'll leave this as just "rte_iova_t iovaaddr __rte_unused" :) Hmm, it is harmless if used without the enclosing #defines. But, i don't know if any compiler has any side-effects attached to this - for example, clang reporting this as error, etc. > >>   { >> -    int *n_segs = arg; >>       struct fslmc_vfio_group *group; >>       struct vfio_iommu_type1_dma_map dma_map = { >>           .argsz = sizeof(struct vfio_iommu_type1_dma_map), >> @@ -205,10 +263,11 @@ fslmc_vfio_map(const struct rte_memseg_list *msl >> __rte_unused, >>       }; >>       int ret; >> -    dma_map.size = ms->len; >> -    dma_map.vaddr = ms->addr_64; >> +    dma_map.size = len; >> +    dma_map.vaddr = vaddr; > > <...> > >>       if (is_dma_done) >>           return 0; > > I suspect this check was needed because you've done VFIO mapping on > device probe as opposed to bus probe, so VFIO mapping function could've > been called multiple times. Is that still the case, or is this check no > longer needed? I took the liberty to remove it. Yes, that is correct. Now that device probe vfio is disabled, it is safe to remove this check. > >> -    if (rte_memseg_walk(fslmc_vfio_map, &i) < 0) >> +    /* Lock before parsing and registering callback to memory >> subsystem */ >> +    rte_rwlock_read_lock(mem_lock); >> + > > <...> > >>       return 0; >> diff --git a/drivers/bus/fslmc/fslmc_vfio.h >> b/drivers/bus/fslmc/fslmc_vfio.h >> index e8fb3445f..e77e4c4ac 100644 >> --- a/drivers/bus/fslmc/fslmc_vfio.h >> +++ b/drivers/bus/fslmc/fslmc_vfio.h >> @@ -9,6 +9,7 @@ >>   #define _FSLMC_VFIO_H_ >>   #include >> +#include >>   #include "eal_vfio.h" > > I suspect this change is not needed? I took the liberty to remove it. > I remember when I was using your initial patch, this I added based on structures being unresolved. It is possible that is not longer the case (and that I too have moved a lot of code beyond the first internal draft). If it compiles OK, no need for this. - Shreyansh