RE: [PATCH net-next 2/4] net: mana: Report OS info to the PF driver

From: Dexuan Cui
Date: Mon Nov 01 2021 - 02:07:42 EST


> From: Haiyang Zhang <haiyangz@xxxxxxxxxxxxx>
> Sent: Saturday, October 30, 2021 8:36 AM
> > @@ -848,6 +850,15 @@ int mana_gd_verify_vf_version(struct pci_dev
> *pdev)
> > req.gd_drv_cap_flags3 = GDMA_DRV_CAP_FLAGS3;
> > req.gd_drv_cap_flags4 = GDMA_DRV_CAP_FLAGS4;
> >
> > + req.drv_ver = 0; /* Unused*/
> > + req.os_type = 0x10; /* Linux */
>
> Instead of a magic number, could you define it as a macro?
>
> Other parts look fine.
>
> Reviewed-by: Haiyang Zhang <haiyangz@xxxxxxxxxxxxx>

Ok, I'll apply the below change in v2.

@@ -497,6 +497,7 @@ enum {

#define GDMA_DRV_CAP_FLAGS4 0

+#define GDMA_OS_TYPE_LINUX 0x10
struct gdma_verify_ver_req {
struct gdma_req_hdr hdr;

diff --git a/drivers/net/ethernet/microsoft/mana/gdma_main.c b/drivers/net/ethernet/microsoft/mana/gdma_main.c
index c96ac81212f7..bea218c5c043 100644
--- a/drivers/net/ethernet/microsoft/mana/gdma_main.c
+++ b/drivers/net/ethernet/microsoft/mana/gdma_main.c
@@ -851,7 +851,7 @@ int mana_gd_verify_vf_version(struct pci_dev *pdev)
req.gd_drv_cap_flags4 = GDMA_DRV_CAP_FLAGS4;

req.drv_ver = 0; /* Unused*/
- req.os_type = 0x10; /* Linux */
+ req.os_type = GDMA_OS_TYPE_LINUX;
req.os_ver_major = LINUX_VERSION_MAJOR;
req.os_ver_minor = LINUX_VERSION_PATCHLEVEL;
req.os_ver_build = LINUX_VERSION_SUBLEVEL;