<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<style>
<!--
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-reply;
font-family:Arial;
color:navy;}
@page Section1
{size:8.5in 11.0in;
margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
{page:Section1;}
-->
</style>
</head>
<body lang=EN-US link=blue vlink=purple>
<div class=Section1>
<div style='border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt'>
<div>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Index: mlx4/kernel/bus/core/SOURCES<br>
===================================================================<br>
--- mlx4/kernel/bus/core/SOURCES (revision 1301)<br>
+++ mlx4/kernel/bus/core/SOURCES (working copy)<br>
@@ -43,7 +43,7 @@<br>
C_DEFINES = $(C_DEFINES) -DEVENT_TRACING<br>
<br>
RUN_WPP = $(SOURCES) -km -ext: .c .h .C .H \<br>
- -scan:..\inc\mlx4_debug.h \<br>
+ -scan:..\..\inc\mlx4_debug.h \<br>
-func:MLX4_PRINT(LEVEL,FLAGS,(MSG,...)) \<br>
-func:MLX4_PRINT_EXIT(LEVEL,FLAGS,(MSG,...)) <br>
!ENDIF<br>
Index: mlx4/kernel/bus/drv/drv.c<br>
===================================================================<br>
--- mlx4/kernel/bus/drv/drv.c (revision 1301)<br>
+++ mlx4/kernel/bus/drv/drv.c (working copy)<br>
@@ -917,11 +917,11 @@<br>
//<br>
status = WdfRegistryQueryULong(hKey, &debugLevel,
&value);<br>
if (NT_SUCCESS (status)) <br>
- g_mlx4_dbg_level = g.DebugPrintLevel = value;<br>
+ g_mlx4_dbg_level = g.bwsd.DebugPrintLevel = value;<br>
<br>
status = WdfRegistryQueryULong(hKey, &debugFlags,
&value);<br>
if (NT_SUCCESS (status)) <br>
- g_mlx4_dbg_flags = g.DebugPrintFlags = value;<br>
+ g_mlx4_dbg_flags = g.bwsd.DebugPrintFlags = value;<br>
<br>
status = WdfRegistryQueryULong(hKey, &numQp, &value);<br>
if (NT_SUCCESS (status)) <br>
@@ -1051,8 +1051,8 @@<br>
<br>
<br>
// global initializations<br>
- g_mlx4_dbg_level = g.DebugPrintLevel = TRACE_LEVEL_VERBOSE;<br>
- g_mlx4_dbg_flags = g.DebugPrintFlags = 0xffff;<br>
+ g_mlx4_dbg_level = g.bwsd.DebugPrintLevel = TRACE_LEVEL_VERBOSE;<br>
+ g_mlx4_dbg_flags = g.bwsd.DebugPrintFlags = 0xffff;<br>
<br>
MLX4_ENTER(MLX4_DBG_DRV);<br>
MLX4_PRINT(TRACE_LEVEL_INFORMATION, MLX4_DBG_DRV, <br>
Index: mlx4/kernel/bus/drv/drv.h<br>
===================================================================<br>
--- mlx4/kernel/bus/drv/drv.h (revision 1301)<br>
+++ mlx4/kernel/bus/drv/drv.h (working copy)<br>
@@ -56,6 +56,14 @@<br>
// The device extension of the bus itself. From whence the PDO's
are born.<br>
//<br>
<br>
+<br>
+typedef<br>
+BOOLEAN<br>
+(*PISR_FUNC)( <br>
+ IN PVOID IsrContext<br>
+ );<br>
+<br>
+<br>
typedef struct _FDO_DEVICE_DATA<br>
{<br>
BUS_WMI_STD_DATA WmiData;<br>
Index: mlx4/kernel/bus/drv/pdo.c<br>
===================================================================<br>
--- mlx4/kernel/bus/drv/pdo.c (revision 1301)<br>
+++ mlx4/kernel/bus/drv/pdo.c (working copy)<br>
@@ -226,6 +226,8 @@<br>
<br>
p_fdo->bus_ib_ifc.mlx4_interface.mlx4_INIT_PORT =
mlx4_INIT_PORT;<br>
p_fdo->bus_ib_ifc.mlx4_interface.mlx4_CLOSE_PORT =
mlx4_CLOSE_PORT;<br>
+ p_fdo->bus_ib_ifc.mlx4_interface.mlx4_add_eq = mlx4_add_eq;<br>
+ p_fdo->bus_ib_ifc.mlx4_interface.mlx4_remove_eq = mlx4_remove_eq;<br>
<br>
<br>
//<br>
Index: mlx4/kernel/bus/inc/bus_intf.h<br>
===================================================================<br>
--- mlx4/kernel/bus/inc/bus_intf.h (revision 1301)<br>
+++ mlx4/kernel/bus/inc/bus_intf.h (working copy)<br>
@@ -12,9 +12,9 @@<br>
enum mlx4_qp_state;<br>
struct mlx4_qp_context;<br>
enum mlx4_qp_optpar;<br>
+struct mlx4_eq;<br>
<br>
<br>
-<br>
typedef int (*MLX4_REGISTER_INTERFACE)(struct mlx4_interface *intf);<br>
typedef VOID (*MLX4_UNREGISTER_INTERFACE)(struct mlx4_interface *intf);<br>
<br>
@@ -98,6 +98,20 @@<br>
typedef int (*MLX4_CLOSE_PORT)(struct mlx4_dev *dev, int port);<br>
<br>
<br>
+typedef<br>
+BOOLEAN<br>
+(*PISR_FUNC)( <br>
+ IN PVOID IsrContext<br>
+ );<br>
<br>
<font color=navy><span style='color:navy'><o:p></o:p></span></font></span></font></p>
<p class=MsoNormal><font size=2 color=blue face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:blue'>This is defined twice now. Why not
put it in a common header file?<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>+<br>
+<br>
+typedef int (*MLX4_ADD_EQ) (struct mlx4_dev *dev, int nent,<br>
+ u8 intr, PISR_FUNC func, PVOID func_context ,<br>
+ u8* p_eq_num, struct mlx4_eq ** p_eq);<br>
+<br>
+typedef VOID (*MLX4_REMOVE_EQ) (struct mlx4_dev *dev, u8 eq_num);<br>
+<br>
+<br>
struct mlx4_interface_ex {<br>
MLX4_PD_ALLOC mlx4_pd_alloc;<br>
MLX4_PD_FREE
mlx4_pd_free;<br>
@@ -141,6 +155,9 @@<br>
<br>
MLX4_INIT_PORT
mlx4_INIT_PORT;<br>
MLX4_CLOSE_PORT
mlx4_CLOSE_PORT;<br>
+<br>
+ MLX4_ADD_EQ
mlx4_add_eq;<br>
+ MLX4_REMOVE_EQ mlx4_remove_eq;<br>
<br>
};<br>
<br>
@@ -154,7 +171,7 @@<br>
int is_livefish;<br>
MLX4_REGISTER_INTERFACE register_interface;<br>
MLX4_UNREGISTER_INTERFACE unregister_interface;<br>
- ULONG port_id;<br>
+ u8 port_id;<br>
struct VipBusIfc *pVipBusIfc;<br>
<br>
} MLX4_BUS_IB_INTERFACE, *PMLX4_BUS_IB_INTERFACE;<br>
Index: mlx4/kernel/bus/net/cq.c<br>
===================================================================<br>
--- mlx4/kernel/bus/net/cq.c (revision 1301)<br>
+++ mlx4/kernel/bus/net/cq.c (working copy)<br>
@@ -127,7 +127,6 @@<br>
u64 mtt_addr;<br>
int err;<br>
<br>
- UNREFERENCED_PARAMETER(vector);<br>
#define COLLAPSED_SHIFT 18<br>
#define ENTRIES_SHIFT 24<br>
<br>
@@ -161,7 +160,11 @@<br>
cq_context->flags = cpu_to_be32(!!collapsed <<
COLLAPSED_SHIFT);<br>
cq_context->logsize_usrpage = cpu_to_be32(<br>
(ilog2(nent) << ENTRIES_SHIFT)
| uar->index);<br>
- cq_context->comp_eqn =
(u8)priv->eq_table.eq[MLX4_EQ_COMP].eqn;<br>
+ if (vector == 0) {<br>
+ cq_context->comp_eqn
= (u8)priv->eq_table.eq[MLX4_EQ_COMP].eqn;<br>
+ } else {<br>
+ cq_context->comp_eqn =
(u8)priv->eq_table.eq[vector].eqn;<br>
+ }<br>
cq_context->log_page_size = (u8)(mtt->page_shift
- MLX4_ICM_PAGE_SHIFT);<br>
<br>
mtt_addr = mlx4_mtt_addr(dev, mtt);<br>
Index: mlx4/kernel/bus/net/eq.c<br>
===================================================================<br>
--- mlx4/kernel/bus/net/eq.c (revision 1303)<br>
+++ mlx4/kernel/bus/net/eq.c (working copy)<br>
@@ -308,6 +308,19 @@<br>
}<br>
}<br>
<br>
+ for (i = MLX4_NUM_EQ; i <= priv->eq_table.max_extra_eqs; ++i) {<br>
+ if (priv->eq_table.eq[i].isr) {<br>
+ int ret = 0;<br>
+ if ( next_eqe_sw(&priv->eq_table.eq[i]) ) {<br>
+ ret =
priv->eq_table.eq[i].isr(priv->eq_table.eq[i].ctx);<br>
+ work |= ret;<br>
+ }<br>
+ else {<font color=navy><span style='color:navy'><o:p></o:p></span></font></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=blue face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:blue'>nit: the placement of curly braces around
the else is inconsistent in this patch.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><br>
+ eq_set_ci(&priv->eq_table.eq[i], 1);<br>
+ }<br>
+ }<br>
+ }<br>
+<br>
return (BOOLEAN)work;<br>
}<br>
<br>
@@ -708,6 +721,65 @@<br>
return err;<br>
}<br>
<br>
+<br>
+int mlx4_add_eq(struct mlx4_dev *dev, int nent,<br>
+ u8 intr, PISR_FUNC func, PVOID func_context ,<br>
+ u8* p_eq_num, struct mlx4_eq ** p_eq)<br>
+{<br>
+ struct mlx4_priv *priv = mlx4_priv(dev);<br>
+ int err;<br>
+ u8 i, new_eq = 0;<br>
+ for (i = MLX4_NUM_EQ; i < MLX4_NUM_EQ + MLX4_MAX_EXTRA_EQS ; i++) {<br>
+ if(priv->eq_table.eq[MLX4_NUM_EQ].isr == NULL) {<br>
+ new_eq = i;<br>
+ break;<br>
+ }<br>
+ }<br>
+ if (new_eq == 0)<br>
+ return -ENOMEM;<br>
+<br>
+ err = mlx4_create_eq(dev, nent,<br>
+ (dev->flags &
MLX4_FLAG_MSI_X) ? MLX4_EQ_COMP : 0,<br>
+ &priv->eq_table.eq[new_eq]);<br>
+ if (err)<br>
+ return err;<br>
+<br>
+ *p_eq = &priv->eq_table.eq[new_eq ];<br>
+ *p_eq_num = new_eq;<br>
+ priv->eq_table.eq[MLX4_NUM_EQ].isr = func;<font color=navy><span
style='color:navy'><o:p></o:p></span></font></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=blue face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:blue'>Does func ever change? Is it
possible to just initialize it in the array once?<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><br>
+ priv->eq_table.eq[MLX4_NUM_EQ].ctx = func_context;<font color=navy><span
style='color:navy'><o:p></o:p></span></font></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=blue face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:blue'>Same question – does this ever
change?<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><br>
+ priv->eq_table.max_extra_eqs = max(priv->eq_table.max_extra_eqs,
new_eq);<br>
+ return 0;<br>
+}<br>
+<br>
+void mlx4_remove_eq(struct mlx4_dev *dev, u8 eq_num)<br>
+{<br>
+ struct mlx4_priv *priv = mlx4_priv(dev);<br>
+ int err;<br>
+ struct mlx4_eq_table *eq_table = &mlx4_priv(dev)->eq_table;<br>
+<br>
+ priv->eq_table.eq[eq_num].isr = NULL;<br>
+ priv->eq_table.eq[eq_num].ctx = NULL;<br>
+<br>
+ if (priv->eq_table.max_extra_eqs == eq_num)<br>
+ priv->eq_table.max_extra_eqs--;<br>
+<br>
+ mlx4_free_eq(dev, &priv->eq_table.eq[eq_num]);<br>
+<br>
+<br>
+ if (eq_table->have_irq) {<br>
+ free_irq(dev->pdev->int_obj);<br>
+<br>
+<br>
+ err = request_irq( dev, <br>
+ dev->pdev->int_info.u.Interrupt.Vector,<br>
+ mlx4_interrupt, dev, <br>
+ mlx4_dpc, &priv->eq_table.eq[0],<br>
+ &dev->pdev->int_obj );<br>
+ // BUGBUG: how should the error be propogated ?<br>
+ }<br>
+}<br>
+<br>
void mlx4_cleanup_eq_table(struct mlx4_dev *dev)<br>
{<br>
struct mlx4_priv *priv = mlx4_priv(dev);<br>
Index: mlx4/kernel/bus/net/mlx4.h<br>
===================================================================<br>
--- mlx4/kernel/bus/net/mlx4.h (revision 1301)<br>
+++ mlx4/kernel/bus/net/mlx4.h (working copy)<br>
@@ -68,7 +68,7 @@<br>
<br>
#pragma warning(disable:4201) // nameless struct/union<br>
typedef struct _GLOBALS {<br>
- BUS_WMI_STD_DATA;<br>
+ BUS_WMI_STD_DATA bwsd;<br>
<br>
int mod_num_qp;<br>
int mod_rdmarc_per_qp;<br>
@@ -109,6 +109,8 @@<br>
MLX4_NUM_EQ<br>
};<br>
<br>
+#define MLX4_MAX_EXTRA_EQS 5<br>
+<br>
enum {<br>
MLX4_NUM_PDS = 1 << 15<br>
};<br>
@@ -172,8 +174,9 @@<br>
KDPC dpc; /* DPC routine */<br>
spinlock_t lock; /* spinlock for simult DPCs */<br>
int eq_ix; /* EQ index - 0..MLX4_NUM_EQ
*/<br>
- BOOLEAN (*isr)(int,void*); /* isr */<br>
+ BOOLEAN (*isr)(void*); /* isr */<font color=navy><span
style='color:navy'><o:p></o:p></span></font></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=blue face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:blue'>Is this the same as the two function
typedef’s above? Are the typedefs even needed then?<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><br>
void * ctx; /* isr ctx */<br>
+ USHORT eq_no_progress; /* used to look for stacked card */<br>
};<br>
<br>
struct mlx4_profile {<br>
@@ -238,13 +241,14 @@<br>
void __iomem *clr_int;<br>
u8 __iomem
*uar_map[(MLX4_NUM_EQ + 6) / 4];<br>
u32 clr_mask;<br>
- struct mlx4_eq eq[MLX4_NUM_EQ];<br>
+ struct mlx4_eq eq[MLX4_NUM_EQ + MLX4_MAX_EXTRA_EQS];<br>
u64 icm_virt;<br>
dma_addr_t icm_page;<br>
dma_addr_t icm_dma;<br>
struct mlx4_icm_table cmpt_table;<br>
int have_irq;<br>
u8 inta_pin;<br>
+ u8 max_extra_eqs;<font color=navy><span
style='color:navy'><o:p></o:p></span></font></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=blue face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:blue'>Can you explain what this is for? You
have MLX4_MAX_EXTRA_EQS. I see where it’s initialized on create eq,
then possibly decremented in remove.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><br>
};<br>
<br>
struct mlx4_srq_table {<br>
@@ -432,4 +436,16 @@<br>
#define ETH_FCS_LEN 4 /* Frame Check Sequence
Length */<br>
#define ETH_HLEN 14<br>
<br>
+<br>
+typedef<br>
+BOOLEAN<br>
+(*PISR_FUNC)( <br>
+ IN PVOID IsrContext<br>
+ );<br>
<br>
<font color=navy><span style='color:navy'><o:p></o:p></span></font></span></font></p>
<p class=MsoNormal><font size=2 color=blue face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:blue'>A third definition…<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>+<br>
+int mlx4_add_eq(struct mlx4_dev *dev, int nent,<br>
+ u8 intr, PISR_FUNC func,PVOID func_context ,<br>
+ u8* p_eq_num, struct mlx4_eq ** p_eq);<br>
+<br>
+void mlx4_remove_eq(struct mlx4_dev *dev, u8 eq_num);<br>
#endif /* MLX4_H */<br>
Index: mlx4/kernel/inc/vip_dev.h<br>
===================================================================<br>
--- mlx4/kernel/inc/vip_dev.h (revision 1301)<br>
+++ mlx4/kernel/inc/vip_dev.h (working copy)<br>
@@ -25,7 +25,7 @@<br>
<br>
#define MTNIC_MAX_PORTS 2<br>
<br>
-#define MAX_PORT_SIZE 120000<br>
+#define MAX_PORT_SIZE 250000<font color=navy><span style='color:navy'><o:p></o:p></span></font></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=blue face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:blue'>This looks unrelated.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><br>
#define MXE_INTERFACE_VERSION 2<br>
<br>
enum mtnic_state {<br>
@@ -47,13 +47,15 @@<br>
LONG
ResetCount;<br>
<br>
// Objects that are needed in order to work with the
hw<br>
-// struct mlx4_dev
*dev;<br>
<br>
u32
priv_pdn;<br>
struct
mlx4_uar priv_uar;<br>
void
__iomem
*uar_map;<br>
struct
mlx4_mr mr;<br>
spinlock_t
uar_lock;<br>
+<br>
+ struct mlx4_eq *
eq;<br>
+
u8
eq_number;<br>
} NicData_t;<br>
<br>
//typedef struct _VipBusIfc</span></font><o:p></o:p></p>
</div>
</div>
</div>
</body>
</html>