]> git.droids-corp.org - dpdk.git/commitdiff
examples/ipsec-secgw: allow larger burst size for vectors
authorNithin Dabilpuram <ndabilpuram@marvell.com>
Fri, 29 Apr 2022 20:44:13 +0000 (02:14 +0530)
committerAkhil Goyal <gakhil@marvell.com>
Wed, 1 Jun 2022 14:26:34 +0000 (16:26 +0200)
Allow larger burst size of vector event mode instead of restricting
to 32. Also restructure traffic type struct to have num pkts first
so that it is always in first cacheline. Also cache align
traffic type struct. Since MAX_PKT_BURST is not used by
vector event mode worker, define another macro for its burst
size so that poll mode perf is not effected.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
examples/ipsec-secgw/ipsec-secgw.c
examples/ipsec-secgw/ipsec-secgw.h

index d6a495952a8eea4a3cd82d688b1b5098d9ef5314..88984a6aaa6539f89fb44745c0e9299ee24c4ab0 100644 (file)
@@ -1317,7 +1317,7 @@ parse_args(int32_t argc, char **argv, struct eh_conf *eh_conf)
                case CMD_LINE_OPT_VECTOR_SIZE_NUM:
                        ret = parse_decimal(optarg);
 
-                       if (ret > MAX_PKT_BURST) {
+                       if (ret > MAX_PKT_BURST_VEC) {
                                printf("Invalid argument for \'%s\': %s\n",
                                        CMD_LINE_OPT_VECTOR_SIZE, optarg);
                                print_usage(prgname);
index fceb835bbf6ad8517bc8ebc5eac66b0ffacc25e6..2edf6319c8259d2a5e921731c4e1699fc81b56e9 100644 (file)
 #define NB_SOCKETS 4
 
 #define MAX_PKT_BURST 32
+#define MAX_PKT_BURST_VEC 256
+
+#define MAX_PKTS                                  \
+       ((MAX_PKT_BURST_VEC > MAX_PKT_BURST ?     \
+         MAX_PKT_BURST_VEC : MAX_PKT_BURST) * 2)
 
 #define RTE_LOGTYPE_IPSEC RTE_LOGTYPE_USER1
 
 #define MBUF_PTYPE_TUNNEL_ESP_IN_UDP (RTE_PTYPE_TUNNEL_ESP | RTE_PTYPE_L4_UDP)
 
 struct traffic_type {
-       const uint8_t *data[MAX_PKT_BURST * 2];
-       struct rte_mbuf *pkts[MAX_PKT_BURST * 2];
-       void *saptr[MAX_PKT_BURST * 2];
-       uint32_t res[MAX_PKT_BURST * 2];
        uint32_t num;
-};
+       struct rte_mbuf *pkts[MAX_PKTS];
+       const uint8_t *data[MAX_PKTS];
+       void *saptr[MAX_PKTS];
+       uint32_t res[MAX_PKTS];
+} __rte_cache_aligned;
 
 struct ipsec_traffic {
        struct traffic_type ipsec;