From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0088.outbound.protection.outlook.com [104.47.34.88]) by dpdk.org (Postfix) with ESMTP id 6FD251C7C9 for ; Sun, 8 Apr 2018 04:19:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=y8tlXOtMPuFYmPh6YENkrTK2y+hNQqJMwR11etEFrgc=; b=AjtH3ucPvcJQJ6zQVyDnBMMTZoBzCFtAsaniUt4VmMA/R5H94gaP2y7BzpWNQruXJU22/1+Y3fQM2XecT/MYRVs0RxBsYr/emzB11j6DTChCIlxD4LHL/88nHTxLp/97DEXCULz2JZ0r4mOIfPlZ7CyCS2VEDDT28LieU5+nnYw= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.JacobKollanukkaran@cavium.com; Received: from jerin (122.178.210.9) by CY1PR07MB2523.namprd07.prod.outlook.com (2a01:111:e400:c636::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.653.12; Sun, 8 Apr 2018 02:19:39 +0000 Date: Sun, 8 Apr 2018 07:49:19 +0530 From: Jerin Jacob To: Pavan Nikhilesh Cc: santosh.shukla@caviumnetworks.com, erik.g.carrillo@intel.com, dev@dpdk.org Message-ID: <20180408021918.GA13341@jerin> References: <20180216213700.3415-1-pbhagavatula@caviumnetworks.com> <20180403150514.24201-1-pbhagavatula@caviumnetworks.com> <20180403150514.24201-2-pbhagavatula@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180403150514.24201-2-pbhagavatula@caviumnetworks.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-Originating-IP: [122.178.210.9] X-ClientProxiedBy: MAXPR0101CA0051.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:e::13) To CY1PR07MB2523.namprd07.prod.outlook.com (2a01:111:e400:c636::14) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: adc4474c-20ba-4f53-fdb4-08d59cf72f82 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(2017052603328)(7153060)(7193020); SRVR:CY1PR07MB2523; X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2523; 3:OxqCROmvkwHiM9aR4lqV1hZAZIcfQAoL+1IM3mOrxO67paZJsh/BZBM2g4WRVv7tKQsgUEJO6wvr0OS6t6itnVARtwLVCKetvTxcd9mdKcCcUf2wlwcAJd9Ku7p8qNaEGZevrZysPrJ7DUpqkJMWCOcXpnMBwdKFBSh/dW8A1k7EBZcfmOFBlsxNUEhLx728kN3J1hACP0YbIRdpktWBOOQN1zZXgIll1Wse5a6V9ynJSXfrEZwa9+AZvymZLZrY; 25:sxJCWeuUDUWlMKM2eH8wO6cBcj2HxP0tlqHtQEUm0Z2nwo6ZOdLwGwpwlYViOjq2pX4SWLUSwNAfyhzDr041DXB+1+R0O/rlcdfh/od10gLNnBfwSOq+D3Ee6JkX32dMKiA9G9392r2Je7WRVFaiYTnoUnsfTcTbGYolhxAf8kMkTw7gnkwrvU2F+rWvpJlx5dgDphZ4HLsufUucx2CuRnvskPdthSbswWDgPu3bBitlheAasijWRQPaH3B6eG13pjdf8vhCusrXoWzfwkTgh6zd4CDTPyYlJQfeeIB0zBQ30DAMRo+YltroUu/5UlKtxrNfclsxUTLlSgQvHw0A8w==; 31:zesbkwT6jWzZnk/HbnEn8TOeJRK+JBefw3bbx1/NtfXy272NAbWmjV6RsisvpqZCWQjCUbYkModUeQgYps35NXp/41yb0USUb77aZGITc8M8qWR7A/NTLVyT/oe45TPHjpA/I5wDSVMqXVSCFRsW0nMi1SnY37uqAfQeKpofxL0IiTsyUxk+G3B8HdcZEduuC+P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-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(10201501046)(93006095)(3231221)(944501327)(52105095)(6041310)(20161123562045)(20161123558120)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(6072148)(201708071742011); SRVR:CY1PR07MB2523; BCL:0; PCL:0; RULEID:; SRVR:CY1PR07MB2523; X-Forefront-PRVS: 0636271852 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(39850400004)(39380400002)(366004)(346002)(396003)(13464003)(199004)(189003)(42882007)(4326008)(58126008)(6116002)(16586007)(3846002)(105586002)(33716001)(6636002)(6862004)(486006)(6246003)(575784001)(9686003)(81166006)(81156014)(53936002)(8676002)(478600001)(6666003)(23726003)(97736004)(47776003)(316002)(66066001)(55016002)(16526019)(5660300001)(7736002)(386003)(72206003)(446003)(26005)(305945005)(476003)(59450400001)(50466002)(11346002)(1076002)(33896004)(106356001)(25786009)(2906002)(76176011)(33656002)(52116002)(6496006)(956004)(68736007)(8936002)(229853002)(18370500001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR07MB2523; H:jerin; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR07MB2523; 23:WSwsGVBAVVMH3JAxA766B8xlmFyzNN19bs0u6EAy2?= =?us-ascii?Q?78N8nuVS5L639ZyWI/DS4fDAAu12ch5VcJvmjnaHjKjbR43t003CMU3e8XIc?= =?us-ascii?Q?2K5y+gGgFhYJDKhBx+4jjJ2L7g7I67qT838VsxKLuQNp5/QRazL0aJhMAzIr?= =?us-ascii?Q?oxnmkKE9mBj/YtyfRouSk7DPgf/kCbyxrblLPIgDKut+kj8KQKU5nQjaEC9K?= =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 5:Mhj8GD4z2sH6+nWT++UxzpejeKrgUiEgKuMf6ub0TJVuMghNoNEV3RVKIg/+4WmWPt1rm/F544hx5u2CRHKV+RHQ7jwubnWInvjP6ByYfmXCTuJXfo2XyVLMf2L2cgWKNVD4RQAgXeN87aN8mDgC7esBpMxaEQBL6h6P4r+/DoA=; 24:Yi6AhCSSqSCMaFOTV1Y6+Ys8PlEwrllE1SXScqfjCMY0bVeBzJz+2r3Y062KHowH4t3ZV934wmRNZBojuDMr8jN1uVJiv/NoqC7iqkq/rhI= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2523; 7:0KTn/IK3tZgQuaVMKs4F5H2/6bVsIxq9B09LwmCtuE2B1vp6XbCIHT6ieueKo5FLfS2MCHP2dWT5q7YoU+vHkBgtqFOrQORNXDqo9P0ZAKJem7msiWdweg8t1ZbT7wwpA61yw9A93/6iyfuE09biapB06Py2VHZb+waughbO2hlrHvj9xtQAUyS8tbkb9bFyUCotV2zfmEex5OSm8SN2Pp2uu2dT0eI4VX6+F9P5rYUP1MVt5jPQYTwSnYGE/DI1 X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Apr 2018 02:19:39.4824 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: adc4474c-20ba-4f53-fdb4-08d59cf72f82 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR07MB2523 Subject: Re: [dpdk-dev] [PATCH v3 01/12] mempool/octeontx: probe timvf PCIe devices 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: Sun, 08 Apr 2018 02:19:45 -0000 -----Original Message----- > Date: Tue, 3 Apr 2018 20:35:03 +0530 > From: Pavan Nikhilesh > To: jerin.jacob@caviumnetworks.com, santosh.shukla@caviumnetworks.com, > erik.g.carrillo@intel.com > Cc: dev@dpdk.org, Pavan Nikhilesh > Subject: [dpdk-dev] [PATCH v3 01/12] mempool/octeontx: probe timvf PCIe > devices > X-Mailer: git-send-email 2.16.3 > > On Octeontx HW, each event timer device is enumerated as separate SRIOV VF > PCIe device. > > In order to expose as a event timer device: > On PCIe probe, the driver stores the information associated with the > PCIe device and later when appliacation requests for a event timer device > through `rte_event_timer_adapter_create` the driver infrastructure creates > the timer adapter with earlier probed PCIe VF devices. > > Signed-off-by: Pavan Nikhilesh > --- > drivers/mempool/octeontx/Makefile | 1 + > drivers/mempool/octeontx/meson.build | 1 + > drivers/mempool/octeontx/octeontx_mbox.h | 7 + > drivers/mempool/octeontx/octeontx_timvf.c | 145 +++++++++++++++++++++ Now that, we have driver/common for mailbox. Please move the octeontx_timvf.c to driver/event/octeontx/timvf_probe.c > .../octeontx/rte_mempool_octeontx_version.map | 3 + > 5 files changed, 157 insertions(+) > create mode 100644 drivers/mempool/octeontx/octeontx_timvf.c > > diff --git a/drivers/mempool/octeontx/Makefile b/drivers/mempool/octeontx/Makefile > index dfc373e62..a0547437a 100644 > --- a/drivers/mempool/octeontx/Makefile > +++ b/drivers/mempool/octeontx/Makefile > @@ -20,6 +20,7 @@ LIBABIVER := 1 > SRCS-$(CONFIG_RTE_LIBRTE_OCTEONTX_MEMPOOL) += octeontx_ssovf.c > SRCS-$(CONFIG_RTE_LIBRTE_OCTEONTX_MEMPOOL) += octeontx_mbox.c > SRCS-$(CONFIG_RTE_LIBRTE_OCTEONTX_MEMPOOL) += octeontx_fpavf.c > +SRCS-$(CONFIG_RTE_LIBRTE_OCTEONTX_MEMPOOL) += octeontx_timvf.c > SRCS-$(CONFIG_RTE_LIBRTE_OCTEONTX_MEMPOOL) += rte_mempool_octeontx.c > > ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y) > diff --git a/drivers/mempool/octeontx/meson.build b/drivers/mempool/octeontx/meson.build > index 1e894a56b..c938436c9 100644 > --- a/drivers/mempool/octeontx/meson.build > +++ b/drivers/mempool/octeontx/meson.build > @@ -4,6 +4,7 @@ > sources = files('octeontx_ssovf.c', > 'octeontx_mbox.c', > 'octeontx_fpavf.c', > + 'octeontx_timvf.c', > 'rte_mempool_octeontx.c' > ) > > diff --git a/drivers/mempool/octeontx/octeontx_mbox.h b/drivers/mempool/octeontx/octeontx_mbox.h > index 1b056071a..7fcc9950f 100644 > --- a/drivers/mempool/octeontx/octeontx_mbox.h > +++ b/drivers/mempool/octeontx/octeontx_mbox.h > @@ -21,6 +21,11 @@ enum octeontx_ssovf_type { > OCTEONTX_SSO_HWS, /* SSO hardware workslot vf */ > }; > > +struct octeontx_timvf_info { > + uint16_t domain; /* Domain id */ > + uint8_t total_timvfs; /* Total timvf available in domain */ > +}; > + > struct octeontx_mbox_hdr { > uint16_t vfid; /* VF index or pf resource index local to the domain */ > uint8_t coproc; /* Coprocessor id */ > @@ -32,5 +37,7 @@ int octeontx_ssovf_info(struct octeontx_ssovf_info *info); > void *octeontx_ssovf_bar(enum octeontx_ssovf_type, uint8_t id, uint8_t bar); > int octeontx_ssovf_mbox_send(struct octeontx_mbox_hdr *hdr, > void *txdata, uint16_t txlen, void *rxdata, uint16_t rxlen); > +int octeontx_timvf_info(struct octeontx_timvf_info *info); > +void *octeontx_timvf_bar(uint8_t id, uint8_t bar); > > #endif /* __OCTEONTX_MBOX_H__ */ > diff --git a/drivers/mempool/octeontx/octeontx_timvf.c b/drivers/mempool/octeontx/octeontx_timvf.c > new file mode 100644 > index 000000000..b20743a33 > --- /dev/null > +++ b/drivers/mempool/octeontx/octeontx_timvf.c > @@ -0,0 +1,145 @@ > +/* SPDX-License-Identifier: BSD-3-Clause > + * Copyright(c) 2017 Cavium, Inc > + */ > + > +#include > +#include > +#include > +#include > + > +#include "octeontx_mbox.h" > +#include "octeontx_pool_logs.h" > + > +#ifndef PCI_VENDOR_ID_CAVIUM > +#define PCI_VENDOR_ID_CAVIUM (0x177D) > +#endif > + > +#define PCI_DEVICE_ID_OCTEONTX_TIM_VF (0xA051) > +#define TIM_MAX_RINGS (64) > + > +struct timvf_res { > + uint16_t domain; > + uint16_t vfid; > + void *bar0; > + void *bar2; > + void *bar4; > +}; > + > +struct timdev { > + uint8_t total_timvfs; > + struct timvf_res rings[TIM_MAX_RINGS]; > +}; > + > +static struct timdev tdev; > + > +int > +octeontx_timvf_info(struct octeontx_timvf_info *tinfo) > +{ > + int i; > + struct octeontx_ssovf_info info; > + > + if (tinfo == NULL) > + return -EINVAL; > + > + if (!tdev.total_timvfs) > + return -ENODEV; > + > + if (octeontx_ssovf_info(&info) < 0) > + return -EINVAL; > + > + for (i = 0; i < tdev.total_timvfs; i++) { > + if (info.domain != tdev.rings[i].domain) { > + mbox_log_err("GRP error, vfid=%d/%d domain=%d/%d %p", > + i, tdev.rings[i].vfid, > + info.domain, tdev.rings[i].domain, > + tdev.rings[i].bar0); > + return -EINVAL; > + } > + } > + > + tinfo->total_timvfs = tdev.total_timvfs; > + tinfo->domain = info.domain; > + return 0; > +} > + > +void* > +octeontx_timvf_bar(uint8_t id, uint8_t bar) > +{ > + if (rte_eal_process_type() != RTE_PROC_PRIMARY) > + return NULL; > + > + if (id > tdev.total_timvfs) > + return NULL; > + > + switch (bar) { > + case 0: > + return tdev.rings[id].bar0; > + case 4: > + return tdev.rings[id].bar4; > + default: > + return NULL; > + } > +} > + > +static int > +timvf_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev) > +{ > + uint64_t val; > + uint16_t vfid; > + struct timvf_res *res; > + > + RTE_SET_USED(pci_drv); > + > + /* For secondary processes, the primary has done all the work */ > + if (rte_eal_process_type() != RTE_PROC_PRIMARY) > + return 0; > + > + if (pci_dev->mem_resource[0].addr == NULL || > + pci_dev->mem_resource[4].addr == NULL) { > + mbox_log_err("Empty bars %p %p", > + pci_dev->mem_resource[0].addr, > + pci_dev->mem_resource[4].addr); > + return -ENODEV; > + } > + > + val = rte_read64((uint8_t *)pci_dev->mem_resource[0].addr + 0x100); Remove 0x100 hard code or add extra comment, something like, 0x100 /* TIM_VRINGX_BASE */ > + vfid = (val >> 23) & 0xff; > + if (vfid >= TIM_MAX_RINGS) { > + mbox_log_err("Invalid vfid(%d/%d)", vfid, TIM_MAX_RINGS); > + return -EINVAL; > + } > + > + res = &tdev.rings[tdev.total_timvfs]; > + res->vfid = vfid; > + res->bar0 = pci_dev->mem_resource[0].addr; > + res->bar2 = pci_dev->mem_resource[2].addr; > + res->bar4 = pci_dev->mem_resource[4].addr; > + res->domain = (val >> 7) & 0xffff; > + tdev.total_timvfs++; > + rte_wmb(); > + > + mbox_log_dbg("Domain=%d VFid=%d bar0 %p total_timvfs=%d", res->domain, > + res->vfid, pci_dev->mem_resource[0].addr, > + tdev.total_timvfs); > + return 0; > +} > + > + > +static const struct rte_pci_id pci_timvf_map[] = { > + { > + RTE_PCI_DEVICE(PCI_VENDOR_ID_CAVIUM, > + PCI_DEVICE_ID_OCTEONTX_TIM_VF) > + }, > + { > + .vendor_id = 0, > + }, > +}; > + > +static struct rte_pci_driver pci_timvf = { > + .id_table = pci_timvf_map, > + .drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_IOVA_AS_VA, > + .probe = timvf_probe, > + .remove = NULL, > +}; > + > +RTE_PMD_REGISTER_PCI(octeontx_timvf, pci_timvf); > diff --git a/drivers/mempool/octeontx/rte_mempool_octeontx_version.map b/drivers/mempool/octeontx/rte_mempool_octeontx_version.map > index fe8cdeca0..91e0a3a93 100644 > --- a/drivers/mempool/octeontx/rte_mempool_octeontx_version.map > +++ b/drivers/mempool/octeontx/rte_mempool_octeontx_version.map > @@ -5,5 +5,8 @@ DPDK_17.11 { > octeontx_ssovf_bar; > octeontx_ssovf_mbox_send; > > + octeontx_timvf_info; > + octeontx_timvf_bar; We may not need to expose this once it is moved to driver/event/octeontx With above changes: Acked-by: Jerin Jacob > + > local: *; > }; > -- > 2.16.3 >