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 A7E5A45459; Wed, 19 Jun 2024 12:08:54 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C9D1342E67; Wed, 19 Jun 2024 12:08:27 +0200 (CEST) Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2124.outbound.protection.outlook.com [40.107.102.124]) by mails.dpdk.org (Postfix) with ESMTP id 912EE42E60 for ; Wed, 19 Jun 2024 12:08:25 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jMr26YeWa+Cneo7sg0HrZ1hU9dTfDakQN4lRVOvxdAliTHMEWFgXJF04vWk556B7XbiE/o8eRyLQtZz0WSfnYD/TiykQU44VjCcRQ7ILYbVg7l5lBZSlKv2v3aZ2SwM//28bI3R+0hCact1N8HB2dxg2bWXkt7PytsTT4wdGoUR7TpV9JTWf9kpceOyBDsgCxTFJ0TXWBym7MiNRl6qBgUg7OvRf8MNMw9c4ZKA2mAbJ4WleopLbaZVhcexd94FQEm56Lgez5gCx0ywwLp5GpRRwMPSylmdYhyvWS15nn30ITRrOvMzKjBKtrLYrW3yLtT7KLdXXjtUEYnos0TYSUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ZQA0KGAEuwSJpYciM+EKd77Xyrz7K9jwjMf91Hm/D5Q=; b=n7Vj8txj9fg2kgprelnKbspYATn67w6jINSqN0LyizCd6AuT29JbyV5JHF7NvTK6SNcj4dCBFni+l2gZ0ef0zvF1+l0IPXh+24xOrIJzLMPacToSHAbhY7Kjq+gHivRCfXX0M+gbrdT/VDyj8Q6gU5aYAMGqRgy4YwhgpNa4hORmlDUJv9wkjFb0NInSTIobZc1btm6bGLyOhYAUMS4mpI5z+N7jjRx3obpcZSs5HsAdM8C9EezD6lJgqTJo59/eMeSfdoZI/FzkcWCcMxodQU/AkNJdJZqBkUMPxm8ushZ4IPTOP+dB5qjWqhnKvD8NnNrFBVCNgWjVf1A+7Nll6Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=corigine.com; dmarc=pass action=none header.from=corigine.com; dkim=pass header.d=corigine.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZQA0KGAEuwSJpYciM+EKd77Xyrz7K9jwjMf91Hm/D5Q=; b=XphxjuIE8tsl1Ie3zPgOINAHYSHab+VhzLPNx8cxGZBq7PAW7ubPsnvgPj9jf9aKwgutH6aX/XGOLK1S4nkjNma+V3gBNw6jvW/ZfQhn1ikkZBcmH+4rj9dd9lHHH7jz8s0hwhCg0y4CzTWLia9MNVw3YvbB6rE71J/3duhkrkY= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) by BLAPR13MB4691.namprd13.prod.outlook.com (2603:10b6:208:306::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7698.20; Wed, 19 Jun 2024 10:08:23 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::b900:5f05:766f:833]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::b900:5f05:766f:833%4]) with mapi id 15.20.7677.030; Wed, 19 Jun 2024 10:08:23 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Chaoyong He , Long Wu , Peng Zhang Subject: [PATCH 6/7] net/nfp: add trace point about flow rule pattern Date: Wed, 19 Jun 2024 18:07:53 +0800 Message-Id: <20240619100754.3480077-7-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20240619100754.3480077-1-chaoyong.he@corigine.com> References: <20240619100754.3480077-1-chaoyong.he@corigine.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: BYAPR06CA0003.namprd06.prod.outlook.com (2603:10b6:a03:d4::16) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|BLAPR13MB4691:EE_ X-MS-Office365-Filtering-Correlation-Id: 57587ee6-5589-4fb7-8e84-08dc9047c089 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230037|1800799021|366013|52116011|376011|38350700011; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?RZVin/K7FChEq5XVF0kZmJyiREfCpF6rISHJFAbqiAwzxfHbbMdVdiM9gFyh?= =?us-ascii?Q?2eN6T7VmXp1sE/i4g8hGtMs7mYE7BCXfGsVh06pg4RRybeMf++33Ddoi606U?= =?us-ascii?Q?Im+jmrrPuqM7nJiz5X7REJdQ09CYBybuTCnKeKnhBOVg4Z3PGS5zOf/pMbOW?= =?us-ascii?Q?dfsryohf50/sv4WxlYxA6DtWhbrZTDtw0KLY+cCrAIZviTupQOAJPe9x/z/c?= =?us-ascii?Q?ZnivMe0NVmJb1C7GJQm6gyArDrtXMIRgaJE51cD1JuKUA9PRTOoUvFqBVjLd?= =?us-ascii?Q?KPgjfYGPiT6RTjsTOfb5om6jvYgFewjBwmoYmTpH8JTVadVu7KW7VYdXxmg1?= =?us-ascii?Q?Qc17N452WktuZiX0++TFSDJS/b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K?= =?us-ascii?Q?UbRzHkc+MafSmXyFnozF1yW94KAaV8H2RIwwYGfv2P9OyEjXXF4TzK5hLuqt?= =?us-ascii?Q?Q+z5RwvRA/do0/OTdSfd5xFytJ3niBXJ3PeYSuFHzO8+VQ/WBL7+yuRKnbQu?= =?us-ascii?Q?OT2viPU=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR13MB5545.namprd13.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230037)(1800799021)(366013)(52116011)(376011)(38350700011); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?xg0IS2ZsIPKHIfesDsoxguVu630jIcV8bqigAYs7rN49OkkgLN8HII9VeI7A?= =?us-ascii?Q?EXvs8F6jNoy18U61+Yf0fPh4A91cNSNCnGFhpt0UuiiepQ9TYtsEoWG5JxNi?= =?us-ascii?Q?qvEkOghnxqwRFazHtqY2+UuJVa8reb4CnW9uYs7/XBclLv3QaOxohdpc8S2f?= =?us-ascii?Q?seaf6DuLEl6veDoEos4p0OWIG+GjFlwy/wv9rzmm4rDPtpXT4qCoyJR3gVIS?= =?us-ascii?Q?CCMx673NQxRhO548iJkm2s9t7roFvSn5bgZdEgtQEB2pFObAjFzwqVw4/zB3?= =?us-ascii?Q?plV4Zd00cb91Eh9qvgaFXbAWbu4m3Y2jgp8+MDx7QAVx+gfW6bxiqoQ2Bjj3?= =?us-ascii?Q?uHNkmUmnvbQq2nPRdCpold6CrRitNICx27y9VIktJMF8l3sB2ShjVoUMv9LE?= =?us-ascii?Q?dpIyD1uSpq6oV8Oj4XpDdzcRQ/j3/J1sUTfJRlyc49mbO+wPWIhuqt5jE/jF?= =?us-ascii?Q?/pmUI1y0FvAt1Q84mYY4nu8hY6QF3nBEnq/l6+eJLy8XcyIYBKgRVPAMBq1m?= =?us-ascii?Q?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ux0iV9sgPN0/zpg5K3?= =?us-ascii?Q?XvQWW4a4OeGaPXkmD1uNFqcx+44dDXF4StkyJ7k6Usk/xmQ76rvaGXghQyiF?= =?us-ascii?Q?UXSbr/a+f/QBErI0NmtMlwFHfV7KzKl1CjhPFH7l/1jLh5SSgJGei0RRReR9?= =?us-ascii?Q?ioo/CM529u7S+y0PsfHiF6pvjdu/3LdFNFxg6hSZ1u2xJ/+BJcwCJL3PudcY?= =?us-ascii?Q?lg=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 57587ee6-5589-4fb7-8e84-08dc9047c089 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jun 2024 10:08:22.9636 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fe128f2c-073b-4c20-818e-7246a585940c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 0H/TcTKYPW64G0CuRqS1W3maEcd9ffh2M1FucUMdyumQZ45Y4OppbONnZT4QUpojhdHQGJpP7XztdEWl8SOOw3pbciYbRgvk0F3Rzw7P27A= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLAPR13MB4691 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 Add 11 trace points of control message related with flow rule pattern. Signed-off-by: Chaoyong He Reviewed-by: Long Wu Reviewed-by: Peng Zhang --- drivers/net/nfp/flower/nfp_flower_cmsg.c | 152 +++++++++++++++++ drivers/net/nfp/nfp_trace.c | 33 ++++ drivers/net/nfp/nfp_trace.h | 199 +++++++++++++++++++++++ 3 files changed, 384 insertions(+) diff --git a/drivers/net/nfp/flower/nfp_flower_cmsg.c b/drivers/net/nfp/flower/nfp_flower_cmsg.c index 9035a9df4f..3b492c94ce 100644 --- a/drivers/net/nfp/flower/nfp_flower_cmsg.c +++ b/drivers/net/nfp/flower/nfp_flower_cmsg.c @@ -189,12 +189,164 @@ nfp_flower_cmsg_port_mod(struct nfp_app_fw_flower *app_fw_flower, return 0; } +static bool +nfp_flower_trace_cmsg_flow_has_tunnel(uint8_t nfp_flow_key_layer, + uint32_t nfp_flow_key_layer2) +{ + if ((nfp_flow_key_layer & NFP_FLOWER_LAYER_VXLAN) != 0) + return true; + + if ((nfp_flow_key_layer & NFP_FLOWER_LAYER_EXT_META) == 0) + return false; + + if ((nfp_flow_key_layer2 & (NFP_FLOWER_LAYER2_GENEVE | NFP_FLOWER_LAYER2_GRE)) != 0) + return true; + + return false; +} + +static void +nfp_flower_trace_cmsg_flow_pattern(char *cmsg, + char *end) +{ + char *start_p = cmsg; + + if (cmsg >= end) { + PMD_DRV_LOG(ERR, "Cmsg flow pattern parameter error"); + return; + } + + struct nfp_flower_meta_tci *meta_tci = (struct nfp_flower_meta_tci *)cmsg; + uint8_t nfp_flow_key_layer = meta_tci->nfp_flow_key_layer; + uint32_t nfp_flow_key_layer2 = 0; + + rte_pmd_nfp_trace_cmsg_flow_pattern_meta_tci(start_p); + start_p += sizeof(struct nfp_flower_meta_tci); + if (start_p >= end) + goto pattern_exit; + + if ((nfp_flow_key_layer & NFP_FLOWER_LAYER_EXT_META) != 0) { + struct nfp_flower_ext_meta *ext_meta = (struct nfp_flower_ext_meta *)start_p; + nfp_flow_key_layer2 = rte_be_to_cpu_32(ext_meta->nfp_flow_key_layer2); + rte_pmd_nfp_trace_cmsg_flow_pattern_ext_meta(start_p); + start_p += sizeof(struct nfp_flower_ext_meta); + if (start_p >= end) + goto pattern_exit; + } + + rte_pmd_nfp_trace_cmsg_flow_pattern_in_port(start_p); + start_p += sizeof(struct nfp_flower_in_port); + if (start_p >= end) + goto pattern_exit; + + /* L2 layer */ + if ((nfp_flow_key_layer & NFP_FLOWER_LAYER_MAC) != 0) { + rte_pmd_nfp_trace_cmsg_flow_pattern_mac(start_p); + start_p += sizeof(struct nfp_flower_mac_mpls); + if (start_p >= end) + goto pattern_exit; + } + + /* L4 layer comes first */ + if ((nfp_flow_key_layer & NFP_FLOWER_LAYER_TP) != 0) { + rte_pmd_nfp_trace_cmsg_flow_pattern_tp(start_p); + start_p += sizeof(struct nfp_flower_tp_ports); + if (start_p >= end) + goto pattern_exit; + } + + /* No tunnel, then L3 layer */ + if (!nfp_flower_trace_cmsg_flow_has_tunnel(nfp_flow_key_layer, nfp_flow_key_layer2)) { + if ((nfp_flow_key_layer & NFP_FLOWER_LAYER_IPV4) != 0) { + rte_pmd_nfp_trace_cmsg_flow_pattern_ipv4(start_p); + start_p += sizeof(struct nfp_flower_ipv4); + if (start_p != end) + PMD_DRV_LOG(ERR, "Cmsg flow pattern IPv4 length error"); + } else { + rte_pmd_nfp_trace_cmsg_flow_pattern_ipv6(start_p); + start_p += sizeof(struct nfp_flower_ipv6); + if (start_p != end) + PMD_DRV_LOG(ERR, "Cmsg flow pattern IPv6 length error"); + } + + return; + } + + /* Tunnel layer */ + if ((nfp_flow_key_layer2 & NFP_FLOWER_LAYER2_TUN_IPV6) != 0) { + if ((nfp_flow_key_layer2 & NFP_FLOWER_LAYER2_GRE) != 0) { + rte_pmd_nfp_trace_cmsg_flow_pattern_ipv6_gre_tun(start_p); + start_p += sizeof(struct nfp_flower_ipv6_gre_tun); + if (start_p >= end) + goto pattern_exit; + } else { + rte_pmd_nfp_trace_cmsg_flow_pattern_ipv6_udp_tun(start_p); + start_p += sizeof(struct nfp_flower_ipv6_udp_tun); + if (start_p >= end) + goto pattern_exit; + } + } else { + if ((nfp_flow_key_layer2 & NFP_FLOWER_LAYER2_GRE) != 0) { + rte_pmd_nfp_trace_cmsg_flow_pattern_ipv4_gre_tun(start_p); + start_p += sizeof(struct nfp_flower_ipv4_gre_tun); + if (start_p >= end) + goto pattern_exit; + } else { + rte_pmd_nfp_trace_cmsg_flow_pattern_ipv4_udp_tun(start_p); + start_p += sizeof(struct nfp_flower_ipv4_udp_tun); + if (start_p >= end) + goto pattern_exit; + } + } + + /* Inner L2 layer */ + if ((nfp_flow_key_layer & NFP_FLOWER_LAYER_MAC) != 0) { + rte_pmd_nfp_trace_cmsg_flow_pattern_mac(start_p); + start_p += sizeof(struct nfp_flower_mac_mpls); + if (start_p >= end) + goto pattern_exit; + } + + /* Inner L4 layer comes first */ + if ((nfp_flow_key_layer & NFP_FLOWER_LAYER_TP) != 0) { + rte_pmd_nfp_trace_cmsg_flow_pattern_tp(start_p); + start_p += sizeof(struct nfp_flower_tp_ports); + if (start_p >= end) + goto pattern_exit; + } + + /* Inner L3 layer */ + if ((nfp_flow_key_layer & NFP_FLOWER_LAYER_IPV4) != 0) { + rte_pmd_nfp_trace_cmsg_flow_pattern_ipv4(start_p); + start_p += sizeof(struct nfp_flower_ipv4); + if (start_p != end) { + PMD_DRV_LOG(ERR, "Cmsg flow pattern IPv4 length error"); + return; + } + } else { + rte_pmd_nfp_trace_cmsg_flow_pattern_ipv6(start_p); + start_p += sizeof(struct nfp_flower_ipv6); + if (start_p != end) { + PMD_DRV_LOG(ERR, "Cmsg flow pattern IPv6 length error"); + return; + } + } + + return; + +pattern_exit: + if (start_p != end) + PMD_DRV_LOG(ERR, "Cmsg flow pattern overlap"); +} + static void nfp_flower_trace_cmsg_flow(const char *msg, struct nfp_fl_payload *payload) { rte_pmd_nfp_trace_cmsg_flow(msg); rte_pmd_nfp_trace_cmsg_flow_meta(payload->meta); + nfp_flower_trace_cmsg_flow_pattern(payload->unmasked_data, payload->mask_data); + nfp_flower_trace_cmsg_flow_pattern(payload->mask_data, payload->action_data); } int diff --git a/drivers/net/nfp/nfp_trace.c b/drivers/net/nfp/nfp_trace.c index d49fb85259..61162f7563 100644 --- a/drivers/net/nfp/nfp_trace.c +++ b/drivers/net/nfp/nfp_trace.c @@ -40,5 +40,38 @@ RTE_TRACE_POINT_REGISTER(rte_pmd_nfp_trace_cmsg_qos_rule, RTE_TRACE_POINT_REGISTER(rte_pmd_nfp_trace_cmsg_flow_meta, pmd.net.nfp.cmsg.flow.meta) +RTE_TRACE_POINT_REGISTER(rte_pmd_nfp_trace_cmsg_flow_pattern_meta_tci, + pmd.net.nfp.cmsg.flow.pattern.meta_tci) + +RTE_TRACE_POINT_REGISTER(rte_pmd_nfp_trace_cmsg_flow_pattern_ext_meta, + pmd.net.nfp.cmsg.flow.pattern.ext_meta) + +RTE_TRACE_POINT_REGISTER(rte_pmd_nfp_trace_cmsg_flow_pattern_in_port, + pmd.net.nfp.cmsg.flow.pattern.in_port) + +RTE_TRACE_POINT_REGISTER(rte_pmd_nfp_trace_cmsg_flow_pattern_mac, + pmd.net.nfp.cmsg.flow.pattern.mac) + +RTE_TRACE_POINT_REGISTER(rte_pmd_nfp_trace_cmsg_flow_pattern_tp, + pmd.net.nfp.cmsg.flow.pattern.tp) + +RTE_TRACE_POINT_REGISTER(rte_pmd_nfp_trace_cmsg_flow_pattern_ipv4, + pmd.net.nfp.cmsg.flow.pattern.ipv4) + +RTE_TRACE_POINT_REGISTER(rte_pmd_nfp_trace_cmsg_flow_pattern_ipv6, + pmd.net.nfp.cmsg.flow.pattern.ipv6) + +RTE_TRACE_POINT_REGISTER(rte_pmd_nfp_trace_cmsg_flow_pattern_ipv4_gre_tun, + pmd.net.nfp.cmsg.flow.pattern.ipv4_gre_tun) + +RTE_TRACE_POINT_REGISTER(rte_pmd_nfp_trace_cmsg_flow_pattern_ipv4_udp_tun, + pmd.net.nfp.cmsg.flow.pattern.ipv4_udp_tun) + +RTE_TRACE_POINT_REGISTER(rte_pmd_nfp_trace_cmsg_flow_pattern_ipv6_gre_tun, + pmd.net.nfp.cmsg.flow.pattern.ipv6_gre_tun) + +RTE_TRACE_POINT_REGISTER(rte_pmd_nfp_trace_cmsg_flow_pattern_ipv6_udp_tun, + pmd.net.nfp.cmsg.flow.pattern.ipv6_udp_tun) + RTE_TRACE_POINT_REGISTER(rte_pmd_nfp_trace_cmsg_flow, pmd.net.nfp.cmsg.flow) diff --git a/drivers/net/nfp/nfp_trace.h b/drivers/net/nfp/nfp_trace.h index e0b8b0cee9..a5a7cc8faf 100644 --- a/drivers/net/nfp/nfp_trace.h +++ b/drivers/net/nfp/nfp_trace.h @@ -236,6 +236,205 @@ RTE_TRACE_POINT( rte_trace_point_emit_u32(meta->shortcut); ) +RTE_TRACE_POINT( + rte_pmd_nfp_trace_cmsg_flow_pattern_meta_tci, + RTE_TRACE_POINT_ARGS(void *cmsg), + + struct nfp_flower_meta_tci *msg = cmsg; + + uint8_t nfp_flow_key_layer = msg->nfp_flow_key_layer; + uint8_t mask_id = msg->mask_id; + uint16_t tci = rte_be_to_cpu_16(msg->tci); + + rte_trace_point_emit_u8(nfp_flow_key_layer); + rte_trace_point_emit_u8(mask_id); + rte_trace_point_emit_u16(tci); +) + +RTE_TRACE_POINT( + rte_pmd_nfp_trace_cmsg_flow_pattern_ext_meta, + RTE_TRACE_POINT_ARGS(void *cmsg), + + struct nfp_flower_ext_meta *msg = cmsg; + + uint32_t nfp_flow_key_layer2 = rte_be_to_cpu_32(msg->nfp_flow_key_layer2); + + rte_trace_point_emit_u32(nfp_flow_key_layer2); +) + +RTE_TRACE_POINT( + rte_pmd_nfp_trace_cmsg_flow_pattern_in_port, + RTE_TRACE_POINT_ARGS(void *cmsg), + + struct nfp_flower_in_port *msg = cmsg; + + uint32_t in_port = rte_be_to_cpu_32(msg->in_port); + + rte_trace_point_emit_u32(in_port); +) + +RTE_TRACE_POINT( + rte_pmd_nfp_trace_cmsg_flow_pattern_mac, + RTE_TRACE_POINT_ARGS(void *cmsg), + + struct nfp_flower_mac_mpls *msg = cmsg; + + uint8_t mac_dst_len = RTE_ETHER_ADDR_LEN; + uint8_t mac_src_len = RTE_ETHER_ADDR_LEN; + uint8_t *mac_dst = &msg->mac_dst[0]; + uint8_t *mac_src = &msg->mac_src[0]; + uint32_t mpls_lse = rte_be_to_cpu_32(msg->mpls_lse); + + rte_trace_point_emit_blob(mac_dst, mac_dst_len); + rte_trace_point_emit_blob(mac_src, mac_src_len); + rte_trace_point_emit_u32(mpls_lse); +) + +RTE_TRACE_POINT( + rte_pmd_nfp_trace_cmsg_flow_pattern_tp, + RTE_TRACE_POINT_ARGS(void *cmsg), + + struct nfp_flower_tp_ports *msg = cmsg; + + uint16_t port_src = rte_be_to_cpu_16(msg->port_src); + uint16_t port_dst = rte_be_to_cpu_16(msg->port_dst); + + rte_trace_point_emit_u16(port_src); + rte_trace_point_emit_u16(port_dst); +) + +RTE_TRACE_POINT( + rte_pmd_nfp_trace_cmsg_flow_pattern_ipv4, + RTE_TRACE_POINT_ARGS(void *cmsg), + + struct nfp_flower_ipv4 *msg = cmsg; + + uint8_t tos = msg->ip_ext.tos; + uint8_t proto = msg->ip_ext.proto; + uint8_t ttl = msg->ip_ext.ttl; + uint8_t flags = msg->ip_ext.flags; + uint32_t ipv4_src = rte_be_to_cpu_16(msg->ipv4_src); + uint32_t ipv4_dst = rte_be_to_cpu_16(msg->ipv4_dst); + + rte_trace_point_emit_u8(tos); + rte_trace_point_emit_u8(proto); + rte_trace_point_emit_u8(ttl); + rte_trace_point_emit_u8(flags); + rte_trace_point_emit_u32(ipv4_src); + rte_trace_point_emit_u32(ipv4_dst); +) + +RTE_TRACE_POINT( + rte_pmd_nfp_trace_cmsg_flow_pattern_ipv6, + RTE_TRACE_POINT_ARGS(void *cmsg), + + struct nfp_flower_ipv6 *msg = cmsg; + + uint8_t tos = msg->ip_ext.tos; + uint8_t proto = msg->ip_ext.proto; + uint8_t ttl = msg->ip_ext.ttl; + uint8_t flags = msg->ip_ext.flags; + uint8_t ipv6_src_len = 16; + uint8_t *ipv6_src = &msg->ipv6_src[0]; + uint8_t ipv6_dst_len = 16; + uint8_t *ipv6_dst = &msg->ipv6_dst[0]; + + rte_trace_point_emit_u8(tos); + rte_trace_point_emit_u8(proto); + rte_trace_point_emit_u8(ttl); + rte_trace_point_emit_u8(flags); + rte_trace_point_emit_blob(ipv6_src, ipv6_src_len); + rte_trace_point_emit_blob(ipv6_dst, ipv6_dst_len); +) + +RTE_TRACE_POINT( + rte_pmd_nfp_trace_cmsg_flow_pattern_ipv4_gre_tun, + RTE_TRACE_POINT_ARGS(void *cmsg), + + struct nfp_flower_ipv4_gre_tun *msg = cmsg; + + uint32_t src = rte_be_to_cpu_32(msg->ipv4.src); + uint32_t dst = rte_be_to_cpu_32(msg->ipv4.dst); + uint16_t tun_flags = rte_be_to_cpu_16(msg->tun_flags); + uint8_t tos = msg->ip_ext.tos; + uint8_t ttl = msg->ip_ext.ttl; + uint16_t ethertype = rte_be_to_cpu_16(msg->ethertype); + uint32_t tun_key = rte_be_to_cpu_32(msg->tun_key); + + rte_trace_point_emit_u32(src); + rte_trace_point_emit_u32(dst); + rte_trace_point_emit_u16(tun_flags); + rte_trace_point_emit_u8(tos); + rte_trace_point_emit_u8(ttl); + rte_trace_point_emit_u16(ethertype); + rte_trace_point_emit_u32(tun_key); +) + +RTE_TRACE_POINT( + rte_pmd_nfp_trace_cmsg_flow_pattern_ipv4_udp_tun, + RTE_TRACE_POINT_ARGS(void *cmsg), + + struct nfp_flower_ipv4_udp_tun *msg = cmsg; + + uint32_t src = rte_be_to_cpu_32(msg->ipv4.src); + uint32_t dst = rte_be_to_cpu_32(msg->ipv4.dst); + uint8_t tos = msg->ip_ext.tos; + uint8_t ttl = msg->ip_ext.ttl; + uint32_t tun_id = rte_be_to_cpu_32(msg->tun_id); + + rte_trace_point_emit_u32(src); + rte_trace_point_emit_u32(dst); + rte_trace_point_emit_u8(tos); + rte_trace_point_emit_u8(ttl); + rte_trace_point_emit_u32(tun_id); +) + +RTE_TRACE_POINT( + rte_pmd_nfp_trace_cmsg_flow_pattern_ipv6_gre_tun, + RTE_TRACE_POINT_ARGS(void *cmsg), + + struct nfp_flower_ipv6_gre_tun *msg = cmsg; + + uint8_t ipv6_src_len = 16; + uint8_t *ipv6_src = &msg->ipv6.ipv6_src[0]; + uint8_t ipv6_dst_len = 16; + uint8_t *ipv6_dst = &msg->ipv6.ipv6_dst[0]; + uint16_t tun_flags = rte_be_to_cpu_16(msg->tun_flags); + uint8_t tos = msg->ip_ext.tos; + uint8_t ttl = msg->ip_ext.ttl; + uint16_t ethertype = rte_be_to_cpu_16(msg->ethertype); + uint32_t tun_key = rte_be_to_cpu_32(msg->tun_key); + + rte_trace_point_emit_blob(ipv6_src, ipv6_src_len); + rte_trace_point_emit_blob(ipv6_dst, ipv6_dst_len); + rte_trace_point_emit_u16(tun_flags); + rte_trace_point_emit_u8(tos); + rte_trace_point_emit_u8(ttl); + rte_trace_point_emit_u16(ethertype); + rte_trace_point_emit_u32(tun_key); +) + +RTE_TRACE_POINT( + rte_pmd_nfp_trace_cmsg_flow_pattern_ipv6_udp_tun, + RTE_TRACE_POINT_ARGS(void *cmsg), + + struct nfp_flower_ipv6_udp_tun *msg = cmsg; + + uint8_t ipv6_src_len = 16; + uint8_t *ipv6_src = &msg->ipv6.ipv6_src[0]; + uint8_t ipv6_dst_len = 16; + uint8_t *ipv6_dst = &msg->ipv6.ipv6_dst[0]; + uint8_t tos = msg->ip_ext.tos; + uint8_t ttl = msg->ip_ext.ttl; + uint32_t tun_id = rte_be_to_cpu_32(msg->tun_id); + + rte_trace_point_emit_blob(ipv6_src, ipv6_src_len); + rte_trace_point_emit_blob(ipv6_dst, ipv6_dst_len); + rte_trace_point_emit_u8(tos); + rte_trace_point_emit_u8(ttl); + rte_trace_point_emit_u32(tun_id); +) + RTE_TRACE_POINT( rte_pmd_nfp_trace_cmsg_flow, RTE_TRACE_POINT_ARGS(const char *name), -- 2.39.1