From patchwork Fri Aug 12 13:10:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jinpu Wang X-Patchwork-Id: 9276913 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E973B60752 for ; Fri, 12 Aug 2016 13:10:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CB77A289EA for ; Fri, 12 Aug 2016 13:10:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C04F3289EC; Fri, 12 Aug 2016 13:10:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_TVD_MIME_EPI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 876AA289EA for ; Fri, 12 Aug 2016 13:10:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752330AbcHLNK1 (ORCPT ); Fri, 12 Aug 2016 09:10:27 -0400 Received: from mail-oi0-f54.google.com ([209.85.218.54]:36432 "EHLO mail-oi0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752225AbcHLNK0 (ORCPT ); Fri, 12 Aug 2016 09:10:26 -0400 Received: by mail-oi0-f54.google.com with SMTP id f189so33393589oig.3 for ; Fri, 12 Aug 2016 06:10:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=profitbricks-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=aInCn7TNabZ1n2YnyMdyrpiqep4UVMvOxmfXkZAUV9I=; b=mbZfP3EAeYWV7bxkHTUPeDtL2cWTRQXmUDE/F4hIkwWpa1+3SXEqLbcvga0qmSs4wr yDPfnHy105mfPfjAl48heBUDpW3ZvB3+jcrs/e8r7XsgOsjJeHg2Y8Me3cOsoD1EeYk+ jf2mhO5il6Vj8LJNLxwFrXhecDhtM2oPvu8t2eFDLfDRKyBHaD0qDbRix+jpSrBPxJpJ na5jhpVmm6Z2SCpkVSy6PzFzb8JmlJGrA9PpLxfg6PuGwDEaTUgP5top8rtOI3pnY3Lb XGQJXFWM46OUVt7q7hZbwVspPjWAbSPNWzonUOb39el2/BholPnImoTe88JE6A/Ldclz /Azw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=aInCn7TNabZ1n2YnyMdyrpiqep4UVMvOxmfXkZAUV9I=; b=iaN7oKCGdnTvrIIIezc48SUPv+Sf0uArjXOUobskkWjLRnWT7oboodYeKpbuAkWvs+ QrS8gyNLQ/W1QokrkwTERigmtxjqLZ+mp7Z5KtQBEcujolE+024psfq3vWrUKin7z8l1 itYXTgUmrw/1IU7PkqSTvSzVONy0L/3Fb+8ZHY94aZLJlAkMCBJYbv5ldUQr1SK03+w+ wmPgKO4MrHgKbTt5jQmbbADFacoRafTT/i9GDAI2Z/bZkiKRaWzJY+p+qtEla2DZd+LK v1Z0FKZhNA7vrmNb40Q6RGrGYRNZ/SL0rIOIK0zHtuQEi9A1aIbZWnGGij6hBRJ9JSwt MOQg== X-Gm-Message-State: AEkooutQDJPT2Qm/0RrZbTfqX1QlgdOwxMour12yG8oIrUATysgERJDWCn0nuk5lbAjYdeXUlTUkMK0Dn22/wwGC X-Received: by 10.202.108.10 with SMTP id h10mr8489184oic.117.1471007425589; Fri, 12 Aug 2016 06:10:25 -0700 (PDT) MIME-Version: 1.0 Received: by 10.182.86.200 with HTTP; Fri, 12 Aug 2016 06:10:05 -0700 (PDT) In-Reply-To: References: <170f9d79-2351-d95f-9ed1-eddedc467d68@dev.mellanox.co.il> <853d9a54-2c05-669a-835b-f87b29d6da38@dev.mellanox.co.il> From: Jinpu Wang Date: Fri, 12 Aug 2016 15:10:05 +0200 Message-ID: Subject: Re: [RFI] ucmatose: No effect to set service type for QoS To: Hal Rosenstock Cc: Sean Hefty , "linux-rdma@vger.kernel.org" Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Fri, Aug 12, 2016 at 3:03 PM, Hal Rosenstock wrote: > On 8/12/2016 7:55 AM, Hal Rosenstock wrote: >> On 8/12/2016 4:15 AM, Jinpu Wang wrote: >>> On Thu, Aug 11, 2016 at 11:15 PM, Hal Rosenstock wrote: >>>> On 8/11/2016 8:29 AM, Jinpu Wang wrote: >>>>> On Wed, Aug 10, 2016 at 8:52 PM, Hal Rosenstock wrote: >>>>>> On 8/9/2016 12:26 PM, Jinpu Wang wrote: >>>>>>> Hi Sean, >>>>>>> >>>>>>> I'm testing QoS support for IB. I notice ucmatose has equally >>>>>>> performance when set different service type, but set SL in ib_send_bw >>>>>>> works well (different SL show different performance base on opensm >>>>>>> settings) >>>>>>> >>>>>>> I capature packats using ibdump, it shows in in LRH the service level >>>>>>> fields are all 0 when running traffic with ucmatose. >>>>>>> >>>>>>> When running ib_send_bw, it carries the right service level I set. >>>>>>> >>>>>>> Seems in rdma_set_service_type, it sets to tos to id_priv->tos, and >>>>>>> lter set to path_rec->qos_class or traffic_class but not to sl >>>>>>> directly, what's the consideration here? >>>>>>> code snip: >>>>>>> switch (cma_family(id_priv)) { >>>>>>> case AF_INET: >>>>>>> path_rec->qos_class = cpu_to_be16((u16) id_priv->tos); >>>>>>> comp_mask |= IB_SA_PATH_REC_QOS_CLASS; >>>>>>> break; >>>>>>> case AF_INET6: >>>>>>> sin6 = (struct sockaddr_in6 *) cma_src_addr(id_priv); >>>>>>> path_rec->traffic_class = (u8) >>>>>>> (be32_to_cpu(sin6->sin6_flowinfo) >> 20); >>>>>>> comp_mask |= IB_SA_PATH_REC_TRAFFIC_CLASS; >>>>>>> break; >>>>>>> case AF_IB: >>>>>>> sib = (struct sockaddr_ib *) cma_src_addr(id_priv); >>>>>>> path_rec->traffic_class = (u8) >>>>>>> (be32_to_cpu(sib->sib_flowinfo) >> 20); >>>>>>> >>>>>>> >>>>>>> Does it make sense we also set sl here, or service type for ucmatose >>>>>>> is totally different with SL for ib_send_bw? >>>>>> >>>>>> I think this is an OpenSM configuration issue. QoS policy needs to be >>>>>> setup to return the proper SL to use for QoS class or TClass in the >>>>>> PathRecord response. >>>>>> >>>>>> -- Hal >>>>>> >>>>> Thanks Hal, >>>>> >>>>> Configure extra QoS policy seems quite complex. >>>> >>>> Configuration complexity varies depending on the requirements of the QoS >>>> needs. >>>> >>>> Which type of RDMA CM connections are being used (IPv4, IPv6, or native >>>> IB) ? >>>> >>>>> Do you think patch attached make sense? >>>> >>>> Attached patch doesn't appear to relate to upstream. >>> >>> Indeed, it's based on MLNXOFED 3.2 >>> >>>> >>>> It also looks incomplete to me. What invokes rdma_set_service_level ? Is >>>> it some option in ucma.c:ucma_set_option ? >>> >>> The main purpose is for our in house transport kernel module, > > One more thing: > > How does transport module know which SL to request ? > > In general, SL is based on SM configuration. > > Service ID and QoS Class or Traffic Class are the "higher level" IB > architected ways to obtain the SL. > >>> it >>> supports all 3 connections >>> (IPv4, IPv6, and native IB, IB is the default). >> >>>> Current patch doesn't appear to me to be backward compatible. If >>>> rdma_set_service_level is not called in flow, then SL should not be set >>>> in SA PR query which is what happens today. >>> >>> Good point, I will add check only set SL if not 0, >> >> 0 is a valid SL so an extra bit somewhere is needed to indicate whether >> a specific SL is being requested. >> >>> but if >>> rdma_set_service_level is not called, >>> SL should be 0 as before, shouldn't change SA PR query behavior, or I >>> missed something? >> >> Component mask for SL in SA PR query is not on currently so that means >> it's wildcarded rather than 0. >> >>>> Also, if SL is set in query, you probably don't need some of the other >>>> fields that are being set. >>>> >>> Do you mean SL shouldn't be set with other fields, what's the side effect there? >> >> Never mind. It's probably best to leave those other fields as is. >> Thanks, I update my patch to address your comments. For configuration, we introduce a module parameter, sysadmin will set that. similar for ib_send_bw kinds of perf tools. From 385edc9d217b8175e1c55b52302571b1d21d8d71 Mon Sep 17 00:00:00 2001 From: Jack Wang Date: Wed, 10 Aug 2016 10:50:53 +0200 Subject: [PATCH] cma: export function to set service level We want this for isolating network traffic with storage traffic. So extend cma to allow us to do it for QoS, to keep the old bahavior, only apply mask when sl_on is set. Signed-off-by: Jack Wang --- drivers/infiniband/core/cma.c | 17 +++++++++++++++++ include/rdma/rdma_cm.h | 13 +++++++++++++ 2 files changed, 30 insertions(+) diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c index 66e8516..4b4d453 100644 --- a/drivers/infiniband/core/cma.c +++ b/drivers/infiniband/core/cma.c @@ -225,6 +225,8 @@ struct rdma_id_private { u32 options; u8 srq; u8 tos; + u8 sl; + bool sl_on; u8 reuseaddr; u8 afonly; enum ib_gid_type gid_type; @@ -2752,6 +2754,17 @@ static void cma_listen_on_all(struct rdma_id_private *id_priv) mutex_unlock(&lock); } +void rdma_set_service_level(struct rdma_cm_id *id, u8 sl) +{ + struct rdma_id_private *id_priv; + + id_priv = container_of(id, struct rdma_id_private, id); + id_priv->sl = sl; + id_priv->sl_on = true; +} +EXPORT_SYMBOL(rdma_set_service_level); + + void rdma_set_service_type(struct rdma_cm_id *id, int tos) { struct rdma_id_private *id_priv; @@ -2838,6 +2851,10 @@ static int cma_query_ib_route(struct rdma_id_private *id_priv, int timeout_ms, path_rec->pkey = cpu_to_be16(ib_addr_get_pkey(&addr->dev_addr)); path_rec->numb_path = 1; path_rec->reversible = 1; + if (id_priv->sl_on) { + path_rec->sl = id_priv->sl; + comp_mask |= IB_SA_PATH_REC_SL; + } path_rec->service_id = rdma_get_service_id(&id_priv->id, cma_dst_addr(id_priv)); comp_mask |= IB_SA_PATH_REC_PKEY | IB_SA_PATH_REC_NUMB_PATH | diff --git a/include/rdma/rdma_cm.h b/include/rdma/rdma_cm.h index b34ee4e..df7030e 100644 --- a/include/rdma/rdma_cm.h +++ b/include/rdma/rdma_cm.h @@ -374,6 +374,19 @@ int rdma_join_multicast(struct rdma_cm_id *id, struct sockaddr *addr, void rdma_leave_multicast(struct rdma_cm_id *id, struct sockaddr *addr); /** + * rdma_set_service_level - Set the level of service associated with a + * connection identifier. + * @id: Communication identifier to associated with service type. + * @sl: service level. + * + * The service level should be specified before + * performing route resolution, as existing communication on the + * connection identifier may be unaffected. The level of service + * requested may not be supported by the network to all destinations. + */ +void rdma_set_service_level(struct rdma_cm_id *id, u8 sl); + +/** * rdma_set_service_type - Set the type of service associated with a * connection identifier. * @id: Communication identifier to associated with service type. -- 2.7.4