diff options
author | Xavier Simonart <xavier.simonart@intel.com> | 2020-05-29 00:06:45 +0200 |
---|---|---|
committer | Xavier Simonart <xavier.simonart@intel.com> | 2020-05-29 23:51:04 +0200 |
commit | 33d5f47e781c6986232378b7f8cadd17ac8894fe (patch) | |
tree | 3d120cd0d22dfae25dd01a372b1ecfb49ee970e8 /VNFs/DPPD-PROX/tx_pkt.h | |
parent | 51fd77bfea70da57af93390e1992b16022e2c88f (diff) |
VLAN support with vdev devices + few other changes
- vdev devices now support VLAN.
- kernel tap device can be configured with a netmask (/24 was
always used in previous version).
- when sending a (fake) packet to the kernel, this packet will now
not be routed by the kernel (i.e. it will leave through the
interface configured by PROX). This might change in the futture
when PROX supports multiple VLANs per port. But today it prevents
ARP being sent on management interfaces.
- Log error in case kernel unable to send packet.
- Added support for comments (';') in lua sections.
- Prevent duplication of local_ipv4 - should now be configured in port section
local_ipv4 in core section still supported
Change-Id: I8f9a40fe6ad6f3013ff91b58b44627c7f34081e6
Signed-off-by: Xavier Simonart <xavier.simonart@intel.com>
Diffstat (limited to 'VNFs/DPPD-PROX/tx_pkt.h')
-rw-r--r-- | VNFs/DPPD-PROX/tx_pkt.h | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/VNFs/DPPD-PROX/tx_pkt.h b/VNFs/DPPD-PROX/tx_pkt.h index b54a2bef..0a71bcc3 100644 --- a/VNFs/DPPD-PROX/tx_pkt.h +++ b/VNFs/DPPD-PROX/tx_pkt.h @@ -26,10 +26,11 @@ struct task_base; struct prox_headroom { uint64_t command; + uint64_t data64; uint32_t ip; uint32_t prefix; uint32_t gateway_ip; - uint64_t data64; + uint16_t vlan; struct ipv6_addr ipv6_addr; } __attribute__((packed)); @@ -187,8 +188,20 @@ static inline struct ipv6_addr *ctrl_ring_get_ipv6_addr(struct rte_mbuf *mbuf) return &prox_headroom->ipv6_addr; } -int tx_ring_cti(struct task_base *tbase, struct rte_ring *ring, uint8_t command, struct rte_mbuf *mbuf, uint8_t core_id, uint8_t task_id, uint32_t ip); -void tx_ring_cti6(struct task_base *tbase, struct rte_ring *ring, uint8_t command, struct rte_mbuf *mbuf, uint8_t core_id, uint8_t task_id, struct ipv6_addr *ip); +static inline void ctrl_ring_set_vlan(struct rte_mbuf *mbuf, uint32_t udata16) +{ + struct prox_headroom *prox_headroom = (struct prox_headroom *)(rte_pktmbuf_mtod(mbuf, uint8_t*) - sizeof(struct prox_headroom)); + prox_headroom->vlan = udata16; +} + +static inline uint16_t ctrl_ring_get_vlan(struct rte_mbuf *mbuf) +{ + struct prox_headroom *prox_headroom = (struct prox_headroom *)(rte_pktmbuf_mtod(mbuf, uint8_t*) - sizeof(struct prox_headroom)); + return prox_headroom->vlan; +} + +int tx_ring_cti(struct task_base *tbase, struct rte_ring *ring, uint8_t command, struct rte_mbuf *mbuf, uint8_t core_id, uint8_t task_id, uint32_t ip, uint16_t vlan); +void tx_ring_cti6(struct task_base *tbase, struct rte_ring *ring, uint8_t command, struct rte_mbuf *mbuf, uint8_t core_id, uint8_t task_id, struct ipv6_addr *ip, uint16_t vlan); void tx_ring_ip(struct task_base *tbase, struct rte_ring *ring, uint8_t command, struct rte_mbuf *mbuf, uint32_t ip); void tx_ring_ip6(struct task_base *tbase, struct rte_ring *ring, uint8_t command, struct rte_mbuf *mbuf, struct ipv6_addr *ip); void tx_ring_ip6_data(struct task_base *tbase, struct rte_ring *ring, uint8_t command, struct rte_mbuf *mbuf, struct ipv6_addr *ip, uint64_t data); |