Subject: Re: linux-next: manual merge of the rdma tree with Linus' tree

From: Stephen Rothwell <[email-masked]>
Date: Wed, 15 Jan 2025 08:27:21 +1100

Hi Jason,

On Tue, 14 Jan 2025 16:48:28 -0400 Jason Gunthorpe <[email-masked]> wrote:
>
> I think we need to retain the ib_get_curr_port_state() call:

Why?  It is no longer used to determine the attr->phys-state value and
then attr->state is set again just below.  And
ib_get_curr_port_state(ndev) dose not appear to have side effects.

> --- drivers/infiniband/sw/siw/siw_verbs.c       2025-01-14 16:37:02.023738738 -0400
> +++ /home/jgg/oss/testing-k.o/drivers/infiniband/sw/siw/siw_verbs.c     2025-01-14 16:42:50.797896811 -0400
> @@ -189,6 +189,7 @@
>         attr->max_msg_sz = -1;
>         attr->max_mtu = ib_mtu_int_to_enum(ndev->max_mtu);
>         attr->active_mtu = ib_mtu_int_to_enum(READ_ONCE(ndev->mtu));
> +       attr->state = ib_get_curr_port_state(ndev);
>         attr->phys_state = (netif_running(ndev) && netif_carrier_ok(ndev)) ?
>                 IB_PORT_PHYS_STATE_LINK_UP : IB_PORT_PHYS_STATE_DISABLED;
>         attr->state = attr->phys_state == IB_PORT_PHYS_STATE_LINK_UP ?

-- 
Cheers,
Stephen Rothwell