Skip to content

Commit

Permalink
crypto: cavium/nitrox - Add mailbox message to get mcode info in VF
Browse files Browse the repository at this point in the history
Add support to get microcode information in VF from PF via mailbox
message.

Signed-off-by: Nagadheeraj Rottela <[email protected]>
Reviewed-by: Srikanth Jampala <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
Nagadheeraj Rottela authored and herbertx committed Oct 4, 2019
1 parent 0600e9c commit 9e5de3e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
15 changes: 15 additions & 0 deletions drivers/crypto/cavium/nitrox/nitrox_dev.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,13 @@ struct nitrox_q_vector {
};
};

enum mcode_type {
MCODE_TYPE_INVALID,
MCODE_TYPE_AE,
MCODE_TYPE_SE_SSL,
MCODE_TYPE_SE_IPSEC,
};

/**
* mbox_msg - Mailbox message data
* @type: message type
Expand All @@ -128,6 +135,14 @@ union mbox_msg {
u64 chipid: 8;
u64 vfid: 8;
} id;
struct {
u64 type: 2;
u64 opcode: 6;
u64 count: 4;
u64 info: 40;
u64 next_se_grp: 3;
u64 next_ae_grp: 3;
} mcode_info;
};

/**
Expand Down
8 changes: 8 additions & 0 deletions drivers/crypto/cavium/nitrox/nitrox_mbx.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ enum mbx_msg_opcode {
MSG_OP_VF_UP,
MSG_OP_VF_DOWN,
MSG_OP_CHIPID_VFID,
MSG_OP_MCODE_INFO = 11,
};

struct pf2vf_work {
Expand Down Expand Up @@ -73,6 +74,13 @@ static void pf2vf_send_response(struct nitrox_device *ndev,
vfdev->nr_queues = 0;
atomic_set(&vfdev->state, __NDEV_NOT_READY);
break;
case MSG_OP_MCODE_INFO:
msg.data = 0;
msg.mcode_info.count = 2;
msg.mcode_info.info = MCODE_TYPE_SE_SSL | (MCODE_TYPE_AE << 5);
msg.mcode_info.next_se_grp = 1;
msg.mcode_info.next_ae_grp = 1;
break;
default:
msg.type = MBX_MSG_TYPE_NOP;
break;
Expand Down

0 comments on commit 9e5de3e

Please sign in to comment.