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 smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (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 597F7CDB465 for ; Thu, 19 Oct 2023 17:51:57 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id E6A058411F; Thu, 19 Oct 2023 17:51:56 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org E6A058411F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1697737916; bh=4orV4K/1b656SECXLI3chzvLYGFxSqVKhIo5yiA/JOw=; h=From:To:Date:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:Cc:From; b=2t76cBE6cClpbT5V/1Lg1dKS+RZ2o+UMxRze9AT3ZLEIQlIwQU8ne8DkLdYhBZKjw dsUb9LKe1fzk8XwY5EauBX5XErdWEqZlTw+LpLfqJ+hShm2u8dJEZSTfvErX72sFMh P1l47k7w4djiVZGnS95ST4hfzDVm6b0jLua++ISuIYJvJrArpN2uGmFC9UvvxkkPaf heAD/A/opaVmROIEVWPYnfS0IIs2v0ZLrjlE1D+AYgF8TNrS0YXk1qMidNXz0JU1+N 2stbN5477Oo0g9IQSRdAKdjfOiqOh5/X+VLu2Fhc5fRtQwHo5SjrsxzricPulaEM2Z pbaRFAQ3PwHoQ== X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id LJXWaBD7lyxN; Thu, 19 Oct 2023 17:51:56 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp1.osuosl.org (Postfix) with ESMTP id D301F84120; Thu, 19 Oct 2023 17:51:55 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org D301F84120 Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 11E6A1BF39F for ; Wed, 18 Oct 2023 21:20:55 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id DCBB5831DE for ; Wed, 18 Oct 2023 21:20:54 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org DCBB5831DE X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id UKn1EOWoltFR for ; Wed, 18 Oct 2023 21:20:54 +0000 (UTC) X-Greylist: delayed 325 seconds by postgrey-1.37 at util1.osuosl.org; Wed, 18 Oct 2023 21:20:53 UTC DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org CC48080E39 Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by smtp1.osuosl.org (Postfix) with ESMTPS id CC48080E39 for ; Wed, 18 Oct 2023 21:20:53 +0000 (UTC) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id A84B15C032D; Wed, 18 Oct 2023 17:15:25 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Wed, 18 Oct 2023 17:15:25 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrjeeggdduheeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffoggfgsedtkeertd ertddtnecuhfhrohhmpefluhhsthhinhcuuehrohhnuggvrhcuoehjshgsrhhonhguvghr segtohhlugdqfhhrohhnthdrohhrgheqnecuggftrfgrthhtvghrnhepudfghfdvkeeuhe duudduhfeuieeikeegfeelhffgfeejgeelheejhfeftdelheegnecuvehluhhsthgvrhfu ihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepjhhssghrohhnuggvrhestgholh guqdhfrhhonhhtrdhorhhg X-ME-Proxy: Feedback-ID: iea0042cb:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 18 Oct 2023 17:15:25 -0400 (EDT) From: Justin Bronder To: intel-wired-lan@lists.osuosl.org Date: Wed, 18 Oct 2023 17:15:22 -0400 Message-ID: <20231018211522.29017-1-jsbronder@cold-front.org> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 X-Mailman-Approved-At: Thu, 19 Oct 2023 17:51:54 +0000 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cold-front.org; h=cc:cc:content-transfer-encoding:content-type:date:date:from :from:in-reply-to:message-id:mime-version:reply-to:sender :subject:subject:to:to; s=mesmtp; t=1697663725; x=1697750125; bh=YUIIbcMEAk6JNyZcfIv8UDjxm/re2iAtxt/LDtQGNOQ=; b=aSGr66n9PCdE +mAREW7NewnM0RN8v4jO4/JprMN4hwpTs72BFggJmCN0jXkViJQjHWQIxIJR6/IK NgNVeVl/FqF/P0kYQutzUmyInAaMQJep96rZALK/CPzAxxEUQfwHpR44B+oYgZhj FFtYOy09WOjypBDf/ZHp85YmzDWMd64= X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:message-id:mime-version:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1697663725; x=1697750125; bh=YUIIbcMEAk6JN yZcfIv8UDjxm/re2iAtxt/LDtQGNOQ=; b=s9s1t6eIBE1AvMT7PMhxpc+2Vdo7b PXx+Bhkn8MEMOj/HcH3VjfNAVsJBKSBsQ66E1laLHqAOch80MyWTidgcxYeK/AbR RzbNOJxKAwY+51P9bQIDCnUJ7iklWd+59oLl03wD5MY6FsZIACb9/3N+9AzqIFzH 9BWuRL/X0XU09BjZgA45UzkPX8hOAKbYeGLd9NT7/th81Eu5gRSoA1/C+XWzesEk kk/+KM4zQRTqZo0SPDpwuLq1o194Z+65zuqYgQLFd+aWNyoimlzsmF4nw/xtoyh2 7rA35nVOm/+oYIjy0knzPULDMYLxYZMUhfKTR5p+Ym7SCNRdxuuaqCG1g== X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dkim=pass (1024-bit key) header.d=cold-front.org header.i=@cold-front.org header.a=rsa-sha256 header.s=mesmtp header.b=aSGr66n9; dkim=pass (2048-bit key, unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b=s9s1t6eI Subject: [Intel-wired-lan] [PATCH net-next] i40e: increase max descriptors for XL710 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: Justin Bronder Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" In Tables 8-12 and 8-22 in the X710/XXV710/XL710 datasheet, the QLEN description states that the maximum size of the descriptor queue is 8k minus 32, or 8160. Signed-off-by: Justin Bronder --- drivers/net/ethernet/intel/i40e/i40e.h | 1 + .../net/ethernet/intel/i40e/i40e_ethtool.c | 23 +++++++++++++++---- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h index 6e310a539467..ad261fa00d4c 100644 --- a/drivers/net/ethernet/intel/i40e/i40e.h +++ b/drivers/net/ethernet/intel/i40e/i40e.h @@ -50,6 +50,7 @@ #define I40E_MAX_VEB 16 #define I40E_MAX_NUM_DESCRIPTORS 4096 +#define I40E_MAX_NUM_DESCRIPTORS_XL710 8160 #define I40E_MAX_CSR_SPACE (4 * 1024 * 1024 - 64 * 1024) #define I40E_DEFAULT_NUM_DESCRIPTORS 512 #define I40E_REQ_DESCRIPTOR_MULTIPLE 32 diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c index afc4fa8c66af..338c8f1acc1a 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c +++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c @@ -2013,6 +2013,18 @@ static void i40e_get_drvinfo(struct net_device *netdev, drvinfo->n_priv_flags += I40E_GL_PRIV_FLAGS_STR_LEN; } +static u32 i40e_get_max_num_descriptors(struct i40e_pf *pf) +{ + struct i40e_hw *hw = &pf->hw; + + switch (hw->mac.type) { + case I40E_MAC_XL710: + return I40E_MAX_NUM_DESCRIPTORS_XL710; + default: + return I40E_MAX_NUM_DESCRIPTORS; + } +} + static void i40e_get_ringparam(struct net_device *netdev, struct ethtool_ringparam *ring, struct kernel_ethtool_ringparam *kernel_ring, @@ -2022,8 +2034,8 @@ static void i40e_get_ringparam(struct net_device *netdev, struct i40e_pf *pf = np->vsi->back; struct i40e_vsi *vsi = pf->vsi[pf->lan_vsi]; - ring->rx_max_pending = I40E_MAX_NUM_DESCRIPTORS; - ring->tx_max_pending = I40E_MAX_NUM_DESCRIPTORS; + ring->rx_max_pending = i40e_get_max_num_descriptors(pf); + ring->tx_max_pending = i40e_get_max_num_descriptors(pf); ring->rx_mini_max_pending = 0; ring->rx_jumbo_max_pending = 0; ring->rx_pending = vsi->rx_rings[0]->count; @@ -2057,18 +2069,19 @@ static int i40e_set_ringparam(struct net_device *netdev, u16 tx_alloc_queue_pairs; int timeout = 50; int i, err = 0; + u32 max_num_descriptors = i40e_get_max_num_descriptors(pf); if ((ring->rx_mini_pending) || (ring->rx_jumbo_pending)) return -EINVAL; - if (ring->tx_pending > I40E_MAX_NUM_DESCRIPTORS || + if (ring->tx_pending > max_num_descriptors || ring->tx_pending < I40E_MIN_NUM_DESCRIPTORS || - ring->rx_pending > I40E_MAX_NUM_DESCRIPTORS || + ring->rx_pending > max_num_descriptors || ring->rx_pending < I40E_MIN_NUM_DESCRIPTORS) { netdev_info(netdev, "Descriptors requested (Tx: %d / Rx: %d) out of range [%d-%d]\n", ring->tx_pending, ring->rx_pending, - I40E_MIN_NUM_DESCRIPTORS, I40E_MAX_NUM_DESCRIPTORS); + I40E_MIN_NUM_DESCRIPTORS, max_num_descriptors); return -EINVAL; } -- 2.42.0 _______________________________________________ Intel-wired-lan mailing list Intel-wired-lan@osuosl.org https://lists.osuosl.org/mailman/listinfo/intel-wired-lan