+/* This API is to convert all the test vector op data entries
+ * to big endian format. It is used when the device supports
+ * the input in the big endian format.
+ */
+static inline void
+convert_op_data_to_be(void)
+{
+ struct op_data_entries *op;
+ enum op_data_type type;
+ uint8_t nb_segs, *rem_data, temp;
+ uint32_t *data, len;
+ int complete, rem, i, j;
+
+ for (type = DATA_INPUT; type < DATA_NUM_TYPES; ++type) {
+ nb_segs = test_vector.entries[type].nb_segments;
+ op = &test_vector.entries[type];
+
+ /* Invert byte endianness for all the segments */
+ for (i = 0; i < nb_segs; ++i) {
+ len = op->segments[i].length;
+ data = op->segments[i].addr;
+
+ /* Swap complete u32 bytes */
+ complete = len / 4;
+ for (j = 0; j < complete; j++)
+ data[j] = rte_bswap32(data[j]);
+
+ /* Swap any remaining bytes */
+ rem = len % 4;
+ rem_data = (uint8_t *)&data[j];
+ for (j = 0; j < rem/2; j++) {
+ temp = rem_data[j];
+ rem_data[j] = rem_data[rem - j - 1];
+ rem_data[rem - j - 1] = temp;
+ }
+ }
+ }
+}
+