From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 02A95C77B7A for ; Thu, 25 May 2023 12:58:39 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 700BC60BC2; Thu, 25 May 2023 12:58:39 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 700BC60BC2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1685019519; bh=mdcyt8njJNCx6knaT/l14IMP4dkFLF67IQwVZ5tVqIk=; h=From:To:Date:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:Cc:From; b=OSlkLyNDHkRvmJbcDCFIpv/H68xyF3iYgwsO2iJihAV4ewmLmxp+6upcLuGFZ3LCl GImjy9d35Fz94L67rrBRklHOi7XHIvUlVoP39LtT4oKp1jQHlobA5Bbl8vvmDhrQ2i AmQwDDjEYRVR9FQg2GqYmqaWuIUWivUNZgJguNlfH96bDEQKn8KyKOgRGv6LXa+6xv NSbm6oGp8mdutXOWZUNVPIOKlcB3p+HLckuKFc3FgArdBQl+C2CXVdktGJ8cQJuVrE yrZy42vgR0H8ACCJb1gPJYSaTvKVVqK/HZ8PNwh9CeCOZNtQZ8QKnk0+f8hK61PwO+ hYDAj4EIpwewA== X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qsYBeV5uuXjT; Thu, 25 May 2023 12:58:37 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp3.osuosl.org (Postfix) with ESMTP id A678B60B88; Thu, 25 May 2023 12:58:37 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org A678B60B88 Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 23CD41BF27A for ; Thu, 25 May 2023 12:58:36 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id EDC2F4109B for ; Thu, 25 May 2023 12:58:35 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org EDC2F4109B X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id za9iFH5LRbYr for ; Thu, 25 May 2023 12:58:34 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org C8A42409E2 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by smtp4.osuosl.org (Postfix) with ESMTPS id C8A42409E2 for ; Thu, 25 May 2023 12:58:33 +0000 (UTC) X-IronPort-AV: E=McAfee;i="6600,9927,10721"; a="351384298" X-IronPort-AV: E=Sophos;i="6.00,191,1681196400"; d="scan'208";a="351384298" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 May 2023 05:58:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10721"; a="817075070" X-IronPort-AV: E=Sophos;i="6.00,191,1681196400"; d="scan'208";a="817075070" Received: from newjersey.igk.intel.com ([10.102.20.203]) by fmsmga002.fm.intel.com with ESMTP; 25 May 2023 05:58:29 -0700 From: Alexander Lobakin To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Date: Thu, 25 May 2023 14:57:34 +0200 Message-Id: <20230525125746.553874-1-aleksander.lobakin@intel.com> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1685019513; x=1716555513; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=f0lF9njkggtpBf9SpDur9tx299D0+TkDV/kEtNrSjqI=; b=fDYE0zysnqffq22/wt/iiKruN4RBDgrJmhV44EU9vH3AqHun7l4uUQp8 zIyWQtyUoYakfOtfu8sSDeCuES+M/iv7/gQrNypJClIStZ7EGK+JnASNf 32LrTYF/7B+4G75ug24wCscbOeZDoUpt6lEOriPSwAKxbeCz8GhgyKQiB 3PPEq5AIOShtQfa5fL4CfnYPpzfgFjHmeH9SHf0oL4/IFjRxWzMRw2n4H cKiX8RyXODrESr+OfasTuJ/bGOtDcypTJNpvtMmhY+sAnm3ZNGW3QEoMT IViFN5lniBKkNmgViVOWZbQCYQGFSBKSxR6oFuOGo0cibpdsOf0Dli2km A==; X-Mailman-Original-Authentication-Results: smtp4.osuosl.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=fDYE0zys Subject: [Intel-wired-lan] [PATCH net-next v2 00/12] net: intel: start The Great Code Dedup + Page Pool for iavf X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paul Menzel , Jesper Dangaard Brouer , Larysa Zaremba , netdev@vger.kernel.org, Ilias Apalodimas , linux-kernel@vger.kernel.org, Michal Kubiak , intel-wired-lan@lists.osuosl.org, Christoph Hellwig , Magnus Karlsson Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" Here's a two-shot: introduce Intel Ethernet common library (libie) and switch iavf to Page Pool. Details in the commit messages; here's summary: Not a secret there's a ton of code duplication between two and more Intel ethernet modules. Before introducing new changes, which would need to be copied over again, start decoupling the already existing duplicate functionality into a new module, which will be shared between several Intel Ethernet drivers. The first thing that came to my mind was "libie" -- "Intel Ethernet common library". Also this sounds like "lovelie" and can be expanded as "lib Internet Explorer" :P I'm open for anything else (but justified). The series is only the beginning. From now on, adding every new feature or doing any good driver refactoring will remove much more lines than add for quite some time. There's a basic roadmap with some deduplications planned already, not speaking of that touching every line now asks: "can I share this?". PP conversion for iavf lands within the same series as these two are tied closely. libie will support Page Pool model only, so a driver can't use much of the lib until it's converted. iavf is only the example, the rest will eventually be converted soon on a per-driver basis. That is when it gets really interesting. Stay tech. Alexander Lobakin (12): net: intel: introduce Intel Ethernet common library iavf: kill "legacy-rx" for good iavf: optimize Rx buffer allocation a bunch iavf: remove page splitting/recycling iavf: always use a full order-0 page net: skbuff: don't include into net: page_pool: avoid calling no-op externals when possible net: page_pool: add DMA-sync-for-CPU inline helpers iavf: switch to Page Pool libie: add common queue stats libie: add per-queue Page Pool stats iavf: switch queue stats to libie MAINTAINERS | 3 +- drivers/net/ethernet/engleder/tsnep_main.c | 1 + drivers/net/ethernet/freescale/fec_main.c | 1 + drivers/net/ethernet/intel/Kconfig | 12 +- drivers/net/ethernet/intel/Makefile | 1 + drivers/net/ethernet/intel/i40e/i40e_common.c | 253 ------- drivers/net/ethernet/intel/i40e/i40e_main.c | 1 + .../net/ethernet/intel/i40e/i40e_prototype.h | 7 - drivers/net/ethernet/intel/i40e/i40e_txrx.c | 74 +- drivers/net/ethernet/intel/i40e/i40e_type.h | 88 --- drivers/net/ethernet/intel/iavf/iavf.h | 2 +- drivers/net/ethernet/intel/iavf/iavf_common.c | 253 ------- .../net/ethernet/intel/iavf/iavf_ethtool.c | 227 +----- drivers/net/ethernet/intel/iavf/iavf_main.c | 45 +- .../net/ethernet/intel/iavf/iavf_prototype.h | 7 - drivers/net/ethernet/intel/iavf/iavf_txrx.c | 715 +++++------------- drivers/net/ethernet/intel/iavf/iavf_txrx.h | 185 +---- drivers/net/ethernet/intel/iavf/iavf_type.h | 90 --- .../net/ethernet/intel/iavf/iavf_virtchnl.c | 16 +- .../net/ethernet/intel/ice/ice_lan_tx_rx.h | 316 -------- drivers/net/ethernet/intel/ice/ice_main.c | 1 + drivers/net/ethernet/intel/ice/ice_txrx_lib.c | 74 +- drivers/net/ethernet/intel/libie/Makefile | 7 + drivers/net/ethernet/intel/libie/internal.h | 23 + drivers/net/ethernet/intel/libie/rx.c | 158 ++++ drivers/net/ethernet/intel/libie/stats.c | 190 +++++ .../ethernet/mellanox/mlx5/core/en/params.c | 1 + .../net/ethernet/mellanox/mlx5/core/en/xdp.c | 1 + drivers/net/wireless/mediatek/mt76/mt76.h | 1 + include/linux/net/intel/libie/rx.h | 170 +++++ include/linux/net/intel/libie/stats.h | 214 ++++++ include/linux/skbuff.h | 4 +- include/net/page_pool.h | 69 +- net/core/page_pool.c | 10 + 34 files changed, 1139 insertions(+), 2081 deletions(-) create mode 100644 drivers/net/ethernet/intel/libie/Makefile create mode 100644 drivers/net/ethernet/intel/libie/internal.h create mode 100644 drivers/net/ethernet/intel/libie/rx.c create mode 100644 drivers/net/ethernet/intel/libie/stats.c create mode 100644 include/linux/net/intel/libie/rx.h create mode 100644 include/linux/net/intel/libie/stats.h --- Directly to net-next, has non-Intel code changes (0006-0008). >From v1[0]: * 0006: new (me, Jakub); * 0008: give the helpers more intuitive names (Jakub, Ilias); * -^-: also expand their kdoc a bit for the same reason; * -^-: fix kdoc copy-paste issue (Patchwork, Jakub); * 0011: drop `inline` from C file (Patchwork, Jakub). [0] https://lore.kernel.org/netdev/20230516161841.37138-1-aleksander.lobakin@intel.com -- 2.40.1 _______________________________________________ Intel-wired-lan mailing list Intel-wired-lan@osuosl.org https://lists.osuosl.org/mailman/listinfo/intel-wired-lan From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EABE3C77B7A for ; Thu, 25 May 2023 12:59:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240400AbjEYM7p (ORCPT ); Thu, 25 May 2023 08:59:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42692 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240727AbjEYM7n (ORCPT ); Thu, 25 May 2023 08:59:43 -0400 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 625E6195; Thu, 25 May 2023 05:59:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1685019557; x=1716555557; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=f0lF9njkggtpBf9SpDur9tx299D0+TkDV/kEtNrSjqI=; b=azvFNd0GhGCULkCjASrsxmOScchdduz3pzAiK1JijYWTdUDP7S29l0Aj cxwXhw8AKZbrr2Ylpt6MvRw15I3O2vsBILED8wA1aXMmBL+AJQ/DSUgX6 Np6LYh1Qrt8lGzAnhSJyKOZoCCuynubEss86KR2+S7awZo8hL0xJntzwy TPp2CIqfhBehvXN83Z7RzxKqTaB1y5uJbykM4PAAXxMpoDjXkvz5siCzr 3/W3u3KZb9Y6xhixauivrWvCgNynvT1XwERH8BKcT988y6xeY/RbFIk34 R35t46Wu/sCkTBHCxWpxzB8MPlxzhHc1DjyssWeIZjjslSki7dWh76G2Z g==; X-IronPort-AV: E=McAfee;i="6600,9927,10721"; a="351384299" X-IronPort-AV: E=Sophos;i="6.00,191,1681196400"; d="scan'208";a="351384299" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 May 2023 05:58:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10721"; a="817075070" X-IronPort-AV: E=Sophos;i="6.00,191,1681196400"; d="scan'208";a="817075070" Received: from newjersey.igk.intel.com ([10.102.20.203]) by fmsmga002.fm.intel.com with ESMTP; 25 May 2023 05:58:29 -0700 From: Alexander Lobakin To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: Alexander Lobakin , Maciej Fijalkowski , Magnus Karlsson , Michal Kubiak , Larysa Zaremba , Jesper Dangaard Brouer , Ilias Apalodimas , Christoph Hellwig , Paul Menzel , netdev@vger.kernel.org, intel-wired-lan@lists.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next v2 00/12] net: intel: start The Great Code Dedup + Page Pool for iavf Date: Thu, 25 May 2023 14:57:34 +0200 Message-Id: <20230525125746.553874-1-aleksander.lobakin@intel.com> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Here's a two-shot: introduce Intel Ethernet common library (libie) and switch iavf to Page Pool. Details in the commit messages; here's summary: Not a secret there's a ton of code duplication between two and more Intel ethernet modules. Before introducing new changes, which would need to be copied over again, start decoupling the already existing duplicate functionality into a new module, which will be shared between several Intel Ethernet drivers. The first thing that came to my mind was "libie" -- "Intel Ethernet common library". Also this sounds like "lovelie" and can be expanded as "lib Internet Explorer" :P I'm open for anything else (but justified). The series is only the beginning. From now on, adding every new feature or doing any good driver refactoring will remove much more lines than add for quite some time. There's a basic roadmap with some deduplications planned already, not speaking of that touching every line now asks: "can I share this?". PP conversion for iavf lands within the same series as these two are tied closely. libie will support Page Pool model only, so a driver can't use much of the lib until it's converted. iavf is only the example, the rest will eventually be converted soon on a per-driver basis. That is when it gets really interesting. Stay tech. Alexander Lobakin (12): net: intel: introduce Intel Ethernet common library iavf: kill "legacy-rx" for good iavf: optimize Rx buffer allocation a bunch iavf: remove page splitting/recycling iavf: always use a full order-0 page net: skbuff: don't include into net: page_pool: avoid calling no-op externals when possible net: page_pool: add DMA-sync-for-CPU inline helpers iavf: switch to Page Pool libie: add common queue stats libie: add per-queue Page Pool stats iavf: switch queue stats to libie MAINTAINERS | 3 +- drivers/net/ethernet/engleder/tsnep_main.c | 1 + drivers/net/ethernet/freescale/fec_main.c | 1 + drivers/net/ethernet/intel/Kconfig | 12 +- drivers/net/ethernet/intel/Makefile | 1 + drivers/net/ethernet/intel/i40e/i40e_common.c | 253 ------- drivers/net/ethernet/intel/i40e/i40e_main.c | 1 + .../net/ethernet/intel/i40e/i40e_prototype.h | 7 - drivers/net/ethernet/intel/i40e/i40e_txrx.c | 74 +- drivers/net/ethernet/intel/i40e/i40e_type.h | 88 --- drivers/net/ethernet/intel/iavf/iavf.h | 2 +- drivers/net/ethernet/intel/iavf/iavf_common.c | 253 ------- .../net/ethernet/intel/iavf/iavf_ethtool.c | 227 +----- drivers/net/ethernet/intel/iavf/iavf_main.c | 45 +- .../net/ethernet/intel/iavf/iavf_prototype.h | 7 - drivers/net/ethernet/intel/iavf/iavf_txrx.c | 715 +++++------------- drivers/net/ethernet/intel/iavf/iavf_txrx.h | 185 +---- drivers/net/ethernet/intel/iavf/iavf_type.h | 90 --- .../net/ethernet/intel/iavf/iavf_virtchnl.c | 16 +- .../net/ethernet/intel/ice/ice_lan_tx_rx.h | 316 -------- drivers/net/ethernet/intel/ice/ice_main.c | 1 + drivers/net/ethernet/intel/ice/ice_txrx_lib.c | 74 +- drivers/net/ethernet/intel/libie/Makefile | 7 + drivers/net/ethernet/intel/libie/internal.h | 23 + drivers/net/ethernet/intel/libie/rx.c | 158 ++++ drivers/net/ethernet/intel/libie/stats.c | 190 +++++ .../ethernet/mellanox/mlx5/core/en/params.c | 1 + .../net/ethernet/mellanox/mlx5/core/en/xdp.c | 1 + drivers/net/wireless/mediatek/mt76/mt76.h | 1 + include/linux/net/intel/libie/rx.h | 170 +++++ include/linux/net/intel/libie/stats.h | 214 ++++++ include/linux/skbuff.h | 4 +- include/net/page_pool.h | 69 +- net/core/page_pool.c | 10 + 34 files changed, 1139 insertions(+), 2081 deletions(-) create mode 100644 drivers/net/ethernet/intel/libie/Makefile create mode 100644 drivers/net/ethernet/intel/libie/internal.h create mode 100644 drivers/net/ethernet/intel/libie/rx.c create mode 100644 drivers/net/ethernet/intel/libie/stats.c create mode 100644 include/linux/net/intel/libie/rx.h create mode 100644 include/linux/net/intel/libie/stats.h --- Directly to net-next, has non-Intel code changes (0006-0008). >From v1[0]: * 0006: new (me, Jakub); * 0008: give the helpers more intuitive names (Jakub, Ilias); * -^-: also expand their kdoc a bit for the same reason; * -^-: fix kdoc copy-paste issue (Patchwork, Jakub); * 0011: drop `inline` from C file (Patchwork, Jakub). [0] https://lore.kernel.org/netdev/20230516161841.37138-1-aleksander.lobakin@intel.com -- 2.40.1