I have written/writing a kernel device driver to intercept IP packets and pass the packets to the user-space application via a character device. The device driver is written to be consistent with the following interface specification:
Some additional information relating to the implementation:
- in the attach routine, additional minor devices are created via the ddi_create_minor_node routine of spec_type S_IFCHR and node_type DDI_PSEUDO;
these are used for input/output between the user-space application and device driver
- the poll entry point follows the approach described in the document rigidly
- pollwakeup is invoked as described on page 25 whenever an event/packet of interest to the application is detected by the driver
- there is no mutex contention between pollwakeup & the chpoll routines
The kernel device driver has been functioning normally for Solaris 10 (SPARC) MU5, and Solaris 10 (SPARC) MU6, Sparc hardware with the exception outlined below.
If the application exits/terminates abnormally, the device driver continues to write to the character device based on rules supplied by the user application. With each write operation, the device attempts to wake the user-space application via the routine pollwakeup. However, when the user application is no longer running (and rules exist for the kernel driver to write to the pseudo-device), the kernel blocks on the pollwakeup. The overall impact is that the system hangs indefinitely and the only way forward is to reboot the host.
Any help/guidance leading to a resolution of this issue would be greatly appreciated.