Received: by 2002:a05:6a10:144:0:0:0:0 with SMTP id 4csp55738pxw; Fri, 8 Apr 2022 00:29:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzADpTzVCtVtSKPMkWGkoWRBWPm6JDqcavVmbN9BLG8ua4YbVoGsn3L5O7oKMxXXSlQqTnd X-Received: by 2002:a05:6a00:14c6:b0:4fb:3978:1020 with SMTP id w6-20020a056a0014c600b004fb39781020mr17698222pfu.36.1649402945954; Fri, 08 Apr 2022 00:29:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649402945; cv=none; d=google.com; s=arc-20160816; b=u3xqm/XcvB14iuydkWo9ZR/8BpFvcjqlig6LXirCwRGRVl0GxlltgrcJKEkcD5ngXa DyJO7t4MmQKNkL+RfeZvV8PyIZUJQSO9LXQS0aPOOGvxwBqrTn0h67k21pRq8y5YYBas 3Vr8qBcL0qSWP96uWx18yVJY7Gy4PWcKnjPgyubo0UsyYuKXJOev0bsH23k2YSg8b3fc uQxiYJjW0nz1lhOM30Gi+nSXK6UGCvxZ2wyRozvPh1A/OKkEPFdas+jvnPS+SzBSFwfU Tc3rBwL1Aoc0HRtAOdTc3o5dfm1DS82sVa5qFCC2pNU9ef1O3MehwDp5yjyN2Dwj8LST 2lvw== 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=Q5xlHpDEKFtMOZU4QrPwBIrtKq8MCeURpHYvruqVKdk=; b=QBTJIYtrt0Mi7YU08fdLGFwaYOSF24OlB77Eqd6y5ghtX2KgFZT+dnreFcR+TOabt7 O+cbLCBqGzSMnWA0+a3xYn4YTTG2nFQKvry7zJ1aHatPP2eIATwv4B11s+P72ufwPM0N mDzrSHGHQZgsVptDYN/79AjbtQk+Ux6Ft6CSYlSF7xPhkYykbiTvkDw54wFM/OS53Zru GnU1GXa8k33714XP3VVryjRgXd0kzjetMvPHP12pW0nGZP7t7YbaRchFdkxt5wrioxxz S3iyHABjMyytiF20/y2pQlL3K7G1UFLxhwyGmYpaflqU5BQPu4+fP88i8NhjoblDwQv5 pwxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@microchip.com header.s=mchp header.b=m9pAcIqQ; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id t16-20020a170902e85000b00153b2d1651fsi153883plg.295.2022.04.08.00.28.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Apr 2022 00:29:05 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=fail header.i=@microchip.com header.s=mchp header.b=m9pAcIqQ; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 96194DBD1A; Fri, 8 Apr 2022 00:01:14 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229596AbiDHHDF (ORCPT + 99 others); Fri, 8 Apr 2022 03:03:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47374 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229503AbiDHHC7 (ORCPT ); Fri, 8 Apr 2022 03:02:59 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E01E6B53D; Fri, 8 Apr 2022 00:00:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1649401255; x=1680937255; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=s2SHzgXPNkhGn4FjSnU3OOm/P7t9aDy3XNrOcD+cnvo=; b=m9pAcIqQ1A7vENZgX7WmSF7i5UtIKybHcYlRF8WWehl1PGSeHWw7zvwH WXEO9JxY271gj+SX0xz7Hhw2YlxCAqjcD5KMJcTvpTI31+F6W+yINOlxx OJ92GkJLq7QPWoV24RNs9qLdGDCUe2sd6iump4nSFygCsMpO7284lvVZ0 vF7S2eH13hYU93AQ92C1cxQjRRGB18mluuBbaiY3OSV7x3rHjeF+KFmrn N+cidiaMz8mXRqleJ/u6fXuOmc41BfWIwsAZ0OFVdwTECgG/QO360QHCd reQqqB3VB07a8cvq55Ih3GACT/sFuoFqAiTBoZnl5HAZuD7ZXoqUzyvvK A==; X-IronPort-AV: E=Sophos;i="5.90,244,1643698800"; d="scan'208";a="91728871" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa6.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 08 Apr 2022 00:00:54 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.17; Fri, 8 Apr 2022 00:00:54 -0700 Received: from soft-dev3-1.microsemi.net (10.10.115.15) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.2375.17 via Frontend Transport; Fri, 8 Apr 2022 00:00:52 -0700 From: Horatiu Vultur To: , CC: , , , , , Horatiu Vultur Subject: [PATCH net-next v4 0/4] net: lan966x: Add support for FDMA Date: Fri, 8 Apr 2022 09:03:53 +0200 Message-ID: <20220408070357.559899-1-horatiu.vultur@microchip.com> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=no 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 Currently when injecting or extracting a frame from CPU, the frame is given to the HW each word at a time. There is another way to inject/extract frames from CPU using FDMA(Frame Direct Memory Access). In this way the entire frame is given to the HW. This improves both RX and TX bitrate. Tested-by: Michael Walle # on kontron-kswitch-d10 v3->v4: - fix race conditions when changing the MTU - build skbs once frames are received and not before - use NAPI_POLL_WEIGHT instead of FDMA_WEIGHT v2->v3: - move skb_tx_timestamp before the IFH is inserted, because in case of PHY timestamping, the PHY should not see the IFH. - use lower/upper_32_bits() - reimplement the RX path in case of memory pressure. - use devm_request_irq instead of devm_request_threaded_irq - add various checks for return values. v1->v2: - fix typo in commit message in last patch - remove first patch as the changes are already there - make sure that there is space in skb to put the FCS - move skb_tx_timestamp closer to the handover of the frame to the HW Horatiu Vultur (4): net: lan966x: Add registers that are used for FDMA. net: lan966x: Expose functions that are needed by FDMA net: lan966x: Add FDMA functionality net: lan966x: Update FDMA to change MTU. .../net/ethernet/microchip/lan966x/Makefile | 2 +- .../ethernet/microchip/lan966x/lan966x_fdma.c | 842 ++++++++++++++++++ .../ethernet/microchip/lan966x/lan966x_main.c | 59 +- .../ethernet/microchip/lan966x/lan966x_main.h | 117 +++ .../ethernet/microchip/lan966x/lan966x_port.c | 3 + .../ethernet/microchip/lan966x/lan966x_regs.h | 106 +++ 6 files changed, 1117 insertions(+), 12 deletions(-) create mode 100644 drivers/net/ethernet/microchip/lan966x/lan966x_fdma.c -- 2.33.0