Re: [PATCH net-next] net: mana: Add support for Multi Vports on Bare metal

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 17-05-2025 01:21, Haiyang Zhang wrote:
To support Multi Vports on Bare metal, increase the device config response
version. And, skip the register HW vport, and register filter steps, when
the Bare metal hostmode is set.

Signed-off-by: Haiyang Zhang <haiyangz@xxxxxxxxxxxxx>
---
  drivers/net/ethernet/microsoft/mana/mana_en.c | 22 +++++++++++++------
  include/net/mana/mana.h                       |  4 +++-
  2 files changed, 18 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ethernet/microsoft/mana/mana_en.c b/drivers/net/ethernet/microsoft/mana/mana_en.c
index 2bac6be8f6a0..0273696d254b 100644
--- a/drivers/net/ethernet/microsoft/mana/mana_en.c
+++ b/drivers/net/ethernet/microsoft/mana/mana_en.c
@@ -921,7 +921,7 @@ static void mana_pf_deregister_filter(struct mana_port_context *apc)
[snip]
+	u8 bm_hostmode = 0;
  	u16 num_ports = 0;
  	int err;
  	int i;
@@ -3026,10 +3032,12 @@ int mana_probe(struct gdma_dev *gd, bool resuming)
  	}
err = mana_query_device_cfg(ac, MANA_MAJOR_VERSION, MANA_MINOR_VERSION,
-				    MANA_MICRO_VERSION, &num_ports);
+				    MANA_MICRO_VERSION, &num_ports, &bm_hostmode);
  	if (err)
  		goto out;
+ ac->bm_hostmode = bm_hostmode;
+
  	if (!resuming) {
  		ac->num_ports = num_ports;
  	} else {
diff --git a/include/net/mana/mana.h b/include/net/mana/mana.h
index 0f78065de8fe..b352d2a7118e 100644
--- a/include/net/mana/mana.h
+++ b/include/net/mana/mana.h
@@ -408,6 +408,7 @@ struct mana_context {
  	struct gdma_dev *gdma_dev;
u16 num_ports;
+	u8 bm_hostmode; /* Bare Metal Host Mode Enabled */

what about maintaining natural alignment, +u8 reserved0 ?

/* +response v3: Bare Metal Host Mode Enabled */ for consistency.
Even though this comment is optional here.
struct mana_eq *eqs;
  	struct dentry *mana_eqs_debugfs;
@@ -557,7 +558,8 @@ struct mana_query_device_cfg_resp {
  	u64 pf_cap_flags4;
u16 max_num_vports;
-	u16 reserved;
+	u8 bm_hostmode; /* response v3: Bare Metal Host Mode Enabled */
+	u8 reserved;
  	u32 max_num_eqs;
/* response v2: */


Thanks,
Alok




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux