{
if (sfc_dp_find_by_name(head, entry->type, entry->name) != NULL) {
SFC_GENERIC_LOG(ERR,
- "sfc %s dapapath '%s' already registered",
+ "sfc %s datapath '%s' already registered",
entry->type == SFC_DP_RX ? "Rx" :
entry->type == SFC_DP_TX ? "Tx" :
"unknown",
return 0;
}
+
+int sfc_dp_ft_id_offset = -1;
+uint64_t sfc_dp_ft_id_valid;
+
+int
+sfc_dp_ft_id_register(void)
+{
+ static const struct rte_mbuf_dynfield ft_id = {
+ .name = "rte_net_sfc_dynfield_ft_id",
+ .size = sizeof(uint8_t),
+ .align = __alignof__(uint8_t),
+ };
+ static const struct rte_mbuf_dynflag ft_id_valid = {
+ .name = "rte_net_sfc_dynflag_ft_id_valid",
+ };
+
+ int field_offset;
+ int flag;
+
+ SFC_GENERIC_LOG(INFO, "%s() entry", __func__);
+
+ if (sfc_dp_ft_id_valid != 0) {
+ SFC_GENERIC_LOG(INFO, "%s() already registered", __func__);
+ return 0;
+ }
+
+ field_offset = rte_mbuf_dynfield_register(&ft_id);
+ if (field_offset < 0) {
+ SFC_GENERIC_LOG(ERR, "%s() failed to register ft_id dynfield",
+ __func__);
+ return -1;
+ }
+
+ flag = rte_mbuf_dynflag_register(&ft_id_valid);
+ if (flag < 0) {
+ SFC_GENERIC_LOG(ERR, "%s() failed to register ft_id dynflag",
+ __func__);
+ return -1;
+ }
+
+ sfc_dp_ft_id_offset = field_offset;
+ sfc_dp_ft_id_valid = UINT64_C(1) << flag;
+
+ SFC_GENERIC_LOG(INFO, "%s() done", __func__);
+
+ return 0;
+}