summaryrefslogtreecommitdiffstats
path: root/src/debug.h
blob: 5af4eba17d3b61e961a36f20d3e2bb06037c64f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
Copyright (c) 2016-2016 Cisco Systems, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

#ifndef _TREX_DEBUG_H
#define _TREX_DEBUG_H
#include "mbuf.h"

class CTrexDebug {
    rte_mbuf_t *m_test;
    uint64_t m_test_drop;
    CPhyEthIF *m_ports;
    uint32_t m_max_ports;
    uint32_t m_rx_q_num;

    int rcv_send(int port,int queue_id);
    int rcv_send_all(int queue_id);
    rte_mbuf_t *create_pkt(uint8_t *pkt,int pkt_size);
    rte_mbuf_t *create_pkt_indirect(rte_mbuf_t *m, uint32_t new_pkt_size);
    rte_mbuf_t *create_udp_pkt();
    rte_mbuf_t *create_udp_9k_pkt();
    int  set_promisc_all(bool enable);
    int test_send_pkts(rte_mbuf_t *, uint16_t queue_id, int pkt, int port);
    rte_mbuf_t *create_test_pkt(int ip_ver, uint16_t l4_proto, uint8_t ttl, uint32_t ip_id, uint16_t flags);
    int verify_hw_rules(bool recv_all);

 public:
    CTrexDebug(CPhyEthIF *m_ports_arg, int max_ports, uint32_t rx_q_num);
    int test_send(uint pkt_type);
};

#endif