[ewg] [PATCH] cancel inline default for Hermon

Oren Meron orenmeron at dev.mellanox.co.il
Thu Jan 31 07:25:56 PST 2008


perftest: cancel inline default for Hermon to optimize BW performance in send and write

Signed-off-by: Oren Meron <orenmeron at dev.mellanox.co.il>

--- a/send_bw.c
+++ b/send_bw.c
@@ -922,6 +922,7 @@ int main(int argc, char *argv[])
        struct pingpong_dest     my_dest;
        struct pingpong_dest    *rem_dest;
        struct user_parameters  user_param;
+       struct ibv_device_attr device_attribute;
        char                    *ib_devname = NULL;
        int                      port = 18515;
        int                      ib_port = 1;
@@ -929,6 +930,8 @@ int main(int argc, char *argv[])
        int                                 sockfd;
        int                      i = 0;
        int                      size_max_pow = 24;
+       int                      inline_given_in_cmd = 0;
+       struct ibv_context       *context;
        /* init default values to user's parameters */
        memset(&user_param, 0, sizeof(struct user_parameters));
        user_param.mtu = 0;
@@ -937,7 +940,7 @@ int main(int argc, char *argv[])
        user_param.servername = NULL;
        user_param.use_event = 0;
        user_param.duplex = 0;
-    user_param.inline_size = MAX_INLINE;
+       user_param.inline_size = MAX_INLINE;
        /* Parameter parsing. */
        while (1) {
                int c;
@@ -1022,6 +1025,7 @@ int main(int argc, char *argv[])
 
                case 'I':
                        user_param.inline_size = strtol(optarg, NULL, 0);
+                       inline_given_in_cmd =1;
                        if (user_param.inline_size > MAX_INLINE) {
                                usage(argv[0]);
                                return 7;
@@ -1069,7 +1073,6 @@ int main(int argc, char *argv[])
        else
                printf("                    Send BW Test\n");
 
-       printf("Inline data is used up to %d bytes message\n", user_param.inline_size);
        if (user_param.connection_type == RC)
                printf("Connection type : RC\n");
        else if (user_param.connection_type == UC)
@@ -1109,6 +1112,16 @@ int main(int argc, char *argv[])
                }
        }
 
+       context = ibv_open_device(ib_dev);
+       if (ibv_query_device(context, &device_attribute)) {
+               fprintf(stderr, "Failed to query device props");
+               return 1;
+       }
+       if ((device_attribute.vendor_part_id == 25418) && (!inline_given_in_cmd)) {
+               user_param.inline_size = 1;
+       }
+       printf("Inline data is used up to %d bytes message\n", user_param.inline_size);
+
        ctx = pp_init_ctx(ib_dev, size, user_param.tx_depth, user_param.rx_depth,
                          ib_port, &user_param);
        if (!ctx)
diff --git a/write_bw.c b/write_bw.c
index 83a8af4..7c518aa 100644 (file)

--- a/write_bw.c
+++ b/write_bw.c
@@ -666,6 +666,7 @@ int main(int argc, char *argv[])
        struct pingpong_dest     *my_dest;
        struct pingpong_dest    **rem_dest;
        struct user_parameters  user_param;
+       struct ibv_device_attr device_attribute;
        char                    *ib_devname = NULL;
        int                      port = 18515;
        int                      ib_port = 1;
@@ -674,6 +675,8 @@ int main(int argc, char *argv[])
        int                      duplex = 0;
        int                      i = 0;
        int                      noPeak = 0;/*noPeak == 0: regular peak-bw calculation done*/
+       int                      inline_given_in_cmd = 0;
+       struct ibv_context       *context;
 
        /* init default values to user's parameters */
        memset(&user_param, 0, sizeof(struct user_parameters));
@@ -767,6 +770,7 @@ int main(int argc, char *argv[])
 
                case 'I':
                        user_param.inline_size = strtol(optarg, NULL, 0);
+                       inline_given_in_cmd =1;
                        if (user_param.inline_size > MAX_INLINE) {
                                usage(argv[0]);
                                return 7;
@@ -810,7 +814,6 @@ int main(int argc, char *argv[])
          printf("                    RDMA_Write BW Test\n");
        }
        
-       printf("Inline data is used up to %d bytes message\n", user_param.inline_size);
        printf("Number of qp's running %d\n",user_param.numofqps);
        if (user_param.connection_type==RC) {
                printf("Connection type : RC\n");
@@ -853,6 +856,16 @@ int main(int argc, char *argv[])
                }
        }
 
+       context = ibv_open_device(ib_dev);
+       if (ibv_query_device(context, &device_attribute)) {
+               fprintf(stderr, "Failed to query device props");
+               return 1;
+       }
+       if ((device_attribute.vendor_part_id == 25418) && (!inline_given_in_cmd)) {
+               user_param.inline_size = 1;
+       }
+       printf("Inline data is used up to %d bytes message\n", user_param.inline_size);
+
        ctx = pp_init_ctx(ib_dev, size, user_param.tx_depth, ib_port, &user_param);
        if (!ctx)
                return 1;
diff --git a/write_bw_postlist.c b/write_bw_postlist.c
index 4cd613c..dc900f4 100644 (file)

--- a/write_bw_postlist.c
+++ b/write_bw_postlist.c
@@ -665,6 +665,7 @@ int main(int argc, char *argv[])
        struct pingpong_dest     *my_dest;
        struct pingpong_dest    **rem_dest;
        struct user_parameters  user_param;
+       struct ibv_device_attr device_attribute;
        char                    *ib_devname = NULL;
        int                      port = 18515;
        int                      ib_port = 1;
@@ -672,6 +673,8 @@ int main(int argc, char *argv[])
        int                      sockfd;
        int                      duplex = 0;
        int                      i = 0;
+       int                      inline_given_in_cmd = 0;
+       struct ibv_context       *context;
 
        /* init default values to user's parameters */
        memset(&user_param, 0, sizeof(struct user_parameters));
@@ -764,6 +767,7 @@ int main(int argc, char *argv[])
 
                case 'I':
                        user_param.inline_size = strtol(optarg, NULL, 0);
+                       inline_given_in_cmd =1;
                        if (user_param.inline_size > MAX_INLINE) {
                                usage(argv[0]);
                                return 7;
@@ -804,7 +808,6 @@ int main(int argc, char *argv[])
          printf("                    RDMA_Write Post List BW Test\n");
        }
        
-       printf("Inline data is used up to %d bytes message\n", user_param.inline_size);
        printf("Number of qp's running %d\n",user_param.numofqps);
        if (user_param.connection_type==RC) {
                printf("Connection type : RC\n");
@@ -844,6 +847,16 @@ int main(int argc, char *argv[])
                }
        }
 
+       context = ibv_open_device(ib_dev);
+       if (ibv_query_device(context, &device_attribute)) {
+               fprintf(stderr, "Failed to query device props");
+               return 1;
+       }
+       if ((device_attribute.vendor_part_id == 25418) && (!inline_given_in_cmd)) {
+               user_param.inline_size = 1;
+       }
+       printf("Inline data is used up to %d bytes message\n", user_param.inline_size);
+
        ctx = pp_init_ctx(ib_dev, size, user_param.tx_depth, ib_port, &user_param);
        if (!ctx)
                return 1;




More information about the ewg mailing list