From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0048.outbound.protection.outlook.com [104.47.36.48]) by dpdk.org (Postfix) with ESMTP id C4B1890FF for ; Thu, 31 Aug 2017 16:56:17 +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=PKBaZkA/i7TUVJi/xBakrrcRVFfSBN+MejM4gEA6pBk=; b=oSevdtqa0mAC/tnuiKqOX2ZSYXAl6IrgawfGKakAXOcoQGoeMilYkRq9GFA3IXql9Ir5e67J0DhifUnTE+NCerP9gJDWD5yEdw+fXygnVX6Zy1Udd7gTzrVuSDHAc9fmGSHGKaRE/fB8X6b6W5IsEH3faG24+eAGPPOhL31XbIo= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.JacobKollanukkaran@cavium.com; Received: from jerin.domain.name (171.76.126.71) by SN2PR07MB2526.namprd07.prod.outlook.com (2603:10b6:804:6::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.13.10; Thu, 31 Aug 2017 14:56:14 +0000 From: Jerin Jacob To: dev@dpdk.org Cc: ferruh.yigit@intel.com, santosh.shukla@caviumnetworks.com, Jerin Jacob Date: Thu, 31 Aug 2017 20:24:33 +0530 Message-Id: <20170831145436.5397-24-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20170831145436.5397-1-jerin.jacob@caviumnetworks.com> References: <20170831145436.5397-1-jerin.jacob@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [171.76.126.71] X-ClientProxiedBy: MA1PR01CA0109.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:1::25) To SN2PR07MB2526.namprd07.prod.outlook.com (2603:10b6:804:6::26) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: be9fa234-d23b-40fa-bada-08d4f0806e76 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(300000502095)(300135100095)(22001)(2017030254152)(300000503095)(300135400095)(2017052603199)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:SN2PR07MB2526; X-Microsoft-Exchange-Diagnostics: 1; SN2PR07MB2526; 3:/e/iEeExeu2035ieIyofMV6I93WLBPozPlrRTgTxDK4lNgAixv2+DeIdHkZoHpce7ena5HceQJIJLnQ4iOp5wXVH0ij6wBp5rcteCYpxpUw4L9LEvNl8M9wK6oFu22GNwWhPg4YuLKzyg1JabmqaUkdvlfT9FGIG7ORN/rxsjqkBCYDR23FRIXbmKOU8Omw1u3anleheatbxlxVp3JQEkOh6tvdxyEtm6C7u5C2mOTGo9bIJIuTik793yXzcFCVg; 25:JCeQ+jFd/GdS558fsYSyNprA4VitxYbfFguaO7LTAnq/k+nLVDf9M+pFGt83TMDNSs4QShWeVoWq/ZTQsA0IMYpLBN+ZP1AUX58svS4StXXZ1DzSamYZ7z4zHJohiNpgeslYbmXh1F/zfNrkToGPCCJ4yM8l4OO51ejaIPMlWtrkxNeXtt7Xmnl7q5yEvOQ2eX5SkNEcttJ/5331FaTYW39RXM4kbwI7tdNYchZTBTv59sBXdw7qqDSJeKyn8mr7p2D2W9SFhK7kMK7A+8dYrJsRHONNgsaXCT3ux0jG5YPEO6cm4mLX1VGZ6ImxLH/6Hca3lryFoN/1lpMoRBXxtw==; 31:pqDwm7Bnw6erA1A5powvdc1oek4RnrVxZ0R1Rn1zn6AvbNuslJtdkS6eDD3pZh1dqQIIMJGrItxirth33vKYg3rk9+XrD6s8EExbkb2rYDKVugxXuKIyo4V+4ItVO86t3h3nzn0Cf5nKNZYnL7JpVG5n5LKuNN2lcj9mpIMhVrguQCZ03Ng3kKsDZUK2RDNgxCDXACszghAUccScVj11pHmjdnzLaz+uMZZx2B3LoI4= X-MS-TrafficTypeDiagnostic: SN2PR07MB2526: X-Microsoft-Exchange-Diagnostics: 1; SN2PR07MB2526; 20:qV2e5WUWjIrDrE2P0bL1bGlCBWoB47LxskSDAybVDK0/KX50PjB51r3F5e951enJQi8HcOGj+0K7vP9ZOe0p6WEnYUPjfjfxioRiE5oJd7E6fPJ5UbuxPxLzIVaGOANHByq3OYBvVDs0udw69zOGmrcwa0FDrAuzfyB2EdjYZEw5VKn+Gyo2jpO9wrcfKnOOWSsUJqY/CKw/ApB0IR6wp0NaNUOIX4PoYAx7+o5pF/yCP0y6YClHaHK8JAgXPXzr6Pl0XAbuN3mgRk6PyW9zXXDgzDPE938HciHT0PlFUGwooBu9lphD8yfPpxIg9p/NfqUuMispJmaDD0AWl2obaumulQnL2DoBqYGV4bMSQs+eGCqSEm0QVXtQIlKLW9TgyoXpGpUYsWvSzOOwQdTu1JgIymQQKn4Fpf4itKQWj/kig7lzQzHy9tewON6QCV+ntCDtjvCzoWVnnrwHGuD3DifZgWcnoQvlveJrl61u+CWzrJj4lN4Ma7xUs8ihtyXKM497jH3pfh8MNBQdADC6hkM+UFfcKi/OIbgxtrsgioz7mX+5siQXoey8WtvTFd7vIbJ31laiqSEuwUOBnb80f50Ic68lFTUYa9zCZJYYSQA=; 4:i+uLExPbXDD3eO3PUWeLLsd3SAIm4vjjMds4Ae8eX3WJ1i6c94Mgw5VesP3ztmufIvhHzRxNOw7GOA3xn8kiU/ZHdxHJ/1m38KT5ir5/Ckbrc4BrNTYqjmZZrTTKfbEjnXAHD49NathNY2dibQpN5gUp3YLQH52eaCn+8S+aHqvH7a+GbfYrD12HMnqAYCQ2gOuWpsnoQggO1eMXfjSZ1kwfLoMRXDu6C83BvA5+kAhWJPebnvf6wPasXsh2rAKa X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(93006095)(100000703101)(100105400095)(10201501046)(3002001)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123564025)(20161123562025)(20161123560025)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:SN2PR07MB2526; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:SN2PR07MB2526; X-Forefront-PRVS: 04163EF38A X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(199003)(189002)(25786009)(1076002)(53936002)(3846002)(6116002)(478600001)(110136004)(72206003)(7736002)(6666003)(107886003)(6512007)(305945005)(6506006)(36756003)(6486002)(68736007)(5003940100001)(189998001)(50986999)(42882006)(106356001)(101416001)(76176999)(2950100002)(6916009)(5660300001)(2361001)(33646002)(2351001)(2906002)(4326008)(97736004)(105586002)(48376002)(50466002)(81166006)(66066001)(69596002)(8936002)(47776003)(53416004)(8676002)(50226002)(81156014)(42186005); DIR:OUT; SFP:1101; SCL:1; SRVR:SN2PR07MB2526; H:jerin.domain.name; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX: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; SN2PR07MB2526; 23:MUur315wadldAmiAscdR56/pUDjsmDJSfb9lJJj2S?= =?us-ascii?Q?HRgApdTHw6XhvKadqGPaOng1tdF90MJloUOdk9PtrZGDKlsGpP0HvKyY+N//?= =?us-ascii?Q?WRdEIFpnG0NFwc0BpmFerzolia1Q0oqp4Dxsq8ifs9DwLBZStJd6BgVTk5TI?= =?us-ascii?Q?b29Uv7XFHIOdjnnhTNxMnxJdidrFS3u+w9qaykWqdDRo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fSdHGHTBuaHDIiAPWQ62GNmGOZHLV46e9sm2BAdprptnCSjHsPqvq9?= =?us-ascii?Q?hcEup7ZMlAsk49c4LSBj/5r5+alTus5TUmUGN8XHKj9rU3lAyayvQ=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; SN2PR07MB2526; 6:sofam46VxWvs8/zJFdzA0abD1p8oeTtkjBY85d+xVo8iJuZPHUaora3sWed1lLGzPfkrUTPv2nr2yLYec+oPctILcLQEv3nWL+5UN4JiKlQpgAcQXc2BhfAHiqYuBrPuJTuTymsyLLSSwx2+x7TNgJW6cKU7rfeuNVKj+5Qj0eg9gdPSvw7xQyldULNz25pziB5E2TS0SFRYveA2SSj8puTwBe3zweUTHfSydzS+gIL8LvXXi+QgxC6K4QoqiOnKslIPjgsoT0pUDuyRvPwcYDdG6KU24NwaZXD8DG6sDGWCCCGwgkYbBCleBjwalW+SPTa+gROp0YiFcf48p5L19w==; 5:1z+EeBrYa4mBhCpNdIInsgBKryiXHoHc65XBx4EhyyAj+BGqJo88QCnD9i4KcV7apatrk0gaj7BwRY572oTTTuDYJRNXbx2L670kGhnw+UcXR/jl6O2jrWAKiLJHrj5Pl1QGZ50av/wwW6W5f/nUIA==; 24:9rPzompsZpadgz+TqZPlNFlDonZ1EbxzPosK8TttMNZaopiIMqdgNozA9gvm1s3mjkr6cN3cjeqilSyZbSmoXDcdNqh/bdjO/oAxoRPp2as=; 7:JkZIQwOlfYlws6PhU6M8DYYeYpUqmhLlDzJwdli4w73ylVx1PtANPYigTHUEm+/sNd+jnVzNtgvfYFDb0gHsHYnPhOrTzWFAvi82M22lH92nVlyrIcNnenZuHRRQBuqDYeVIKV3UKYxmzINDE9BMSu+XG3IyLsgFkZ15ELy5yKwHCsVHh5ALo3pPyy0M/1y7FKNut1H8Kre9QG0d7z/m0mskVgXR9zXmtT3ynUQXyg0= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Aug 2017 14:56:14.8493 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN2PR07MB2526 Subject: [dpdk-dev] [PATCH 23/26] net/octeontx: add packet receive burst function 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: Thu, 31 Aug 2017 14:56:18 -0000 Signed-off-by: Jerin Jacob Co-authored-by: Santosh Shukla --- drivers/net/octeontx/octeontx_rxtx.c | 38 ++++++++++++++++++++++++++++++++++++ drivers/net/octeontx/octeontx_rxtx.h | 2 ++ 2 files changed, 40 insertions(+) diff --git a/drivers/net/octeontx/octeontx_rxtx.c b/drivers/net/octeontx/octeontx_rxtx.c index 32f46ae49..05f003649 100644 --- a/drivers/net/octeontx/octeontx_rxtx.c +++ b/drivers/net/octeontx/octeontx_rxtx.c @@ -102,3 +102,41 @@ octeontx_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) return count; /* return number of pkts transmitted */ } + +uint16_t __hot +octeontx_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) +{ + struct rte_mbuf *mbuf; + struct octeontx_rxq *rxq; + struct rte_event ev; + octtx_wqe_t *wqe; + size_t count; + uint16_t valid_event; + + rxq = rx_queue; + count = 0; + while (count < nb_pkts) { + valid_event = rte_event_dequeue_burst(rxq->evdev, + rxq->ev_ports, &ev, + 1, 0); + if (!valid_event) + break; + + wqe = (octtx_wqe_t *)(uintptr_t)ev.u64; + rte_prefetch_non_temporal(wqe); + + /* Get mbuf from wqe */ + mbuf = (struct rte_mbuf *)((uintptr_t)wqe - + OCTTX_PACKET_WQE_SKIP); + mbuf->data_off = RTE_PTR_DIFF(wqe->s.w3.addr, mbuf->buf_addr); + mbuf->pkt_len = wqe->s.w1.len; + mbuf->data_len = mbuf->pkt_len; + mbuf->nb_segs = 1; + mbuf->ol_flags = 0; + mbuf->port = rxq->port_id; + rte_mbuf_refcnt_set(mbuf, 1); + rx_pkts[count++] = mbuf; + } + + return count; /* return number of pkts received */ +} diff --git a/drivers/net/octeontx/octeontx_rxtx.h b/drivers/net/octeontx/octeontx_rxtx.h index 4a49fc159..1f9153272 100644 --- a/drivers/net/octeontx/octeontx_rxtx.h +++ b/drivers/net/octeontx/octeontx_rxtx.h @@ -42,5 +42,7 @@ uint16_t octeontx_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts); +uint16_t +octeontx_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts); #endif /* __OCTEONTX_RXTX_H__ */ -- 2.14.1