Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1615163pxb; Mon, 11 Oct 2021 09:31:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy0299qTtDfoI0/hFDZ1esUhCfiWx6s/6KrXg8LwlFPXC2Wa+7v+ymVyEfwPbkZOXhAE7lQ X-Received: by 2002:a05:6a00:2306:b0:44c:6d97:5a5e with SMTP id h6-20020a056a00230600b0044c6d975a5emr26936611pfh.84.1633969919506; Mon, 11 Oct 2021 09:31:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633969919; cv=none; d=google.com; s=arc-20160816; b=AD8qSvEBTioDT9J92zRHL9WheNMaCInECmHbky8JnCw7leAZ+kcvpv90beRKNAtLah yvN9SYB7P5EfZp2CWMx1GtccOBfNopP1J3ul1fRtD+aId/7ZqNG0KKaMPLuFb86s6g6N 3BFWgWF0OjUplNi2gW6WICYKCY5Wm1nUQQAgfUTq3buDQRrotlyF9A8O5GNo/yTyCwOH 2jMGR8zxew/78oUJVBxhd8R9shpk+O+OfLDk73I6SziV5+AsvK523VtnmTCuur04pPNC b5DlVt05pQQb/Xmw4Mwu7FbpF8fYO/JEXkmE0qfia1jbHMDw7pq7Lgb8lhOetLxk6GHl 4TVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=T5S+voxIdRs/CFCtM8PtRFcgHN0VrrZnv8og2agpYS0=; b=louj7lkwW40Vjy9z4gnMuHKJ8S10/ZTZK2g0MBM4mlNs0vWMzIl7PQKjetHsQzdKpA CnbAp93+56FVAYJ9H/VVIzfU59JlrtgGx2wocvKOTN1c/NMv18HVjIzxSWxuKBUlg1z/ O5AtOU2WmkJJx2YS4yAJMNeVb9OvNNzqcBMucjGknDFXrZN8+9vs9NJQ5MOUcNrx7+YF ZCA+2oUF4+kJKYz5r/12MtNCw7VR6z+GwvK2/BdBVt3rQ/DqMqXSRRsE9Py2VxBInJrf kUVQ09diwj/0aojg6v9GwshF8wG78Ta63PZHPbw/wasDOVftF3bfpBLkRT+M74KgVRk1 D01g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xnomW9qv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l184si11271868pfl.52.2021.10.11.09.31.46; Mon, 11 Oct 2021 09:31:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xnomW9qv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238035AbhJKN7u (ORCPT + 99 others); Mon, 11 Oct 2021 09:59:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:47086 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237099AbhJKN56 (ORCPT ); Mon, 11 Oct 2021 09:57:58 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id EA39D60F11; Mon, 11 Oct 2021 13:54:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1633960476; bh=rc5GRsNpvm/GFbpZM6yosk8RwXPRH/YcaoCm5CZ/KdM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xnomW9qvP3V95aqzDyb7kDljKl4wYmAzuf+Y6fxg6D6Q4OlW8XA0atbcYXbdKKIW8 RnC6txFwu224kbIl3VDtXDQCC56KN3o+SHfFY7VkIyEnIO8ap52Qiy2LZDMMyJ6++z ZMu6VCcBy9bIfMlDUvVfEHp3lKZOzTTvzza0FmLQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Raed Salem , Saeed Mahameed , Sasha Levin Subject: [PATCH 5.10 38/83] net/mlx5e: IPSEC RX, enable checksum complete Date: Mon, 11 Oct 2021 15:45:58 +0200 Message-Id: <20211011134509.704779170@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211011134508.362906295@linuxfoundation.org> References: <20211011134508.362906295@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Raed Salem [ Upstream commit f9a10440f0b1f33faa792af26f4e9823a9b8b6a4 ] Currently in Rx data path IPsec crypto offloaded packets uses csum_none flag, so checksum is handled by the stack, this naturally have some performance/cpu utilization impact on such flows. As Nvidia NIC starting from ConnectX6DX provides checksum complete value out of the box also for such flows there is no sense in taking csum_none path, furthermore the stack (xfrm) have the method to handle checksum complete corrections for such flows i.e. IPsec trailer removal and consequently checksum value adjustment. Because of the above and in addition the ConnectX6DX is the first HW which supports IPsec crypto offload then it is safe to report csum complete for IPsec offloaded traffic. Fixes: b2ac7541e377 ("net/mlx5e: IPsec: Add Connect-X IPsec Rx data path offload") Signed-off-by: Raed Salem Signed-off-by: Saeed Mahameed Signed-off-by: Sasha Levin --- drivers/net/ethernet/mellanox/mlx5/core/en_rx.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c index f327b78261ec..117a59341453 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c @@ -999,14 +999,9 @@ static inline void mlx5e_handle_csum(struct net_device *netdev, goto csum_unnecessary; if (likely(is_last_ethertype_ip(skb, &network_depth, &proto))) { - u8 ipproto = get_ip_proto(skb, network_depth, proto); - - if (unlikely(ipproto == IPPROTO_SCTP)) + if (unlikely(get_ip_proto(skb, network_depth, proto) == IPPROTO_SCTP)) goto csum_unnecessary; - if (unlikely(mlx5_ipsec_is_rx_flow(cqe))) - goto csum_none; - stats->csum_complete++; skb->ip_summed = CHECKSUM_COMPLETE; skb->csum = csum_unfold((__force __sum16)cqe->check_sum); -- 2.33.0