From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?iso-8859-1?Q?N=E9lio?= Laranjeiro Subject: Re: [PATCH v4 08/11] net/mlx5: add hardware flow debug dump Date: Wed, 18 Apr 2018 08:57:20 +0200 Message-ID: <20180418065720.7casgo4had3dsw2p@laranjeiro-vm.dev.6wind.com> References: <20180413112023.106420-1-xuemingl@mellanox.com> <20180417151436.161374-9-xuemingl@mellanox.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Cc: Shahaf Shuler , dev@dpdk.org To: Xueming Li Return-path: Received: from mail-wr0-f194.google.com (mail-wr0-f194.google.com [209.85.128.194]) by dpdk.org (Postfix) with ESMTP id AB5E27CE8 for ; Wed, 18 Apr 2018 08:56:46 +0200 (CEST) Received: by mail-wr0-f194.google.com with SMTP id f14-v6so1639770wre.4 for ; Tue, 17 Apr 2018 23:56:46 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20180417151436.161374-9-xuemingl@mellanox.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Tue, Apr 17, 2018 at 11:14:33PM +0800, Xueming Li wrote: > Dump verb flow detail including flow spec type and size for debugging > purpose. > > Signed-off-by: Xueming Li > --- > drivers/net/mlx5/mlx5_flow.c | 68 ++++++++++++++++++++++++++++++++++++------- > drivers/net/mlx5/mlx5_rxq.c | 25 +++++++++++++--- > drivers/net/mlx5/mlx5_utils.h | 6 ++++ > 3 files changed, 85 insertions(+), 14 deletions(-) > > diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c > index a6791c525..371d029c8 100644 > --- a/drivers/net/mlx5/mlx5_flow.c > +++ b/drivers/net/mlx5/mlx5_flow.c > @@ -2050,6 +2050,57 @@ mlx5_flow_create_update_rxqs(struct rte_eth_dev *dev, struct rte_flow *flow) > } > > /** > + * Dump flow hash RX queue detail. > + * > + * @param dev > + * Pointer to Ethernet device. > + * @param flow > + * Pointer to the rte_flow. > + * @param i > + * Hash RX queue index. > + */ > +static void > +mlx5_flow_dump(struct rte_eth_dev *dev __rte_unused, > + struct rte_flow *flow __rte_unused, > + unsigned int i __rte_unused) Can this "i" be renamed to hrxq_idx to have something more understandable across the code? > +{ > +#ifndef NDEBUG > + uintptr_t spec_ptr; > + uint16_t j; > + char buf[256]; > + uint8_t off; > + > + spec_ptr = (uintptr_t)(flow->frxq[i].ibv_attr + 1); > + for (j = 0, off = 0; j < flow->frxq[i].ibv_attr->num_of_specs; > + j++) { > + struct ibv_flow_spec *spec = (void *)spec_ptr; > + off += sprintf(buf + off, " %x(%hu)", spec->hdr.type, > + spec->hdr.size); > + spec_ptr += spec->hdr.size; > + } > + DRV_LOG(DEBUG, > + "port %u Verbs flow %p type %u: hrxq:%p qp:%p ind:%p, hash:%lx/%u" > + " specs:%hhu(%hu), priority:%hu, type:%d, flags:%x," > + " comp_mask:%x specs:%s", > + dev->data->port_id, (void *)flow, i, > + (void *)flow->frxq[i].hrxq, > + (void *)flow->frxq[i].hrxq->qp, > + (void *)flow->frxq[i].hrxq->ind_table, > + flow->frxq[i].hash_fields | > + (flow->tunnel && > + flow->rss_conf.level > 1 ? (uint32_t)IBV_RX_HASH_INNER : 0), > + flow->rss_conf.queue_num, > + flow->frxq[i].ibv_attr->num_of_specs, > + flow->frxq[i].ibv_attr->size, > + flow->frxq[i].ibv_attr->priority, > + flow->frxq[i].ibv_attr->type, > + flow->frxq[i].ibv_attr->flags, > + flow->frxq[i].ibv_attr->comp_mask, > + buf); > +#endif >[...] Thanks, -- Nélio Laranjeiro 6WIND