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:   Wed, 1 Mar 2023 20:11:12 -0800
From:   Jakub Kicinski <kuba@...nel.org>
To:     Shay Agroskin <shayagr@...zon.com>
Cc:     David Miller <davem@...emloft.net>, <netdev@...r.kernel.org>,
        "Woodhouse, David" <dwmw@...zon.com>,
        "Machulsky, Zorik" <zorik@...zon.com>,
        "Matushevsky, Alexander" <matua@...zon.com>,
        Saeed Bshara <saeedb@...zon.com>,
        "Wilson, Matt" <msw@...zon.com>,
        "Liguori, Anthony" <aliguori@...zon.com>,
        "Bshara, Nafea" <nafea@...zon.com>,
        "Belgazal, Netanel" <netanel@...zon.com>,
        "Saidi, Ali" <alisaidi@...zon.com>,
        "Herrenschmidt, Benjamin" <benh@...zon.com>,
        "Kiyanovski, Arthur" <akiyano@...zon.com>,
        "Dagan, Noam" <ndagan@...zon.com>,
        "Arinzon, David" <darinzon@...zon.com>,
        "Itzko, Shahar" <itzko@...zon.com>,
        "Abboud, Osama" <osamaabb@...zon.com>
Subject: Re: [PATCH RFC v1 net-next 5/5] net: ena: Advertise
 ETHTOOL_RING_USE_TX_PUSH_BUF_LEN support

On Wed, 1 Mar 2023 20:02:13 +0200 Shay Agroskin wrote:
> -static const struct ethtool_ops ena_ethtool_ops = {
> +static struct ethtool_ops ena_ethtool_ops = {
>  	.supported_coalesce_params = ETHTOOL_COALESCE_USECS |
>  				     ETHTOOL_COALESCE_USE_ADAPTIVE_RX,
>  	.get_link_ksettings	= ena_get_link_ksettings,
> @@ -967,8 +967,18 @@ static const struct ethtool_ops ena_ethtool_ops = {
>  	.get_ts_info            = ethtool_op_get_ts_info,
>  };
>  
> -void ena_set_ethtool_ops(struct net_device *netdev)
> +void ena_set_ethtool_ops(struct ena_adapter *adapter)
>  {
> +	struct net_device *netdev = adapter->netdev;
> +
> +	ena_ethtool_ops.supported_ring_params = 0;
> +	if (adapter->ena_dev->tx_mem_queue_type ==
> +	    ENA_ADMIN_PLACEMENT_POLICY_HOST)
> +		goto no_llq_supported;
> +
> +	ena_ethtool_ops.supported_ring_params |= ETHTOOL_RING_USE_TX_PUSH_BUF_LEN;
> +
> +no_llq_supported:
>  	netdev->ethtool_ops = &ena_ethtool_ops;
>  }

Don't update the global structures based on caps of a single device.
The opt-in is to declare that the driver will act on the value, doesn't
necessarily mean that given device can support the feature.
Leave ETHTOOL_RING_USE_TX_PUSH_BUF_LEN always set and error out
appropriately in ena_set_ringparam().

Option #2 is to refactor the supported features into a struct
and add a callback for driver to "fix up" the caps at request time.
But that'd touch a lot of drivers.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ