net: add rte prefix to arp structures
[dpdk.git] / test / test / test_link_bonding.c
index 8400cb2..db437a9 100644 (file)
 
 #define TEST_MAX_NUMBER_OF_PORTS (6)
 
-#define RX_RING_SIZE 128
+#define RX_RING_SIZE 1024
 #define RX_FREE_THRESH 32
 #define RX_PTHRESH 8
 #define RX_HTHRESH 8
 #define RX_WTHRESH 0
 
-#define TX_RING_SIZE 512
+#define TX_RING_SIZE 1024
 #define TX_FREE_THRESH 32
 #define TX_PTHRESH 32
 #define TX_HTHRESH 0
 #define TX_WTHRESH 0
 #define TX_RSBIT_THRESH 32
-#define TX_Q_FLAGS (ETH_TXQ_FLAGS_NOMULTSEGS | ETH_TXQ_FLAGS_NOVLANOFFL |\
-       ETH_TXQ_FLAGS_NOXSUMSCTP | ETH_TXQ_FLAGS_NOXSUMUDP | \
-       ETH_TXQ_FLAGS_NOXSUMTCP)
 
 #define MBUF_CACHE_SIZE (250)
 #define BURST_SIZE (32)
@@ -135,35 +132,11 @@ static uint16_t dst_port_1 = 2024;
 
 static uint16_t vlan_id = 0x100;
 
-struct rte_eth_rxmode rx_mode = {
-       .max_rx_pkt_len = ETHER_MAX_LEN, /**< Default maximum frame length. */
-       .split_hdr_size = 0,
-       .header_split   = 0, /**< Header Split disabled. */
-       .hw_ip_checksum = 0, /**< IP checksum offload disabled. */
-       .hw_vlan_filter = 1, /**< VLAN filtering enabled. */
-       .hw_vlan_strip  = 1, /**< VLAN strip enabled. */
-       .hw_vlan_extend = 0, /**< Extended VLAN disabled. */
-       .jumbo_frame    = 0, /**< Jumbo Frame Support disabled. */
-       .hw_strip_crc   = 1, /**< CRC stripping by hardware enabled. */
-};
-
-struct rte_fdir_conf fdir_conf = {
-       .mode = RTE_FDIR_MODE_NONE,
-       .pballoc = RTE_FDIR_PBALLOC_64K,
-       .status = RTE_FDIR_REPORT_STATUS,
-       .drop_queue = 127,
-};
-
 static struct rte_eth_conf default_pmd_conf = {
        .rxmode = {
                .mq_mode = ETH_MQ_RX_NONE,
-               .max_rx_pkt_len = ETHER_MAX_LEN,
                .split_hdr_size = 0,
-               .header_split   = 0, /**< Header Split disabled */
-               .hw_ip_checksum = 0, /**< IP checksum offload enabled */
-               .hw_vlan_filter = 0, /**< VLAN filtering disabled */
-               .jumbo_frame    = 0, /**< Jumbo Frame Support disabled */
-               .hw_strip_crc   = 1, /**< CRC stripped by hardware */
+               .max_rx_pkt_len = ETHER_MAX_LEN,
        },
        .txmode = {
                .mq_mode = ETH_MQ_TX_NONE,
@@ -189,8 +162,6 @@ static struct rte_eth_txconf tx_conf_default = {
        },
        .tx_free_thresh = TX_FREE_THRESH,
        .tx_rs_thresh = TX_RSBIT_THRESH,
-       .txq_flags = TX_Q_FLAGS
-
 };
 
 static void free_virtualpmd_tx_queue(void);
@@ -4489,7 +4460,7 @@ test_alb_change_mac_in_reply_sent(void)
        struct rte_mbuf *pkts_sent[MAX_PKT_BURST];
 
        struct ether_hdr *eth_pkt;
-       struct arp_hdr *arp_pkt;
+       struct rte_arp_hdr *arp_pkt;
 
        int slave_idx, nb_pkts, pkt_idx;
        int retval = 0;
@@ -4524,7 +4495,7 @@ test_alb_change_mac_in_reply_sent(void)
        eth_pkt = rte_pktmbuf_mtod(pkt, struct ether_hdr *);
        initialize_eth_header(eth_pkt, &bond_mac, &client_mac, ETHER_TYPE_ARP, 0,
                        0);
-       arp_pkt = (struct arp_hdr *)((char *)eth_pkt + sizeof(struct ether_hdr));
+       arp_pkt = (struct rte_arp_hdr *)((char *)eth_pkt + sizeof(struct ether_hdr));
        initialize_arp_header(arp_pkt, &bond_mac, &client_mac, ip_host, ip_client1,
                        ARP_OP_REPLY);
        rte_eth_tx_burst(test_params->bonded_port_id, 0, &pkt, 1);
@@ -4534,7 +4505,7 @@ test_alb_change_mac_in_reply_sent(void)
        eth_pkt = rte_pktmbuf_mtod(pkt, struct ether_hdr *);
        initialize_eth_header(eth_pkt, &bond_mac, &client_mac, ETHER_TYPE_ARP, 0,
                        0);
-       arp_pkt = (struct arp_hdr *)((char *)eth_pkt + sizeof(struct ether_hdr));
+       arp_pkt = (struct rte_arp_hdr *)((char *)eth_pkt + sizeof(struct ether_hdr));
        initialize_arp_header(arp_pkt, &bond_mac, &client_mac, ip_host, ip_client2,
                        ARP_OP_REPLY);
        rte_eth_tx_burst(test_params->bonded_port_id, 0, &pkt, 1);
@@ -4544,7 +4515,7 @@ test_alb_change_mac_in_reply_sent(void)
        eth_pkt = rte_pktmbuf_mtod(pkt, struct ether_hdr *);
        initialize_eth_header(eth_pkt, &bond_mac, &client_mac, ETHER_TYPE_ARP, 0,
                        0);
-       arp_pkt = (struct arp_hdr *)((char *)eth_pkt + sizeof(struct ether_hdr));
+       arp_pkt = (struct rte_arp_hdr *)((char *)eth_pkt + sizeof(struct ether_hdr));
        initialize_arp_header(arp_pkt, &bond_mac, &client_mac, ip_host, ip_client3,
                        ARP_OP_REPLY);
        rte_eth_tx_burst(test_params->bonded_port_id, 0, &pkt, 1);
@@ -4554,7 +4525,7 @@ test_alb_change_mac_in_reply_sent(void)
        eth_pkt = rte_pktmbuf_mtod(pkt, struct ether_hdr *);
        initialize_eth_header(eth_pkt, &bond_mac, &client_mac, ETHER_TYPE_ARP, 0,
                        0);
-       arp_pkt = (struct arp_hdr *)((char *)eth_pkt + sizeof(struct ether_hdr));
+       arp_pkt = (struct rte_arp_hdr *)((char *)eth_pkt + sizeof(struct ether_hdr));
        initialize_arp_header(arp_pkt, &bond_mac, &client_mac, ip_host, ip_client4,
                        ARP_OP_REPLY);
        rte_eth_tx_burst(test_params->bonded_port_id, 0, &pkt, 1);
@@ -4575,7 +4546,7 @@ test_alb_change_mac_in_reply_sent(void)
 
                for (pkt_idx = 0; pkt_idx < nb_pkts; pkt_idx++) {
                        eth_pkt = rte_pktmbuf_mtod(pkts_sent[pkt_idx], struct ether_hdr *);
-                       arp_pkt = (struct arp_hdr *)((char *)eth_pkt + sizeof(struct ether_hdr));
+                       arp_pkt = (struct rte_arp_hdr *)((char *)eth_pkt + sizeof(struct ether_hdr));
 
                        if (slave_idx%2 == 0) {
                                if (!is_same_ether_addr(slave_mac1, &arp_pkt->arp_data.arp_sha)) {
@@ -4600,7 +4571,7 @@ static int
 test_alb_reply_from_client(void)
 {
        struct ether_hdr *eth_pkt;
-       struct arp_hdr *arp_pkt;
+       struct rte_arp_hdr *arp_pkt;
 
        struct rte_mbuf *pkt;
        struct rte_mbuf *pkts_sent[MAX_PKT_BURST];
@@ -4637,7 +4608,7 @@ test_alb_reply_from_client(void)
        eth_pkt = rte_pktmbuf_mtod(pkt, struct ether_hdr *);
        initialize_eth_header(eth_pkt, &bond_mac, &client_mac, ETHER_TYPE_ARP, 0,
                        0);
-       arp_pkt = (struct arp_hdr *)((char *)eth_pkt + sizeof(struct ether_hdr));
+       arp_pkt = (struct rte_arp_hdr *)((char *)eth_pkt + sizeof(struct ether_hdr));
        initialize_arp_header(arp_pkt, &client_mac, &bond_mac, ip_client1, ip_host,
                        ARP_OP_REPLY);
        virtual_ethdev_add_mbufs_to_rx_queue(test_params->slave_port_ids[0], &pkt,
@@ -4648,7 +4619,7 @@ test_alb_reply_from_client(void)
        eth_pkt = rte_pktmbuf_mtod(pkt, struct ether_hdr *);
        initialize_eth_header(eth_pkt, &bond_mac, &client_mac, ETHER_TYPE_ARP, 0,
                        0);
-       arp_pkt = (struct arp_hdr *)((char *)eth_pkt + sizeof(struct ether_hdr));
+       arp_pkt = (struct rte_arp_hdr *)((char *)eth_pkt + sizeof(struct ether_hdr));
        initialize_arp_header(arp_pkt, &client_mac, &bond_mac, ip_client2, ip_host,
                        ARP_OP_REPLY);
        virtual_ethdev_add_mbufs_to_rx_queue(test_params->slave_port_ids[0], &pkt,
@@ -4659,7 +4630,7 @@ test_alb_reply_from_client(void)
        eth_pkt = rte_pktmbuf_mtod(pkt, struct ether_hdr *);
        initialize_eth_header(eth_pkt, &bond_mac, &client_mac, ETHER_TYPE_ARP, 0,
                        0);
-       arp_pkt = (struct arp_hdr *)((char *)eth_pkt + sizeof(struct ether_hdr));
+       arp_pkt = (struct rte_arp_hdr *)((char *)eth_pkt + sizeof(struct ether_hdr));
        initialize_arp_header(arp_pkt, &client_mac, &bond_mac, ip_client3, ip_host,
                        ARP_OP_REPLY);
        virtual_ethdev_add_mbufs_to_rx_queue(test_params->slave_port_ids[0], &pkt,
@@ -4670,7 +4641,7 @@ test_alb_reply_from_client(void)
        eth_pkt = rte_pktmbuf_mtod(pkt, struct ether_hdr *);
        initialize_eth_header(eth_pkt, &bond_mac, &client_mac, ETHER_TYPE_ARP, 0,
                        0);
-       arp_pkt = (struct arp_hdr *)((char *)eth_pkt + sizeof(struct ether_hdr));
+       arp_pkt = (struct rte_arp_hdr *)((char *)eth_pkt + sizeof(struct ether_hdr));
        initialize_arp_header(arp_pkt, &client_mac, &bond_mac, ip_client4, ip_host,
                        ARP_OP_REPLY);
        virtual_ethdev_add_mbufs_to_rx_queue(test_params->slave_port_ids[0], &pkt,
@@ -4696,7 +4667,7 @@ test_alb_reply_from_client(void)
 
                for (pkt_idx = 0; pkt_idx < nb_pkts; pkt_idx++) {
                        eth_pkt = rte_pktmbuf_mtod(pkts_sent[pkt_idx], struct ether_hdr *);
-                       arp_pkt = (struct arp_hdr *)((char *)eth_pkt + sizeof(struct ether_hdr));
+                       arp_pkt = (struct rte_arp_hdr *)((char *)eth_pkt + sizeof(struct ether_hdr));
 
                        if (slave_idx%2 == 0) {
                                if (!is_same_ether_addr(slave_mac1, &arp_pkt->arp_data.arp_sha)) {
@@ -4728,7 +4699,7 @@ test_alb_receive_vlan_reply(void)
 {
        struct ether_hdr *eth_pkt;
        struct vlan_hdr *vlan_pkt;
-       struct arp_hdr *arp_pkt;
+       struct rte_arp_hdr *arp_pkt;
 
        struct rte_mbuf *pkt;
        struct rte_mbuf *pkts_sent[MAX_PKT_BURST];
@@ -4769,7 +4740,7 @@ test_alb_receive_vlan_reply(void)
        vlan_pkt = vlan_pkt+1;
        vlan_pkt->vlan_tci = rte_cpu_to_be_16(2);
        vlan_pkt->eth_proto = rte_cpu_to_be_16(ETHER_TYPE_ARP);
-       arp_pkt = (struct arp_hdr *)((char *)(vlan_pkt + 1));
+       arp_pkt = (struct rte_arp_hdr *)((char *)(vlan_pkt + 1));
        initialize_arp_header(arp_pkt, &client_mac, &bond_mac, ip_client1, ip_host,
                        ARP_OP_REPLY);
        virtual_ethdev_add_mbufs_to_rx_queue(test_params->slave_port_ids[0], &pkt,