diff options
author | Shrikrishna Khare <skhare@vmware.com> | 2016-06-16 10:51:57 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-06-16 22:37:04 -0700 |
commit | 4edef40ef5f8d09a0b1ded4d1d9b0e988cd98e97 (patch) | |
tree | 5b2ebb62c8e7c7ec7fcf8ce514ed340d9365ef74 /drivers/net/vmxnet3/vmxnet3_defs.h | |
parent | 50a5ce3e7116a70edb7a1d1d209e3bc537752427 (diff) | |
download | lwn-4edef40ef5f8d09a0b1ded4d1d9b0e988cd98e97.tar.gz lwn-4edef40ef5f8d09a0b1ded4d1d9b0e988cd98e97.zip |
vmxnet3: add support for get_coalesce, set_coalesce ethtool operations
The emulation supports a variety of coalescing modes viz. disabled
(no coalescing), adaptive, static (number of packets to batch before
raising an interrupt), rate based (number of interrupts per second).
This patch implements get_coalesce and set_coalesce methods to allow
querying and configuring different coalescing modes.
Signed-off-by: Keyong Sun <sunk@vmware.com>
Signed-off-by: Manoj Tammali <tammalim@vmware.com>
Signed-off-by: Shrikrishna Khare <skhare@vmware.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/vmxnet3/vmxnet3_defs.h')
-rw-r--r-- | drivers/net/vmxnet3/vmxnet3_defs.h | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/drivers/net/vmxnet3/vmxnet3_defs.h b/drivers/net/vmxnet3/vmxnet3_defs.h index f3b31c2d8abc..274e145ab72a 100644 --- a/drivers/net/vmxnet3/vmxnet3_defs.h +++ b/drivers/net/vmxnet3/vmxnet3_defs.h @@ -80,6 +80,7 @@ enum { VMXNET3_CMD_LOAD_PLUGIN, VMXNET3_CMD_RESERVED2, VMXNET3_CMD_RESERVED3, + VMXNET3_CMD_SET_COALESCE, VMXNET3_CMD_FIRST_GET = 0xF00D0000, VMXNET3_CMD_GET_QUEUE_STATUS = VMXNET3_CMD_FIRST_GET, @@ -92,7 +93,8 @@ enum { VMXNET3_CMD_GET_DEV_EXTRA_INFO, VMXNET3_CMD_GET_CONF_INTR, VMXNET3_CMD_GET_RESERVED1, - VMXNET3_CMD_GET_TXDATA_DESC_SIZE + VMXNET3_CMD_GET_TXDATA_DESC_SIZE, + VMXNET3_CMD_GET_COALESCE, }; /* @@ -637,6 +639,35 @@ struct Vmxnet3_SetPolling { u8 enablePolling; }; +#define VMXNET3_COAL_STATIC_MAX_DEPTH 128 +#define VMXNET3_COAL_RBC_MIN_RATE 100 +#define VMXNET3_COAL_RBC_MAX_RATE 100000 + +enum Vmxnet3_CoalesceMode { + VMXNET3_COALESCE_DISABLED = 0, + VMXNET3_COALESCE_ADAPT = 1, + VMXNET3_COALESCE_STATIC = 2, + VMXNET3_COALESCE_RBC = 3 +}; + +struct Vmxnet3_CoalesceRbc { + u32 rbc_rate; +}; + +struct Vmxnet3_CoalesceStatic { + u32 tx_depth; + u32 tx_comp_depth; + u32 rx_depth; +}; + +struct Vmxnet3_CoalesceScheme { + enum Vmxnet3_CoalesceMode coalMode; + union { + struct Vmxnet3_CoalesceRbc coalRbc; + struct Vmxnet3_CoalesceStatic coalStatic; + } coalPara; +}; + /* If the command data <= 16 bytes, use the shared memory directly. * otherwise, use variable length configuration descriptor. */ |