aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/marvell/octeon_ep/octep_pfvf_mbox.c
diff options
context:
space:
mode:
authorShinas Rasheed <srasheed@marvell.com>2023-12-15 10:14:23 -0800
committerPaolo Abeni <pabeni@redhat.com>2023-12-19 12:00:53 +0100
commitc130e589d50bbf43eb77d45b806b38cf95e2bad9 (patch)
tree78d363b5ee869a59e1639d8efaa6f3ad6fb528b9 /drivers/net/ethernet/marvell/octeon_ep/octep_pfvf_mbox.c
parentcde29af9e68e757824821d290842fbceeae11f88 (diff)
octeon_ep: PF-VF mailbox version support
Add PF-VF mailbox initial version support Signed-off-by: Shinas Rasheed <srasheed@marvell.com> Reviewed-by: Simon Horman <horms@kernel.org> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'drivers/net/ethernet/marvell/octeon_ep/octep_pfvf_mbox.c')
-rw-r--r--drivers/net/ethernet/marvell/octeon_ep/octep_pfvf_mbox.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/drivers/net/ethernet/marvell/octeon_ep/octep_pfvf_mbox.c b/drivers/net/ethernet/marvell/octeon_ep/octep_pfvf_mbox.c
index 0557c138060f..fb4da72e5193 100644
--- a/drivers/net/ethernet/marvell/octeon_ep/octep_pfvf_mbox.c
+++ b/drivers/net/ethernet/marvell/octeon_ep/octep_pfvf_mbox.c
@@ -27,10 +27,18 @@ static void octep_pfvf_validate_version(struct octep_device *oct, u32 vf_id,
{
u32 vf_version = (u32)cmd.s_version.version;
- if (vf_version <= OCTEP_PFVF_MBOX_VERSION_V1)
- rsp->s_version.type = OCTEP_PFVF_MBOX_TYPE_RSP_ACK;
+ dev_dbg(&oct->pdev->dev, "VF id:%d VF version:%d PF version:%d\n",
+ vf_id, vf_version, OCTEP_PFVF_MBOX_VERSION_CURRENT);
+ if (vf_version < OCTEP_PFVF_MBOX_VERSION_CURRENT)
+ rsp->s_version.version = vf_version;
else
- rsp->s_version.type = OCTEP_PFVF_MBOX_TYPE_RSP_NACK;
+ rsp->s_version.version = OCTEP_PFVF_MBOX_VERSION_CURRENT;
+
+ oct->vf_info[vf_id].mbox_version = rsp->s_version.version;
+ dev_dbg(&oct->pdev->dev, "VF id:%d negotiated VF version:%d\n",
+ vf_id, oct->vf_info[vf_id].mbox_version);
+
+ rsp->s_version.type = OCTEP_PFVF_MBOX_TYPE_RSP_ACK;
}
static void octep_pfvf_get_link_status(struct octep_device *oct, u32 vf_id,
@@ -166,6 +174,7 @@ int octep_setup_pfvf_mbox(struct octep_device *oct)
goto free_mbox;
memset(oct->mbox[ring], 0, sizeof(struct octep_mbox));
+ memset(&oct->vf_info[i], 0, sizeof(struct octep_pfvf_info));
mutex_init(&oct->mbox[ring]->lock);
INIT_WORK(&oct->mbox[ring]->wk.work, octep_pfvf_mbox_work);
oct->mbox[ring]->wk.ctxptr = oct->mbox[ring];