<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6000.16587" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=466495420-05052008>Here is the
description of mlx4_0290_mcast_loopback.patch</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2>mlx4: enable discarding/passing multicast loopback
packets by FW/HW.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Multicast (and broadcast) loopback is handled by
the network stack meaning that<BR>all MC or BC packets that need to return into
receive sockets on the machine are<BR>duplicated and put in the rx path handling
by the ip network stack.<BR>The HCA loops all multicast outgoing packets so that
any attached QP can get<BR>these multicast packets as well.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>The IPoIB module needs to discard all those self QP
loopback packets and does<BR>so by comparing the SLID and QPN.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>This patch controls the ConnectX HCA multicast
packets block loopback (blck_lb) for self QP.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>The patch is designed to enable or disable blocking
of all multicast packets on self QP<BR>in FW/HW on all QPs created on the
ConnectX HCA.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Inter QP multicast packets on the relevant HCA will
still be delivered.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>The /sys/module/mlx4_core/block_loopback attribute
controls the policy flag.<BR>Its default value is blocking-enabled
(non-zero).<BR>The flag can be read and set/unset through sysfs.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Signed-off-by: Alex Rosenbaum <<A
href="mailto:alexr@voltaire.com">alexr@voltaire.com</A>><BR>Signed-off-by:
Merav Havuv <<A
href="mailto:meravh@voltaire.com">meravh@voltaire.com</A>><BR>Signed-off-by:
Jack Morgenstein <<A
href="mailto:jackm@dev.mellanox.co.il">jackm@dev.mellanox.co.il</A>><BR></FONT></DIV>
<DIV><SPAN class=466495420-05052008><FONT face=Arial size=2>The following is
it's windows porting.</FONT></SPAN></DIV>
<DIV><SPAN class=466495420-05052008><FONT face=Arial size=2>Please note, I have
run a few tests that show that things work correctly (no regression). I'll still
have to run tests that will show that performance is
improved.</FONT></SPAN></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN
class=466495420-05052008>Thanks</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=466495420-05052008>Tzachi</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Index:
kernel/bus/drv/drv.c<BR>===================================================================<BR>---
kernel/bus/drv/drv.c (revision 2386)<BR>+++
kernel/bus/drv/drv.c (working copy)<BR>@@ -843,6 +843,9
@@<BR> // "Enable Quality of Service support in the HCA if > 0,
(default 1)"<BR> DECLARE_CONST_UNICODE_STRING(enableQoS,
L"EnableQoS"); <BR> <BR>+ // "Block multicast loopback packets if
> 0 (default 1)"<BR>+ DECLARE_CONST_UNICODE_STRING(BlockMcastLB,
L"BlockMcastLoopBack"); <BR>+<BR> ULONG
value;<BR> WDFKEY hKey = NULL;<BR> NTSTATUS status =
STATUS_SUCCESS;<BR>@@ -897,6 +900,12
@@<BR> else<BR> g.enable_qos =
1;<BR> <BR>+ status = WdfRegistryQueryULong(hKey,
&BlockMcastLB, &value);<BR>+ if (NT_SUCCESS (status))
<BR>+ g.mlx4_blck_lb =
value;<BR>+ else<BR>+ g.mlx4_blck_lb =
1;<BR>+<BR> WdfRegistryClose(hKey);<BR> status
= STATUS_SUCCESS;<BR> }<BR>Index:
kernel/bus/drv/mlx4_bus.inf<BR>===================================================================<BR>---
kernel/bus/drv/mlx4_bus.inf (revision 2386)<BR>+++
kernel/bus/drv/mlx4_bus.inf (working copy)<BR>@@ -147,6 +147,7
@@<BR> HKR,"Parameters","LogNumMpt",%REG_DWORD%,0x00000011<BR> HKR,"Parameters","LogNumMtt",%REG_DWORD%,0x00000014<BR> HKR,"Parameters","EnableQoS",%REG_DWORD%,0x00000001<BR>+HKR,"Parameters","BlockMcastLoopBack",%REG_DWORD%,0x00000001<BR> <BR> HKLM,"System\CurrentControlSet\Control\WMI\GlobalLogger\E51BB6E2-914A-4e21-93C0-192F4801BBFF","Flags",%REG_DWORD%,0xffff<BR> HKLM,"System\CurrentControlSet\Control\WMI\GlobalLogger\E51BB6E2-914A-4e21-93C0-192F4801BBFF","Level",%REG_DWORD%,0x3<BR>Index:
kernel/bus/net/mcg.c<BR>===================================================================<BR>---
kernel/bus/net/mcg.c (revision 2386)<BR>+++
kernel/bus/net/mcg.c (working copy)<BR>@@ -204,13 +204,15
@@<BR> }<BR> <BR> for (i = 0; i < members_count;
++i)<BR>- if (mgm->qp[i] == cpu_to_be32(qp->qpn))
{<BR>+ if ((be32_to_cpu(mgm->qp[i]) & MGM_QPN_MASK) ==
qp->qpn) {<BR> mlx4_dbg(dev, "QP %06x already a member
of MGM\n", qp->qpn);<BR> err =
0;<BR> goto
out;<BR> }<BR> <BR>- mgm->qp[members_count++] =
cpu_to_be32(qp->qpn);<BR>+ mgm->qp[members_count++] =
cpu_to_be32((qp->qpn & MGM_QPN_MASK)
|<BR>+
(!!g.mlx4_blck_lb <<
MGM_BLCK_LB_BIT));<BR>+<BR> mgm->members_count
= cpu_to_be32(members_count);<BR> <BR> err = mlx4_WRITE_MCG(dev,
index, mailbox);<BR>@@ -285,7 +287,7 @@<BR> <BR> members_count =
be32_to_cpu(mgm->members_count);<BR> for (loc = -1, i = 0; i <
(int)members_count; ++i)<BR>- if (mgm->qp[i] ==
cpu_to_be32(qp->qpn))<BR>+ if ((be32_to_cpu(mgm->qp[i]) &
MGM_QPN_MASK) == qp->qpn)<BR> loc =
i;<BR> <BR> if (loc == -1) {<BR>Index:
kernel/bus/net/mlx4.h<BR>===================================================================<BR>---
kernel/bus/net/mlx4.h (revision 2386)<BR>+++
kernel/bus/net/mlx4.h (working copy)<BR>@@ -73,6 +73,7
@@<BR> int mod_num_mtt;<BR> <BR> int
enable_qos;<BR>+ int mlx4_blck_lb;<BR> } GLOBALS;<BR> #pragma
warning(default:4201) // nameless struct/union<BR> <BR>@@ -114,6 +115,9
@@<BR> MLX4_NUM_CMPTS = MLX4_CMPT_NUM_TYPE <<
MLX4_CMPT_SHIFT<BR> };<BR> <BR>+#define
MGM_QPN_MASK 0x00FFFFFF<BR>+#define
MGM_BLCK_LB_BIT 30<BR>+<BR> struct mlx4_bitmap
{<BR> u32 last;<BR> u32 top;<BR></DIV></FONT></BODY></HTML>