netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Roger Quadros <rogerq@kernel.org>
To: Diogo Ivo <diogo.ivo@siemens.com>,
	danishanwar@ti.com, davem@davemloft.net, edumazet@google.com,
	kuba@kernel.org, pabeni@redhat.com, grygorii.strashko@ti.com,
	andrew@lunn.ch, linux-arm-kernel@lists.infradead.org,
	netdev@vger.kernel.org
Cc: Jan Kiszka <jan.kiszka@siemens.com>
Subject: Re: [PATCH v2 6/8] net: ti: icssg-ethtool: Adjust channel count for SR1.0
Date: Mon, 22 Jan 2024 15:42:53 +0200	[thread overview]
Message-ID: <81aa3232-b706-4931-87a2-13dfed82e9c7@kernel.org> (raw)
In-Reply-To: <20240117161602.153233-7-diogo.ivo@siemens.com>



On 17/01/2024 18:15, Diogo Ivo wrote:
> SR1.0 uses the highest priority channel to transmit control
> messages to the firmware. Take this into account when computing
> channels.
> 
> Based on the work of Roger Quadros in TI's 5.10 SDK [1].
> 
> [1]: https://git.ti.com/cgit/ti-linux-kernel/ti-linux-kernel/tree/?h=ti-linux-5.10.y
> 
> Co-developed-by: Jan Kiszka <jan.kiszka@siemens.com>
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> Signed-off-by: Diogo Ivo <diogo.ivo@siemens.com>
> ---
>  drivers/net/ethernet/ti/icssg/icssg_ethtool.c | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/ti/icssg/icssg_ethtool.c b/drivers/net/ethernet/ti/icssg/icssg_ethtool.c
> index a27ec1dcc8d5..29e67526fa22 100644
> --- a/drivers/net/ethernet/ti/icssg/icssg_ethtool.c
> +++ b/drivers/net/ethernet/ti/icssg/icssg_ethtool.c
> @@ -141,6 +141,9 @@ static int emac_set_channels(struct net_device *ndev,
>  		return -EBUSY;
>  
>  	emac->tx_ch_num = ch->tx_count;
> +	/* highest channel number for management messaging on SR1 */
> +	if (emac->is_sr1)
> +		emac->tx_ch_num++;

I don't recollect now but is management channel always pinned to the highest priority
channel?

Wouldn't it be better if we don't mix up management channel details here
in emac_get/set_channels(). So this patch is not required and we only need
to set ch->max_tx to PRUETH_MAX_TX_QUEUES-1 for sr1?

>  
>  	return 0;
>  }
> @@ -151,9 +154,12 @@ static void emac_get_channels(struct net_device *ndev,
>  	struct prueth_emac *emac = netdev_priv(ndev);
>  
>  	ch->max_rx = 1;
> -	ch->max_tx = PRUETH_MAX_TX_QUEUES;

Leave the above intact and add
	if (emac->is_sr1)
		ch->max_tx--;

> +	/* SR1 use high priority channel for management messages */
> +	ch->max_tx = emac->is_sr1 ? PRUETH_MAX_TX_QUEUES - 1 :
> +				    PRUETH_MAX_TX_QUEUES;
>  	ch->rx_count = 1;
> -	ch->tx_count = emac->tx_ch_num;
> +	ch->tx_count = emac->is_sr1 ? emac->tx_ch_num - 1 :
> +				      emac->tx_ch_num;
>  }
>  
>  static const struct ethtool_rmon_hist_range emac_rmon_ranges[] = {

-- 
cheers,
-roger

  reply	other threads:[~2024-01-22 13:42 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-17 16:14 [PATCH v2 0/8] Add support for ICSSG-based Ethernet on SR1.0 devices Diogo Ivo
2024-01-17 16:14 ` [PATCH v2 1/8] dt-bindings: net: Add support for AM65x SR1.0 in ICSSG Diogo Ivo
2024-01-17 17:35   ` Rob Herring
2024-01-17 16:14 ` [PATCH v2 3/8] net: ti: icssg-prueth: add SR1.0-specific configuration bits Diogo Ivo
2024-01-17 16:14 ` [PATCH v2 4/8] net: ti: icssg-classifier: Add support for SR1.0 Diogo Ivo
2024-01-17 20:48   ` Andrew Lunn
2024-01-17 16:14 ` [PATCH v2 5/8] net: ti: icssg-config: Add SR1.0 configuration functions Diogo Ivo
2024-01-17 16:15 ` [PATCH v2 6/8] net: ti: icssg-ethtool: Adjust channel count for SR1.0 Diogo Ivo
2024-01-22 13:42   ` Roger Quadros [this message]
2024-01-17 16:15 ` [PATCH v2 7/8] net: ti: iccsg-prueth: Add necessary functions for SR1.0 support Diogo Ivo
2024-01-17 20:56   ` Andrew Lunn
2024-01-17 16:15 ` [PATCH v2 8/8] net: ti: icssg-prueth: Wire up support for SR1.0 Diogo Ivo
2024-01-18  1:16 ` [PATCH v2 0/8] Add support for ICSSG-based Ethernet on SR1.0 devices Jakub Kicinski
2024-01-23 12:15 ` Roger Quadros
2024-01-24  9:24   ` Diogo Ivo

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=81aa3232-b706-4931-87a2-13dfed82e9c7@kernel.org \
    --to=rogerq@kernel.org \
    --cc=andrew@lunn.ch \
    --cc=danishanwar@ti.com \
    --cc=davem@davemloft.net \
    --cc=diogo.ivo@siemens.com \
    --cc=edumazet@google.com \
    --cc=grygorii.strashko@ti.com \
    --cc=jan.kiszka@siemens.com \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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).