From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 66AC4A0613 for ; Tue, 23 Jul 2019 03:02:36 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 521601BF63; Tue, 23 Jul 2019 03:02:36 +0200 (CEST) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 1506A1BF58 for ; Tue, 23 Jul 2019 03:02:35 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE2 (envelope-from yskoh@mellanox.com) with ESMTPS (AES256-SHA encrypted); 23 Jul 2019 04:02:32 +0300 Received: from scfae-sc-2.mti.labs.mlnx (scfae-sc-2.mti.labs.mlnx [10.101.0.96]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id x6N11HfS026580; Tue, 23 Jul 2019 04:02:31 +0300 From: Yongseok Koh To: Bernard Iremonger Cc: Konstantin Ananyev , Akhil Goyal , dpdk stable Date: Mon, 22 Jul 2019 18:00:09 -0700 Message-Id: <20190723010115.6446-42-yskoh@mellanox.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190723010115.6446-1-yskoh@mellanox.com> References: <20190723010115.6446-1-yskoh@mellanox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'examples/ipsec-secgw: fix debug logs' has been queued to LTS release 17.11.7 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to LTS release 17.11.7 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objection by 07/27/19. So please shout if anyone has objection. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Thanks. Yongseok --- >From 5a9550b54eb791c78d0998d37abc9003c5b7948f Mon Sep 17 00:00:00 2001 From: Bernard Iremonger Date: Thu, 7 Mar 2019 10:34:52 +0000 Subject: [PATCH] examples/ipsec-secgw: fix debug logs [ upstream commit da7a540e1dc64495785d4f0d6e6b20b27bf28580 ] Improve debug code in esp.c, sa.c and ipsec-secgw.c Fixes: f159e70b0922 ("examples/ipsec-secgw: support transport mode") Fixes: ec17993a145a ("examples/ipsec-secgw: support security offload") Fixes: 0d547ed03717 ("examples/ipsec-secgw: support configuration file") Fixes: 906257e965b7 ("examples/ipsec-secgw: support IPv6") Signed-off-by: Bernard Iremonger Acked-by: Konstantin Ananyev Acked-by: Akhil Goyal --- examples/ipsec-secgw/esp.c | 5 +++-- examples/ipsec-secgw/ipsec-secgw.c | 6 ++++-- examples/ipsec-secgw/sa.c | 21 ++++++++++++++++++--- 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/examples/ipsec-secgw/esp.c b/examples/ipsec-secgw/esp.c index c3efe52b15..32989aaa4e 100644 --- a/examples/ipsec-secgw/esp.c +++ b/examples/ipsec-secgw/esp.c @@ -189,7 +189,7 @@ esp_inbound_post(struct rte_mbuf *m, struct ipsec_sa *sa, } if (cop->status != RTE_CRYPTO_OP_STATUS_SUCCESS) { - RTE_LOG(ERR, IPSEC_ESP, "failed crypto op\n"); + RTE_LOG(ERR, IPSEC_ESP, "%s() failed crypto op\n", __func__); return -1; } @@ -479,7 +479,8 @@ esp_outbound_post(struct rte_mbuf *m, } else { RTE_ASSERT(cop != NULL); if (cop->status != RTE_CRYPTO_OP_STATUS_SUCCESS) { - RTE_LOG(ERR, IPSEC_ESP, "Failed crypto op\n"); + RTE_LOG(ERR, IPSEC_ESP, "%s() failed crypto op\n", + __func__); return -1; } } diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c index f98d529f5d..2b4b8900df 100644 --- a/examples/ipsec-secgw/ipsec-secgw.c +++ b/examples/ipsec-secgw/ipsec-secgw.c @@ -262,7 +262,8 @@ prepare_one_packet(struct rte_mbuf *pkt, struct ipsec_traffic *t) } } else { /* Unknown/Unsupported type, drop the packet */ - RTE_LOG(ERR, IPSEC, "Unsupported packet type\n"); + RTE_LOG(ERR, IPSEC, "Unsupported packet type 0x%x\n", + rte_be_to_cpu_16(eth->ether_type)); rte_pktmbuf_free(pkt); } } @@ -807,7 +808,8 @@ main_loop(__attribute__((unused)) void *dummy) qconf->outbound.session_pool = socket_ctx[socket_id].session_pool; if (qconf->nb_rx_queue == 0) { - RTE_LOG(INFO, IPSEC, "lcore %u has nothing to do\n", lcore_id); + RTE_LOG(DEBUG, IPSEC, "lcore %u has nothing to do\n", + lcore_id); return 0; } diff --git a/examples/ipsec-secgw/sa.c b/examples/ipsec-secgw/sa.c index b51a230a33..eb83d94cdc 100644 --- a/examples/ipsec-secgw/sa.c +++ b/examples/ipsec-secgw/sa.c @@ -700,7 +700,22 @@ print_one_sa_rule(const struct ipsec_sa *sa, int inbound) } break; case TRANSPORT: - printf("Transport"); + printf("Transport "); + break; + } + printf(" type:"); + switch (sa->type) { + case RTE_SECURITY_ACTION_TYPE_NONE: + printf("no-offload "); + break; + case RTE_SECURITY_ACTION_TYPE_INLINE_CRYPTO: + printf("inline-crypto-offload "); + break; + case RTE_SECURITY_ACTION_TYPE_INLINE_PROTOCOL: + printf("inline-protocol-offload "); + break; + case RTE_SECURITY_ACTION_TYPE_LOOKASIDE_PROTOCOL: + printf("lookaside-protocol-offload "); break; } printf("\n"); @@ -727,8 +742,8 @@ sa_create(const char *name, int32_t socket_id) snprintf(s, sizeof(s), "%s_%u", name, socket_id); /* Create SA array table */ - printf("Creating SA context with %u maximum entries\n", - IPSEC_SA_MAX_ENTRIES); + printf("Creating SA context with %u maximum entries on socket %d\n", + IPSEC_SA_MAX_ENTRIES, socket_id); mz_size = sizeof(struct sa_ctx); mz = rte_memzone_reserve(s, mz_size, socket_id, -- 2.21.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2019-07-22 17:55:08.793138071 -0700 +++ 0042-examples-ipsec-secgw-fix-debug-logs.patch 2019-07-22 17:55:06.067473000 -0700 @@ -1,15 +1,16 @@ -From da7a540e1dc64495785d4f0d6e6b20b27bf28580 Mon Sep 17 00:00:00 2001 +From 5a9550b54eb791c78d0998d37abc9003c5b7948f Mon Sep 17 00:00:00 2001 From: Bernard Iremonger Date: Thu, 7 Mar 2019 10:34:52 +0000 Subject: [PATCH] examples/ipsec-secgw: fix debug logs +[ upstream commit da7a540e1dc64495785d4f0d6e6b20b27bf28580 ] + Improve debug code in esp.c, sa.c and ipsec-secgw.c Fixes: f159e70b0922 ("examples/ipsec-secgw: support transport mode") Fixes: ec17993a145a ("examples/ipsec-secgw: support security offload") Fixes: 0d547ed03717 ("examples/ipsec-secgw: support configuration file") Fixes: 906257e965b7 ("examples/ipsec-secgw: support IPv6") -Cc: stable@dpdk.org Signed-off-by: Bernard Iremonger Acked-by: Konstantin Ananyev @@ -21,10 +22,10 @@ 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/examples/ipsec-secgw/esp.c b/examples/ipsec-secgw/esp.c -index e33232c989..faa84ddd13 100644 +index c3efe52b15..32989aaa4e 100644 --- a/examples/ipsec-secgw/esp.c +++ b/examples/ipsec-secgw/esp.c -@@ -162,7 +162,7 @@ esp_inbound_post(struct rte_mbuf *m, struct ipsec_sa *sa, +@@ -189,7 +189,7 @@ esp_inbound_post(struct rte_mbuf *m, struct ipsec_sa *sa, } if (cop->status != RTE_CRYPTO_OP_STATUS_SUCCESS) { @@ -33,7 +34,7 @@ return -1; } -@@ -455,7 +455,8 @@ esp_outbound_post(struct rte_mbuf *m, +@@ -479,7 +479,8 @@ esp_outbound_post(struct rte_mbuf *m, } else { RTE_ASSERT(cop != NULL); if (cop->status != RTE_CRYPTO_OP_STATUS_SUCCESS) { @@ -44,11 +45,11 @@ } } diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c -index 8e7cd1b73b..b253eea2bf 100644 +index f98d529f5d..2b4b8900df 100644 --- a/examples/ipsec-secgw/ipsec-secgw.c +++ b/examples/ipsec-secgw/ipsec-secgw.c -@@ -260,7 +260,8 @@ prepare_one_packet(struct rte_mbuf *pkt, struct ipsec_traffic *t) - pkt->l3_len = sizeof(struct ip6_hdr); +@@ -262,7 +262,8 @@ prepare_one_packet(struct rte_mbuf *pkt, struct ipsec_traffic *t) + } } else { /* Unknown/Unsupported type, drop the packet */ - RTE_LOG(ERR, IPSEC, "Unsupported packet type\n"); @@ -56,9 +57,9 @@ + rte_be_to_cpu_16(eth->ether_type)); rte_pktmbuf_free(pkt); } - -@@ -984,7 +985,8 @@ main_loop(__attribute__((unused)) void *dummy) - socket_ctx[socket_id].session_priv_pool; + } +@@ -807,7 +808,8 @@ main_loop(__attribute__((unused)) void *dummy) + qconf->outbound.session_pool = socket_ctx[socket_id].session_pool; if (qconf->nb_rx_queue == 0) { - RTE_LOG(INFO, IPSEC, "lcore %u has nothing to do\n", lcore_id); @@ -68,10 +69,10 @@ } diff --git a/examples/ipsec-secgw/sa.c b/examples/ipsec-secgw/sa.c -index 93e3620bcd..a7298a30c2 100644 +index b51a230a33..eb83d94cdc 100644 --- a/examples/ipsec-secgw/sa.c +++ b/examples/ipsec-secgw/sa.c -@@ -688,7 +688,22 @@ print_one_sa_rule(const struct ipsec_sa *sa, int inbound) +@@ -700,7 +700,22 @@ print_one_sa_rule(const struct ipsec_sa *sa, int inbound) } break; case TRANSPORT: @@ -95,7 +96,7 @@ break; } printf("\n"); -@@ -716,8 +731,8 @@ sa_create(const char *name, int32_t socket_id) +@@ -727,8 +742,8 @@ sa_create(const char *name, int32_t socket_id) snprintf(s, sizeof(s), "%s_%u", name, socket_id); /* Create SA array table */