From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wj0-f171.google.com (mail-wj0-f171.google.com [209.85.210.171]) by dpdk.org (Postfix) with ESMTP id 5319E378E for ; Thu, 24 Nov 2016 17:04:06 +0100 (CET) Received: by mail-wj0-f171.google.com with SMTP id mp19so36892911wjc.1 for ; Thu, 24 Nov 2016 08:04:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=MwWPKWmfmdZMwP3k/XtXtDBmPvyf5zxymdo5yMFzRGw=; b=obxXqvtLj/F7eIM6LJ2+hofEWp0BX5TBIIPmeuPkSzj4u7MJTs4Gdm6qpi5nKoVyXi erBayo7hWI+qcfHjrTEnQ1Exkj6MPPZwDBlzb5+CZPbdjjoUT4srZAbKeTED9A0xJwO+ JSDBlNDjsfqb/vvGAMRK4vaClbkYjfLLXCdgmrt0lrdtgx1Gh6KKHRvXgFdL1ETlwKIt QJPNBtpl4ie5Dn7KvgBblFePiAxCFoX/wtCw1dHqITipWNBwCA5gHabb1SUyO1WYaA2h 1SULiujOhgWYpfg64DzOdrKVjiC3VROjzZsbq60wjOy1OhDNdeGXV5CNcK1L5a7AmzAR OewQ== 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:in-reply-to :references:in-reply-to:references; bh=MwWPKWmfmdZMwP3k/XtXtDBmPvyf5zxymdo5yMFzRGw=; b=mqYtVaeNeTZNvXAd+VuWz3iQ/13py4cw2q1+lVtFdpsRIGn4J8vSmb7I6qbxushJ9Z fMU1cwCqDq5FnA8dp5rqRgXIk9oYIAEbNi2Hi2Mjk9FocZtO77JDlNvY5WHWpSCq3v1f 8Ut81X7suM2C+KS6LMXsLg6jb6DaY8UTG4keY0FRpbiuiMHlsc/PMfGNDlMdWxRM+psZ fx3jnoY1ARPS+uZdO85T+vblGWt/fiXgVQY7e14evb03vupv0vRS69GgVYvQzjMikzy6 XcVLNDOhxdsVc+pRljFyaEZSvc5LjcTL0RBKZal89Tl58el6GkWfmj4x6FAwe45JBJAs 59Tw== X-Gm-Message-State: AKaTC0092PZs8LvLqOpVQtp/Cu0PrRfJhe5XYMQgnkQAi85aUJWHKpvcYD6iclazk2QO6mBV X-Received: by 10.194.52.42 with SMTP id q10mr2915960wjo.50.1480003446004; Thu, 24 Nov 2016 08:04:06 -0800 (PST) Received: from ping.vm.6wind.com (guy78-3-82-239-227-177.fbx.proxad.net. [82.239.227.177]) by smtp.gmail.com with ESMTPSA id vr9sm42495142wjc.35.2016.11.24.08.04.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 24 Nov 2016 08:04:05 -0800 (PST) From: Nelio Laranjeiro To: dev@dpdk.org Cc: Thomas Monjalon , Adrien Mazarguil Date: Thu, 24 Nov 2016 17:03:35 +0100 Message-Id: X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH 6/7] net/mlx5: optimize copy of Ethernet header X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Nov 2016 16:04:06 -0000 Use fewer instructions to copy the first two bytes of Ethernet headers to work queue elements. Signed-off-by: Nelio Laranjeiro Acked-by: Adrien Mazarguil --- drivers/net/mlx5/mlx5_rxtx.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c index 0d0b807..4b8c197 100644 --- a/drivers/net/mlx5/mlx5_rxtx.c +++ b/drivers/net/mlx5/mlx5_rxtx.c @@ -409,7 +409,7 @@ mlx5_tx_burst(void *dpdk_txq, struct rte_mbuf **pkts, uint16_t pkts_n) unsigned int ds = 0; uintptr_t addr; uint16_t pkt_inline_sz = MLX5_WQE_DWORD_SIZE; - uint8_t ehdr[2]; + uint16_t ehdr; uint8_t cs_flags = 0; #ifdef MLX5_PMD_SOFT_COUNTERS uint32_t total_length = 0; @@ -436,8 +436,8 @@ mlx5_tx_burst(void *dpdk_txq, struct rte_mbuf **pkts, uint16_t pkts_n) rte_prefetch0(*pkts); addr = rte_pktmbuf_mtod(buf, uintptr_t); length = DATA_LEN(buf); - ehdr[0] = ((uint8_t *)addr)[0]; - ehdr[1] = ((uint8_t *)addr)[1]; + ehdr = (((uint8_t *)addr)[1] << 8) | + ((uint8_t *)addr)[0]; #ifdef MLX5_PMD_SOFT_COUNTERS total_length = length; #endif @@ -600,8 +600,7 @@ mlx5_tx_burst(void *dpdk_txq, struct rte_mbuf **pkts, uint16_t pkts_n) 0, cs_flags, 0, - (ehdr[1] << 24) | (ehdr[0] << 16) | - htons(pkt_inline_sz), + (ehdr << 16) | htons(pkt_inline_sz), }; txq->wqe_ci += (ds + 3) / 4; #ifdef MLX5_PMD_SOFT_COUNTERS -- 2.1.4