From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0057.outbound.protection.outlook.com [104.47.36.57]) by dpdk.org (Postfix) with ESMTP id 9A9EDBD28 for ; Tue, 21 Feb 2017 10:29:50 +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=isX4Ro9cWmE8nIMWROkuaK436qDEeuu0lA4M7S9Ezc8=; b=NwsNPofxsNqZJVgrcmvElBXKO2Qyxw+3Y04XKju0RRLgVA7xM63blsLMrEJT6Z2bOQ34qdgMQMnBBvruFUQxJaK/Z/V5o45FTyWu3wpBzxg/DDA6quYPRXF6v7in5hqTU8Lhv+h+Dex2gqPXFpF5a2rlIvlLFxHo+vtE7xeTf/c= 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:45 +0000 From: Shijith Thotton To: dev@dpdk.org Cc: Jerin Jacob , Derek Chickles , Venkat Koppula , Mallesham Jatharakonda Date: Tue, 21 Feb 2017 14:56:47 +0530 Message-Id: <1487669225-30091-33-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: e29f1a2e-b2e3-49f2-2a8c-08d45a3c2dbc X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:SN1PR07MB2285; X-Microsoft-Exchange-Diagnostics: 1; SN1PR07MB2285; 3:F8VhSZmQF/AM3zSPl6gGLnZd/v7m5/zfJntaPeWDVcUt/A2jRC1yXYy6/U5y2pzVV0fS/hpdARDNfaiCuiycxhLABa4xAQu1ogGrJ0Rw65e0P3mT9b45byxxu0hlEbVyWflaGPCFY4m+E+Kel8aYfzbS1kObVkS5HKb07XwDeJN3Xtk0ZyzvIcVLCSUygXQ07ohBRDcV1e/eM5EbsJ9LebsXIckxK7zvi3yH0pxVBt/THJfuu04RFfpwA8jjaIYbvPsy6uwEDWSxHYwa2GM8AA==; 25:KMhmrJMzDGVMrgMAt7wTx4NW47+Nb977/VhOIeEdNg2S1sgd4KYGK2OkQiXSAgnIXoAMxs6k2MggEpARNELmAPkEn3iHwheJVSloLkQJFqxWuS4EWcZOvSarBd5pYFoaId+0bxBhO7Hg9x25ZHwSWX8cP+VjFI7b3qyqE54IUwDL8gG1QsHv6GFKi/DxSVbsZMQs7nat570bu/K9vS38pViLY1/cUDv1/XS6kwg77S3R1V8310NLUfyA+GHQ4odQSKJ/8P5b+vkGiWKqvmFfEg5g+AS33w+MOBW8le4jtl7lkxOKg7sxWD5wgMKF8J23XHCPFKO0pqPvDZX2LasFV+YIWmQSiya8qIidPJPdYmpfAQdXNkRF1Bvp9HAr6KYw+3S0EE2U9rgjkrrtn3V+2k77uW8byt7C35Vi28V4AAjGka7/KcUZGq9D7j6ADk/Ofan8XNM/1Al1VxNWmRuIbg== X-Microsoft-Exchange-Diagnostics: 1; SN1PR07MB2285; 31:hboNjR6fxXtdSZAR+oE4SBIJ1lZDUPgCg0dstCOxxR68L/6rPuw+xvFphh0Sq/6bDzo3qqJE7sl9zAKGbQan8x+BgYv2AXZEk5gwrtHImdLJk6HNC66fsh5XBp4QgLcrS5vQusGXFBmXuM9Z/S6M0UP87r85xjeF61QoW1XWFrYItwEvf0z5C7i1Wx2hPZb1FHYUCNWlbYjrGsGy21JD3SUPxymzfSTACc+ddUnjYKU=; 20:XjzwAliS6qGcaYmgszXcd19pieS/2rTx+OhOanzorYdd3s59hUCYx0JJitOH15d0zWcQNB3kchke3G+sP5+p9Xp29dOfgfDeA0PZ5boyeTyObwbb7DQaSpmvpMMBDgb3pPt/UZoyRbtnnxX98mCDdtEpt0ckso8TavEBBMxf6O0N/gWeFDSeCcfRU1gl0X6rA32VHcuoj1OFW+TTZYJm3Qo3YB1RzzT8z+sBZo3o4HcZljorvnxPlUcW4LmL0lg15sGw1aG6FTMhHRWaSw9keqi9eOfjxe1qqFNpRgoxjhA2KbB0gYYlIhma4pZegcsBErdA2en1j7ixxe1rwScED7+Qwmwckp4tGidlrFkr0GugqJB5VMAGa5UPPnbQop4Aj7qGVXBuANnZrWZWWgSDj97Dl2NS0l5DUnoW9cvHArz16eWa9fzfhHv8h1hmyyyvhJ1qFiluNfUAzlATILLtEU3lmVsuAFn6zX5pNQiGxa9RqFl+59PP5d9BaDw3Y8aeC3ZEQ6mbo4PaqKizhJBil7vikvZCOmLhy1ArqscmLs0Be2Qw2cxB4WoJSCFhtZxA5od+rvvf1N2VTi4tbCGD6Crs+NXSAF5aIaEf+0ByPBE= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; 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:LSVTHZOYQPDQAuCzP9cBITML0q9ycfsEHV0x6UeS+R8HGORvStD62BFxt/uNX7nH/TW33qy5xXrcCQOIb25Ho2m+T8KN4/NOKPkJOcKpxAPTOXx7IeWwkqIeX4ccj7cARJLyZblHKTutD7VwsCyXqp65fZAyQsT9PO7wKJKsETDi6bLMGDGaIYUljT46clAfgC6jGIWaSQCDJhIQi6oOcI14H28Ko+/QmKNVc1q5WLHjf8fY4BWB1abjDpIJRpY3DY6jMyf/gByyR2rXNPJ5LFoK0Ov/Oo4j2jRpLBNUKJMu+yIY+nSJnXCVl/2izSVk3EfqjJK9h1y2KIj6OU2R2IYboC6/iEN8bmcEDYlr18wbJKWa2tmoFQAGH+4ORFW687pv76Z+FJB9PBJQYrKz0urP9oJK2YovC2JQiIrfsDfBGqIDOYzoOlXZmk3qVK0wCaK9u60JYCJKAgpotAKvHDqeNdel7nfOHiOd0DelJjQbUXRgHFA+XFMoH/Jc5hZbX1Cgk0UXPFiLll3J3SzWF7QucvovudggLbdHXF7FgIuSvGsfDrjRLxVM49X0n6F4rIP61M2RYnLPuibl//JUgBSjLgiZYIPz3RZGB9u/LNo= X-Forefront-PRVS: 0225B0D5BC X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(7916002)(39450400003)(39410400002)(39830400002)(189002)(43544003)(199003)(50226002)(81166006)(42186005)(2361001)(575784001)(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)(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; SN1PR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PScviMQGuiza1ocMJ+LKf76h60nuPJtwiMW5DByXZMHKlA/nJV+5NLdVsrk9FqbDlZrb6sFLnxwDiyJfxaugsUICJtm2wQn/DPA==; 24:SGveBQ63NyYE+opvNgwt4CpH7nMD4fOT3yGMXGRTg1tIFXP4HrzUj3MTbQsfe1AQyPGm1TRmtBdSWwr2GScxQT+M20w9Z1jPh6r9f64925M= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN1PR07MB2285; 7:W0KK+2FUlWACbUJZcDwuwuZC4KrLu5Q97bmo/VOKeRevmuiYwJGdbXKdAV4XmDVR5D5or40d/rlQtKCn4eL7sAdRvuVv0fExuwFyYpm6JZgnaTcmFvBZVmyCmyNi9sto0v4lD55Jdw0lG2EPubA0PotUMZhGeu6UmpHr5xFW2C9paC3G8XFCpzMdclklq43xvANhDLMxlON78x6lEbXKspzb+PXxXlvQQslEcXKfbJ8mtSJlYmg2d3e7zC5KiNXfr3/z3L8kijB+5LwSkcXzVCdwmmjcLg482E0ymRfFcywjiSUD8Vi7hrBWNlHLd5XhRLM1jSN33eq7NftSib2aDA== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Feb 2017 09:29:45.8863 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR07MB2285 Subject: [dpdk-dev] [PATCH 32/50] net/liquidio: add APIs to flush IQ and free buffers 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:51 -0000 Add support for instruction queue flush. Check how many packets reached device from host and free host buffers accordingly from request list. 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 | 1 + drivers/net/liquidio/lio_rxtx.c | 187 +++++++++++++++++++++++++++++++++++++- drivers/net/liquidio/lio_rxtx.h | 1 + 3 files changed, 188 insertions(+), 1 deletion(-) diff --git a/drivers/net/liquidio/lio_ethdev.c b/drivers/net/liquidio/lio_ethdev.c index a5acce8..bf85089 100644 --- a/drivers/net/liquidio/lio_ethdev.c +++ b/drivers/net/liquidio/lio_ethdev.c @@ -281,6 +281,7 @@ static int lio_dev_configure(struct rte_eth_dev *eth_dev) * response arrived or timed-out. */ while ((*sc->status_word == LIO_COMPLETION_WORD_INIT) && --timeout) { + lio_flush_iq(lio_dev, lio_dev->instr_queue[sc->iq_no]); lio_process_ordered_list(lio_dev); rte_delay_ms(1); } diff --git a/drivers/net/liquidio/lio_rxtx.c b/drivers/net/liquidio/lio_rxtx.c index 32ef0fd..448c8b9 100644 --- a/drivers/net/liquidio/lio_rxtx.c +++ b/drivers/net/liquidio/lio_rxtx.c @@ -41,6 +41,9 @@ #include "lio_rxtx.h" #define LIO_MAX_SG 12 +/* Flush iq if available tx_desc fall below LIO_FLUSH_WM */ +#define LIO_FLUSH_WM(_iq) ((_iq)->max_count / 2) +#define LIO_PKT_IN_DONE_CNT_MASK 0x00000000FFFFFFFFULL static void lio_droq_compute_max_packet_bufs(struct lio_droq *droq) @@ -977,6 +980,146 @@ iq->request_list[idx].reqtype = reqtype; } +static inline void +lio_free_netsgbuf(void *buf) +{ + struct lio_buf_free_info *finfo = buf; + struct lio_device *lio_dev = finfo->lio_dev; + struct rte_mbuf *m = finfo->mbuf; + struct lio_gather *g = finfo->g; + uint8_t iq = finfo->iq_no; + + /* This will take care of multiple segments also */ + rte_pktmbuf_free(m); + + rte_spinlock_lock(&lio_dev->glist_lock[iq]); + CIRCLEQ_INSERT_TAIL(&lio_dev->glist_head[iq], &g->list, entries); + rte_spinlock_unlock(&lio_dev->glist_lock[iq]); + rte_free(finfo); +} + +/* Can only run in process context */ +static int +lio_process_iq_request_list(struct lio_device *lio_dev, + struct lio_instr_queue *iq) +{ + struct octeon_instr_irh *irh = NULL; + uint32_t old = iq->flush_index; + struct lio_soft_command *sc; + uint32_t inst_count = 0; + int reqtype; + void *buf; + + while (old != iq->lio_read_index) { + reqtype = iq->request_list[old].reqtype; + buf = iq->request_list[old].buf; + + if (reqtype == LIO_REQTYPE_NONE) + goto skip_this; + + switch (reqtype) { + case LIO_REQTYPE_NORESP_NET: + rte_pktmbuf_free((struct rte_mbuf *)buf); + break; + case LIO_REQTYPE_NORESP_NET_SG: + lio_free_netsgbuf(buf); + break; + case LIO_REQTYPE_SOFT_COMMAND: + sc = buf; + irh = (struct octeon_instr_irh *)&sc->cmd.cmd3.irh; + if (irh->rflag) { + /* We're expecting a response from Octeon. + * It's up to lio_process_ordered_list() to + * process sc. Add sc to the ordered soft + * command response list because we expect + * a response from Octeon. + */ + rte_spinlock_lock(&lio_dev->response_list.lock); + rte_atomic64_inc( + &lio_dev->response_list.pending_req_count); + CIRCLEQ_INSERT_TAIL( + &lio_dev->response_list.head, + &sc->node, entries); + rte_spinlock_unlock( + &lio_dev->response_list.lock); + } else { + if (sc->callback) { + /* This callback must not sleep */ + sc->callback(LIO_REQUEST_DONE, + sc->callback_arg); + } + } + break; + default: + lio_dev_err(lio_dev, + "Unknown reqtype: %d buf: %p at idx %d\n", + reqtype, buf, old); + } + + iq->request_list[old].buf = NULL; + iq->request_list[old].reqtype = 0; + + skip_this: + inst_count++; + old = lio_incr_index(old, 1, iq->max_count); + } + + iq->flush_index = old; + + return inst_count; +} + +static void +lio_update_read_index(struct lio_instr_queue *iq) +{ + uint32_t pkt_in_done = rte_read32(iq->inst_cnt_reg); + uint32_t last_done; + + last_done = pkt_in_done - iq->pkt_in_done; + iq->pkt_in_done = pkt_in_done; + + /* Add last_done and modulo with the IQ size to get new index */ + iq->lio_read_index = (iq->lio_read_index + + (uint32_t)(last_done & LIO_PKT_IN_DONE_CNT_MASK)) % + iq->max_count; +} + +int +lio_flush_iq(struct lio_device *lio_dev, struct lio_instr_queue *iq) +{ + uint32_t tot_inst_processed = 0; + uint32_t inst_processed = 0; + int tx_done = 1; + + if (rte_atomic64_test_and_set(&iq->iq_flush_running) == 0) + return tx_done; + + rte_spinlock_lock(&iq->lock); + + lio_update_read_index(iq); + + do { + /* Process any outstanding IQ packets. */ + if (iq->flush_index == iq->lio_read_index) + break; + + inst_processed = lio_process_iq_request_list(lio_dev, iq); + + if (inst_processed) + rte_atomic64_sub(&iq->instr_pending, inst_processed); + + tot_inst_processed += inst_processed; + inst_processed = 0; + + } while (1); + + rte_spinlock_unlock(&iq->lock); + + rte_atomic64_clear(&iq->iq_flush_running); + + return tx_done; +} + static int lio_send_command(struct lio_device *lio_dev, uint32_t iq_no, void *cmd, void *buf, uint32_t datasize __rte_unused, uint32_t reqtype) @@ -1385,6 +1528,35 @@ struct lio_soft_command * lio_dev->num_iqs--; } +static inline uint32_t +lio_iq_get_available(struct lio_device *lio_dev, uint32_t q_no) +{ + return ((lio_dev->instr_queue[q_no]->max_count - 1) - + (uint32_t)rte_atomic64_read( + &lio_dev->instr_queue[q_no]->instr_pending)); +} + +static inline int +lio_iq_is_full(struct lio_device *lio_dev, uint32_t q_no) +{ + return ((uint32_t)rte_atomic64_read( + &lio_dev->instr_queue[q_no]->instr_pending) >= + (lio_dev->instr_queue[q_no]->max_count - 2)); +} + +static int +lio_dev_cleanup_iq(struct lio_device *lio_dev, int iq_no) +{ + struct lio_instr_queue *iq = lio_dev->instr_queue[iq_no]; + uint32_t count = 10000; + + while ((lio_iq_get_available(lio_dev, iq_no) < LIO_FLUSH_WM(iq)) && + --count) + lio_flush_iq(lio_dev, iq); + + return count ? 0 : 1; +} + /** Send data packet to the device * @param lio_dev - lio device pointer * @param ndata - control structure with queueing, and buffer information @@ -1421,6 +1593,8 @@ struct lio_soft_command * goto xmit_failed; } + lio_dev_cleanup_iq(lio_dev, iq_no); + for (i = 0; i < nb_pkts; i++) { uint32_t pkt_len = 0; @@ -1432,6 +1606,14 @@ struct lio_soft_command * ndata.buf = m; ndata.q_no = iq_no; + if (lio_iq_is_full(lio_dev, ndata.q_no)) { + if (lio_dev_cleanup_iq(lio_dev, iq_no)) { + PMD_TX_LOG(lio_dev, ERR, + "Transmit failed iq:%d full\n", + ndata.q_no); + break; + } + } cmdsetup.cmd_setup64 = 0; cmdsetup.s.iq_no = iq_no; @@ -1524,8 +1706,11 @@ struct lio_soft_command * break; } - if (unlikely(status == LIO_IQ_SEND_STOP)) + if (unlikely(status == LIO_IQ_SEND_STOP)) { PMD_TX_LOG(lio_dev, DEBUG, "iq full\n"); + /* create space as iq is full */ + lio_dev_cleanup_iq(lio_dev, iq_no); + } processed++; } diff --git a/drivers/net/liquidio/lio_rxtx.h b/drivers/net/liquidio/lio_rxtx.h index dbf8685..9b94fbc 100644 --- a/drivers/net/liquidio/lio_rxtx.h +++ b/drivers/net/liquidio/lio_rxtx.h @@ -706,6 +706,7 @@ uint16_t lio_dev_xmit_pkts(void *tx_queue, struct rte_mbuf **pkts, int lio_setup_iq(struct lio_device *lio_dev, int q_index, union octeon_txpciq iq_no, uint32_t num_descs, void *app_ctx, unsigned int socket_id); +int lio_flush_iq(struct lio_device *lio_dev, struct lio_instr_queue *iq); void lio_delete_instruction_queue(struct lio_device *lio_dev, int iq_no); /** Setup instruction queue zero for the device * @param lio_dev which lio device to setup -- 1.8.3.1