From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0045.outbound.protection.outlook.com [104.47.33.45]) by dpdk.org (Postfix) with ESMTP id 9FCD3590B for ; Fri, 30 Sep 2016 14:06:46 +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=jfvJ4kODxH/vbQmC5nQCN/3ubNErdYR/XDEeb9ebAgw=; b=WdmhS79bLomff3VZmYcWFQmtE8LRrUdcJNDXqSSDcVBRDKdDuHWEBurO+S5CNZyGSE6FHsavbiL2hpmsMM2Lw1zFjick1wv3KZELoZK60cULsRjqB0QBhe4SfchNYbB38ACg+1P3PdCFZX+8q36AA6Yfb/0B39FwihoApAtBaLA= 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:44 +0000 From: Kamil Rytarowski To: CC: , , , , , , , Kamil Rytarowski Date: Fri, 30 Sep 2016 14:05:42 +0200 Message-ID: <1475237154-25388-4-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: 48c5b345-980c-4c6f-3f49-08d3e92a3fc1 X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3063; 2:Df88O5iP0Y3R5tRi2B6gvrGJNtGoi4xo8VaVNTPWL6cssVlhb5qGqyayzou+4rTnq5kqVtdv4cbRxh5QIcbLAetCmYR+eJevDxJNOKx1NNnCn7aqbN2VFSL6VFkPXksQJECKyRWanTrUsg7pVXNQXmxjZwDJIsMJwJ+PPViU0UflYa0/FQUMofddMWZlDfHQ; 3:DhAZdrIXBqto4Z4WkQneWbhTjPwNywqcJQDbSOhKmOxj6anAjcL1XE0tYyOHKjceHX2Vbz3VT9IC8FtTFMzkrHx1QnZYsTLcO+29e4RlfUJr7xuwK0BFvgk7Ja1b+F+s; 25:YIQy6IawoqOz0m5FJZyJ06915CbhOLTTvFuUqiKNyCa3nLzM80fF1jWDXpmzarkEIo2gujCzAXRmyxn5ya0MhCikm71yfZpX3rG5SUOcgLp+NHXMcmABU9/ojIoqA5o7IeCzd2vDcv0LmbnJQbnhGBtUumAr8JEMcYdLjzOFD6UdA6Lq8fWIl3l4HPcWXCNs+3o2o+72PgAI0G5aukt4AJMUxHhfJDhia3b4EtmS9kS465mzG6Wn27PkH8/QO8Zx+h9YGdw9nsdF3qispuXw3T7ak5cyOF4B8Qc3GzBbZuUOOw72LEO5UxzfOeZe0pCKm243ehLGZtEcbrnGg17eODJvwCE2c6u4BEbQsmaOPZzjkWcNWfqgURywBccKvyNA4pZv4rEnKr1nU153PnnMQ/9cvpeyd8butVSSw5Tnkc0= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY4PR07MB3063; X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3063; 31:nxT2l//EHIGEnAXPNhcQ72glXC0I1kFKSE2MkzUA7qmwK18sUaxrjrescMwYUesQ6FSxS3sah1MUA/SO4h0AJsGua5r5kDcUiDHfQEW9S48blazbVR2zlE4bPn4+a6Bbhh4i/Hd1Z4+ATnK1tJYhqDCaR4ufr6jC3+ZIGGgYHvqLdeW91fYJPpztxpDtrWf58rfk5jq+DMUnjlcwniKuXgrVYWPHaVgppjmd5YHzBIA=; 20:W3cAAtV1+s8pV/QNfGSadjTx2RJdMwjJM2SHYEAPDz5Tc6syiz4QIbFdc9w0Nk+6uENT5Ob979Mo9oFGbGzOhipFOYySsAYvwa0D4WYSbCokqBDs6qgyCj3L4Gfi9IBSELtJUod7P537a+6EOvWImdFD0ro3C6u4Ufrv2scm+PJ/7s+vWE0xoTd8z5iWs2EevOI6+HIlwpObkl6s+D/sEAg8weGHOBKHF8aGWJgDnnnszHu5igl5clXVeSlAquCjBc1JsFKQTJwDS56kUc/nuYFhkQmpYvuuxBGNvVra3RMnuNuTLNVA9FQTkZg6WpIv9oxmPJiBI/+4XB2qtVXA0qCpGd2lcmQJXSYPtG5FXB1PwmPs6pOl3V6sMh1qf2JpcNvNO7ZxhndL4Fv+9O4rOLCh17RxiPLBlVrYAsQSzEJenkvv3DCKAowv+U/ze+Frlr5HM/u5uw0W2J7UOOL8g8LR52y7sCG7r8Ig/i2caJSBH3vjJOiGxsHYhitYfcaU/jN8TQotXY5+lunuKVCAxhTC5nnKOFqYQRQ+f7l2TpPTn3p5b9J1iXEl2iOIMUYzB45hnYYqfOxc958TkZBq+SrltbhT83wRC9X4CTZfEyk= 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:rLoUSKPFqtZxAZJqPmGyYSIK4AV+IHWY4oUaLR/s9rj9p/i3XA2UvYavMnwAm9qSw7TeG4GGGbU1aVbHSWrcsHEtt5ikP/k7Owu0wj6g/2zqrAAg8LZSr7Kc8DwLDL5uwvTg8436ZZSonWaexLLR2vJQSy98ywHZLXa6terGuNZS8vkdhgP5r7ew9GOXopIRf5II/Sf7/m6TmCZ1NeW3BWYp5Im9IhbZx+oohSj4G0M/d2k/lQH57kQHOr4HZ8mn2GMDCmTcZUYjBHcP5iyI9wJyrYl52BHQGExPcVobPv+zvkQJq1eIrKZHBErgvfcNrLi9PpJW1/z8a2kY8jtKYv8TILjKwlZImsXz8kDeKkrFcAsKc8YcrdsWMdNpvnLnsV93vXH9ItjS1Jn28bMNWg== 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)(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-ascii?Q?1; CY4PR07MB3063; 23:x7Yt7b7tPJYUFxRJod9piJhSTik17Vfndrm8RVeqX?= =?us-ascii?Q?BlZZ2LCGFPzY9+WgSZobbUpwxpDxet0BSkxNzAIq9RWiID9r9ZDeZVW4tivs?= =?us-ascii?Q?e9xfSpHspypVJsv+ihraQ3ofN3CzFZAzD3QGllVD5TEDNAGILT6XX0y85TQ8?= =?us-ascii?Q?XrMeI0k0WVWhNcnDhiwWe+sKhMLrpwnCRhl6TbljyCjI82MuT1wcyl1FUF3z?= =?us-ascii?Q?Pou6m2HQ94IaHtvEKSOq671gKcYer0V5JfXWwgwcFpLHbb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HZwxcmzdkrYvYRvjxKv+86P57MhTQQ=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3063; 6:qk3Z8+bbAW5kqpqjGcRcn9k2aIfulMg2WJx5G3DFafcB24qbcd2x+VAof50hHaVjZviFx0wPZoUr/9xTXGmE0h/aTKzMY74L5Ulb1KOqfgl7lnbZDeIgQJ/qYScmaURncej35omNVzxfqnXwMw7OqUHKbOsj4Qhy740CqbD3DHnSsAE23Mb3l9sFoJOaYxSTGjcRY8ARfdwVulbU3nIx/ThYsg9/VkHB4bykFfBRbGdLmLgk4kCqqfVAiF83DPwDxkhkSsFyFX4e98TkIym7hm//ejUq+5gb5qHU56WJfNI=; 5:nrpYsGaZKV40ikRccfLMJZydqOVseY/l2Z1ixxD1Rz7Bj8izfPlP8ISkinoy/SqDpXlSDKzKW3GLJdqFauf8XdrwRi5yRRdeKLPdXgC4K+19diIupJgep72lJPP8d9lvm+ooK3MjzcIXP90Zv43avg==; 24:zedCH9HmOiHhnC8v8qIhMR2TXIwyXIbd7NlWUCCsfIeLoS4zD+mc4WtURDjScyHz5tWKmGDOtfoThHowLBZTcajJZdP3a/aJ7biI7YmEuuE=; 7:zyuIg1QlHdD09vwoBfpuwHckuy36Zd1m73vrGcGpL9yTbmmu9plYSQYfJx4VPqoegbvfx1U+jHm6DinIFQs6i5/lvMNviMju5MZzy+PMHhFdPqfdGjQhGonRrc7FvCVRPRs4SiT2UuNLJD5sqxaWZkPNQCr7TpEpMIjmxO/+WLvS3lY2VShyObJrtxPMii1FmghMZ+7PmDmW8eVOs128LZp16x/nvQ1bupk5lWWY0ets4R1ys7fm7nSTBhRp8jAgxPZnJYpO569yr2TRVPHGhYsn9n2fhs3pQkwZ0mZVVcoKwNfWMcQnAUnvg57MqnbY SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Sep 2016 12:06:44.0035 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR07MB3063 Subject: [dpdk-dev] [PATCH v2 03/15] net/thunderx/base: add family of functions to store 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:47 -0000 From: Kamil Rytarowski This interface (nicvf_bsvf) will be used for secondary queue set support. 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/base/nicvf_bsvf.c | 72 ++++++++++++++++++++++++++++++++ drivers/net/thunderx/base/nicvf_bsvf.h | 76 ++++++++++++++++++++++++++++++++++ 3 files changed, 149 insertions(+) create mode 100644 drivers/net/thunderx/base/nicvf_bsvf.c create mode 100644 drivers/net/thunderx/base/nicvf_bsvf.h diff --git a/drivers/net/thunderx/Makefile b/drivers/net/thunderx/Makefile index 8ea6b45..711400a 100644 --- a/drivers/net/thunderx/Makefile +++ b/drivers/net/thunderx/Makefile @@ -57,6 +57,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_THUNDERX_NICVF_PMD) += nicvf_rxtx.c 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 ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y) CFLAGS_nicvf_rxtx.o += -fno-prefetch-loop-arrays diff --git a/drivers/net/thunderx/base/nicvf_bsvf.c b/drivers/net/thunderx/base/nicvf_bsvf.c new file mode 100644 index 0000000..9e028a3 --- /dev/null +++ b/drivers/net/thunderx/base/nicvf_bsvf.c @@ -0,0 +1,72 @@ +/* + * 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 "nicvf_bsvf.h" +#include "nicvf_plat.h" + +static SIMPLEQ_HEAD(, svf_entry) head = SIMPLEQ_HEAD_INITIALIZER(head); + +void +nicvf_bsvf_push(struct svf_entry *entry) +{ + assert(entry != NULL); + assert(entry->vf != NULL); + + SIMPLEQ_INSERT_TAIL(&head, entry, next); +} + +struct svf_entry * +nicvf_bsvf_pop(void) +{ + struct svf_entry *entry; + + assert(!SIMPLEQ_EMPTY(&head)); + + entry = SIMPLEQ_FIRST(&head); + + assert(entry != NULL); + assert(entry->vf != NULL); + + SIMPLEQ_REMOVE_HEAD(&head, next); + + return entry; +} + +int +nicvf_bsvf_empty(void) +{ + return SIMPLEQ_EMPTY(&head); +} diff --git a/drivers/net/thunderx/base/nicvf_bsvf.h b/drivers/net/thunderx/base/nicvf_bsvf.h new file mode 100644 index 0000000..5d5a25e --- /dev/null +++ b/drivers/net/thunderx/base/nicvf_bsvf.h @@ -0,0 +1,76 @@ +/* + * 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_BSVF_H__ +#define __THUNDERX_NICVF_BSVF_H__ + +#include + +struct nicvf; + +/** + * The base queue structure to hold secondary qsets. + */ +struct svf_entry { + SIMPLEQ_ENTRY(svf_entry) next; /**< Next element's pointer */ + struct nicvf *vf; /**< Holder of a secondary qset */ +}; + +/** + * Enqueue new entry to secondary qsets. + * + * @param entry + * Entry to be enqueued. + */ +void +nicvf_bsvf_push(struct svf_entry *entry); + +/** + * Dequeue an entry from secondary qsets. + * + * @return + * Dequeued entry. + */ +struct svf_entry * +nicvf_bsvf_pop(void); + +/** + * Check if the queue of secondary qsets is empty. + * + * @return + * 0 on non-empty + * otherwise empty + */ +int +nicvf_bsvf_empty(void); + +#endif /* __THUNDERX_NICVF_BSVF_H__ */ -- 1.9.1