LIBNVMF_CONTEXT_SET_RECONNECT_POLICY-LIBNVME3(2)

πŸ“¦ version 3.2, in arch rolling

πŸ’… libnvmf_context_set_reconnect_policy β€” the one where you set the whole reconnect vibe in a single call

okay so bestie, welcome to the libnvme API manual ✨ this is page libnvmf_context_set_reconnect_policy(2), and it's genuinely one of those little convenience functions that lowkey saves your life. sit down, grab a πŸ“, let's go.


🌸 NAME 🌸

libnvmf_context_set_reconnect_policy β€” sets the reconnect policy for your context. that's it. that's the whole thing. and yet. πŸ’…


✨ SYNOPSIS ✨

int libnvmf_context_set_reconnect_policy (struct libnvmf_context *fctx ,
int ctrl_loss_tmo , int reconnect_delay , int fast_io_fail_tmo );

she takes four arguments and returns an int. iconic behavior honestly 🫢


πŸŽ€ ARGUMENTS πŸŽ€

  • fctx β€” the Fabrics context. your main character. everything happens inside her πŸ’–
  • ctrl_loss_tmo β€” the controller loss timeout, in seconds. and here's the fun part: if you pass a negative value, it means retry indefinitely. no cap, she will just keep going forever 😭
  • reconnect_delay β€” the delay between reconnect attempts, in seconds. the little breather between tries 🌸
  • fast_io_fail_tmo β€” the fast I/O fail timeout, in seconds. a negative value disables it. and ⚠️ it must not exceed ctrl_loss_tmo β€” like, that's a hard rule, do not test her.

πŸ¦‹ DESCRIPTION πŸ¦‹

so this is a convenience setter for the three coupled reconnect policy parameters β€” one call, all three, slay ✨

here's the tea on the coupling, and it's important so listen up:

  • ctrl_loss_tmo and reconnect_delay are coupled. the kernel literally derives the maximum reconnect attempt count from their ratio. so like, they're a package deal, you can't just set one and ignore the other's energy πŸ’€
  • fast_io_fail_tmo controls how quickly outstanding I/O gets failed while reconnection is in progress. so it's the "how fast do we give up on this I/O" dial πŸ”₯

and if you only need to change a subset of these, no worries bestie β€” the individual accessors are also available:

  • libnvmf_context_set_ctrl_loss_tmo
  • _set_reconnect_delay
  • _set_fast_io_fail_tmo

pick your fighter, use whichever fits the vibe check πŸ‘‘


⭐ RETURN ⭐

  • 0 on success πŸŽ‰
  • a negative error code otherwise 😭

ngl the whole thing is: three knobs, one function, don't let fast_io_fail_tmo be bigger than ctrl_loss_tmo, and negative numbers mean very different things depending on which argument you hand them to. read the arguments section again if you need to, i'll wait 🧚

and that's the page, bestie!! this gem is from the libnvme API manual, dated October 2026 β€” go forth and reconnect responsibly πŸ’œπŸŒˆπŸ‘‘

πŸ“¦ where this page comes from