Received: by 2002:ab2:6f44:0:b0:1fd:c486:4f03 with SMTP id l4csp215568lqq; Thu, 13 Jun 2024 00:21:11 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUE8pMntjfSqnr96ZyuaRRj+wUWxMyDlxoHo/cHmvmM0TCiGjEEvZvNtXRkr6Ok6gym/K4F42QkQTnuDSwBn4tDZD9ZoHBj7/88vOphWg== X-Google-Smtp-Source: AGHT+IFsj+gOvQQBNFzuC3cqewVcsP1+R5HBdes62Tjw8rgcydc7QrKcGSqZqXOHOiPSp+nKtCRv X-Received: by 2002:a05:6870:f622:b0:258:37e7:a1d0 with SMTP id 586e51a60fabf-25837e7dd72mr275464fac.30.1718263271368; Thu, 13 Jun 2024 00:21:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718263271; cv=pass; d=google.com; s=arc-20160816; b=FzNwIdUALGFeRybyNSSORszc4Fhls0S4THpIQlj8ZnV+xlGmPeyP//Y5YZD++bgrny eN/Irt2dP+KGi1kEEZyXnDvBX3N4bw+ivySlZHJSf04ti7sMAZ77XYnSfGMKhSYqjnXh TKYrKQ9345juVXkmrs4VyROgLQUGCuhRbt0qetTWwjzVmdXuDIDQW0MYm9XzMgwUQU54 9B5RuR1get+uPO/azdT4a+OLXRS1MTfoJCjNhqrOM/mBvXkMhQdZHChuChOccJ88wQrB MfcO8DCg/6mNlqdmPLxxsgbaUQh/pTurfQrtJNF8/zK1heDAksXLK2nVpsmgMIsFph7r /qDQ== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=BhnHh/JpPAcj1s1x841oMiqX3u4Ui69weo3oOd3w4XM=; fh=j7UdCSvSbUmOxvkqY4yQZi9wqG46MeQhtGJgH3+ZkeE=; b=rezyxCE17ogZiUsOx+ajSxFVLIgI1dfB3PyjIcPLBx1WKHIlToCZ5DiQoj+14IYNFM OH9arvde6PYzbegcqRbYH6um8ZxfN5gEp5Y1USzO1VbqvoE7XXCMhjUTWq8UpaF8CkZy pgmRhUjmJXeKcMYQ1/vPfzFRl+DNbZmu3jvRli+A6guntwph18zxhNm4bA+xbE+Lsrx9 5ypZv26oG/fdYFq084ARKmFAm9WgCR4YZ7LJRT/VloQ1R/n7GRBMk/ElhoNU+/N8NsfA u7DaTPUBPYmI5kMQ3BTTFAaaqzfM5lgR2TFAqKHGcioUuTYr8e4hnMtD6ck6rR1mBgou w+KQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=VFsXIyvG; 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-212678-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-212678-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=marvell.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d2e1a72fcca58-705cc961e28si885946b3a.122.2024.06.13.00.21.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jun 2024 00:21:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-212678-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=VFsXIyvG; 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-212678-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-212678-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 0FCBCB21409 for ; Thu, 13 Jun 2024 07:21:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 05ED46F2F2; Thu, 13 Jun 2024 07:20:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=marvell.com header.i=@marvell.com header.b="VFsXIyvG" Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) (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 AE6B05914A; Thu, 13 Jun 2024 07:20:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=67.231.156.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718263254; cv=none; b=ar+AuwbcJ8daBAL2V+e5r+tiaVCPxckeIM/DDi1Mh2PmCUeGva43Bk8YowWR5Z46URMoQ/eGRjA/yAJmH1rYczfFSCtbG7jYKpxh1ysvM0SDl2NKfBfn+DJL5yCaa2LeL39UQVAME9LEQuNrkMin2oHtfdr+TcWwaHbK2R1EzUs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718263254; c=relaxed/simple; bh=HIsXKak4myaF77luhn0CUtjKAUGTcQ0It6dOSzQBOLQ=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ueRFFoWMI6bE7eO0toS8jFMI4CmnBjTg3AOdGkH4VNSn3AG9edtHFFh0gOP5fjlzaVHXccCFlTA1swbrqYDEvhZxtw0oUEfZSxYnrK16K31YgK+YtInlroAz2+EXYI274Ush6eAoPgOFjS9F08c1NLdXpPciRFb+V/4uySTUcP0= 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=VFsXIyvG; arc=none smtp.client-ip=67.231.156.173 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 (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45D0Anoj019119; Thu, 13 Jun 2024 00:20:26 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pfpt0220; bh=B hnHh/JpPAcj1s1x841oMiqX3u4Ui69weo3oOd3w4XM=; b=VFsXIyvGXMJpfH9pB 0IVoH8ci3Ryyb1GNbOoASINQetKHz9pJyyhVd+nMTRmGVL/wqs1mucZEZBFGkM4l xn5JR4DKxvQMV0T53qciLEhSZJZZiq9H/HSoVMCzsYRcGtDE0Mf5D+TVKUmYvkKd awCxSc+Ya3hz0c5Bby5I0kmAGK36IuuDghGxuSMU6v+b2uyeAIM/UQRBqtAo+Mp5 fQ5KTLR8Kk4psUpEUcoI3uLUk2ddrjbBXf1tqIDWNUkFGMrq8/5rSbhZ4GuZ6MyC Aeyb/Xjf0TD4CRzRs3hIM/IblEo1wEBDnagiWYC3irpr41jEIVDvyKG4CvLiLcAX 50oJA== Received: from dc5-exch05.marvell.com ([199.233.59.128]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3yq8syw4kf-6 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 13 Jun 2024 00:20:26 -0700 (PDT) Received: from DC5-EXCH05.marvell.com (10.69.176.209) by DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Thu, 13 Jun 2024 00:20:06 -0700 Received: from bharat-OptiPlex-3070.marvell.com (10.69.176.80) by DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Thu, 13 Jun 2024 00:20:02 -0700 From: Bharat Bhushan To: , , , , , , , , , , , , CC: Subject: [net-next,v5 1/8] octeontx2-pf: map skb data as device writeable Date: Thu, 13 Jun 2024 12:49:48 +0530 Message-ID: <20240613071955.2280099-2-bbhushan2@marvell.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240613071955.2280099-1-bbhushan2@marvell.com> References: <20240613071955.2280099-1-bbhushan2@marvell.com> 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: 3WAtGCLCpm8x4AhqR3A572YtzHIjGzVH X-Proofpoint-ORIG-GUID: 3WAtGCLCpm8x4AhqR3A572YtzHIjGzVH 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_12,2024-06-13_01,2024-05-17_01 Crypto hardware need write permission when doing inline in-place encrypt or decrypt operation on skb-data. So map this memory as device read-write. Signed-off-by: Bharat Bhushan --- drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c index a16e9f244117..847052b57d9b 100644 --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c @@ -98,7 +98,7 @@ static dma_addr_t otx2_dma_map_skb_frag(struct otx2_nic *pfvf, offset = skb_frag_off(frag); *len = skb_frag_size(frag); } - return otx2_dma_map_page(pfvf, page, offset, *len, DMA_TO_DEVICE); + return otx2_dma_map_page(pfvf, page, offset, *len, DMA_BIDIRECTIONAL); } static void otx2_dma_unmap_skb_frags(struct otx2_nic *pfvf, struct sg_list *sg) @@ -107,7 +107,7 @@ static void otx2_dma_unmap_skb_frags(struct otx2_nic *pfvf, struct sg_list *sg) for (seg = 0; seg < sg->num_segs; seg++) { otx2_dma_unmap_page(pfvf, sg->dma_addr[seg], - sg->size[seg], DMA_TO_DEVICE); + sg->size[seg], DMA_BIDIRECTIONAL); } sg->num_segs = 0; } -- 2.34.1