Message ID | 1465814925-27259-3-git-send-email-matias.elo@nokia.com |
---|---|
State | Superseded |
Headers | show
Delivered-To: patch@linaro.org Received: by 10.140.106.246 with SMTP id e109csp1476480qgf; Mon, 13 Jun 2016 03:49:29 -0700 (PDT) X-Received: by 10.200.49.73 with SMTP id h9mr4731228qtb.60.1465814969393; Mon, 13 Jun 2016 03:49:29 -0700 (PDT) Return-Path: <lng-odp-bounces@lists.linaro.org> Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id c90si14824622qgd.80.2016.06.13.03.49.28; Mon, 13 Jun 2016 03:49:29 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE dis=NONE) header.from=nokia.com Received: by lists.linaro.org (Postfix, from userid 109) id BE2AA684C0; Mon, 13 Jun 2016 10:49:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAD_ENC_HEADER,BAYES_00, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id C0AE0684B3; Mon, 13 Jun 2016 10:49:23 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id C701C684B5; Mon, 13 Jun 2016 10:49:21 +0000 (UTC) Received: from emea01-am1-obe.outbound.protection.outlook.com (mail-am1on0147.outbound.protection.outlook.com [157.56.112.147]) by lists.linaro.org (Postfix) with ESMTPS id 0B6D6684B2 for <lng-odp@lists.linaro.org>; Mon, 13 Jun 2016 10:49:20 +0000 (UTC) Received: from VI1PR07CA0103.eurprd07.prod.outlook.com (10.165.229.157) by DB5PR07MB0901.eurprd07.prod.outlook.com (10.161.196.17) with Microsoft SMTP Server (TLS) id 15.1.511.8; Mon, 13 Jun 2016 10:49:17 +0000 Received: from DB3FFO11FD005.protection.gbl (2a01:111:f400:7e04::160) by VI1PR07CA0103.outlook.office365.com (2a01:111:e400:7a52::29) with Microsoft SMTP Server (TLS) id 15.1.517.8 via Frontend Transport; Mon, 13 Jun 2016 10:49:17 +0000 Received-SPF: Pass (protection.outlook.com: domain of nokia.com designates 131.228.2.241 as permitted sender) receiver=protection.outlook.com; client-ip=131.228.2.241; helo=mailrelay.int.nokia.com; Received: from mailrelay.int.nokia.com (131.228.2.241) by DB3FFO11FD005.mail.protection.outlook.com (10.47.216.94) with Microsoft SMTP Server (TLS) id 15.1.497.8 via Frontend Transport; Mon, 13 Jun 2016 10:49:17 +0000 Received: from fihe3nok0735.emea.nsn-net.net (localhost [127.0.0.1]) by fihe3nok0735.emea.nsn-net.net (8.14.9/8.14.5) with ESMTP id u5DAmjJV023999 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for <lng-odp@lists.linaro.org>; Mon, 13 Jun 2016 13:48:45 +0300 Received: from 10.144.19.15 ([10.144.104.92]) by fihe3nok0735.emea.nsn-net.net (8.14.9/8.14.5) with ESMTP id u5DAmjjs023989 (version=TLSv1/SSLv3 cipher=AES256-SHA256 bits=256 verify=NO) for <lng-odp@lists.linaro.org>; Mon, 13 Jun 2016 13:48:45 +0300 X-HPESVCS-Source-Ip: 10.144.104.92 From: Matias Elo <matias.elo@nokia.com> To: <lng-odp@lists.linaro.org> Date: Mon, 13 Jun 2016 13:48:45 +0300 Message-ID: <1465814925-27259-3-git-send-email-matias.elo@nokia.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1465814925-27259-1-git-send-email-matias.elo@nokia.com> References: <1465814925-27259-1-git-send-email-matias.elo@nokia.com> X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:131.228.2.241; IPV:NLI; CTRY:FI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(7916002)(2980300002)(438002)(199003)(189002)(586003)(450100001)(229853001)(33646002)(8676002)(11100500001)(19580405001)(81166006)(19580395003)(575784001)(22756006)(36756003)(2351001)(5008740100001)(189998001)(6806005)(47776003)(92566002)(81156014)(48376002)(50466002)(5003940100001)(16796002)(76176999)(50986999)(110136002)(2906002)(2950100001)(50226002)(356003)(8936002)(97736004)(87936001)(68736007)(107886002)(106466001)(77096005)(42882005); DIR:OUT; SFP:1102; SCL:1; SRVR:DB5PR07MB0901; H:mailrelay.int.nokia.com; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; DB3FFO11FD005; 1:AyN8J5cY+jNGR2kAd4wQTJiTNonIaHOKK0Uwe88KSRztL4TQyMCTO0Tzn/vA/vQLfxBwCFj3hR7t/3XhzFyDDRp+m+9fveTbTvHCktUo4EXhFV4QM0hdo2wWDL5omx32kzxvhdDfkrmUOqbB2jHbfkxj78wwKYcGOP6BgdTBHLkBjz/Tym5p6KUABCrmkV/q8iJ7kkAoMSf786r589gxh5F8tk0Hl2kwkJ/EjDOJGYWCAELFgLn91GLyMbHqQ4Wp2saMYIrWi/7tgff/cVZIfKB4PGkYDBG6c9LcikLkFG1yAz3/1XiO+garRgooWl4jrf9/FACrMAiqzeJ8Bn55/zETzeFICXn1ah6ox5kXJ4eewdDmnBIJCic4cr4SSdS0Qh611M4YhMhAT8KAafK4UfbTBgAMG95miuy8B5Z/L5t9h68LEbZWIqyr21+2TFSP MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 24a0ca5f-d9f1-4cc6-f484-08d393785e2e X-Microsoft-Exchange-Diagnostics: 1; DB5PR07MB0901; 2:shzI8sgaLjjAW3KthWBib9xiCTxLyBkZ9k7oA0d7DVbMl2jc1VBRJwxepExf00nUGieiGDRSjAn+mfcxcU+OtQjt359lijVQDjENwprxXhYTYuwlQS7kOj5e8hhZFYGob+nnHEkEuLpgk2zyrDK8nWtOhqxYlZL8uA3pVsk5BFHejVqVHuJ3q+yod365dcSm; 3:Y2SHOLSCgDozie6ZG63B+gOuD9jG+mLXvio7kJ7hMh8bCrp4WtWdV84B9re7gELKuuOPkcqjLyhaL2AT28l2prDNGUz4nV9MVlxeTjginY69InoZAUboK/jUYpOwR0/auDH8xEj4ux0NlcnN3MdtEHlHyskTuF1T3TwCyoo6RUm+hvcn6Wpb0+FPIn8JZkMIOO7J3AbfniVCjJSctz6cJwPx1tqEu5sgc8SHq1dC38fB0KXHhKacYuFOkxkMxMylCW3pQisqG+S8DTJfnpbL4w== X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(8251501002); SRVR:DB5PR07MB0901; X-Microsoft-Exchange-Diagnostics: 1; DB5PR07MB0901; 25:GqNBrPln20ovxC5rd99G0OD7XxG/nSA4hJO3dzkMBC8qNwQCa2WA/xkoZdcvI+7pP4J00bcwhTckVk0okFic3cS6ckcGwQpZTZC18T4PsEsFbdITLrAS1pC3024B3ZcvUDhwMFrCnZPdbRvuwkKNt8DOnnCQxHobHoPm9AIjzk7Z7OXTkapa7VhfC6mCMInHDqGOiqNGWLZRQFHzw6hwY0gD8DPN6T37q6LCfo2JIg663ED9t+W4q/WRlDAk9fUxSA0EmVJbDC9U0raTqxroobEHMoObh2NOS/MDW7T8njyov9W8Cz2Od1+osaVkbvRrot6kOXpEkvjIttboDFnJjESp1itV/S7atmZsHcQw27YY4Cf7sx3oI4pJRn9jn2tBHNe2xA/8iEVF+B+TS8V8JyMjQzTtS/s6njdYxUl9mxNo87qnJWLCmRdIcd/Fn7APGBY4YgSq0aTJJ1ZUaBMa1z/iOH4EtwOguXLcVssn5Cx95YQ7CNkuG+W4/fGidCbjBoxJK4qqPZTnuuerOR2Pvn+6KqeboJZ+QTz0q1puuZ0lVE1gQszistf4aYmHCyHstD28ClUc6DAM+4hUSfbHsXHcMCC7XdS3qzvkH0aA2oOlwirXqv09DclQAuLdzTv0wTaBExTFc6YfZvphtKmc1XTnMUTcSj2bhN80vNwkTJMOTHkP2Nb6wLH8sxIgY4REIrfK2LRhBri6DEa8dnajafasDQA8thEQgUsJDFoDYjsman8HRpuUr4v3h2ybB4QT X-Microsoft-Exchange-Diagnostics: 1; DB5PR07MB0901; 20:N8Snr1bspdsnmFPFAT7zCs+ZPoG/5wIuF3h5XSl5aSZdt7HOzErWUW0Bp5FRw06NqtiQiX4YASZAo1BvvV6Sn11WwT2Px5ZxAzc4DiMk0IkOvOSKvY3e70+hlkF46XwPikUOh9ouuypZXObKu7ycE2dGErf56mz9PwgAR4nYk4hfsYpEMzEAJLmEaHh310I894uvILCDz84T+I0GDFErwui7094dF3dbvC+G+wxFryXACfpm47OBKSSfEtZwaBce75YYlgL16S2mrAmneZ6XDbzcZZ/CQR9JcBWPV0m8TOUsG+UrlDhYyI3hhBARbgJPktSl7Hs6ELatIXoneSO5QM9A5mahT1TWjRDtFKKU7IyMtBtL9zGuvsFIT64UKZPiCUbZuqacvoFKqoA/SK/ua8Ncy5x/9CnY+UCPYVI5WlMP1ADPfuvXck3FJiqN86Zxf18pR1A4nvbraPEEe90m9mNAG09CQDi4BcRnobhD4j8xLNvnT7Fk3QShpZWX/niIgBhnsA2Ula8hErQXQAQULaE/RngmKQXxTYZqrrRD2L0FVtT6dsjOeq9yC9f81rTcG2mVGirWqUrBgKqfaoTzMPeDFNBpeYqLFfyhIurzHRg= X-Microsoft-Antispam-PRVS: <DB5PR07MB0901E15D86827B58EFA7EB5887530@DB5PR07MB0901.eurprd07.prod.outlook.com> X-Exchange-Antispam-Report-Test: UriScan:(82608151540597); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(13018025)(13016025)(5005006)(8121501046)(10201501046)(3002001); SRVR:DB5PR07MB0901; BCL:0; PCL:0; RULEID:; SRVR:DB5PR07MB0901; X-Microsoft-Exchange-Diagnostics: 1; DB5PR07MB0901; 4:pvXHMkEW6mrYJOgS0K80dtJE9grfTS5CTgGyQYPD7052v4F1TPHPcxtAX51C2iiWM/iVJdWImWY0GUf3FUOqsumCjdV6EwrSbVbT3sHuko2DzZy9cXx49BqX2UH544gIFh/TiWFVXT/rclwYoabzhMEauuuYvKwoHQQ2uafAfg//WVCIryyL8TD2qUZMrJ5LM5gQkzDgcI9k8nh+m/7pZAr9e4o/iCxwwFOF+eM0z2ePwxpBZ4aoOHT8KCWiV3nVTQAiMh9SHaxQ17S/tQ9cm6RNuNjvWeKqcVheRbibBiDNSNd1NLrNJ8qJVOequpdzDgFjbIcW5aHKqhTLf61uynFxwQ90kwqhy9ToNzVpvM1kGkn4rcIf/LnjeEuJiJPyxFwNGg68hPcSCFsDfLu2coJBvB12y5Z1rQfJ5toUakWD/dn/RR6qg90ow4mj9yZw7sPxgGVw2RyfSZ2a02AZgQ== X-Forefront-PRVS: 0972DEC1D9 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DB5PR07MB0901; 23:O/ZOyBpk9GLd31T7xbNSPZRtjLlWI4Mgzhcpa79mC?= =?us-ascii?Q?X8mT1O+UEQx07+GaOtq32Ot4CtJh4c4z53tmtCeQVRJOEx6qjwTwqEJ1WawW?= =?us-ascii?Q?Oc0kbuoE2TTAvdOmauat6sDYQ3AjiJnZxyQvA5wBd5QqeU8AHEyRRQgVAsfW?= =?us-ascii?Q?gB33fnPbwxJJ6MIfUxmcIxbuKTAdkVHfpWDA8WHmVxixPWqx3zEtGpWplQDv?= =?us-ascii?Q?GN5hPi0OEM8xtZs1hc/nsP0wkvROyDcTALHxkgikjI+oscP6NyJPaKsl6c85?= =?us-ascii?Q?8ueIlsD7Ux6IeF7P/etbstyi9lkSohtWmHb5uh3oEBVLjSYNVAmDbKICZYqh?= =?us-ascii?Q?JadIxKLlgBu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WvIUyBiD5vXxwhateIG8L5z/jQEokCpCp/7tHIpvBadF44ogeJUbWtxRZDtu1kNsxAcqc26mA==; 24:jPkuJMkS41+QuJdn4r+gVNj3SD0BCyGY4UlY6NVUkNiUX9QVat98uBIkNja2j5jpytcf3UssanhxVaLogjIxpChtfxUBw7U7r26o4Tk83bM=; 7:ZxZgBl4FlepT4kaAiI4J20aHAWA2TZhWMt4yqerA0Tk8XORzvL/VDRIpdvL6EuOvY/ZqxygjgHSnEGYZWs1fe7svhK8loEtEx5mPPgOkInIy0S01mpbAz+DwDvWkll6IAc5ZbGdEfA3q3qDCKYK8XOoTdsicQJ/Zd0OlfOUaT6hwnh5afZjmCDgjbdqU+wr2uSDOHGalcUvCy0W4/OloUA== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nokia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jun 2016 10:49:17.2994 (UTC) X-MS-Exchange-CrossTenant-Id: 5d471751-9675-428d-917b-70f44f9630b0 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5d471751-9675-428d-917b-70f44f9630b0; Ip=[131.228.2.241]; Helo=[mailrelay.int.nokia.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5PR07MB0901 X-Topics: patch Subject: [lng-odp] [PATCH v2 3/3] linux-gen: loop: improve classifying segmented packets X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" <lng-odp.lists.linaro.org> List-Unsubscribe: <https://lists.linaro.org/mailman/options/lng-odp>, <mailto:lng-odp-request@lists.linaro.org?subject=unsubscribe> List-Archive: <http://lists.linaro.org/pipermail/lng-odp/> List-Post: <mailto:lng-odp@lists.linaro.org> List-Help: <mailto:lng-odp-request@lists.linaro.org?subject=help> List-Subscribe: <https://lists.linaro.org/mailman/listinfo/lng-odp>, <mailto:lng-odp-request@lists.linaro.org?subject=subscribe> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" <lng-odp-bounces@lists.linaro.org> |
diff --git a/platform/linux-generic/pktio/loop.c b/platform/linux-generic/pktio/loop.c index e0b2ed4..3ee979a 100644 --- a/platform/linux-generic/pktio/loop.c +++ b/platform/linux-generic/pktio/loop.c @@ -87,12 +87,24 @@ static int loopback_recv(pktio_entry_t *pktio_entry, int index ODP_UNUSED, odp_packet_t new_pkt; odp_pool_t new_pool; uint8_t *pkt_addr; + uint8_t buf[PACKET_PARSE_SEG_LEN]; int ret; + uint32_t seg_len = odp_packet_seg_len(pkt); - pkt_addr = odp_packet_data(pkt); + /* Make sure there is enough data for the packet + * parser in the case of a segmented packet. */ + if (odp_unlikely(seg_len < PACKET_PARSE_SEG_LEN && + pkt_len > PACKET_PARSE_SEG_LEN)) { + odp_packet_copy_to_mem(pkt, 0, + PACKET_PARSE_SEG_LEN, + buf); + seg_len = PACKET_PARSE_SEG_LEN; + pkt_addr = buf; + } else { + pkt_addr = odp_packet_data(pkt); + } ret = cls_classify_packet(pktio_entry, pkt_addr, - pkt_len, - odp_packet_seg_len(pkt), + pkt_len, seg_len, &new_pool, &parsed_hdr); if (ret) { failed++;
Make sure there is enough data for the packet parser in the case of a segmented packet. Signed-off-by: Matias Elo <matias.elo@nokia.com> --- platform/linux-generic/pktio/loop.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-)