Support packets in flight
[samplevnf.git] / VNFs / DPPD-PROX / handle_master.c
index 169c7ca..58240ba 100644 (file)
@@ -73,6 +73,8 @@ const char *actions_string[] = {
 
 };
 
+int (*handle_ctrl_plane)(struct task_base *tbase, struct rte_mbuf **mbuf, uint16_t n_pkts) = NULL;
+
 static struct my_arp_t arp_reply = {
        .htype = 0x100,
        .ptype = 8,
@@ -259,7 +261,7 @@ static inline void handle_arp_request(struct task_base *tbase, struct rte_mbuf *
                plogx_dbg("\tMaster handling ARP request for ip "IPv4_BYTES_FMT" on port %d which supports random ip\n", IP4(key.ip), key.port);
                struct rte_ring *ring = task->internal_port_table[port].ring;
                create_mac(arp, &mac);
-               mbuf->ol_flags &= ~(PKT_TX_IP_CKSUM|PKT_TX_UDP_CKSUM);
+               mbuf->ol_flags &= ~(RTE_MBUF_F_TX_IP_CKSUM|RTE_MBUF_F_TX_UDP_CKSUM);
                build_arp_reply(ether_hdr, &mac, arp);
                tx_ring(tbase, ring, SEND_ARP_REPLY_FROM_MASTER, mbuf);
                return;
@@ -274,7 +276,7 @@ static inline void handle_arp_request(struct task_base *tbase, struct rte_mbuf *
                tx_drop(mbuf);
        } else {
                struct rte_ring *ring = task->internal_ip_table[ret].ring;
-               mbuf->ol_flags &= ~(PKT_TX_IP_CKSUM|PKT_TX_UDP_CKSUM);
+               mbuf->ol_flags &= ~(RTE_MBUF_F_TX_IP_CKSUM|RTE_MBUF_F_TX_UDP_CKSUM);
                build_arp_reply(ether_hdr, &task->internal_ip_table[ret].mac, arp);
                tx_ring(tbase, ring, SEND_ARP_REPLY_FROM_MASTER, mbuf);
        }
@@ -339,7 +341,7 @@ static inline void handle_unknown_ip(struct task_base *tbase, struct rte_mbuf *m
                return;
        }
        // We send an ARP request even if one was just sent (and not yet answered) by another task
-       mbuf->ol_flags &= ~(PKT_TX_IP_CKSUM|PKT_TX_UDP_CKSUM);
+       mbuf->ol_flags &= ~(RTE_MBUF_F_TX_IP_CKSUM|RTE_MBUF_F_TX_UDP_CKSUM);
        build_arp_request(mbuf, &task->internal_port_table[port].mac, ip_dst, ip_src, vlan);
        tx_ring(tbase, ring, SEND_ARP_REQUEST_FROM_MASTER, mbuf);
 }
@@ -368,7 +370,7 @@ static inline void build_icmp_reply_message(struct task_base *tbase, struct rte_
                tx_drop(mbuf);
        } else {
                struct rte_ring *ring = task->internal_ip_table[ret].ring;
-               mbuf->ol_flags &= ~(PKT_TX_IP_CKSUM|PKT_TX_UDP_CKSUM);
+               mbuf->ol_flags &= ~(RTE_MBUF_F_TX_IP_CKSUM|RTE_MBUF_F_TX_UDP_CKSUM);
                tx_ring(tbase, ring, SEND_ICMP_FROM_MASTER, mbuf);
        }
 }
@@ -907,6 +909,7 @@ void init_ctrl_plane(struct task_base *tbase)
                .entries = n_entries,
                .hash_func = rte_hash_crc,
                .hash_func_init_val = 0,
+               .socket_id = socket_id,
        };
        if (prox_cfg.flags & DSF_L3_ENABLED) {
                hash_params.key_len = sizeof(uint32_t);