From patchwork Thu Jan 14 10:56:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 59714 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp3924421lbb; Thu, 14 Jan 2016 02:56:47 -0800 (PST) X-Received: by 10.140.109.100 with SMTP id k91mr4391729qgf.54.1452769007881; Thu, 14 Jan 2016 02:56:47 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id n67si6888506qki.14.2016.01.14.02.56.47; Thu, 14 Jan 2016 02:56:47 -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; dkim=neutral (body hash did not verify) header.i=@linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 3E231617E8; Thu, 14 Jan 2016 10:56:47 +0000 (UTC) Authentication-Results: lists.linaro.org; dkim=fail reason="verification failed; unprotected key" header.d=linaro.org header.i=@linaro.org header.b=X1G2LO6A; dkim-adsp=none (unprotected policy); dkim-atps=neutral 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.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID, 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 9AAF8617E2; Thu, 14 Jan 2016 10:56:43 +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 D2736617E3; Thu, 14 Jan 2016 10:56:41 +0000 (UTC) Received: from mail-wm0-f44.google.com (mail-wm0-f44.google.com [74.125.82.44]) by lists.linaro.org (Postfix) with ESMTPS id DFDF96179B for ; Thu, 14 Jan 2016 10:56:40 +0000 (UTC) Received: by mail-wm0-f44.google.com with SMTP id f206so422889332wmf.0 for ; Thu, 14 Jan 2016 02:56:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=5Hf8qrgjokGrppZ6UOpkwt+WZN7XVAUDTbm6Jg3rINA=; b=X1G2LO6AH3poLO3ZSOoxxMjI57qYzwoUAFnRK/o13sJnu6O59uT0cPaXpEXM8sNKYp OTNyvP+FUPjSX2ng3CEq8QHgNCxcGch5L12HGC5M4y3T/u2V24v2LvvlyDEjnwEQvOcg U3+zgP6ck2bCXMPxvj8aT3W3fnu4o3loi1tDY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=5Hf8qrgjokGrppZ6UOpkwt+WZN7XVAUDTbm6Jg3rINA=; b=R0CKw9LGityQncxy94NGm0ldw4RWu0VCMjBcfCIT0RvBN7dx/22hM97qgrs3gm9xqB ROIYVNDrRfGp0GA4fVwowGzv0aZQCFPzKWVbuvyoGwOiLSSmlTWUt3YlxUfOYS+Sw+4L frRw4Ba/7KaK8UoyHYZ/l+VHzhqxJixWfCaZs9pYpFyOEydPscV7c53IoVYVhINcyIUE Z6HaZiXFrD8gNh508SjsPoPVIMxzPwndyyVdYj7tllKU8V3cOpWTlx/FcUmKiQf5F4VO mxgbLVhSuGOrFSf5gQsaDDkylVODgaFRGq1XrCXxb4uCmFPTZPV/S/Uwt5coe6suv9ND Bs3w== X-Gm-Message-State: ALoCoQnEpYg4cNvJSPmig6fxqoQ+rGRVJ2IbwzAkovT4H4aeoG58Nxg0EoAKumHU/8UfghADpyO/1yNt2TfmYW2Fl0x/7lTvxg== X-Received: by 10.112.182.8 with SMTP id ea8mr909933lbc.114.1452768998281; Thu, 14 Jan 2016 02:56:38 -0800 (PST) Received: from localhost.localdomain ([195.238.92.128]) by smtp.gmail.com with ESMTPSA id a67sm698098lfe.6.2016.01.14.02.56.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 14 Jan 2016 02:56:37 -0800 (PST) From: Ivan Khoronzhuk To: lng-odp@lists.linaro.org Date: Thu, 14 Jan 2016 12:56:31 +0200 Message-Id: <1452768991-25198-1-git-send-email-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 1.9.1 X-Topics: patch Subject: [lng-odp] [PATCH] validation: pktio: assign MAC address if one loop pktio is used 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: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" In case of one loop pktio the MAC address is not set in the packets but should be. Signed-off-by: Ivan Khoronzhuk --- test/validation/pktio/pktio.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/test/validation/pktio/pktio.c b/test/validation/pktio/pktio.c index 536ef6c..a756af4 100644 --- a/test/validation/pktio/pktio.c +++ b/test/validation/pktio/pktio.c @@ -830,11 +830,21 @@ void pktio_test_start_stop(void) pktio_init_packet(pkt); if (num_ifaces > 1) { pktio_pkt_set_macs(pkt, pktio[0], pktio[1]); - if (pktio_fixup_checksums(pkt) != 0) { - odp_packet_free(pkt); - break; - } + } else { + uint32_t len; + odph_ethhdr_t *eth; + + eth = (odph_ethhdr_t *)odp_packet_l2_ptr(pkt, &len); + ret = odp_pktio_mac_addr(pktio[0], + ð->dst, sizeof(eth->dst)); + CU_ASSERT(ret == ODPH_ETHADDR_LEN); } + + if (pktio_fixup_checksums(pkt) != 0) { + odp_packet_free(pkt); + break; + } + tx_ev[alloc] = odp_packet_to_event(pkt); }