From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0044.outbound.protection.outlook.com [104.47.41.44]) by dpdk.org (Postfix) with ESMTP id 69C142BB8 for ; Thu, 8 Jun 2017 13:23:35 +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=MtWqyrDp/XBrTmLW9iN0Fkw5KFEwWx1R4l1mNIm9x0c=; b=DmrRIL5G4Ebx99NcTEkMat3eK8ul0+mmVF0lMBn600+U9/agssfXVpEEUcTEzl9gRqs+p5gd18NhnGUfwNGHggOPyjBZ2TWJBkQTUlPUr5yPJIW3QNnVR5C9gGTeflAeRyZ+bkWU3W16XOe5CsnNP6H3e0E/kXh6RCAcbz3LJTw= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=caviumnetworks.com; Received: from lio357.in.caveonetworks.com (14.140.2.178) by BN6PR07MB3059.namprd07.prod.outlook.com (10.172.106.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1157.12; Thu, 8 Jun 2017 11:23:31 +0000 From: Shijith Thotton To: dev@dpdk.org Cc: Olivier Matz , Ferruh Yigit Date: Thu, 8 Jun 2017 16:52:51 +0530 Message-Id: <1496920971-9400-1-git-send-email-shijith.thotton@caviumnetworks.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [14.140.2.178] X-ClientProxiedBy: MA1PR01CA0092.INDPRD01.PROD.OUTLOOK.COM (10.174.56.32) To BN6PR07MB3059.namprd07.prod.outlook.com (10.172.106.141) X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN6PR07MB3059: X-MS-Office365-Filtering-Correlation-Id: ade3fef3-9970-415d-ca70-08d4ae60cc22 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:BN6PR07MB3059; X-Microsoft-Exchange-Diagnostics: 1; BN6PR07MB3059; 3:iv3usaLYRirMj8sEz8rKcJLkMZ2e7tgSZutRhciiDObCGCZ4356f99tmlqzPN7tJWnFRPblh0BHaMCuMZTtSn0Gww9RDLDpBWaCo3kXWFI7WcpGgkw0aL5PgYXTzYzhgdtCrjgQPIXvVz0KlZM2Msp94EtcoDhYF5XJl2mp3Nsel5K4Kv/55SzGIwRF+mZWCbsPBsinJ0FJGolkrdNX9V8e6Zv5KD00YE5FpRq2klF6b9due/BxeM5onI4QmIQWX1A6lk9LKk6A52E7uEeqEHZJlc8CMPBY/ywXaRARJnGLvoryIfC9PYAdZf97ZTEPnJVmg3RlPUfKDyod4MTodmg==; 25:xHXs3N309Ec+fZC8gg2jSUFwqj9yVNgtwmfyzNhftCYmSGPdfk7GDEvKtRUsQv6W0n5UOlUWEXe9ZyEoxQuifUAkHNMZpSANV3g/QEXaX77+jmjtupvC+pt4Od8W0HEEdcFREHi4Kz7OxvIqsTduAz/B+WvzTvfcu0A64iQg53SChI3rJAznsIYrW6QOZnsPWfekkrIgAltNXKu0kjojiMc7uuLgON//CExc0BmI63tb2RxatKHCbWdhwOZzzYKysGDMDHJMdg29qq1/FwwmUWXfk2h7TE7tBITlTUYJpZjMAURBjY38ejrqi/IAMENBc/zxFhU47VXlzTTS7nztlzZwDvwQSA5c01EVJ9p6N5o7cFIJYT5BUT+h/tniK5y9M60768iCyCpc4YZm8m4PwX0BoydMKNSvZHN3mS/4ZPl9PIj6GibnFSm9F4WxQTfbGqZg+qSxz1MwI13yrvYisLohXVzH6ymUfGCfGXReOcc= X-Microsoft-Exchange-Diagnostics: 1; BN6PR07MB3059; 31:QchpqFdjFXD6Y4MeknN/YPashiOKLGwbud4OuBoLwZ20md/lElarYTu7QSdaQKmGTLq0MIX0nLFu0dfWl0FBMsXqKPT+Nf/O95vpinrZaiASJF8w+GMKrPuXIp5lS6EPLMp6eixGfFjerqkZNyfWeffSR5hiIdq3u0uzwluq20FKryPBO3POyDZrzzL4JKcYc80aR8VTTnkoxXdC7opJWRcpzbNEMeURS9IHPcLAHzDOoUhb8cOIHHv2wMszpdo907tRxEVviHRSh1Bv0yPuig==; 20:heBuAZopD+eNNO4hly4sHGEV0WVADkS9Qa371T4mSPh4dJ0jkh0P3PhLoGKQUbh2+CDEyqeJ86kWcNpDDjZx8ye2x+HVU9BR5HSiYrgfmead3syS7iZGTcY0GUFjNf0BoNAJDA6Qu6zG8vnMHJf7n843ZzmCk24La5OK+KL7BvDsId6BxeMzE3+AdEv4qnFuaP7Av2XDPaDy8NI3yyV9GRmhgpBCKWQR+Dq7RihBtXbVI80wkpkp9LVBmPaG30JTiH3TdB3gNRJJ9Z0sgzrZF9LvWDFJqauw98OhuIEa9jAruiI5Mw/lAky2hlnLDfTpsUGaIHjEicHghGAZ6DIGNR33DSgVHR4D3ywdWHyRLS7un7OAR/i6exix8TsC+8gLm6jtOi2G6j/mEGN7OxSOX867sIwYb+vRjYdNGe6Hob0WsZBvagRVlh3jERNn5bBqkau0WZVQENvW1JnigfJihcmsfBD8QKPlX80oHuarEGbPsT9oh0rqVKOhhs/pYJ5CTc+gk+VB5PrKV7BqDYquMhIIcIqP5HfWOLm/JlTFRIKYrfG49rBrHRoocM4sCx41cGZGRLQ6pFcLAwnHmXK7747gTitqJwRrtZy8V5GyUI4= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(93006095)(10201501046)(3002001)(100000703101)(100105400095)(6041248)(20161123558100)(20161123555025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123560025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BN6PR07MB3059; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BN6PR07MB3059; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR07MB3059; 4:7tUhZTljQIX3CSt2EWN2r/mn6ZPF0Fcqy7YYEWF+6p?= =?us-ascii?Q?ov2QnXAZngHVLByFPhVAfNFH2KrxRe076CJQO6SYDT7W6a5yNrZKOKaKozlp?= =?us-ascii?Q?Kw5w7xnB5RUkKcjLNLbWbvqJLps3PbuYJhN7cERjSeddy9SccE6pgaJg+YHY?= =?us-ascii?Q?vFYiiFb6ME5S/wyOrQ12qm2fBgBu1tWqmPJekp5tHF8UZYBpzvMvr/LjAM/D?= =?us-ascii?Q?tYG0aAe2xIT+wWwaqnZPMqBsXv+o3j+AMChM7NJ0AkM+fJg9CXU0uHiLi0t5?= =?us-ascii?Q?1BkrgRUS8inKkeE8qClWYVsj/aRTLD1rXapLI6dJInTukRkgmvoVo0L7xNt2?= =?us-ascii?Q?S2C/SKy5otBmyqfWI9vPnRTt97Q5ehsdSwDKL0igCOSbqy7+UGwZvqaX0b1g?= =?us-ascii?Q?sf6TUvwnI/3Eh2hHZJ0mMl+7GxbkqVxB/4OQxEkwiUdahNPekhiWspr2Qlj+?= =?us-ascii?Q?/kV+l4mxejoM2nmbz56EDSZ7qwXHVYA7Wilh6Bzu/3EAJvjYYoPm00zHUf8E?= =?us-ascii?Q?R1TJPcwgvaB8j4SL53Z5p7i/oOOCCc9KbMUnAPl2HUfxCJea6mexfMu9PWAg?= =?us-ascii?Q?LZQmTbvn0l0ucXtOc+MlXKiITpT1oqA6iztYH0JtWf5ad25yGgj85YMc5Bi9?= =?us-ascii?Q?nuKjR7ch2JALnTFIjdAKD8BMSBmCQynRE8/d7vjYM5p0B1eIMB4zPBIiQSN9?= =?us-ascii?Q?NwXtYP6XVT4aRSv6LoCw/cEsNVODPDUsJnjpzEpfvqK8wms7XXyyy/JQ8IRK?= =?us-ascii?Q?8QrqvgnoJqtDWK+4aVU/1GQhKYCAAaNMHV58+BVeggjRyRpO/FeGZAVKuMBk?= =?us-ascii?Q?NllCukFhfjM/oNiew0sokD9VqipGPDmeM/rzQUVLLaao8GlR5iMdjE77C4ca?= =?us-ascii?Q?GiQnDvWq3686hdIbHIbsqEYt0Ipe6vgsfi4t8U63nOBDpX8xaksAEyScuuCH?= =?us-ascii?Q?Yt9UOYi2cs/deORzNe+osDgn7NcZTw74s2OT2M6wJ6quP7qXOgEjzK9H2VZ+?= =?us-ascii?Q?q9ZZCuUPveP+Lct8RFNdwZWggELg6tvRwyRZcQUEX9ROB9YSoyGk/97cTXp6?= =?us-ascii?Q?53x4NhGkJOpBjphp2t3hEtJSgfjr1ZhgSRijtbfpZHQRaNck903tzJX0Bmy5?= =?us-ascii?Q?Ln21RroZY=3D?= X-Forefront-PRVS: 0332AACBC3 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(39400400002)(39410400002)(39850400002)(39450400003)(39840400002)(50944005)(478600001)(8676002)(189998001)(81166006)(50226002)(72206003)(4326008)(5660300001)(48376002)(7736002)(2361001)(5003940100001)(2351001)(42186005)(33646002)(42882006)(4720700003)(305945005)(6916009)(6666003)(5009440100003)(2906002)(3846002)(36756003)(6486002)(110136004)(25786009)(54906002)(6512007)(6506006)(38730400002)(47776003)(66066001)(53936002)(50986999)(110426004); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR07MB3059; H:lio357.in.caveonetworks.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR07MB3059; 23:HYvWykjBu/2GNsRWnsHbE1TYj9V+/2G0YxVzpx2mu?= =?us-ascii?Q?cFzoFKwluxF8HIxUF78MB5DoNozb6LbYVQRUxVQQlINhkZ/+TymwyNfehpfi?= =?us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JbhgdRLP568YsHae4uaslzruCPbzB5tZ?= =?us-ascii?Q?wKD7i594cb/Aefo8+nGz1JofkbWkBG8re5Au/y9Uo/CIePLT+UiI+rLsYlla?= =?us-ascii?Q?obDSUrtw4mGSIGeaulqrlW9Yc2ePS3r3wDw5Ebye1F5wVTUSwfSsHdVKFACr?= =?us-ascii?Q?LxdkRhfbdk=3D?= X-Microsoft-Exchange-Diagnostics: 1; BN6PR07MB3059; 6:c1IRs0HgfoA0D+jMhLXjpIr5t6Cto5PIxHHhq1V4SfMgtX0XKXmgHSPG2KhM370lJyuQKl+xEIUGzzxssVnAYO7ANcw+5BM1qjDQPbhPmILj3B6cNBcC5O+x8lHnC4LHnKROe3orlb7qs/xMdoJPSYCcHua2L4tTD3dXigAYpatyuKMv8o369heKoYA756s3tjuwip1RfpsYILo5ozOcBEHBwnfFomsPvkwMahBU1488SxqeolRP1yb3cjFk3fmDI0aD2mKZVzf7IAQNiWjSoI+5P8a0M9awKnm2KDl0AFxNjbA3x/WASgWHczSCbrhlfuEAYLGICDVPiv75s20AyRXbVp6jmPNIXvjyeUhEbeSFxbFVNPAICIbthvG6xFTC4vkQm2Zw8nAUuUCXh0HisWch32KYXr+owlY9N6n57gDYj4GEi3g5fQKLfdAs07Wv0h+1ZLy/fZETztEu9m9Hw+lDJS6qLZ4T5w8CaloYFS/MyUjcT9BcQ2E4P4KKLgSNLQEy53BFJx0gtN3M5v+I/w== X-Microsoft-Exchange-Diagnostics: 1; BN6PR07MB3059; 5:iTx1Z2oY8DBgq+Gl/O08F596+U2flaSdVUHL6K5LvMzxScfUrsXm1APDGf4IQMVrgYWiEmUJV/HbHq8PwYfY8zSQq6m7fzvVNgL/NThMZEQOgW9ei2NN8SQ8Rat+JHMNbeUTKlurO0SFiZnUg1mx+tedDwobJg64ukTsUWL2oFSqbHdkQeU63TknNyXtiL2jO9+v6cUFNtVT5MguQc2jtFxxAB+EAVqfmDfh41TexlmCvmrnHSHQI0ihOOFalmts2bDzq3lWcZ4Vvec4007aSUTCEtMS0dooqxC+u/1jdaOzFCuVy4nVQok3PfnvoZS703r6BnzllS4hnkWNts7tsVimHEm5O1csFErmEfLIb+jdWzdWYX9LwnCP+aahBlpNsXrAYXUKakVodRCcGLp5LctOCoNFE+GFzlJ2DJZD4RiHlvYWdrQbZ/gdbIfnjcGJJcZUapREkGgbOE5dcyI9jsO+M0+4kyGgINqI9FvnjLcadlP0ylNz8S0fiJxFOG2O; 24:CJqtBFC3GLoSbRdrIoQQaTCQjn8o3nOAhHUT9CsXGDQIWOzBamfNJbh/GVZjtXpMpeitYwY4ZeypsgTahgScDOWYsZJrTCoc3PNZh2IexSI= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN6PR07MB3059; 7:Uz2sP9HomGBh9Fne3ve6Pj5sHfR6GztjodhjAsrIlCjmkRRfAxhb/E79/j96/Op55eAAL9Rx5uai/v6SMdwbncS+/NBccB2MiDgQAgEKv2xd9rm1akGY2gRJwNKNfV6XnmJ4uU45xe72rgoSPgug9SedvAAHKWNr9xFZHROzgVddqxk7xed7ia9gBsqEQFfvGYV9MvmpzZh+6jAm6YCHuNpWJuzBC260gMcdsXSBKRkcCbpCfGF9nQYmqgnRHgdArMrf1C4aHg9qWeJhJZoDDibCCxhQy/QeLx+fDBSv2fNjRb387BUCfCJkEKKZfAAd2H+licaabRBpfwJ9laxf8g== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jun 2017 11:23:31.4132 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR07MB3059 Subject: [dpdk-dev] [PATCH] net/liquidio: do not touch mbuf initialized fields 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, 08 Jun 2017 11:23:36 -0000 Avoid re-initializing of mbuf fields which are set while in pool. Replaced lio_recv_buffer_alloc with rte_pktmbuf_alloc. See commit 8f094a9ac5d7 ("mbuf: set mbuf fields while in pool"). Signed-off-by: Shijith Thotton --- drivers/net/liquidio/lio_rxtx.c | 37 ++++--------------------------------- drivers/net/liquidio/lio_struct.h | 2 +- 2 files changed, 5 insertions(+), 34 deletions(-) diff --git a/drivers/net/liquidio/lio_rxtx.c b/drivers/net/liquidio/lio_rxtx.c index 9533015..2bbb893 100644 --- a/drivers/net/liquidio/lio_rxtx.c +++ b/drivers/net/liquidio/lio_rxtx.c @@ -81,28 +81,6 @@ lio_droq_reset_indices(droq); } -static void * -lio_recv_buffer_alloc(struct lio_device *lio_dev, int q_no) -{ - struct lio_droq *droq = lio_dev->droq[q_no]; - struct rte_mempool *mpool = droq->mpool; - struct rte_mbuf *m; - - m = rte_pktmbuf_alloc(mpool); - if (m == NULL) { - lio_dev_err(lio_dev, "Cannot allocate\n"); - return NULL; - } - - rte_mbuf_refcnt_set(m, 1); - m->next = NULL; - m->data_off = RTE_PKTMBUF_HEADROOM; - m->nb_segs = 1; - m->pool = mpool; - - return m; -} - static int lio_droq_setup_ring_buffers(struct lio_device *lio_dev, struct lio_droq *droq) @@ -112,7 +90,7 @@ void *buf; for (i = 0; i < droq->max_count; i++) { - buf = lio_recv_buffer_alloc(lio_dev, droq->q_no); + buf = rte_pktmbuf_alloc(droq->mpool); if (buf == NULL) { lio_dev_err(lio_dev, "buffer alloc failed\n"); droq->stats.rx_alloc_failure++; @@ -378,7 +356,6 @@ /* lio_droq_refill * - * @param lio_dev - pointer to the lio device structure * @param droq - droq in which descriptors require new buffers. * * Description: @@ -394,7 +371,7 @@ * This routine is called with droq->lock held. */ static uint32_t -lio_droq_refill(struct lio_device *lio_dev, struct lio_droq *droq) +lio_droq_refill(struct lio_droq *droq) { struct lio_droq_desc *desc_ring; uint32_t desc_refilled = 0; @@ -407,7 +384,7 @@ * reuse the buffer, else allocate. */ if (droq->recv_buf_list[droq->refill_idx].buffer == NULL) { - buf = lio_recv_buffer_alloc(lio_dev, droq->q_no); + buf = rte_pktmbuf_alloc(droq->mpool); /* If a buffer could not be allocated, no point in * continuing */ @@ -489,9 +466,6 @@ droq->refill_count++; if (likely(nicbuf != NULL)) { - nicbuf->data_off = RTE_PKTMBUF_HEADROOM; - nicbuf->nb_segs = 1; - nicbuf->next = NULL; /* We don't have a way to pass flags yet */ nicbuf->ol_flags = 0; if (rh->r_dh.has_hash) { @@ -545,9 +519,6 @@ if (!pkt_len) first_buf = nicbuf; - nicbuf->data_off = RTE_PKTMBUF_HEADROOM; - nicbuf->nb_segs = 1; - nicbuf->next = NULL; nicbuf->port = lio_dev->port_id; /* We don't have a way to pass * flags yet @@ -617,7 +588,7 @@ } if (droq->refill_count >= droq->refill_threshold) { - int desc_refilled = lio_droq_refill(lio_dev, droq); + int desc_refilled = lio_droq_refill(droq); /* Flush the droq descriptor data to memory to be sure * that when we update the credits the data in memory is diff --git a/drivers/net/liquidio/lio_struct.h b/drivers/net/liquidio/lio_struct.h index 26f803f..d9cbf00 100644 --- a/drivers/net/liquidio/lio_struct.h +++ b/drivers/net/liquidio/lio_struct.h @@ -94,7 +94,7 @@ struct lio_droq_stats { /** Num of vxlan packets received; */ uint64_t rx_vxlan; - /** Num of failures of lio_recv_buffer_alloc() */ + /** Num of failures of rte_pktmbuf_alloc() */ uint64_t rx_alloc_failure; }; -- 1.8.3.1