iouring - animeshtrivedi/notes GitHub Wiki

Linux io_uring notes

Installing liburing from source

git clone https://github.com/axboe/liburing.git 
# [email protected]:axboe/liburing.git
cd liburing 
./configure --prefix=/home/atr/local/
make -j 
make install 

The .bashrc file contains the pkg_path configurations for others to pick up automatically.

Pass through code

https://github.com/torvalds/linux/blob/master/drivers/nvme/host/ioctl.c

static int nvme_ns_uring_cmd(struct nvme_ns *ns, struct io_uring_cmd *ioucmd,
			     unsigned int issue_flags)
{
	struct nvme_ctrl *ctrl = ns->ctrl;
	int ret;

	BUILD_BUG_ON(sizeof(struct nvme_uring_cmd_pdu) > sizeof(ioucmd->pdu));

	ret = nvme_uring_cmd_checks(issue_flags);
	if (ret)
		return ret;

	switch (ioucmd->cmd_op) {
	case NVME_URING_CMD_IO:
		ret = nvme_uring_cmd_io(ctrl, ns, ioucmd, issue_flags, false);
		break;
	case NVME_URING_CMD_IO_VEC:
		ret = nvme_uring_cmd_io(ctrl, ns, ioucmd, issue_flags, true);
		break;
	default:
		ret = -ENOTTY;
	}

	return ret;
}

From the paper, https://www.usenix.org/system/files/fast24-joshi.pdf

image

Enabling printf

Since the version 2.4 CONFIG_NOLBC is enabled by default, which include -nostdlic flag to gcc. In this case, we get

undefined reference to `__printf_chk'

When using printf.

So to disable this:

./configure --prefix=/home/atr/local/ --use-libc

Misc