From patchwork Tue Jan 7 02:51:34 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Daley X-Patchwork-Id: 13928009 X-Patchwork-Delegate: kuba@kernel.org Received: from alln-iport-3.cisco.com (alln-iport-3.cisco.com [173.37.142.90]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7C238155335 for ; Tue, 7 Jan 2025 02:52:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=173.37.142.90 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736218372; cv=none; b=lRpqwg4TMYOZ7bgyYw0g29nXtZR9hS2ueCD4+H2QgPO0PqfJw9rjF2qosDfQBkPIuXfyDP0oyQf5vrxjhFmfZF+k5Ke3ElvejWoHWkci+g64ulsCJ2iLQUHYxPOwY3L3NQPVyXVME8u9DUcGofYnFbmmAqh3E2qIdD1TYWD19ag= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736218372; c=relaxed/simple; bh=kj3XAeBVudwD3vo/0EEH75kWe1rcErK6eALotHsNWn4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=b3EODjWcGX+UrN7dMEmLnsksEt/8dhal3+xTelnvudjZmP/kYqOsJ33VthxK4FmCVqHC0xuq8CP32ILOfQgR8SfN82g+2MS/0n8nJQLLAv5Uz1re4C3MnL5G0IR5Rv98BwwBD2ebnR3h/jg57y8Q1v/MoXW+V5SE6gq/vkwqqtM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=cisco.com; spf=pass smtp.mailfrom=cisco.com; dkim=pass (1024-bit key) header.d=cisco.com header.i=@cisco.com header.b=MXCt+wIU; arc=none smtp.client-ip=173.37.142.90 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=cisco.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=cisco.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=cisco.com header.i=@cisco.com header.b="MXCt+wIU" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cisco.com; i=@cisco.com; l=3131; q=dns/txt; s=iport; t=1736218370; x=1737427970; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=VPokXnowB9WV2FbOa7AooedmIXf8/hgdXZkkQ7irUCc=; b=MXCt+wIUmiiUzca1QvVcawGi0lFp7EDOiqc+TT7fPEl2Ga6yIDCKlhDe J9GXfG8JixREBdHZTfCUXjR435O+PGvGgJalcPGW1poUbFVmVUH7MmlUK fkY0qcf/idr9e2qcJkg4SPsibhLNCVK2GfuUQWN0mwBS7zf8CXct6j8Gm M=; X-CSE-ConnectionGUID: 4+Q3FWGMT3mjMiCzWEe/hA== X-CSE-MsgGUID: BihqDPxgQLabhY16IbKr7g== X-IPAS-Result: A0A6AADjlXxn/5IQJK1aHQEBAQEJARIBBQUBgX8IAQsBgkqBT0NIjHJfpw2BJQNWDwEBAQ9EBAEBhQcCinQCJjQJDgECBAEBAQEDAgMBAQEBAQEBAQEBAQsBAQUBAQECAQcFgQ4ThgiGWwIBAycLAUYQUSsrBxKDAYJlA7A/gXkzgQHeM4FtgUgBhWqHX3CEdycbgUlEgRWBO4ItiwcEgjOFOYZmhx6PcEiBIQNZLAFVEw0KCwcFgTk6AyILCwwLFBwVAhUfEgYVBHREOYJGaUk3Ag0CNYIeJFiCK4RchEeEVoJJVYJIghd8gRqCQS1AAwsYDUgRLDcGDhsGPm4HmmY8g20BgQ58lRWSH4tylRGEJYFjn2MaM4QElAaSSZh8IoI2oW+EZoFnPIFZMxoIGxWDIlIZD44tFrgHJTI8AgcLAQEDCZF0AQE IronPort-Data: A9a23:9o2QUai20wwljWklZntGf5R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:47OZIgbeBur3GOBTnT7snR1aJMhRx62kCHFUz7QMmNPbOnkl X-IronPort-Anti-Spam-Filtered: true X-IronPort-AV: E=Sophos;i="6.12,294,1728950400"; d="scan'208";a="423805522" Received: from alln-l-core-09.cisco.com ([173.36.16.146]) by alln-iport-3.cisco.com with ESMTP/TLS/TLS_AES_256_GCM_SHA384; 07 Jan 2025 02:51:40 +0000 Received: from cisco.com (savbu-usnic-a.cisco.com [10.193.184.48]) by alln-l-core-09.cisco.com (Postfix) with ESMTP id 96BE11800022D; Tue, 7 Jan 2025 02:51:40 +0000 (GMT) Received: by cisco.com (Postfix, from userid 392789) id 6740820F2004; Mon, 6 Jan 2025 18:51:40 -0800 (PST) From: John Daley To: benve@cisco.com, satishkh@cisco.com, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org Cc: John Daley , Nelson Escobar Subject: [PATCH net-next 1/2] enic: Move RX coalescing set function Date: Mon, 6 Jan 2025 18:51:34 -0800 Message-Id: <20250107025135.15167-2-johndale@cisco.com> X-Mailer: git-send-email 2.35.2 In-Reply-To: <20250107025135.15167-1-johndale@cisco.com> References: <20250107025135.15167-1-johndale@cisco.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Outbound-SMTP-Client: 10.193.184.48, savbu-usnic-a.cisco.com X-Outbound-Node: alln-l-core-09.cisco.com X-Patchwork-Delegate: kuba@kernel.org Move the function used for setting the RX coalescing range to before the function that checks the link status. It needs to be called from there instead of from the probe function. There is no functional change. Co-developed-by: Nelson Escobar Signed-off-by: Nelson Escobar Co-developed-by: Satish Kharat Signed-off-by: Satish Kharat Signed-off-by: John Daley Reviewed-by: Michal Swiatkowski Reviewed-by: Andrew Lunn --- drivers/net/ethernet/cisco/enic/enic_main.c | 60 ++++++++++----------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/drivers/net/ethernet/cisco/enic/enic_main.c b/drivers/net/ethernet/cisco/enic/enic_main.c index 9913952ccb42..957efe73e41a 100644 --- a/drivers/net/ethernet/cisco/enic/enic_main.c +++ b/drivers/net/ethernet/cisco/enic/enic_main.c @@ -428,6 +428,36 @@ static void enic_mtu_check(struct enic *enic) } } +static void enic_set_rx_coal_setting(struct enic *enic) +{ + unsigned int speed; + int index = -1; + struct enic_rx_coal *rx_coal = &enic->rx_coalesce_setting; + + /* 1. Read the link speed from fw + * 2. Pick the default range for the speed + * 3. Update it in enic->rx_coalesce_setting + */ + speed = vnic_dev_port_speed(enic->vdev); + if (speed > ENIC_LINK_SPEED_10G) + index = ENIC_LINK_40G_INDEX; + else if (speed > ENIC_LINK_SPEED_4G) + index = ENIC_LINK_10G_INDEX; + else + index = ENIC_LINK_4G_INDEX; + + rx_coal->small_pkt_range_start = mod_range[index].small_pkt_range_start; + rx_coal->large_pkt_range_start = mod_range[index].large_pkt_range_start; + rx_coal->range_end = ENIC_RX_COALESCE_RANGE_END; + + /* Start with the value provided by UCSM */ + for (index = 0; index < enic->rq_count; index++) + enic->cq[index].cur_rx_coal_timeval = + enic->config.intr_timer_usec; + + rx_coal->use_adaptive_rx_coalesce = 1; +} + static void enic_link_check(struct enic *enic) { int link_status = vnic_dev_link_status(enic->vdev); @@ -1901,36 +1931,6 @@ static void enic_synchronize_irqs(struct enic *enic) } } -static void enic_set_rx_coal_setting(struct enic *enic) -{ - unsigned int speed; - int index = -1; - struct enic_rx_coal *rx_coal = &enic->rx_coalesce_setting; - - /* 1. Read the link speed from fw - * 2. Pick the default range for the speed - * 3. Update it in enic->rx_coalesce_setting - */ - speed = vnic_dev_port_speed(enic->vdev); - if (ENIC_LINK_SPEED_10G < speed) - index = ENIC_LINK_40G_INDEX; - else if (ENIC_LINK_SPEED_4G < speed) - index = ENIC_LINK_10G_INDEX; - else - index = ENIC_LINK_4G_INDEX; - - rx_coal->small_pkt_range_start = mod_range[index].small_pkt_range_start; - rx_coal->large_pkt_range_start = mod_range[index].large_pkt_range_start; - rx_coal->range_end = ENIC_RX_COALESCE_RANGE_END; - - /* Start with the value provided by UCSM */ - for (index = 0; index < enic->rq_count; index++) - enic->cq[index].cur_rx_coal_timeval = - enic->config.intr_timer_usec; - - rx_coal->use_adaptive_rx_coalesce = 1; -} - static int enic_dev_notify_set(struct enic *enic) { int err;