<!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>[PATCH] query_ca</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=2>Fab</FONT>
</P>
<P><FONT SIZE=2>inorder to support AV with GRH we still need to copy the ca attr and update the internal pointers in the struct </FONT>
<BR><FONT SIZE=2>here is patch for that </FONT>
</P>
<P><FONT SIZE=2>10x</FONT>
<BR><FONT SIZE=2>Yossi </FONT>
</P>
<BR>
<P><FONT SIZE=2>Singed-off-by: Yossi Leybovich</FONT>
<BR><FONT SIZE=2>Index: hw/mt23108/user/mlnx_ual_ca.c</FONT>
<BR><FONT SIZE=2>===================================================================</FONT>
<BR><FONT SIZE=2>--- hw/mt23108/user/mlnx_ual_ca.c (revision 603)</FONT>
<BR><FONT SIZE=2>+++ hw/mt23108/user/mlnx_ual_ca.c (working copy)</FONT>
<BR><FONT SIZE=2>@@ -192,16 +192,48 @@</FONT>
<BR><FONT SIZE=2> IN size_t byte_count,</FONT>
<BR><FONT SIZE=2> IN ci_umv_buf_t *p_umv_buf )</FONT>
<BR><FONT SIZE=2> {</FONT>
<BR><FONT SIZE=2>+</FONT>
<BR><FONT SIZE=2> FUNC_ENTER;</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2> CL_ASSERT(h_uvp_ca);</FONT>
<BR><FONT SIZE=2> CL_ASSERT(p_umv_buf);</FONT>
<BR><FONT SIZE=2>+ </FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2> if ( ioctl_status == IB_SUCCESS && p_ca_attr &&</FONT>
<BR><FONT SIZE=2> byte_count && !h_uvp_ca->p_hca_attr )</FONT>
<BR><FONT SIZE=2> {</FONT>
<BR><FONT SIZE=2>+</FONT>
<BR><FONT SIZE=2>+ ib_ca_attr_t* p_dest = NULL;</FONT>
<BR><FONT SIZE=2>+ ib_ca_attr_t* p_src = NULL;</FONT>
<BR><FONT SIZE=2>+ uint8_t i;</FONT>
<BR><FONT SIZE=2>+ uintn_t offset ;</FONT>
<BR><FONT SIZE=2>+ ib_port_attr_t *p_tmp_port_attr = NULL;</FONT>
<BR><FONT SIZE=2>+ </FONT>
<BR><FONT SIZE=2>+ </FONT>
<BR><FONT SIZE=2> h_uvp_ca->p_hca_attr = p_umv_buf->p_inout_buf;</FONT>
<BR><FONT SIZE=2>- cl_memcpy(h_uvp_ca->p_hca_attr, p_ca_attr, byte_count);</FONT>
<BR><FONT SIZE=2>+</FONT>
<BR><FONT SIZE=2>+ p_dest = h_uvp_ca->p_hca_attr;</FONT>
<BR><FONT SIZE=2>+ p_src = p_ca_attr;</FONT>
<BR><FONT SIZE=2>+ offset = (uintn_t)h_uvp_ca->p_hca_attr - (uintn_t)p_ca_attr;</FONT>
<BR><FONT SIZE=2>+ </FONT>
<BR><FONT SIZE=2>+ cl_memcpy(p_dest, p_src, byte_count);</FONT>
<BR><FONT SIZE=2>+ /* Fix up the pointers to point within the destination buffer. */</FONT>
<BR><FONT SIZE=2>+ p_dest->p_page_size =</FONT>
<BR><FONT SIZE=2>+ (uint32_t* __ptr64)(((uint8_t* __ptr64)p_dest->p_page_size) + offset);</FONT>
<BR><FONT SIZE=2>+</FONT>
<BR><FONT SIZE=2>+ p_tmp_port_attr =</FONT>
<BR><FONT SIZE=2>+ (ib_port_attr_t* __ptr64)(((uint8_t* __ptr64)p_dest->p_port_attr) + offset);</FONT>
<BR><FONT SIZE=2>+</FONT>
<BR><FONT SIZE=2>+ /* Fix up each port attribute's gid and pkey table pointers. */</FONT>
<BR><FONT SIZE=2>+ for( i = 0; i < p_dest->num_ports; i++ )</FONT>
<BR><FONT SIZE=2>+ {</FONT>
<BR><FONT SIZE=2>+ p_tmp_port_attr[i].p_gid_table = (ib_gid_t* __ptr64)</FONT>
<BR><FONT SIZE=2>+ (((uint8_t* __ptr64)p_tmp_port_attr[i].p_gid_table) + offset);</FONT>
<BR><FONT SIZE=2>+</FONT>
<BR><FONT SIZE=2>+ p_tmp_port_attr[i].p_pkey_table =(ib_net16_t* __ptr64)</FONT>
<BR><FONT SIZE=2>+ (((uint8_t* __ptr64)p_tmp_port_attr[i].p_pkey_table) + offset);</FONT>
<BR><FONT SIZE=2>+ }</FONT>
<BR><FONT SIZE=2>+ p_dest->p_port_attr = p_tmp_port_attr;</FONT>
<BR><FONT SIZE=2> }</FONT>
<BR><FONT SIZE=2> else if (p_umv_buf->p_inout_buf) </FONT>
<BR><FONT SIZE=2> {</FONT>
</P>
<P><FONT FACE="Arial" SIZE=2 COLOR="#000000"></FONT>
</BODY>
</HTML>