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 761CB42609 for ; Tue, 19 Sep 2023 16:04:58 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6D98740A8B; Tue, 19 Sep 2023 16:04:58 +0200 (CEST) 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 A4F8E40277 for ; Tue, 19 Sep 2023 16:04:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695132296; 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=l3TnipYqyxed0ejt0wMlzHMLLSnCyz81eKYVA6eG8E0=; b=AFsb5JxJIusbNJ2RRBfnTchOHaf2N4VnqAKBgYQpJDzo0xxvHMqgoRS3brRve/SjjJey5V cKaigxVS+5sW7HBTKH9bgkklEztv/8um1jjlcPHPGbFMTIKeUjohzyTIKZARte28gbiosR XVRQvxXVpOPc2RM0iVmw8IKDT1R7hQ0= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-75-5x0zv6UDO_qye3khhdgCCA-1; Tue, 19 Sep 2023 10:04:52 -0400 X-MC-Unique: 5x0zv6UDO_qye3khhdgCCA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7E2823C0BE26; Tue, 19 Sep 2023 14:04:50 +0000 (UTC) Received: from dmarchan.redhat.com (unknown [10.45.225.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0C8F4C158BA; Tue, 19 Sep 2023 14:04:48 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: ktraynor@redhat.com, mkp@redhat.com, dexia.li@jaguarmicro.com, stable@dpdk.org, Qiming Yang , Qi Zhang , Kevin Liu Subject: [PATCH 2/2] net/ice: fix TSO with big segments Date: Tue, 19 Sep 2023 16:04:30 +0200 Message-ID: <20230919140430.3251493-2-david.marchand@redhat.com> In-Reply-To: <20230919140430.3251493-1-david.marchand@redhat.com> References: <20230919140430.3251493-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 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 Packets to be segmented with TSO are usually larger than MTU. Plus, a single segment for the whole packet may be used: in OVS case, an external rte_malloc'd buffer is used for packets received from vhost-user ports. Before this fix, TSO packets were dropped by net/ice with the following message: 2023-09-18T13:34:31.064Z|00020|dpdk(pmd-c31/id:22)|ERR|ice_prep_pkts(): INVALID mbuf: bad data_len=[2962] Remove the check on data_len. Besides, logging an error level message in a datapath function may slow down the whole application. It is better not to log anything. Fixes: ccf33dccf7aa ("net/ice: check illegal packet sizes") Cc: stable@dpdk.org Signed-off-by: David Marchand --- Note: there may be some followup patch later, as some additional check has been added in ice_prep_pkts. For context, see: http://inbox.dpdk.org/dev/CAJFAV8yOa3ShkVdEXHfnmOEmUTwV3e75Bu9U3OqpNc5usTt3Rw@mail.gmail.com/T/#u --- drivers/net/ice/ice_rxtx.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/net/ice/ice_rxtx.c b/drivers/net/ice/ice_rxtx.c index 64c4486b4b..80c4284200 100644 --- a/drivers/net/ice/ice_rxtx.c +++ b/drivers/net/ice/ice_rxtx.c @@ -3685,9 +3685,6 @@ ice_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts, int i, ret; uint64_t ol_flags; struct rte_mbuf *m; - struct ice_tx_queue *txq = tx_queue; - struct rte_eth_dev *dev = &rte_eth_devices[txq->port_id]; - uint16_t max_frame_size = dev->data->mtu + ICE_ETH_OVERHEAD; for (i = 0; i < nb_pkts; i++) { m = tx_pkts[i]; @@ -3704,11 +3701,8 @@ ice_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts, return i; } - /* check the data_len in mbuf */ - if (m->data_len < ICE_TX_MIN_PKT_LEN || - m->data_len > max_frame_size) { + if (m->pkt_len < ICE_TX_MIN_PKT_LEN) { rte_errno = EINVAL; - PMD_DRV_LOG(ERR, "INVALID mbuf: bad data_len=[%hu]", m->data_len); return i; } -- 2.41.0