Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1101746rwb; Wed, 9 Nov 2022 12:54:50 -0800 (PST) X-Google-Smtp-Source: AMsMyM5bITODU+Fe8o1FfU0b5a1ZPKOGR/ocK1QkxXlPvf8IHzh8SibMIeR1eIU1UD+osN8mYk3k X-Received: by 2002:a17:902:f684:b0:187:1d07:7339 with SMTP id l4-20020a170902f68400b001871d077339mr52969804plg.23.1668027290403; Wed, 09 Nov 2022 12:54:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668027290; cv=none; d=google.com; s=arc-20160816; b=NIAq2lQ2o28+bOVXYMK9Hbs5KhN5RvRWOZmCY+bqDdYqF/eIQv6xA+tcKytAhp+0xp epNcFxkY1kLPgt4gVF3GpDnF4KQFIC80W+QwgnTHUypY76ggKaE21KQbkvTeLA4ySdTr /R4G/vJc7DJRdgWDbfwYeIDryxTYr+EmwUA0fkLnaTV9qyNX/3q9isk5IHNCOxPp3E9M xBg0h/hNUwxdc6wGdGCPC9ypsmshN9Ji2PLESz33iUy2gD1qPUoenLJtgDdIxloIVsr7 ywM9X4MhdGHo81lbmCSAUVYSCtMFEg+VUf5FQL+mSNpEViO0VWDDq1dIdu+TDuNF+G+R pqpw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=eJmU7kJzWHNEOx3/hZQMGlkX3jqCUIcNqFSDi7HX5tc=; b=ZPLiJ1KHbMd+aeeN4ateTfNCdbmtUvZNDrl+bpTF2x91YYvFEnbGb90fC01qNSSYdK yKyeKWnwaa7u32UbQ/y1A+47L97JUttp89kxZywCWeF3i0gSyOoiuXRyluutal3sa8Ok XuXd62k0mbfD6j8CpaOkuigh4hHbrI9a/4rUUWIx3XOPLkPjOfcRErx5lD1DScRTtjM3 vmR6gxFT4XN9jsCzR3x9ZbqVrkbcfu9klIyPrgt0JT3nd6xtYd2Huhedwwm/JNLvnq9L CntvhoaCUxd7LS9jqwraj+VMmSnTu7Z0nJrkYVVuGRwtedtPaxPXgj6On/9KbaH1dmxD UdYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=XN4IiU0U; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d2-20020a056a00244200b0056bf15d0cbfsi21308758pfj.308.2022.11.09.12.54.38; Wed, 09 Nov 2022 12:54:50 -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=@microchip.com header.s=mchp header.b=XN4IiU0U; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231557AbiKIUlp (ORCPT + 93 others); Wed, 9 Nov 2022 15:41:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229561AbiKIUln (ORCPT ); Wed, 9 Nov 2022 15:41:43 -0500 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C23B217050; Wed, 9 Nov 2022 12:41:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1668026500; x=1699562500; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=+O/GefFOW6jxFk/nJ/+JlQXGvg7uqtqqmPjyGOaK5B0=; b=XN4IiU0Unq0aMJymV9WnlRzbXaohPuFMBv9HTaM0jC0e5RAZrXoHsWFX zPE8rJ/0vcyrVRLl3UadDmWsfHmQQ3fYq0gjGvLDaMUIx4SehOJfUihRb YRgu9M/VCzs2YdFqC1Tl9GtQL+IVQGLdGpvdVK66BKo9WtjCAx8/2Hg+a D80rc6wVIgYHR6IiWbzT71AnEQhJpoccc1zvzs7e5RMfd9GGf2lrdQSMV LBA+TD64pz7pYW+uiv3IbTtfA41B6K6DMZM85c2eQRhI/1S8QssnKTrre b32FgqGuc0W/7yqiMwPTdGDFItMFQooahrcqw988jsf2UH/CXa0FMGs64 g==; X-IronPort-AV: E=Sophos;i="5.96,151,1665471600"; d="scan'208";a="122642737" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa6.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 09 Nov 2022 13:41:39 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.12; Wed, 9 Nov 2022 13:41:39 -0700 Received: from soft-dev3-1.microsemi.net (10.10.115.15) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server id 15.1.2507.12 via Frontend Transport; Wed, 9 Nov 2022 13:41:36 -0700 From: Horatiu Vultur To: , , CC: , , , , , , , , , , , Horatiu Vultur Subject: [PATCH net-next v3 0/4] net: lan966x: Add xdp support Date: Wed, 9 Nov 2022 21:46:09 +0100 Message-ID: <20221109204613.3669905-1-horatiu.vultur@microchip.com> X-Mailer: git-send-email 2.38.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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 Add support for xdp in lan966x driver. Currently only XDP_PASS and XDP_DROP are supported. The first 2 patches are just moving things around just to simplify the code for when the xdp is added. Patch 3 actually adds the xdp. Currently the only supported actions are XDP_PASS and XDP_DROP. In the future this will be extended with XDP_TX and XDP_REDIRECT. Patch 4 changes to use page pool API, because the handling of the pages is similar with what already lan966x driver is doing. In this way is possible to remove some of the code. All these changes give a small improvement on the RX side: Before: iperf3 -c 10.96.10.1 -R [ 5] 0.00-10.01 sec 514 MBytes 430 Mbits/sec 0 sender [ 5] 0.00-10.00 sec 509 MBytes 427 Mbits/sec receiver After: iperf3 -c 10.96.10.1 -R [ 5] 0.00-10.02 sec 540 MBytes 452 Mbits/sec 0 sender [ 5] 0.00-10.01 sec 537 MBytes 450 Mbits/sec receiver --- v2->v3: - inline lan966x_xdp_port_present - update max_len of page_pool_params not to be the page size anymore but actually be rx->max_mtu. v1->v2: - rebase on net-next, once the fixes for FDMA and MTU were accepted - drop patch 2, which changes the MTU as is not needed anymore - allow to run xdp programs on frames bigger than 4KB Horatiu Vultur (4): net: lan966x: Add define IFH_LEN_BYTES net: lan966x: Split function lan966x_fdma_rx_get_frame net: lan966x: Add basic XDP support net: lan96x: Use page_pool API .../net/ethernet/microchip/lan966x/Kconfig | 1 + .../net/ethernet/microchip/lan966x/Makefile | 3 +- .../ethernet/microchip/lan966x/lan966x_fdma.c | 181 +++++++++++------- .../ethernet/microchip/lan966x/lan966x_ifh.h | 1 + .../ethernet/microchip/lan966x/lan966x_main.c | 7 +- .../ethernet/microchip/lan966x/lan966x_main.h | 33 ++++ .../ethernet/microchip/lan966x/lan966x_xdp.c | 76 ++++++++ 7 files changed, 236 insertions(+), 66 deletions(-) create mode 100644 drivers/net/ethernet/microchip/lan966x/lan966x_xdp.c -- 2.38.0