[etherlab-dev] ec_lock_* vs. ec_ioctl_lock in master/ioctl.c

Esben Haabendal esben.haabendal at gmail.com
Tue Feb 27 16:39:10 CET 2018


Hi

I have been fixing a number of locking related issues, and have a hard
time figuring out how to handle locking in general, and in
master/ioctl.c in particular.

As of patch
base/0017-Master-locks-to-avoid-corrupted-datagram-queue.patch
there is now the macro pair of
ec_ioctl_lock_down_interruptible() and ec_ioctl_lock_up(), which maps to
ec_lock_down_interruptible() and ec_lock_up() for the non RTDM use-case.

But looking at the master/ioctl.c file as of patchset version 20171108,
there are the following number of calls:

8   ec_lock_down()
52  ec_lock_down_interruptible()
129 ec_lock_up()
6   ec_ioctl_lock_up()
4   ec_ioctl_lock_down_interruptible()

When should the ec_lock_* functions be called directly, and when should
they be wrapped (and thus compiled out for RTDM)?

And how is this supposed to work for RTDM in the first place?
I mean, there are code outside of ioctl.c which is called from ioctl.c
which are taking locks.  Isn't this kind of defeating the purpose of
this idea?

Also, as far as I can see, EC_IOCTL_RTDM is only defined when compiling
rtdm-ioctl.c.  When and how is master/ioctl.c supposed to be compiled
with EC_IOCTL_RTDM defined?

Best regards,
Esben Haabendal



More information about the Etherlab-dev mailing list