From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 1701EAABC for ; Fri, 9 Mar 2018 12:30:07 +0100 (CET) Received: from Internal Mail-Server by MTLPINE1 (envelope-from xuemingl@mellanox.com) with ESMTPS (AES256-SHA encrypted); 9 Mar 2018 13:30:36 +0200 Received: from dev-r630-06.mtbc.labs.mlnx (dev-r630-06.mtbc.labs.mlnx [10.12.205.180]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id w29BU3XJ021127; Fri, 9 Mar 2018 13:30:04 +0200 Received: from dev-r630-06.mtbc.labs.mlnx (localhost [127.0.0.1]) by dev-r630-06.mtbc.labs.mlnx (8.14.7/8.14.7) with ESMTP id w29BU3s9002220; Fri, 9 Mar 2018 19:30:03 +0800 Received: (from xuemingl@localhost) by dev-r630-06.mtbc.labs.mlnx (8.14.7/8.14.7/Submit) id w29BU3QX002219; Fri, 9 Mar 2018 19:30:03 +0800 From: Xueming Li To: Wenzhuo Lu , Jingjing Wu , Thomas Monjalon , Nelio Laranjeiro , Adrien Mazarguil , Shahaf Shuler , Olivier Matz Cc: Xueming Li , dev@dpdk.org Date: Fri, 9 Mar 2018 19:29:14 +0800 Message-Id: <20180309112921.2105-15-xuemingl@mellanox.com> X-Mailer: git-send-email 2.13.3 In-Reply-To: <20180309112921.2105-1-xuemingl@mellanox.com> References: <20180309112921.2105-1-xuemingl@mellanox.com> In-Reply-To: <20180226150947.107179-2-xuemingl@mellanox.com> References: <20180226150947.107179-2-xuemingl@mellanox.com> Subject: [dpdk-dev] [PATCH v1 14/21] net/mlx5: add hardware flow debug dump X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Mar 2018 11:30:07 -0000 Dump verb flow detail including each flow spec type and size for debug purpose. Signed-off-by: Xueming Li --- drivers/net/mlx5/mlx5_flow.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index 5e5184b..139dc72 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -1993,6 +1993,30 @@ struct ibv_spec_header { flow->frxq[i].ibv_flow = mlx5_glue->create_flow(flow->frxq[i].hrxq->qp, flow->frxq[i].ibv_attr); +#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; + } + DEBUG("verb flow: qp:%p n_specs:%hhu, size:%hu, priority:%hu, type:%d, flags:%x, comp_mask:%x specs:%s", + (void *)flow->frxq[i].hrxq->qp, + 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 if (!flow->frxq[i].ibv_flow) { rte_flow_error_set(error, ENOMEM, RTE_FLOW_ERROR_TYPE_HANDLE, -- 1.8.3.1