include $(RTE_SDK)/mk/rte.vars.mk
-ifeq ($(FLEXRAN_SDK),)
-$(error "Please define FLEXRAN_SDK environment variable")
-endif
# library name
LIB = librte_pmd_bbdev_turbo_sw.a
# versioning export map
EXPORT_MAP := rte_pmd_bbdev_turbo_sw_version.map
-# external library dependencies
+# external library dependencies if available
+ifeq ($(CONFIG_RTE_BBDEV_SDK_AVX2),y)
+ifeq ($(FLEXRAN_SDK),)
+$(error "Please define FLEXRAN_SDK environment variable")
+endif
CFLAGS += -I$(FLEXRAN_SDK)/lib_common
CFLAGS += -I$(FLEXRAN_SDK)/lib_turbo
CFLAGS += -I$(FLEXRAN_SDK)/lib_crc
CFLAGS += -I$(FLEXRAN_SDK)/lib_rate_matching
-
LDLIBS += -L$(FLEXRAN_SDK)/lib_turbo -lturbo
LDLIBS += -L$(FLEXRAN_SDK)/lib_crc -lcrc
LDLIBS += -L$(FLEXRAN_SDK)/lib_rate_matching -lrate_matching
LDLIBS += -L$(FLEXRAN_SDK)/lib_common -lcommon
-LDLIBS += -lstdc++ -lirc -limf -lipps
+LDLIBS += -lstdc++ -lirc -limf -lipps -lsvml
+endif
# library version
LIBABIVER := 1
#include <rte_bbdev.h>
#include <rte_bbdev_pmd.h>
+#ifdef RTE_BBDEV_SDK_AVX2
#include <phy_turbo.h>
#include <phy_crc.h>
#include <phy_rate_match.h>
-#include <divide.h>
+#endif
#define DRIVER_NAME baseband_turbo_sw
enum rte_bbdev_op_type type;
} __rte_cache_aligned;
+#ifdef RTE_BBDEV_SDK_AVX2
static inline char *
mbuf_append(struct rte_mbuf *m_head, struct rte_mbuf *m, uint16_t len)
{
return result;
}
+#endif
/* Read flag value 0/1 from bitmap */
static inline bool
struct bbdev_private *internals = dev->data->dev_private;
static const struct rte_bbdev_op_cap bbdev_capabilities[] = {
+#ifdef RTE_BBDEV_SDK_AVX2
{
.type = RTE_BBDEV_OP_TURBO_DEC,
.cap.turbo_dec = {
.num_buffers_dst = RTE_BBDEV_MAX_CODE_BLOCKS,
}
},
+#endif
RTE_BBDEV_END_OF_CAPABILITIES_LIST()
};
.queue_size = RTE_BBDEV_QUEUE_SIZE_LIMIT,
};
+#ifdef RTE_BBDEV_SDK_AVX2
static const enum rte_cpu_flag_t cpu_flag = RTE_CPUFLAG_SSE4_2;
+ dev_info->cpu_flag_reqs = &cpu_flag;
+#else
+ dev_info->cpu_flag_reqs = NULL;
+#endif
default_queue_conf.socket = dev->data->socket_id;
dev_info->max_ul_queue_priority = 0;
dev_info->default_queue_conf = default_queue_conf;
dev_info->capabilities = bbdev_capabilities;
- dev_info->cpu_flag_reqs = &cpu_flag;
dev_info->min_alignment = 64;
rte_bbdev_log_debug("got device info from %u\n", dev->data->dev_id);
.queue_release = q_release
};
+#ifdef RTE_BBDEV_SDK_AVX2
/* Checks if the encoder input buffer is correct.
* Returns 0 if it's valid, -1 otherwise.
*/
return 0;
}
+#endif
static inline void
process_enc_cb(struct turbo_sw_queue *q, struct rte_bbdev_enc_op *op,
struct rte_mbuf *m_out, uint16_t in_offset, uint16_t out_offset,
uint16_t in_length, struct rte_bbdev_stats *q_stats)
{
+#ifdef RTE_BBDEV_SDK_AVX2
int ret;
int16_t k_idx;
uint16_t m;
}
*tmp_out = 0;
}
+#else
+ RTE_SET_USED(q);
+ RTE_SET_USED(op);
+ RTE_SET_USED(r);
+ RTE_SET_USED(c);
+ RTE_SET_USED(k);
+ RTE_SET_USED(ncb);
+ RTE_SET_USED(e);
+ RTE_SET_USED(m_in);
+ RTE_SET_USED(m_out_head);
+ RTE_SET_USED(m_out);
+ RTE_SET_USED(in_offset);
+ RTE_SET_USED(out_offset);
+ RTE_SET_USED(in_length);
+ RTE_SET_USED(q_stats);
+#endif
}
static inline void
NULL);
}
+#ifdef RTE_BBDEV_SDK_AVX2
static inline void
move_padding_bytes(const uint8_t *in, uint8_t *out, uint16_t k,
uint16_t ncb)
rte_memcpy(&out[nd + kpi + 64], &in[kpi], d);
rte_memcpy(&out[(nd - 1) + 2 * (kpi + 64)], &in[2 * kpi], d);
}
+#endif
static inline void
process_dec_cb(struct turbo_sw_queue *q, struct rte_bbdev_dec_op *op,
uint16_t crc24_overlap, uint16_t in_length,
struct rte_bbdev_stats *q_stats)
{
+#ifdef RTE_BBDEV_SDK_AVX2
int ret;
int32_t k_idx;
int32_t iter_cnt;
rte_bbdev_log(ERR, "Turbo Decoder failed");
return;
}
+#else
+ RTE_SET_USED(q);
+ RTE_SET_USED(op);
+ RTE_SET_USED(c);
+ RTE_SET_USED(k);
+ RTE_SET_USED(kw);
+ RTE_SET_USED(m_in);
+ RTE_SET_USED(m_out_head);
+ RTE_SET_USED(m_out);
+ RTE_SET_USED(in_offset);
+ RTE_SET_USED(out_offset);
+ RTE_SET_USED(check_crc_24b);
+ RTE_SET_USED(crc24_overlap);
+ RTE_SET_USED(in_length);
+ RTE_SET_USED(q_stats);
+#endif
}
static inline void
# TURBO SOFTWARE PMD is dependent on the FLEXRAN library
_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_BBDEV_TURBO_SW) += -lrte_pmd_bbdev_turbo_sw
+ifeq ($(CONFIG_RTE_BBDEV_SDK_AVX2),y)
+# Dependency on the FLEXRAN SDK library if available
_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_BBDEV_TURBO_SW) += -L$(FLEXRAN_SDK)/lib_crc -lcrc
_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_BBDEV_TURBO_SW) += -L$(FLEXRAN_SDK)/lib_turbo -lturbo
_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_BBDEV_TURBO_SW) += -L$(FLEXRAN_SDK)/lib_rate_matching -lrate_matching
_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_BBDEV_TURBO_SW) += -L$(FLEXRAN_SDK)/lib_common -lcommon
_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_BBDEV_TURBO_SW) += -lirc -limf -lstdc++ -lipps
+endif # CONFIG_RTE_BBDEV_SDK_AVX2
endif # CONFIG_RTE_LIBRTE_BBDEV
ifeq ($(CONFIG_RTE_LIBRTE_CRYPTODEV),y)