From patchwork Mon Feb 6 10:08:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 5006 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2150826wrn; Mon, 6 Feb 2023 02:10:39 -0800 (PST) X-Google-Smtp-Source: AK7set+zpumgIkujBZMLIJsGsrCKhbDeG8vmOy+QxgxFzShLPJ9CG3pEkZYfPj+hEbvYXEicWGOT X-Received: by 2002:a17:906:3a91:b0:82d:e2a6:4b0d with SMTP id y17-20020a1709063a9100b0082de2a64b0dmr18153802ejd.18.1675678239294; Mon, 06 Feb 2023 02:10:39 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1675678239; cv=pass; d=google.com; s=arc-20160816; b=QaGNrJ6OruMn8OWtAbEyGSkcZ5vd5BEiWAgjQ8uVNsaz2gSnfw98WD81cUenOY2pc3 qK80yWzpiXRU+gyiZgWhdJHaSUlKgyDYRNQNwbtRi37T5147yqlGQXK7r1j+BHmT4Glt nzj/qXt/Jz7UnVWO7zt1JLSryZenmqZ+EXsYTeC+hgXuA79o3XumRa8lZaav6hlmf/wd pHaS/uehwXLryIf1tBBW3bpZ1/utw+v8MsmbisWN87fZ3aWg5oAdq+VI3qSyRbF6pcT6 zqgIrlp1oES3LIMHls2oV48Ge3b3ZxoqWyLXE99I8ZkwRqmt71NRKmopPZDOnqRqsTxI Xrmw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :message-id:date:subject:cc:to:from:dkim-signature; bh=DiXX4eniqOJLKvp++w8g4EOvCT/FBmZVf6lByc9HJKY=; b=umSCoN1V9gF8gmArD1Y5dncYTO1xLXWOm9IPul4RK5EnJeCiFsvtXCA8Ga+EAHv/Fj 4FTK7wQS+ZqRFeVfr7DlYM9LNXpRTC/MeoUnrVBPkHMeKX2BQc+m+CTJ9dJiFt1Q+vL4 dBrRzlQQQgx77PcHb7IOyuQwTPjdo/5K10br4myOYGX47BMvVcB3OfAC5g6NFBNP/6CN rzN+uYel8sLX09bXA9JG6ku6Ita0SoRcZjV9rV5YxdQGoaw9B+h4sdO5vlk9qwe8JXIT te2hq4oWt5dpGGzT0dWN4gX+65EBSA+EkvZLamyuwQlUyfxUXuPhlcdtOH5vMNvpHW/m PDLA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=ZJ3ZTmql; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qw25-20020a1709066a1900b00890ac6d67efsi12130696ejc.44.2023.02.06.02.10.16; Mon, 06 Feb 2023 02:10:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=ZJ3ZTmql; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229635AbjBFKJD (ORCPT + 99 others); Mon, 6 Feb 2023 05:09:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33008 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229479AbjBFKJA (ORCPT ); Mon, 6 Feb 2023 05:09:00 -0500 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2087.outbound.protection.outlook.com [40.107.20.87]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 252BC1043F; Mon, 6 Feb 2023 02:08:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Y5novYCuty08EAGwBltdZaCKVAxzXrLPMZM+mWDEtpCB82GBEIVVvaHQ0EafFmBc6impbtXKgHz1ifioSwKmjYupJfqwtGm6GMlKX1YPhopyVIvLjGjfGT77wyiKUZfqf0Yt4vIrpcybmLnNYwohWiY9SM2IVL0djALM6wiwKNxYuaDXDfUZdVJFYWIiqNGPiuG9FO0ff9gbijVCSOk9DnLHX/j9tv4qfiJJkA68bkkPxs4RbyAYGB+sXLfj3LVtIFUJRSD70jvRB4RUY8/QgW/U6L3rZkCyJL1rbyPk9KW17xLMqzCM8faqjGDWwPfqWTj9VoRAElje61smRgcbaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=DiXX4eniqOJLKvp++w8g4EOvCT/FBmZVf6lByc9HJKY=; b=cay7k1PcDNYKs0h6EQidykCpXt5lRUrhPPSLO2lB7oFlqSog1LznmGv6hvPEIFln1eA/jw9qxllcfmuO7VjNUM3Y8+gNGFuU2u6lGgZMPFVZb1BH30DUejI/2+0fo4eL84jY8qcaNPYHQPOW+/aEg3UlQ4ldsvxUKLljnnhPH7TAm7vM62iKlPQ0FTHiXghCS7RaQFT2whH3jz8AUmOJKMjxn3mh+IENZ051pMUd+ZbfmUjAfBPNYlFBBCO0u3lSFeGaoYT63lQBWSGEnMKimra0iRSCs8TeybTq32hXmFhzUAMXChFsScLihzIZy2jlEQT8YyNlkDYNCVKtwK2/Rw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=DiXX4eniqOJLKvp++w8g4EOvCT/FBmZVf6lByc9HJKY=; b=ZJ3ZTmqlh9bcp2Kbz7NJ5iiOrtV6VLlXlDZUSVQ4pby4qlgg3OFRTT68hy7/rnLEcs7adkYM3jN7RM6CokgUjgpv/RPaSqfpiJHzC1Wj9jOf4cPDCbVWmcX1NxCwUo6Ab+7CG9UKD0B8y2kryzj/LJyx3Sjq5XwOsfV59eqq+Ls= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB5136.eurprd04.prod.outlook.com (2603:10a6:803:55::19) by AM9PR04MB8421.eurprd04.prod.outlook.com (2603:10a6:20b:3ee::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.34; Mon, 6 Feb 2023 10:08:57 +0000 Received: from VI1PR04MB5136.eurprd04.prod.outlook.com ([fe80::3cfb:3ae7:1686:a68b]) by VI1PR04MB5136.eurprd04.prod.outlook.com ([fe80::3cfb:3ae7:1686:a68b%5]) with mapi id 15.20.6064.034; Mon, 6 Feb 2023 10:08:56 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Claudiu Manoil , =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= , Magnus Karlsson , Maciej Fijalkowski , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , bpf@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH net-next 00/11] NXP ENETC AF_XDP zero-copy sockets Date: Mon, 6 Feb 2023 12:08:26 +0200 Message-Id: <20230206100837.451300-1-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 X-ClientProxiedBy: AS4PR10CA0019.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:5d8::19) To VI1PR04MB5136.eurprd04.prod.outlook.com (2603:10a6:803:55::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1PR04MB5136:EE_|AM9PR04MB8421:EE_ X-MS-Office365-Filtering-Correlation-Id: bed9b52a-906c-4a40-fd33-08db082a288a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zlkrAhfSjbVmAfai0ZWc4tOz0bJnfjFW9DHgFbcOYElnBhCGewZdaL9A0afRPwPZE9OTAYqCLYRVLoaPS9tudV5+Ywh4QA/dftUzPtyZJrWE22IZQQJto03Q85kk+eEHzzXorZXiTjA5I35JMqL7TtnQFRZq0gXgvCrsfnRrWcHGqSQBJme5IJ6FbMZv1MHPI02+FBymHfDxkhlU6ijWEBgq9DgOh6yLpUfrRcp75xYlkK2Tiw7taORZJSU4ALKt4uEcFE4a9w1PO9SM9mnLQqL7hBuvAX8ulwPa2zrxkvdJk5tzZaLu55vs+PL2aMwreun3d1CniiO0un55oqhJzD9Wd+Iqz8vN0JuKs0Q1EP1LypJAy1QsCnkIE4/aOx8btTGqXBuC2dwJXKBmsTeAjp5/JOl0cXSuTZpUs2nCExlGFUnIEwiOG0QAkKyzdXcVbSm4vlxRKvWnLAYCI2BIxuE0ZbG/gN/wEYGn4mMiwBm47nsWO5z9xA7cFqhemZzJF9ABL2FE5IO+mbYrTbPGSydxa29MR/aNwP4uCvx0wBdenS35y+jwr//SippOZxChnfFDbJ7IzSZDdVZhSm8nMOyQZLlyaE7aYgTwSsrs0XpLR/0m2eTEbth0qKICQEA59EL96iL2NbG2jEEuZoIDYHqvDNcDpe/S4k9+F+fFz/NIaleVopmzP5stggD19Lv5gkYsgluT3W6ILpBZGRncDw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB5136.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(376002)(136003)(39860400002)(366004)(346002)(396003)(451199018)(86362001)(2906002)(36756003)(8676002)(66556008)(83380400001)(52116002)(1076003)(6512007)(6506007)(186003)(26005)(6666004)(2616005)(5660300002)(6486002)(8936002)(38100700002)(7416002)(38350700002)(41300700001)(478600001)(44832011)(54906003)(6916009)(66476007)(66946007)(4326008)(316002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 4UWlyu+ZiGazLjcPXXp2v6t6Qjw54JVVdSb5G20R1BsWrWooKZBHYh38JmbimIAXi7pca2M5jcSLWRhwtk2afNBqapwvoB0zl7aGa910hGw+OyFi/yrgBWwRSqeunrO/Zv0VcV4GsgO/vWmwetdlkTN8WTRjX+DL0z0F524WImYqexRgzSRcFDYPHdq6LPz6LlwdmKSS/kPnbHQGSZxj9USNaW+OXmhpu1ujd/CrN17JcuK3s1Nca5fy2/pRQ2RgVIiK+y25XPDB2sebMIhCVBlxEZBtPTvwqKd+swtTexAhd2M8XmNGCNUip5bemxvkP91ezeKwHWVWWber7aX3GAu78mFHfPS170my0TR/y8kzLqSj3e6pEd8zzAR1H2agB+Wxru8aka5YfXy/97hkh/+a8t87UtL8lc/Og3FCDnbx3qspSZ6LUpVUMk2ZGEWg5IlAsh48425dEEkwyKUwNi5m7Rj/uAGYo2Q3rfDZ4fcuRYUz693wJsa6KQIqQ//Brp7F2IKBKT8YSPYzaSPC+X3A+hI30h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nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: bed9b52a-906c-4a40-fd33-08db082a288a X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5136.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Feb 2023 10:08:56.6778 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: uPf4aO7sQW5TQece+xDlFSshlYPU+RhQzZ77eyZ2FEXon7M5S1/mZWiZwy1B9q5ZN7P1sonthHEIfztW6fQ/Ug== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8421 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS 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-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757075985839112816?= X-GMAIL-MSGID: =?utf-8?q?1757075985839112816?= This is RFC because I have a few things I'm not 100% certain about. I've tested this with the xdpsock test application, I don't have very detailed knowledge about the internals of AF_XDP sockets. Patches where I'd appreciate if people took a look are 02/11, 05/11, 10/11 and 11/11. Vladimir Oltean (11): net: enetc: optimize struct enetc_rx_swbd layout net: enetc: perform XDP RX queue registration at enetc_setup_bpf() time net: enetc: rename "cleaned_cnt" to "buffs_missing" net: enetc: continue NAPI processing on frames with RX errors net: enetc: add support for ethtool --show-channels net: enetc: consolidate rx_swbd freeing net: enetc: rename enetc_free_tx_frame() to enetc_free_tx_swbd() net: enetc: increment rx_byte_cnt for XDP data path net: enetc: move setting of ENETC_TXBD_FLAGS_F flag to enetc_xdp_map_tx_buff() net: enetc: add RX support for zero-copy XDP sockets net: enetc: add TX support for zero-copy XDP sockets drivers/net/ethernet/freescale/enetc/enetc.c | 676 +++++++++++++++--- drivers/net/ethernet/freescale/enetc/enetc.h | 9 +- .../ethernet/freescale/enetc/enetc_ethtool.c | 10 + .../net/ethernet/freescale/enetc/enetc_pf.c | 1 + 4 files changed, 606 insertions(+), 90 deletions(-)