From patchwork Thu Mar 23 19:59:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shay Agroskin X-Patchwork-Id: 13186055 X-Patchwork-Delegate: kuba@kernel.org 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 39804C6FD1C for ; Thu, 23 Mar 2023 20:02:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231643AbjCWUCO (ORCPT ); Thu, 23 Mar 2023 16:02:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231688AbjCWUCB (ORCPT ); Thu, 23 Mar 2023 16:02:01 -0400 Received: from smtp-fw-9102.amazon.com (smtp-fw-9102.amazon.com [207.171.184.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F9EC29E23 for ; Thu, 23 Mar 2023 13:01:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1679601710; x=1711137710; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=9LQ6zqfWDM2SoZ0nYrUDovkbmR+F3GKeGmLRoDbzFe0=; b=bDFuXVYrMF7ZYR0dhCZzWjX5J2fqOO3wtKjgN8oD2UwhdRlai37CcZaH UeQJHUIcML+KowYtlWOgMUTaSW3jhL1TCT9oZ1bQ9MLQmD9KS05FKX1Yj QdwvUCZQlHeH3WsJ+iz6yzmtH5Y148E+hNghOjpWXM+Uul3cTMRHDvF86 U=; X-IronPort-AV: E=Sophos;i="5.98,285,1673913600"; d="scan'208";a="321946804" Received: from pdx4-co-svc-p1-lb2-vlan2.amazon.com (HELO email-inbound-relay-iad-1a-m6i4x-edda28d4.us-east-1.amazon.com) ([10.25.36.210]) by smtp-border-fw-9102.sea19.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Mar 2023 20:01:49 +0000 Received: from EX19D020EUA002.ant.amazon.com (iad12-ws-svc-p26-lb9-vlan3.iad.amazon.com [10.40.163.38]) by email-inbound-relay-iad-1a-m6i4x-edda28d4.us-east-1.amazon.com (Postfix) with ESMTPS id 97B6081410; Thu, 23 Mar 2023 20:01:45 +0000 (UTC) Received: from EX19D028EUB003.ant.amazon.com (10.252.61.31) by EX19D020EUA002.ant.amazon.com (10.252.50.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.21; Thu, 23 Mar 2023 20:01:44 +0000 Received: from u570694869fb251.ant.amazon.com (10.85.143.174) by EX19D028EUB003.ant.amazon.com (10.252.61.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.24; Thu, 23 Mar 2023 20:01:33 +0000 From: Shay Agroskin To: David Miller , Jakub Kicinski , CC: Shay Agroskin , "Woodhouse, David" , "Machulsky, Zorik" , "Matushevsky, Alexander" , Saeed Bshara , "Wilson, Matt" , "Liguori, Anthony" , "Bshara, Nafea" , "Belgazal, Netanel" , "Saidi, Ali" , "Herrenschmidt, Benjamin" , "Kiyanovski, Arthur" , "Dagan, Noam" , "Arinzon, David" , "Itzko, Shahar" , "Abboud, Osama" , Eric Dumazet , Paolo Abeni , Vladimir Oltean , Andrew Lunn , Johannes Berg , Edward Cree , Florian Westphal , "Michal Kubiak" Subject: [PATCH v8 net-next 7/7] net: ena: Advertise TX push support Date: Thu, 23 Mar 2023 21:59:23 +0200 Message-ID: <20230323195923.1731790-8-shayagr@amazon.com> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20230323195923.1731790-1-shayagr@amazon.com> References: <20230323195923.1731790-1-shayagr@amazon.com> MIME-Version: 1.0 X-Originating-IP: [10.85.143.174] X-ClientProxiedBy: EX19D036UWC001.ant.amazon.com (10.13.139.233) To EX19D028EUB003.ant.amazon.com (10.252.61.31) Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org LLQ is auto enabled by the device and disabling it isn't supported on new ENA generations while on old ones causes sub-optimal performance. This patch adds advertisement of push-mode when LLQ mode is used, but rejects an attempt to modify it. Reviewed-by: Michal Kubiak Signed-off-by: Shay Agroskin --- drivers/net/ethernet/amazon/ena/ena_ethtool.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/amazon/ena/ena_ethtool.c b/drivers/net/ethernet/amazon/ena/ena_ethtool.c index de7ec02d8c09..d671df4b76bc 100644 --- a/drivers/net/ethernet/amazon/ena/ena_ethtool.c +++ b/drivers/net/ethernet/amazon/ena/ena_ethtool.c @@ -479,12 +479,14 @@ static void ena_get_ringparam(struct net_device *netdev, if (adapter->ena_dev->tx_mem_queue_type == ENA_ADMIN_PLACEMENT_POLICY_DEV) { bool large_llq_supported = adapter->large_llq_header_supported; + kernel_ring->tx_push = true; kernel_ring->tx_push_buf_len = adapter->ena_dev->tx_max_header_size; if (large_llq_supported) kernel_ring->tx_push_buf_max_len = ENA_LLQ_LARGE_HEADER; else kernel_ring->tx_push_buf_max_len = ENA_LLQ_HEADER; } else { + kernel_ring->tx_push = false; kernel_ring->tx_push_buf_max_len = 0; kernel_ring->tx_push_buf_len = 0; } @@ -516,6 +518,12 @@ static int ena_set_ringparam(struct net_device *netdev, /* This value is ignored if LLQ is not supported */ new_tx_push_buf_len = adapter->ena_dev->tx_max_header_size; + if ((adapter->ena_dev->tx_mem_queue_type == ENA_ADMIN_PLACEMENT_POLICY_DEV) != + kernel_ring->tx_push) { + NL_SET_ERR_MSG_MOD(extack, "Push mode state cannot be modified"); + return -EINVAL; + } + /* Validate that the push buffer is supported on the underlying device */ if (kernel_ring->tx_push_buf_len) { enum ena_admin_placement_policy_type placement; @@ -957,7 +965,8 @@ static int ena_set_tunable(struct net_device *netdev, static const struct ethtool_ops ena_ethtool_ops = { .supported_coalesce_params = ETHTOOL_COALESCE_USECS | ETHTOOL_COALESCE_USE_ADAPTIVE_RX, - .supported_ring_params = ETHTOOL_RING_USE_TX_PUSH_BUF_LEN, + .supported_ring_params = ETHTOOL_RING_USE_TX_PUSH_BUF_LEN | + ETHTOOL_RING_USE_TX_PUSH, .get_link_ksettings = ena_get_link_ksettings, .get_drvinfo = ena_get_drvinfo, .get_msglevel = ena_get_msglevel,