mlx5_eswitch_enable_locked(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ mlx5_eswitch_enable_locked(9) ✨

okay so bestie, welcome to the Kernel API Manual πŸ’– this one is literally called mlx5_eswitch_enable_locked and it does exactly what it says on the tin: it enables the eswitch. that's it, that's the vibe. no cap, it's giving "small function, big responsibilities" πŸ‘‘


πŸŽ€ NAME πŸŽ€

mlx5_eswitch_enable_locked β€” Enable eswitch ✨


πŸ¦‹ SYNOPSIS πŸ¦‹

int mlx5_eswitch_enable_locked (struct mlx5_eswitch *esw , int num_vfs );

like, it takes a pointer to an eswitch and a number of VFs and hands you back an int. simple slay πŸ’…


🌸 ARGUMENTS 🌸

  • esw β€” bestie, this is a pointer to the eswitch. that's the whole thing. it's the main character of this function 🫢
  • num_vfs β€” Enable eswitch for given number of VFs. This is optional. Valid value are 0, > 0 and MLX5_ESWITCH_IGNORE_NUM_VFS. here's the whole breakdown because it's lowkey important:
    • Caller should pass num_vfs > 0 when enabling eswitch for vf vports. πŸ”₯
    • Caller should pass num_vfs = 0, when eswitch is enabled without sriov VFs or when caller is unaware of the sriov state of the host PF on ECPF based eswitch. πŸ™ˆ
    • Caller should pass < 0 when num_vfs should be completely ignored. This is typically the case when eswitch is enabled without sriov regardless of PF/ECPF system. πŸ’€

and now the actual behaviour, because yes there's lore: mlx5_eswitch_enable_locked Enables eswitch in either legacy or offloads mode. If num_vfs >=0 is provided, it setup VF related eswitch vports. It returns 0 on success or error code on failure. so like, 0 = we ate πŸ“, anything else = check the error code bestie 😭


🌈 SEE ALSO 🌈


🧚 sign-off 🧚

this little gem comes to you courtesy of ./drivers/net/ethernet/mellano... and it's dated October 2026 β€” so mark your calendars bestie, and remember: locked means locked, hold that lock properly or it's not gonna be iconic πŸ’œ πŸ’… ✨

πŸ“¦ where this page comes from