diff mbox

vmxnet3: Add support for VMXNET3_CMD_GET_ADAPTIVE_RING_INFO command

Message ID 1442555704-20550-1-git-send-email-shmulik.ladkani@ravellosystems.com
State New
Headers show

Commit Message

Shmulik Ladkani Sept. 18, 2015, 5:55 a.m. UTC
Some drivers (e.g. vmware-tools) issue the VMXNET3_CMD_GET_ADAPTIVE_RING_INFO
command.

Currently, due to lack of support, a bogus value (-1) is returned.

Support this command, returning the "adaptive-ring disabled" flag.

Signed-off-by: Shmulik Ladkani <shmulik.ladkani@ravellosystems.com>
---
 hw/net/vmxnet3.c | 9 +++++++++
 hw/net/vmxnet3.h | 6 +++++-
 2 files changed, 14 insertions(+), 1 deletion(-)

Comments

Dmitry Fleytman Sept. 18, 2015, 9:11 a.m. UTC | #1
ACK.

> On Sep 18, 2015, at 08:55 AM, Shmulik Ladkani <shmulik.ladkani@ravellosystems.com> wrote:
> 
> Some drivers (e.g. vmware-tools) issue the VMXNET3_CMD_GET_ADAPTIVE_RING_INFO
> command.
> 
> Currently, due to lack of support, a bogus value (-1) is returned.
> 
> Support this command, returning the "adaptive-ring disabled" flag.
> 
> Signed-off-by: Shmulik Ladkani <shmulik.ladkani@ravellosystems.com>
> ---
> hw/net/vmxnet3.c | 9 +++++++++
> hw/net/vmxnet3.h | 6 +++++-
> 2 files changed, 14 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/net/vmxnet3.c b/hw/net/vmxnet3.c
> index 04159c8..56a1faa 100644
> --- a/hw/net/vmxnet3.c
> +++ b/hw/net/vmxnet3.c
> @@ -1629,6 +1629,11 @@ static void vmxnet3_handle_command(VMXNET3State *s, uint64_t cmd)
>         VMW_CBPRN("Set: VMXNET3_CMD_GET_CONF_INTR - interrupt configuration");
>         break;
> 
> +    case VMXNET3_CMD_GET_ADAPTIVE_RING_INFO:
> +        VMW_CBPRN("Set: VMXNET3_CMD_GET_ADAPTIVE_RING_INFO - "
> +                  "adaptive ring info flags");
> +        break;
> +
>     default:
>         VMW_CBPRN("Received unknown command: %" PRIx64, cmd);
>         break;
> @@ -1668,6 +1673,10 @@ static uint64_t vmxnet3_get_command_status(VMXNET3State *s)
>         ret = vmxnet3_get_interrupt_config(s);
>         break;
> 
> +    case VMXNET3_CMD_GET_ADAPTIVE_RING_INFO:
> +        ret = VMXNET3_DISABLE_ADAPTIVE_RING;
> +        break;
> +
>     default:
>         VMW_WRPRN("Received request for unknown command: %x", s->last_command);
>         ret = -1;
> diff --git a/hw/net/vmxnet3.h b/hw/net/vmxnet3.h
> index f987d71..f7006af 100644
> --- a/hw/net/vmxnet3.h
> +++ b/hw/net/vmxnet3.h
> @@ -198,9 +198,13 @@ enum {
>     VMXNET3_CMD_GET_DID_LO,                               /* 0xF00D0005 */
>     VMXNET3_CMD_GET_DID_HI,                               /* 0xF00D0006 */
>     VMXNET3_CMD_GET_DEV_EXTRA_INFO,                       /* 0xF00D0007 */
> -    VMXNET3_CMD_GET_CONF_INTR                             /* 0xF00D0008 */
> +    VMXNET3_CMD_GET_CONF_INTR,                            /* 0xF00D0008 */
> +    VMXNET3_CMD_GET_ADAPTIVE_RING_INFO                    /* 0xF00D0009 */
> };
> 
> +/* Adaptive Ring Info Flags */
> +#define VMXNET3_DISABLE_ADAPTIVE_RING 1
> +
> /*
>  *    Little Endian layout of bitfields -
>  *    Byte 0 :    7.....len.....0
> -- 
> 1.9.1
>
Shmulik Ladkani Oct. 1, 2015, 7 a.m. UTC | #2
Ping...

On Fri, 18 Sep 2015 08:55:04 +0300, shmulik.ladkani@ravellosystems.com wrote:
> Some drivers (e.g. vmware-tools) issue the VMXNET3_CMD_GET_ADAPTIVE_RING_INFO
> command.
> 
> Currently, due to lack of support, a bogus value (-1) is returned.
> 
> Support this command, returning the "adaptive-ring disabled" flag.
> 
> Signed-off-by: Shmulik Ladkani <shmulik.ladkani@ravellosystems.com>
> ---
>  hw/net/vmxnet3.c | 9 +++++++++
>  hw/net/vmxnet3.h | 6 +++++-
>  2 files changed, 14 insertions(+), 1 deletion(-)

Thanks.
Jason Wang Oct. 10, 2015, 2:15 a.m. UTC | #3
On 10/01/2015 03:00 PM, Shmulik Ladkani wrote:
> Ping...
>
> On Fri, 18 Sep 2015 08:55:04 +0300, shmulik.ladkani@ravellosystems.com wrote:
>> Some drivers (e.g. vmware-tools) issue the VMXNET3_CMD_GET_ADAPTIVE_RING_INFO
>> command.
>>
>> Currently, due to lack of support, a bogus value (-1) is returned.
>>
>> Support this command, returning the "adaptive-ring disabled" flag.
>>
>> Signed-off-by: Shmulik Ladkani <shmulik.ladkani@ravellosystems.com>
>> ---
>>  hw/net/vmxnet3.c | 9 +++++++++
>>  hw/net/vmxnet3.h | 6 +++++-
>>  2 files changed, 14 insertions(+), 1 deletion(-)
> Thanks.
>

Applied in my tree.

https://github.com/jasowang/qemu/commits/net

Thanks
diff mbox

Patch

diff --git a/hw/net/vmxnet3.c b/hw/net/vmxnet3.c
index 04159c8..56a1faa 100644
--- a/hw/net/vmxnet3.c
+++ b/hw/net/vmxnet3.c
@@ -1629,6 +1629,11 @@  static void vmxnet3_handle_command(VMXNET3State *s, uint64_t cmd)
         VMW_CBPRN("Set: VMXNET3_CMD_GET_CONF_INTR - interrupt configuration");
         break;
 
+    case VMXNET3_CMD_GET_ADAPTIVE_RING_INFO:
+        VMW_CBPRN("Set: VMXNET3_CMD_GET_ADAPTIVE_RING_INFO - "
+                  "adaptive ring info flags");
+        break;
+
     default:
         VMW_CBPRN("Received unknown command: %" PRIx64, cmd);
         break;
@@ -1668,6 +1673,10 @@  static uint64_t vmxnet3_get_command_status(VMXNET3State *s)
         ret = vmxnet3_get_interrupt_config(s);
         break;
 
+    case VMXNET3_CMD_GET_ADAPTIVE_RING_INFO:
+        ret = VMXNET3_DISABLE_ADAPTIVE_RING;
+        break;
+
     default:
         VMW_WRPRN("Received request for unknown command: %x", s->last_command);
         ret = -1;
diff --git a/hw/net/vmxnet3.h b/hw/net/vmxnet3.h
index f987d71..f7006af 100644
--- a/hw/net/vmxnet3.h
+++ b/hw/net/vmxnet3.h
@@ -198,9 +198,13 @@  enum {
     VMXNET3_CMD_GET_DID_LO,                               /* 0xF00D0005 */
     VMXNET3_CMD_GET_DID_HI,                               /* 0xF00D0006 */
     VMXNET3_CMD_GET_DEV_EXTRA_INFO,                       /* 0xF00D0007 */
-    VMXNET3_CMD_GET_CONF_INTR                             /* 0xF00D0008 */
+    VMXNET3_CMD_GET_CONF_INTR,                            /* 0xF00D0008 */
+    VMXNET3_CMD_GET_ADAPTIVE_RING_INFO                    /* 0xF00D0009 */
 };
 
+/* Adaptive Ring Info Flags */
+#define VMXNET3_DISABLE_ADAPTIVE_RING 1
+
 /*
  *    Little Endian layout of bitfields -
  *    Byte 0 :    7.....len.....0