From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f47.google.com (mail-wm0-f47.google.com [74.125.82.47]) by dpdk.org (Postfix) with ESMTP id 474042C65 for ; Mon, 22 Feb 2016 19:18:27 +0100 (CET) Received: by mail-wm0-f47.google.com with SMTP id g62so176332536wme.0 for ; Mon, 22 Feb 2016 10:18:27 -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; bh=+LRgL7R+Yfpi/SyKNDYXnFMMveEk+ELH7EEYbhwyRds=; b=uInWAUig7zq2chFgrfMmO2gwxkdGJ8B0xTRn9pzByiBcsK0YX0t728jq2A9MpReDEY MYSjnbNFlphDSGRyFlk/6NA7G0BI2aKiF7Jyh8r8lihh5tl7x+pw1GVdE2K4flXfmXLz znBbpPAZEzg7YKKLFy/cF+pRkq7vXl4pvDwcLCIuhD2erh45pQck/m4aIo+QyOraQxYT lmbbKSCFB9jLjkrIKVQ7gXQvx91G982LftN7jcWbOMaz8FxQflOaosTvKSJA8d9n3l+A inT5/fGgVTwdAH/tVqFypcXno9QqATy21GhY3zBFHdn/7qIC4zCMj0vl9t+VV2SKAR57 g34Q== 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; bh=+LRgL7R+Yfpi/SyKNDYXnFMMveEk+ELH7EEYbhwyRds=; b=CJwlxDB310ksuoy1fyDEe+Lxah1RSU3k0XyJsk1MlebmUVbu76AMo1pJSWfB6fjqUw kRtZlA6wZL21vV+5s5RzSRRNlmia+Vv/4aXkQwRlt1dNSI1L19qIRX9hGaCQrK6R/8+R sAmZLTcUEA9dE25K/NEqcUpJVA5AMhlv/AYa98EDi6IBQkwY4SgllGbTJdxj9/HpLAUT IaQ1gHk99cIa9J9In9WZNImM4RMYpsPj8uC7kabaXjpWMy0RprUFKFWd93FqJ/k4cOet 5CSv3oSck5KuciDHgchUOdqnZmft52S5RnZasvkw+Bxg6oFJdQUh73I9DDZEa4Bw/h3L TnXQ== X-Gm-Message-State: AG10YORTjADOqZsAIeL/aDOF4BHHsf1mI+ardNTIfxmDtplpMvG0EwkBiMSsKbsHlfUIzXtF X-Received: by 10.194.58.12 with SMTP id m12mr32929712wjq.22.1456165107138; Mon, 22 Feb 2016 10:18:27 -0800 (PST) Received: from 6wind.com (guy78-3-82-239-227-177.fbx.proxad.net. [82.239.227.177]) by smtp.gmail.com with ESMTPSA id y3sm22236729wmy.17.2016.02.22.10.18.25 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 22 Feb 2016 10:18:26 -0800 (PST) From: Adrien Mazarguil To: dev@dpdk.org Date: Mon, 22 Feb 2016 19:17:58 +0100 Message-Id: <1456165083-28316-3-git-send-email-adrien.mazarguil@6wind.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1456165083-28316-1-git-send-email-adrien.mazarguil@6wind.com> References: <1454063573-1993-1-git-send-email-adrien.mazarguil@6wind.com> <1456165083-28316-1-git-send-email-adrien.mazarguil@6wind.com> Subject: [dpdk-dev] [PATCH v2 2/7] mlx5: reorder TX/RX queue structure 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: Mon, 22 Feb 2016 18:18:27 -0000 From: Nelio Laranjeiro Remove padding and move important fields to the beginning for better performance. Signed-off-by: Nelio Laranjeiro --- drivers/net/mlx5/mlx5_rxtx.h | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/drivers/net/mlx5/mlx5_rxtx.h b/drivers/net/mlx5/mlx5_rxtx.h index fde0ca2..4a857d8 100644 --- a/drivers/net/mlx5/mlx5_rxtx.h +++ b/drivers/net/mlx5/mlx5_rxtx.h @@ -105,7 +105,6 @@ struct priv; struct rxq { struct priv *priv; /* Back pointer to private data. */ struct rte_mempool *mp; /* Memory Pool for allocations. */ - struct ibv_mr *mr; /* Memory Region (for mp). */ struct ibv_cq *cq; /* Completion Queue. */ struct ibv_exp_wq *wq; /* Work Queue. */ struct ibv_exp_wq_family *if_wq; /* WQ burst interface. */ @@ -117,19 +116,20 @@ struct rxq { unsigned int port_id; /* Port ID for incoming packets. */ unsigned int elts_n; /* (*elts)[] length. */ unsigned int elts_head; /* Current index in (*elts)[]. */ - union { - struct rxq_elt_sp (*sp)[]; /* Scattered RX elements. */ - struct rxq_elt (*no_sp)[]; /* RX elements. */ - } elts; unsigned int sp:1; /* Use scattered RX elements. */ unsigned int csum:1; /* Enable checksum offloading. */ unsigned int csum_l2tun:1; /* Same for L2 tunnels. */ unsigned int vlan_strip:1; /* Enable VLAN stripping. */ + union { + struct rxq_elt_sp (*sp)[]; /* Scattered RX elements. */ + struct rxq_elt (*no_sp)[]; /* RX elements. */ + } elts; uint32_t mb_len; /* Length of a mp-issued mbuf. */ - struct mlx5_rxq_stats stats; /* RX queue counters. */ unsigned int socket; /* CPU socket ID for allocations. */ + struct mlx5_rxq_stats stats; /* RX queue counters. */ struct ibv_exp_res_domain *rd; /* Resource Domain. */ struct fdir_queue fdir_queue; /* Flow director queue. */ + struct ibv_mr *mr; /* Memory Region (for mp). */ }; /* Hash RX queue types. */ @@ -248,30 +248,31 @@ typedef uint8_t linear_t[16384]; /* TX queue descriptor. */ struct txq { struct priv *priv; /* Back pointer to private data. */ - struct { - const struct rte_mempool *mp; /* Cached Memory Pool. */ - struct ibv_mr *mr; /* Memory Region (for mp). */ - uint32_t lkey; /* mr->lkey */ - } mp2mr[MLX5_PMD_TX_MP_CACHE]; /* MP to MR translation table. */ struct ibv_cq *cq; /* Completion Queue. */ struct ibv_qp *qp; /* Queue Pair. */ - struct ibv_exp_qp_burst_family *if_qp; /* QP burst interface. */ - struct ibv_exp_cq_family *if_cq; /* CQ interface. */ + struct txq_elt (*elts)[]; /* TX elements. */ #if MLX5_PMD_MAX_INLINE > 0 uint32_t max_inline; /* Max inline send size <= MLX5_PMD_MAX_INLINE. */ #endif unsigned int elts_n; /* (*elts)[] length. */ - struct txq_elt (*elts)[]; /* TX elements. */ unsigned int elts_head; /* Current index in (*elts)[]. */ unsigned int elts_tail; /* First element awaiting completion. */ unsigned int elts_comp; /* Number of completion requests. */ unsigned int elts_comp_cd; /* Countdown for next completion request. */ unsigned int elts_comp_cd_init; /* Initial value for countdown. */ + struct { + const struct rte_mempool *mp; /* Cached Memory Pool. */ + struct ibv_mr *mr; /* Memory Region (for mp). */ + uint32_t lkey; /* mr->lkey */ + } mp2mr[MLX5_PMD_TX_MP_CACHE]; /* MP to MR translation table. */ struct mlx5_txq_stats stats; /* TX queue counters. */ + /* Elements used only for init part are here. */ linear_t (*elts_linear)[]; /* Linearized buffers. */ struct ibv_mr *mr_linear; /* Memory Region for linearized buffers. */ - unsigned int socket; /* CPU socket ID for allocations. */ + struct ibv_exp_qp_burst_family *if_qp; /* QP burst interface. */ + struct ibv_exp_cq_family *if_cq; /* CQ interface. */ struct ibv_exp_res_domain *rd; /* Resource Domain. */ + unsigned int socket; /* CPU socket ID for allocations. */ }; /* mlx5_rxq.c */ -- 2.1.4