<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2654.45">
<TITLE>RE: [PATCH] FW version in vstat</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=2>Fab ,Yael</FONT>
</P>
<P><FONT SIZE=2>Attched is the new patch for adding fw_ver in query_ca_attr</FONT>
</P>
<BR>
<BR>
<P><FONT SIZE=2>10x</FONT>
<BR><FONT SIZE=2>Yossi </FONT>
</P>
<P><FONT SIZE=2>Singned-off-by:Yossi Leybovich (sleybo@mellanox.co.il)</FONT>
</P>
<P><FONT SIZE=2>Index: hw/mt23108/kernel/hca_data.c</FONT>
<BR><FONT SIZE=2>===================================================================</FONT>
<BR><FONT SIZE=2>--- hw/mt23108/kernel/hca_data.c (revision 707)</FONT>
<BR><FONT SIZE=2>+++ hw/mt23108/kernel/hca_data.c (working copy)</FONT>
<BR><FONT SIZE=2>@@ -2096,6 +2096,7 @@</FONT>
<BR><FONT SIZE=2> ca_attr_p->vend_id = hca_info_p->vendor_id;</FONT>
<BR><FONT SIZE=2> ca_attr_p->dev_id = (uint16_t)hca_info_p->dev_id;</FONT>
<BR><FONT SIZE=2> ca_attr_p->revision = (uint16_t)hca_info_p->hw_ver;</FONT>
<BR><FONT SIZE=2>+ ca_attr_p->fw_ver = hca_info_p->fw_ver;</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2> ca_attr_p->ca_guid = *(UNALIGNED64 u_int64_t *)vapi_hca_cap_p->node_guid;</FONT>
<BR><FONT SIZE=2> ca_attr_p->num_ports = vapi_hca_cap_p->phys_port_num;</FONT>
<BR><FONT SIZE=2>Index: hw/mt23108/vapi/Hca/hcahal/hh.h</FONT>
<BR><FONT SIZE=2>===================================================================</FONT>
<BR><FONT SIZE=2>--- hw/mt23108/vapi/Hca/hcahal/hh.h (revision 707)</FONT>
<BR><FONT SIZE=2>+++ hw/mt23108/vapi/Hca/hcahal/hh.h (working copy)</FONT>
<BR><FONT SIZE=2>@@ -69,6 +69,7 @@</FONT>
<BR><FONT SIZE=2> u_int32_t vendor_id; /* IEEE's 24 bit Device Vendor ID */</FONT>
<BR><FONT SIZE=2> u_int32_t dev_id; /* Device ID */</FONT>
<BR><FONT SIZE=2> u_int32_t hw_ver; /* Hardware version (step/rev) */</FONT>
<BR><FONT SIZE=2>+ u_int64_t fw_ver;</FONT>
<BR><FONT SIZE=2> struct hh_if_ops* if_ops; /* Interface operations */</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2> /* Size (bytes) of user-level ... */</FONT>
<BR><FONT SIZE=2>Index: hw/mt23108/vapi/Hca/hcahal/tavor/thh_hob/thh_hob.c</FONT>
<BR><FONT SIZE=2>===================================================================</FONT>
<BR><FONT SIZE=2>--- hw/mt23108/vapi/Hca/hcahal/tavor/thh_hob/thh_hob.c (revision 707)</FONT>
<BR><FONT SIZE=2>+++ hw/mt23108/vapi/Hca/hcahal/tavor/thh_hob/thh_hob.c (working copy)</FONT>
<BR><FONT SIZE=2>@@ -4176,6 +4176,9 @@</FONT>
<BR><FONT SIZE=2> tdev.dev_id = (u_int32_t)hw_props_p->device_id;</FONT>
<BR><FONT SIZE=2> MTL_DEBUG1("hw_props_p: device_id = 0x%X, pci_vendor_id=0x%X,hw_ver=0x%X\n",</FONT>
<BR><FONT SIZE=2> hw_props_p->device_id, hw_props_p->pci_vendor_id, hw_props_p->hw_ver);</FONT>
<BR><FONT SIZE=2>+ tdev.fw_ver= tdev.fw_ver = hob_p->fw_props.fw_rev_major;</FONT>
<BR><FONT SIZE=2>+ tdev.fw_ver = (tdev.fw_ver <<16) | hob_p->fw_props.fw_rev_minor;</FONT>
<BR><FONT SIZE=2>+ tdev.fw_ver = (tdev.fw_ver <<16) | hob_p->fw_props.fw_rev_subminor;;</FONT>
<BR><FONT SIZE=2> tdev.hw_ver = hob_p->hw_props.hw_ver; </FONT>
<BR><FONT SIZE=2> tdev.if_ops = if_ops_p;</FONT>
<BR><FONT SIZE=2> tdev.hca_ul_resources_sz = sizeof(THH_hca_ul_resources_t);</FONT>
<BR><FONT SIZE=2>Index: inc/iba/ib_types.h</FONT>
<BR><FONT SIZE=2>===================================================================</FONT>
<BR><FONT SIZE=2>--- inc/iba/ib_types.h (revision 707)</FONT>
<BR><FONT SIZE=2>+++ inc/iba/ib_types.h (working copy)</FONT>
<BR><FONT SIZE=2>@@ -7574,6 +7574,7 @@</FONT>
<BR><FONT SIZE=2> uint32_t vend_id;</FONT>
<BR><FONT SIZE=2> uint16_t dev_id;</FONT>
<BR><FONT SIZE=2> uint16_t revision;</FONT>
<BR><FONT SIZE=2>+ uint64_t fw_ver;</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2> /*</FONT>
<BR><FONT SIZE=2> * Total size of the ca attributes in bytes</FONT>
<BR><FONT SIZE=2>@@ -7658,6 +7659,9 @@</FONT>
<BR><FONT SIZE=2> * revision</FONT>
<BR><FONT SIZE=2> * Revision ID of this adapter</FONT>
<BR><FONT SIZE=2> *</FONT>
<BR><FONT SIZE=2>+* Fw_ver</FONT>
<BR><FONT SIZE=2>+* Device Firmware version.</FONT>
<BR><FONT SIZE=2>+*</FONT>
<BR><FONT SIZE=2> * size</FONT>
<BR><FONT SIZE=2> * Total size in bytes for the HCA attributes. This size includes total</FONT>
<BR><FONT SIZE=2> * size required for all the variable members of the structure. If a</FONT>
<BR><FONT SIZE=2>Index: tools/vstat/user/vstat_main.c</FONT>
<BR><FONT SIZE=2>===================================================================</FONT>
<BR><FONT SIZE=2>--- tools/vstat/user/vstat_main.c (revision 707)</FONT>
<BR><FONT SIZE=2>+++ tools/vstat/user/vstat_main.c (working copy)</FONT>
<BR><FONT SIZE=2>@@ -44,6 +44,7 @@</FONT>
<BR><FONT SIZE=2> #endif</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2>+#define VEND_ID_MELLNOX 0x02c9</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2> /*******************************************************************</FONT>
<BR><FONT SIZE=2>@@ -163,7 +164,14 @@</FONT>
<BR><FONT SIZE=2> printf("\tvendor_id=0x%04x\n", ca_attr->vend_id);</FONT>
<BR><FONT SIZE=2> printf("\tvendor_part_id=0x%04x\n", ca_attr->dev_id);</FONT>
<BR><FONT SIZE=2> printf("\thw_ver=0x%x\n", ca_attr->revision); //TODO: ???</FONT>
<BR><FONT SIZE=2>- printf("\tfw_ver=NA\n");</FONT>
<BR><FONT SIZE=2>+ if(ca_attr->vend_id == VEND_ID_MELLNOX){</FONT>
<BR><FONT SIZE=2>+ printf("\tfw_ver=%d.%.2d.%.4d\n",</FONT>
<BR><FONT SIZE=2>+ (uint16_t )(ca_attr->fw_ver>>32),</FONT>
<BR><FONT SIZE=2>+ (uint16_t)(ca_attr->fw_ver>>16),</FONT>
<BR><FONT SIZE=2>+ (uint16_t )(ca_attr->fw_ver));</FONT>
<BR><FONT SIZE=2>+ }else{</FONT>
<BR><FONT SIZE=2>+ printf("\tfw_ver=0x%I64x\n",ca_attr->fw_ver);</FONT>
<BR><FONT SIZE=2>+ }</FONT>
<BR><FONT SIZE=2> printf("\tPSID=NA\n");</FONT>
<BR><FONT SIZE=2> if(fullPrint){</FONT>
<BR><FONT SIZE=2> printf("\tnum_phys_ports = %d\n",ca_attr->num_ports);</FONT>
<BR><FONT SIZE=2>@@ -336,7 +344,7 @@</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2> /* Print_ca_attributes */</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2>- vstat_print_ca_attr((int)i,vstat_ca_attr, fullPrint);</FONT>
<BR><FONT SIZE=2>+ vstat_print_ca_attr((int)i, vstat_ca_attr, fullPrint);</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2> /* Free the memory */</FONT>
<BR><FONT SIZE=2>Index: ulp/opensm/user/include/iba/ib_types.h</FONT>
<BR><FONT SIZE=2>===================================================================</FONT>
<BR><FONT SIZE=2>--- ulp/opensm/user/include/iba/ib_types.h (revision 707)</FONT>
<BR><FONT SIZE=2>+++ ulp/opensm/user/include/iba/ib_types.h (working copy)</FONT>
<BR><FONT SIZE=2>@@ -7536,6 +7536,7 @@</FONT>
<BR><FONT SIZE=2> uint32_t vend_id;</FONT>
<BR><FONT SIZE=2> uint16_t dev_id;</FONT>
<BR><FONT SIZE=2> uint16_t revision;</FONT>
<BR><FONT SIZE=2>+ uint16_t fw_ver;</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2> /*</FONT>
<BR><FONT SIZE=2> * Total size of the ca attributes in bytes</FONT>
<BR><FONT SIZE=2>@@ -7625,6 +7626,9 @@</FONT>
<BR><FONT SIZE=2> * revision</FONT>
<BR><FONT SIZE=2> * Revision ID of this adapter</FONT>
<BR><FONT SIZE=2> *</FONT>
<BR><FONT SIZE=2>+* Fw_ver</FONT>
<BR><FONT SIZE=2>+* Device Firmware version.</FONT>
<BR><FONT SIZE=2>+*</FONT>
<BR><FONT SIZE=2> * size</FONT>
<BR><FONT SIZE=2> * Total size in bytes for the HCA attributes. This size includes total</FONT>
<BR><FONT SIZE=2> * size required for all the variable members of the structure. If a</FONT>
<BR><FONT SIZE=2>Index: ulp/opensm/user/include/iba/ib_types_extended.h</FONT>
<BR><FONT SIZE=2>===================================================================</FONT>
<BR><FONT SIZE=2>--- ulp/opensm/user/include/iba/ib_types_extended.h (revision 707)</FONT>
<BR><FONT SIZE=2>+++ ulp/opensm/user/include/iba/ib_types_extended.h (working copy)</FONT>
<BR><FONT SIZE=2>@@ -607,6 +607,7 @@</FONT>
<BR><FONT SIZE=2> uint32_t vend_id;</FONT>
<BR><FONT SIZE=2> uint16_t dev_id;</FONT>
<BR><FONT SIZE=2> uint16_t revision;</FONT>
<BR><FONT SIZE=2>+ uint64_t fw_ver;</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2> /*</FONT>
<BR><FONT SIZE=2> * Total size of the ca attributes in bytes</FONT>
</P>
<P><FONT FACE="Arial" SIZE=2 COLOR="#000000"></FONT>
</BODY>
</HTML>