From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from na01-bl2-obe.outbound.protection.outlook.com (mail-bl2on0077.outbound.protection.outlook.com [65.55.169.77]) by dpdk.org (Postfix) with ESMTP id 58EFC5A40 for ; Sat, 7 May 2016 17:18:43 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=HWPkt6GMnwL0IZWwS2TN1kWChSHBZf0NiBB7+f/NY7Y=; b=O206frRzvZl0Duf+aG3ejaSN6SNnkPuKSGUVaXUPFNt2Mi6gF4R5Ew30JC8VJKq2n4WvpHtmeMgBvqxb35gRDPWxJtkHbyNjO8L3gJRZlq7rouHpdoNChpWlPkIn3FVR0FudnMp5o+jh/2gm2gi77wgdLdibz/XOPiNI4qYzW4s= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=caviumnetworks.com; Received: from localhost.localdomain.localdomain (122.167.10.92) by BN3PR0701MB1718.namprd07.prod.outlook.com (10.163.39.17) with Microsoft SMTP Server (TLS) id 15.1.492.11; Sat, 7 May 2016 15:18:36 +0000 From: Jerin Jacob To: CC: , , Jerin Jacob , Maciej Czekaj , Kamil Rytarowski , Zyta Szpak , Slawomir Rosek , Radoslaw Biernacki Date: Sat, 7 May 2016 20:46:30 +0530 Message-ID: <1462634198-2289-13-git-send-email-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1462634198-2289-1-git-send-email-jerin.jacob@caviumnetworks.com> References: <1462634198-2289-1-git-send-email-jerin.jacob@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [122.167.10.92] X-ClientProxiedBy: PN1PR01CA0050.INDPRD01.PROD.OUTLOOK.COM (10.164.136.150) To BN3PR0701MB1718.namprd07.prod.outlook.com (10.163.39.17) X-MS-Office365-Filtering-Correlation-Id: 30c5d7a5-b83f-4835-a10f-08d3768adf38 X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1718; 2:qZs7nyx+bqVd8hwcQScOZ7I5tMWhiRplwk0LY1IQMhOvGBxZXcfFKK0mumQst+8Q1/WF3MIrjEksOvst5xK2Q1054pViSbzRMjsNPRJXzgsuOIBrV/A/ZucTreFK+0SuInGaRlnBkxT7dVKgQxInAmDrgOqdDhNUrySgy+30F7ldTtDCqSpASDFJk+HndWER; 3:wIDbWQzuCHoVmiijTWqo76xGqv3pdendZFTWl6tQs5AYBMcO2ybsegwmcY3+9uy6iQS78/5D/pDBUYOf7/QJ11OulXrkfuRXG5HnuG/UzEMqg3WbNgXQ+w4MP+kKniQn; 25:uHn1ohIWk6FMkIPLbjQ/6PARAFzKV2NvP/UkbhytPCOtP1l5HVWjBSGKQ+wE4/lf8hJxziK/jYthYc8yX/+VDOrEDFkcTw8Oa6tkZ86BwRW+gvW/qtTIzS1pSaYWncuMO1YaYlEz3cI0eUL0PppgfpVyGMObXxkprXR/42jiYLjGU5kIRX1zwwfofIVN659DPEc8zaCDk3gWAOVHVMqlobz81Tb+pdRJsHVSurFCx5/8GyCESyqxzchdA5wyLH38sbgVI4sBnbkR2CqzvvjTvLRn2Wi3HTMJC4QQ0Y9nOjlgm15EDnaXcGMNU5mM6dX4RSW+q2qJ03wKJ14WmL4r3+49rxznVKPwqhqCxyW8qJMeXPCR11iKe3URcMrDwI+A7WF2PHz2AOPlB5XFUEgPuA== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN3PR0701MB1718; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1718; 20:xPzMTFnVooXllurChxcEzYRCaYsreJ/3dwnR7cM6QNsOPCENk8J/LeyIWNSC6m3KlE1LmYgdt/1yuaoyRzpP57yk7tTFPEwHUc+o9vM0XjiG7Jj4s0HPI//JHIzHmo25u/88mqXZX1iVa8kKVW6h+1YFwq2fuQOyK8DrTfL11HAbZqGhhZj7HrkRVlS42h9RYgkNniqzZ3/vBkuZPyVoS1lgUlT+mr+6nDw4U9tNI5wjP/ErRHbhpbZogLL5C2qknqrIT4iuYEA6KPnlkj/BHx4HZBI3hjxy3VVTuDfyeUeswKiFDQ033wwDsqfgfZyqRsMTVwTWJpAe68N4kObZqAkMjHPXIGI9B6opg7hOQ7v9KS0RDRu3BvYYhnBqe5NVIyTT658hT/9Maav12W9S5EeCSi6RyzhV9OWBhQuiumlah5wF6Wgm5litJaGv5fvPsnUxbIWOSupfsit8jOkAhXlrNhHRMviPL6KLGulCGN8aGfjpBNF0sRGnvTbqwNhGlVosEJbJEKkG3wtX6yVf2olPO3y2lFvz/kZUTfSGx7kY5KbnbDXptnRpzVMY85ibxcR5yZqsIE0e5k8wNIRoBstB1TcEeOfqjQcLh7CBLEo= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046); SRVR:BN3PR0701MB1718; BCL:0; PCL:0; RULEID:; SRVR:BN3PR0701MB1718; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1718; 4:h+7djOA52qhg/lvPQ4Q9v+7g4jAWogL4iQ2UvUUR3Q35HZG5TW0zcJXXcSKSba2R25AmO4t7tRcbdOxzMDERTwmvez+0TSW5snodeLt5poSTaq7chr3YpNSFOAqzjUnDvx94NA78fDGpyOaeR1/ZkzytyjWXEQr7SmKOdw9FswvUTyCQvfFSplLr52mA3gSE3qkBQjNzmxzvPUd0e8dKJ+FmPTEsEAjhWHR+lTX3eSIc5Lc4D8RF/Swd40lDvsTKV7v/dptAwYM/Nrf2i5ufVa3gcwATwjwXLuIZmaIBb8yKldBJlGQd7nYl0SN1sAQchHMLwF6tvXQogsCwZt73+I9FSkFeRRcuhzwa1EttPQYb4fVtf030tjjKWiKImqj2 X-Forefront-PRVS: 09352FD734 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(6069001)(50226002)(77096005)(2950100001)(48376002)(81166005)(50466002)(66066001)(47776003)(92566002)(5003940100001)(4326007)(2906002)(110136002)(50986999)(2351001)(33646002)(586003)(3846002)(6116002)(229853001)(5004730100002)(76176999)(19580395003)(19580405001)(189998001)(5008740100001)(42186005)(36756003)(7099028); DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR0701MB1718; H:localhost.localdomain.localdomain; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1718; 23:cSFO7lbHS1OM8suu2MDDWxyNEaF0t8jIPATsG37gV4UPsYOARTBpyICSwAdSRHitmKPS7hjCFTYZJsQWtKsKOOk2qBf3ieoUyGpeQduoqTJ4TRHFE3CyetnTQG5yT6w+DWDc9NRsdkmTDXPVFbwPmSdLZOVoGCKI4o6GxdFQCAYVsBZK8r+zC72ktrIcYJ+EuL0d0kttAURXb0qivf7MJYqT95cULeMEf2IkbcdapDBQO2B4+sUL2OC8HF//Gmkn8RaXjKXWTcBVstMJqfT4lxTituDWPpSVz3e4a8ZLl9jdW9ocUSnbW4hzVyZ6xmbN4E65UT8vZ8gg11xYbkFtsbq1hpOhTV7+iI/6Zvzef05+cOYhcwTXrJkY0/0PcRBW69vmWtVgpKJWAYEqCHtUiAIUZggHOeELErSruKi+HiQCjzALn0rcugldkDl2mEdT3s9InZu++an/lvBAYznmTT+qF0bMC/9OVjkKGqZfdOxfBmgqX9PM9DdwQGq/rrQRnro4VB/CUqmVm5N7NTpAzb3+h40wGgRfKNbcst+Y3Id0ABPUeQ24W0/eO8hwFqni99uOLEo2CtNhV5DiwSAeqXg9Is7F2KLC3wZcw72mLuDa/wcrZ0F/R9j9PJ6LEj4k/YFGexzMS1c2losL89Mpf/Nbn3wgm1+/DgRbHgoTclgOf6EE8k0nz3k/5mpHiy8v084qbxmBdScoezrt8ZigIMvqLsbax5J/v0K8IHqkF/orydaL2dAJhrb2d5wYMG1VJ92KYbqNWcniWTnzoH7zma7mqSZgri6Hup7/sZIkdA9SiCndfLuQtwTU6PzwbEU6iy/SAdAHVmGtc0jAzXvpQv4i1iDlwyNB1sTnSPZFT5LffEb/8Ju8F5yAJxhU6rAa X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1718; 5:R0pWqgODNipBlCCFtHI464AquX9krmcQjqi9umYA9k1wYMUpizVC9JFeQK7MfvB3yKGzboVTjqLl0QrhBAuK9u0VFXv3vn+NqzRaUSuXXuSH3XZutBZ9AK3GGGrN9KyGxlGrbw6RfTVbamoqjeCdDg==; 24:fS7SD1ga4FG+r1FNKhbXlThyJjQTx2oUyMkNJYO5ja0Wu0UsCiHIy5FqFPpSKsE0g2QySqdDM4Ftm5KbKLBSlvOXoj/6YWHYjY19TqZm+/E=; 7:AVcbsvIYFTUE88nsVNrHJsAQ+Uzi9HAPTdep99EWQDMJKeUUhz4gRNjtxWAnghG9TEG1BxE7YAv8p20ocQyt0zx6RPSp9N8yqRgd3EViSJtgjlucyMjKCHLNNqqNgGWkdsod14Dd461apENV60jMcVAzG0nPXg0AAwbfX0iOsNaUgF+25iWJ9gsBZ67pZvUa SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 May 2016 15:18:36.7590 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR0701MB1718 Subject: [dpdk-dev] [PATCH 12/20] thunderx/nicvf: add single and multi segment tx functions 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: Sat, 07 May 2016 15:18:43 -0000 Signed-off-by: Jerin Jacob 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 --- drivers/net/thunderx/Makefile | 2 + drivers/net/thunderx/nicvf_rxtx.c | 279 ++++++++++++++++++++++++++++++++++++++ drivers/net/thunderx/nicvf_rxtx.h | 48 +++++++ 3 files changed, 329 insertions(+) create mode 100644 drivers/net/thunderx/nicvf_rxtx.c create mode 100644 drivers/net/thunderx/nicvf_rxtx.h diff --git a/drivers/net/thunderx/Makefile b/drivers/net/thunderx/Makefile index 69bb750..7a7a072 100644 --- a/drivers/net/thunderx/Makefile +++ b/drivers/net/thunderx/Makefile @@ -51,10 +51,12 @@ VPATH += $(SRCDIR)/base # # all source are stored in SRCS-y # +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 +CFLAGS_nicvf_rxtx.o += -fno-prefetch-loop-arrays -Ofast # this lib depends upon: DEPDIRS-$(CONFIG_RTE_LIBRTE_THUNDERX_NICVF_PMD) += lib/librte_eal lib/librte_ether diff --git a/drivers/net/thunderx/nicvf_rxtx.c b/drivers/net/thunderx/nicvf_rxtx.c new file mode 100644 index 0000000..504c651 --- /dev/null +++ b/drivers/net/thunderx/nicvf_rxtx.c @@ -0,0 +1,279 @@ +/* + * 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 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "base/nicvf_plat.h" + +#include "nicvf_ethdev.h" +#include "nicvf_rxtx.h" +#include "nicvf_logs.h" + +static inline void __hot +fill_sq_desc_header(union sq_entry_t *entry, struct rte_mbuf *pkt) +{ + /* Local variable sqe to avoid read from sq desc memory*/ + union sq_entry_t sqe; + uint64_t ol_flags; + + /* Fill SQ header descriptor */ + sqe.buff[0] = 0; sqe.buff[1] = 0; + sqe.hdr.subdesc_type = SQ_DESC_TYPE_HEADER; + /* Number of sub-descriptors following this one */ + sqe.hdr.subdesc_cnt = pkt->nb_segs; + sqe.hdr.tot_len = pkt->pkt_len; + + ol_flags = pkt->ol_flags & NICVF_TX_OFFLOAD_MASK; + if (unlikely(ol_flags)) { + /* L4 cksum */ + if (ol_flags & PKT_TX_TCP_CKSUM) + sqe.hdr.csum_l4 = SEND_L4_CSUM_TCP; + else if (ol_flags & PKT_TX_SCTP_CKSUM) + sqe.hdr.csum_l4 = SEND_L4_CSUM_SCTP; + else if (ol_flags & PKT_TX_UDP_CKSUM) + sqe.hdr.csum_l4 = SEND_L4_CSUM_UDP; + else + sqe.hdr.csum_l4 = SEND_L4_CSUM_DISABLE; + sqe.hdr.l4_offset = pkt->l3_len + pkt->l2_len; + + /* L3 cksum */ + if (ol_flags & PKT_TX_IP_CKSUM) { + sqe.hdr.csum_l3 = 1; + sqe.hdr.l3_offset = pkt->l2_len; + } + } + + entry->buff[0] = sqe.buff[0]; + entry->buff[1] = sqe.buff[1]; +} + +static inline void __hot +fill_sq_desc_gather(union sq_entry_t *entry, struct rte_mbuf *pkt) +{ + /* Local variable sqe to avoid read from sq desc memory*/ + union sq_entry_t sqe; + + /* Fill the SQ gather entry */ + sqe.buff[0] = 0; sqe.buff[1] = 0; + sqe.gather.subdesc_type = SQ_DESC_TYPE_GATHER; + sqe.gather.ld_type = NIC_SEND_LD_TYPE_E_LDT; + sqe.gather.size = pkt->data_len; + sqe.gather.addr = rte_mbuf_data_dma_addr(pkt); + + entry->buff[0] = sqe.buff[0]; + entry->buff[1] = sqe.buff[1]; +} + +static inline void __hot +nicvf_single_pool_free_xmited_buffers(struct nicvf_txq *sq) +{ + int j = 0; + uint32_t curr_head; + uint32_t head = sq->head; + struct rte_mbuf **txbuffs = sq->txbuffs; + void *obj_p[MAX_TX_FREE_THRESH] __rte_cache_aligned; + + curr_head = nicvf_addr_read(sq->sq_head) >> 4; + while (head != curr_head) { + if (txbuffs[head]) + obj_p[j++] = txbuffs[head]; + + head = (head + 1) & sq->qlen_mask; + } + + rte_mempool_put_bulk(sq->pool, obj_p, j); + sq->head = curr_head; + sq->xmit_bufs -= j; + NICVF_TX_ASSERT(sq->xmit_bufs >= 0); +} + +static inline void __hot +nicvf_multi_pool_free_xmited_buffers(struct nicvf_txq *sq) +{ + uint32_t n = 0; + uint32_t curr_head; + uint32_t head = sq->head; + struct rte_mbuf **txbuffs = sq->txbuffs; + + curr_head = nicvf_addr_read(sq->sq_head) >> 4; + while (head != curr_head) { + if (txbuffs[head]) { + rte_pktmbuf_free_seg(txbuffs[head]); + n++; + } + + head = (head + 1) & sq->qlen_mask; + } + + sq->head = curr_head; + sq->xmit_bufs -= n; + NICVF_TX_ASSERT(sq->xmit_bufs >= 0); +} + +static inline uint32_t __hot +nicvf_free_tx_desc(struct nicvf_txq *sq) +{ + return ((sq->head - sq->tail - 1) & sq->qlen_mask); +} + +/* Send Header + Packet */ +#define TX_DESC_PER_PKT 2 + +static inline uint32_t __hot +nicvf_free_xmittted_buffers(struct nicvf_txq *sq, struct rte_mbuf **tx_pkts, + uint16_t nb_pkts) +{ + uint32_t free_desc = nicvf_free_tx_desc(sq); + + if (free_desc < nb_pkts * TX_DESC_PER_PKT || + sq->xmit_bufs > sq->tx_free_thresh) { + if (sq->is_single_pool) { + if (unlikely(sq->pool == NULL)) + sq->pool = tx_pkts[0]->pool; + + nicvf_single_pool_free_xmited_buffers(sq); + } else { + nicvf_multi_pool_free_xmited_buffers(sq); + } + /* Freed now, let see the number of free descs again */ + free_desc = nicvf_free_tx_desc(sq); + } + return free_desc; +} + +uint16_t __hot +nicvf_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) +{ + int i; + uint32_t free_desc; + uint32_t tail; + struct nicvf_txq *sq = tx_queue; + union sq_entry_t *desc_ptr = sq->desc; + struct rte_mbuf **txbuffs = sq->txbuffs; + struct rte_mbuf *pkt; + uint32_t qlen_mask = sq->qlen_mask; + + tail = sq->tail; + free_desc = nicvf_free_xmittted_buffers(sq, tx_pkts, nb_pkts); + + for (i = 0; i < nb_pkts && (int)free_desc >= TX_DESC_PER_PKT; i++) { + pkt = tx_pkts[i]; + + txbuffs[tail] = NULL; + fill_sq_desc_header(desc_ptr + tail, pkt); + tail = (tail + 1) & qlen_mask; + + txbuffs[tail] = pkt; + fill_sq_desc_gather(desc_ptr + tail, pkt); + tail = (tail + 1) & qlen_mask; + free_desc -= TX_DESC_PER_PKT; + } + + sq->tail = tail; + sq->xmit_bufs += i; + rte_wmb(); + + /* Inform HW to xmit the packets */ + nicvf_addr_write(sq->sq_door, i * TX_DESC_PER_PKT); + return i; +} + +uint16_t __hot +nicvf_xmit_pkts_multiseg(void *tx_queue, struct rte_mbuf **tx_pkts, + uint16_t nb_pkts) +{ + int i, k; + uint32_t used_desc, next_used_desc, used_bufs, free_desc, tail; + struct nicvf_txq *sq = tx_queue; + union sq_entry_t *desc_ptr = sq->desc; + struct rte_mbuf **txbuffs = sq->txbuffs; + struct rte_mbuf *pkt, *seg; + uint32_t qlen_mask = sq->qlen_mask; + uint16_t nb_segs; + + tail = sq->tail; + used_desc = 0; + used_bufs = 0; + + free_desc = nicvf_free_xmittted_buffers(sq, tx_pkts, nb_pkts); + + for (i = 0; i < nb_pkts; i++) { + pkt = tx_pkts[i]; + + nb_segs = pkt->nb_segs; + + next_used_desc = used_desc + nb_segs + 1; + if (next_used_desc > free_desc) + break; + used_desc = next_used_desc; + used_bufs += nb_segs; + + txbuffs[tail] = NULL; + fill_sq_desc_header(desc_ptr + tail, pkt); + tail = (tail + 1) & qlen_mask; + + txbuffs[tail] = pkt; + fill_sq_desc_gather(desc_ptr + tail, pkt); + tail = (tail + 1) & qlen_mask; + + seg = pkt->next; + for (k = 1; k < nb_segs; k++) { + txbuffs[tail] = seg; + fill_sq_desc_gather(desc_ptr + tail, seg); + tail = (tail + 1) & qlen_mask; + seg = seg->next; + } + } + + sq->tail = tail; + sq->xmit_bufs += used_bufs; + rte_wmb(); + + /* Inform HW to xmit the packets */ + nicvf_addr_write(sq->sq_door, used_desc); + return nb_pkts; +} diff --git a/drivers/net/thunderx/nicvf_rxtx.h b/drivers/net/thunderx/nicvf_rxtx.h new file mode 100644 index 0000000..9c9bd07 --- /dev/null +++ b/drivers/net/thunderx/nicvf_rxtx.h @@ -0,0 +1,48 @@ +/* + * 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_RXTX_H__ +#define __THUNDERX_NICVF_RXTX_H__ + +#include + +#define NICVF_TX_OFFLOAD_MASK (PKT_TX_IP_CKSUM | PKT_TX_L4_MASK) + +#ifndef __hot +#define __hot __attribute__((hot)) +#endif + +uint16_t nicvf_xmit_pkts(void *txq, struct rte_mbuf **tx_pkts, uint16_t pkts); +uint16_t nicvf_xmit_pkts_multiseg(void *txq, struct rte_mbuf **tx_pkts, + uint16_t pkts); + +#endif /* __THUNDERX_NICVF_RXTX_H__ */ -- 2.1.0