Thread (30 messages) 30 messages, 3 authors, 2023-12-11

Re: [PATCH v7 net-next 6/8] net: ethernet: ti: am65-cpsw-qos: Add Frame Preemption MAC Merge support

From: Roger Quadros <rogerq@kernel.org>
Date: 2023-12-11 12:14:18


On 11/12/2023 14:12, Vladimir Oltean wrote:
On Fri, Dec 08, 2023 at 02:33:00PM +0200, Roger Quadros wrote:
quoted
But,

bool __ethtool_dev_mm_supported(struct net_device *dev)
{
	const struct ethtool_ops *ops = dev->ethtool_ops;
	struct ethtool_mm_state state = {};
	int ret = -EOPNOTSUPP;

	if (ops && ops->get_mm)
		ret = ops->get_mm(dev, &state);

	return !ret;
}

So looks like it is better to not define get_mm/set_mm if CONFIG_TI_AM65_CPSW_TAS is disabled.
Why not? __ethtool_dev_mm_supported() returns true if os->get_mm() is
implemented and returns 0. You return -EOPNOTSUPP, and that's different
from 0.
Yes, I realized it eventually. Better to define it and return -EOPNOTSUPP if
CONFIG_TI_AM65_CPSW_TAS is not enabled.

-- 
cheers,
-roger
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help