From patchwork Thu Jan 5 13:39:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Balasubramanian Manoharan X-Patchwork-Id: 90017 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp8972226qgi; Thu, 5 Jan 2017 05:39:49 -0800 (PST) X-Received: by 10.200.35.250 with SMTP id r55mr75016911qtr.161.1483623589198; Thu, 05 Jan 2017 05:39:49 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id u28si47711547qta.70.2017.01.05.05.39.48; Thu, 05 Jan 2017 05:39:49 -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 8953D607F4; Thu, 5 Jan 2017 13:39:48 +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=BAYES_00, RCVD_IN_DNSWL_NONE, 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 7FCD96079A; Thu, 5 Jan 2017 13:39:42 +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 988C6607DB; Thu, 5 Jan 2017 13:39:40 +0000 (UTC) Received: from mail-pg0-f50.google.com (mail-pg0-f50.google.com [74.125.83.50]) by lists.linaro.org (Postfix) with ESMTPS id D259E6065E for ; Thu, 5 Jan 2017 13:39:38 +0000 (UTC) Received: by mail-pg0-f50.google.com with SMTP id f188so240457915pgc.3 for ; Thu, 05 Jan 2017 05:39:38 -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=bT+AKPmZCmhjPTL7SjanRPHoQLAtLGguVJJXUva3bxA=; b=Hw7WD6zdBnNkOD1fQMXgYJzPO5vCrb9iGOq+TEUFYHk4DsPhhUiKxbhkAbd+7MSYwc XvFoShmn0YopVh3Ow3b7sHevRNfyOsfL8ANdaKiAsXeyau65I6tyX8qPQtIt40fqPw1C 3B01llDzUpl+N+bPNWRA+I6vFc2SpklSpiRroS8Vv2yDSg4MR0YzOpkrpdsbj0K/9PyX AsaAhNIKkTdN6F7vQLRDTWrIPsvJNcHPAzqnUH0Db+hDcS2H5WCmYpveYJ80PLHzKHgs WJNtvGWMZCKm10u5wwUMgSEzJm/PmQY7+RSEVqFbrQ0wVRXlq4wpBd9qduMKj7uN1HgJ 54ug== X-Gm-Message-State: AIkVDXIziySXdBe9Y9KCu8aaB+/6jtS6Q+8GjUJLlTnrYGHv2D9kyL86oYuseJsPEIB211HSYEY= X-Received: by 10.84.218.3 with SMTP id q3mr156599201pli.80.1483623577986; Thu, 05 Jan 2017 05:39:37 -0800 (PST) Received: from localhost.localdomain ([122.166.219.57]) by smtp.gmail.com with ESMTPSA id p64sm153937365pfi.88.2017.01.05.05.39.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 05 Jan 2017 05:39:37 -0800 (PST) From: Balasubramanian Manoharan To: lng-odp@lists.linaro.org Date: Thu, 5 Jan 2017 19:09:26 +0530 Message-Id: <1483623566-17460-1-git-send-email-bala.manoharan@linaro.org> X-Mailer: git-send-email 1.9.1 Subject: [lng-odp] [PATCHv3 1/1] validation: pktio: fix invalid mac addr 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" Fixes https://bugs.linaro.org/show_bug.cgi?id=2496 Signed-off-by: Balasubramanian Manoharan --- v3: Review comment incorporation test/common_plat/validation/api/pktio/pktio.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) -- 1.9.1 Reviewed-by: Josep Puigdemont diff --git a/test/common_plat/validation/api/pktio/pktio.c b/test/common_plat/validation/api/pktio/pktio.c index 7c979fb..438b7e8 100644 --- a/test/common_plat/validation/api/pktio/pktio.c +++ b/test/common_plat/validation/api/pktio/pktio.c @@ -31,6 +31,8 @@ #define PKTIN_TS_MAX_RES 10000000000 #define PKTIN_TS_CMP_RES 1 +#define PKTIO_SRC_MAC {1, 2, 3, 4, 5, 6} +#define PKTIO_DST_MAC {6, 5, 4, 3, 2, 1} #undef DEBUG_STATS /** interface names used for testing */ @@ -245,7 +247,8 @@ static uint32_t pktio_init_packet(odp_packet_t pkt) odph_udphdr_t *udp; char *buf; uint16_t seq; - uint8_t mac[ODP_PKTIO_MACADDR_MAXSIZE] = {0}; + uint8_t src_mac[ODP_PKTIO_MACADDR_MAXSIZE] = PKTIO_SRC_MAC; + uint8_t dst_mac[ODP_PKTIO_MACADDR_MAXSIZE] = PKTIO_DST_MAC; int pkt_len = odp_packet_len(pkt); buf = odp_packet_data(pkt); @@ -253,8 +256,8 @@ static uint32_t pktio_init_packet(odp_packet_t pkt) /* Ethernet */ odp_packet_l2_offset_set(pkt, 0); eth = (odph_ethhdr_t *)buf; - memcpy(eth->src.addr, mac, ODPH_ETHADDR_LEN); - memcpy(eth->dst.addr, mac, ODPH_ETHADDR_LEN); + memcpy(eth->src.addr, &src_mac, ODPH_ETHADDR_LEN); + memcpy(eth->dst.addr, &dst_mac, ODPH_ETHADDR_LEN); eth->type = odp_cpu_to_be_16(ODPH_ETHTYPE_IPV4); /* IP */