Support packets in flight
[samplevnf.git] / VNFs / DPPD-PROX / handle_cgnat.c
index cc1eae2..9ce63b2 100644 (file)
@@ -310,7 +310,7 @@ static int add_new_port_entry(struct task_nat *task, uint8_t proto, int public_i
 static int handle_nat_bulk(struct task_base *tbase, struct rte_mbuf **mbufs, uint16_t n_pkts)
 {
        struct task_nat *task = (struct task_nat *)tbase;
-       uint8_t out[MAX_PKT_BURST];
+       uint8_t out[MAX_PKT_BURST] = {0};
        uint16_t j;
        uint32_t *ip_addr, public_ip, private_ip;
        uint16_t *udp_src_port, port, private_port, public_port;
@@ -797,6 +797,7 @@ static int lua_to_hash_nat(struct task_args *targ, struct lua_State *L, enum lua
                .key_len = sizeof(struct private_key),
                .hash_func = rte_hash_crc,
                .hash_func_init_val = 0,
+               .socket_id = socket,
        };
        plogx_info("hash table name = %s\n", hash_params.name);
        struct private_key private_key;
@@ -964,7 +965,7 @@ static void init_task_nat(struct task_base *tbase, struct task_args *targ)
 
        struct prox_port_cfg *port = find_reachable_port(targ);
        if (port) {
-               task->offload_crc = port->requested_tx_offload & (DEV_TX_OFFLOAD_IPV4_CKSUM | DEV_TX_OFFLOAD_UDP_CKSUM);
+               task->offload_crc = port->requested_tx_offload & (RTE_ETH_TX_OFFLOAD_IPV4_CKSUM | RTE_ETH_TX_OFFLOAD_UDP_CKSUM);
        }
 }