From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0076.outbound.protection.outlook.com [104.47.32.76]) by dpdk.org (Postfix) with ESMTP id CC825F973 for ; Fri, 3 Mar 2017 18:29:24 +0100 (CET) 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=T6lB79S1WMvxtMOaOrXnPeQxVwJGihIsrMnK6xvsqYw=; b=QevUPhALXtmbsCqw1hzUbEtv5PBQeTJ+OWuAbJ/x8xUL66EGR3JRkcjwQu8gCcj+3GusNKZJJsjnZqmAENQ0gnTdUYI0OuLc1ZxbxTcW8li+9ZqEyp2rm/WDsPJGBmpzz9m9+ALVRWhUounBclpv+AklRimcxs3N/peaJRzRL9c= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=caviumnetworks.com; Received: from localhost.localdomain.localdomain (14.140.2.178) by BN3PR0701MB1719.namprd07.prod.outlook.com (10.163.39.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.933.12; Fri, 3 Mar 2017 17:29:19 +0000 From: Jerin Jacob To: dev@dpdk.org Cc: thomas.monjalon@6wind.com, bruce.richardson@intel.com, harry.van.haaren@intel.com, hemant.agrawal@nxp.com, gage.eads@intel.com, nipun.gupta@nxp.com, santosh.shukla@caviumnetworks.com, Jerin Jacob Date: Fri, 3 Mar 2017 22:57:49 +0530 Message-Id: <1488562101-6658-8-git-send-email-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1488562101-6658-1-git-send-email-jerin.jacob@caviumnetworks.com> References: <1488562101-6658-1-git-send-email-jerin.jacob@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [14.140.2.178] X-ClientProxiedBy: BMXPR01CA0021.INDPRD01.PROD.OUTLOOK.COM (10.174.214.159) To BN3PR0701MB1719.namprd07.prod.outlook.com (10.163.39.18) X-MS-Office365-Filtering-Correlation-Id: a8dba7a1-96d5-4a35-37fa-08d4625ad531 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BN3PR0701MB1719; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 3:r4sNoN6+wEomb+QccCYqWiaZMXGlLazIwBUbOBME+JevN1Ky1x5IXYTbSitjRktyF5vMQVydzExGBig5USBlrQItSozCb2vOaSJ40ZY4m9xswv619Y3rb8GDcyTMK8yM2kUFugDYJhdw4X8gLTauEV1qWoJMRQt/995xQPxmiPdme6Yb/+66OZpMlNVWCYuAallHRMHT0IxyPmB9DWv5k1BZWrBzdUcL9Zz6pU8NpxkffgHy4G4HTly04JM/qM2Cv/Tj1ivFXo5+e6ESzOPxhQ==; 25:mflwszJPJPdWoVlAMzvuy72QjJ+4fwDWyJQjwLB+LOc4XIFPB2+3tu7s3KRpKP9sJRq/iqp9ZRjoAsP/I4J1YMJ6rJj5FnKpoHMUohcxxQAknAjdmNbcFm6z8ApH2wtpaYhSY60/0gsVyD8AbH4R+vyN1QqjQie0EeAg3z4CN6eAB/jJ93HsLvlXm6CeJC00KhmjFTHfK8Wr0Pb3F/d3GcaQXl/mCt3NEk0Qk9Ef5LMbQfycMxxaKRgZ1BVSKTdZRjbiAFp3Dp5wOpO9NmsSfN5UGPx9oomqh34b4iFKhZDN3j6uSb7YF+8VaggpiwofQtmpGzVisGtnFk+5hY7HiK7PTH5vQt2r2A8Vxy/ItPFXub7t4wp2k+CZtX3Km9ZBsuZZFPCTxFRHSErx6QfMSmG9555u4bLI07R4dhucR2Med4ZCL4l0P0Fsft7HT7P1PnhEV+lvhaczH2PS3tIA4A== X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 31:VKnaf0izkf4RPOsy9XMdo0do5di18wT73sUNSRZsZs7HtmFZkyxnAP2LaAa0UDSS50NOlwhErzNA5vmbwkiIyiMe83yP8lU/yHBxvCQFSDJ2lZ9D7aauYJqxxlDl8URCZlkvl5FuZsRxuOh7zypLUmupXaN42XKqrP81He8mu5/R2QUqN9AqciD/ThjHgYA8H9l+EFdxIxlsnRc4BkAkGzj2zbZ5LJ6yObuyDMLpJSRyeRTfYCfFPfyznNKBDZt/; 20:/jhKCkDRj2yDpq9aIrOBz/ZtuuvT9H2KQWPt4cX7SAzdb7WOzC9bEZjlsUlONLlkZnjCcu8Jw5Iglkrcpxq/SrpjjuJeU+cl/ZQcpLe2EwN409HwY49eNkC9Y2LMYj9E9d1zmqd8rT2BSB/YxBs6wZy/6oERR3olUGUUD16Ty8jsRXTEYUxC7IcXG2oiUPgnq8/Ws0o5+NvtPq1nVuwbDB/WAjH5lMIDk5/Vcf4SJYMUc7jcKqlCVxTDVBlSPEZIjgtJMLgrZQzBI+1zmETKSREY0WJyN224I/Zcb4ELzToCfBty686oZW7gq9bN5KXXHBt06/X+TJgr7kJiQ5pT4O0iyROjgxPFNyIJ2yqn1YU7luHjNh0+d/Tkf/8AIrG21y5GprURgp3pHXvXMsG/rKM5fe/Si3dIjSGIjQUKpufEMGEpfbXR4WmXGfbHUd5yHGe7WuG5QxG+YMSe4eTYdBHCRjmpCsNbgDpyOhfR/zkkQ7l8Zq7DXGZGNx/JHo5p6nmU5haWzEf5JQux/n8aAgsEElHMxL8YIyXaaacL/NLzE9wxbDoQRX6fpYQ415zJJoNGsR59TpE2zmZJOu59fc91LcqZb728egUgdL632jQ= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6041248)(20161123555025)(20161123560025)(20161123562025)(20161123558025)(20161123564025)(6072148); SRVR:BN3PR0701MB1719; BCL:0; PCL:0; RULEID:; SRVR:BN3PR0701MB1719; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 4:QnbQYItns1/BFgHmy4RM+gXeWT+NTaKcxyNXjZ1e2gWN4aKkp/wJkxv6bKOI049sHc89gG4lvs5SSkkTgRPcw33ca8WXt9q25tQFxdQB67v1xAUO7CUYvmhL+RSIiRzDZy/CRX0MWFxtuDp5lt/Np7Lj9cpToHT9hTElXnvRXRoeM+p9W6bFD/8NeDS3jqKQg+LUhVIO+LExbVjjve+xGpEBUuTZC4SNdiwuG/p8gI0iCE47xt9Vs8VG65kQ2h7xq3YbEJCMlrgNNnTT+i+K7vniFqHt7CTfmAeZxpAw/i4qjTYqGeswFvX+P/Eu8FrOnz7Hlip+sdX8FhDRqDcZe3pJs2sBtHoGdg8yNosZuo64zQnECCB8MJeF+imNBVINE78Nch7bWbAOYfeyNMHr2xjOJcH4uQO/8t5tVtPsEZmG4wZCfT4l7t7640pFgNu6tNYj5ZxL0tz3iOFtLG4h8xqaz3LemP63dATR5c4c28zCuRPDCdL2WRwFvPonr/q8jYDeN9GyVFaU8aMPfFA2mOURzb7KmKfrtuwAEsZ2UcZ7nbhFs7dymx74v3eFBLSF0C+qAc9WDOmSGtxFgHpLLBHhlgNDsHdUV3ZdmD00hU4= X-Forefront-PRVS: 0235CBE7D0 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6069001)(6009001)(7916002)(39450400003)(3846002)(50986999)(6116002)(36756003)(81166006)(6512007)(97736004)(2361001)(2351001)(6506006)(5660300001)(42186005)(50226002)(8676002)(6666003)(106356001)(8656002)(2950100002)(2906002)(25786008)(47776003)(6486002)(76176999)(33646002)(7736002)(107886003)(42882006)(66066001)(110136004)(4326008)(38730400002)(6916009)(305945005)(48376002)(92566002)(5009440100003)(5003940100001)(50466002)(189998001)(53936002)(7099028)(110426004); DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR0701MB1719; H:localhost.localdomain.localdomain; FPR:; SPF:None; MLV:nov; PTR:InfoNoRecords; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN3PR0701MB1719; 23:NyFGQBGGGLWPmPqmy8UwYkL951hq0NzEO1cEI46?= =?us-ascii?Q?th7iWCgLGdXjNfFDGfGoEowSXa+E03sAzeNCRA4hjflwrhfk0f6El92C1bF+?= =?us-ascii?Q?Mjdh6lsaOJLIZuz+cqeIBQJjaDguG031kpTVjMEXsYw0js3xnYsfU+ducNn0?= =?us-ascii?Q?Cc9esFNXfZDYYRDxY8gdpCgOgcppUGosaOWSplqdR39yI8Ql5Un0oseiS44c?= =?us-ascii?Q?M4/LeZpWrTQ3kpEhW+wLJ08KQnRwfB2h+zOrRBHRYYct51oejUMJpUKepHcu?= =?us-ascii?Q?1DMN/AxID8gHEqwygvtv5tOGS14Wk8vweKnTqysZzLUYsVlJ56r0lA7c7jlw?= =?us-ascii?Q?/ZLezk8qiq4LkAm1Y5hXQphQ3qgx90LUBKEv0aRUANN9mnwG272/S/9sokqJ?= =?us-ascii?Q?lR9XPGySWUa7utfoLnxZ0cZa88QjGSqa6X+eMUvwoZdGFhI5g8pSPfAV3FkW?= =?us-ascii?Q?dx1Z6impGGVHJahRS6Yo84Fv3xaUdnGKjXkKPLXmfm5exceYV2u0vfu4UOK6?= =?us-ascii?Q?sew3r4DVcS2edbWtIzCeS1bF8QedbIpDHpDADIi+VEVDGNCjhy1t0TE2E+8R?= =?us-ascii?Q?ntfI7mwPnikluYDfecqfAVnO5Pk70oSrSHGDE9xsRcdyeb/kvZT2KHZ8wMJU?= =?us-ascii?Q?+85P4fF59rc7lNx0UW6xrudBPRvmlpvTKuaq1xh12uOdb63r/c+bhfK0AJ+o?= =?us-ascii?Q?Jd/jMSnkuKUD8Feo8Cj1tHQajSPKGbd+BDXMwRm/nhlU8QgeEcVR/yQjdQZn?= =?us-ascii?Q?vPBW1azWmid9tXl6cavH+PerAxq37vuXaAHJHrXtyXnqH7a+u4gbdcmQMYur?= =?us-ascii?Q?xCZ53iaENB5n3cePlyq71zyd2MCkl3qEI3YkrCnu+OM6LF+UslLGkEmxfEOZ?= =?us-ascii?Q?Il2B7UfBr+PO5HStGL55i0gY5JAwrce71lMzitNUVLWjP2z57Iik24xMitm9?= =?us-ascii?Q?pGBxoA9ZCHGm4aPeTPMwiSv18W7X3SCnUtidgtXugbGtq8dYM817Rc2UMmJz?= =?us-ascii?Q?8QhUcJgkfsmblZycGpKldQ4wtTvvCi8jcP4mnrNa5sl+PWWp9QTUNEGLV0bH?= =?us-ascii?Q?OWsdWY2Asx7aD76fNEmQ8iA4ieIFBOrjS0ooSLstB3B5Cn/aWDIAJl/yNWKT?= =?us-ascii?Q?BUm8Rc7i9ekNf4hWQ5noQocxV/b47snLp?= X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 6:+RygBkH9TiWhh4rsF3b4la3dXrNpUvsRkDmcsZwxEA699HMFSgUcw8cStYOoZjTfPiqFUGCbYTTa2GOA3hlbt9P6gMejKdp2bQPXylEqFbn4PUwmGfFK2lGtHwWrNFZDw14jiP7D4gKuqmSQ/oO/Ztf2X+5dQaaOToJ/bnxJzPFz1AWaH/qQp/A1l8jJGRG3b0CvVEWXE/HUqUAsFauIMl6wCtqr9mgnJ9Y3w/qso1ONHLAn0GR788vVHE1E79KgL39RBrcoy7PYFkc4kh1hm0NwzbLM3EYsQOMTbT37IP8LyxXCJUVs3HW7Xv6ImYZjNLVdX5TZWrGiD+gXfp3iIXXCnwkd0i0GjF7wQXSRNS7Qfr7CGrKBR7HA5MnXK8sLFEi0w5uOIsYfaOg5lvhDXg==; 5:oj/3MwEhblnEDwXEEjs1ZlEVjs6O6kGCdULhe/cws9GdEoyAb+eQ6BvbVVYfAmrSO5cJsug97eniU/2Kk+WUj2YSDSpBAHzF96/SRQcEDsCKwiEUe/cKRnxHfkedLE1ioeyg5RTq0FtjnIQuC26dmQ==; 24:rnthkCPsTtCrSDqN6P78YiYGCqu+XgDzOf5biHLcxgj47b66CsYJ1NJJfCwrRfQekiq8qBLnQKyBRwor4JHDfSf+g2hAnUM+rD0NGbXcUkw= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 7:HdlNQwEHGNaRvrbxOMURRCOEwYWWjq+zTtm0YvWZ3lOkG9XyDAm16UXGEXdbAffF7+KMtTMbGrbrE0gbdTt5PSGr1YXWTrbnQQJDinV2FR36ZA02fryKBJPOrXm15N+K2y6GXWl5kdvrZT+K8xA/JooMQ0PWAaOWVZoZ1+bUbXUut437G1XVKME3p0FOaFYRy05pWgZAVdbzDWrbuDAQBjMwRs+EJgmLbgvE8F6lPQppbjuhXvRHeag4iMWszKfF9FCU9fTx/1X5NlfWLgsPwN+YoEbcfa1W9vX9PR7NT7yhBY7NSqTILy9hFobyr2XAFw3QtIZmg9pri2IXffzcYw== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Mar 2017 17:29:19.4745 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR0701MB1719 Subject: [dpdk-dev] [PATCH 07/39] event/octeontx: add vdev interface functions 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: Fri, 03 Mar 2017 17:29:25 -0000 ssovf and ssowvf PCIe VF devices are shared between eventdev PMD and ethdev PMD.This patch expose a set of interface API to get info about probed ssovf and ssowvf VF resources to use with eventdev and ethdev vdev devices latter. Signed-off-by: Jerin Jacob Signed-off-by: Santosh Shukla --- drivers/event/octeontx/Makefile | 3 + drivers/event/octeontx/rte_pmd_octeontx_ssovf.h | 53 ++++++++++++++ .../octeontx/rte_pmd_octeontx_ssovf_version.map | 4 ++ drivers/event/octeontx/ssovf_evdev.h | 2 + drivers/event/octeontx/ssovf_probe.c | 81 ++++++++++++++++++++++ 5 files changed, 143 insertions(+) create mode 100644 drivers/event/octeontx/rte_pmd_octeontx_ssovf.h diff --git a/drivers/event/octeontx/Makefile b/drivers/event/octeontx/Makefile index d72ad46..896e556 100644 --- a/drivers/event/octeontx/Makefile +++ b/drivers/event/octeontx/Makefile @@ -48,6 +48,9 @@ LIBABIVER := 1 # SRCS-$(CONFIG_RTE_LIBRTE_PMD_OCTEONTX_SSOVF) += ssovf_probe.c +# install this header file +SYMLINK-$(CONFIG_RTE_LIBRTE_PMD_OCTEONTX_SSOVF)-include := rte_pmd_octeontx_ssovf.h + # this lib depends upon: DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_OCTEONTX_SSOVF) += lib/librte_eal DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_OCTEONTX_SSOVF) += lib/librte_eventdev diff --git a/drivers/event/octeontx/rte_pmd_octeontx_ssovf.h b/drivers/event/octeontx/rte_pmd_octeontx_ssovf.h new file mode 100644 index 0000000..e92a61f --- /dev/null +++ b/drivers/event/octeontx/rte_pmd_octeontx_ssovf.h @@ -0,0 +1,53 @@ +/* + * BSD LICENSE + * + * Copyright (C) Cavium networks Ltd. 2017. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Cavium networks nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef __RTE_PMD_OCTEONTX_SSOVF_H__ +#define __RTE_PMD_OCTEONTX_SSOVF_H__ + +#include + +struct octeontx_ssovf_info { + uint16_t domain; /* Domain id */ + uint8_t total_ssovfs; /* Total sso groups available in domain */ + uint8_t total_ssowvfs;/* Total sso hws available in domain */ +}; + +enum octeontx_ssovf_type { + OCTEONTX_SSO_GROUP, /* SSO group vf */ + OCTEONTX_SSO_HWS, /* SSO hardware workslot vf */ +}; + + +int octeontx_ssovf_info(struct octeontx_ssovf_info *info); +void *octeontx_ssovf_bar(enum octeontx_ssovf_type, uint8_t id, uint8_t bar); + +#endif /* __RTE_PMD_OCTEONTX_SSOVF_H__ */ diff --git a/drivers/event/octeontx/rte_pmd_octeontx_ssovf_version.map b/drivers/event/octeontx/rte_pmd_octeontx_ssovf_version.map index 8591cc0..c71d4c7 100644 --- a/drivers/event/octeontx/rte_pmd_octeontx_ssovf_version.map +++ b/drivers/event/octeontx/rte_pmd_octeontx_ssovf_version.map @@ -1,4 +1,8 @@ DPDK_17.05 { + global: + + octeontx_ssovf_info; + octeontx_ssovf_bar; local: *; }; diff --git a/drivers/event/octeontx/ssovf_evdev.h b/drivers/event/octeontx/ssovf_evdev.h index 0a3c76e..c2b8187 100644 --- a/drivers/event/octeontx/ssovf_evdev.h +++ b/drivers/event/octeontx/ssovf_evdev.h @@ -36,6 +36,8 @@ #include #include +#include "rte_pmd_octeontx_ssovf.h" + #define EVENTDEV_NAME_OCTEONTX_PMD event_octeontx #ifdef RTE_LIBRTE_PMD_OCTEONTX_SSOVF_DEBUG diff --git a/drivers/event/octeontx/ssovf_probe.c b/drivers/event/octeontx/ssovf_probe.c index 7033ff5..dd5aa62 100644 --- a/drivers/event/octeontx/ssovf_probe.c +++ b/drivers/event/octeontx/ssovf_probe.c @@ -67,6 +67,87 @@ struct ssodev { static struct ssodev sdev; +/* Interface functions */ +int +octeontx_ssovf_info(struct octeontx_ssovf_info *info) +{ + uint8_t i; + uint16_t domain; + + if (rte_eal_process_type() != RTE_PROC_PRIMARY || info == NULL) + return -EINVAL; + + domain = sdev.grp[0].domain; + for (i = 0; i < sdev.total_ssovfs; i++) { + /* Check vfid's are contiguous and belong to same domain */ + if (sdev.grp[i].vfid != i || + sdev.grp[i].bar0 == NULL || + sdev.grp[i].domain != domain) { + ssovf_log_err("GRP error, vfid=%d/%d domain=%d/%d %p", + i, sdev.grp[i].vfid, + domain, sdev.grp[i].domain, + sdev.grp[i].bar0); + return -EINVAL; + } + } + + for (i = 0; i < sdev.total_ssowvfs; i++) { + /* Check vfid's are contiguous and belong to same domain */ + if (sdev.hws[i].vfid != i || + sdev.hws[i].bar0 == NULL || + sdev.hws[i].domain != domain) { + ssovf_log_err("HWS error, vfid=%d/%d domain=%d/%d %p", + i, sdev.hws[i].vfid, + domain, sdev.hws[i].domain, + sdev.hws[i].bar0); + return -EINVAL; + } + } + + info->domain = domain; + info->total_ssovfs = sdev.total_ssovfs; + info->total_ssowvfs = sdev.total_ssowvfs; + return 0; +} + +void* +octeontx_ssovf_bar(enum octeontx_ssovf_type type, uint8_t id, uint8_t bar) +{ + if (rte_eal_process_type() != RTE_PROC_PRIMARY || + type > OCTEONTX_SSO_HWS) + return NULL; + + if (type == OCTEONTX_SSO_GROUP) { + if (id >= sdev.total_ssovfs) + return NULL; + } else { + if (id >= sdev.total_ssowvfs) + return NULL; + } + + if (type == OCTEONTX_SSO_GROUP) { + switch (bar) { + case 0: + return sdev.grp[id].bar0; + case 2: + return sdev.grp[id].bar2; + default: + return NULL; + } + } else { + switch (bar) { + case 0: + return sdev.hws[id].bar0; + case 2: + return sdev.hws[id].bar2; + case 4: + return sdev.hws[id].bar4; + default: + return NULL; + } + } +} + /* SSOWVF pcie device aka event port probe */ static int -- 2.5.5