From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0053.outbound.protection.outlook.com [104.47.40.53]) by dpdk.org (Postfix) with ESMTP id 8DA225922 for ; Fri, 26 Aug 2016 18:55:00 +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=ld0c5uRUpuqefuLtvQXFsF9PEIFBDNv0Cm8Oc3kvduEmzr5II/1KgbEeUPtbgkg2Hh11Oi6mlaU8FXguMoqNhxvpUZjhOJ979DA3OrWi0jHnMC6rihR9GVcs3yoSkStPg7nX1dOAeeO8tmQcm4E3oEC4XMKT6En6VOKUCv5jiPg= 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:54:56 +0000 From: Kamil Rytarowski To: CC: , , , , , Kamil Rytarowski Date: Fri, 26 Aug 2016 18:53:58 +0200 Message-ID: <1472230448-17490-4-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: 610c9a25-0940-420e-f8d1-08d3cdd1b677 X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3064; 2:N1FWLNL+JyJqGd+7v9ev2LOGlzg5e9Mmsr2evLPPRCK49FNeYAnbeUWt6g5FgpdkcfuUEFPkLfQOdJIQ58ZA0jGM2FlrSULXS3bRihZJtSu8o0Objxci8kj9r3St4f7wATOa1c6a1wEB9XE3t68ZXe1dMBasS5cBqjlharKs4VUib6Sxo7PLPxUNNREdNVJc; 3:3N3jEZaq0gUogYECMpOnJfDVFt/YoMfRsfjj+uqWSSFxEtU25wI5CNUfQDmjmYXewJsejubqIw3w04/q6d9ABh+PaT775ywLHFqJjP1TcKzb67+3jA50n5YOTEhltW2u; 25:ZySOPk9FXWbieaTE7tg2unpGweGnFQJkLw/rTL9KMruEdNK0cPIHaES6w3aYh/tXW3UdbdSeVfz+6C0XW/sWAOJacNw/+c6R8AbluaUJwZaDOpdj/w1sV1Zcnv2xw2wISt1v+FqjWcjGn0OtPBPe66SdtDVoxHar9lSi6VI6a1USnBmem1unqOU2mum49h6ecncbe+GJDpEOrc+1NSdSjbJmB3vEKj36E3z8tfIei1cSPoFFWQ7sEn1dPnXzvaa5QESvU4kuYovINiMhGC6nWNHGeV9dW7QYKOjA3Qoh4uq43tHSodFI+6YjCikjPcCX6814n0zSBWNDdBdBiOG3VvjgPd104uOYb3lZHz0QCreRZRg15thjPw6qKeeM8WH5c7c1bBQ1mS888rvoFrQj0Mwidbv3v7RCR0kmNSW0+9w= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY4PR07MB3064; X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3064; 31:D64hp2huCb682I8ZxEYhLar22xHuXlo9bhQBNDpHkXrUvoaZNQEp5cLZV0qOHiXp1mVpCaNTCFm04JgJLXec8c++4Ft3pxjC5gTFufqW02n/+Re2YUMGvo4MGI+bXmZ4zJSmhWQ7jMNqZ7joNzneEoahYHUkN6+BXp0keu7uF6MOnksOsGWOQ4nLKEJIPgLFUekmrAOKFP05NSlW6fgGNh0UmMahHVo8yEBOsBOfklk=; 20:BPCv+c4sw+qJGkQd+aY/9vNrxMQBQwAx60JlYIYyclR4RcAh4gn4yhf5jynlnc24psJsNSflxx1er2K5/InRAdU+Ng2w1kY5j9vH5pJNOIqL9vcRbxfPXug3XIPx38CFNAc4/FS+LvEoSYAhu/lU60dyPN3lo2b7oX+lvx/uLRVUzok0nvGOC9omSdMX+zI2SPFQyZ2N/lhyuy3BFe+i6s3+GgNuF8TOsFQMkZMZuUoFGKL3CyBhdDMcHWvQzb7ZbtRMT0qYpm2me14E9eYWeCEy6y84jTCWsVNnhSH+HRYl19ooAzDkeE1SX01vmoff6qEGMMaykcZ9PoIDcvVr+BSU4+3r0yc1ZVtbdDAQLBWSN0pmz5JrnZXDEEDwOSVsrOPFdKQZoh3jMzz2aQPlAmtrvJ/w8ABtDHBhH3C6ZsSWJhYgyZjwL9w7RFBwUU7w9Tjo3MLmNYuN8BsPBAc995qOhiJJu2M49WcsCjy2R7f2RUHx9V0mVmQu3UceQzjXRDYhqjNcBmZx88EDBjCG+bn5DJR7sl1jklxTjjuk+sF+kRv3z6Nk0UfMTIn+SscbYvN0xxx87X1IcxdhoKm5gNIzxb4KBzgKGm5U9Q57LIA= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-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:dqMeF/uQJKnKQgKKxkAF+RIaKdXRP1ptSNn0lu7NDfX7gQS92AzrqIHO9ZyZ6K/xVhI2yQ5zC1XxKQh6P2PN4oZqfvQkgvUatTrtXwcgtUYF3FiR00qGgyotaXnhXuxj1/040oI+hBQznO6DWe+anFoHVLJYmo8+0deljloVBZ1bV1AFAH8AggPQKLaqmuDgkFRJjdCQnR19ySggNWH3pT1GCysfHgEheVzwREBGUIrEXAkNblRxSAzcjrR6RSqkYjdCdiAExc27pSdErNYp4q6jYFnZ1Z9LxZ4jr+1aUtOsTlq0Gaf7p1QaHkhxipUZc1JWsseLNTKU+QWy6Ivy3dhSeZbGoZAjcAV9f7e3dpTpubg0SZAita2lWOCvrmhdd7Pt/TjsFIdXvhxSYvEaYg== 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:HcBjqjNv3Ss/D43q9+/zhHZFUsX8mDrQPjuo+fO+L?= =?us-ascii?Q?2tb2G9CdxjpsISQA78sG+b7yQPk9TXal1yGCjzLWtXTdsQJj9lx42MHHpXzG?= =?us-ascii?Q?EeJyp+1O1RajjKPAmcTcuJgOj87d20FfDEZQLsMkymxN0QNdEq3nYyfnoP5W?= =?us-ascii?Q?3Lx3IV33zK4/fHhU77QQqyIq6RVeVFxWw8njuOS7dCx4KF3KpUvtkSg+dE2I?= =?us-ascii?Q?AqZdGXhTLID+QP/gzaglT5dXaTvjkzBNlowjIyqC/NOmDRDLahavROBXcg+S?= =?us-ascii?Q?vv8rWBXtiQzKMtAqbbU4tL3TcN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VAWBpqElHglz8kg/vwWx6fUOqMjOipitMH/dcc3aLwqSs6c9cDavn25P5+15UOZ8iDIWlen4+0iF5mVjcNQTTUp7LIXS8c4fLUu5BpKoF0qPJLjEDgTsa2wKXKXQzR9iEzgBpoF18fC+PAkBw9YPlEwEQ4fVnsBqTAJ1FldrdKyAOMEVXy9bRGOZT5S56zqcq1cY0SBDVitzm7TsMMdmsZDIN1FMv8N+qWkqF5h6hVQyJNmeY1NZAGctMXYP+4rvhm27nJKDXvuFoyChMZoj9cFZhRk=; 5:g5SFt8D9CgdltXqxdc6ZHpidKA7QRFHdBchqq9VaTh32hblXEVC60T2aaazHMAhK3r85TjUcG4N9jp+d1my3lqaHKPJgeL6gNn+908+5bFwqrUauYbpvRnkC6o0F7ducBEpSwRXcUPDzZSOcQq+Whg==; 24:7Yg7UeQQc2Uvhm2fxTPiCmnqWkHMRBr0ydhKbkyRgbgympyCv1E8Nyiq4dzdkwZOLADnz7VQYmMoYnDx/NeAxaEPSVlKTX4QtlC8blzE3mk=; 7:KdU3QjiXCX/ywTSm8GrVoOelLZvXi9g73Doyv3ABEdC+Yl19vzST+3DTM2o9JaERquZd7qrqhh3vzsY9r/oP918rb8lJXi5QFLAC999tA1kkvrdPkayPXBude6AsmHji8PFu1dU4QLB2LE/p+5wbGxY3/aytfMNxyrwFn2rlsKR1b4vkDXUGj8yfO+ze/bTBnjCwm7KTZ1OHnBY4HEWUOXPe8TsHPbKOH476Vku+YPhUUmdzOFmVZJ5CZlBBcIAf SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Aug 2016 16:54:56.4441 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR07MB3064 Subject: [dpdk-dev] [PATCH 03/13] 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, 26 Aug 2016 16:55:01 -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