From patchwork Mon Oct 3 11:49:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Elo, Matias \(Nokia - FI/Espoo\)" X-Patchwork-Id: 77214 Delivered-To: patch@linaro.org Received: by 10.140.106.72 with SMTP id d66csp1622638qgf; Mon, 3 Oct 2016 04:51:12 -0700 (PDT) X-Received: by 10.237.59.220 with SMTP id s28mr15913210qte.37.1475495472871; Mon, 03 Oct 2016 04:51:12 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id g23si20276843qte.114.2016.10.03.04.51.12; Mon, 03 Oct 2016 04:51:12 -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 6F4E960D33; Mon, 3 Oct 2016 11:51:12 +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 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 A663F60D39; Mon, 3 Oct 2016 11:50:13 +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 411BB60C43; Mon, 3 Oct 2016 11:50:00 +0000 (UTC) Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0126.outbound.protection.outlook.com [104.47.1.126]) by lists.linaro.org (Postfix) with ESMTPS id EF41160CFD for ; Mon, 3 Oct 2016 11:49:41 +0000 (UTC) Received: from HE1PR0701CA0048.eurprd07.prod.outlook.com (10.168.191.16) by DB5PR07MB0854.eurprd07.prod.outlook.com (10.161.196.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.639.5; Mon, 3 Oct 2016 11:49:39 +0000 Received: from DB3FFO11FD002.protection.gbl (2a01:111:f400:7e04::192) by HE1PR0701CA0048.outlook.office365.com (2603:10a6:3:9e::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.649.16 via Frontend Transport; Mon, 3 Oct 2016 11:49:39 +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=fihe3nok0735.emea.nsn-net.net; Received: from fihe3nok0735.emea.nsn-net.net (131.228.2.241) by DB3FFO11FD002.mail.protection.outlook.com (10.47.216.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.629.5 via Frontend Transport; Mon, 3 Oct 2016 11:49:38 +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 u93BnHCZ001136 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 3 Oct 2016 14:49:17 +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 u93BnHPU001104 (version=TLSv1/SSLv3 cipher=AES128-SHA256 bits=128 verify=NOT) for ; Mon, 3 Oct 2016 14:49:17 +0300 X-HPESVCS-Source-Ip: 10.144.104.92 From: Matias Elo To: Date: Mon, 3 Oct 2016 14:49:14 +0300 Message-ID: <1475495356-4038-3-git-send-email-matias.elo@nokia.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1475495356-4038-1-git-send-email-matias.elo@nokia.com> References: <1475495356-4038-1-git-send-email-matias.elo@nokia.com> X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant 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)(106466001)(50986999)(5660300001)(76176999)(2950100002)(626004)(68736007)(110136003)(229853001)(6916009)(42882006)(586003)(8936002)(92566002)(33646002)(19580405001)(19580395003)(2351001)(5003940100001)(50466002)(11100500001)(36756003)(107886002)(77096005)(47776003)(6666003)(189998001)(2906002)(50226002)(97736004)(450100001)(87936001)(48376002)(305945005)(81166006)(81156014)(8676002)(7846002)(356003)(32563001); DIR:OUT; SFP:1102; SCL:1; SRVR:DB5PR07MB0854; H:fihe3nok0735.emea.nsn-net.net; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; DB3FFO11FD002; 1:XN/+MZepHwY3v847PwpPS61ZFQx0S4Nclm7gAcTxBz1MzcUs0xF28F3oiMYJSLTp5vo9S+Zh86C7sTLzz1eRlDu3pfBc+zrZGaUH2jeutXBv8p1U3KaNYlKUz6ZQA2p+flVEi2VTRG2Pqqzc4fnuKM6wP6CUPvpVjcDqCQGktFZYzbz8RBY8piiwlTf2fwprM/2NG+POHeWPgJehHy/o9F84sJb0YgY0gTnalN0G/dINf2kDJIPk75OpfDPJO3uANayLLk3i1yhJorz1SZiJ0adQIDSEFc+dGj7bLspTivdVEW2314ESi1U3Yt8XcSwMB4PWkON7O2Zfo2uCUnRNaybGJeoucQp3QwHYCy8xP0c9nitPO4E22a2+OtZWQfRx60Peu2KP6sVrKkHOY6u7zUb7Yb9xdXxaGZewadj5OEV/T0RGtJlrWwCp6yx3OYbUbEjll8n4sMuQLeeWYCpNWqaAF8OgzH/6VRsQvD/b8uM= MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: e30794f1-f691-44f8-0cb9-08d3eb835aeb X-Microsoft-Exchange-Diagnostics: 1; DB5PR07MB0854; 2:h+6HhK/X4Vzzm0IwyJgWEJ5+Tz/rbpNQi65BzI8QuuBaz+b1W+pL4O0fcFBkwI7a2LdDo6g+6FW7P5qUMxZw6P8w8hyYpMW6eR4C6FoGaN5RR8xSz6AxXBGighsdRydHC9T9oVpz4k05l8yqvNzcHItzMxQ+GNFR+vrswHmLegc423owimKPPgvYGRzlFkpr; 3:1iiEKTQyndAlR0KdOFkx4a3HhttxF/hxSoxi5+92uX5Fa9mvpmvytvryt4JO4N5s4vrzm2gR1uXPsDa7lKwD2C9II0nbCFqtCsFyUMY4Wx2pAX8b3N0CApuydRPcVBjVwf/Gn6/iSDze/lqU0XfgGoNWT/Sgmsa/mLruMr2Vl3LfGBN6TTPjobSul04tGAGbtusgHqD/oz22N81hJsjo7VrxqbjCdSdQo07WBhZSR4yTVsZBytRkn0Q9dSBVkcVZiF87KdGPXMdZ/ABQGrLShQ== X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(8251501002); SRVR:DB5PR07MB0854; X-Microsoft-Exchange-Diagnostics: 1; DB5PR07MB0854; 25:k8IyLNNqtAkZhI+PA7k5iETfHlRcfX6E4rW/btY5ypTezJx7UmqTKIUJOG8o5GS6dsi1NR6sEMoNACtWJNWgAG+8llQPPTIFFYBWmqMkuKLaJKADA4UAgKwDVvJv2u/ctRl+1M4l75JghkikFKfJzvv6dV/ic4rc3hxlqhcG0MG1x7rpWUpSXc5cGy42PjgKwxXQ7mkWHEBWTKYgLBsAyxR5pVAkQaLMVCwxlKXMdRdHNQaZvqknGMmEdeKBEHZQlJtcmYfpgBWy2FQ2o3G8ifaQ/OUu3iluNW618GQrvCkTkEYRmqAmYlY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8Xr65GLJW23hQ5CpXYbnpLZu6UJZS3Sbxnl9qHoXC6C9o/PveT2vko7JzcfWT6ZS3VXFgQorCgSNQ8R/cGtDNEKscAfJ1O+NsLVEWepUvm9YspjL7gHawDJtHa1/9KbrcEHfi1VvHS8kO7ik+xsIhG0sNOcfyO4fJ89+EMkzy8jmvqImzRf2Sf9kWrxnPBtIMR0LdTKcqb5PRWb7MDIxRe02cM9Hubegdq50TK1gApiXdAYe4i0v3i/iSCi3ltrLvBU6NzB9qss5OLdbbnPA4jIxNJ7PVo= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(82608151540597); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(13016025)(13018025)(5005006)(8121501046)(10201501046)(3002001)(6055026); SRVR:DB5PR07MB0854; BCL:0; PCL:0; RULEID:; SRVR:DB5PR07MB0854; X-Microsoft-Exchange-Diagnostics: 1; DB5PR07MB0854; 4:+bGscD3kxIx3FqS1ECAAXQKr5eBeSnqCtxA36mdu2IQra1/grgzWFbRaOZ2W6XQDbtcyNcNdH935TRBpgs7rNrJBL6x6BGr4ZQXKGEKY0C0Kqm5mEVM+lDkz0oYzFRWI6jVTlXBqiuXJ0wejxI5RAZ5dOx9sxq+dGzFye0314Vk6MfWAK0VhySAvOir5l5qn2rYV+vvz5N9a/mWKWYRfzDD8tQ0tNddpKB+ceJ1Jvc8kIg0Rmk2iaTJS0lIMfgECNO3si1LfE0Ns4fzW+gbRC87ZcqoClfsP4znkjfcHsc0ZX0ONvvdCZh/yP6IOn1M19Sg8npe38B0BGaowQVSgrN71QIeUkzwd4yOVwnL+9U6VYU2rRS92DwRm8boZHH9HaE/wC9bXlakvg2EDEcZJUdpppapx0hsk7ydRwngy+o/VLckn+Hyg9PDdXdPxMzsvOF4QOcehqgQ5cEH9UPfItowDDkaKBYAVHI8Pxw8m2mw= X-Forefront-PRVS: 008421A8FF X-Microsoft-Exchange-Diagnostics: =?us-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uW4H4dAY9hdfD3nFn6brcePkiwbNCBrt6zcN46cT7y/x9OL6HwwhOIaZ/a5wuAd+lmLw/g6i67sngrx2+0wkRN0sADIRw0Q68th33tp0/Vy/KKS8bZbvv9bECfl0FUHUCvTGh49oZ7Ubn0MY99OyOurJCk9WMbtLFuBYGLtgM0usWWGXZX5A3m5cJ44TmBDPDsSMVPTYI2tTUXk/zEqugd43TTSBHcVbUxLFXKx/aMcExsqQFuClDDWsfI2KAjeF1gi/ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nokia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Oct 2016 11:49:38.6096 (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=[fihe3nok0735.emea.nsn-net.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5PR07MB0854 X-Topics: patch Subject: [lng-odp] [PATCH v3 3/5] example: l3fwd: make packet error check optional X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" Make packet error check optional as it forces full packet parse. Signed-off-by: Matias Elo --- v3: - Fixed struct option's has_arg values (Forrest) example/l3fwd/odp_l3fwd.c | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) -- 2.7.4 diff --git a/example/l3fwd/odp_l3fwd.c b/example/l3fwd/odp_l3fwd.c index 95c3d85..df412af 100644 --- a/example/l3fwd/odp_l3fwd.c +++ b/example/l3fwd/odp_l3fwd.c @@ -80,6 +80,7 @@ typedef struct { uint32_t duration; /* seconds to run */ uint8_t hash_mode; /* 1:hash, 0:lpm */ uint8_t dest_mac_changed[MAX_NB_PKTIO]; /* 1: dest mac from cmdline */ + int error_check; /* Check packets for errors */ } app_args_t; struct { @@ -241,10 +242,10 @@ static int l3fwd_pkt_lpm(odp_packet_t pkt, int sif) } /** - * Drop packets which input parsing marked as containing errors. + * Drop unsupported packets and packets containing errors. * - * Frees packets with error and modifies pkt_tbl[] to only contain packets with - * no detected errors. + * Frees packets with errors or unsupported protocol and modifies pkt_tbl[] to + * only contain valid packets. * * @param pkt_tbl Array of packets * @param num Number of packets in pkt_tbl[] @@ -256,12 +257,16 @@ static inline int drop_err_pkts(odp_packet_t pkt_tbl[], unsigned num) odp_packet_t pkt; unsigned dropped = 0; unsigned i, j; + int err; for (i = 0, j = 0; i < num; ++i) { pkt = pkt_tbl[i]; + err = 0; - if (odp_unlikely(odp_packet_has_error(pkt) || - !odp_packet_has_ipv4(pkt))) { + if (global.cmd_args.error_check) + err = odp_packet_has_error(pkt); + + if (odp_unlikely(err || !odp_packet_has_ipv4(pkt))) { odp_packet_free(pkt); dropped++; } else if (odp_unlikely(i != j++)) { @@ -475,6 +480,8 @@ static void print_usage(char *progname) " -q, --queue Configure rx queue(s) for port\n" " optional, format: [(port, queue, thread),...]\n" " for example: -q '(0, 0, 1),(1,0,2)'\n" + " -e, --error_check 0: Don't check packet errors (default)\n" + " 1: Check packet errors\n" " -h, --help Display help and exit.\n\n" "\n", NO_PATH(progname), NO_PATH(progname) ); @@ -491,16 +498,17 @@ static void parse_cmdline_args(int argc, char *argv[], app_args_t *args) static struct option longopts[] = { {"interface", required_argument, NULL, 'i'}, /* return 'i' */ {"route", required_argument, NULL, 'r'}, /* return 'r' */ - {"style", optional_argument, NULL, 's'}, /* return 's' */ - {"duration", optional_argument, NULL, 'd'}, /* return 'd' */ - {"thread", optional_argument, NULL, 't'}, /* return 't' */ - {"queue", optional_argument, NULL, 'q'}, /* return 'q' */ + {"style", required_argument, NULL, 's'}, /* return 's' */ + {"duration", required_argument, NULL, 'd'}, /* return 'd' */ + {"thread", required_argument, NULL, 't'}, /* return 't' */ + {"queue", required_argument, NULL, 'q'}, /* return 'q' */ + {"error_check", required_argument, NULL, 'e'}, {"help", no_argument, NULL, 'h'}, /* return 'h' */ {NULL, 0, NULL, 0} }; while (1) { - opt = getopt_long(argc, argv, "+s:t:d:i:r:q:h", + opt = getopt_long(argc, argv, "+s:t:d:i:r:q:e:h", longopts, &long_index); if (opt == -1) @@ -585,6 +593,10 @@ static void parse_cmdline_args(int argc, char *argv[], app_args_t *args) args->route_str[route_index++] = local; break; + case 'e': + args->error_check = atoi(optarg); + break; + case 'h': print_usage(argv[0]); exit(EXIT_SUCCESS);