From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0083.outbound.protection.outlook.com [104.47.42.83]) by dpdk.org (Postfix) with ESMTP id 1A358590B for ; Fri, 30 Sep 2016 14:06:51 +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=KkiC8YIqdvGXV72R1nVapuG0WKgPpsYbVBRd+aX5WI41yYmy7CTWQZQpGfqpgoUPPOu/XZUt7TOzCpkxgW1GImxTfPWgC3VV1xJ+3SOeedcooFvmYyoMYDorcZyDbnq7vX+3mj8zk5xn0HDNSzvwCMyoIem7DwGB/u+c4GgKYVA= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Kamil.Rytarowski@cavium.com; Received: from cavium1.semihalf.local (31.172.191.173) by CY4PR07MB3063.namprd07.prod.outlook.com (10.172.116.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.549.15; Fri, 30 Sep 2016 12:06:48 +0000 From: Kamil Rytarowski To: CC: , , , , , , , Kamil Rytarowski Date: Fri, 30 Sep 2016 14:05:44 +0200 Message-ID: <1475237154-25388-6-git-send-email-krytarowski@caviumnetworks.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1475237154-25388-1-git-send-email-krytarowski@caviumnetworks.com> References: <1472230448-17490-1-git-send-email-krytarowski@caviumnetworks.com> <1475237154-25388-1-git-send-email-krytarowski@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [31.172.191.173] X-ClientProxiedBy: VI1PR07CA0001.eurprd07.prod.outlook.com (10.163.160.139) To CY4PR07MB3063.namprd07.prod.outlook.com (10.172.116.144) X-MS-Office365-Filtering-Correlation-Id: 6495d705-9474-465e-e4ef-08d3e92a4248 X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3063; 2:V95E+ldfH/HAyi1MEoXQK6kaPt6z4eAC6NiHGpuM57mxCNriERjgVVV/NoD1WYSqFux2+ub8I5SNutZ/4ri7moq5d7oJQBqxHSPaEDbz7q8L6HiqIc0O/E+0ptmTs0ATz63GWjeCp54jcSFp2v3snURPUL03S94Jg5jVcfznO5w6mQ6Hgukdu/ElGQfsMXRX; 3:43GKoRYsHBEdu+9rc6Bm56NyU6o2dJiRF20ez3wCC2O7l+9N5mpCk0mpmnXiBaTiO8DTzHaaEktwDvdLE+6GdmriP65po9zu+IkHQ+6IDh3pGrdPAy+zsONQmBjPLxLk X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY4PR07MB3063; X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3063; 25:cKX1m8qb+PUsNRrBNG85OHNrZFWu9aMkU7+m6Ejs9jp2aiHdrhPC5VX/YDVhvnTYKEv9Huqs/OoCCgaxtR233OJTbVNO58waAJ7fwZLbSjIlxtqyQgQb+qQwGnX+4xC9hpI+hIf15k9oR1p87H6ZaOKLx2cYVLGyfOSmbVlKYZNdODCMbY5XjA441vV63EedD86YoLwoROTpvZWKNwVc2BwkB+hnPishe2j/e73OGgqZv0tDkeH3YamuARggCVV2dtn8CLvsEchC1sY/sNh5QKrfYYbYUWb8Ww+iH1vTZbyT1yIGfUiAON3yPpm0XlwwV3jopwd5uSzwxKVLyKxewNzJC3cv+m87ZD7Xwsk4HaS4Rkevb+ShEBmOhWALd8snsztybJzfGETtlsGMJCjeuL7aKdFBqlVQGTBiBO6SigmChtxP6zo5zKsOYjL1SIf2wfs3Ti9/Si++uxiB/bBMcjfMBiqnCl1JRcFhOAgqsXPghj9ljvsX/iqTq4wxWOeKtQY4oJ2wDjZuycEzR0G+O2lX9xiLyLI5CivaNPyBrIjkwm6vyfisYSgAUl7XSp4WXmrFhg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uw= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001); SRVR:CY4PR07MB3063; BCL:0; PCL:0; RULEID:; SRVR:CY4PR07MB3063; X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3063; 4:TOLM+J2WtV0smhh8KACcWZZeB219Kk/kgoMeUEQGaxblbnIErv20XQ/mgpbSMej37tFkQcJl/PkE5US6U/ewVzTFTSbVLxKH8trx7QK2iT198Sd0FTmYIAshfVji0NmFzQO/iniKRcNDpQ4VaCpSK0gnu6zG3ame5LwrBf5vquXxid7SptAMEBJNlX4NEzNI0cM2WfQSoo+aQ+tlOa2HffGoBLvPMWJv7KwG/DqaMG1inA2+iDp3S4ztWCzN6o5MQQYglY32fj+8QaqQtDzXQNNOfNoXQDn2R9RcpBlvteUhpEiPkDtJYFce+364/9SaRe6HX4j8kmUSDbri8QaE6viHo7q77/8ICwTOqx4Qm8sVUpS51FHo+rSNvipvVvWMIOAcQUK6XocfxtojrufXfA== X-Forefront-PRVS: 008184426E X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(7916002)(189002)(199003)(92566002)(3846002)(66066001)(189998001)(47776003)(42882006)(36756003)(105586002)(19580395003)(97736004)(6916009)(6666003)(68736007)(42186005)(19580405001)(50986999)(50226002)(77096005)(76176999)(5003940100001)(6116002)(7736002)(2950100002)(101416001)(586003)(106356001)(7846002)(5660300001)(4001430100002)(305945005)(33646002)(229853001)(110136003)(8676002)(4326007)(81166006)(107886002)(81156014)(50466002)(2906002)(48376002)(2351001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR07MB3063; 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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cf/84E0SJpAf7n4Fonox2AkXtwieFIay+uTG9y2OW1phxy2+Teg3xDNphcXdRcy8pj54LzDUUO/0eQn5LDRQEaGgfPWMEkC/T2z2hU2bI5/rUc+lGcYvYsSHkLmRGKUXXXRUFwKCU/2D5u7s0zcHtddVO+tlXE1DFcrhO9haC3Q0hiu61p+F8VmxEM5gw2BS1bjAPsHjMw7kKL73xhAH7gzUPPimY2kguKdx58fVSnOHtBg/d3DccZ0uXmI0kbxku3auV/veRn51f SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Sep 2016 12:06:48.2459 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR07MB3063 Subject: [dpdk-dev] [PATCH v2 05/15] 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, 30 Sep 2016 12:06:51 -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