From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 993B143345 for ; Thu, 16 Nov 2023 14:24:57 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5A22740E7C; Thu, 16 Nov 2023 14:24:57 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 4C03C40DF5 for ; Thu, 16 Nov 2023 14:24:55 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1700141094; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LcE3lu8kO73BrHsX5lBNIpeKPpNEZ3YvSma9pJ8UikA=; b=c79nTfTw79T2slOj5WBo2swrKaSQBQOxcG+4UbjGZs25leAgho8rLoMsPTAjITBF30lseM H+tusyqQn/Y8jjRbFvYqkmZTuAOoYD3kmoXNEjwpvR+Gv11F5sIH29TmEQHkTaCRfz4nNF ZTH//Qx60ELdyVk2sbE2CUn6HdG7s+Q= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-357-I1tl989qPlqXD0zLwwADQw-1; Thu, 16 Nov 2023 08:24:53 -0500 X-MC-Unique: I1tl989qPlqXD0zLwwADQw-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5960B811E7E; Thu, 16 Nov 2023 13:24:53 +0000 (UTC) Received: from rh.Home (unknown [10.39.194.169]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7FFFB2166B28; Thu, 16 Nov 2023 13:24:52 +0000 (UTC) From: Kevin Traynor To: Qi Zhang Cc: Qiming Yang , dpdk stable Subject: patch 'net/ice: fix Tx preparation' has been queued to stable release 21.11.6 Date: Thu, 16 Nov 2023 13:23:23 +0000 Message-ID: <20231116132348.557257-41-ktraynor@redhat.com> In-Reply-To: <20231116132348.557257-1-ktraynor@redhat.com> References: <20231116132348.557257-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, FYI, your patch has been queued to stable release 21.11.6 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/21/23. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/kevintraynor/dpdk-stable This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable/commit/f4ef2095b0fc209e6e45936245bc11ac2e110936 Thanks. Kevin --- >From f4ef2095b0fc209e6e45936245bc11ac2e110936 Mon Sep 17 00:00:00 2001 From: Qi Zhang Date: Thu, 2 Nov 2023 10:22:07 -0400 Subject: [PATCH] net/ice: fix Tx preparation [ upstream commit 2f13ba5333b06589ba0e0e307dadcfaa95daf3dc ] 1. Check nb_segs > 8 for NO TSO case 2. Check nb_segs > Tx ring size for TSO case 3. report nb_mtu_seg_max and nb_seg_max in dev_info. Fixes: 17c7d0f9d6a4 ("net/ice: support basic Rx/Tx") Signed-off-by: Qi Zhang Acked-by: Qiming Yang --- drivers/net/ice/ice_ethdev.c | 2 ++ drivers/net/ice/ice_rxtx.c | 18 ++++++++++++++++-- drivers/net/ice/ice_rxtx.h | 2 ++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c index 30be64ac40..5e84894e5f 100644 --- a/drivers/net/ice/ice_ethdev.c +++ b/drivers/net/ice/ice_ethdev.c @@ -3773,4 +3773,6 @@ ice_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) .nb_min = ICE_MIN_RING_DESC, .nb_align = ICE_ALIGN_RING_DESC, + .nb_mtu_seg_max = ICE_TX_MTU_SEG_MAX, + .nb_seg_max = ICE_MAX_RING_DESC, }; diff --git a/drivers/net/ice/ice_rxtx.c b/drivers/net/ice/ice_rxtx.c index 9db511acdc..7578bac03e 100644 --- a/drivers/net/ice/ice_rxtx.c +++ b/drivers/net/ice/ice_rxtx.c @@ -3485,5 +3485,5 @@ ice_check_empty_mbuf(struct rte_mbuf *tx_pkt) uint16_t -ice_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts, +ice_prep_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) { @@ -3496,7 +3496,21 @@ ice_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts, ol_flags = m->ol_flags; - if (ol_flags & RTE_MBUF_F_TX_TCP_SEG && + if (!(ol_flags & RTE_MBUF_F_TX_TCP_SEG) && + /** + * No TSO case: nb->segs, pkt_len to not exceed + * the limites. + */ + (m->nb_segs > ICE_TX_MTU_SEG_MAX || + m->pkt_len > ICE_FRAME_SIZE_MAX)) { + rte_errno = EINVAL; + return i; + } else if (ol_flags & RTE_MBUF_F_TX_TCP_SEG && + /** TSO case: tso_segsz, nb_segs, pkt_len not exceed + * the limits. + */ (m->tso_segsz < ICE_MIN_TSO_MSS || m->tso_segsz > ICE_MAX_TSO_MSS || + m->nb_segs > + ((struct ice_tx_queue *)tx_queue)->nb_tx_desc || m->pkt_len > ICE_MAX_TSO_FRAME_SIZE)) { /** diff --git a/drivers/net/ice/ice_rxtx.h b/drivers/net/ice/ice_rxtx.h index 2f0f050b58..3815c1cec3 100644 --- a/drivers/net/ice/ice_rxtx.h +++ b/drivers/net/ice/ice_rxtx.h @@ -49,4 +49,6 @@ extern int ice_timestamp_dynfield_offset; #define ICE_RX_MAX_DATA_BUF_SIZE (16 * 1024 - 128) +#define ICE_TX_MTU_SEG_MAX 8 + typedef void (*ice_rx_release_mbufs_t)(struct ice_rx_queue *rxq); typedef void (*ice_tx_release_mbufs_t)(struct ice_tx_queue *txq); -- 2.41.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-11-16 13:21:53.539765767 +0000 +++ 0041-net-ice-fix-Tx-preparation.patch 2023-11-16 13:21:52.505946535 +0000 @@ -1 +1 @@ -From 2f13ba5333b06589ba0e0e307dadcfaa95daf3dc Mon Sep 17 00:00:00 2001 +From f4ef2095b0fc209e6e45936245bc11ac2e110936 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 2f13ba5333b06589ba0e0e307dadcfaa95daf3dc ] + @@ -11 +12,0 @@ -Cc: stable@dpdk.org @@ -22 +23 @@ -index 6ef06b9926..3ccba4db80 100644 +index 30be64ac40..5e84894e5f 100644 @@ -25 +26 @@ -@@ -3919,4 +3919,6 @@ ice_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) +@@ -3773,4 +3773,6 @@ ice_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) @@ -33 +34 @@ -index ee9cb7b955..73e47ae92d 100644 +index 9db511acdc..7578bac03e 100644 @@ -36 +37 @@ -@@ -3680,5 +3680,5 @@ ice_check_empty_mbuf(struct rte_mbuf *tx_pkt) +@@ -3485,5 +3485,5 @@ ice_check_empty_mbuf(struct rte_mbuf *tx_pkt) @@ -43 +44 @@ -@@ -3691,7 +3691,21 @@ ice_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts, +@@ -3496,7 +3496,21 @@ ice_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts, @@ -67 +68 @@ -index 268289716e..bd2c4abec9 100644 +index 2f0f050b58..3815c1cec3 100644 @@ -70,2 +71,2 @@ -@@ -57,4 +57,6 @@ extern int ice_timestamp_dynfield_offset; - #define ICE_HEADER_SPLIT_ENA BIT(0) +@@ -49,4 +49,6 @@ extern int ice_timestamp_dynfield_offset; + #define ICE_RX_MAX_DATA_BUF_SIZE (16 * 1024 - 128)