From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0075.outbound.protection.outlook.com [104.47.40.75]) by dpdk.org (Postfix) with ESMTP id F2A355A57 for ; Fri, 26 Aug 2016 18:55:05 +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=vMDWleBX58sniMrV25PaX4vn5e/ssSpEWHEdoWggdog=; b=DJBgcwlx2n3dRhovjw+cxuHGWrzML/1YMaSoQz3tGhWmA4aeNh/VWGIh8sTeZJQSp7SyQGnyFji3U5rNNT3hDeThJRCRAsQjG396d3WdcCDDlO3jRmVf4+HS7tzSq5F+SOcG7daP8yIYwSyueN3sGAQe/Upa0z8VFvLBwS5hCaA= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Kamil.Rytarowski@cavium.com; Received: from cavium1.semihalf.local (31.172.191.173) by CY4PR07MB3064.namprd07.prod.outlook.com (10.172.116.145) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.549.15; Fri, 26 Aug 2016 16:55:01 +0000 From: Kamil Rytarowski To: CC: , , , , , Kamil Rytarowski Date: Fri, 26 Aug 2016 18:54:00 +0200 Message-ID: <1472230448-17490-6-git-send-email-krytarowski@caviumnetworks.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1472230448-17490-1-git-send-email-krytarowski@caviumnetworks.com> References: <1472230448-17490-1-git-send-email-krytarowski@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [31.172.191.173] X-ClientProxiedBy: HE1PR0201CA0008.eurprd02.prod.outlook.com (10.165.229.18) To CY4PR07MB3064.namprd07.prod.outlook.com (10.172.116.145) X-MS-Office365-Filtering-Correlation-Id: fae3cf9c-fe24-4c73-b484-08d3cdd1b949 X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3064; 2:XtUEyy19DRZG+IaURNfGO894BwoZfwLlCphjYwtB4PqWY2FebjLMIZJR0JN5C/J9JV0UyL843sHj0qEjJr4+HQ05z5fBQ19UPu4meM/MyPviZtKQiwCJobAMQV3rtM3XCmjziNjytxFOLUrgKr2IzHZagAuLiePBEkUb01x0Q/OHbuE8fruXeQilO6s8Goag; 3:7/OqM04loE7RvgtYv9vH9ejkxIQ4lw8vT62+dBCupUAjRKpF99/iOmxsbxBJuB2NjUuJy1/9Tccvcfr+ZK0fQWntojg8fF2ju3g7o4d4aoNQ/6BlgaKupckNSthv5zQu X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY4PR07MB3064; X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3064; 25:UwjRZRLWV/L0pcZVBkTZr9nvNaXntB2sUkvOSjUsU91N59x7imnhqeu8NQRk3yqspEJXflQJoCHNgwEq6p5V5O6QZjLJXY6PHkjvXda+A3KbpdRkHCtmuX9ib3mS5tvW0WAOZqmyTQBU45bKF1eK7PkuYjCTScFCNSgAicAHc1b6BJugTC+8Sl03NalNdYG3gMod348QQ0Qj+wfywH5pF0z837TN+1MVr8CV+7fT9C/MWF86g0AG8tuU8NT2Aizbj0c4v9qSf9I0SDqw1s1M89ahQji9je0VKxPxGX00W8RoHOb3cQxJQ58979p8pkV8n/z8WaBcWrrEf9SRItaO6CaD/nSKNhSKSvyOANxH5/ZnLWp8HDWl4O1yCIzHKDKznm1NWBHKglJ7yIP0doFXOCYwhYd/x5KFEq6Ms9OOCLMUybXsrNv7B1h+bWsgqWaXHnCPTAaun6riDAf2oYEC0BXBrp1048s1P5V0sXNGkBRBz9cEPJgCi/FbgFwd01LcohIZUWFDuDjgxV7ZQwEIvcz7Pg+FFbYWQPrU/isgeOWOYODxKizIeohZ6dQW0yNxXrSgN7ppQ6NcWPichIg+v0pMY5+g8qtNZRoyBrpkVE1WIVbi9GY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Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001); SRVR:CY4PR07MB3064; BCL:0; PCL:0; RULEID:; SRVR:CY4PR07MB3064; X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3064; 4:unRPeyG9M+VvrHoakClh+b8+JIYlysiZIldusf3jIKnjW8/rysTuifKxMplTzPnS0LV3BrJ0twY58SRr9OfFzmKt5tG/zlSPXwc257ZL6mDSj7dgZAoICQS2hY34TETN0RriuJPEGZUZzOLa/PufWmoHKm291RSomLfSh1Q1MHJQuGfeJC73RBSMrj6b2TTwiawg6+ecUVfWEkOA5pI8pCC1CCCSuyrr27X25t/B2VN/nmW0p3A/sSJ0zKmd4krMqXq1E8iFoJp/jQTcT8Sx9DIXphggPU2TgX6pijUMmx22WVdYjr9E8JSWEU3+by+EVZulW42L1B2ixFlGDHA5uwDV189E+OhgiRebHToqBzOPYq9ZLiecsDxWpHSVri9Zg6Jel9HW6E3SNT68QNh1aw== X-Forefront-PRVS: 00462943DE X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(7916002)(189002)(199003)(81156014)(36756003)(77096005)(189998001)(2906002)(229853001)(2351001)(105586002)(8676002)(101416001)(92566002)(5660300001)(81166006)(6116002)(4001430100002)(2950100001)(7736002)(47776003)(4326007)(66066001)(586003)(50466002)(106356001)(50226002)(5003940100001)(19580405001)(19580395003)(305945005)(50986999)(110136002)(76176999)(7846002)(48376002)(68736007)(42186005)(3846002)(107886002)(33646002)(97736004); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR07MB3064; H:cavium1.semihalf.local; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR07MB3064; 23:3fbEDHRTbWYoeqUYeFc82Gfw3OYtW8VYuBGy/MmOJ?= =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S0nt8X5MbwOBgu22+tG6qPPjGbodjznYWgBlXNSPu3mlA70zTzLCDIu7kqznClldcYuS8/oI SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Aug 2016 16:55:01.1741 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR07MB3064 Subject: [dpdk-dev] [PATCH 05/13] net/thunderx: add family of functions to store DPDK qsets X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Aug 2016 16:55:07 -0000 From: Kamil Rytarowski These functions (nicvf_svf) are DPDK specialization of base/nicvf_bsvf.[ch] ones. Signed-off-by: Maciej Czekaj Signed-off-by: Kamil Rytarowski Signed-off-by: Zyta Szpak Signed-off-by: Slawomir Rosek Signed-off-by: Radoslaw Biernacki Signed-off-by: Jerin Jacob --- drivers/net/thunderx/Makefile | 1 + drivers/net/thunderx/nicvf_svf.c | 78 ++++++++++++++++++++++++++++++++++++++++ drivers/net/thunderx/nicvf_svf.h | 66 ++++++++++++++++++++++++++++++++++ 3 files changed, 145 insertions(+) create mode 100644 drivers/net/thunderx/nicvf_svf.c create mode 100644 drivers/net/thunderx/nicvf_svf.h diff --git a/drivers/net/thunderx/Makefile b/drivers/net/thunderx/Makefile index 711400a..bcab5f9 100644 --- a/drivers/net/thunderx/Makefile +++ b/drivers/net/thunderx/Makefile @@ -58,6 +58,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_THUNDERX_NICVF_PMD) += nicvf_hw.c SRCS-$(CONFIG_RTE_LIBRTE_THUNDERX_NICVF_PMD) += nicvf_mbox.c SRCS-$(CONFIG_RTE_LIBRTE_THUNDERX_NICVF_PMD) += nicvf_ethdev.c SRCS-$(CONFIG_RTE_LIBRTE_THUNDERX_NICVF_PMD) += nicvf_bsvf.c +SRCS-$(CONFIG_RTE_LIBRTE_THUNDERX_NICVF_PMD) += nicvf_svf.c ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y) CFLAGS_nicvf_rxtx.o += -fno-prefetch-loop-arrays diff --git a/drivers/net/thunderx/nicvf_svf.c b/drivers/net/thunderx/nicvf_svf.c new file mode 100644 index 0000000..f746e94 --- /dev/null +++ b/drivers/net/thunderx/nicvf_svf.c @@ -0,0 +1,78 @@ +/* + * BSD LICENSE + * + * Copyright (C) Cavium networks Ltd. 2016. + * + * 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. + */ + +#include +#include + +#include +#include + +#include "base/nicvf_bsvf.h" + +#include "nicvf_svf.h" + +void +nicvf_svf_push(struct nicvf *vf) +{ + struct svf_entry *entry = NULL; + + assert(vf != NULL); + + entry = rte_zmalloc("nicvf", sizeof(*entry), RTE_CACHE_LINE_SIZE); + if (entry == NULL) + rte_panic("Cannoc allocate memory for svf_entry\n"); + + entry->vf = vf; + + nicvf_bsvf_push(entry); +} + +struct nicvf * +nicvf_svf_pop(void) +{ + struct nicvf *vf; + struct svf_entry *entry; + + entry = nicvf_bsvf_pop(); + + vf = entry->vf; + + rte_free(entry); + + return vf; +} + +int +nicvf_svf_empty(void) +{ + return nicvf_bsvf_empty(); +} diff --git a/drivers/net/thunderx/nicvf_svf.h b/drivers/net/thunderx/nicvf_svf.h new file mode 100644 index 0000000..6471aa5 --- /dev/null +++ b/drivers/net/thunderx/nicvf_svf.h @@ -0,0 +1,66 @@ +/* + * BSD LICENSE + * + * Copyright (C) Cavium networks Ltd. 2016. + * + * 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 __THUNDERX_NICVF_SVF_H__ +#define __THUNDERX_NICVF_SVF_H__ + +struct nicvf; + +/** + * Enqueue new VF to secondary qsets. + * + * @param entry + * Entry to be enqueued. + */ +void +nicvf_svf_push(struct nicvf *vf); + +/** + * Dequeue a VF from secondary qsets. + * + * @return + * Dequeued entry. + */ +struct nicvf * +nicvf_svf_pop(void); + +/** + * Check if the queue of secondary qsets is empty. + * + * @return + * 0 on non-empty + * otherwise empty + */ +int +nicvf_svf_empty(void); + +#endif /* __THUNDERX_NICVF_SVF_H__ */ -- 1.9.1