]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net/mlx5: Add HV VHCA infrastructure
authorEran Ben Elisha <eranbe@mellanox.com>
Thu, 22 Aug 2019 05:05:51 +0000 (05:05 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 22 Aug 2019 07:25:12 +0000 (00:25 -0700)
commit87175120defd2907d42592653c35feea9de0437a
tree7daf9a207fa5dfe5ecd50758b88f3d42b691dc11
parent913d14e866573350de3adede3c90cefb81944b0c
net/mlx5: Add HV VHCA infrastructure

HV VHCA is a layer which provides PF to VF communication channel based on
HyperV PCI config channel. It implements Mellanox's Inter VHCA control
communication protocol. The protocol contains control block in order to
pass messages between the PF and VF drivers, and data blocks in order to
pass actual data.

The infrastructure is agent based. Each agent will be responsible of
contiguous buffer blocks in the VHCA config space. This infrastructure will
bind agents to their blocks, and those agents can only access read/write
the buffer blocks assigned to them. Each agent will provide three
callbacks (control, invalidate, cleanup). Control will be invoked when
block-0 is invalidated with a command that concerns this agent. Invalidate
callback will be invoked if one of the blocks assigned to this agent was
invalidated. Cleanup will be invoked before the agent is being freed in
order to clean all of its open resources or deferred works.

Block-0 serves as the control block. All execution commands from the PF
will be written by the PF over this block. VF will ack on those by
writing on block-0 as well. Its format is described by struct
mlx5_hv_vhca_control_block layout.

Signed-off-by: Eran Ben Elisha <eranbe@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx5/core/Makefile
drivers/net/ethernet/mellanox/mlx5/core/lib/hv_vhca.c [new file with mode: 0644]
drivers/net/ethernet/mellanox/mlx5/core/lib/hv_vhca.h [new file with mode: 0644]
drivers/net/ethernet/mellanox/mlx5/core/main.c
include/linux/mlx5/driver.h