From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0088.outbound.protection.outlook.com [104.47.36.88]) by dpdk.org (Postfix) with ESMTP id 2EBB2F951 for ; Sat, 25 Mar 2017 07:28:23 +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=x9nMH87UsDpb+3kTKLsqTy+lwJBXU1EOsJusWqUGEm8=; b=cQlCSQ+5I4XTZ023URKKx+Umui9zZ+B2xUqN1/SUYDHWUgyVTBpAAQRhqp7xAWtUKQFMd3UwnNw9QCsMTp4c2p7bsYpT0482Y+9YXj/bRJAZpw+JlknzrIigIQjKegBs0HS0RTsbA7S+8ZIu6qJdn31A1JJeZCQPPAnI4C3GbB0= Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=caviumnetworks.com; Received: from lio357.in.caveonetworks.com (14.140.2.178) by CY1PR07MB2280.namprd07.prod.outlook.com (10.164.112.158) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.977.11; Sat, 25 Mar 2017 06:28:17 +0000 From: Shijith Thotton To: Ferruh Yigit Cc: dev@dpdk.org, Jerin Jacob , Derek Chickles , Venkat Koppula , Srisivasubramanian S , Mallesham Jatharakonda Date: Sat, 25 Mar 2017 11:54:39 +0530 Message-Id: <1490423097-6797-29-git-send-email-shijith.thotton@caviumnetworks.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1490423097-6797-1-git-send-email-shijith.thotton@caviumnetworks.com> References: <1488454371-3342-1-git-send-email-shijith.thotton@caviumnetworks.com> <1490423097-6797-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: BM1PR01CA0117.INDPRD01.PROD.OUTLOOK.COM (10.174.208.33) To CY1PR07MB2280.namprd07.prod.outlook.com (10.164.112.158) X-MS-Office365-Filtering-Correlation-Id: a5578ba3-7118-4fac-03c8-08d47348218c X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:CY1PR07MB2280; X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2280; 3:OwwpYYJhtIP81RXcIA1tapiNejCAW+bi84o9dy4mUu1fGrcSeMM4O9FkgU1j4M4PEd+0nVt+SM3diiJRZgrMk3+hr0OkRPlxNvbcegBauQAHO5pW49gnTflZr7rBd6NYtnP35bBr6hm4Ax+BjR9Dzyz4bFEtjrSqIfZTuR99J3y2Imjw087+jNryLZ6so0H/9dYbiiKdW/AK3cEIgq/zeURVdwQgn29RBsXOfE9F/vh4OZP2NtlRRHv0FF0QvPhFAZEPBunGBroPKiZzNa6JNw==; 25:8WZGi5iWtdQGwxwNeG11BrZbZlozVEU1+Dm2oHn2HQF3rmxo/KsgQJJqgDpXOZJWJ2V8ofWshGKDFf0s+URu5WIifHT4dIfCAAXlXRXArL1j3rQV7t5ZNmzrvujxp3FbHfu9sXII2fosG5vPljRoOXAJqkWK2euFoGfumM7U7k8f6d1tMcGLF/rLw0cqdhSHwBg4B01lJz/tmN7vR89XNRrgpuaMNQH/ssZjKojUdzTa9Hq39Qe217Q1zV4XHuJ4Dg+Ee58fJ0uFvAZ+BCySENLyeQkDZOOPtFyBAdp+M1rwoy1lXhEcNqE5J3dbwPJU1i8CaO2r4rmANrJxjsd21Fa1LrVk8YyhmrJ3yvVFjVuj164JnPfJjyzOi8rTAk4hR+pYAgyNl0B4jzGjvAeW1VsEJItviYVUaZ6yoqcWJ4ozvGPy6YWu5k/aI6A6p0YJuqFer9f8O+pQIN/n/t9TDg== X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2280; 31:t2RGRex+/Iaf7cMCid4rbwmPWUeWrqk7BlAj03/aM72EKGnhTvkDrnJ4IE6343rX0j1GN+f5jOo/rCpp9+ZDh1YWmVLcu4ihodt+EPBncICzdrJlIipf/n2RyfDv6pibAvEYsYdZtScXczjV1LILpfNpQudPkd+frjrUZ87Ka0jBjhhvVJHzSI3JrEHBqUBzTxCn9anhF4V6MuzU3rL4QKuW7igxuFiG/kvvOKNr2nE9XXVRAxDommDNy5zfsnIK; 20:TcO52zxCVy1rHHs4X+RfxTSdVKRs8/nAdb8y5lxbn/IEoMXo8erKZQfjxjDK88zDAR5FdP8Cl4OHW/nCAygAUOhUR0Zb7lvB3WYOzzZarfRDYde2R+DbaBtoEzNUMACubgH/+VJukr9xf4LQMXdnNqoBhEziFxP7BUmrVCW+R8x0CT8MSbd2HRqHVRXlsASYs3Gk65TnKsxs0JT9+PhaLK+hcW961lLv8JqZdI1vSonx0bQh4fAKsUJuhovqvDXniaIr73QZuNBrLne9752x7G4s+tCBMDJo9UwLD7s6vv2gjnBTlP2jARJ4OUFKk5/DCTsZDGZXvjyKGNwFbhvw8zZafAVf8cEl2WVgsPjqRZ3LOOTUqb5KzzzfXOIZA2XVj/csvVM2Z/zAqR4Dj6mmRECGR/gH7Riu1rGABAZOdR1ZazUbEKLWhnJ1uWsUAImh8/dZAJx6UmHDCzuWyU2hRSDYV7Q0lYyTalXnDp46KigWngtTZlycLYCxQI+ngkD/5IrHZuujPRJ7nCf6Xb2jOAEzZThd1FL/ONXjIS6ZiiyHaUn5Lgf47eWXR8oB4GAkv+Wx1O1QK43V/htuk8u8o+azOZDivSz1dHWNRw0qKFA= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6041248)(20161123564025)(20161123560025)(20161123562025)(20161123558025)(20161123555025)(6072148); SRVR:CY1PR07MB2280; BCL:0; PCL:0; RULEID:; SRVR:CY1PR07MB2280; X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2280; 4:kwj4pzod88ZFEmh6M3ZGufjitq/nNIV7Xe7X6Pnhyj0MCT/j2d7fNsysM+Z3fhG9fIWN6zbO3eQ1wQuLH8ZcP1hHF867fJvlvMLgWmw9MFnlP02xFx01BoK0+fbM7GU/7tadtNtX2LLpRp917VhJbfFTV+GCFvJXSa5XqEZeoI8jpJl5LJ0zqag5yGoSEymEmx3r2PJJBWq2yxYWtH4I7KtmHQY4WTmixsLJLqK6LcZ7TC/MTNK+74zOohdjo96Er2DkKnk60vhfN5fa8GMB961JjlJONZOxWiqi5pVLRUVjfsSldVmyhNlVPlUWmxLmCmWlefswN4xRwk3nSQF8uML3bzeMOPZFdKemKXNbaHw5NPaSzpVwaiZ6BRa44qqCy4XJZH6/JkISpXSflIJkkU38xiFi6kuCskW2HBd/DJNQFKjdNdUCq5KDxYXGI2GFfRw3My0nwTeCiFjumfhC+W99oDdB3F/pxAh13MSvJ6k8ZjuWiZwB/gEBxyrPU8eBhsvDzcAWmmQW/PPg9v0xST/M4BBvIhDZOCY1H7BQbHePI/awzTQdQjKiUJVQVyYY3mjr66qeF0b3HKjdiECILht3NWMdBDEQ3s0njKiVKug= X-Forefront-PRVS: 025796F161 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(39450400003)(39410400002)(39830400002)(2906002)(2950100002)(5003940100001)(66066001)(42882006)(6916009)(50466002)(48376002)(47776003)(42186005)(53936002)(6512007)(68736007)(5009440100003)(54906002)(50226002)(38730400002)(6486002)(6666003)(25786009)(305945005)(81166006)(7736002)(6116002)(3846002)(4326008)(8676002)(6506006)(189998001)(36756003)(50986999)(76176999)(33646002)(4720700003)(5660300001)(110136004)(110426004); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR07MB2280; H:lio357.in.caveonetworks.com; FPR:; SPF:None; MLV:nov; PTR:InfoNoRecords; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR07MB2280; 23:dOfXqp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=?us-ascii?Q?0808E2085AiQ0TFrcGapz6JDJuoC500PnC/Pb3b0AsKLdNthYOqKry5fQo7p?= =?us-ascii?Q?Fn7kDX3HezfP72USfn8EiCgNKh6d5WQQg7va+EYyIW2J2fhZ86wszM4HrVmF?= =?us-ascii?Q?iIHhb9Dtc/Zv59SQvzVM6u95hgdH0Y2YiyqBN26a+3FcGidhSKbMRQSabYsW?= =?us-ascii?Q?rEoV3rGZbp2ehyYpOMf0UD+QdY8?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2280; 6:aJTrvxl4zDnZodI4KHLU/PKFyQJE0HkNAkDihxPmvXdFHUrhpQ7VD27LUpWtPuP2DMpuAJ1FFqqgSJvqvm4PzLGy24wuB+6ye61zAag3RkADSnPMU0pMhB6RcCMt4J8rtmZ4su0yJQdLH2qjPh0bJwMujIulI+42vZGA0QPm2zEV6EmF9Ai9m8VB/TNuHNcEip6uJmRHO5PBnIfuo1dBF95eG4GzpykldVOqNFqsTZ7gJYYxKPQoaIvxcc+RseA9ev0PyRln9S6tL8LqtX3lKDx9L3IEjebFc4BuNRtinIIr1erbSKuxBOW/JhqXhDc1SBXyC9Kjx914sWTyusZ3DM/sR7h4mqytiZy7i13CzovkloLzCW5q6cPnspRrKVfealmwzVyic+QqNfHKTZN6kw==; 5:7AtyyEXyqETHSFXIMK7YA2JVxAFNhEZd64hzNZWVnw6J551Ip9E1u8W4siuMUoDrkb20ttgiFH1AjEsf5ZEQtr6MY9s34pHitKLgO1KvT7P3+V78+KeeebEfaYpcP/7miOJs5Wr9hvt80grDgcMPTg==; 24:fpT1tDq+k14hZBgr8E0XN6zDjDVL5JyGFc8mJtmnJ04C/WFYTiZbvf7LwuktlkylmhKT3ZJGbP/hz8yIff0cBxULl0r52Mbs01M5TjxR2wI= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2280; 7:a6KvIz2CI2HBHlZsG5VHpwI/r43JpuM2mU96X82KGAh7D0cR0AGQAauW37oKjRh1psmGfPGIcjh0M5V35lMmjlrwr2lm8sjwqzvScIl5b7ra1gKMRsW7QOfM82siFF9cwoggj2e/dJTJ6PZiNogRCvZAZsTBpILTN9M7JFNjbNjpGP438eCCxFYMpPXStZPkiagvP0DtIBQ393dv5bFlZ2DVCY67Klm56zAdczx4sIjTiszwk1qbLz9a+0NCGANP3Jq4DuA/ls0yJ56pSkXTpBaDTF2VkKTEbv3NknAml67z3+hB0yPGPHO1xDBoZzJ2W9L97+qvMvQMkg6YhlAOzQ== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Mar 2017 06:28:17.9336 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR07MB2280 Subject: [dpdk-dev] [PATCH v3 28/46] net/liquidio: add Tx data path for multiple segments 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: Sat, 25 Mar 2017 06:28:23 -0000 Signed-off-by: Shijith Thotton Signed-off-by: Jerin Jacob Signed-off-by: Derek Chickles Signed-off-by: Venkat Koppula Signed-off-by: Srisivasubramanian S Signed-off-by: Mallesham Jatharakonda --- doc/guides/nics/features/liquidio.ini | 1 + drivers/net/liquidio/lio_rxtx.c | 62 +++++++++++++++++++++++++++++++++++ drivers/net/liquidio/lio_rxtx.h | 11 +++++++ drivers/net/liquidio/lio_struct.h | 24 ++++++++++++++ 4 files changed, 98 insertions(+) diff --git a/doc/guides/nics/features/liquidio.ini b/doc/guides/nics/features/liquidio.ini index 554d921..d4bbea1 100644 --- a/doc/guides/nics/features/liquidio.ini +++ b/doc/guides/nics/features/liquidio.ini @@ -4,6 +4,7 @@ ; Refer to default.ini for the full list of available PMD features. ; [Features] +Jumbo frame = Y Scattered Rx = Y CRC offload = Y L3 checksum offload = Y diff --git a/drivers/net/liquidio/lio_rxtx.c b/drivers/net/liquidio/lio_rxtx.c index 14113e1..75ecbd5 100644 --- a/drivers/net/liquidio/lio_rxtx.c +++ b/drivers/net/liquidio/lio_rxtx.c @@ -1451,6 +1451,68 @@ struct lio_soft_command * &cmdsetup, tag); ndata.cmd.cmd3.dptr = rte_mbuf_data_dma_addr(m); ndata.reqtype = LIO_REQTYPE_NORESP_NET; + } else { + struct lio_buf_free_info *finfo; + struct lio_gather *g; + phys_addr_t phyaddr; + int i, frags; + + finfo = (struct lio_buf_free_info *)rte_malloc(NULL, + sizeof(*finfo), 0); + if (finfo == NULL) { + PMD_TX_LOG(lio_dev, ERR, + "free buffer alloc failed\n"); + goto xmit_failed; + } + + rte_spinlock_lock(&lio_dev->glist_lock[iq_no]); + g = (struct lio_gather *)list_delete_first_node( + &lio_dev->glist_head[iq_no]); + rte_spinlock_unlock(&lio_dev->glist_lock[iq_no]); + if (g == NULL) { + PMD_TX_LOG(lio_dev, ERR, + "Transmit scatter gather: glist null!\n"); + goto xmit_failed; + } + + cmdsetup.s.gather = 1; + cmdsetup.s.u.gatherptrs = m->nb_segs; + lio_prepare_pci_cmd(lio_dev, &ndata.cmd, + &cmdsetup, tag); + + memset(g->sg, 0, g->sg_size); + g->sg[0].ptr[0] = rte_mbuf_data_dma_addr(m); + lio_add_sg_size(&g->sg[0], m->data_len, 0); + pkt_len = m->data_len; + finfo->mbuf = m; + + /* First seg taken care above */ + frags = m->nb_segs - 1; + i = 1; + m = m->next; + while (frags--) { + g->sg[(i >> 2)].ptr[(i & 3)] = + rte_mbuf_data_dma_addr(m); + lio_add_sg_size(&g->sg[(i >> 2)], + m->data_len, (i & 3)); + pkt_len += m->data_len; + i++; + m = m->next; + } + + phyaddr = rte_mem_virt2phy(g->sg); + if (phyaddr == RTE_BAD_PHYS_ADDR) { + PMD_TX_LOG(lio_dev, ERR, "bad phys addr\n"); + goto xmit_failed; + } + + ndata.cmd.cmd3.dptr = phyaddr; + ndata.reqtype = LIO_REQTYPE_NORESP_NET_SG; + + finfo->g = g; + finfo->lio_dev = lio_dev; + finfo->iq_no = (uint64_t)iq_no; + ndata.buf = finfo; } ndata.datasize = pkt_len; diff --git a/drivers/net/liquidio/lio_rxtx.h b/drivers/net/liquidio/lio_rxtx.h index 6813aea..b555bde 100644 --- a/drivers/net/liquidio/lio_rxtx.h +++ b/drivers/net/liquidio/lio_rxtx.h @@ -666,6 +666,17 @@ enum { return subcode2 != subcode1; } +static inline void +lio_add_sg_size(struct lio_sg_entry *sg_entry, + uint16_t size, uint32_t pos) +{ +#if RTE_BYTE_ORDER == RTE_BIG_ENDIAN + sg_entry->u.size[pos] = size; +#elif RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN + sg_entry->u.size[3 - pos] = size; +#endif +} + /* Macro to increment index. * Index is incremented by count; if the sum exceeds * max, index is wrapped-around to the start. diff --git a/drivers/net/liquidio/lio_struct.h b/drivers/net/liquidio/lio_struct.h index 906553c..478a290 100644 --- a/drivers/net/liquidio/lio_struct.h +++ b/drivers/net/liquidio/lio_struct.h @@ -298,6 +298,30 @@ struct lio_instr_queue { const struct rte_memzone *iq_mz; }; +/** This structure is used by driver to store information required + * to free the mbuff when the packet has been fetched by Octeon. + * Bytes offset below assume worst-case of a 64-bit system. + */ +struct lio_buf_free_info { + /** Bytes 1-8. Pointer to network device private structure. */ + struct lio_device *lio_dev; + + /** Bytes 9-16. Pointer to mbuff. */ + struct rte_mbuf *mbuf; + + /** Bytes 17-24. Pointer to gather list. */ + struct lio_gather *g; + + /** Bytes 25-32. Physical address of mbuf->data or gather list. */ + uint64_t dptr; + + /** Bytes 33-47. Piggybacked soft command, if any */ + struct lio_soft_command *sc; + + /** Bytes 48-63. iq no */ + uint64_t iq_no; +}; + /* The Scatter-Gather List Entry. The scatter or gather component used with * input instruction has this format. */ -- 1.8.3.1