static struct rte_flow_item_eth eth_spec;
static struct rte_flow_item_eth eth_mask;
- memset(ð_spec, 0, sizeof(struct rte_flow_item_eth));
- memset(ð_mask, 0, sizeof(struct rte_flow_item_eth));
-
items[items_counter].type = RTE_FLOW_ITEM_TYPE_ETH;
items[items_counter].spec = ð_spec;
items[items_counter].mask = ð_mask;
uint8_t items_counter,
__rte_unused struct additional_para para)
{
- static struct rte_flow_item_vlan vlan_spec;
- static struct rte_flow_item_vlan vlan_mask;
-
- uint16_t vlan_value = VLAN_VALUE;
-
- memset(&vlan_spec, 0, sizeof(struct rte_flow_item_vlan));
- memset(&vlan_mask, 0, sizeof(struct rte_flow_item_vlan));
-
- vlan_spec.tci = RTE_BE16(vlan_value);
- vlan_mask.tci = RTE_BE16(0xffff);
+ static struct rte_flow_item_vlan vlan_spec = {
+ .tci = RTE_BE16(VLAN_VALUE),
+ };
+ static struct rte_flow_item_vlan vlan_mask = {
+ .tci = RTE_BE16(0xffff),
+ };
items[items_counter].type = RTE_FLOW_ITEM_TYPE_VLAN;
items[items_counter].spec = &vlan_spec;
static struct rte_flow_item_ipv4 ipv4_masks[RTE_MAX_LCORE] __rte_cache_aligned;
uint8_t ti = para.core_idx;
- memset(&ipv4_specs[ti], 0, sizeof(struct rte_flow_item_ipv4));
- memset(&ipv4_masks[ti], 0, sizeof(struct rte_flow_item_ipv4));
-
ipv4_specs[ti].hdr.src_addr = RTE_BE32(para.src_ip);
ipv4_masks[ti].hdr.src_addr = RTE_BE32(0xffffffff);
static struct rte_flow_item_ipv6 ipv6_masks[RTE_MAX_LCORE] __rte_cache_aligned;
uint8_t ti = para.core_idx;
- memset(&ipv6_specs[ti], 0, sizeof(struct rte_flow_item_ipv6));
- memset(&ipv6_masks[ti], 0, sizeof(struct rte_flow_item_ipv6));
-
/** Set ipv6 src **/
memset(&ipv6_specs[ti].hdr.src_addr, para.src_ip,
sizeof(ipv6_specs->hdr.src_addr) / 2);
static struct rte_flow_item_tcp tcp_spec;
static struct rte_flow_item_tcp tcp_mask;
- memset(&tcp_spec, 0, sizeof(struct rte_flow_item_tcp));
- memset(&tcp_mask, 0, sizeof(struct rte_flow_item_tcp));
-
items[items_counter].type = RTE_FLOW_ITEM_TYPE_TCP;
items[items_counter].spec = &tcp_spec;
items[items_counter].mask = &tcp_mask;
static struct rte_flow_item_udp udp_spec;
static struct rte_flow_item_udp udp_mask;
- memset(&udp_spec, 0, sizeof(struct rte_flow_item_udp));
- memset(&udp_mask, 0, sizeof(struct rte_flow_item_udp));
-
items[items_counter].type = RTE_FLOW_ITEM_TYPE_UDP;
items[items_counter].spec = &udp_spec;
items[items_counter].mask = &udp_mask;
vni_value = VNI_VALUE;
- memset(&vxlan_specs[ti], 0, sizeof(struct rte_flow_item_vxlan));
- memset(&vxlan_masks[ti], 0, sizeof(struct rte_flow_item_vxlan));
-
/* Set standard vxlan vni */
for (i = 0; i < 3; i++) {
vxlan_specs[ti].vni[2 - i] = vni_value >> (i * 8);
vni_value = VNI_VALUE;
- memset(&vxlan_gpe_specs[ti], 0, sizeof(struct rte_flow_item_vxlan_gpe));
- memset(&vxlan_gpe_masks[ti], 0, sizeof(struct rte_flow_item_vxlan_gpe));
-
/* Set vxlan-gpe vni */
for (i = 0; i < 3; i++) {
vxlan_gpe_specs[ti].vni[2 - i] = vni_value >> (i * 8);
uint8_t items_counter,
__rte_unused struct additional_para para)
{
- static struct rte_flow_item_gre gre_spec;
- static struct rte_flow_item_gre gre_mask;
-
- uint16_t proto;
-
- proto = RTE_ETHER_TYPE_TEB;
-
- memset(&gre_spec, 0, sizeof(struct rte_flow_item_gre));
- memset(&gre_mask, 0, sizeof(struct rte_flow_item_gre));
-
- gre_spec.protocol = RTE_BE16(proto);
- gre_mask.protocol = RTE_BE16(0xffff);
+ static struct rte_flow_item_gre gre_spec = {
+ .protocol = RTE_BE16(RTE_ETHER_TYPE_TEB),
+ };
+ static struct rte_flow_item_gre gre_mask = {
+ .protocol = RTE_BE16(0xffff),
+ };
items[items_counter].type = RTE_FLOW_ITEM_TYPE_GRE;
items[items_counter].spec = &gre_spec;
vni_value = VNI_VALUE;
- memset(&geneve_specs[ti], 0, sizeof(struct rte_flow_item_geneve));
- memset(&geneve_masks[ti], 0, sizeof(struct rte_flow_item_geneve));
-
for (i = 0; i < 3; i++) {
geneve_specs[ti].vni[2 - i] = vni_value >> (i * 8);
geneve_masks[ti].vni[2 - i] = 0xff;
uint8_t items_counter,
__rte_unused struct additional_para para)
{
- static struct rte_flow_item_gtp gtp_spec;
- static struct rte_flow_item_gtp gtp_mask;
-
- uint32_t teid_value;
-
- teid_value = TEID_VALUE;
-
- memset(>p_spec, 0, sizeof(struct rte_flow_item_gtp));
- memset(>p_mask, 0, sizeof(struct rte_flow_item_gtp));
-
- gtp_spec.teid = RTE_BE32(teid_value);
- gtp_mask.teid = RTE_BE32(0xffffffff);
+ static struct rte_flow_item_gtp gtp_spec = {
+ .teid = RTE_BE32(TEID_VALUE),
+ };
+ static struct rte_flow_item_gtp gtp_mask = {
+ .teid = RTE_BE32(0xffffffff),
+ };
items[items_counter].type = RTE_FLOW_ITEM_TYPE_GTP;
items[items_counter].spec = >p_spec;
uint8_t items_counter,
__rte_unused struct additional_para para)
{
- static struct rte_flow_item_meta meta_spec;
- static struct rte_flow_item_meta meta_mask;
-
- uint32_t data;
-
- data = META_DATA;
-
- memset(&meta_spec, 0, sizeof(struct rte_flow_item_meta));
- memset(&meta_mask, 0, sizeof(struct rte_flow_item_meta));
-
- meta_spec.data = RTE_BE32(data);
- meta_mask.data = RTE_BE32(0xffffffff);
+ static struct rte_flow_item_meta meta_spec = {
+ .data = RTE_BE32(META_DATA),
+ };
+ static struct rte_flow_item_meta meta_mask = {
+ .data = RTE_BE32(0xffffffff),
+ };
items[items_counter].type = RTE_FLOW_ITEM_TYPE_META;
items[items_counter].spec = &meta_spec;
uint8_t items_counter,
__rte_unused struct additional_para para)
{
- static struct rte_flow_item_tag tag_spec;
- static struct rte_flow_item_tag tag_mask;
- uint32_t data;
- uint8_t index;
-
- data = META_DATA;
- index = TAG_INDEX;
-
- memset(&tag_spec, 0, sizeof(struct rte_flow_item_tag));
- memset(&tag_mask, 0, sizeof(struct rte_flow_item_tag));
-
- tag_spec.data = RTE_BE32(data);
- tag_mask.data = RTE_BE32(0xffffffff);
- tag_spec.index = index;
- tag_mask.index = 0xff;
+ static struct rte_flow_item_tag tag_spec = {
+ .data = RTE_BE32(META_DATA),
+ .index = TAG_INDEX,
+ };
+ static struct rte_flow_item_tag tag_mask = {
+ .data = RTE_BE32(0xffffffff),
+ .index = 0xff,
+ };
items[items_counter].type = RTE_FLOW_ITEM_TYPE_TAG;
items[items_counter].spec = &tag_spec;
static struct rte_flow_item_icmp icmpv4_spec;
static struct rte_flow_item_icmp icmpv4_mask;
- memset(&icmpv4_spec, 0, sizeof(struct rte_flow_item_icmp));
- memset(&icmpv4_mask, 0, sizeof(struct rte_flow_item_icmp));
-
items[items_counter].type = RTE_FLOW_ITEM_TYPE_ICMP;
items[items_counter].spec = &icmpv4_spec;
items[items_counter].mask = &icmpv4_mask;
static struct rte_flow_item_icmp6 icmpv6_spec;
static struct rte_flow_item_icmp6 icmpv6_mask;
- memset(&icmpv6_spec, 0, sizeof(struct rte_flow_item_icmp6));
- memset(&icmpv6_mask, 0, sizeof(struct rte_flow_item_icmp6));
-
items[items_counter].type = RTE_FLOW_ITEM_TYPE_ICMP6;
items[items_counter].spec = &icmpv6_spec;
items[items_counter].mask = &icmpv6_mask;