[ofw] patch: Force using grh when RoCE is used

Tzachi Dar tzachid at mellanox.co.il
Mon Dec 27 02:20:01 PST 2010


Applied on 3050. (changes to the mlx4 driver were not applied, they are already applied to the new driver).

Thanks
Tzachi

From: ofw-bounces at lists.openfabrics.org [mailto:ofw-bounces at lists.openfabrics.org] On Behalf Of Tzachi Dar
Sent: Thursday, November 25, 2010 6:59 PM
To: ofw at lists.openfabrics.org
Subject: [ofw] patch: Force using grh when RoCE is used

The following patch changes one of the places in which we have decided if to use grh or not.
In the case of an RDMA nic, grh will always be used.

Thanks
Tzachi

Index: D:/projinf1/trunk/core/al/kernel/al_cm_cep.c
===================================================================
--- D:/projinf1/trunk/core/al/kernel/al_cm_cep.c            (revision 6917)
+++ D:/projinf1/trunk/core/al/kernel/al_cm_cep.c         (revision 6918)
@@ -4335,6 +4335,7 @@
                                OUT                                       kcep_av_t* const                                            p_av )
 {
                cep_agent_t*                   p_port_cep;
+             int force_grh;

                AL_ENTER( AL_DBG_CM );

@@ -4364,7 +4365,9 @@
                p_av->attr.grh.src_gid = p_path->sgid;
                p_av->attr.grh.dest_gid = p_path->dgid;

-              p_av->attr.grh_valid = !ib_gid_is_link_local( &p_path->dgid );
+             force_grh = p_port_cep->h_ca->obj.p_ci_ca->verbs.rdma_port_get_transport(p_port_cep-> h_ca->obj.p_ci_ca->h_ci_ca, p_port_cep->port_num) == RDMA_TRANSPORT_RDMAOE;
+             p_av->attr.grh_valid = force_grh || (!ib_gid_is_link_local( &p_path->dgid )) ||
+                                    (ib_path_rec_hop_limit(p_path) > 1);

                p_av->attr.static_rate = ib_path_rec_rate( p_path );
                p_av->attr.path_bits = (uint8_t)(p_path->slid - p_port_cep->base_lid);
Index: D:/projinf1/trunk/inc/iba/ib_ci.h
===================================================================
--- D:/projinf1/trunk/inc/iba/ib_ci.h        (revision 6917)
+++ D:/projinf1/trunk/inc/iba/ib_ci.h     (revision 6918)
@@ -74,7 +74,7 @@
  * definition.
  */
 #define VERBS_MAJOR_VER                                     (0x0002)
-#define VERBS_MINOR_VER                                    (0x0001)
+#define VERBS_MINOR_VER                                   (0x0002)

 #define VERBS_VERSION                                            (((VERBS_MAJOR_VER) << 16) | (VERBS_MINOR_VER))
 #define MK_VERBS_VERSION(maj,min)              ((((maj) & 0xFFFF) << 16) | \
@@ -2935,7 +2935,28 @@



+typedef enum rdma_transport_type
+(*ci_rdma_port_get_transport) (
+             IN                                           const     ib_ca_handle_t                                h_ca,
+             IN                                           const     uint8_t                                                 port_num );
+/*
+* DESCRIPTION
+*           This routine Release page list for fast memory registration
+*
+* PARAMETERS
+*           h_ca
+*                           [in] Handle to HCA
+*           port_num
+*                           [in] port number to which this request is directed is to be sent.
+*
+* RETURN VALUE
+*                           rdma_transport_type identifying the type of the card
+* SEE ALSO
+*
+******
+*/

+
 #define               MAX_LIB_NAME                              32

 #ifdef CL_KERNEL
@@ -3094,6 +3115,9 @@
                ci_alloc_fast_reg_page_list         alloc_fast_reg_page_list;
                ci_free_fast_reg_page_list         free_fast_reg_page_list;

+             /* 2.2 verbs */
+             ci_rdma_port_get_transport rdma_port_get_transport;
+
 } ci_interface_t;
 /********/

Index: D:/projinf1/trunk/hw/mlx4/kernel/hca/data.h
===================================================================
--- D:/projinf1/trunk/hw/mlx4/kernel/hca/data.h            (revision 6917)
+++ D:/projinf1/trunk/hw/mlx4/kernel/hca/data.h         (revision 6918)
@@ -327,10 +327,6 @@
                IN           OUT                                       ci_interface_t                                                    *p_interface );

 void
-mlnx_ca_if_livefish(
-              IN           OUT                                       ci_interface_t                                                    *p_interface );
-
-void
 mlnx_mr_if_livefish(
                IN           OUT                                       ci_interface_t                                                    *p_interface );

Index: D:/projinf1/trunk/hw/mlx4/kernel/hca/ca.c
===================================================================
--- D:/projinf1/trunk/hw/mlx4/kernel/hca/ca.c (revision 6917)
+++ D:/projinf1/trunk/hw/mlx4/kernel/hca/ca.c              (revision 6918)
@@ -407,8 +407,25 @@
                return IB_SUCCESS;
 }

+enum rdma_transport_type
+mlnx_port_get_transport (
+             IN                           const     ib_ca_handle_t                h_ca,
+             IN           const uint8_t                                                     port_num )
+{
+             mlnx_hca_t *p_hca = (mlnx_hca_t *)h_ca;
+             struct ib_device *p_ibdev = hca2ibdev(p_hca);
+
+             HCA_ENTER(HCA_DBG_SHIM);

+             ASSERT (port_num >= start_port(p_ibdev) && port_num <= end_port(p_ibdev));

+             HCA_EXIT(HCA_DBG_SHIM);
+
+             return p_ibdev->get_port_transport(p_ibdev, port_num);
+
+
+}
+
 void
 mlnx_ca_if(
                IN           OUT                                       ci_interface_t                                                    *p_interface )
@@ -419,14 +436,7 @@
                p_interface->close_ca = mlnx_close_ca;
                p_interface->register_event_handler = mlnx_register_event_handler;
                p_interface->unregister_event_handler = mlnx_unregister_event_handler;
+             p_interface->rdma_port_get_transport = mlnx_port_get_transport;
+
 }

-void
-mlnx_ca_if_livefish(
-              IN           OUT                                       ci_interface_t                                                    *p_interface )
-{
-              p_interface->open_ca = mlnx_open_ca;
-              p_interface->query_ca = mlnx_query_ca;
-              p_interface->close_ca = mlnx_close_ca;
-}
-
Index: D:/projinf1/trunk/hw/mthca/kernel/hca_verbs.c
===================================================================
--- D:/projinf1/trunk/hw/mthca/kernel/hca_verbs.c      (revision 6917)
+++ D:/projinf1/trunk/hw/mthca/kernel/hca_verbs.c   (revision 6918)
@@ -1631,6 +1631,16 @@
 }


+
+enum rdma_transport_type
+mlnx_port_get_transport (
+             IN                           const     ib_ca_handle_t                h_ca,
+             IN           const uint8_t                                                     port_num )
+{
+             UNREFERENCED_PARAMETER(h_ca);
+             UNREFERENCED_PARAMETER(port_num);
+             return RDMA_TRANSPORT_IB;
+}
 void
 setup_ci_interface(
                IN                           const     ib_net64_t                                                                          ca_guid,
@@ -1686,6 +1696,7 @@
                p_interface->destroy_cq = mlnx_destroy_cq;

                p_interface->local_mad = mlnx_local_mad;
+             p_interface->rdma_port_get_transport = mlnx_port_get_transport;


                mlnx_memory_if(p_interface);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20101227/d6689bee/attachment.html>


More information about the ofw mailing list