From patchwork Thu Dec 22 12:43:44 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 88858 Delivered-To: patch@linaro.org Received: by 10.182.112.6 with SMTP id im6csp3219353obb; Thu, 22 Dec 2016 04:43:54 -0800 (PST) X-Received: by 10.200.38.102 with SMTP id v35mr9344839qtv.100.1482410634689; Thu, 22 Dec 2016 04:43:54 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id l68si17356438qte.4.2016.12.22.04.43.54; Thu, 22 Dec 2016 04:43:54 -0800 (PST) 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=pass (p=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 150ED60E10; Thu, 22 Dec 2016 12:43:54 +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=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, 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 82B2860DEA; Thu, 22 Dec 2016 12:43:50 +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 93E2960DEF; Thu, 22 Dec 2016 12:43:48 +0000 (UTC) Received: from mail-oi0-f41.google.com (mail-oi0-f41.google.com [209.85.218.41]) by lists.linaro.org (Postfix) with ESMTPS id 8353C60DE9 for ; Thu, 22 Dec 2016 12:43:47 +0000 (UTC) Received: by mail-oi0-f41.google.com with SMTP id v84so239915310oie.3 for ; Thu, 22 Dec 2016 04:43:47 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=zSvf8ezr8VqT+TOz87asfos0FTJgZMGrBv/UFV8LXqQ=; b=e4ZacZWKFY4Y1BonjlF2hjhafWIZqtwR7CNg+JuucjFgOxNcgnjIYP9r2JmABWUism N+lu57EOKdoy/Wogho1z29LY0fK1h1AO5HvOsq6ABhRAWZ3XK2N0moyvysaO5JGTNr46 gFnlbM105J0IM4W7moBgFGq69CZPiZhZ3IyiyGG3VjWt3uDu9Pa2kCd9SilAxlQnzKLh lKzeJ1B3+C55KjOpIYtGjgfqHdYpbpMEQQNCtW9xWEvclYMYXoK0uPWh/ls3px22BhxK faLM4OZq/UqMtAdprcs0ajnh6cPnsfn/x8tkWp7K7nuIZ/16RvLoY7aPNb7yt1c/X7Og TP6A== X-Gm-Message-State: AIkVDXKGObzwNgTKBiWv0vZq/YQrRSDkZMLEq7HGMQZZmQz/RZkzxaNs+Oiy0S05Ex4AlaYd7XY= X-Received: by 10.157.44.188 with SMTP id p57mr4772449otb.255.1482410627021; Thu, 22 Dec 2016 04:43:47 -0800 (PST) Received: from localhost.localdomain (cpe-70-121-83-241.austin.res.rr.com. [70.121.83.241]) by smtp.gmail.com with ESMTPSA id s51sm13828689otb.31.2016.12.22.04.43.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 22 Dec 2016 04:43:46 -0800 (PST) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Thu, 22 Dec 2016 06:43:44 -0600 Message-Id: <1482410624-6163-1-git-send-email-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.7.4 Subject: [lng-odp] [PATCH] test: perf: add assert since src_idx cannot be negative 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" Address Bug https://bugs.linaro.org/show_bug.cgi?id=2790 by adding an assert. odp_packet_input_index() only returns a negative value if the packet did not originate on an I/O interface, which is known to be false here. Signed-off-by: Bill Fischofer --- test/common_plat/performance/odp_l2fwd.c | 2 ++ 1 file changed, 2 insertions(+) -- 2.7.4 Reviewed-by: Balasubramanian Manoharan diff --git a/test/common_plat/performance/odp_l2fwd.c b/test/common_plat/performance/odp_l2fwd.c index 651ed10..1fee9ff 100644 --- a/test/common_plat/performance/odp_l2fwd.c +++ b/test/common_plat/performance/odp_l2fwd.c @@ -20,6 +20,7 @@ #include #include #include +#include #include @@ -353,6 +354,7 @@ static int run_worker_sched_mode(void *arg) /* packets from the same queue are from the same interface */ src_idx = odp_packet_input_index(pkt_tbl[0]); + assert(src_idx >= 0); dst_idx = gbl_args->dst_port_from_idx[src_idx]; fill_eth_addrs(pkt_tbl, pkts, dst_idx);