From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id D254041D9E; Tue, 28 Feb 2023 16:55:36 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 693B640EE6; Tue, 28 Feb 2023 16:55:36 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id ADD224021F for ; Tue, 28 Feb 2023 16:55:34 +0100 (CET) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 31SEOInM019218; Tue, 28 Feb 2023 07:55:32 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=81liqq1fiRsiChxaEdeJuMbzXYYx1jgBsVcBLHgb7D4=; b=WUEmCO0qT7DkPOhoGJ3UdMBwglJ3/xbrikXevIUyyEG+wOb+mhLtt86o2cjChi+fsp69 6JmSKMU/71x/dkeZCjmHBE/GJHhf4aCa/tBVaro59g/pEFGBPYO6nmdROcRyuj5iETYI +ieBy3pSO95OprEaZ0/fFlcq3Vjx7v3HqSXIXIiywXjC96urS9Nk0Wkz13hbgX7cWr8I PQa8AYAF5wkStNHeIK/30bQi86plBreGixciEOwzRTG8AEQRsf2VLfU7h4hFMzcq8iYO TRusmFaipFf+NgaSJGoad5kk5aSIFX1VQhVgWQlAtHW5rNsPE4Z5nVpsX9afTCyfpDgb /w== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3nygjwgma9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 28 Feb 2023 07:55:32 -0800 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Tue, 28 Feb 2023 07:55:30 -0800 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.42 via Frontend Transport; Tue, 28 Feb 2023 07:55:30 -0800 Received: from localhost.localdomain (unknown [10.28.36.185]) by maili.marvell.com (Postfix) with ESMTP id 08BE25B6943; Tue, 28 Feb 2023 07:55:28 -0800 (PST) From: Ankur Dwivedi To: CC: , , , "Ankur Dwivedi" Subject: [PATCH v1] ethdev: remove bitfields from trace Date: Tue, 28 Feb 2023 21:25:16 +0530 Message-ID: <20230228155516.2403535-1-adwivedi@marvell.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: EnyvbCWAVuRVRKaVQp-c7xVQkLCy6AmN X-Proofpoint-GUID: EnyvbCWAVuRVRKaVQp-c7xVQkLCy6AmN X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-02-28_13,2023-02-28_03,2023-02-09_01 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org To capture bitfield variables in trace, the pointer to the structure containing the bitfields was referenced. But during trace point registration the pointer contains invalid address. Referencing this invalid address causes segmentation fault. This patch removes the capture of bitfield variables in trace. Bugzilla ID: 1167 Fixes: 6679cf21d608 ("ethdev: add trace points") Fixes: ed04fd4072e9 ("ethdev: add trace points for flow") Signed-off-by: Ankur Dwivedi --- lib/ethdev/ethdev_trace.h | 80 ++------------------------------------- 1 file changed, 3 insertions(+), 77 deletions(-) diff --git a/lib/ethdev/ethdev_trace.h b/lib/ethdev/ethdev_trace.h index 53d1a71ff0..6c2a68216f 100644 --- a/lib/ethdev/ethdev_trace.h +++ b/lib/ethdev/ethdev_trace.h @@ -237,22 +237,10 @@ RTE_TRACE_POINT( RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t rx_queue_id, uint16_t nb_rx_desc, const struct rte_eth_hairpin_conf *conf, int ret), - uint16_t peer_count = conf->peer_count; - uint8_t tx_explicit = conf->tx_explicit; - uint8_t manual_bind = conf->manual_bind; - uint8_t use_locked_device_memory = conf->use_locked_device_memory; - uint8_t use_rte_memory = conf->use_rte_memory; - uint8_t force_memory = conf->force_memory; - rte_trace_point_emit_u16(port_id); rte_trace_point_emit_u16(rx_queue_id); rte_trace_point_emit_u16(nb_rx_desc); - rte_trace_point_emit_u16(peer_count); - rte_trace_point_emit_u8(tx_explicit); - rte_trace_point_emit_u8(manual_bind); - rte_trace_point_emit_u8(use_locked_device_memory); - rte_trace_point_emit_u8(use_rte_memory); - rte_trace_point_emit_u8(force_memory); + rte_trace_point_emit_ptr(conf); rte_trace_point_emit_int(ret); ) @@ -261,22 +249,10 @@ RTE_TRACE_POINT( RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t tx_queue_id, uint16_t nb_tx_desc, const struct rte_eth_hairpin_conf *conf, int ret), - uint16_t peer_count = conf->peer_count; - uint8_t tx_explicit = conf->tx_explicit; - uint8_t manual_bind = conf->manual_bind; - uint8_t use_locked_device_memory = conf->use_locked_device_memory; - uint8_t use_rte_memory = conf->use_rte_memory; - uint8_t force_memory = conf->force_memory; - rte_trace_point_emit_u16(port_id); rte_trace_point_emit_u16(tx_queue_id); rte_trace_point_emit_u16(nb_tx_desc); - rte_trace_point_emit_u16(peer_count); - rte_trace_point_emit_u8(tx_explicit); - rte_trace_point_emit_u8(manual_bind); - rte_trace_point_emit_u8(use_locked_device_memory); - rte_trace_point_emit_u8(use_rte_memory); - rte_trace_point_emit_u8(force_memory); + rte_trace_point_emit_ptr(conf); rte_trace_point_emit_int(ret); ) @@ -499,30 +475,16 @@ RTE_TRACE_POINT( RTE_TRACE_POINT( rte_eth_trace_link_get_nowait, RTE_TRACE_POINT_ARGS(uint16_t port_id, const struct rte_eth_link *link), - uint8_t link_duplex = link->link_duplex; - uint8_t link_autoneg = link->link_autoneg; - uint8_t link_status = link->link_status; - rte_trace_point_emit_u16(port_id); rte_trace_point_emit_u32(link->link_speed); - rte_trace_point_emit_u8(link_duplex); - rte_trace_point_emit_u8(link_autoneg); - rte_trace_point_emit_u8(link_status); ) RTE_TRACE_POINT( rte_eth_trace_link_to_str, RTE_TRACE_POINT_ARGS(size_t len, const struct rte_eth_link *link, char *str, int ret), - uint8_t link_duplex = link->link_duplex; - uint8_t link_autoneg = link->link_autoneg; - uint8_t link_status = link->link_status; - rte_trace_point_emit_size_t(len); rte_trace_point_emit_u32(link->link_speed); - rte_trace_point_emit_u8(link_duplex); - rte_trace_point_emit_u8(link_autoneg); - rte_trace_point_emit_u8(link_status); rte_trace_point_emit_string(str); rte_trace_point_emit_int(ret); ) @@ -1564,17 +1526,8 @@ RTE_TRACE_POINT( RTE_TRACE_POINT_ARGS(uint16_t port_id, const struct rte_flow_pattern_template_attr *template_attr, const struct rte_flow_item *pattern, const void *tmplate), - uint8_t relaxed_matching = template_attr->relaxed_matching; - uint8_t ingress = template_attr->ingress; - uint8_t egress = template_attr->egress; - uint8_t transfer = template_attr->transfer; - rte_trace_point_emit_u16(port_id); rte_trace_point_emit_ptr(template_attr); - rte_trace_point_emit_u8(relaxed_matching); - rte_trace_point_emit_u8(ingress); - rte_trace_point_emit_u8(egress); - rte_trace_point_emit_u8(transfer); rte_trace_point_emit_ptr(pattern); rte_trace_point_emit_ptr(tmplate); ) @@ -1595,15 +1548,8 @@ RTE_TRACE_POINT( const struct rte_flow_actions_template_attr *template_attr, const struct rte_flow_action *actions, const struct rte_flow_action *masks, const void *tmplate), - uint8_t ingress = template_attr->ingress; - uint8_t egress = template_attr->egress; - uint8_t transfer = template_attr->transfer; - rte_trace_point_emit_u16(port_id); rte_trace_point_emit_ptr(template_attr); - rte_trace_point_emit_u8(ingress); - rte_trace_point_emit_u8(egress); - rte_trace_point_emit_u8(transfer); rte_trace_point_emit_ptr(actions); rte_trace_point_emit_ptr(masks); rte_trace_point_emit_ptr(tmplate); @@ -1628,17 +1574,10 @@ RTE_TRACE_POINT( struct rte_flow_actions_template **actions_templates, uint8_t nb_actions_templates, const struct rte_flow_template_table *table), - uint8_t ingress = table_attr->flow_attr.ingress; - uint8_t egress = table_attr->flow_attr.egress; - uint8_t transfer = table_attr->flow_attr.transfer; - rte_trace_point_emit_u16(port_id); rte_trace_point_emit_u32(table_attr->nb_flows); rte_trace_point_emit_u32(table_attr->flow_attr.group); rte_trace_point_emit_u32(table_attr->flow_attr.priority); - rte_trace_point_emit_u8(ingress); - rte_trace_point_emit_u8(egress); - rte_trace_point_emit_u8(transfer); rte_trace_point_emit_ptr(pattern_templates); rte_trace_point_emit_u8(nb_pattern_templates); rte_trace_point_emit_ptr(actions_templates); @@ -2177,15 +2116,8 @@ RTE_TRACE_POINT_FP( RTE_TRACE_POINT_FP( rte_eth_trace_link_get, RTE_TRACE_POINT_ARGS(uint16_t port_id, const struct rte_eth_link *link), - uint8_t link_duplex = link->link_duplex; - uint8_t link_autoneg = link->link_autoneg; - uint8_t link_status = link->link_status; - rte_trace_point_emit_u16(port_id); rte_trace_point_emit_u32(link->link_speed); - rte_trace_point_emit_u8(link_duplex); - rte_trace_point_emit_u8(link_autoneg); - rte_trace_point_emit_u8(link_status); ) /* Called in loop in examples/ip_pipeline */ @@ -2349,14 +2281,8 @@ RTE_TRACE_POINT_FP( const struct rte_flow_indir_action_conf *conf, const struct rte_flow_action *action, const struct rte_flow_action_handle *handle), - uint8_t ingress = conf->ingress; - uint8_t egress = conf->egress; - uint8_t transfer = conf->transfer; - rte_trace_point_emit_u16(port_id); - rte_trace_point_emit_u8(ingress); - rte_trace_point_emit_u8(egress); - rte_trace_point_emit_u8(transfer); + rte_trace_point_emit_ptr(conf); rte_trace_point_emit_ptr(action); rte_trace_point_emit_ptr(handle); ) -- 2.25.1