examples/ipsec-secgw: allow larger burst size for vectors

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>
This commit is contained in:
Nithin Dabilpuram 2022-04-30 02:14:13 +05:30 committed by Akhil Goyal
parent d04bb1c526
commit a2b445b810
2 changed files with 11 additions and 6 deletions

View 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);

View File

@ -11,6 +11,11 @@
#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
@ -49,12 +54,12 @@
#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;