From patchwork Mon Nov 13 13:00:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yunsheng Lin X-Patchwork-Id: 164468 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b909:0:b0:403:3b70:6f57 with SMTP id t9csp1183128vqg; Mon, 13 Nov 2023 05:02:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IGcE0WO5ChfszArZ0gP7Sjs5UDyo4svtw7gSZ9Rm2XQxUTKmXLwqAkPDeHPtFTQUfRCd55y X-Received: by 2002:a05:6a20:7f99:b0:184:26d8:db7e with SMTP id d25-20020a056a207f9900b0018426d8db7emr10682281pzj.14.1699880531290; Mon, 13 Nov 2023 05:02:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699880531; cv=none; d=google.com; s=arc-20160816; b=LvwrPavSPYWEiVcDHh8oViFF8yvx4/6FOZtXBogFcXdw++pEY3Rp6WWwxmSvGIIUo8 1zUyaLmT+PCYx/EvvFFwquZRyTj0BYLHlncjGuJMdt1P9idaU2h6cH3hJexpZeUsqZVK +c4qo3p0FvdasZomJ2TVDMdnn0WWJhinJFCUxhrYp3NIZHxnahFUVH+0RDVCXrIDi9O1 pVR/P+eP2SNW4nvS+eRdaQHtOWC+oq989vyiPZGbTg67vF55S7Bix4h55RM6kctRIua0 D/pPnEMSYncV3SIJnXFrEbcczo27eXNNXA8/WLNjuqRsmWsfItaPfwJydtJgWYlOmbHK 8/nQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=yprYwkuv2QMnHlT2eUBfdWw1OEs3H1kZidn2ZZzPvm8=; fh=D6xVSegNul4KrUJ9ERmiGKlse4yUgZ/4HEoMM009vXk=; b=SN3sN1I3s2MAGcXmKviPrSDUJCdUuimu09kR8UfNO1BjCk6m/bp3t0XGsRLxcCxVOL WbM6LYdM0w7Hjb1w4OH+zdwYP0mrHJQYnz//NZBSBDAmji+oxliQjHwDy309zCmsvR+5 GmQ4I+9nvnEPxsAPnpBVpVcFuqtNT/B3k3RBXO5E7lFXec4CqY0HM3E4e7MzihfVL8jx 3VQLI8EUXOLTwi97i7jUwljDVhYCZPOwxsuZUNPRjVsJvuItIak38IeFfHIHP1Y3cD7F BULJdUaEEN/YyaHO5vwdLOYHnBoCfRSTAGa01usiVsqgmhan+nv6ubyc+PIhHX1+VCrL Fzaw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id s12-20020a056a00194c00b006bddac4b018si5775586pfk.107.2023.11.13.05.02.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Nov 2023 05:02:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id CA412802FB90; Mon, 13 Nov 2023 05:01:32 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231232AbjKMNBZ (ORCPT + 29 others); Mon, 13 Nov 2023 08:01:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230443AbjKMNAz (ORCPT ); Mon, 13 Nov 2023 08:00:55 -0500 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC7FF1727; Mon, 13 Nov 2023 05:00:51 -0800 (PST) Received: from dggpemm500005.china.huawei.com (unknown [172.30.72.54]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4STV0G0LFJzWhLY; Mon, 13 Nov 2023 21:00:30 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by dggpemm500005.china.huawei.com (7.185.36.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Mon, 13 Nov 2023 21:00:50 +0800 From: Yunsheng Lin To: , , CC: , , Yunsheng Lin , Eric Dumazet Subject: [PATCH RFC 8/8] net: temp hack for dmabuf page in __skb_datagram_iter() Date: Mon, 13 Nov 2023 21:00:40 +0800 Message-ID: <20231113130041.58124-9-linyunsheng@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20231113130041.58124-1-linyunsheng@huawei.com> References: <20231113130041.58124-1-linyunsheng@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.56] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpemm500005.china.huawei.com (7.185.36.74) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 13 Nov 2023 05:01:32 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782453927874241496 X-GMAIL-MSGID: 1782453927874241496 Signed-off-by: Yunsheng Lin --- net/core/datagram.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/net/core/datagram.c b/net/core/datagram.c index 103d46fa0eeb..5556782ac658 100644 --- a/net/core/datagram.c +++ b/net/core/datagram.c @@ -436,7 +436,15 @@ static int __skb_datagram_iter(const struct sk_buff *skb, int offset, end = start + skb_frag_size(frag); if ((copy = end - offset) > 0) { struct page *page = skb_frag_page(frag); - u8 *vaddr = kmap(page); + u8 *vaddr; + + if ((page->pp_magic & ~0x3UL) == PP_SIGNATURE) { + struct page_pool_iov *ppiov = (struct page_pool_iov *)page; + + page = ppiov->page; + } + + vaddr = kmap(page); if (copy > len) copy = len;