[dpdk-dev] [PATCH 1/3] kcp: add kernel control path kernel module

Stephen Hemminger stephen at networkplumber.org
Mon Feb 29 21:11:58 CET 2016


On Wed, 27 Jan 2016 16:24:07 +0000
Ferruh Yigit <ferruh.yigit at intel.com> wrote:

> +static int
> +kcp_ioctl_release(unsigned int ioctl_num, unsigned long ioctl_param)
> +{
> +	int ret = -EINVAL;
> +	struct kcp_dev *dev;
> +	struct kcp_dev *n;
> +	char name[RTE_KCP_NAMESIZE];
> +	unsigned int instance = ioctl_param;
> +
> +	snprintf(name, RTE_KCP_NAMESIZE, "dpdk%u", instance);
> +
> +	down_write(&kcp_list_lock);


Some observations about how acceptable this will to upstream
kernel developers.

ioctl's are the lease favored form of API.

You chose the worst possible mutual exclusion read/write semaphores.
Read/write is slower than simpler primtives, and semaphores were
replaced for almost all usage models by mutexes (about 4 years ago).

Looks like you copied the out of date kernel API's used
by KNI.


More information about the dev mailing list