On Fri, 13 Dec 2024 12:06:01 -0800 lon...@linuxonhyperv.com wrote:
> Other kernel APIs (e.g those in "include/linux/netdevice.h") check for
> IFF_MASTER, IFF_SLAVE and IFF_BONDING for determing if those are used
> in a master/slave bonded setup. RDMA uses those APIs extensively when
> looking for master/slave devices. Netvsc's bonding setup with its slave
> device falls into this category.
> 
> Make hv_netvsc properly indicate bonding with its slave and change the
> API to reflect this bonding setup.

This is severely lacking in terms of safety analysis.

> @@ -2204,6 +2204,10 @@ static int netvsc_vf_join(struct net_device *vf_netdev,
>               goto rx_handler_failed;
>       }
>  
> +     vf_netdev->permanent_bond = 1;
> +     ndev->permanent_bond = 1;
> +     ndev->flags |= IFF_MASTER;

> @@ -2484,7 +2488,15 @@ static int netvsc_unregister_vf(struct net_device 
> *vf_netdev)
>  
>       reinit_completion(&net_device_ctx->vf_add);
>       netdev_rx_handler_unregister(vf_netdev);
> +
> +     /* Unlink the slave device and clear flag */
> +     vf_netdev->permanent_bond = 0;
> +     ndev->permanent_bond = 0;

> + *   @permanent_bond: device is permanently bonded to another device

I think we have been taught a definition of the word "permanent"

Reply via email to