From patchwork Sat Feb 23 12:29:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lijun Ou X-Patchwork-Id: 10827459 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 034391390 for ; Sat, 23 Feb 2019 11:47:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D8BB42F8FF for ; Sat, 23 Feb 2019 11:47:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CA2C32F916; Sat, 23 Feb 2019 11:47:52 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 0FD802F8FF for ; Sat, 23 Feb 2019 11:47:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726437AbfBWLrv (ORCPT ); Sat, 23 Feb 2019 06:47:51 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:3721 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726326AbfBWLrv (ORCPT ); Sat, 23 Feb 2019 06:47:51 -0500 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 20D3BCC5614D4AB8A698; Sat, 23 Feb 2019 19:47:48 +0800 (CST) Received: from linux-ioko.site (10.71.200.31) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.408.0; Sat, 23 Feb 2019 19:47:39 +0800 From: Lijun Ou To: , , CC: , Subject: [[RFC] iproute2-next] rdma: Add the prefix for driver attributes Date: Sat, 23 Feb 2019 20:29:58 +0800 Message-ID: <1550924998-34099-1-git-send-email-oulijun@huawei.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Originating-IP: [10.71.200.31] X-CFilter-Loop: Reflected 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 We need to increase the prefix named drv_ to distinguish whether the attribute is from IB/core or the driver attribute. Signed-off-by: Lijun Ou --- rdma/utils.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/rdma/utils.c b/rdma/utils.c index 069d44f..8890981 100644 --- a/rdma/utils.c +++ b/rdma/utils.c @@ -720,7 +720,7 @@ static int print_driver_string(struct rd *rd, const char *key_str, jsonw_string_field(rd->jw, key_str, val_str); return 0; } else { - return pr_out("%s %s ", key_str, val_str); + return pr_out("drv_%s %s ", key_str, val_str); } } @@ -733,9 +733,9 @@ static int print_driver_s32(struct rd *rd, const char *key_str, int32_t val, } switch (print_type) { case RDMA_NLDEV_PRINT_TYPE_UNSPEC: - return pr_out("%s %d ", key_str, val); + return pr_out("drv_%s %d ", key_str, val); case RDMA_NLDEV_PRINT_TYPE_HEX: - return pr_out("%s 0x%x ", key_str, val); + return pr_out("drv_%s 0x%x ", key_str, val); default: return -EINVAL; } @@ -750,9 +750,9 @@ static int print_driver_u32(struct rd *rd, const char *key_str, uint32_t val, } switch (print_type) { case RDMA_NLDEV_PRINT_TYPE_UNSPEC: - return pr_out("%s %u ", key_str, val); + return pr_out("drv_%s %u ", key_str, val); case RDMA_NLDEV_PRINT_TYPE_HEX: - return pr_out("%s 0x%x ", key_str, val); + return pr_out("drv_%s 0x%x ", key_str, val); default: return -EINVAL; } @@ -767,9 +767,9 @@ static int print_driver_s64(struct rd *rd, const char *key_str, int64_t val, } switch (print_type) { case RDMA_NLDEV_PRINT_TYPE_UNSPEC: - return pr_out("%s %" PRId64 " ", key_str, val); + return pr_out("drv_%s %" PRId64 " ", key_str, val); case RDMA_NLDEV_PRINT_TYPE_HEX: - return pr_out("%s 0x%" PRIx64 " ", key_str, val); + return pr_out("drv_%s 0x%" PRIx64 " ", key_str, val); default: return -EINVAL; } @@ -784,9 +784,9 @@ static int print_driver_u64(struct rd *rd, const char *key_str, uint64_t val, } switch (print_type) { case RDMA_NLDEV_PRINT_TYPE_UNSPEC: - return pr_out("%s %" PRIu64 " ", key_str, val); + return pr_out("drv_%s %" PRIu64 " ", key_str, val); case RDMA_NLDEV_PRINT_TYPE_HEX: - return pr_out("%s 0x%" PRIx64 " ", key_str, val); + return pr_out("drv_%s 0x%" PRIx64 " ", key_str, val); default: return -EINVAL; }