From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0069.outbound.protection.outlook.com [104.47.38.69]) by dpdk.org (Postfix) with ESMTP id 243A12B98 for ; Fri, 31 Mar 2017 15:37:02 +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=Pp32R1/zgt4YX805TUTLL8GoVlN7UnF85SnHoP4YbQU=; b=O45dvpeszaQnpWzDIUzz/oWY13KVitnaHsHGs3RTAuxEsZZe6knJMXi22NfPNlG8dkImKJOyUSdapzP4VSVTJLZ/KOnPtJ9czJGKJdTvVPrXO0XhaP0AXWWVePXHFpj9CBGiq4Y+cn0qJuGBKC1m/2i3r/5kblDHW+ZESI1ECxs= Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=caviumnetworks.com; Received: from b.semihalf.local (31.172.191.173) by BLUPR0701MB1027.namprd07.prod.outlook.com (10.160.35.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1005.10; Fri, 31 Mar 2017 13:37:00 +0000 From: Andriy Berestovskyy To: Cristian Dumitrescu Cc: dev@dpdk.org Date: Fri, 31 Mar 2017 15:36:35 +0200 Message-Id: <1490967396-2240-4-git-send-email-Andriy.Berestovskyy@caviumnetworks.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1490967396-2240-1-git-send-email-Andriy.Berestovskyy@caviumnetworks.com> References: <1490967396-2240-1-git-send-email-Andriy.Berestovskyy@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [31.172.191.173] X-ClientProxiedBy: VI1P195CA0004.EURP195.PROD.OUTLOOK.COM (10.175.187.14) To BLUPR0701MB1027.namprd07.prod.outlook.com (10.160.35.19) X-MS-Office365-Filtering-Correlation-Id: 95f14ae0-8130-4f3d-f4fd-08d4783b028a X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:BLUPR0701MB1027; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1027; 3:1EUjpWA2rG8MSCCjtTpMnlsH/CwuQ/0Nc/+zGhuLnOnZ8Ll5dIzLTDMU6tp5CBp7ZagCPeuPXpVS/iB6QZx+iwXiIAeS/0gSoxMhpFfgDlxukU/nbap8CIVFoOXupGt5GGAvNf1y7O3vxVPhpsc1MomsiER7Ay6yezqt2z9dtsRxotHL+DZJwDh8C6X6ZO7KYxbEkJq8OW5/DFBbmg16HAJKUwAXv/ef0/d9zACXjTc1zbjiDlgM6MVRdr3sgAJ34vADoa6ON9whWi3dhfH+RwvhBJWj6BtEcmrDas0E8WRkr5Qm4XXiBiOrlyTOB9ymPFoCj97eFX2EkPNRTfAWqg==; 25:GRJ1WxmrbVEQN0l/TszAuTct5yf2CQrO39LZ+4/LQHhYyi34h3iGxkdV/TUbTe8geSlR/6syDXC0UOMoUmfcsTHE7BdQOTigcV8GTfGfFmV2u/YzobEoG+s3xnwUFaugSEaYhcJoKYT3Hn1wz9DbSxxBd4nJ8Hn+sFWbuaEch57kA01jOzTCBQVsoibrJTq7Gt+bYWK63S/LYoziH666kDTHqyvHZkjeRmDe3Z2bmXFbO8gJNtDxN6oZQZ2WkU0epGlmxCuo1klhAuMBDCv/BCo7ENhKkfR3BON74u9g4qGRYgFQMBekD3WxAmbmSFRC7oa73woemIh/DxXvhYzC0Qfhut+tx5YTMuN8IsoSKPjyV/6nz4N6TlsgIWHPM5rvvZAqOgvhAejN+TMWGIWo4mFUcJcMFboewbtSoXirRskIIGuvX8CjuJCOfuyUPq25Vu7pTGVQh7KjAyeFDx86kQ== X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1027; 31:56sK2JD6vAtlDujlpic12IyYOInE7R4iiEiC+zE16Ycd7fOMfIOfdr+Cn2L+DonG2m0H3BeX19AmdfhTwmY3J8EebNUCwnujY/06VjLf/GqA5A6UdTL7DxRduoKxHg/PmvDYZGtfRSZtyihDDnE6Y3mah0HrEBKGkJVMBLeBF9q1AAACpYd6z4KqEP0fwDyYg428MLoRGXbsGE7v1pbZDbTxXtpRswxj0qFRi6akgKtuafd8jM7jd9jHaa7hFh+l; 20:vqHAZTpH0zDTpFtocJbRK7qNvpZHWrz2QuFozNymQi9ZW2s0pSPehY7gUB7D+zEhEgXt9VxTlT7y6Rfa05F4impGXDDfhY44bMuSyS2FHyK9xaHhSRVjJ49JPtePWX0Fwp/hsytOtSrzv3H3Q3D/x3IpZwr/1U2ZLsoIGayUoAM926KqU4Gy/2YjRJyVKz0AvGqhZONsLUM+Z7bcdxKzAZwuFcNtZtqIWT6eyyNCOBIn1V/FHIo+BOEti57Eqrmak3NpEPRO35qHc9Q4SnjJm9Kroeblrym4YwDise1mXPoRrPk6M6yY7vw3oPlZkabkNX58n4ob4mb5UZHg/iSidC9+49To07rdoWYC+IoqZd+hds0XDPQahVBflAC5qUHQtxFjp2iUj0Gcax68n5zay0fDAmdyLkJ615+ko4rh99M3yMQEdoGwAVDq7hU+j3uawML03usvBcWyUnlSuxJQLyIermpF0s9POARhQXUFiVjtJcmm7rVbFjiCeA2+NcdPXXhL4SKsIXAW2Ziwq1eGS/FbqdHVijUorEYBEov3goGzHWB3yW1pgRyWG/ieumbNapMH12JsiFa0+/8CqkIq0qpJq68qrP3VJ5U+2EnG208= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(93006095)(6041248)(20161123562025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(20161123555025)(20161123560025)(6072148); SRVR:BLUPR0701MB1027; BCL:0; PCL:0; RULEID:; SRVR:BLUPR0701MB1027; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1027; 4:6PnnrdyNcsa2Ero6LSwdqmkyI0HfXRweFcFnen5qHrBJGeVtCKXDL/MfBilzBgUBVYkk0/dNeuMGi2j1FHI2YtM2C0aauCMqOUVoTlOrRPquZ9HmFsnT8/JJXRW3D3V31gx0h+j6xKLAYuN+767DMEJ49ou+al48XO2gYnGhfUiqszky5Y45NPrk3ob8xd3np/XjdZ27Urso3oKAkZW/G7gDM3SZfVyrrxhFzBnzLV9BRoUnyEFiCPJpEO7dB85V9h43HLbwbSdzxTHWmGQmJ3dTBX/HCwDVmFDpvUxP/E/9lWR7MvRVIP442Nhn3WV4GMkR0tC3toXEATFeomCzv3BMGWe36+vPmD/4LkN78Qey7xOaYhMOPMhkQlr6loP/4N+kNhCECwKLxGxkN2wv68bb2GMHqLyyRr4lAqUEi2CSXE7KbIaJ6W3YjU0X9UbdDptcY9HORI1dFEbR9Qps+y0G8tR5HuezY/fEMI//QcJPisc5HFJKr8XfHSiVw+5kAXaXeucR0Lu6uKgph1eC/4kfuuozk52P4Z7OE/ECPs3xXLkbpE3Fzb0x40rnnrwUWoC0Y3uuwuuzj1g0A3P+I4Q2cXZ5t6/DcwoVgQTwZpbMW3ddqtgoQHW8ViQQE7u1Xlxz971032n7PMan/XhOegHAZqk3enOKy5sgguiCTLJtk2o23qnm3zBPABFr9gOa X-Forefront-PRVS: 02638D901B X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(39410400002)(39840400002)(39850400002)(39450400003)(39400400002)(53936002)(76176999)(189998001)(50986999)(6512007)(66066001)(305945005)(7736002)(47776003)(6116002)(3846002)(6506006)(6486002)(2906002)(5003940100001)(8676002)(48376002)(5660300001)(81166006)(110136004)(38730400002)(50226002)(36756003)(4326008)(2950100002)(42882006)(42186005)(6916009)(6666003)(25786009); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR0701MB1027; H:b.semihalf.local; FPR:; SPF:None; MLV:sfv; LANG:en; X-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8Juc7dcMs5HAQO6anDkV9pCMQKiLQHzL2VTFdq4Jyfn69yMKdpYKUwwp5+mpf437GwqzKQMEEJLRHnFXn8vshXt7ugZr1F8XaxfQoEc0uAXne0cacWyfWfTz5SkpnLbV7Szi7REHgiUIJj9EUvGvWQAQxXXLvOijgsTxwRvTTm4VRIHF8Uwiz1ogAqYR4ffj2YBJC0X4q9ObD79xqb2pRVxCt5xWxca5pJ5hmYkLE6bdcv02Z7MadugzDTERWzcqtsYmd2hvXTZsRP7k+8A8kL5zx5A== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Mar 2017 13:37:00.2459 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0701MB1027 Subject: [dpdk-dev] [PATCH 4/5] port: fix file descriptor reader 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: Fri, 31 Mar 2017 13:37:02 -0000 The code should return the actual number of packets read. Fixes: 5a99f208 ("port: support file descriptor") Signed-off-by: Andriy Berestovskyy --- lib/librte_port/rte_port_fd.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/librte_port/rte_port_fd.c b/lib/librte_port/rte_port_fd.c index 03e69f5..914dfac 100644 --- a/lib/librte_port/rte_port_fd.c +++ b/lib/librte_port/rte_port_fd.c @@ -108,7 +108,7 @@ static int rte_port_fd_reader_rx(void *port, struct rte_mbuf **pkts, uint32_t n_pkts) { struct rte_port_fd_reader *p = (struct rte_port_fd_reader *) port; - uint32_t i; + uint32_t i, j; if (rte_pktmbuf_alloc_bulk(p->mempool, pkts, n_pkts) != 0) return 0; @@ -126,12 +126,12 @@ rte_port_fd_reader_rx(void *port, struct rte_mbuf **pkts, uint32_t n_pkts) pkt->pkt_len = n_bytes; } - for ( ; i < n_pkts; i++) - rte_pktmbuf_free(pkts[i]); + for (j = i; j < n_pkts; j++) + rte_pktmbuf_free(pkts[j]); RTE_PORT_FD_READER_STATS_PKTS_IN_ADD(p, i); - return n_pkts; + return i; } static int -- 2.7.4