1

In a lot of Linux kernel modules (hardware drivers) their source header files, one can spot lines like:

#ifndef __VMKLNX__

__VMKLNX__ is not defined in the source code of this module. A guess is that __VMKLNX__ is a "C" system specific predefined macro. Maybe related to virtual machines or even VMware. However I can't find any authoritative source to confirm this.

What is and how/where can I find the meaning of this __VMKLNX__ part?

Pro Backup
  • 729
  • 14
  • 34
  • I would guess it stands for "virtual memory", since Linux also supports systems without an MMU. – o11c Oct 09 '14 at 23:11

1 Answers1

3

That means the driver supports being built for the VMware ESX kernel, whose documentation and source code are not public. The VMware ESX kernel is a hypervisor commonly called "vmkernel". You can infer what __VMKLNX__ is for by looking at code comments in existing drivers, like in bnx2.c:

#if defined(__VMKLNX__)
/* On VMware ESX there is a possibility that that netdev watchdog thread
 * runs before the reset task if the machine is loaded.  If this occurs
 * too many times, these premature watchdog triggers will cause a PSOD
 * on a VMware ESX beta build */ 
#define TX_TIMEOUT  (20*HZ)
#else
#define TX_TIMEOUT  (5*HZ)
#endif /* defined(__VMKLNX__) */

VMware ESX isn't linux, though. The ESX kernel just implements an interface that allows it to run Linux device drivers.

indiv
  • 17,306
  • 6
  • 61
  • 82