<!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><SPAN class=866380708-10072008><FONT face=Arial color=#0000ff
size=2>Applied at 1362.</FONT></SPAN></DIV><BR>
<BLOCKQUOTE dir=ltr
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> ofw-bounces@lists.openfabrics.org
[mailto:ofw-bounces@lists.openfabrics.org] <B>On Behalf Of </B>Tzachi
Dar<BR><B>Sent:</B> Wednesday, July 09, 2008 12:39 PM<BR><B>To:</B>
ofw@lists.openfabrics.org; Uri Habusha<BR><B>Subject:</B> [ofw] patch: move eq
defenitions to a common header file<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV><FONT face=Arial size=2><SPAN class=998343009-09072008>This patch is in
order to allow other users of the eqs to use the code that reads data from the
eq.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=998343009-09072008>(no new code is
introduced, only moving code from .c file to .h
file) </SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=998343009-09072008></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN
class=998343009-09072008>Thanks</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=998343009-09072008>Tzachi</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Index: inc/eq.h</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial
size=2>===================================================================</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>--- inc/eq.h (revision 0)</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>+++ inc/eq.h (revision 0)</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>@@ -0,0 +1,129 @@</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>+/*</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>+ * Copyright (c) 2008 Mellanox
Technologies. All rights reserved.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>+ * Portions Copyright (c) 2008 Microsoft
Corporation. All rights reserved.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>+ *</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>+ * This software is available to you under the
OpenIB.org BSD license</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>+ * below:</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>+ *</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>+ * Redistribution and
use in source and binary forms, with or</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>+ * without modification,
are permitted provided that the following</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>+ * conditions are
met:</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>+ *</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>+ * -
Redistributions of source code must retain the above</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>+ *
copyright notice, this list of conditions and the following</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>+ *
disclaimer.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>+ *</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>+ * -
Redistributions in binary form must reproduce the above</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>+ *
copyright notice, this list of conditions and the following</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>+ *
disclaimer in the documentation and/or other materials</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>+ *
provided with the distribution.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>+ *</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT
WARRANTY OF ANY KIND,</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
TO THE WARRANTIES OF</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>+ * NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>+ * ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>+ * CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>+ * SOFTWARE.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>+ *</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>+ * $Id: ipoib_port.h 1310 2008-06-30 18:09:25Z
ftillier $</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>+ */</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>+</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>+#ifndef MLX4_EQ_H</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>+#define MLX4_EQ_H</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>+</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>+enum {<BR>+ MLX4_NUM_ASYNC_EQE =
0x100,<BR>+ MLX4_NUM_SPARE_EQE =
0x80,<BR>+ MLX4_EQ_ENTRY_SIZE = 0x20<BR>+};</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>+</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>+struct mlx4_eq {<BR>+ struct
mlx4_dev *dev;<BR>+ void
__iomem
*doorbell;<BR>+ int eqn;<BR>+ u32 cons_index;<BR>+ u16 irq;<BR>+ u16 have_irq;<BR>+ int nent;<BR>+ struct
mlx4_buf_list *page_list;<BR>+ struct
mlx4_mtt mtt;<BR>+ //
Windows<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)(void*); /* isr
*/<BR>+ void * ctx; /* isr ctx */<BR>+ USHORT
eq_no_progress; /* used to look for stacked card
*/<BR>+};<BR>+</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>+</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>+</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>+#pragma pack(push,1)<BR>+struct mlx4_eqe
{<BR>+ u8 reserved1;<BR>+ u8 type;<BR>+ u8 reserved2;<BR>+ u8 subtype;<BR>+ union
{<BR>+ u32 raw[6];<BR>+ struct
{<BR>+ __be32 cqn;<BR>+ }
__attribute__((packed)) comp;<BR>+ struct
{<BR>+ u16 reserved1;<BR>+ __be16 token;<BR>+ u32 reserved2;<BR>+ u8 reserved3[3];<BR>+ u8 status;<BR>+ __be64 out_param;<BR>+ }
__attribute__((packed)) cmd;<BR>+ struct
{<BR>+ __be32 qpn;<BR>+ }
__attribute__((packed)) qp;<BR>+ struct
{<BR>+ __be32 srqn;<BR>+ }
__attribute__((packed)) srq;<BR>+ struct
{<BR>+ __be32 cqn;<BR>+ u32 reserved1;<BR>+ u8 reserved2[3];<BR>+ u8 syndrome;<BR>+ }
__attribute__((packed)) cq_err;<BR>+ struct
{<BR>+ u32 reserved1[2];<BR>+ __be32 port;<BR>+ }
__attribute__((packed))
port_change;<BR>+ } event;<BR>+ u8 reserved3[3];<BR>+ u8 owner;<BR>+}
__attribute__((packed));<BR>+#pragma pack(pop)<BR>+<BR>+static void
eq_set_ci(struct mlx4_eq *eq, int
req_not)<BR>+{<BR>+ __raw_writel((__force u32)
cpu_to_be32((eq->cons_index & 0xffffff)
|<BR>+
req_not << 31),<BR>+
eq->doorbell);<BR>+ /* We still want ordering, just not swabbing, so
add a barrier */<BR>+ mb();<BR>+}<BR>+<BR>+static struct mlx4_eqe
*get_eqe(struct mlx4_eq *eq, u32 entry)<BR>+{<BR>+ unsigned long off =
(entry & (eq->nent - 1)) * MLX4_EQ_ENTRY_SIZE;<BR>+ return (struct
mlx4_eqe *)(eq->page_list[off / PAGE_SIZE].buf + off %
PAGE_SIZE);<BR>+}<BR>+<BR>+static struct mlx4_eqe *next_eqe_sw(struct mlx4_eq
*eq)<BR>+{<BR>+ struct mlx4_eqe *eqe = get_eqe(eq,
eq->cons_index);<BR>+ return !!(eqe->owner & 0x80) ^
!!(eq->cons_index & eq->nent) ? NULL : eqe;<BR>+}<BR>+</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>+</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>+</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>+#endif /* MLX4_EQ_H */</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>+</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>+</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>Index: net/eq.c</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial
size=2>===================================================================</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>--- net/eq.c (revision 1353)</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>+++ net/eq.c (working copy)</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>@@ -34,13 +34,8 @@</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2> #include "mlx4.h"<BR> #include
"cmd.h"<BR> #include "fw.h"<BR>+#include "eq.h"<BR> <BR>-enum
{<BR>- MLX4_NUM_ASYNC_EQE =
0x100,<BR>- MLX4_NUM_SPARE_EQE =
0x80,<BR>- MLX4_EQ_ENTRY_SIZE =
0x20<BR>-};<BR>-<BR> /*<BR> * Must be packed because start is 64
bits but only aligned to 32 bits.<BR> */<BR>@@ -91,68 +86,6
@@</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial
size=2> (1ull
<< MLX4_EVENT_TYPE_SRQ_LIMIT) |
\<BR> (1ull
<< MLX4_EVENT_TYPE_CMD))<BR> <BR>-#pragma pack(push,1)<BR>-struct
mlx4_eqe
{<BR>- u8 reserved1;<BR>- u8 type;<BR>- u8 reserved2;<BR>- u8 subtype;<BR>- union
{<BR>- u32 raw[6];<BR>- struct
{<BR>- __be32 cqn;<BR>- }
__attribute__((packed)) comp;<BR>- struct
{<BR>- u16 reserved1;<BR>- __be16 token;<BR>- u32 reserved2;<BR>- u8 reserved3[3];<BR>- u8 status;<BR>- __be64 out_param;<BR>- }
__attribute__((packed)) cmd;<BR>- struct
{<BR>- __be32 qpn;<BR>- }
__attribute__((packed)) qp;<BR>- struct
{<BR>- __be32 srqn;<BR>- }
__attribute__((packed)) srq;<BR>- struct
{<BR>- __be32 cqn;<BR>- u32 reserved1;<BR>- u8 reserved2[3];<BR>- u8 syndrome;<BR>- }
__attribute__((packed)) cq_err;<BR>- struct
{<BR>- u32 reserved1[2];<BR>- __be32 port;<BR>- }
__attribute__((packed))
port_change;<BR>- } event;<BR>- u8 reserved3[3];<BR>- u8 owner;<BR>-}
__attribute__((packed));<BR>-#pragma pack(pop)<BR>-<BR>-static void
eq_set_ci(struct mlx4_eq *eq, int
req_not)<BR>-{<BR>- __raw_writel((__force u32)
cpu_to_be32((eq->cons_index & 0xffffff)
|<BR>-
req_not << 31),<BR>-
eq->doorbell);<BR>- /* We still want ordering, just not swabbing, so
add a barrier */<BR>- mb();<BR>-}<BR>-<BR>-static struct mlx4_eqe
*get_eqe(struct mlx4_eq *eq, u32 entry)<BR>-{<BR>- unsigned long off =
(entry & (eq->nent - 1)) * MLX4_EQ_ENTRY_SIZE;<BR>- return (struct
mlx4_eqe *)(eq->page_list[off / PAGE_SIZE].buf + off %
PAGE_SIZE);<BR>-}<BR>-<BR>-static struct mlx4_eqe *next_eqe_sw(struct mlx4_eq
*eq)<BR>-{<BR>- struct mlx4_eqe *eqe = get_eqe(eq,
eq->cons_index);<BR>- return !!(eqe->owner & 0x80) ^
!!(eq->cons_index & eq->nent) ? NULL :
eqe;<BR>-}<BR>-<BR> #pragma warning( disable : 4706)<BR> static int
mlx4_eq_int(struct mlx4_dev *dev, struct mlx4_eq *eq)<BR> {<BR>Index:
net/mlx4.h</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial
size=2>===================================================================</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>--- net/mlx4.h (revision 1353)</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>+++ net/mlx4.h (working copy)</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>@@ -42,6 +42,7 @@</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2> #include "device.h"<BR> #include
"doorbell.h"<BR> #include "bus_intf.h"<BR>+#include
"eq.h"<BR> <BR> <BR> #define DRV_NAME "mlx4_net"<BR>@@
-163,25 +164,6 @@</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2> struct
mlx4_icm
**icm;<BR> };<BR> <BR>-struct mlx4_eq {<BR>- struct
mlx4_dev *dev;<BR>- void
__iomem
*doorbell;<BR>- int eqn;<BR>- u32 cons_index;<BR>- u16 irq;<BR>- u16 have_irq;<BR>- int nent;<BR>- struct
mlx4_buf_list *page_list;<BR>- struct
mlx4_mtt mtt;<BR>- //
Windows<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)(void*); /* isr
*/<BR>- void * ctx; /* isr ctx */<BR>- USHORT
eq_no_progress; /* used to look for stacked card
*/<BR>-};<BR>-<BR> struct mlx4_profile
{<BR> int num_qp;<BR> int rdmarc_per_qp;</FONT></DIV></BLOCKQUOTE></BODY></HTML>