distributor: fix 128-bit write alignment
authorDavid Hunt <david.hunt@intel.com>
Fri, 16 Jul 2021 13:32:37 +0000 (14:32 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Tue, 20 Jul 2021 12:32:08 +0000 (14:32 +0200)
When the distributor sample app is built as a 32-bit app,
the data buffer passed to find_match_vec can be unaligned,
causing a segmentation fault due to writing a 128-bit value
using _mm_store_si128().  128-bit align the data being
passed in so this does not happen.

Fixes: 775003ad2f96 ("distributor: add new burst-capable library")
Cc: stable@dpdk.org
Signed-off-by: David Hunt <david.hunt@intel.com>
lib/distributor/rte_distributor.c

index 07e385a..c210cf8 100644 (file)
@@ -478,7 +478,7 @@ rte_distributor_process(struct rte_distributor *d,
                return 0;
 
        while (next_idx < num_mbufs) {
-               uint16_t matches[RTE_DIST_BURST_SIZE];
+               uint16_t matches[RTE_DIST_BURST_SIZE] __rte_aligned(128);
                unsigned int pkts;
 
                if ((num_mbufs - next_idx) < RTE_DIST_BURST_SIZE)