lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 18 Jun 2024 18:20:38 +0200
From: Przemek Kitszel <przemyslaw.kitszel@...el.com>
To: Jon Kohler <jon@...anix.com>
CC: Christian Benvenuti <benve@...co.com>, Satish Kharat <satishkh@...co.com>,
	"David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
	<netdev@...r.kernel.org>, <linux-kernel@...r.kernel.org>, Larysa Zaremba
	<larysa.zaremba@...el.com>
Subject: Re: [PATCH] enic: add ethtool get_channel support

On 6/18/24 18:01, Jon Kohler wrote:
> Add .get_channel to enic_ethtool_ops to enable basic ethtool -l
> support to get the current channel configuration.
> 
> Note that the driver does not support dynamically changing queue
> configuration, so .set_channel is intentionally unused. Instead, users
> should use Cisco's hardware management tools (UCSM/IMC) to modify
> virtual interface card configuration out of band.
> 
> Signed-off-by: Jon Kohler <jon@...anix.com>
> ---
>   drivers/net/ethernet/cisco/enic/enic_ethtool.c | 18 ++++++++++++++++++
>   1 file changed, 18 insertions(+)
> 
> diff --git a/drivers/net/ethernet/cisco/enic/enic_ethtool.c b/drivers/net/ethernet/cisco/enic/enic_ethtool.c
> index 241906697019..efbc0715b10e 100644
> --- a/drivers/net/ethernet/cisco/enic/enic_ethtool.c
> +++ b/drivers/net/ethernet/cisco/enic/enic_ethtool.c
> @@ -608,6 +608,23 @@ static int enic_get_ts_info(struct net_device *netdev,
>   	return 0;
>   }
>   
> +static void enic_get_channels(struct net_device *netdev,
> +			      struct ethtool_channels *channels)
> +{
> +	struct enic *enic = netdev_priv(netdev);
> +
> +	channels->max_rx = ENIC_RQ_MAX;
> +	channels->max_tx = ENIC_WQ_MAX;
> +	channels->rx_count = enic->rq_count;
> +	channels->tx_count = enic->wq_count;
> +
> +	/* enic doesn't use other channels or combined channels */
> +	channels->combined_count = 0;

my understanding is that effective Rx count is combined_count+rx_count,
analogous for Tx

and:
uapi/linux/ethtool.h:547: * @combined_count: Valid values are in the 
range 1 to the max_combined.

> +	channels->max_combined = 0;
> +	channels->max_other = 0;
> +	channels->other_count = 0;
> +}
> +
>   static const struct ethtool_ops enic_ethtool_ops = {
>   	.supported_coalesce_params = ETHTOOL_COALESCE_USECS |
>   				     ETHTOOL_COALESCE_USE_ADAPTIVE_RX |
> @@ -632,6 +649,7 @@ static const struct ethtool_ops enic_ethtool_ops = {
>   	.set_rxfh = enic_set_rxfh,
>   	.get_link_ksettings = enic_get_ksettings,
>   	.get_ts_info = enic_get_ts_info,
> +	.get_channels = enic_get_channels,
>   };
>   
>   void enic_set_ethtool_ops(struct net_device *netdev)


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ