#include <stdlib.h>
#include "../common.h"
#include "../jump_flow.h"
#include "snippet_match_nvgre.h"
void
snippet_init_nvgre(void)
{
flow_attr.ingress = 1;
flow_attr.group = 1;
}
void
snippet_match_nvgre_create_actions(uint16_t port_id,
struct rte_flow_action *action)
{
create_jump_flow(port_id, 1, &error);
if (queue == NULL)
fprintf(stderr, "Failed to allocate memory for queue\n");
}
void
snippet_match_nvgre_create_patterns(
struct rte_flow_item *pattern)
{
if (nvgre == NULL)
fprintf(stderr, "Failed to allocate memory for nvgre\n");
if (udp == NULL)
fprintf(stderr, "Failed to allocate memory for udp\n");
if (nvgre_mask == NULL)
fprintf(stderr, "Failed to allocate memory for nvgre_mask\n");
if (udp_mask == NULL)
fprintf(stderr, "Failed to allocate memory for udp_mask\n");
nvgre_mask->
tni[0] = 0xff;
nvgre_mask->
tni[1] = 0xff;
nvgre_mask->
tni[2] = 0xff;
pattern[2].
mask = nvgre_mask;
pattern[5].
mask = udp_mask;
}
static struct rte_flow_pattern_template *
snippet_match_nvgre_create_pattern_template(uint16_t port_id,
struct rte_flow_error *error)
{
.
tni = {0xff, 0xff, 0xff},
.flow_id = 0xff,
};
};
pattern[2].
mask = &nvgre_mask;
pattern[5].
mask = &udp_mask;
.ingress = 1,
};
}
static struct rte_flow_actions_template *
snippet_match_nvgre_create_actions_template(uint16_t port_id,
struct rte_flow_error *error)
{
};
};
{
.conf = &queue_v,
},
{
},
};
{
.conf = &queue_m,
},
{
},
};
};
}
struct rte_flow_template_table *
snippet_match_nvgre_create_table(uint16_t port_id,
struct rte_flow_error *error)
{
struct rte_flow_pattern_template *pt;
struct rte_flow_actions_template *at;
.priority = 0,
.ingress = 1,
},
.nb_flows = 1,
};
pt = snippet_match_nvgre_create_pattern_template(port_id, error);
if (pt == NULL) {
printf("Failed to create pattern template: %s (%s)\n",
return NULL;
}
at = snippet_match_nvgre_create_actions_template(port_id, error);
if (at == NULL) {
printf("Failed to create actions template: %s (%s)\n",
return NULL;
}
}