From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0061.outbound.protection.outlook.com [104.47.36.61]) by dpdk.org (Postfix) with ESMTP id 5D5FB1B277 for ; Sun, 8 Oct 2017 14:46:20 +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=GYU/LXkgFA8addAYcfcb1BrICbG5uyM9x7zU+NFbNwc=; b=EzqrooOX2pO+UwC6ZPwe9FWDvQQua4hg9mocS2XaLNguJyDXgMIf+a6CeyyqhaesM1Jyh80LjzhWRGkGVzJZ8/31Fa9PjTVpsSYJWaRYEnVtUkSZNF+er4RlCw0Ml69mVHgV0qXvLcE/t1D5qltgtg8LUHc/RdEZcZJeM3EI2i0= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Santosh.Shukla@cavium.com; Received: from localhost.localdomain (14.140.2.178) by BN6PR07MB3089.namprd07.prod.outlook.com (10.172.105.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Sun, 8 Oct 2017 12:46:17 +0000 From: Santosh Shukla To: dev@dpdk.org Cc: ferruh.yigit@intel.com, jerin.jacob@caviumnetworks.com, Santosh Shukla Date: Sun, 8 Oct 2017 18:14:27 +0530 Message-Id: <20171008124430.1866-24-santosh.shukla@caviumnetworks.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171008124430.1866-1-santosh.shukla@caviumnetworks.com> References: <20170831145436.5397-1-jerin.jacob@caviumnetworks.com> <20171008124430.1866-1-santosh.shukla@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [14.140.2.178] X-ClientProxiedBy: MA1PR01CA0113.INDPRD01.PROD.OUTLOOK.COM (10.174.56.157) To BN6PR07MB3089.namprd07.prod.outlook.com (10.172.105.7) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5f6dc998-dad0-4cdd-2df0-08d50e4a92c0 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:BN6PR07MB3089; X-Microsoft-Exchange-Diagnostics: 1; BN6PR07MB3089; 3:vLOQj5TuVa9RdmRpbQBx2m9T7A8PlkDgFY7xpkj4HcWFxUSbiiVzYKGcS9sa7QA4XZv2KdeGu+1Skq6+1bgi1RhEO/+Co5Qs3P5/2tUCVn0z+oFEnHqkHtCim6sg82VvNbgjzOxEivcN/ul4P0uL34K9ipJ4415GzSO0Uaf7ma0eM/+TWvcGXn1voDgwxOumjHoA5EnvLOFWss5CLb54GPr4KZNEeQpRBdS5Yd3+4CR/MPXIUTHt0OOVf0NsXbyW; 25:0XnRI3jGobuTLxOhU/MGQXAlSSkyYzy3/ilYAZ+N06DyGq3E30zIhpCmfthA8aO32pwoejssCoMUtAjqc5wMlQeHMlET0NDmAfIivsByTzfkN9zXdehn/zEm5qSnr7HD5xX5KRpaXLx8BYTuz8k7SlHg90Pug9ovWAFzJLcRlg3peszvOpb1WztrkwDr9dBQbUZ1JWxENnJvrAL2K0KFnqgOttmi43stlcLVW9VFAM+MRYHj62oZ/PmiFPoJl7WXlo49HpaWaqgGudIxsfvYZ0ACtBUlr9e5gk4laMBl+bCL0utb6g5ZhOf4blLMgzJBFmnzHGepn6JdC2Ax5YJgVQ==; 31:nAdB8fCwchsc3SjWqbBRWqwWVUEyU8RvMRNlNcCTvO2IC0dla31QTPf7XVr+g+nuu6bzokre7EKDe3cYR50BbZuSCAiaTNCKJA5d39vBsELkQENkrYNVDnlGb5UK7bAZjePoSP8sIRhW7duLxPLL00IVxkT3pbLRmahKRq4cTG6ZiXuvq3GUk7EPi7AC8YVJbD0f5Q7aJVetZHQwb4wTpsu/gTbLKmudGPESeLdKTkg= X-MS-TrafficTypeDiagnostic: BN6PR07MB3089: X-Microsoft-Exchange-Diagnostics: 1; BN6PR07MB3089; 20:Rg4N+K55ROD3eL+oXP76yonU9aVGl5Us0vBzqOWc40AKU3JphUWHRE6Bczl5pWy5DoSDY5Vovm6fQ+6WKhOBnEGy4BjhRi/xQaYMAAdYICKCuvcYUJLAs+7UptEADob4UUv2Rrkl40nB3UaTaA6venJj3POrM8vEcoNouOADo6Ix3RP1Omyz7DzzZFuGjW4d8lrbIAx99HucCVX1UrLNqsRIdty9nVgxDY+9Vcxza+v4396fUxPa3fw2gxiG0ZKSojR1pgPzOQpUgUIVDBhchEQQyPbIZ0YHj0SCinUdKSXKUA0Mi4+GAZw8AkSI+nhEJCLLzKznnkucAaKs5ZhuNkcirf1L2kukfYgHgtFwdqjurEJzrZJPIN1jp6TZP940SSomokLe0Bod9ceJX0k2Mp8lsbhWY0kzHpl9kr1ERyN4qyssFYDVFWJsBYLewQVgR58/5pTxN0uINbjsn/yk56PYfUc65g5pPfAIFhzfGPWqudoVaFWy+8uyf5aPGLhQX1izNOYCjOR2smNnIpuq0Ogr21CtL8FDYOpq+R7o8s91F2C4aGvt0qJBngH3HD12cLiAPRPMRWDgzlvfAhz4u/3oa8s/bCljIUQJ7TEwjC8=; 4:6hHdTO4/uzljNnqHqYvZdt9bKvg76Gn17Rk1Uor6WCVXMc4egV1fCeurvNFm1XHnDhy/r1XiGNbTzymFnmdKgzVuUGJAh0KGSeuCt6WR4zf8XP+VKsUO3Ym2VN/TJt3iG8ugm0eJDWTHXu7AljcvocquPgRpctA9wwE7BZVT0gLt1j3LXRZ8NsNT6dHh8NimkjiWbZcRvz0rlRmEHOog6+6zl0n4fzSRWrtrQ8v5nHLtX4K08I06a8UPjzsbkQj3 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)(2401047)(8121501046)(5005006)(3002001)(10201501046)(93006095)(100000703101)(100105400095)(6041248)(20161123562025)(20161123558100)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123560025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BN6PR07MB3089; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BN6PR07MB3089; X-Forefront-PRVS: 0454444834 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(6009001)(376002)(346002)(199003)(189002)(6916009)(42882006)(81166006)(2950100002)(81156014)(8936002)(50226002)(6486002)(16526018)(6666003)(189998001)(16586007)(316002)(6116002)(1076002)(6506006)(3846002)(7736002)(305945005)(8676002)(106356001)(105586002)(5009440100003)(53936002)(4326008)(66066001)(107886003)(47776003)(2906002)(5660300001)(6512007)(76176999)(5003940100001)(50986999)(97736004)(25786009)(101416001)(68736007)(48376002)(50466002)(478600001)(72206003)(2351001)(2361001)(33646002)(36756003)(110426004); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR07MB3089; H:localhost.localdomain; 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; BN6PR07MB3089; 23:UkLLPPIhjTde1UZzrGJ1+c1jBnGQcDTzGe43mKoUR?= =?us-ascii?Q?ki24oQXipf4KefUUNlRMsNJpxD/LSlwl7nSdZq2aSEIgISAh9BFx2Fc0pwED?= =?us-ascii?Q?Jdf0+at+m8CHuBiSlRcS5a4e0eKBMrk8myR5Sk1/GMJAAzwjhn9sQXf39t6W?= =?us-ascii?Q?4GgRmxjGtppsKVCajlYhhQ4yR3kGRZh5CsJow7sGRNaNzPoP6AdbcMUdgJDM?= =?us-ascii?Q?UKO5btlWn5P53uj5mj4JwYNne5X/iefEAm9tjsSYnl8lOOfNPdhADc6XXFCU?= =?us-ascii?Q?y25PpA2ahhhCTjO2rF1zayiwsBaCtZH94NOh83xRf71Guu6v9YMR/F0qN7jE?= =?us-ascii?Q?w5uaL+XCF6H8VFumYk5/AUTCmboOeM6nSMIR1o+ORl+I+XX/LhnA0cw9I1mc?= =?us-ascii?Q?s9pPNKKmuSOfF1Mzx/7rW4+lDUZYv59TC1V+/oUeNmPH7wezDHY0l1waMmaI?= =?us-ascii?Q?9U6P5Ad6+VexTEo+1EFrOn3F76RsUA7MhRQnN99XeL5r2VspOf98v715bpcB?= =?us-ascii?Q?K1xCjgp1kz3rzJHDMXrHhsbe9TC+mosVPOOsAv/j1j/xjLFfHDm1837UgxwY?= =?us-ascii?Q?a6gYSoiXXBsELJh/H7L/M8gXh70trDk2dk640vPBnJNMRXbKWDYaF/MCN5jC?= =?us-ascii?Q?WKlqSaHKl1+6YXsA5jst2FfG324qs03mA34z36OqrigAM062jEXxPhPF36Fi?= =?us-ascii?Q?y582qzyfY3c+73x3EDV0vCIWHc4sePm44LL1dqClZTvZsq3nDkeuDwR5+FDa?= =?us-ascii?Q?bpPRUXktk7wp/2t2veThK0rWg1XexVHBnNMoUW8v1tu99+KMs+WlBxRn4hPe?= =?us-ascii?Q?1rql/8/q9AZ8+RdqK16/yB0sVvtAMmKSzh1OByjIIUpPYnV13oC8gE5j+0ad?= =?us-ascii?Q?Vkpl8EubwyoLKGmTAL8BgtmAhYH6eOeR001NPR4PqTUFZfnpUWLvdyO7iDVr?= =?us-ascii?Q?sd5xpwe95r2KpAMGeH2TWH3lIoNOrRaA1Rg0plU451gXel1vUJZ8EgGaBsD7?= =?us-ascii?Q?/Ci2RSOdad1EXWXff4/xtrtY6haGbd+mEwpRcrAIPwxuGMkz0WIpsMYUTydK?= =?us-ascii?Q?Rfdtd+nqCe4raORDeHane5r83rsN/NBLB9LnkkfDSHptbY2ul3Vx8s3N+VOj?= =?us-ascii?Q?gtjfNE2x0Z8oyKm/3OPu7NcGjhcu1uEDMSgZkMMuKbujmZazeBRxMIm63/xk?= =?us-ascii?Q?tnghuDTiovMhikFic2k7bpqB739OtLL/V9AtYC0eEmJzWOVGwXQsAXblw=3D?= =?us-ascii?Q?=3D?= X-Microsoft-Exchange-Diagnostics: 1; BN6PR07MB3089; 6:xOONr31FZWFcYKpFfWTZ/0px82gpMamy09WnofmtjwsarF/FlImW7qceTX/VydGGpu01NGH8YsGfuv5fL74iVHosGs2RECtrxJt7jo1OHEqLRaqaNpXm0D8VFnl7HNWuq6eVjIQgKn2yWqODH4stEGJjyYiTVLjOQhMM87lkay4TJ0ba7HlfcNX/JJvcGaKnEfah8MhQJksKp5Jd4mLQVM7Bn3pFw/0N7wRkedU9/kjFHcb4a1AF3W5L+USC4yVGbiWMBKKSByOrpWv7Qwjms2cfA1gHgEKPQl1lVeaSukToRpIFFnrjfDuZm9dK5UsLEVJrZry765yeAJbOdGD3nQ==; 5:XEacRddZUmO7T/efRA+SCZcwAlZ+h+HO2rz8vlJU8VgycKU6idU+88FssEG6KV4FW4yW7Ms50g0E2R0BZdH5+WmDI1OdmQzYTc5onBwZk62M0Kt54E1IQelOxa937UyXQRTHdv8nCi6zaUiCa+NjAg==; 24:NKIzSubvLc3my7l7qYt/4Ll24h5JSw6WBQVWinL/t4nKrGDlIDrs2w85XSEgv2djNxQ43IdQ5/v7mKnQ0WPphYswX0uCV/eBJFKRnX3+FcE=; 7:wiKKRlAOJekfmCd9UPuNo6Eexp3ZOiHknedBV2+Evrx0UbV4C3UZavJe7LW9lJs35fJZ/uPmytzZO4/zMFlo8qewrm+U6JE5wV0EzgfCw0QLSnovWr9rMGjjjBTtx6ce9hA8BdI2AXwJOH9FZ2XZhfcdge+ECkLy4yk8sjR5uuY4ZlNRgm1+k93F/6jBMg3si51cQsvekcqDqOaXJp5lByaNYbgrhR1+sEXDbvINalw= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Oct 2017 12:46:17.6224 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR07MB3089 Subject: [dpdk-dev] [PATCH v2 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: Sun, 08 Oct 2017 12:46:21 -0000 From: Jerin Jacob Signed-off-by: Jerin Jacob Co-authored-by: Santosh Shukla Signed-off-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