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 4EDA4A00C2 for ; Thu, 3 Nov 2022 10:29:23 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4A81740694; Thu, 3 Nov 2022 10:29:23 +0100 (CET) Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) by mails.dpdk.org (Postfix) with ESMTP id 1110940694 for ; Thu, 3 Nov 2022 10:29:22 +0100 (CET) Received: by mail-wr1-f49.google.com with SMTP id bs21so1728360wrb.4 for ; Thu, 03 Nov 2022 02:29:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=MvIi4+Fd+mkTITeWpYlOnVOJevNlF7fMo5UB6ptSooU=; b=kTpthM0mBU2LKIxEXEsBwHxexIjFkz1eVM04ow+yvUUHtu72eglHUM9wT8B7Qo90td Ne3ZkH67tvLC7mWlBQKg+UT7NrIFbZ2MX59mpmSW1ez6fEA+0MGIvBB6hqdcQAJI5ePC 7g1z7srgxqaWQrwMAbtlXA/ANwfgkhwm8UyaXEEdXznjaEh7KMVWd4+wQEI7zrpK7AUY 7kcQxyMv8yxC6zlbNVk2wo8bsRIkWaj7UdAgoUHYiCxrCj4AJsMW+5i/MvoNKflDwD4j xoye/eyoy22F4NBsmXVcBxLXW7f8/ze/sDKLIN8qLn0ongttuuQtcz0YWTtNVRyF6lkp npRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MvIi4+Fd+mkTITeWpYlOnVOJevNlF7fMo5UB6ptSooU=; b=JvXkmpqo88c6ohbexNf5+gAq6avB0TtwYd6ct7wZxcHPSXzkkuEEgFdE0D5YEvcc5C GEqJamwlUE9Mnbd42Flzh2/X8CuLfODqCUzqTiGw1vTUsTJbfh89o4FZ4YMC5af9hmC5 LMsm3EYQGHubPrB1ZoAAFAY4uJb63WBqI2LGd6LUsfwW3U1LDNV5kD//YjDQM+bPeTzS AIyJ9IDX5xdW2XjgPNzaBUhqi+BPCeJWhY9OhYx7NMh+j1DkD44Py+agJxFaIubR+h8z RWDSi/8frf+GvJGZ4W9Z2rJYRETjgF9uKdJEddx3czoxTjgOwg3e/kjq64xfGBwbzFzi LX3g== X-Gm-Message-State: ACrzQf1viD4p78+u8rLTdnxwwqCchPmdh+abwh6ZCDIOaM/2749J/Afx YuT7T2/Y9f29EUZ4Bdp3dLMikw+CY26MCA== X-Google-Smtp-Source: AMsMyM5c/tr+lHZrjXg0ULf4NL5aRAMXAwh7FSXOS+wzEWKV8aQTP4JXyfQfSQc4eeAlOYzW1VKfjw== X-Received: by 2002:adf:e510:0:b0:235:de50:72ff with SMTP id j16-20020adfe510000000b00235de5072ffmr17333420wrm.100.1667467761667; Thu, 03 Nov 2022 02:29:21 -0700 (PDT) Received: from localhost ([2a01:4b00:d307:1000:f1d3:eb5e:11f4:a7d9]) by smtp.gmail.com with ESMTPSA id e7-20020a5d5007000000b00236644228besm365135wrt.40.2022.11.03.02.29.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Nov 2022 02:29:20 -0700 (PDT) From: luca.boccassi@gmail.com To: Nithin Dabilpuram Cc: Akhil Goyal , dpdk stable Subject: patch 'examples/ipsec-secgw: use Tx checksum offload conditionally' has been queued to stable release 20.11.7 Date: Thu, 3 Nov 2022 09:26:41 +0000 Message-Id: <20221103092758.1099402-23-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221103092758.1099402-1-luca.boccassi@gmail.com> References: <20221103092758.1099402-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 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 Hi, FYI, your patch has been queued to stable release 20.11.7 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/05/22. So please shout if anyone has objections. 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. Queued patches are on a temporary branch at: https://github.com/kevintraynor/dpdk-stable This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable/commit/5f5d17a1149855eee2b8145e3f18bac976d13207 Thanks. Luca Boccassi --- >From 5f5d17a1149855eee2b8145e3f18bac976d13207 Mon Sep 17 00:00:00 2001 From: Nithin Dabilpuram Date: Thu, 21 Jul 2022 21:01:31 +0530 Subject: [PATCH] examples/ipsec-secgw: use Tx checksum offload conditionally [ upstream commit 4edcee19fc20be7c28da3e06e3be5e8567162f01 ] Use Tx checksum offload only when all the ports have it enabled as the qconf for a particular lcore stores ipv4_offloads for all the Tx ports and each lcore can Tx to any port. Fixes: 03128be4cd4d ("examples/ipsec-secgw: allow disabling some Rx/Tx offloads") Signed-off-by: Nithin Dabilpuram Acked-by: Akhil Goyal --- examples/ipsec-secgw/ipsec-secgw.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c index 091f54f065..c2fb95f890 100644 --- a/examples/ipsec-secgw/ipsec-secgw.c +++ b/examples/ipsec-secgw/ipsec-secgw.c @@ -2262,12 +2262,6 @@ port_init(uint16_t portid, uint64_t req_rx_offloads, uint64_t req_tx_offloads) qconf = &lcore_conf[lcore_id]; qconf->tx_queue_id[portid] = tx_queueid; - /* Pre-populate pkt offloads based on capabilities */ - qconf->outbound.ipv4_offloads = PKT_TX_IPV4; - qconf->outbound.ipv6_offloads = PKT_TX_IPV6; - if (local_port_conf.txmode.offloads & DEV_TX_OFFLOAD_IPV4_CKSUM) - qconf->outbound.ipv4_offloads |= PKT_TX_IP_CKSUM; - tx_queueid++; /* init RX queues */ @@ -2807,6 +2801,7 @@ main(int32_t argc, char **argv) uint64_t req_rx_offloads[RTE_MAX_ETHPORTS]; uint64_t req_tx_offloads[RTE_MAX_ETHPORTS]; struct eh_conf *eh_conf = NULL; + uint32_t ipv4_cksum_port_mask = 0; size_t sess_sz; nb_bufs_in_pool = 0; @@ -2912,6 +2907,20 @@ main(int32_t argc, char **argv) &req_tx_offloads[portid]); port_init(portid, req_rx_offloads[portid], req_tx_offloads[portid]); + if ((req_tx_offloads[portid] & DEV_TX_OFFLOAD_IPV4_CKSUM)) + ipv4_cksum_port_mask = 1U << portid; + } + + for (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id++) { + if (rte_lcore_is_enabled(lcore_id) == 0) + continue; + + /* Pre-populate pkt offloads based on capabilities */ + lcore_conf[lcore_id].outbound.ipv4_offloads = PKT_TX_IPV4; + lcore_conf[lcore_id].outbound.ipv6_offloads = PKT_TX_IPV6; + /* Update per lcore checksum offload support only if all ports support it */ + if (ipv4_cksum_port_mask == enabled_port_mask) + lcore_conf[lcore_id].outbound.ipv4_offloads |= PKT_TX_IP_CKSUM; } /* -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-11-03 09:27:26.832335511 +0000 +++ 0023-examples-ipsec-secgw-use-Tx-checksum-offload-conditi.patch 2022-11-03 09:27:25.337421744 +0000 @@ -1 +1 @@ -From 4edcee19fc20be7c28da3e06e3be5e8567162f01 Mon Sep 17 00:00:00 2001 +From 5f5d17a1149855eee2b8145e3f18bac976d13207 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 4edcee19fc20be7c28da3e06e3be5e8567162f01 ] + @@ -11 +12,0 @@ -Cc: stable@dpdk.org @@ -20 +21 @@ -index 815b9254ae..8a25b83535 100644 +index 091f54f065..c2fb95f890 100644 @@ -23 +24 @@ -@@ -1998,12 +1998,6 @@ port_init(uint16_t portid, uint64_t req_rx_offloads, uint64_t req_tx_offloads) +@@ -2262,12 +2262,6 @@ port_init(uint16_t portid, uint64_t req_rx_offloads, uint64_t req_tx_offloads) @@ -28,4 +29,4 @@ -- qconf->outbound.ipv4_offloads = RTE_MBUF_F_TX_IPV4; -- qconf->outbound.ipv6_offloads = RTE_MBUF_F_TX_IPV6; -- if (local_port_conf.txmode.offloads & RTE_ETH_TX_OFFLOAD_IPV4_CKSUM) -- qconf->outbound.ipv4_offloads |= RTE_MBUF_F_TX_IP_CKSUM; +- qconf->outbound.ipv4_offloads = PKT_TX_IPV4; +- qconf->outbound.ipv6_offloads = PKT_TX_IPV6; +- if (local_port_conf.txmode.offloads & DEV_TX_OFFLOAD_IPV4_CKSUM) +- qconf->outbound.ipv4_offloads |= PKT_TX_IP_CKSUM; @@ -36 +37 @@ -@@ -2925,6 +2919,7 @@ main(int32_t argc, char **argv) +@@ -2807,6 +2801,7 @@ main(int32_t argc, char **argv) @@ -44 +45 @@ -@@ -3046,6 +3041,20 @@ main(int32_t argc, char **argv) +@@ -2912,6 +2907,20 @@ main(int32_t argc, char **argv) @@ -48 +49 @@ -+ if ((req_tx_offloads[portid] & RTE_ETH_TX_OFFLOAD_IPV4_CKSUM)) ++ if ((req_tx_offloads[portid] & DEV_TX_OFFLOAD_IPV4_CKSUM)) @@ -57,2 +58,2 @@ -+ lcore_conf[lcore_id].outbound.ipv4_offloads = RTE_MBUF_F_TX_IPV4; -+ lcore_conf[lcore_id].outbound.ipv6_offloads = RTE_MBUF_F_TX_IPV6; ++ lcore_conf[lcore_id].outbound.ipv4_offloads = PKT_TX_IPV4; ++ lcore_conf[lcore_id].outbound.ipv6_offloads = PKT_TX_IPV6; @@ -61 +62 @@ -+ lcore_conf[lcore_id].outbound.ipv4_offloads |= RTE_MBUF_F_TX_IP_CKSUM; ++ lcore_conf[lcore_id].outbound.ipv4_offloads |= PKT_TX_IP_CKSUM;