Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp416127rdb; Thu, 19 Oct 2023 08:05:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG20BLJ+3v3wTw6T+rTd8Ub791vQDnpGS1uxYdTUGDO1+bQ/d9wd/wfjD9o2i0Fv2v5JouU X-Received: by 2002:a05:6a20:244a:b0:17b:62ae:a8bf with SMTP id t10-20020a056a20244a00b0017b62aea8bfmr2395415pzc.30.1697727929977; Thu, 19 Oct 2023 08:05:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697727929; cv=none; d=google.com; s=arc-20160816; b=Fsx6gx6qWN2tc1uRMix7as3WxcEz4eazZ0XFrbq0+3Cn80v4rVdZ+zpQ5T3JmuTtwI atkYFDqLgNk57gmpBT6y+QpToRgC9R/eZAoSCiozu6cRXl11Ak1GQAS0ns2PW4mRa8+t jd8D0E5zedCh2zNbRW3vvVUF4M31cd3ouUB5FA4DZnKLWZqoQM05P8tb6Tzh/CVWbQZa lHhJ+2FzHZ8XLubT0dysIArfZczb48iteQPR/QKE/Jc2aPRSJp1jnwLCqB5A35pajRru KTSZuOOdyO1nI6orWhFgj8Mr/8w1Y0ULWmBzjvYqCgV0Uv5lESvbnHEBECAS9pi9QTFX ud8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=9v0UnUfMjecgKqfEffISepiTr1uFTVrtWXV8o/iqOKA=; fh=pcDwxfl2/a8E/l7W4F4hlR+l0pCjAADP3VKUOIcTik0=; b=EoZ5pb1WjtJ7l6G1qOlkKT6tHCC2yutQYCGDy1pPZWtO2JyCXCAU0wlDXiyYWB6C9I PPuM1Y6N26bZD2V1mNIkasEMOO/RVESCY/mr8aWasxY2KF0P0m6hjEa7Lc27EAJyaUMC zZFaYiu3q1OkHTk/fOytq5Lz3lvQMoe9mXH3bwQZFmBsnYzZzOOf3X4Dufvz3smKivgb 8S++LVHPry/Px53R4TcXlns23kwXQ8imecud5B3XG+qC5Oe9Jt5wFUAbly1FvV6Gs8jS lVQ+YNM61QmCyKvPZun0N5jMKlVrI9kX7OX3uK2BlVf8o6oEc+efrgqqR5LFkR/i8hLQ F4eA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=FUWhfg5W; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id l65-20020a633e44000000b0059fa3d2e560si4574577pga.298.2023.10.19.08.05.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 08:05:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=FUWhfg5W; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id B49E48324314; Thu, 19 Oct 2023 08:05:23 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346242AbjJSPFO (ORCPT + 99 others); Thu, 19 Oct 2023 11:05:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57890 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346215AbjJSPFK (ORCPT ); Thu, 19 Oct 2023 11:05:10 -0400 Received: from mail-il1-x132.google.com (mail-il1-x132.google.com [IPv6:2607:f8b0:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E16CF12A; Thu, 19 Oct 2023 08:05:08 -0700 (PDT) Received: by mail-il1-x132.google.com with SMTP id e9e14a558f8ab-357a354e616so2267715ab.1; Thu, 19 Oct 2023 08:05:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697727908; x=1698332708; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=9v0UnUfMjecgKqfEffISepiTr1uFTVrtWXV8o/iqOKA=; b=FUWhfg5WwE0T6gYovj9FqQrtPky4GInnc+jP9nQQLXUINv6+0LFH1GVEyLs2YN3kEK DcDtRlEKcHufFeSU6VJl3f/2CIdTUCxvn6VVipqlKl3hyngDpjOoR7DXAJuAamb6nVKJ JfW6RsqmJ3oKrSnfn1iOYe2o+QFGg6J0/m4fLMYrKIHWXWfSYxjGNIsyevFyEc/0j77z tZnLJN0He93brcL+dHwpTSLJlFUzM/pPFUqnqjX47gpnT2Ng1PWSr5aZ97EeNiEVQnxS Ka1DoginE/Lh0nJ//7f29GwD6DfqbNXPKgPKn/15rXKcpOnNBLtQF6zVLdExrveRUAS0 46fg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697727908; x=1698332708; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=9v0UnUfMjecgKqfEffISepiTr1uFTVrtWXV8o/iqOKA=; b=YGw4MdoyvAdoWFGz3p+gyQV+18Zo33VcEpZ1yPyb2v6cqAMxDimZyW5MxXF09JUT+o AQFVCA0r7ZovYmVbs9PJPZY6JQfgbjIizjjLi91PpI0G5YKDzuUtyvNyWku5oRLI1F3b oPScsDIdPPka4cEyIuBewCR2dcPlHTzeiYdnt45pcxwzbHqlJ4mVGmmYofHmDZ6KUMfh 6FWVHBB66fUCqION+DB+uusA+PUKf7eIg+Uw19tYFqFQwMDZkoJhHpNXzfp57+tV+Ur0 nVd+Z60bUHgmm90fipwCQMmwEM/2I7WLaStQ9Hja2cBmSl8/sEIUcVzZpeDF6o8G57t2 6Ryg== X-Gm-Message-State: AOJu0YxzAo3djm53uMUIJnG3VeErcNnZvYgEZxSc+SDGuRM1K5WlRhI2 c9OXcf466ph1n2P2r9mSG4g= X-Received: by 2002:a92:db01:0:b0:351:134d:ce3d with SMTP id b1-20020a92db01000000b00351134dce3dmr1469272iln.7.1697727908139; Thu, 19 Oct 2023 08:05:08 -0700 (PDT) Received: from ?IPV6:2601:282:1e82:2350:80d6:b9fd:f23f:cfa9? ([2601:282:1e82:2350:80d6:b9fd:f23f:cfa9]) by smtp.googlemail.com with ESMTPSA id h9-20020a92d849000000b003574844cd71sm1851713ilq.25.2023.10.19.08.05.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 19 Oct 2023 08:05:07 -0700 (PDT) Message-ID: <2c0e946d-eaaf-59f8-2c5a-c47890920c5a@gmail.com> Date: Thu, 19 Oct 2023 09:05:06 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH iproute2-next 2/3] rdma: Add an option to set privileged QKEY parameter Content-Language: en-US To: Petr Machata , Patrisious Haddad Cc: jgg@ziepe.ca, leon@kernel.org, stephen@networkplumber.org, netdev@vger.kernel.org, linux-rdma@vger.kernel.org, linuxarm@huawei.com, linux-kernel@vger.kernel.org, huangjunxian6@hisilicon.com, michaelgur@nvidia.com References: <20231019082138.18889-1-phaddad@nvidia.com> <20231019082138.18889-3-phaddad@nvidia.com> <87il72aiqm.fsf@nvidia.com> From: David Ahern In-Reply-To: <87il72aiqm.fsf@nvidia.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Thu, 19 Oct 2023 08:05:23 -0700 (PDT) On 10/19/23 4:38 AM, Petr Machata wrote: > > Patrisious Haddad writes: > >> @@ -40,6 +45,22 @@ static int sys_show_parse_cb(const struct nlmsghdr *nlh, void *data) >> mode_str); >> } >> >> + if (tb[RDMA_NLDEV_SYS_ATTR_PRIVILEGED_QKEY_MODE]) { >> + const char *pqkey_str; >> + uint8_t pqkey_mode; >> + >> + pqkey_mode = >> + mnl_attr_get_u8(tb[RDMA_NLDEV_SYS_ATTR_PRIVILEGED_QKEY_MODE]); >> + >> + if (pqkey_mode < ARRAY_SIZE(privileged_qkey_str)) >> + pqkey_str = privileged_qkey_str[pqkey_mode]; >> + else >> + pqkey_str = "unknown"; >> + >> + print_color_string(PRINT_ANY, COLOR_NONE, "privileged-qkey", >> + "privileged-qkey %s ", pqkey_str); >> + } >> + > > Elsewhere in the file, you just use print_color_on_off(), why not here? +1