Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp107201pxb; Tue, 17 Aug 2021 20:36:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzbifuUrVhKGXxCMQKz1j7Cjrrwj+e4d/2J2DaVOnHKfn7/hhPjiY6E8MbQgJgrX8B8jrdx X-Received: by 2002:a05:6402:54a:: with SMTP id i10mr401574edx.172.1629257810798; Tue, 17 Aug 2021 20:36:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629257810; cv=none; d=google.com; s=arc-20160816; b=0ADoFR4BBKmbDBIt7JDHSPDJ7SzOHflJIVdbbMgBuLAG2+kP/IVjnCOay4huwI/T1T aLEh6anMpzILUFlc4xifP7OwgJPx5edrrXP3FCxPIvpKxyzo6tsMkBXXTl6vDDWlHHYC CadaS9znFjnxOAK9yrsWHo4CLgWmc1Gfk58e94rMAKax+ws1gwTo5GWljvA/jlfJiHQW F7ZP2C6PJ3J9JOKHoM8X3v9LxubGOv0HL8M2JmE80aoJprZFDqXFbQwZfOfOHLKRxsIp C42Mggc/jaayRuXEoRozVrCEbhKlwJL8Mmmq0V4TGLHb/ATngEXHtRscXrYJPFTNkLqq XLLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=zZbarokAO8RylWhzB4nJUG4o8S9Qnu8S8WIsCAuSLc4=; b=izWtBKWcS+bXtuS467C8SOBxzBxinU6EsEI1XZAFjeWEK6IXfNuQxNgLwRWFxJVqe6 1MJj0sgSgUTWSfSYYnzfP75siGS+gAqXN3JvXfAA528wBnYSv90iJ1913TH/uEg6tDNd pJRnKxtElrrgBU7FdHnXUaLLtz6gAQl/bLmX+pTQKuK/ON3tv+7MvMGt/B0sQCtMYdnA 7sA8Tlo8t25vgtrCnfwBgSlLY3CEgzZHJHp5UVrtivWJT3kwzeALm+EfwSzFawiag3ue Jo6cSWV8TChbxkrqgKhG4a+y3l942q9am3qYLLt1l00kuVPVb9we0xiqLijUUyJ19O2u T8Mw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cb24si4427236ejb.612.2021.08.17.20.36.27; Tue, 17 Aug 2021 20:36:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236850AbhHRDeF (ORCPT + 99 others); Tue, 17 Aug 2021 23:34:05 -0400 Received: from szxga01-in.huawei.com ([45.249.212.187]:17035 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235554AbhHRDeE (ORCPT ); Tue, 17 Aug 2021 23:34:04 -0400 Received: from dggemv711-chm.china.huawei.com (unknown [172.30.72.55]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4GqD0m1sC9zbfRK; Wed, 18 Aug 2021 11:29:44 +0800 (CST) Received: from dggpemm500005.china.huawei.com (7.185.36.74) by dggemv711-chm.china.huawei.com (10.1.198.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Wed, 18 Aug 2021 11:33:27 +0800 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.2176.2; Wed, 18 Aug 2021 11:33:26 +0800 From: Yunsheng Lin To: , CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH RFC 0/7] add socket to netdev page frag recycling support Date: Wed, 18 Aug 2021 11:32:16 +0800 Message-ID: <1629257542-36145-1-git-send-email-linyunsheng@huawei.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.56] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpemm500005.china.huawei.com (7.185.36.74) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patchset adds the socket to netdev page frag recycling support based on the busy polling and page pool infrastructure. The profermance improve from 30Gbit to 41Gbit for one thread iperf tcp flow, and the CPU usages decreases about 20% for four threads iperf flow with 100Gb line speed in IOMMU strict mode. The profermance improve about 2.5% for one thread iperf tcp flow in IOMMU passthrough mode. Yunsheng Lin (7): page_pool: refactor the page pool to support multi alloc context skbuff: add interface to manipulate frag count for tx recycling net: add NAPI api to register and retrieve the page pool ptr net: pfrag_pool: add pfrag pool support based on page pool sock: support refilling pfrag from pfrag_pool net: hns3: support tx recycling in the hns3 driver sysctl_tcp_use_pfrag_pool drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 32 +++++---- include/linux/netdevice.h | 9 +++ include/linux/skbuff.h | 43 +++++++++++- include/net/netns/ipv4.h | 1 + include/net/page_pool.h | 15 ++++ include/net/pfrag_pool.h | 24 +++++++ include/net/sock.h | 1 + net/core/Makefile | 1 + net/core/dev.c | 34 ++++++++- net/core/page_pool.c | 86 ++++++++++++----------- net/core/pfrag_pool.c | 92 +++++++++++++++++++++++++ net/core/sock.c | 12 ++++ net/ipv4/sysctl_net_ipv4.c | 7 ++ net/ipv4/tcp.c | 34 ++++++--- 14 files changed, 325 insertions(+), 66 deletions(-) create mode 100644 include/net/pfrag_pool.h create mode 100644 net/core/pfrag_pool.c -- 2.7.4