On 6/22/23 06:47, Denis Pryazhennikov wrote:
From: Sandilya Bhagi <sbh...@solarflare.com>
NIC Partitioning mode in SFC devices means multiple PFs
per network port. When NIC Partitioning is configured,
apart from the privileged adapter(s) the other
unprivileged adapter(s) will share the same physical port.
Determining NIC Partitioning mode is required to take
necessary action(s) for unprivileged adapter to work seamlessly.
BNIC Partitioning is determined using heuristic approach.
If the physical ports are shared between PFs then either
NIC Partitioning or SR-IOV is in use.
Signed-off-by: Sandilya Bhagi <sbh...@solarflare.com>
Signed-off-by: Denis Pryazhennikov <denis.pryazhenni...@arknetworks.am>
Reviewed-by: Andy Moreton <amore...@xilinx.com>
Overall LGMT with few style notes:
Acked-by: Andrew Rybchenko <andrew.rybche...@oktetlabs.ru>
[snip]
+#define CAP_PFS_TO_PORTS(_n) \
+ (MC_CMD_GET_CAPABILITIES_V2_OUT_PFS_TO_PORTS_ASSIGNMENT_ ## _n)
+
+ encp->enc_port_usage = EFX_PORT_USAGE_UNKNOWN;
+
+ if (req.emr_out_length_used >= MC_CMD_GET_CAPABILITIES_V2_OUT_LEN) {
+ /* PFs to ports assignment */
+ uint8_t pfs_to_ports[CAP_PFS_TO_PORTS(NUM)];
+
+ EFX_STATIC_ASSERT((CAP_PFS_TO_PORTS(NUM) *
CAP_PFS_TO_PORTS(LEN)) ==
+ EFX_ARRAY_SIZE(pfs_to_ports));
As far as I remember libefx style, it should be 4 spaces indent above
relative to mail line.
+
+ memcpy(pfs_to_ports, MCDI_OUT(req, efx_byte_t,
CAP_PFS_TO_PORTS(OFST)),
+ EFX_ARRAY_SIZE(pfs_to_ports));
same here, 4 spaces indent
+
+ rc = ef10_nic_get_physical_port_usage(enp, pfs_to_ports,
+
EFX_ARRAY_SIZE(pfs_to_ports),
+ &encp->enc_port_usage);
same here, 4 spaces indent
+ if (rc != 0) {
+ /* PF to port mapping lookup failed */
+ encp->enc_port_usage = EFX_PORT_USAGE_UNKNOWN;
+ }
+ }
+#undef CAP_PFS_TO_PORTS
+
/*
* Check if firmware reports the VI window mode.
* Medford2 has a variable VI window size (8K, 16K or 64K).
[snip]