From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0082.outbound.protection.outlook.com [104.47.32.82]) by dpdk.org (Postfix) with ESMTP id 58EB6F957 for ; Tue, 21 Feb 2017 10:29:11 +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=OnRm9zdA88IAktLTlkJxpGFGYerjBYV6TNKx2m/cHac=; b=W+ZYpKp/Q/Q+S9V/aAkBtwaqNbzXfmRx6RluVCaujJFqZzpYM0p49xIC1Nc+tPukD3829j+ACdqfKGkcts5MN4EessL7ljNI/dZU+nNQq3g42BGux8Jiy7xX2HEiM6RJb3MZ6ndjL/KZgfZAIIn4sY9OT6HLR1v0d4VRGrziZoQ= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Shijith.Thotton@cavium.com; Received: from lio357.in.caveonetworks.com (14.140.2.178) by SN1PR07MB2285.namprd07.prod.outlook.com (10.164.47.155) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.919.13; Tue, 21 Feb 2017 09:29:06 +0000 From: Shijith Thotton To: dev@dpdk.org Cc: Jerin Jacob , Derek Chickles , Venkat Koppula , Mallesham Jatharakonda Date: Tue, 21 Feb 2017 14:56:35 +0530 Message-Id: <1487669225-30091-21-git-send-email-shijith.thotton@caviumnetworks.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1487669225-30091-1-git-send-email-shijith.thotton@caviumnetworks.com> References: <1487669225-30091-1-git-send-email-shijith.thotton@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [14.140.2.178] X-ClientProxiedBy: MA1PR01CA0089.INDPRD01.PROD.OUTLOOK.COM (10.174.56.29) To SN1PR07MB2285.namprd07.prod.outlook.com (10.164.47.155) X-MS-Office365-Filtering-Correlation-Id: 06e26a09-cccc-4cf6-2988-08d45a3c1633 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:SN1PR07MB2285; X-Microsoft-Exchange-Diagnostics: 1; SN1PR07MB2285; 3:WOLS2o8vpLlsxafEKtVP3nDwsMaCHFK4XYEM2IAJ9aPhWlNW0/L7jhaNjjZoPEr59rOujGOVTTVDISKWU0BARO6YEdVllG+sN+O/gIl1GM7sRX9QzJuzKy7QWYa+7nV70pLSA3c8fmg6c1Rajq0oaGVCiXDcvSp9M50qzq7R3ja6GFioRr0vXpZdjX3soG0nZgWjo/JqHrzbK5VNIbXAroJ7FeRb+HxYJfZr/l6FxDuzEkcpaFOTptDAU1hKAf7rFdkU1tjeYiEjoRriHE92LQ==; 25:x1YThkPbOeNcuVFIEvo0u9+Hl30CUfbPUJNKUXf5XQ3M+rsVQPWzZOjnaiEohet/OxcIHoYitGPZILmHgOugx5n8tMdpxm8+6p64/E8UOjUMYRPyRdnUO8zCSLzrZh4Qoa2zGki1G7BTYR8n8x0a8cDUm+zUN7l7oZ22WgTjdZhoQiU8H90CawLEL6EbSRvTFXWTocqxoxWi+H7MNelttWhN0NqDJVOcKvGvClg+/+JOfU4pVfp2/b2MwLIB6ktVn3C5AKbKKgExOr1YzgTCgIVJu0tbribwaGr8FLVQ8hPksGr3AvXAuIZRDEOQsrzt3+2E7WL6i7cFWKWE2xyGXAJ5CQk4Q35LfftvB/9yq9v+g8H3K0iZ6M30DB0q7kmbZekBOI3B9k+jp6NOzk0Zo7vCmFck9lkTy/1ccSRGgO8CKeqd9fNLPg6G/SBM2H1Le0eTnxePyVwmzqD57jxl5Q== X-Microsoft-Exchange-Diagnostics: 1; SN1PR07MB2285; 31:XAaSt/NpIWwXs5qK9QMs1deNyojRL66EpEcJK9UOUv1vhCTHh+8ms/cQY6EVtwCxFM+UKc0jvn7tXz7e77yBtNZIVMFJyBmTfR3YLqUXFjdbR65v3Z4pG/S32XPPCfZkxhNU08ts6H33Gd9aQJNzlzVb8gWtxZDDGwLUYTenf5UekOJUU58JNEjT+DFa/MJK6PwcrJO+i9HNSZUsZ5PzsqGTnZWkDmhPzJ1n5unqCFy1a6FX52xcSu1RCE3Use0o; 20:EF7p/KOWDhM94Sqhj8ANDpJAjn9qv2e0D76ZgjO8YG+Yq40lKR6PlwHcSqKrUCwmX6poDede9M5Q7eXVPQxAMufJ4OijwJx/KvGmc4AIsPM7Cqe1+Y5OxZsjcTC0M55T4TGjgzd0/6Rj0TMna55YYJU/PmUv4TURw0wia/Cmldkckbr5SM7GQJQ2xDwbLHPzsuG3chO7ZxqTQye1o9wWQKemZXGh5LOCavEaIacI9xB+ZVtKQOjBtVJea4LuHgS+N+JXurpn88NpVifIkWgoraoLy1J+T14gzqlDxNpQuqiePliV8qLto4rZKdSB5Vfw7ylPHUeYQk5Nqt2kN0Y16oj514W/M14HU3Vb0ulksq/58hkEXGi5Xj9yx1K6BWOIKm7crm4AR/tvTbB6IL7tVH1wgPMMmHw3a36lLLucivAyBWG/WNiBGNsAvCaLY/yF066XZ3CNI1KTC0XW820CrPGJZvn9mYgGo6cuczusgfXBeSQs30oIsZh8R9VL8G3/Kg4LGWTJpnPxYjwL0OP1G4RrrUXTQPyDOlRoB078vxAE7z8S9NFexf+ynDv7eQ7VleOKxnNs2xBxEZlNeCfecjBWN9pzpnTyMpRWaLJdocU= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(278428928389397); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6041248)(20161123555025)(20161123564025)(20161123562025)(20161123560025)(20161123558025)(6072148); SRVR:SN1PR07MB2285; BCL:0; PCL:0; RULEID:; SRVR:SN1PR07MB2285; X-Microsoft-Exchange-Diagnostics: 1; SN1PR07MB2285; 4:lemPMWS1fHyXwJETuQP1M4fqFzoaE9/YEdHEpFplSMsQ/XE1hr6sTu20+HDZbPfz7PmBRFW2jrGkG2cgQILQjejLpSyTSLO4AvoMEwrD6X0LdjcR3rFsOzIaxcvnExkmvDU1LXboC+wSxFm8QCiRQa4Kn4UKaRowj1O1fRS/dn2Tojm4qenFzdLZACzwtF4Z5unqRA/JrqTW2m9nZFfs8cgigLf6SUO2AkVKqBXxWZS3S1fBuhfe4oxL9nsc3OaMEXGd10MQ+y7CNlAfig2qMxTNeEvVgBilSF98nqA6qYnVQLmdG0RzGiZNHyUFAxCXBdhKfHC5wP9LB38NulzaTu3CGR2lDH7guBs3qsQqYVNDv6nrqHo5ElRBLQXwwbUknb412onYQfrcospXvs78cAN38xKQFnn/Xv1SAixH06vaGdX2U+lgcQkxomMCNlQPlVIr3PNo68XMErQQiu5cF+K14u5X1EHyjyoB0/NCp/3ejTRZn3I4W7Sj/XhAp/jrxwS3a6dVWac4JcAdbCr61aU88XJjJ67JJQ6sHLbDn51p37ZByGYzfobfLoDuux09p2fCTvGt+VAFlCWAnK5h4S03ueR2ODoFLXdSKgfoTwyFbJ8Apjx50XuBSyk7XqcEpMbglNiwbWD9FJYZ8XIAbg== X-Forefront-PRVS: 0225B0D5BC X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(7916002)(39450400003)(39410400002)(39830400002)(189002)(199003)(50226002)(81166006)(42186005)(2361001)(101416001)(81156014)(305945005)(3846002)(6116002)(5009440100003)(8676002)(105586002)(7736002)(53936002)(36756003)(110136004)(106356001)(6506006)(25786008)(38730400002)(2351001)(92566002)(48376002)(6486002)(97736004)(50466002)(5003940100001)(189998001)(68736007)(2906002)(4326007)(33646002)(76176999)(54906002)(5660300001)(6666003)(6916009)(50986999)(2950100002)(6512007)(4720700003)(42882006)(66066001)(47776003)(7099028)(110426004); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR07MB2285; H:lio357.in.caveonetworks.com; 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; SN1PR07MB2285; 23:DoMqiX8nJPW5LROBN9KnibGy8/Zkt0TTgOuY8o560?= =?us-ascii?Q?1A/t498KT0V1X4D8JDvb9wBD/byjb4Ohm48Ogcvk6/QCTfjhQMf3LxP6s0hw?= =?us-ascii?Q?QLe5EG4kg3bpzUmNFKWAWA73GHsPqNLqHiemnHthNlyYocx6C+D5vn1zXYdb?= =?us-ascii?Q?MsWVGVwCpljxYj0FlCPE8vZDYariB6VofbixveBgTZTJzfcLNmoiyNDAhH9H?= =?us-ascii?Q?+onYNhY0CyEN/c8FBQevFeeA9/hiz/5HSNYaiOV3ih0i8YOoHYfjDTZVvthP?= =?us-ascii?Q?QPT2y+3bhhnzyd9OE9IYQlQ/NNbWsdnHm/PeLAVWXRm7COyPuHx8dpplyXCD?= =?us-ascii?Q?EF51ugof9X09Woc5aMBCzq/9IBoxdzZar3eg4j0tsc7wIw50sSthduL5R5h2?= =?us-ascii?Q?JSvvrx3u2LoYSMpr/vB0v0sQcR/stDZTOJ3LnuawKXMDiv4323l4OJMMAdwp?= =?us-ascii?Q?OyaPDHfb7gOr5tXHgRtEf1GTQpwted8qiAE7iuu+58r3uBl0dDLJ2aK86/pJ?= =?us-ascii?Q?xsgep2foM02rAA6nES7PfczaDLkTEk3TeUZ0Gt0xn55FYkjMYOZQ/dvN9yE/?= =?us-ascii?Q?sJyPpH5EsF7Dg0cD82nfbq8luCAD0MuuOyZrd19YAkCAdx576o3xONJXI+BY?= =?us-ascii?Q?EoZOLIIFLpUp0Ga7ujpn6A8ViHe+KOoxIJdnDidmEvBU4kufjpSfnBV5mlg6?= =?us-ascii?Q?FqYhC0+bS2PmfQ+IUxkUD315GLqGZoDIjnR4m92+nSgEkozD3uFfrC9qaQJ0?= =?us-ascii?Q?1/i2zWPazaMQYF1x+77tiBTQgTDNgsuNurRQ3TT4D5hbwLTqjpJiOAVzThMr?= =?us-ascii?Q?KaNsz1C6m1JgDEhh0yi5gE0c6AF/M48nV4NudqrvlaqbMtJmDYbc7Qw+VdbN?= =?us-ascii?Q?+Eg/KChqMJjUOo7MlQzwofCpz1cGIfXnyWE/eji/JfDYr/Z+AFNLzWLQu0ZI?= =?us-ascii?Q?PIeDtJmvB14ZJqiHecENXSolNKmBUuQcmRfF4GSCElAXbOiFJIra4bOzMU4o?= =?us-ascii?Q?gZypelK/W40+bgYKcvHPdpmdxGm7imaSFHC/Jm4/VIvQksv9SEYqwtIYHM6V?= =?us-ascii?Q?JCT8iP2oYKAtNL6OG41JfqLPLYXRfNGW1vycgvbJ0ye9dIKZHR4vWAq/VmVa?= =?us-ascii?Q?qIRcCqUZXvgpcibwduQ4KBLQtY89dHpdjg0nun4SlU5+hYmc2iNAsGgQRNpg?= =?us-ascii?Q?wDML4Tj0Y7HC4rzdXXlTMwKD49g/MqbS3+1aN5f0+u/kp4RPFeJ8nlHedMfN?= =?us-ascii?Q?XfHCUzep50uroZucHJxzjZHEsyhOItilzNq5tuoCHFtKiGHXArS0xKyQAQy5?= =?us-ascii?Q?8LnIpck6A13/mhIKWvLE2A=3D?= X-Microsoft-Exchange-Diagnostics: 1; SN1PR07MB2285; 6:cmXleIdJNAitrlQMNRBWTbNnSiGQbYTCmB1n+UMRD9lrq5RIW4mimi3VTjF64ASE36mTEmPJjtPd8jhOdLxKQhKqkw1hjFj2sX8Q1cyNtpLXIJjY3gtIRsiR1m0TwFJRoXetJQpCgaH3fZ+EBYBz++n9qx9+GJdZhoKYSJT0pN0d+Shlj0jdb1AcosD7+5dE764HdDYpCErzjmOl13VidwvbQXTjGwN+h4cN6S8eMLWPVR01N9aLQQrCpIieDb5XY4KVyFfb2xyk0+P+SQaq0VINRnmYbgXRC4F9U6i464A5GA2K+/fUh3C7SfoC1icMr6NXInUD9nkR7Wx72qcPIQdNAkvomWVgYKN43KX6ckI5+U3/GX+knwWuCTwveqpiShZWH2Mzbdb2GOabyHO0gA==; 5:O3cAdKkcxAq0NTPfPAhqJeWeRP/8u/c0Wt1AtDXoPVVpJaYis5RvoZVjqcqLaGxhSPn1mFa/qlzxWZqFc5C6Rsc8VD99wcRDfLC1mm+RExiXlFOaJsio91N1Eo9gKWrpqWJRTDGgGNREtD6KRMVStw==; 24:XD/AH8354phCOWPwE3hR2FUn2xROLUhgw6Mg9x9hx5PeHKTA4izzweUix8Ut1IE/ChQahCBMf3UcTFDZq8E/wEaGn1miAPREX9/fbM83PkA= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN1PR07MB2285; 7:mWRcJVGV6bkxHVuCYJxNlfJle8d0Bliiy4o8kcTAPQfe53kNjuAuLCdPWT2k0yRvz+dyMEZ/G4O8MqhsCOS9a6oQsXVMpTXAOzPfl1nnnvj1dp3eINR7dhju4P+vUlCnbIB2WXkxJSC+PkHbzBmUY9/yju14+D0LfTAV8FWY2oqmsWUrxmOexVdbUkw1tJAjTRHQPR4E+W93ndW/+xMNRGV72D2p7Jr0sJEEh43KtB42aPgtNN2nJtb3OigUOvgRSTTXSM1SHQvBj0XJ+nHgbXmU5GZyw8zv7xZmBCvRrXn/2mFroY8a9Ow2qUB7csQMyYTpCFrCT2P8iqS8wIObQA== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Feb 2017 09:29:06.1040 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR07MB2285 Subject: [dpdk-dev] [PATCH 20/50] net/liquidio: add APIs for response list 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: Tue, 21 Feb 2017 09:29:11 -0000 Add API to setup and process response list. It is used to wait for response from device. Signed-off-by: Shijith Thotton Signed-off-by: Jerin Jacob Signed-off-by: Derek Chickles Signed-off-by: Venkat Koppula Signed-off-by: Mallesham Jatharakonda --- drivers/net/liquidio/lio_ethdev.c | 5 ++ drivers/net/liquidio/lio_rxtx.c | 106 ++++++++++++++++++++++++++++++++++++++ drivers/net/liquidio/lio_rxtx.h | 73 ++++++++++++++++++++++++++ drivers/net/liquidio/lio_struct.h | 14 +++++ 4 files changed, 198 insertions(+) diff --git a/drivers/net/liquidio/lio_ethdev.c b/drivers/net/liquidio/lio_ethdev.c index 3702c61..a6813e0 100644 --- a/drivers/net/liquidio/lio_ethdev.c +++ b/drivers/net/liquidio/lio_ethdev.c @@ -107,6 +107,11 @@ return -1; } + /* Initialize lists to manage the requests of different types that + * arrive from applications for this lio device. + */ + lio_setup_response_list(lio_dev); + if (lio_dev->fn_list.setup_mbox(lio_dev)) { lio_dev_err(lio_dev, "Mailbox setup failed\n"); goto error; diff --git a/drivers/net/liquidio/lio_rxtx.c b/drivers/net/liquidio/lio_rxtx.c index cfec96d..515ba79 100644 --- a/drivers/net/liquidio/lio_rxtx.c +++ b/drivers/net/liquidio/lio_rxtx.c @@ -293,3 +293,109 @@ struct lio_soft_command * { rte_pktmbuf_free(sc->mbuf); } + +void +lio_setup_response_list(struct lio_device *lio_dev) +{ + CIRCLEQ_INIT(&lio_dev->response_list.head); + rte_spinlock_init(&lio_dev->response_list.lock); + rte_atomic64_set(&lio_dev->response_list.pending_req_count, 0); +} + +int +lio_process_ordered_list(struct lio_device *lio_dev) +{ + int resp_to_process = LIO_MAX_ORD_REQS_TO_PROCESS; + struct lio_response_list *ordered_sc_list; + struct lio_soft_command *sc; + int request_complete = 0; + uint64_t status64; + uint32_t status; + + ordered_sc_list = &lio_dev->response_list; + + do { + rte_spinlock_lock(&ordered_sc_list->lock); + + if (CIRCLEQ_EMPTY(&ordered_sc_list->head)) { + /* ordered_sc_list is empty; there is + * nothing to process + */ + rte_spinlock_unlock(&ordered_sc_list->lock); + return -1; + } + + sc = LIO_CLIST_FIRST_ENTRY(&ordered_sc_list->head, + struct lio_soft_command, node); + + status = LIO_REQUEST_PENDING; + + /* check if octeon has finished DMA'ing a response + * to where rptr is pointing to + */ + status64 = *sc->status_word; + + if (status64 != LIO_COMPLETION_WORD_INIT) { + /* This logic ensures that all 64b have been written. + * 1. check byte 0 for non-FF + * 2. if non-FF, then swap result from BE to host order + * 3. check byte 7 (swapped to 0) for non-FF + * 4. if non-FF, use the low 32-bit status code + * 5. if either byte 0 or byte 7 is FF, don't use status + */ + if ((status64 & 0xff) != 0xff) { + lio_swap_8B_data(&status64, 1); + if (((status64 & 0xff) != 0xff)) { + /* retrieve 16-bit firmware status */ + status = (uint32_t)(status64 & + 0xffffULL); + if (status) { + status = + LIO_FIRMWARE_STATUS_CODE( + status); + } else { + /* i.e. no error */ + status = LIO_REQUEST_DONE; + } + } + } + } else if ((sc->timeout && lio_check_timeout(lio_uptime, + sc->timeout))) { + lio_dev_err(lio_dev, + "cmd failed, timeout (%ld, %ld)\n", + (long)lio_uptime, (long)sc->timeout); + status = LIO_REQUEST_TIMEOUT; + } + + if (status != LIO_REQUEST_PENDING) { + /* we have received a response or we have timed out. + * remove node from linked list + */ + CIRCLEQ_REMOVE(&ordered_sc_list->head, + &sc->node, entries); + rte_atomic64_dec( + &lio_dev->response_list.pending_req_count); + rte_spinlock_unlock(&ordered_sc_list->lock); + + if (sc->callback) + sc->callback(status, sc->callback_arg); + request_complete++; + + } else { + /* no response yet */ + request_complete = 0; + rte_spinlock_unlock(&ordered_sc_list->lock); + } + + /* If we hit the Max Ordered requests to process every loop, + * we quit and let this function be invoked the next time + * the poll thread runs to process the remaining requests. + * This function can take up the entire CPU if there is + * no upper limit to the requests processed. + */ + if (request_complete >= resp_to_process) + break; + } while (request_complete); + + return 0; +} diff --git a/drivers/net/liquidio/lio_rxtx.h b/drivers/net/liquidio/lio_rxtx.h index 8dab73e..58e2a6e 100644 --- a/drivers/net/liquidio/lio_rxtx.h +++ b/drivers/net/liquidio/lio_rxtx.h @@ -42,6 +42,14 @@ #include "lio_struct.h" +#define LIO_CLIST_FIRST_ENTRY(ptr, type, elem) \ + (type *)((char *)((ptr)->cqh_first) - offsetof(type, elem)) + +#define lio_check_timeout(cur_time, chk_time) ((cur_time) > (chk_time)) + +#define lio_uptime \ + (size_t)(rte_get_timer_cycles() / rte_get_timer_hz()) + struct lio_request_list { uint32_t reqtype; void *buf; @@ -94,6 +102,71 @@ struct lio_soft_command * uint32_t ctxsize); void lio_free_soft_command(struct lio_soft_command *sc); +/** Maximum ordered requests to process in every invocation of + * lio_process_ordered_list(). The function will continue to process requests + * as long as it can find one that has finished processing. If it keeps + * finding requests that have completed, the function can run for ever. The + * value defined here sets an upper limit on the number of requests it can + * process before it returns control to the poll thread. + */ +#define LIO_MAX_ORD_REQS_TO_PROCESS 4096 + +/** Error codes used in Octeon Host-Core communication. + * + * 31 16 15 0 + * ---------------------------- + * | | | + * ---------------------------- + * Error codes are 32-bit wide. The upper 16-bits, called Major Error Number, + * are reserved to identify the group to which the error code belongs. The + * lower 16-bits, called Minor Error Number, carry the actual code. + * + * So error codes are (MAJOR NUMBER << 16)| MINOR_NUMBER. + */ +/** Status for a request. + * If the request is successfully queued, the driver will return + * a LIO_REQUEST_PENDING status. LIO_REQUEST_TIMEOUT is only returned by + * the driver if the response for request failed to arrive before a + * time-out period or if the request processing * got interrupted due to + * a signal respectively. + */ +enum { + /** A value of 0x00000000 indicates no error i.e. success */ + LIO_REQUEST_DONE = 0x00000000, + /** (Major number: 0x0000; Minor Number: 0x0001) */ + LIO_REQUEST_PENDING = 0x00000001, + LIO_REQUEST_TIMEOUT = 0x00000003, + +}; + +/*------ Error codes used by firmware (bits 15..0 set by firmware */ +#define LIO_FIRMWARE_MAJOR_ERROR_CODE 0x0001 +#define LIO_FIRMWARE_STATUS_CODE(status) \ + ((LIO_FIRMWARE_MAJOR_ERROR_CODE << 16) | (status)) + +/** Initialize the response lists. The number of response lists to create is + * given by count. + * @param lio_dev - the lio device structure. + */ +void lio_setup_response_list(struct lio_device *lio_dev); + +/** Check the status of first entry in the ordered list. If the instruction at + * that entry finished processing or has timed-out, the entry is cleaned. + * @param lio_dev - the lio device structure. + * @return 1 if the ordered list is empty, 0 otherwise. + */ +int lio_process_ordered_list(struct lio_device *lio_dev); + +static inline void +lio_swap_8B_data(uint64_t *data, uint32_t blocks) +{ + while (blocks) { + *data = rte_cpu_to_be_64(*data); + blocks--; + data++; + } +} + /** Setup instruction queue zero for the device * @param lio_dev which lio device to setup * diff --git a/drivers/net/liquidio/lio_struct.h b/drivers/net/liquidio/lio_struct.h index a06726b..ad67ed1 100644 --- a/drivers/net/liquidio/lio_struct.h +++ b/drivers/net/liquidio/lio_struct.h @@ -213,6 +213,17 @@ struct lio_sriov_info { uint32_t num_vfs; }; +/* Head of a response list */ +struct lio_response_list { + /** List structure to add delete pending entries to */ + struct lio_clist_head head; + + /** A lock for this response list */ + rte_spinlock_t lock; + + rte_atomic64_t pending_req_count; +}; + /* Structure to define the configuration attributes for each Input queue. */ struct lio_iq_config { /* Max number of IQs available */ @@ -289,6 +300,9 @@ struct lio_device { /** The input instruction queues */ struct lio_instr_queue *instr_queue[LIO_MAX_POSSIBLE_INSTR_QUEUES]; + /** The circular-linked list of instruction response */ + struct lio_response_list response_list; + struct lio_io_enable io_qmask; struct lio_sriov_info sriov_info; -- 1.8.3.1