Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

vmxnet3: introduce command to register memory region

In vmxnet3 version 3, the emulation added support for the vmxnet3 driver
to communicate information about the memory regions the driver will use
for rx/tx buffers. The driver can also indicate which rx/tx queue the
memory region is applicable for. If this information is communicated
to the emulation, the emulation will always keep these memory regions
mapped, thereby avoiding the mapping/unmapping overhead for every packet.

Currently, Linux vmxnet3 driver does not leverage this capability. The
feasibility of using this approach for the Linux vmxnet3 driver will be
investigated independently and if possible, will be part of a different
patch. This patch only exposes the emulation capability to the driver
(vmxnet3_defs.h is identical between the driver and the emulation).

Signed-off-by: Guolin Yang <gyang@vmware.com>
Signed-off-by: Shrikrishna Khare <skhare@vmware.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Shrikrishna Khare and committed by
David S. Miller
47443222 4edef40e

+17
+17
drivers/net/vmxnet3/vmxnet3_defs.h
··· 81 81 VMXNET3_CMD_RESERVED2, 82 82 VMXNET3_CMD_RESERVED3, 83 83 VMXNET3_CMD_SET_COALESCE, 84 + VMXNET3_CMD_REGISTER_MEMREGS, 84 85 85 86 VMXNET3_CMD_FIRST_GET = 0xF00D0000, 86 87 VMXNET3_CMD_GET_QUEUE_STATUS = VMXNET3_CMD_FIRST_GET, ··· 667 666 struct Vmxnet3_CoalesceRbc coalRbc; 668 667 struct Vmxnet3_CoalesceStatic coalStatic; 669 668 } coalPara; 669 + }; 670 + 671 + struct Vmxnet3_MemoryRegion { 672 + __le64 startPA; 673 + __le32 length; 674 + __le16 txQueueBits; 675 + __le16 rxQueueBits; 676 + }; 677 + 678 + #define MAX_MEMORY_REGION_PER_QUEUE 16 679 + #define MAX_MEMORY_REGION_PER_DEVICE 256 680 + 681 + struct Vmxnet3_MemRegs { 682 + __le16 numRegs; 683 + __le16 pad[3]; 684 + struct Vmxnet3_MemoryRegion memRegs[1]; 670 685 }; 671 686 672 687 /* If the command data <= 16 bytes, use the shared memory directly.