Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp1759045rdb; Mon, 9 Oct 2023 01:44:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEHAmjKoO0vVzACPoHPk56NQFEY2vSE9632VGGPyibtRO3CEdNZBjvqZ00zWoRTtWR3gkhw X-Received: by 2002:a17:902:d50c:b0:1c4:fae:bf28 with SMTP id b12-20020a170902d50c00b001c40faebf28mr13644384plg.32.1696841074775; Mon, 09 Oct 2023 01:44:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696841074; cv=none; d=google.com; s=arc-20160816; b=sGZZy99rzWbfXpls9IimrnELQJNTJdLFs8tujM7b2FR1dafBMqSJVndwFyf5MNGB0p Q9WHSFRaCvGC05UNDDlTbW5DBr5Pc5peiD7Va62h/nib73U2XFRtULvF6BG6b/b/Xzn+ 3+QAYNXOgSLIpOQI8rF+m1REsHiS1/UpMpF0lGVX8zi4yu/TL5hIn/hsMwiPhJoG9aZM 1E8fO0ogEfuwvaDVBye917/41QK1e8LtNhcrwiopM5K4uMxsPDRSR3eENgS8+lWPIJIt JlQRBIoV/OIxL8wGFoxTPLKe1SgJXFRP96jb0O6slpfs7a70tI087c/Mv5DHxPtNcqAj 4RSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Btj9w/HA1jx9NdZd0YLWxTtjY31HhS6B3Ppn5rOYN1U=; fh=1jj82TdK/LdfRrVk4wPz9G39d0+5NU+oWLPVxAhEDIo=; b=T8cReOu7s7u7lQjFfbCC7hBzTp/c8ARUGtjHXgO0iYX9UfinIlYdHCr+eU5nnHRLtG YNLv+zsRw2u/ykNFrdwgyDMDf45VLhoiJIXVqHtldYjW6nV6VwoTTTcZE4WCiGQhM3FQ raAni4TI6hTd9OjRgrt17e+JwcEJPDyN7qmPhGCwyJOzqwbsbGx9Xdfpy6hyogLJztHG Z6rRSjrdvcVPI4MKuSFREhZrGkB+ee9VFQ8OVu45naBlE/KMPEcS3TZahG9bV2Hy7iIt IBts2nnjv+GDw1Q4NpBvXBhvgr+3uoTHPHkWLd5jmPKp70d5p2S1FL4u9/BiEHe7l2ou wBfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DPHn6xM3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id v12-20020a170902b7cc00b001c5bcddc7aesi8704430plz.126.2023.10.09.01.44.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 01:44:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DPHn6xM3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id A43E08021723; Mon, 9 Oct 2023 01:44:30 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345456AbjJIIoN (ORCPT + 99 others); Mon, 9 Oct 2023 04:44:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345483AbjJIIoM (ORCPT ); Mon, 9 Oct 2023 04:44:12 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0DE1BBA; Mon, 9 Oct 2023 01:44:11 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2D14CC433C7; Mon, 9 Oct 2023 08:44:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696841050; bh=BGJHNwJNMBztON4oLZ3LK2mJH//4F5a7Anr3Jd6sFmI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=DPHn6xM3gL5Za1CbvpeiFF3F0gzdQ3DjDTTeg9Ovi4zhADS2ZCOnru4zQMiodrHX9 Ku/FOE3+x9wXR+FMb/kuc4HHJwpwk5aOZL3bT+dypbMozi8tk+xD19g90Stq4ltEEG 8PY1pFf30rnGzUH4RocDUvCqJeIFugAqv570BPUOLbqFIKPp22v6vRExQ8fq1Der8I yVFNvbJJh+KjYq4HeYvJqtA3EiE4i0QDJv+DLoSQwqQolVRcJ2XPio3z0+v+IEaQQg pPOGsGSi5P72ZzUuCstB2fPY/FRBGLOz2WzlwcezIpAS0xiXjXbDBeLS0lgoSfR9Pq Vbo7g+Hk/PkWg== Date: Mon, 9 Oct 2023 11:44:06 +0300 From: Leon Romanovsky To: Junxian Huang Cc: jgg@ziepe.ca, dsahern@gmail.com, stephen@networkplumber.org, netdev@vger.kernel.org, linux-rdma@vger.kernel.org, linuxarm@huawei.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH iproute2-next 2/2] rdma: Add support to dump SRQ resource in raw format Message-ID: <20231009084406.GC5042@unreal> References: <20231007035855.2273364-1-huangjunxian6@hisilicon.com> <20231007035855.2273364-3-huangjunxian6@hisilicon.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231007035855.2273364-3-huangjunxian6@hisilicon.com> X-Spam-Status: No, score=2.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.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 (morse.vger.email [0.0.0.0]); Mon, 09 Oct 2023 01:44:30 -0700 (PDT) X-Spam-Level: ** On Sat, Oct 07, 2023 at 11:58:55AM +0800, Junxian Huang wrote: > From: wenglianfa > > Add support to dump SRQ resource in raw format. > > This patch relies on the corresponding kernel commit aebf8145e11a > ("RDMA/core: Add support to dump SRQ resource in RAW format") > > Example: > $ rdma res show srq -r > dev hns3 149000... > > $ rdma res show srq -j -r > [{"ifindex":0,"ifname":"hns3","data":[149,0,0,...]}] > > Signed-off-by: wenglianfa > --- > rdma/res-srq.c | 17 ++++++++++++++++- > rdma/res.h | 2 ++ > 2 files changed, 18 insertions(+), 1 deletion(-) > > diff --git a/rdma/res-srq.c b/rdma/res-srq.c > index 186ae281..d2581a3f 100644 > --- a/rdma/res-srq.c > +++ b/rdma/res-srq.c > @@ -162,6 +162,20 @@ out: > return -EINVAL; > } <...> > static int res_srq_line(struct rd *rd, const char *name, int idx, > struct nlattr **nla_line) > { > @@ -276,7 +290,8 @@ int res_srq_parse_cb(const struct nlmsghdr *nlh, void *data) > if (ret != MNL_CB_OK) > break; > > - ret = res_srq_line(rd, name, idx, nla_line); > + ret = (rd->show_raw) ? res_srq_line_raw(rd, name, idx, nla_line) : > + res_srq_line(rd, name, idx, nla_line); You are missing same change in res_srq_idx_parse_cb(), see commit e2bbf737e61b ("rdma: Add support to get MR in raw format") as an example. Thanks > if (ret != MNL_CB_OK) > break; > } > diff --git a/rdma/res.h b/rdma/res.h > index 70e51acd..e880c28b 100644 > --- a/rdma/res.h > +++ b/rdma/res.h > @@ -39,6 +39,8 @@ static inline uint32_t res_get_command(uint32_t command, struct rd *rd) > return RDMA_NLDEV_CMD_RES_CQ_GET_RAW; > case RDMA_NLDEV_CMD_RES_MR_GET: > return RDMA_NLDEV_CMD_RES_MR_GET_RAW; > + case RDMA_NLDEV_CMD_RES_SRQ_GET: > + return RDMA_NLDEV_CMD_RES_SRQ_GET_RAW; > default: > return command; > } > -- > 2.30.0 >