From patchwork Thu Aug 6 13:00:16 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 52000 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by patches.linaro.org (Postfix) with ESMTPS id 1933920539 for ; Thu, 6 Aug 2015 13:01:02 +0000 (UTC) Received: by labia3 with SMTP id ia3sf5360718lab.1 for ; Thu, 06 Aug 2015 06:01:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:delivered-to:from:to:date :message-id:subject:precedence:list-id:list-unsubscribe:list-archive :list-post:list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=W9zvOFXKmdRLKNV9gGvpjolcrzteg5O0AHs5tp1YPpw=; b=A4Tc3JwXSAt0X/BUK/t10XxfDuXD9mBo2GzFpKqsiiqZSbYyaOQYbDklBuhvjqXiFu ZJaXoFkPmHCIdj9tuSlcNTi2uVmfl/+Z11XcOqr+fnidxp9Ji/o2LJfxPrJIk/DBa+RU R1JTbDwsztzDaxYiJjl2rKEd/1z7mTWyU2ZKPixCy+dSU8ftxEtwjz1rAGLijBZZnzII VKT7n2sjCh4lqArn2pA75Qtn0oGNCMHvzjnfjACz50eMOw/PCD49BZGHnUD6awV2TXfP 7egBQLK2N/hg1OyxBGp38vjWXv0JVNHAbZZ0YbqriKNQUpfIke2F1ULXNpPiUrLdC6Wx fVbg== X-Gm-Message-State: ALoCoQmQoqYRP50qOMIzk6c6Y9F9ekw+UwnGM+tdavu9FEWHb+eFsWoaZ4XSyzfT1eyG/wEXO6Yk X-Received: by 10.112.138.2 with SMTP id qm2mr487359lbb.19.1438866060962; Thu, 06 Aug 2015 06:01:00 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.5.225 with SMTP id v1ls330349lav.71.gmail; Thu, 06 Aug 2015 06:01:00 -0700 (PDT) X-Received: by 10.152.36.226 with SMTP id t2mr1425413laj.6.1438866060690; Thu, 06 Aug 2015 06:01:00 -0700 (PDT) Received: from mail-lb0-f171.google.com (mail-lb0-f171.google.com. [209.85.217.171]) by mx.google.com with ESMTPS id w10si4620367lad.155.2015.08.06.06.01.00 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Aug 2015 06:01:00 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.171 as permitted sender) client-ip=209.85.217.171; Received: by lbbpo9 with SMTP id po9so42464441lbb.2 for ; Thu, 06 Aug 2015 06:01:00 -0700 (PDT) X-Received: by 10.112.198.74 with SMTP id ja10mr1387529lbc.19.1438866060367; Thu, 06 Aug 2015 06:01:00 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.7.198 with SMTP id l6csp935639lba; Thu, 6 Aug 2015 06:00:56 -0700 (PDT) X-Received: by 10.50.79.199 with SMTP id l7mr3338964igx.87.1438866056096; Thu, 06 Aug 2015 06:00:56 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id k65si5354788iok.7.2015.08.06.06.00.53; Thu, 06 Aug 2015 06:00:55 -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; Received: by lists.linaro.org (Postfix, from userid 109) id 08052620C5; Thu, 6 Aug 2015 13:00:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252.ec2.internal 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 ip-10-142-244-252.ec2.internal (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 351A862097; Thu, 6 Aug 2015 13:00:46 +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 928D462098; Thu, 6 Aug 2015 13:00:43 +0000 (UTC) Received: from mail-lb0-f178.google.com (mail-lb0-f178.google.com [209.85.217.178]) by lists.linaro.org (Postfix) with ESMTPS id A300262096 for ; Thu, 6 Aug 2015 13:00:41 +0000 (UTC) Received: by lbbyj8 with SMTP id yj8so42213526lbb.0 for ; Thu, 06 Aug 2015 06:00:40 -0700 (PDT) X-Received: by 10.112.219.165 with SMTP id pp5mr1373010lbc.23.1438866039777; Thu, 06 Aug 2015 06:00:39 -0700 (PDT) Received: from khorivan.itg.ti.com ([195.238.92.128]) by smtp.gmail.com with ESMTPSA id q5sm579110laj.6.2015.08.06.06.00.38 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 06 Aug 2015 06:00:39 -0700 (PDT) From: Ivan Khoronzhuk To: lng-odp@lists.linaro.org Date: Thu, 6 Aug 2015 16:00:16 +0300 Message-Id: <1438866016-19572-1-git-send-email-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 1.9.1 X-Topics: patch Subject: [lng-odp] [Patch v2] performance: odp_pktio_perf: use real MAC addresses while packet creation X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: 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" X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ivan.khoronzhuk@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.171 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 It's needed as pktio is not set in promisc mode. Signed-off-by: Ivan Khoronzhuk Reviewed-by: Stuart Haslam --- Since v1: - initialize mac address at init, while packet creation only copy test/performance/odp_pktio_perf.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/test/performance/odp_pktio_perf.c b/test/performance/odp_pktio_perf.c index 08f13b6..fcbc4ec 100644 --- a/test/performance/odp_pktio_perf.c +++ b/test/performance/odp_pktio_perf.c @@ -123,6 +123,8 @@ typedef struct { odp_pktio_t pktio_rx; pkt_rx_stats_t rx_stats[ODP_CONFIG_MAX_THREADS]; pkt_tx_stats_t tx_stats[ODP_CONFIG_MAX_THREADS]; + uint8_t src_mac[ODPH_ETHADDR_LEN]; + uint8_t dst_mac[ODPH_ETHADDR_LEN]; } test_globals_t; /* Status of max rate search */ @@ -169,7 +171,6 @@ static odp_packet_t pktio_create_packet(void) uint32_t offset; pkt_head_t pkt_hdr; size_t payload_len; - uint8_t mac[ODPH_ETHADDR_LEN] = {0}; payload_len = sizeof(pkt_hdr) + gbl_args->args.pkt_len; @@ -186,8 +187,8 @@ static odp_packet_t pktio_create_packet(void) offset = 0; odp_packet_l2_offset_set(pkt, offset); 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, gbl_args->src_mac, ODPH_ETHADDR_LEN); + memcpy(eth->dst.addr, gbl_args->dst_mac, ODPH_ETHADDR_LEN); eth->type = odp_cpu_to_be_16(ODPH_ETHTYPE_IPV4); /* IP */ @@ -731,6 +732,11 @@ static int test_init(void) else gbl_args->pktio_rx = gbl_args->pktio_tx; + odp_pktio_mac_addr(gbl_args->pktio_tx, gbl_args->src_mac, + ODPH_ETHADDR_LEN); + odp_pktio_mac_addr(gbl_args->pktio_rx, gbl_args->dst_mac, + ODPH_ETHADDR_LEN); + if (gbl_args->pktio_rx == ODP_PKTIO_INVALID || gbl_args->pktio_tx == ODP_PKTIO_INVALID) { LOG_ERR("failed to open pktio\n");