Received: by 2002:ab2:6c55:0:b0:1fd:c486:4f03 with SMTP id v21csp457427lqp; Wed, 12 Jun 2024 06:53:12 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXrywJA+lWxkzcidT2k3zq7ZA7hPoopWwhWXjrPZ39UmZsHGa4ENm7rBACPjCgFCckOF3hQd6+k5OcSBQYHcfjZaUnVmhr1TZuONnIvpg== X-Google-Smtp-Source: AGHT+IEOyt/BKSq8kzWFw+ro7NodXMR2wd/mZwwZGPUxS7HV7PHe91b7/TtyH0WBsJHIcBkzvo9w X-Received: by 2002:a50:96d2:0:b0:57c:6871:e04d with SMTP id 4fb4d7f45d1cf-57ca977d020mr1335967a12.22.1718200391861; Wed, 12 Jun 2024 06:53:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718200391; cv=pass; d=google.com; s=arc-20160816; b=RWpjob0KCGB/w/Z3lcLzAGI0lrc74+Xc3gO87os7uuyjLwnWvc85HcsIm8UCXg0Ak0 Jdd5jQUNQTV4291OvXio0Kt0CncYHqcNINNRiyygvhB+WVv21YKWRQWD9DzOhavskcAA 2EWQ2phNwzRzN0kHWeBGGM0j0synf1Zdkg5AkI9GkN5KYFSUFFS8nFUUp+62hzcBQaUf pjWQ1b5sUWUhajriOxZlVokS6SclU7LiwxzTzo8Sp+DZRhI0JzKvys60rxXUwY3Tl3kz PO0oaYa6gQd8gdkay4ZnAYMLNW1I3bOUjhW0QfqU7BuJtp1RcmXZkeKlFcQKVpYJyzo7 6QJw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=vfSgv9/tpfHbWYJdCKz61kSsrvCLMtL8kuJRyvXKozg=; fh=j7UdCSvSbUmOxvkqY4yQZi9wqG46MeQhtGJgH3+ZkeE=; b=OqdXH0d/+c5SNPF+8jVyufUAy3wCmVB3PVUJwzKn9UcRlpNYfla8K/4HolN5sn3xqL FeiglJiRgiV8OP5QG/2y34GbdrulTJAYL/0AJhmTjgP05mt4hYG4SBE0H+Qt2NH/TBkt +APBBGIn8zDrvxzAwNI1upqrXwhvxDjS0BJZPkuCHNlRiABnZyww747ZDBotgjHaoDVY V4074jtBt9+2IWRy2cTYXQYqw80XeP+IFxrZAthEkYfdBGv69VGyeCY2iOP7hD4EPbds eA0HVTGJ3sPhDJazTFIynSJ85PtFpJOWZ3oyDtGBqCRzF1W4BGnKRrLcceQRLZEJ1AN2 t2+Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=QxmcjL46; arc=pass (i=1 spf=pass spfdomain=marvell.com dkim=pass dkdomain=marvell.com dmarc=pass fromdomain=marvell.com); spf=pass (google.com: domain of linux-kernel+bounces-211586-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-211586-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=marvell.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57c80c6fe8csi3577401a12.614.2024.06.12.06.53.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 06:53:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-211586-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=QxmcjL46; arc=pass (i=1 spf=pass spfdomain=marvell.com dkim=pass dkdomain=marvell.com dmarc=pass fromdomain=marvell.com); spf=pass (google.com: domain of linux-kernel+bounces-211586-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-211586-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=marvell.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 9CC221F264BB for ; Wed, 12 Jun 2024 13:46:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 96F0317C7D5; Wed, 12 Jun 2024 13:46:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=marvell.com header.i=@marvell.com header.b="QxmcjL46" Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 25D5417CA07; Wed, 12 Jun 2024 13:46:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=67.231.148.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718200000; cv=none; b=FAUlCiWHe+PGNh/Ml16JVRAonLlQ8rNtXVZYzkgymjl8HHcpr1PzjPMbH95V1SvnRSHUCZacJyxPKdO7xAcy/dCwJZGts1JThoPSazebK734W1kz/rASqn+5Mo1lhobO8KvyONOEhYnqnZVDdrhB9UgmrRINLvCtPcaCe4/bv4Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718200000; c=relaxed/simple; bh=l6JauifMwDADWOX0MI9XkCrKIjsUwmsm/PL6kduWNZE=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=iPc+y9oYB8hcfcE5gHERA4PG1dfTrNCLdlZ8BX9ANXzGAMv7sjUF6O28p3T6Pa1gG48VQIrMCKaif3sE39GVI/Dj5vDq9eP3/2r5aeHzLvibNS1d/M6hrd4NLPay6G9XK3Epo6fKsCTpsh214vsD6iqcvcaXwLfdZqb/YqtjXLs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=marvell.com; spf=pass smtp.mailfrom=marvell.com; dkim=pass (2048-bit key) header.d=marvell.com header.i=@marvell.com header.b=QxmcjL46; arc=none smtp.client-ip=67.231.148.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=marvell.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=marvell.com Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45CAdUMv019644; Wed, 12 Jun 2024 06:46:31 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h= cc:content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to; s=pfpt0220; bh=vfSgv9/tpfHbWYJdCKz61kS srvCLMtL8kuJRyvXKozg=; b=QxmcjL46DXMuew+PuR6lS5NjMJUG+I86X5NIECh 88X5FMkeuDXKxddRJiIE0V7kHsNyfDu2l0EdNOMXpQzQoCjKz6YvL/VRUBBuXkf2 jfyWkWAY1JEqwAs0hr6Un8MhkjZa94hFtSFG5Fm6G9afwlwWQaWy5u8KN+7XorXd t6xTinkRkFYcIQsmbV+zn7nqafVer2E4yQliZ4Vw7tE+cWexw+cXmtA28jes3hEg xeZ34eT1hfhpaMrQxSGYjWXs+uBvxg8wooMuOTfDEbsgxbfPb6KNa1kCuXNpMV1e zll0uPFb0n25ddL02N+xMVrMj7pTa26PP2HO123V36AiPAQ== Received: from dc6wp-exch02.marvell.com ([4.21.29.225]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3yq8qx0u2u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 12 Jun 2024 06:46:31 -0700 (PDT) Received: from DC6WP-EXCH02.marvell.com (10.76.176.209) by DC6WP-EXCH02.marvell.com (10.76.176.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Wed, 12 Jun 2024 06:46:30 -0700 Received: from bharat-OptiPlex-3070.marvell.com (10.69.176.80) by DC6WP-EXCH02.marvell.com (10.76.176.209) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Wed, 12 Jun 2024 06:46:25 -0700 From: Bharat Bhushan To: , , , , , , , , , , , , CC: Subject: [net-next,v4 0/8] cn10k-ipsec: Add outbound inline ipsec support Date: Wed, 12 Jun 2024 19:16:14 +0530 Message-ID: <20240612134622.2157086-1-bbhushan2@marvell.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: 8biBxeXItfoWX1HIztZt2Z1JP3WaqIad X-Proofpoint-ORIG-GUID: 8biBxeXItfoWX1HIztZt2Z1JP3WaqIad X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-12_07,2024-06-12_02,2024-05-17_01 This patch series adds outbound inline ipsec support on Marvell cn10k series of platform. One crypto hardware logical function (cpt-lf) per netdev is required for inline ipsec outbound functionality. Software prepare and submit crypto hardware (CPT) instruction for outbound inline ipsec crypto mode offload. The CPT instruction have details for encryption and authentication Crypto hardware encrypt, authenticate and provide the ESP packet to network hardware logic to transmit ipsec packet. First patch makes dma memory writable for in-place encryption, Second patch moves code to common file, Third patch disable backpressure on crypto (CPT) and network (NIX) hardware. Patch four onwards enables inline outbound ipsec. v3->v4: - Few error messages in datapath removed and some moved under netif_msg_tx_err(). - Added check for crypto offload (XFRM_DEV_OFFLOAD_CRYPTO) Thanks "Leon Romanovsky" for pointing out - Fixed codespell error as per comment from Simon Horman - Added some other cleanup comment from Kalesh Anakkur Purayil v2->v3: - Fix smatch and sparse erros (Comment from Simon Horman) - Fix build error with W=1 (Comment from Simon Horman) https://patchwork.kernel.org/project/netdevbpf/patch/20240513105446.297451-6-bbhushan2@marvell.com/ - Some other minor cleanup as per comment https://www.spinics.net/lists/netdev/msg997197.html v1->v2: - Fix compilation error to build driver a module - Use dma_wmb() instead of architecture specific barrier - Fix couple of other compilation warnings Bharat Bhushan (8): octeontx2-pf: map skb data as device writeable octeontx2-pf: Move skb fragment map/unmap to common code octeontx2-af: Disable backpressure between CPT and NIX cn10k-ipsec: Initialize crypto hardware for outb inline ipsec cn10k-ipsec: Add SA add/delete support for outb inline ipsec cn10k-ipsec: Process inline ipsec transmit offload cn10k-ipsec: Allow inline ipsec offload for skb with SA cn10k-ipsec: Enable outbound inline ipsec offload .../net/ethernet/marvell/octeontx2/af/mbox.h | 4 + .../ethernet/marvell/octeontx2/af/rvu_nix.c | 74 +- .../ethernet/marvell/octeontx2/nic/Makefile | 1 + .../marvell/octeontx2/nic/cn10k_ipsec.c | 1078 +++++++++++++++++ .../marvell/octeontx2/nic/cn10k_ipsec.h | 258 ++++ .../marvell/octeontx2/nic/otx2_common.c | 99 +- .../marvell/octeontx2/nic/otx2_common.h | 25 + .../marvell/octeontx2/nic/otx2_dcbnl.c | 3 + .../ethernet/marvell/octeontx2/nic/otx2_pf.c | 19 +- .../marvell/octeontx2/nic/otx2_txrx.c | 65 +- .../marvell/octeontx2/nic/otx2_txrx.h | 3 + .../ethernet/marvell/octeontx2/nic/otx2_vf.c | 10 +- 12 files changed, 1585 insertions(+), 54 deletions(-) create mode 100644 drivers/net/ethernet/marvell/octeontx2/nic/cn10k_ipsec.c create mode 100644 drivers/net/ethernet/marvell/octeontx2/nic/cn10k_ipsec.h -- 2.34.1