[ofa-general] Re: [PATCH] qperf: adding SL option for RDMA tests
Johann George
johann.george at qlogic.com
Thu Jan 31 20:35:57 PST 2008
Hello Yevgeny.
You did quite well with the patch but missed a few items.
We should also increment the version since the data we are
passing between the client and the server has changed to
include the service level. I'll fix it up and check it in.
Thanks for the patch. It is a useful option.
Johann
On Wed, Jan 30, 2008 at 04:22:20PM +0200, Yevgeny Kliteynik wrote:
> Hi Johann,
>
> I'd like to add to qperf a command line parameter to for
> changing the SL of the QP/AH (for RDMA tests).
> This is being used mainly in order to check the QoS feature
> and performance on different VLs.
>
> I'm not sure I figured out the option thing in qperf right,
> but in any case, the following patch does the job for me.
>
> Please review and let me know what you think.
>
> -- Yevgeny
>
> Signed-off-by: Yevgeny Kliteynik <kliteyn at dev.mellanox.co.il>
> ---
> src/help.txt | 4 ++++
> src/qperf.c | 11 ++++++++++-
> src/qperf.h | 3 +++
> src/rdma.c | 6 ++++--
> 4 files changed, 21 insertions(+), 3 deletions(-)
>
> diff --git a/src/help.txt b/src/help.txt
> index 59195cb..ec00356 100644
> --- a/src/help.txt
> +++ b/src/help.txt
> @@ -77,6 +77,7 @@ Opts
> --timeout Time (-T) Set timeout
> --loc_timeout Time (-lT) Set local timeout
> --rem_timeout Time (-rT) Set remote timeout
> + --service_level SL (-sl) Set Service Level to SL for RDMA tests
> --unify_nodes (-un) Unify nodes
> --unify_units (-uu) Unify units
> --use_bits_per_sec (-ub) Use bits/sec rather than bytes/sec
> @@ -184,6 +185,9 @@ Options
> Set local timeout to Time.
> --rem_timeout Time (-rT)
> Set local timeout to Time.
> + --service_level SL (-sl)
> + Set Service Level to SL. This is the SL used for RDMA tests only.
> + The default SL is 0.
> --unify_nodes (-un)
> Unify the nodes. Describe them in terms of local and remote rather
> than send and receive.
> diff --git a/src/qperf.c b/src/qperf.c
> index fd4c24f..06ff2d5 100644
> --- a/src/qperf.c
> +++ b/src/qperf.c
> @@ -280,6 +280,7 @@ PAR_NAME ParName[] ={
> { "sock_buf_size", L_SOCK_BUF_SIZE, R_SOCK_BUF_SIZE },
> { "time", L_TIME, R_TIME },
> { "timeout", L_TIMEOUT, R_TIMEOUT },
> + { "service_level", L_SL, R_SL },
> };
>
>
> @@ -317,6 +318,8 @@ PAR_INFO ParInfo[P_N] ={
> { R_TIME, 't', &RReq.time },
> { L_TIMEOUT, 't', &Req.timeout },
> { R_TIMEOUT, 't', &RReq.timeout },
> + { L_SL, 'q', &Req.sl },
> + { R_SL, 'q', &RReq.sl },
> };
>
>
> @@ -392,6 +395,8 @@ OPTION Options[] ={
> { "-rT", 0, &opt_time, R_TIMEOUT },
> { "--server_timeout", 0, &opt_misc, 's', 't' },
> { "-st", 0, &opt_misc, 's', 't' },
> + { "--service_level", 0, &opt_long, L_SL, R_SL },
> + { "-sl", 0, &opt_long, L_SL, R_SL },
> { "--unify_nodes", 0, &opt_misc, 'u', 'n' },
> { "-un", 0, &opt_misc, 'u', 'n' },
> { "--unify_units", 0, &opt_misc, 'u', 'u' },
> @@ -1217,6 +1222,8 @@ client(TEST *test)
> par_use(R_AFFINITY);
> par_use(L_TIME);
> par_use(R_TIME);
> + par_use(L_SL);
> + par_use(R_SL);
>
> set_affinity();
> RReq.ver_maj = VER_MAJ;
> @@ -1848,7 +1855,7 @@ show_rest(void)
> uint64_t lr = LStat.r.no_bytes;
> uint64_t rs = RStat.s.no_bytes;
> uint64_t rr = RStat.r.no_bytes;
> -
> +
> if (ls && !rs && rr && !lr) {
> srmode = 1;
> resnS = &Res.l;
> @@ -2385,6 +2392,7 @@ enc_req(REQ *host)
> enc_int(host->no_msgs, sizeof(host->no_msgs));
> enc_int(host->sock_buf_size, sizeof(host->sock_buf_size));
> enc_int(host->time, sizeof(host->time));
> + enc_int(host->sl, sizeof(host->sl));
> enc_str(host->id, sizeof(host->id));
> }
>
> @@ -2411,6 +2419,7 @@ dec_req(REQ *host)
> host->no_msgs = dec_int(sizeof(host->no_msgs));
> host->sock_buf_size = dec_int(sizeof(host->sock_buf_size));
> host->time = dec_int(sizeof(host->time));
> + host->sl = dec_int(sizeof(host->sl));
> dec_str(host->id, sizeof(host->id));
> }
>
> diff --git a/src/qperf.h b/src/qperf.h
> index 0c42361..2539f61 100644
> --- a/src/qperf.h
> +++ b/src/qperf.h
> @@ -119,6 +119,8 @@ typedef enum {
> R_TIME,
> L_TIMEOUT,
> R_TIMEOUT,
> + L_SL,
> + R_SL,
> P_N
> } PAR_INDEX;
>
> @@ -156,6 +158,7 @@ typedef struct REQ {
> uint32_t no_msgs; /* Number of messages */
> uint32_t sock_buf_size; /* Socket buffer size */
> uint32_t time; /* Duration in seconds */
> + uint8_t sl; /* Service Level */
> char id[STRSIZE]; /* Identifier */
> char rate[STRSIZE]; /* Rate */
> } REQ;
> diff --git a/src/rdma.c b/src/rdma.c
> index b0cd067..5208d4d 100644
> --- a/src/rdma.c
> +++ b/src/rdma.c
> @@ -1596,7 +1596,8 @@ ib_prepare(IBDEV *ibdev)
> .ah_attr = {
> .dlid = ibdev->rcon.lid,
> .port_num = ibdev->port,
> - .static_rate = ibdev->rate
> + .static_rate = ibdev->rate,
> + .sl = Req.sl
> }
> };
> struct ibv_qp_attr rts_attr ={
> @@ -1610,7 +1611,8 @@ ib_prepare(IBDEV *ibdev)
> struct ibv_ah_attr ah_attr ={
> .dlid = ibdev->rcon.lid,
> .port_num = ibdev->port,
> - .static_rate = ibdev->rate
> + .static_rate = ibdev->rate,
> + .sl = Req.sl
> };
>
> if (ibdev->trans == IBV_QPT_UD) {
> --
> 1.5.1.4
More information about the general
mailing list