From: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
To: John Daley <johndale@cisco.com>
Cc: 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,
Nelson Escobar <neescoba@cisco.com>
Subject: Re: [PATCH net-next 1/2] enic: Move RX coalescing set function
Date: Tue, 7 Jan 2025 06:51:28 +0100 [thread overview]
Message-ID: <Z3zA4LJD0Eak0kZt@mev-dev.igk.intel.com> (raw)
In-Reply-To: <20250107025135.15167-2-johndale@cisco.com>
On Mon, Jan 06, 2025 at 06:51:34PM -0800, John Daley wrote:
> 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 <neescoba@cisco.com>
> Signed-off-by: Nelson Escobar <neescoba@cisco.com>
> Co-developed-by: Satish Kharat <satishkh@cisco.com>
> Signed-off-by: Satish Kharat <satishkh@cisco.com>
> Signed-off-by: John Daley <johndale@cisco.com>
> ---
> 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;
> --
> 2.35.2
Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
next prev parent reply other threads:[~2025-01-07 5:54 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-07 2:51 [PATCH net-next 0/2] enic: Set link speed only after link up John Daley
2025-01-07 2:51 ` [PATCH net-next 1/2] enic: Move RX coalescing set function John Daley
2025-01-07 5:51 ` Michal Swiatkowski [this message]
2025-01-07 13:35 ` Andrew Lunn
2025-01-07 2:51 ` [PATCH net-next 2/2] enic: Obtain the Link speed only after the link comes up John Daley
2025-01-07 5:58 ` Michal Swiatkowski
2025-01-07 19:53 ` John Daley
2025-01-08 6:00 ` Michal Swiatkowski
2025-01-07 13:37 ` Andrew Lunn
2025-01-07 21:48 ` John Daley
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Z3zA4LJD0Eak0kZt@mev-dev.igk.intel.com \
--to=michal.swiatkowski@linux.intel.com \
--cc=andrew+netdev@lunn.ch \
--cc=benve@cisco.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=johndale@cisco.com \
--cc=kuba@kernel.org \
--cc=neescoba@cisco.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=satishkh@cisco.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).