From patchwork Fri Apr 5 14:45:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 139127 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id CF96C43E06; Fri, 5 Apr 2024 16:46:26 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A7FAA40633; Fri, 5 Apr 2024 16:46:24 +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 D13A24029C for ; Fri, 5 Apr 2024 16:46:22 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1712328382; 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=RtC5jXApKY6IYlWOW2A5EQJPQ9UakXkhFCPFE23EBI4=; b=JjN0mLqknko0AHRE6MF4U83V4ShgycM/+PXOOTQ0XyF4ry4NVzlbCB6ZqQmLU9cAT3Ymcp uHqp4GCG9pFqY18STNBfPobkYfKeu2n1Or9kPLbPp9fABSXjjUsvSE4fxnkSpif+KCMPIv n8m4Qk/jMGhM/+ptkcAz7bY6tnLVZrM= 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-237-B0wIKmh0OTSp67vb7GW5lQ-1; Fri, 05 Apr 2024 10:46:19 -0400 X-MC-Unique: B0wIKmh0OTSp67vb7GW5lQ-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (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 91C47101A521; Fri, 5 Apr 2024 14:46:18 +0000 (UTC) Received: from dmarchan.redhat.com (unknown [10.45.225.49]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4C8B9492BCB; Fri, 5 Apr 2024 14:46:17 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: thomas@monjalon.net, ferruh.yigit@amd.com, Qi Zhang , Murphy Yang Subject: [PATCH v2 1/8] net/ice: fix check for outer UDP checksum offload Date: Fri, 5 Apr 2024 16:45:55 +0200 Message-ID: <20240405144604.906695-2-david.marchand@redhat.com> In-Reply-To: <20240405144604.906695-1-david.marchand@redhat.com> References: <20240405125039.897933-1-david.marchand@redhat.com> <20240405144604.906695-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org ICE_TX_CTX_EIPT_NONE == 0. There is a good chance that !(anything & 0) is true :-). While removing this noop check is doable, let's check that the descriptor does contain a outer ip type. Fixes: 2ed011776334 ("net/ice: fix outer UDP Tx checksum offload") Signed-off-by: David Marchand Reviewed-by: Bruce Richardson --- Changes since v1: - fix inverted check, --- drivers/net/ice/ice_rxtx.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/ice/ice_rxtx.c b/drivers/net/ice/ice_rxtx.c index 13aabe97a5..40471306b4 100644 --- a/drivers/net/ice/ice_rxtx.c +++ b/drivers/net/ice/ice_rxtx.c @@ -2751,9 +2751,9 @@ ice_parse_tunneling_params(uint64_t ol_flags, * Calculate the tunneling UDP checksum. * Shall be set only if L4TUNT = 01b and EIPT is not zero */ - if (!(*cd_tunneling & ICE_TX_CTX_EIPT_NONE) && - (*cd_tunneling & ICE_TXD_CTX_UDP_TUNNELING) && - (ol_flags & RTE_MBUF_F_TX_OUTER_UDP_CKSUM)) + if ((*cd_tunneling & ICE_TXD_CTX_QW0_EIPT_M) && + (*cd_tunneling & ICE_TXD_CTX_UDP_TUNNELING) && + (ol_flags & RTE_MBUF_F_TX_OUTER_UDP_CKSUM)) *cd_tunneling |= ICE_TXD_CTX_QW0_L4T_CS_M; }