From 17298d01211a8611b9206086fff04624297a4197 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Wed, 24 Apr 2019 13:00:12 +0100 Subject: [intelxl] Allow admin cookie to hold extended opcode and return code The "send to PF" and "send to VF" admin queue descriptors (ab)use the cookie field to hold the extended opcode and return code values. Signed-off-by: Michael Brown --- src/drivers/net/intelxl.c | 10 +++++++--- src/drivers/net/intelxl.h | 13 +++++++++---- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/drivers/net/intelxl.c b/src/drivers/net/intelxl.c index a4dca5fb..1cf5cad4 100644 --- a/src/drivers/net/intelxl.c +++ b/src/drivers/net/intelxl.c @@ -313,8 +313,11 @@ static int intelxl_admin_command ( struct intelxl_nic *intelxl ) { tail = ( admin->index % INTELXL_ADMIN_NUM_DESC ); cmd = &admin->desc[ index % INTELXL_ADMIN_NUM_DESC ]; buf = &admin->buf[ index % INTELXL_ADMIN_NUM_DESC ]; - DBGC2 ( intelxl, "INTELXL %p admin command %#x opcode %#04x:\n", + DBGC2 ( intelxl, "INTELXL %p admin command %#x opcode %#04x", intelxl, index, le16_to_cpu ( cmd->opcode ) ); + if ( cmd->vopcode ) + DBGC2 ( intelxl, "/%#08x", le32_to_cpu ( cmd->vopcode ) ); + DBGC2 ( intelxl, ":\n" ); /* Sanity checks */ assert ( ! ( cmd->flags & cpu_to_le16 ( INTELXL_ADMIN_FL_DD ) ) ); @@ -329,8 +332,9 @@ static int intelxl_admin_command ( struct intelxl_nic *intelxl ) { cmd->params.buffer.low = cpu_to_le32 ( address & 0xffffffffUL ); } - /* Populate cookie */ - cmd->cookie = cpu_to_le32 ( index ); + /* Populate cookie, if not being (ab)used for VF opcode */ + if ( ! cmd->vopcode ) + cmd->cookie = cpu_to_le32 ( index ); /* Record cookie */ cookie = cmd->cookie; diff --git a/src/drivers/net/intelxl.h b/src/drivers/net/intelxl.h index 0175c1f9..5067b807 100644 --- a/src/drivers/net/intelxl.h +++ b/src/drivers/net/intelxl.h @@ -333,10 +333,15 @@ struct intelxl_admin_descriptor { uint16_t len; /** Return value */ uint16_t ret; - /** Cookie */ - uint32_t cookie; - /** Reserved */ - uint32_t reserved; + /** Opaque cookie / VF opcode */ + union { + /** Cookie */ + uint32_t cookie; + /** VF opcode */ + uint32_t vopcode; + }; + /** VF return value */ + int32_t vret; /** Parameters */ union intelxl_admin_params params; } __attribute__ (( packed )); -- cgit v1.2.3-55-g7522