From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f43.google.com (mail-wm0-f43.google.com [74.125.82.43]) by dpdk.org (Postfix) with ESMTP id EF4692BD9 for ; Thu, 3 Mar 2016 15:27:37 +0100 (CET) Received: by mail-wm0-f43.google.com with SMTP id n186so134168587wmn.1 for ; Thu, 03 Mar 2016 06:27:37 -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=fHLtYDD182Ul1ptPyxewzjD1AQNJJV+nM3MZ/35sNd8saD+1RyGf9unX58LupMrBNY Fuer0UXNLqjbo8/oPYtwLF2uB1vAcXr82Udo5XFepDTY7XVWk+zPJM/vGndFw1hxgh59 5PXbmydpNRuipcsvFFe25kLro9UJOvipdGda6I/ywMQu70c10bULKSQyKYhjbb6FYRcm 5w78sQlF3oTAtwO0BmAGehRmf8suCNCMJ5d2JhMw8ttwUSQyuORXkLyGKdSrbVSkpL9U hq++ADvAPbjFa4Hzh3TsqRjfRZySqULtBacWbB6yeMwbUtDJuZhJ+MB1TfCgkHTSWMqx 8uWg== 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=Id5q9MGuuXxAPW/zzI1H7YX/EK5b0YTnG/iqA5+/A9WeM+QJYgaKWF8OP15ZnmyJgn quFPUbl0gYQwBFPcO0WinPzTyCI05elxQAe+UthL+eEznPkcGeUgrDz/bNfY5chCyXC0 7HHDtinyePFhPAELTrK4xojq0DIwwcAoiLPmapnTZ94UptwxEKPMHCbE//iOE+tn7NVi 0I/+wKCzPI6bFaYYQ+xvigU4TrO79Jyk3F3qq0E/wiprs511p/MosQtEehnRX7cuMyFP Hfq8nW0EB0daUya+tmehq1c9MJ5bXTwM/2+pceAQB8L/Hpwb4Xb46lWD2vRVi4BSI2pb bhRw== X-Gm-Message-State: AD7BkJIvhkj/38LEJQMaotUQzoj+/3DxLk2xDpa+qbrGxG03wuLeO+tx2Gsx/ijKE22DhOqx X-Received: by 10.28.184.78 with SMTP id i75mr4003177wmf.22.1457015257866; Thu, 03 Mar 2016 06:27:37 -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 i2sm40908632wje.22.2016.03.03.06.27.36 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 03 Mar 2016 06:27:37 -0800 (PST) From: Adrien Mazarguil To: dev@dpdk.org Date: Thu, 3 Mar 2016 15:27:12 +0100 Message-Id: <1457015237-2993-3-git-send-email-adrien.mazarguil@6wind.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1457015237-2993-1-git-send-email-adrien.mazarguil@6wind.com> References: <1456165083-28316-1-git-send-email-adrien.mazarguil@6wind.com> <1457015237-2993-1-git-send-email-adrien.mazarguil@6wind.com> Subject: [dpdk-dev] [PATCH v3 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: Thu, 03 Mar 2016 14:27:38 -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