Skip to content

io_uring_register_ifq() returns EEIXST when testing zero-copy RX #1550

@youngmin-kaist

Description

@youngmin-kaist

Problem: io_uring_register_ifq() returns -17, EEIXST

I'm testing io_uring zero-copy RX and sometimes encountering an EEXIST error from io_uring_register_ifq() when I run the program multiple times.

Test environment
Kernel version: 6.19.0-061900rc5-generic
liburing version: 2.11
HW: NVIDIA connectx-7 NIC, fw_version: 28.42.1000

Reason
I looked at the source code and found that it returns EEXIST when rxq has mp_ops

	rxq = __netif_get_rx_queue(dev, rxq_idx);
	if (rxq->mp_params.mp_ops) {
		NL_SET_ERR_MSG(extack, "designated queue already memory provider bound");
		return -EEXIST;
	}

I ran bpftrace to check this is the problem.

'kprobe:__net_mp_open_rxq
/((struct net_device *)arg0)->ifindex == 3/
{
  $dev = (struct net_device *)arg0;
  $qid = arg1;
  $rxq = (struct netdev_rx_queue *)($dev->_rx + $qid);

  @watch[tid] = 1;
  printf("enter ifindex=%d q=%d mp_ops=%p mp_priv=%p\n",
         $dev->ifindex, $qid,
         $rxq->mp_params.mp_ops,
         $rxq->mp_params.mp_priv);
}

kretprobe:__net_mp_open_rxq
/@watch[tid]/
{
  printf("ret=%d\n", retval);
  delete(@watch[tid]);
}'

And found that rxq has mp_ops.

enter ifindex=3 q=6 mp_ops=0xffffffffa56a32e0 mp_priv=0xff294f20e2856cc0
ret=-17

I tried to reload the interface using ifconfig down/up, it sometimes work but not always. How can I solve the problem deterministically?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions