#include <rte_esp.h>
#include <rte_tcp.h>
#include <rte_udp.h>
+#include <rte_vxlan.h>
#include <rte_cryptodev.h>
#include <rte_cryptodev_pmd.h>
{
struct dscp_table_entry_data *dscp_entry = &dscp_table->entry[dscp];
uint32_t queue_id = data->queue_id |
- (dscp_entry->tc << 2) |
dscp_entry->tc_queue;
rte_mbuf_sched_set(mbuf, queue_id, dscp_entry->tc,
(uint8_t)dscp_entry->color);
struct encap_ether_data {
struct rte_ether_hdr ether;
-} __attribute__((__packed__));
+};
#define VLAN(pcp, dei, vid) \
((uint16_t)((((uint64_t)(pcp)) & 0x7LLU) << 13) | \
struct encap_vlan_data {
struct rte_ether_hdr ether;
struct rte_vlan_hdr vlan;
-} __attribute__((__packed__));
+};
struct encap_qinq_data {
struct rte_ether_hdr ether;
struct rte_vlan_hdr svlan;
struct rte_vlan_hdr cvlan;
-} __attribute__((__packed__));
+};
#define ETHER_TYPE_MPLS_UNICAST 0x8847
struct rte_ether_hdr ether;
uint32_t mpls[RTE_TABLE_ACTION_MPLS_LABELS_MAX];
uint32_t mpls_count;
-} __attribute__((__packed__));
+} __attribute__((__packed__)) __rte_aligned(2);
#define PPP_PROTOCOL_IP 0x0021
uint16_t session_id;
uint16_t length;
uint16_t protocol;
-} __attribute__((__packed__));
+};
struct encap_pppoe_data {
struct rte_ether_hdr ether;
struct pppoe_ppp_hdr pppoe_ppp;
-} __attribute__((__packed__));
+};
#define IP_PROTO_UDP 17
struct rte_ipv4_hdr ipv4;
struct rte_udp_hdr udp;
struct rte_vxlan_hdr vxlan;
-} __attribute__((__packed__));
+} __attribute__((__packed__)) __rte_aligned(2);
struct encap_vxlan_ipv4_vlan_data {
struct rte_ether_hdr ether;
struct rte_ipv4_hdr ipv4;
struct rte_udp_hdr udp;
struct rte_vxlan_hdr vxlan;
-} __attribute__((__packed__));
+} __attribute__((__packed__)) __rte_aligned(2);
struct encap_vxlan_ipv6_data {
struct rte_ether_hdr ether;
struct rte_ipv6_hdr ipv6;
struct rte_udp_hdr udp;
struct rte_vxlan_hdr vxlan;
-} __attribute__((__packed__));
+} __attribute__((__packed__)) __rte_aligned(2);
struct encap_vxlan_ipv6_vlan_data {
struct rte_ether_hdr ether;
struct rte_ipv6_hdr ipv6;
struct rte_udp_hdr udp;
struct rte_vxlan_hdr vxlan;
-} __attribute__((__packed__));
+} __attribute__((__packed__)) __rte_aligned(2);
struct encap_qinq_pppoe_data {
struct rte_ether_hdr ether;
struct rte_vlan_hdr svlan;
struct rte_vlan_hdr cvlan;
struct pppoe_ppp_hdr pppoe_ppp;
-} __attribute__((__packed__));
+} __attribute__((__packed__)) __rte_aligned(2);
static size_t
encap_data_size(struct rte_table_action_encap_config *encap)
{
struct encap_ether_data *d = data;
uint16_t ethertype = (common_cfg->ip_version) ?
- RTE_ETHER_TYPE_IPv4 :
- RTE_ETHER_TYPE_IPv6;
+ RTE_ETHER_TYPE_IPV4 :
+ RTE_ETHER_TYPE_IPV6;
/* Ethernet */
rte_ether_addr_copy(&p->ether.ether.da, &d->ether.d_addr);
{
struct encap_vlan_data *d = data;
uint16_t ethertype = (common_cfg->ip_version) ?
- RTE_ETHER_TYPE_IPv4 :
- RTE_ETHER_TYPE_IPv6;
+ RTE_ETHER_TYPE_IPV4 :
+ RTE_ETHER_TYPE_IPV6;
/* Ethernet */
rte_ether_addr_copy(&p->vlan.ether.da, &d->ether.d_addr);
{
struct encap_qinq_data *d = data;
uint16_t ethertype = (common_cfg->ip_version) ?
- RTE_ETHER_TYPE_IPv4 :
- RTE_ETHER_TYPE_IPv6;
+ RTE_ETHER_TYPE_IPV4 :
+ RTE_ETHER_TYPE_IPV6;
/* Ethernet */
rte_ether_addr_copy(&p->qinq.ether.da, &d->ether.d_addr);
d->cvlan.vlan_tci = rte_htons(VLAN(p->qinq.cvlan.pcp,
p->qinq.cvlan.dei,
p->qinq.cvlan.vid));
- d->cvlan.eth_proto = rte_htons(ETHER_TYPE_PPPOE_SESSION);
+ d->cvlan.eth_proto = rte_htons(RTE_ETHER_TYPE_PPPOE_SESSION);
/* PPPoE and PPP*/
d->pppoe_ppp.ver_type_code = rte_htons(0x1100);
/* Ethernet */
rte_ether_addr_copy(&p->pppoe.ether.da, &d->ether.d_addr);
rte_ether_addr_copy(&p->pppoe.ether.sa, &d->ether.s_addr);
- d->ether.ether_type = rte_htons(ETHER_TYPE_PPPOE_SESSION);
+ d->ether.ether_type = rte_htons(RTE_ETHER_TYPE_PPPOE_SESSION);
/* PPPoE and PPP*/
d->pppoe_ppp.ver_type_code = rte_htons(0x1100);
d->vlan.vlan_tci = rte_htons(VLAN(p->vxlan.vlan.pcp,
p->vxlan.vlan.dei,
p->vxlan.vlan.vid));
- d->vlan.eth_proto = rte_htons(RTE_ETHER_TYPE_IPv4);
+ d->vlan.eth_proto = rte_htons(RTE_ETHER_TYPE_IPV4);
/* IPv4*/
d->ipv4.version_ihl = 0x45;
&d->ether.d_addr);
rte_ether_addr_copy(&p->vxlan.ether.sa,
&d->ether.s_addr);
- d->ether.ether_type = rte_htons(RTE_ETHER_TYPE_IPv4);
+ d->ether.ether_type = rte_htons(RTE_ETHER_TYPE_IPV4);
/* IPv4*/
d->ipv4.version_ihl = 0x45;
d->vlan.vlan_tci = rte_htons(VLAN(p->vxlan.vlan.pcp,
p->vxlan.vlan.dei,
p->vxlan.vlan.vid));
- d->vlan.eth_proto = rte_htons(RTE_ETHER_TYPE_IPv6);
+ d->vlan.eth_proto = rte_htons(RTE_ETHER_TYPE_IPV6);
/* IPv6*/
d->ipv6.vtc_flow = rte_htonl((6 << 28) |
&d->ether.d_addr);
rte_ether_addr_copy(&p->vxlan.ether.sa,
&d->ether.s_addr);
- d->ether.ether_type = rte_htons(RTE_ETHER_TYPE_IPv6);
+ d->ether.ether_type = rte_htons(RTE_ETHER_TYPE_IPV6);
/* IPv6*/
d->ipv6.vtc_flow = rte_htonl((6 << 28) |