From patchwork Mon Jun 5 08:21:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nithin Dabilpuram X-Patchwork-Id: 128096 X-Patchwork-Delegate: gakhil@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4448B42C34; Mon, 5 Jun 2023 10:21:31 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C3C5B40A7F; Mon, 5 Jun 2023 10:21:30 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 5658E4003C for ; Mon, 5 Jun 2023 10:21:29 +0200 (CEST) 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 354KeHbh015673; Mon, 5 Jun 2023 01:21:28 -0700 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=eoueLjuTsUjXsgoUmtJZgV4DjdQLRSxVLyLZAc9OINA=; b=csYD2lVdliIhV/GF5e6jDb6IJxweLL3ztkiuYjQ/oy9RXc9Sx3jTGT6O7fOekNjdOQZM FeJPBuAPVJYTqaFs6uJmiQZj2D50c/EDvybWWnEtdtYZrDYXeqLESD+MCqheHBL5pSxh xmgG9K8sXS6xhu1ZThLWoxnRUebM/TvJ+bJ5ka28e6pMCFfZk5Q0eU9SZSBGHtajySjW dPzvY0Z2AwWoAdrQ0qxslOgePfe03EzU8102v5zZ+qy01MORdYxiNF1bYqyE7Orjpnxu LjmFegIkH8CdNrRJPQMnFu8cY5LLjGmtSOMhcEoOhyhNrh3Rv9usqDwjby0uPjCWo+Kl pg== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3r02vpdsfs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Mon, 05 Jun 2023 01:21:28 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Mon, 5 Jun 2023 01:21:26 -0700 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.48 via Frontend Transport; Mon, 5 Jun 2023 01:21:26 -0700 Received: from hyd1588t430.caveonetworks.com (unknown [10.29.52.204]) by maili.marvell.com (Postfix) with ESMTP id DC5153F705A; Mon, 5 Jun 2023 01:21:24 -0700 (PDT) From: Nithin Dabilpuram To: Radu Nicolau , Akhil Goyal CC: , , Nithin Dabilpuram Subject: [PATCH 1/3] examples/ipsec-secgw: avoid error pkt prints in fast path Date: Mon, 5 Jun 2023 13:51:20 +0530 Message-ID: <20230605082122.422934-1-ndabilpuram@marvell.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Proofpoint-GUID: TG_SOt8S49NF53G9s8IOkgq09j1rIBdD X-Proofpoint-ORIG-GUID: TG_SOt8S49NF53G9s8IOkgq09j1rIBdD X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.176.26 definitions=2023-06-03_08,2023-06-02_02,2023-05-22_02 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 Avoid printing errors due to bad packets in fast path as it effects performance. Make them RTE_LOG_DP() instead. Also print the actual ptype that is used to classify the pkt. Signed-off-by: Nithin Dabilpuram Acked-by: Akhil Goyal --- examples/ipsec-secgw/ipsec_worker.c | 2 +- examples/ipsec-secgw/ipsec_worker.h | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/examples/ipsec-secgw/ipsec_worker.c b/examples/ipsec-secgw/ipsec_worker.c index 2f02946f86..58c80c73f0 100644 --- a/examples/ipsec-secgw/ipsec_worker.c +++ b/examples/ipsec-secgw/ipsec_worker.c @@ -578,7 +578,7 @@ process_ipsec_ev_outbound(struct ipsec_ctx *ctx, struct route_table *rt, * Only plain IPv4 & IPv6 packets are allowed * on protected port. Drop the rest. */ - RTE_LOG(ERR, IPSEC, "Unsupported packet type = %d\n", type); + RTE_LOG_DP(DEBUG, IPSEC, "Unsupported packet type = %d\n", type); goto drop_pkt_and_exit; } diff --git a/examples/ipsec-secgw/ipsec_worker.h b/examples/ipsec-secgw/ipsec_worker.h index d5a68d91fa..cf59b9b5ab 100644 --- a/examples/ipsec-secgw/ipsec_worker.h +++ b/examples/ipsec-secgw/ipsec_worker.h @@ -123,7 +123,6 @@ prepare_one_packet(struct rte_security_ctx *ctx, struct rte_mbuf *pkt, struct ipsec_traffic *t) { uint32_t ptype = pkt->packet_type; - const struct rte_ether_hdr *eth; const struct rte_ipv4_hdr *iph4; const struct rte_ipv6_hdr *iph6; uint32_t tun_type, l3_type; @@ -138,7 +137,6 @@ prepare_one_packet(struct rte_security_ctx *ctx, struct rte_mbuf *pkt, tun_type = ptype & RTE_PTYPE_TUNNEL_MASK; l3_type = ptype & RTE_PTYPE_L3_MASK; - eth = rte_pktmbuf_mtod(pkt, const struct rte_ether_hdr *); if (RTE_ETH_IS_IPV4_HDR(l3_type)) { iph4 = (const struct rte_ipv4_hdr *)rte_pktmbuf_adj(pkt, RTE_ETHER_HDR_LEN); @@ -192,8 +190,7 @@ prepare_one_packet(struct rte_security_ctx *ctx, struct rte_mbuf *pkt, tx_offload = l3len << RTE_MBUF_L2_LEN_BITS; } else { /* Unknown/Unsupported type, drop the packet */ - RTE_LOG(ERR, IPSEC, "Unsupported packet type 0x%x\n", - rte_be_to_cpu_16(eth->ether_type)); + RTE_LOG_DP(DEBUG, IPSEC, "Unsupported packet type 0x%x\n", ptype); free_pkts(&pkt, 1); return; }