From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from proxy.6wind.com (host.76.145.23.62.rev.coltfrance.com [62.23.145.76]) by dpdk.org (Postfix) with ESMTP id E675F293C for ; Tue, 24 Jan 2017 16:22:43 +0100 (CET) Received: from glumotte.dev.6wind.com (unknown [10.16.0.195]) by proxy.6wind.com (Postfix) with ESMTP id 65FE727486 for ; Tue, 24 Jan 2017 16:22:39 +0100 (CET) From: Olivier Matz To: dev@dpdk.org Date: Tue, 24 Jan 2017 16:19:25 +0100 Message-Id: <1485271173-13408-1-git-send-email-olivier.matz@6wind.com> X-Mailer: git-send-email 2.8.1 Subject: [dpdk-dev] [RFC 0/8] mbuf: structure reorganization X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jan 2017 15:22:44 -0000 Based on discussion done in [1], this patchset reorganizes the mbuf. The main changes are: - reorder structure to increase vector performance on some non-ia platforms. - add a 64bits timestamp field in the 1st cache line - m->next, m->nb_segs, and m->refcnt are always initialized for mbufs in the pool, avoiding the need of setting m->next (located in the 2nd cache line) in the Rx path for mono-segment packets. - change port and nb_segs to 16 bits - move seqn in the 2nd cache line Things discussed but not done in the patchset: - move refcnt and nb_segs to the 2nd cache line: many drivers sets them in the Rx path, so it could introduce a performance regression, or it would require to change all the drivers, which is not an easy task. - remove the m->port field: too much impact on many examples and libraries, and some people highlighted they are using it. - moving m->next in the 1st cache line: there is not enough room, and having it set to NULL for unused mbuf should remove the need for it. - merge seqn and timestamp together in a union: we could imagine use cases were both are activated. There is no flag indicating the presence of seqn, so it looks preferable to keep them separated for now. I made some basic performance tests (ixgbe) and see no regression, but the patchset requires more testing. [1] http://dpdk.org/ml/archives/dev/2016-October/049338.html Jerin Jacob (1): mbuf: make rearm data address naturally aligned Olivier Matz (7): mbuf: make segment prefree function public mbuf: make raw free function public mbuf: set mbuf fields while in pool net: don't touch mbuf next or nb segs on Rx mbuf: use 2 bytes for port and nb segments mbuf: move sequence number in second cache line mbuf: add a timestamp field app/test-pmd/csumonly.c | 4 +- drivers/net/ena/ena_ethdev.c | 2 +- drivers/net/enic/enic_rxtx.c | 2 +- drivers/net/fm10k/fm10k_rxtx.c | 6 +- drivers/net/fm10k/fm10k_rxtx_vec.c | 9 +- drivers/net/i40e/i40e_rxtx_vec_common.h | 6 +- drivers/net/i40e/i40e_rxtx_vec_sse.c | 11 +- drivers/net/ixgbe/ixgbe_rxtx.c | 10 +- drivers/net/ixgbe/ixgbe_rxtx_vec_common.h | 6 +- drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c | 9 -- drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c | 9 -- drivers/net/mlx5/mlx5_rxtx.c | 11 +- drivers/net/mpipe/mpipe_tilegx.c | 3 +- drivers/net/null/rte_eth_null.c | 2 - drivers/net/virtio/virtio_rxtx.c | 3 - drivers/net/virtio/virtio_rxtx_simple.h | 6 +- .../linuxapp/eal/include/exec-env/rte_kni_common.h | 5 +- lib/librte_mbuf/rte_mbuf.c | 4 + lib/librte_mbuf/rte_mbuf.h | 114 ++++++++++++++++----- 19 files changed, 124 insertions(+), 98 deletions(-) -- 2.8.1