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]
Message-ID: <CALs4sv3FC9ig1aJ2=Uwk-enXhb5_fwz1DU3Z_zpe76osS6_nBA@mail.gmail.com>
Date:   Fri, 24 Feb 2023 14:19:37 +0530
From:   Pavan Chebbi <pavan.chebbi@...adcom.com>
To:     Nick Child <nnac123@...ux.ibm.com>
Cc:     netdev@...r.kernel.org, bjking1@...ux.ibm.com, haren@...ux.ibm.com,
        ricklind@...ibm.com
Subject: Re: [PATCH net-next] ibmvnic: Assign XPS map to correct queue index

On Thu, Feb 23, 2023 at 9:10 PM Nick Child <nnac123@...ux.ibm.com> wrote:
>
> When setting the XPS map value for TX queues, use the index of the
> transmit queue.
> Previously, the function was passing the index of the loop that iterates
> over all queues (RX and TX). This was causing invalid XPS map values.
>
> Fixes: 6831582937bd ("ibmvnic: Toggle between queue types in affinity mapping")
> Signed-off-by: Nick Child <nnac123@...ux.ibm.com>

Fix looks good to me.
Reviewed-by: Pavan Chebbi <pavan.chebbi@...adcom.com>

> ---
>
> I am a little surprised that __netif_set_xps_queue() did not complain that some
> index values were greater than the number of tx queues. Though maybe the function
> assumes that the developers are wise enough :)

Are you sure an index greater than total tx queues was sent?
A quick look at ibmvnic_set_affinity() suggests that the condition if
(... || (i_txqs == num_txqs)) prevents overrunning available tx
queues.

>
> Should __netif_set_xps_queue() have a check that index < dev->num_tx_queues?
>
>  drivers/net/ethernet/ibm/ibmvnic.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
> index 146ca1d8031b..c63d3ec9d328 100644
> --- a/drivers/net/ethernet/ibm/ibmvnic.c
> +++ b/drivers/net/ethernet/ibm/ibmvnic.c
> @@ -296,10 +296,10 @@ static void ibmvnic_set_affinity(struct ibmvnic_adapter *adapter)
>
>                 rc = __netif_set_xps_queue(adapter->netdev,
>                                            cpumask_bits(queue->affinity_mask),
> -                                          i, XPS_CPUS);
> +                                          i_txqs - 1, XPS_CPUS);
>                 if (rc)
>                         netdev_warn(adapter->netdev, "%s: Set XPS on queue %d failed, rc = %d.\n",
> -                                   __func__, i, rc);
> +                                   __func__, i_txqs - 1, rc);
>         }
>
>  out:
> --
> 2.31.1
>

Download attachment "smime.p7s" of type "application/pkcs7-signature" (4209 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ