From patchwork Thu Jan 2 22:24:26 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Daley X-Patchwork-Id: 13924985 X-Patchwork-Delegate: kuba@kernel.org Received: from alln-iport-8.cisco.com (alln-iport-8.cisco.com [173.37.142.95]) (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 7DBC21A8F9A for ; Thu, 2 Jan 2025 22:25:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=173.37.142.95 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735856723; cv=none; b=oky5Fykbxs84/nyQWrFnindBqksp04oP3m1x2ILiEWDKgodPeV5GVn7p3BrDYcpd98RzB5VeBND9Oa8OoErhM3NIMTn4Gh1yJ09M/iPtpOvdw7YAV9CnFZg3G7Zh4O2jqfKeeWSM3MilklBr03abg/1PzRzSGv5CDfhPDBRT7is= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735856723; c=relaxed/simple; bh=qeTewmqwSrOs8bYjJ+5ITjSqi0F3qN8mJGmbLUGHrjU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=oytbEtw9DD2sSicdYMFdRYiVZiHEuo4Jp6Lrf9v0o21E83v4oZ0a5X2rnnYuMt/1tE0ED1YlMAFMsKq5JjHkh93oMImFOlerAilFwwxn3edDxjp7JHQlX5xKc67Er2obNszsN91JYuihe0DOVQ5q+9aZ59k2BDrHpC8NVtzlzqE= 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=NcAkMSnz; arc=none smtp.client-ip=173.37.142.95 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="NcAkMSnz" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cisco.com; i=@cisco.com; l=3131; q=dns/txt; s=iport; t=1735856721; x=1737066321; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=GyX0+WH5s3r+DRb+YeqbtPUswHg2E8oZDXD3UkWxyqo=; b=NcAkMSnze3jwcyJefdSMX86M5QMRwdPKIrBmaJBYfq7JrBszDhM0/GcY LYANoNWZbzBRprTfyqaDZeFrUWBQ5r2it8WqZUa2ZgLj6gdhzv2l506RN MKRghtfI8jBxJh6KjD101JEQ4oJX96cuIExB2YsohX+9hOnm09oOv4C8c 4=; X-CSE-ConnectionGUID: Bdfvx99/QMKcSggux2+lyA== X-CSE-MsgGUID: CPfjqbaORcqmZpCLiqNlBg== X-IPAS-Result: A0ATAADxEHdnj4oQJK1aHQEBAQEJARIBBQUBgX8IAQsBhBlDSIxyX6cNgSUDVg8BAQEPRAQBAYUHAopvAiY0CQ4BAgQBAQEBAwIDAQEBAQEBAQEBAQELAQEFAQEBAgEHBRQBAQEBAQE5BUmGCIZbAgEDJwsBRhBRKysHEoMBgmUDsxaBeTOBAd4zgW2BSAGFaodfcIR3JxuBSUSBFYE7gi2LBwSCM4ZVhm6HH49KSIEhA1ksAVUTDQoLBwWBOToDIgsLDAsUHBUCgRqBAhQGFQSBC0U9gkhpSTcCDQI2giAkWIIrhF2ER4RWgklVgkiCF3yBGoIqQAMLGA1IESw3Bg4bBj5uB5t5PINtAYEOfJUVkh+LcpURhCSBY59jGjOEBJQFkkmYfCKCNaFvhGaBZzqBWzMaCBsVgyJSGQ+OLQ0JsHIlMjwCBwsBAQMJkVYBAQ IronPort-Data: A9a23:YeVoZ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OkE7DrL/3XhRcCBkXsqpwyCmXuWCOQFhUHowEOPcxKhpeopu2cxoehTgo BmAtrtj4AOn3xXvcFzSAlg6MeOHdcgk9xoTY3dzVWtELlB/Ou5DGo9DLMNvJdHKNYVLkZZJc hXyU5zZU6QSE2WeoWR1gFuUhNUKSSlHTDmmZ0KNCAXTtbY5L+AV0rcIpjfSyRQ= IronPort-HdrOrdr: A9a23:qQrbzqNaCbILH8BcTsajsMiBIKoaSvp037Dk7S9MoHtuA6ulfq +V/cjzuSWYtN9VYgBDpTniAtjlfZqjz/5ICOAqVN/INjUO+lHYSb2KhrGN/9SPIUHDH5ZmpM Rdm2wUMqyIMbC85vyKhjWFLw== X-Talos-CUID: 9a23:1XDeB2FK8mD7tQpyqmJN+EAKCpF0NUT473zrLEClGTwqTKy8HAo= X-Talos-MUID: 9a23:7rJsMwzQrCqtdQV0olNiu8Qkt3OaqI+WBkIUm5whgcKdMB5oEBOclRKzaIByfw== X-IronPort-Anti-Spam-Filtered: true X-IronPort-AV: E=Sophos;i="6.12,286,1728950400"; d="scan'208";a="407974215" Received: from alln-l-core-01.cisco.com ([173.36.16.138]) by alln-iport-8.cisco.com with ESMTP/TLS/TLS_AES_256_GCM_SHA384; 02 Jan 2025 22:25:12 +0000 Received: from cisco.com (savbu-usnic-a.cisco.com [10.193.184.48]) by alln-l-core-01.cisco.com (Postfix) with ESMTP id 869581800019B; Thu, 2 Jan 2025 22:25:12 +0000 (GMT) Received: by cisco.com (Postfix, from userid 392789) id 35AA720F2008; Thu, 2 Jan 2025 14:25:12 -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 v4 5/6] enic: Move RX coalescing set function Date: Thu, 2 Jan 2025 14:24:26 -0800 Message-Id: <20250102222427.28370-6-johndale@cisco.com> X-Mailer: git-send-email 2.35.2 In-Reply-To: <20250102222427.28370-1-johndale@cisco.com> References: <20250102222427.28370-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-01.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 --- 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 5bfd89749237..21cbd7ed7bda 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); @@ -1816,36 +1846,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;