From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yongseok Koh Subject: Re: [PATCH] net/mlx5: fix packet inline on Tx queue wraparound Date: Mon, 11 Mar 2019 19:58:02 +0000 Message-ID: <44AC735D-DF85-4883-A612-979D6D6DD59C@mellanox.com> References: <20190310081410.94830-1-shahafs@mellanox.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Cc: "dev@dpdk.org" , "stable@dpdk.org" To: Shahaf Shuler Return-path: In-Reply-To: <20190310081410.94830-1-shahafs@mellanox.com> Content-Language: en-US Content-ID: List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > On Mar 10, 2019, at 12:14 AM, Shahaf Shuler wrote: >=20 > Inlining a packet to WQE that cross the WQ wraparound, i.e. the WQE > starts on the end of the ring and ends on the beginning, is not > supported and blocked by the data path logic. >=20 > However, in case of TSO, an extra inline header is required before > inlining. This inline header is not taken into account when checking if > there is enough room left for the required inline size. > On some corner cases were > (ring_tailroom - inline header) < inline size < ring_tailroom , > this can lead to WQE being written outsize of the ring buffer. >=20 > Fixing it by always assuming the worse case that inline of packet will > require the inline header. >=20 > Fixes: 3f13f8c23a7c ("net/mlx5: support hardware TSO") > Cc: stable@dpdk.org >=20 > Signed-off-by: Shahaf Shuler > --- Acked-by: Yongseok Koh =20 Thanks > drivers/net/mlx5/mlx5_rxtx.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) >=20 > diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c > index baa4079c14..38ce0e29a2 100644 > --- a/drivers/net/mlx5/mlx5_rxtx.c > +++ b/drivers/net/mlx5/mlx5_rxtx.c > @@ -693,7 +693,8 @@ mlx5_tx_burst(void *dpdk_txq, struct rte_mbuf **pkts,= uint16_t pkts_n) > RTE_CACHE_LINE_SIZE); > copy_b =3D (addr_end > addr) ? > RTE_MIN((addr_end - addr), length) : 0; > - if (copy_b && ((end - (uintptr_t)raw) > copy_b)) { > + if (copy_b && ((end - (uintptr_t)raw) > > + (copy_b + sizeof(inl)))) { > /* > * One Dseg remains in the current WQE. To > * keep the computation positive, it is > --=20 > 2.12.0 >=20