All of lore.kernel.org
 help / color / mirror / Atom feed
From: Roger Quadros <rogerq@kernel.org>
To: Vladimir Oltean <vladimir.oltean@nxp.com>
Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com, s-vadapalli@ti.com, r-gunasekaran@ti.com,
	vigneshr@ti.com, srk@ti.com, horms@kernel.org, p-varis@ti.com,
	netdev@vger.kernel.org
Subject: Re: [PATCH v7 net-next 6/8] net: ethernet: ti: am65-cpsw-qos: Add Frame Preemption MAC Merge support
Date: Mon, 11 Dec 2023 14:25:35 +0200	[thread overview]
Message-ID: <0d2bfc00-86e4-440b-95d2-d25afd15c69f@kernel.org> (raw)
In-Reply-To: <20231211121105.l5nk47b5uaptzhay@skbuf>



On 11/12/2023 14:11, Vladimir Oltean wrote:
> On Fri, Dec 08, 2023 at 12:26:24PM +0200, Roger Quadros wrote:
>> On 08/12/2023 12:13, Roger Quadros wrote:
>>> Wondering how to fix this the right way. Should set/get_mm fail if CONFIG_TI_AM65_CPSW_TAS is not enabled?
>>>
>>
>> How about this fix?
>>
>> diff --git a/drivers/net/ethernet/ti/am65-cpsw-ethtool.c b/drivers/net/ethernet/ti/am65-cpsw-ethtool.c
>> index 1ac4b9b53c93..688291d6038f 100644
>> --- a/drivers/net/ethernet/ti/am65-cpsw-ethtool.c
>> +++ b/drivers/net/ethernet/ti/am65-cpsw-ethtool.c
>> @@ -775,6 +775,9 @@ static int am65_cpsw_get_mm(struct net_device *ndev, struct ethtool_mm_state *st
>>  	u32 port_ctrl, iet_ctrl, iet_status;
>>  	u32 add_frag_size;
>>  
>> +	if (!IS_ENABLED(CONFIG_TI_AM65_CPSW_TAS))
>> +		return -EOPNOTSUPP;
>> +
>>  	mutex_lock(&priv->mm_lock);
>>  
>>  	iet_ctrl = readl(port->port_base + AM65_CPSW_PN_REG_IET_CTRL);
>> @@ -827,6 +830,9 @@ static int am65_cpsw_set_mm(struct net_device *ndev, struct ethtool_mm_cfg *cfg,
>>  	u32 val, add_frag_size;
>>  	int err;
>>  
>> +	if (!IS_ENABLED(CONFIG_TI_AM65_CPSW_TAS))
>> +		return -EOPNOTSUPP;
>> +
>>  	err = ethtool_mm_frag_size_min_to_add(cfg->tx_min_frag_size, &add_frag_size, extack);
>>  	if (err)
>>  		return err;
>> diff --git a/drivers/net/ethernet/ti/am65-cpsw-qos.h b/drivers/net/ethernet/ti/am65-cpsw-qos.h
>> index 6df3c2c5a04b..946e89fbb314 100644
>> --- a/drivers/net/ethernet/ti/am65-cpsw-qos.h
>> +++ b/drivers/net/ethernet/ti/am65-cpsw-qos.h
>> @@ -100,6 +100,8 @@ void am65_cpsw_qos_link_up(struct net_device *ndev, int link_speed);
>>  void am65_cpsw_qos_link_down(struct net_device *ndev);
>>  int am65_cpsw_qos_ndo_tx_p0_set_maxrate(struct net_device *ndev, int queue, u32 rate_mbps);
>>  void am65_cpsw_qos_tx_p0_rate_init(struct am65_cpsw_common *common);
>> +void am65_cpsw_iet_commit_preemptible_tcs(struct am65_cpsw_port *port);
>> +void am65_cpsw_iet_common_enable(struct am65_cpsw_common *common);
>>  #else
>>  static inline int am65_cpsw_qos_ndo_setup_tc(struct net_device *ndev,
>>  					     enum tc_setup_type type,
>> @@ -124,10 +126,12 @@ static inline int am65_cpsw_qos_ndo_tx_p0_set_maxrate(struct net_device *ndev,
>>  
>>  static inline void am65_cpsw_qos_tx_p0_rate_init(struct am65_cpsw_common *common)
>>  { }
>> +static inline void am65_cpsw_iet_commit_preemptible_tcs(struct am65_cpsw_port *port)
>> +{ }
>> +static inline void am65_cpsw_iet_common_enable(struct am65_cpsw_common *common)
>> +{ }
>>  #endif
>>  
>> -void am65_cpsw_iet_commit_preemptible_tcs(struct am65_cpsw_port *port);
>> -void am65_cpsw_iet_common_enable(struct am65_cpsw_common *common);
>>  
>>  #define AM65_CPSW_REG_CTL			0x004
>>  #define AM65_CPSW_PN_REG_CTL			0x004
>>
>>
>> -- 
>> cheers,
>> -roger
> 
> I don't know, does it sound like it is related?
> 
> config TI_AM65_CPSW_TAS
> 	bool "Enable TAS offload in AM65 CPSW"
> 	depends on TI_K3_AM65_CPSW_NUSS && NET_SCH_TAPRIO && TI_K3_AM65_CPTS
> 	help
> 	  Say y here to support Time Aware Shaper(TAS) offload in AM65 CPSW.
> 	  AM65 CPSW hardware supports Enhanced Scheduled Traffic (EST)
> 	  defined in IEEE 802.1Q 2018. The EST scheduler runs on CPTS and the
> 	  TAS/EST schedule is updated in the Fetch RAM memory of the CPSW.

The config option mentions only about TAS/EST 802.1Qbv.
Maybe it needs to be extended to include IET/Frame-preeption 802.1Qbu as well?

This is the simplest way as the file am65-cpsw-qos.c can be completely omitted if
TI_AM65_CPSW_TSN is not set.

-- 
cheers,
-roger

  reply	other threads:[~2023-12-11 12:26 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-01 13:57 [PATCH v7 net-next 0/8] net: ethernet: am65-cpsw: Add mqprio, frame pre-emption & coalescing Roger Quadros
2023-12-01 13:57 ` [PATCH v7 net-next 1/8] net: ethernet: am65-cpsw: Build am65-cpsw-qos only if required Roger Quadros
2023-12-01 13:57 ` [PATCH v7 net-next 2/8] net: ethernet: am65-cpsw: cleanup TAPRIO handling Roger Quadros
2023-12-04 13:38   ` Vladimir Oltean
2023-12-01 13:57 ` [PATCH v7 net-next 3/8] net: ethernet: ti: am65-cpsw: Move code to avoid forward declaration Roger Quadros
2023-12-01 13:57 ` [PATCH v7 net-next 4/8] net: ethernet: am65-cpsw: Move register definitions to header file Roger Quadros
2023-12-01 13:57 ` [PATCH v7 net-next 5/8] net: ethernet: ti: am65-cpsw: add mqprio qdisc offload in channel mode Roger Quadros
2023-12-04 13:48   ` Vladimir Oltean
2023-12-01 13:58 ` [PATCH v7 net-next 6/8] net: ethernet: ti: am65-cpsw-qos: Add Frame Preemption MAC Merge support Roger Quadros
2023-12-01 16:01   ` [EXTERNAL] " Varis, Pekka
2023-12-04  9:30     ` Roger Quadros
2023-12-04 11:02       ` Vladimir Oltean
2023-12-04 11:10   ` Vladimir Oltean
2023-12-04 12:35   ` Vladimir Oltean
2023-12-08 10:13     ` Roger Quadros
2023-12-08 10:26       ` Roger Quadros
2023-12-08 12:33         ` Roger Quadros
2023-12-11 12:12           ` Vladimir Oltean
2023-12-11 12:14             ` Roger Quadros
2023-12-11 12:11         ` Vladimir Oltean
2023-12-11 12:25           ` Roger Quadros [this message]
2023-12-11 13:26             ` Vladimir Oltean
2023-12-07 15:24   ` Vladimir Oltean
2023-12-08 13:43     ` Roger Quadros
2023-12-11 13:29       ` Vladimir Oltean
2023-12-11 13:59         ` Roger Quadros
2023-12-01 13:58 ` [PATCH v7 net-next 7/8] net: ethernet: ti: am65-cpsw: add sw tx/rx irq coalescing based on hrtimers Roger Quadros
2023-12-01 13:58 ` [PATCH v7 net-next 8/8] selftests: forwarding: ethtool_mm: support devices with higher rx-min-frag-size Roger Quadros
2023-12-04 11:13   ` Vladimir Oltean
2023-12-04 12:36   ` Vladimir Oltean

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=0d2bfc00-86e4-440b-95d2-d25afd15c69f@kernel.org \
    --to=rogerq@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=p-varis@ti.com \
    --cc=pabeni@redhat.com \
    --cc=r-gunasekaran@ti.com \
    --cc=s-vadapalli@ti.com \
    --cc=srk@ti.com \
    --cc=vigneshr@ti.com \
    --cc=vladimir.oltean@nxp.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.