Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp1956986lqo; Mon, 13 May 2024 03:55:36 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWHoO15JMDRUTqjohMI+a7lRfF5Gt7YIfe81UswrtdH7aqtPmlLJkx207yMU1maYsN6XCg251ORW1VO0Pr5BG4mFPTxoYW1ntTBi1uf+w== X-Google-Smtp-Source: AGHT+IFS3L35l8zs8hBOnSKo2GLVnRbOcsVsf56D7UX8EFcdwTcmbS56owLzn/pr97ZyXYDf3b0T X-Received: by 2002:a50:c010:0:b0:572:7e9f:c124 with SMTP id 4fb4d7f45d1cf-5734d59040bmr6469488a12.9.1715597736188; Mon, 13 May 2024 03:55:36 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715597736; cv=pass; d=google.com; s=arc-20160816; b=q3t9PfeDR1d9eEpmyFQ6jeFhSdacs8v7qRvv8alAblffd/wmXSo20dH//AK1T0kerl ro2YcPUd3HibUu61GOY6MryRPoPn17mNfFi6fxo43Hbao2+cvRCOKqhKV6sf0uSBh8dE IcvIDm+vo+7TZ10lP1D2XrWnq37bJQwP5MNxKpeUHb4huPS3o8HPqsGpb6VYel28NoF5 ikw67eWR7rqYNxAQUWKga2+lOVC88ZU6V/FulbeHa9OsDoqmiqCoeDPwo+/hpMc3ktLl 01qvaPpYJbrnhYLh0a/tBKvX/K7KXHiIJjwElfZkzd2M4RnLdJ6sJsZCscZcltfI3xeZ VXgQ== 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=bmjP/KIb7yRXxywpA+4EodyCgFIr3x04cvs2nu37av8=; b=IStLdidTHbKoBN1lcBVpPApb3ELOp/eYsnXay7UOsUt3mwMmlWdQH8AmO5hxpFh1z9 K1Nat7Zs7EqXSIF/UTwsGsK3cUhbaqDl4R+XjGRY9phIcCTdnkYwrwa77ID97+J/Fudj ++NBt1SmYtlY4ESJRTnDdH3qiie6MO0fTCKuhFyagH0L8brwHAPU/9PihDIg/JOUv6gs nGhU/1VguKrmsp4fqYL9CXZxb3d1doHWeRBkAV1nJi5lYarHaLG5al4jVBJ4Ir/1buEa y1nxgJRD12+oz0tY0fwVUo+0hjVyLiN7V70DkvW5sF6WHtBmUT/xIpjaTra+wl+Hskf+ xlyg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=fzWqm1OO; 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-177479-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-177479-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-5733c32c7bfsi4815545a12.449.2024.05.13.03.55.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 May 2024 03:55:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-177479-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=fzWqm1OO; 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-177479-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-177479-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 E6D561F21C09 for ; Mon, 13 May 2024 10:55:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DF98B14D28E; Mon, 13 May 2024 10:55:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=marvell.com header.i=@marvell.com header.b="fzWqm1OO" 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 3887E14B06E; Mon, 13 May 2024 10:55:08 +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=1715597711; cv=none; b=YeGZxygQhL6Rdt9xOUUOVSPObyn0IBVAc5rqviVaQsI9gBLlD8yJ0gfv66REmx/m48+gpih3noHwr91gp8vhOVb42pbl5PVWuU3+iKkkk2LnsOYXoXTdo2NVgNlKk/4ELOHBpdDNYnr3826iuOXpHnWYZpEAUauhUqPAaSEKok4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715597711; c=relaxed/simple; bh=HIsXKak4myaF77luhn0CUtjKAUGTcQ0It6dOSzQBOLQ=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=qKeFNT4f5ZzmcP3NjM98VJU9DqhZonp/tn8+kz/O+fs/Y3mVjsglZh4SsLVJG0FXfFEPgfNaf1hX6n9/3UyGNb/8XpsjtNd9K8zZ8rMq/JCXYDrM0KBrDPvrCqC/2R4qRiAgZk+LAkBRKMYlo7n1SFzzN6kEhjb4FFYlFuGZzEA= 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=fzWqm1OO; 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 44D9fi2E014208; Mon, 13 May 2024 03:55:01 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s= pfpt0220; bh=BhnHh/JpPAcj1s1x841oMiqX3u4Ui69weo3oOd3w4XM=; b=fzW qm1OOlE2WWIBq8m3G+DdhmEKHtJkkkAEfJvD7G7pPMAH+erVGG4ScU4HLSxOtFoc PKvxGus+qlMfbnoMtJGN1Vo86AhiMVVrH8W4y+iPn38aUuGt6DeK54PQCih/Uz6r JOcbY3AidE0BYxNylj155BOycGVw94XIyTBBJuNPxWRqsk5KUbkv5w4dZDmZc683 504r5k0pp5ezQi/iqgn12THpvG/GCbbXO/At37DzwzaPrD1lrxL+VkXc1L8O4udD 1hylQS3MCWSZ03VFMHn0mEUowLVbuVQOT4t2VEjpKQEqwARtG/N2iOWg9FE7FVHJ Fypldl+uDPePASTAV1A== Received: from dc6wp-exch02.marvell.com ([4.21.29.225]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3y3gf4g5gg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 13 May 2024 03:55:01 -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; Mon, 13 May 2024 03:54:59 -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; Mon, 13 May 2024 03:54:54 -0700 From: Bharat Bhushan To: , , , , , , , , , , , , CC: Bharat Bhushan Subject: [net-next,v2 1/8] octeontx2-pf: map skb data as device writeable Date: Mon, 13 May 2024 16:24:39 +0530 Message-ID: <20240513105446.297451-2-bbhushan2@marvell.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240513105446.297451-1-bbhushan2@marvell.com> References: <20240513105446.297451-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-ORIG-GUID: l9N_sv-mOFJ5drKP5IW-1-rS52IGbWL4 X-Proofpoint-GUID: l9N_sv-mOFJ5drKP5IW-1-rS52IGbWL4 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.650,FMLib:17.11.176.26 definitions=2024-05-13_07,2024-05-10_02,2023-05-22_02 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