Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp2659947lqb; Tue, 28 May 2024 06:54:54 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVQqKBmtDwXfTHOJJTMMCKM9cg2BN+18lmzvoUvI/cpYWc0jd8rjVZYLjOsuwTrQmM2bfIOSu2czs69jFMz98DFYs4l4alvFeNnMQI4tQ== X-Google-Smtp-Source: AGHT+IF/qfsZhNfSu4HxmIacSx/SDudscGGAehUYrl27X/xySi4gYuuBZWH6z1MCpQjVFVrlOrKr X-Received: by 2002:a05:620a:5dca:b0:794:b8dd:b921 with SMTP id af79cd13be357-794b8ddb984mr801847385a.64.1716904493735; Tue, 28 May 2024 06:54:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716904493; cv=pass; d=google.com; s=arc-20160816; b=l+LfGoG/5R8i36UVasplVUs08A6x/Tb9gNebBhcS2TtGkKcHKbhmxkXD0NBL47hG99 ClLwt+fcLe1LTH+igVOt65wWLqHYpnd8z26hG/BWjHJyVk6eloUzFNQ+05iMSnEGSHMV yl9TQgNpGJJl2VWT614Pm5pDxQRQlxv7DtmAmNH+6jyD1rUxs3toMPD5SFhvbX8SmKGb Q4KIfZHZa2ouj4N+9/7x2CtP59JsiilRt/QzK8o2jbaZcSrnsT9WCYGYAIAsVqdqRP11 0B/4OLJ8qIpzloIE/8lnSEFxH40dlgGH1rgwBm3K6QMRHGdBI+wrd8w+F4fZASRP9jcS 5FCg== 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=fMgImE3THA+q/dHw0Ox0vPXJCYxEUB++uNTlwvZrZgl4KjoQd+Fw3WBqlDMDsBr5UT slCg47H22P7n4+eeruYUSUHt6c6OAm0sNKZREwV97bUTRyJ9s2+ZgGe+SVAInXPUoI3D ug5BzZq4TXg4XSlQfQABiRol/bYKH5geJMEpJk/NE8njlPFptJpFq0YhWXgUVd9XkDx6 LXdqDUw+AhH6vB7Ws1LLF5JdNTy4KBqp7YsBTulgtkeSV6IHfcLXUm/Iyy4+48pxIp5f jeL2/d1MxvzA3E7PnR31ancbfywWaHcehYqOuH01kQQPH2VhMODL7Hbdq0+LrvSMyX51 SABQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b="C2AM5D/c"; 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-192468-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-192468-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=marvell.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id af79cd13be357-794abd4cb5asi1010482285a.609.2024.05.28.06.54.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 May 2024 06:54:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-192468-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b="C2AM5D/c"; 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-192468-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-192468-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 61E8E1C2290B for ; Tue, 28 May 2024 13:54:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3C77D16F827; Tue, 28 May 2024 13:54:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=marvell.com header.i=@marvell.com header.b="C2AM5D/c" 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 DC91716C879; Tue, 28 May 2024 13:54:10 +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=1716904452; cv=none; b=aIm6BtBZ0ZXlKJ/bctHHMuGA0Z1FWSLhg49et0glWYdyH2x3w0SSLhZvzIQZfw9MelrqjqJgMgnslhro4t7sKDwIglBO62bTUYL9CEkKhGAT2aB6iNOylISjES7XruYdZ+AvGQOW4TG48h4lKxe8ThlrXsRg3mAlxGzAZPydmbA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716904452; c=relaxed/simple; bh=HIsXKak4myaF77luhn0CUtjKAUGTcQ0It6dOSzQBOLQ=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=u7Xx7ZcJ++f4MRDARtgi1qDrkmoXQpaZmE051n4eU6Z3Qvqh7p4DsM93EgVq/8FJlWswI+x1+zZK2XdcsB9I/MLsy3pLZsg/eY+FtT1QDHzl6AqngA8t3NUYdLxuanHbiL181nWIcYYI039U6fY7W9s+pPtWcAMmLQyUez8bWd8= 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=C2AM5D/c; 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 44SAbQq5000401; Tue, 28 May 2024 06:54:03 -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=C2AM5D/cUH32emlCY BUISxxSNfs9ewypFJNmlbwP3ICL7ah9/FBWrHaNq6NY/UamVdBAdBwsiWEPQI2m4 kyYF1k+BrESRrPhnGdV6ACjWuvzlXXSGzt8FdI3hXxYPE3j8AM3bPIIkFht8o9sB SHWbBg8Fi2rxBexzGfVg0f82wDqqmMtunpf4BkqR2CEI8jATDfpuXP7+EP6x6gKp RoT1QtQn2HfsHgSTmBZHfLtm7TPTAu2QXQ3sjkwFL9MP+iGDQVJ2XCK1jK8ks8E4 NcqykbBviJJxY2D5tBDCLQN12j7uoQea9xcY4Ou2VBsHze4auh6uYjIoyxzNMsDO l0rSg== Received: from dc6wp-exch02.marvell.com ([4.21.29.225]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3yddnv8pay-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 28 May 2024 06:54:03 -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; Tue, 28 May 2024 06:54:02 -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; Tue, 28 May 2024 06:53:57 -0700 From: Bharat Bhushan To: , , , , , , , , , , , , CC: Subject: [net-next,v3 1/8] octeontx2-pf: map skb data as device writeable Date: Tue, 28 May 2024 19:23:42 +0530 Message-ID: <20240528135349.932669-2-bbhushan2@marvell.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240528135349.932669-1-bbhushan2@marvell.com> References: <20240528135349.932669-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: 09RC7fNlRjEqG5Xj7OnEv7hIG7lhAEml X-Proofpoint-ORIG-GUID: 09RC7fNlRjEqG5Xj7OnEv7hIG7lhAEml X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.650,FMLib:17.12.28.16 definitions=2024-05-28_09,2024-05-28_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