]> git.droids-corp.org - dpdk.git/commitdiff
net: add rte prefix to arp defines
authorOlivier Matz <olivier.matz@6wind.com>
Tue, 23 Oct 2018 16:24:53 +0000 (18:24 +0200)
committerOlivier Matz <olivier.matz@6wind.com>
Tue, 23 Oct 2018 16:24:53 +0000 (18:24 +0200)
- rename ARP_HRD_ETHER as RTE_ARP_HRD_ETHER
- rename ARP_OP_REQUEST as RTE_ARP_OP_REQUEST
- rename ARP_OP_REPLY as RTE_ARP_OP_REPLY
- rename ARP_OP_REVREQUEST as RTE_ARP_OP_REVREQUEST
- rename ARP_OP_REVREPLY as RTE_ARP_OP_REVREPLY
- rename ARP_OP_INVREQUEST as RTE_ARP_OP_INVREQUEST
- rename ARP_OP_INVREPLY as RTE_ARP_OP_INVREPLY

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
app/test-pmd/icmpecho.c
drivers/net/bonding/rte_eth_bond_alb.c
drivers/net/bonding/rte_eth_bond_pmd.c
examples/bond/main.c
lib/librte_net/rte_arp.c
lib/librte_net/rte_arp.h
test/test/packet_burst_generator.c
test/test/test_link_bonding.c

index c461ef7f55303b2a71d32bd49a608288eb0721f6..9709ff95180ea4180daf0f8bc9be40efe32703aa 100644 (file)
@@ -39,17 +39,17 @@ static const char *
 arp_op_name(uint16_t arp_op)
 {
        switch (arp_op ) {
-       case ARP_OP_REQUEST:
+       case RTE_ARP_OP_REQUEST:
                return "ARP Request";
-       case ARP_OP_REPLY:
+       case RTE_ARP_OP_REPLY:
                return "ARP Reply";
-       case ARP_OP_REVREQUEST:
+       case RTE_ARP_OP_REVREQUEST:
                return "Reverse ARP Request";
-       case ARP_OP_REVREPLY:
+       case RTE_ARP_OP_REVREPLY:
                return "Reverse ARP Reply";
-       case ARP_OP_INVREQUEST:
+       case RTE_ARP_OP_INVREQUEST:
                return "Peer Identify Request";
-       case ARP_OP_INVREPLY:
+       case RTE_ARP_OP_INVREPLY:
                return "Peer Identify Reply";
        default:
                break;
@@ -359,7 +359,7 @@ reply_to_icmp_echo_rqsts(struct fwd_stream *fs)
                                       arp_op_name(arp_op));
                        }
                        if ((RTE_BE_TO_CPU_16(arp_h->arp_hrd) !=
-                            ARP_HRD_ETHER) ||
+                            RTE_ARP_HRD_ETHER) ||
                            (arp_pro != ETHER_TYPE_IPv4) ||
                            (arp_h->arp_hln != 6) ||
                            (arp_h->arp_pln != 4)
@@ -381,7 +381,7 @@ reply_to_icmp_echo_rqsts(struct fwd_stream *fs)
                                ipv4_addr_dump(" tip=", ip_addr);
                                printf("\n");
                        }
-                       if (arp_op != ARP_OP_REQUEST) {
+                       if (arp_op != RTE_ARP_OP_REQUEST) {
                                rte_pktmbuf_free(pkt);
                                continue;
                        }
@@ -396,7 +396,7 @@ reply_to_icmp_echo_rqsts(struct fwd_stream *fs)
                        ether_addr_copy(&ports[fs->tx_port].eth_addr,
                                        &eth_h->s_addr);
 
-                       arp_h->arp_op = rte_cpu_to_be_16(ARP_OP_REPLY);
+                       arp_h->arp_op = rte_cpu_to_be_16(RTE_ARP_OP_REPLY);
                        ether_addr_copy(&arp_h->arp_data.arp_tha, &eth_addr);
                        ether_addr_copy(&arp_h->arp_data.arp_sha, &arp_h->arp_data.arp_tha);
                        ether_addr_copy(&eth_h->s_addr, &arp_h->arp_data.arp_sha);
index 89a66d7e14734a4581869f5577a055d295533df7..6268bf73d78266d3155689551bd8a552b23e8447 100644 (file)
@@ -84,7 +84,7 @@ void bond_mode_alb_arp_recv(struct ether_hdr *eth_h, uint16_t offset,
        arp = (struct rte_arp_hdr *) ((char *) (eth_h + 1) + offset);
 
        /* ARP Requests are forwarded to the application with no changes */
-       if (arp->arp_op != rte_cpu_to_be_16(ARP_OP_REPLY))
+       if (arp->arp_op != rte_cpu_to_be_16(RTE_ARP_OP_REPLY))
                return;
 
        /* From now on, we analyze only ARP Reply packets */
@@ -150,7 +150,7 @@ bond_mode_alb_arp_xmit(struct ether_hdr *eth_h, uint16_t offset,
        client_info = &hash_table[hash_index];
 
        rte_spinlock_lock(&internals->mode6.lock);
-       if (arp->arp_op == rte_cpu_to_be_16(ARP_OP_REPLY)) {
+       if (arp->arp_op == rte_cpu_to_be_16(RTE_ARP_OP_REPLY)) {
                if (client_info->in_use) {
                        if (client_info->app_ip == arp->arp_data.arp_sip &&
                                client_info->cli_ip == arp->arp_data.arp_tip) {
@@ -220,11 +220,11 @@ bond_mode_alb_arp_upd(struct client_data *client_info,
        ether_addr_copy(&client_info->cli_mac, &arp_h->arp_data.arp_tha);
        arp_h->arp_data.arp_tip = client_info->cli_ip;
 
-       arp_h->arp_hrd = rte_cpu_to_be_16(ARP_HRD_ETHER);
+       arp_h->arp_hrd = rte_cpu_to_be_16(RTE_ARP_HRD_ETHER);
        arp_h->arp_pro = rte_cpu_to_be_16(ETHER_TYPE_IPv4);
        arp_h->arp_hln = ETHER_ADDR_LEN;
        arp_h->arp_pln = sizeof(uint32_t);
-       arp_h->arp_op = rte_cpu_to_be_16(ARP_OP_REPLY);
+       arp_h->arp_op = rte_cpu_to_be_16(RTE_ARP_OP_REPLY);
 
        slave_idx = client_info->slave_idx;
        rte_spinlock_unlock(&internals->mode6.lock);
index f8987e432956b050ad2c4d9a098495fee91fc708..77a2f4143a6642d9f6410a700e9cda36a4437e08 100644 (file)
@@ -488,25 +488,25 @@ static void
 arp_op_name(uint16_t arp_op, char *buf)
 {
        switch (arp_op) {
-       case ARP_OP_REQUEST:
+       case RTE_ARP_OP_REQUEST:
                snprintf(buf, sizeof("ARP Request"), "%s", "ARP Request");
                return;
-       case ARP_OP_REPLY:
+       case RTE_ARP_OP_REPLY:
                snprintf(buf, sizeof("ARP Reply"), "%s", "ARP Reply");
                return;
-       case ARP_OP_REVREQUEST:
+       case RTE_ARP_OP_REVREQUEST:
                snprintf(buf, sizeof("Reverse ARP Request"), "%s",
                                "Reverse ARP Request");
                return;
-       case ARP_OP_REVREPLY:
+       case RTE_ARP_OP_REVREPLY:
                snprintf(buf, sizeof("Reverse ARP Reply"), "%s",
                                "Reverse ARP Reply");
                return;
-       case ARP_OP_INVREQUEST:
+       case RTE_ARP_OP_INVREQUEST:
                snprintf(buf, sizeof("Peer Identify Request"), "%s",
                                "Peer Identify Request");
                return;
-       case ARP_OP_INVREPLY:
+       case RTE_ARP_OP_INVREPLY:
                snprintf(buf, sizeof("Peer Identify Reply"), "%s",
                                "Peer Identify Reply");
                return;
index e3e7e5824ffc549bf6cd76bfa0e3e37ae3212084..ae2d0971b75244826deeeb1eb75a59acfddcc7b8 100644 (file)
@@ -369,8 +369,8 @@ static int lcore_main(__attribute__((unused)) void *arg1)
                                }
                                arp_hdr = (struct rte_arp_hdr *)((char *)(eth_hdr + 1) + offset);
                                if (arp_hdr->arp_data.arp_tip == bond_ip) {
-                                       if (arp_hdr->arp_op == rte_cpu_to_be_16(ARP_OP_REQUEST)) {
-                                               arp_hdr->arp_op = rte_cpu_to_be_16(ARP_OP_REPLY);
+                                       if (arp_hdr->arp_op == rte_cpu_to_be_16(RTE_ARP_OP_REQUEST)) {
+                                               arp_hdr->arp_op = rte_cpu_to_be_16(RTE_ARP_OP_REPLY);
                                                /* Switch src and dst data and set bonding MAC */
                                                ether_addr_copy(&eth_hdr->s_addr, &eth_hdr->d_addr);
                                                rte_eth_macaddr_get(BOND_PORT, &eth_hdr->s_addr);
@@ -464,11 +464,11 @@ static void cmd_obj_send_parsed(void *parsed_result,
        eth_hdr->ether_type = rte_cpu_to_be_16(ETHER_TYPE_ARP);
 
        arp_hdr = (struct rte_arp_hdr *)((char *)eth_hdr + sizeof(struct ether_hdr));
-       arp_hdr->arp_hrd = rte_cpu_to_be_16(ARP_HRD_ETHER);
+       arp_hdr->arp_hrd = rte_cpu_to_be_16(RTE_ARP_HRD_ETHER);
        arp_hdr->arp_pro = rte_cpu_to_be_16(ETHER_TYPE_IPv4);
        arp_hdr->arp_hln = ETHER_ADDR_LEN;
        arp_hdr->arp_pln = sizeof(uint32_t);
-       arp_hdr->arp_op = rte_cpu_to_be_16(ARP_OP_REQUEST);
+       arp_hdr->arp_op = rte_cpu_to_be_16(RTE_ARP_OP_REQUEST);
 
        rte_eth_macaddr_get(BOND_PORT, &arp_hdr->arp_data.arp_sha);
        arp_hdr->arp_data.arp_sip = bond_ip;
index e09428da9ee0062a8d923c51f8670eebda44ecc0..6d39bd15f226b1ddaec4d7caa9fb442f8d2e5f3f 100644 (file)
@@ -35,11 +35,11 @@ rte_net_make_rarp_packet(struct rte_mempool *mpool,
 
        /* RARP header. */
        rarp = (struct rte_arp_hdr *)(eth_hdr + 1);
-       rarp->arp_hrd = htons(ARP_HRD_ETHER);
+       rarp->arp_hrd = htons(RTE_ARP_HRD_ETHER);
        rarp->arp_pro = htons(ETHER_TYPE_IPv4);
        rarp->arp_hln = ETHER_ADDR_LEN;
        rarp->arp_pln = 4;
-       rarp->arp_op  = htons(ARP_OP_REVREQUEST);
+       rarp->arp_op  = htons(RTE_ARP_OP_REVREQUEST);
 
        ether_addr_copy(mac, &rarp->arp_data.arp_sha);
        ether_addr_copy(mac, &rarp->arp_data.arp_tha);
index cf187d778e9dff37a69ed4241d7cf2a2cf71e23f..d4907bc63e40c110f9210440c9dcffa15b3482a2 100644 (file)
@@ -33,18 +33,18 @@ struct rte_arp_ipv4 {
  */
 struct rte_arp_hdr {
        uint16_t arp_hrd;    /* format of hardware address */
-#define ARP_HRD_ETHER     1  /* ARP Ethernet address format */
+#define RTE_ARP_HRD_ETHER     1  /* ARP Ethernet address format */
 
        uint16_t arp_pro;    /* format of protocol address */
        uint8_t  arp_hln;    /* length of hardware address */
        uint8_t  arp_pln;    /* length of protocol address */
        uint16_t arp_op;     /* ARP opcode (command) */
-#define        ARP_OP_REQUEST    1 /* request to resolve address */
-#define        ARP_OP_REPLY      2 /* response to previous request */
-#define        ARP_OP_REVREQUEST 3 /* request proto addr given hardware */
-#define        ARP_OP_REVREPLY   4 /* response giving protocol address */
-#define        ARP_OP_INVREQUEST 8 /* request to identify peer */
-#define        ARP_OP_INVREPLY   9 /* response identifying peer */
+#define        RTE_ARP_OP_REQUEST    1 /* request to resolve address */
+#define        RTE_ARP_OP_REPLY      2 /* response to previous request */
+#define        RTE_ARP_OP_REVREQUEST 3 /* request proto addr given hardware */
+#define        RTE_ARP_OP_REVREPLY   4 /* response giving protocol address */
+#define        RTE_ARP_OP_INVREQUEST 8 /* request to identify peer */
+#define        RTE_ARP_OP_INVREPLY   9 /* response identifying peer */
 
        struct rte_arp_ipv4 arp_data;
 } __attribute__((__packed__));
index cbc68f20e30bf8a73a3ce6d89e94159b34f8fcb2..a8e78139a072a444feb44ccc72fe145c61c186c0 100644 (file)
@@ -78,7 +78,7 @@ initialize_arp_header(struct rte_arp_hdr *arp_hdr, struct ether_addr *src_mac,
                struct ether_addr *dst_mac, uint32_t src_ip, uint32_t dst_ip,
                uint32_t opcode)
 {
-       arp_hdr->arp_hrd = rte_cpu_to_be_16(ARP_HRD_ETHER);
+       arp_hdr->arp_hrd = rte_cpu_to_be_16(RTE_ARP_HRD_ETHER);
        arp_hdr->arp_pro = rte_cpu_to_be_16(ETHER_TYPE_IPv4);
        arp_hdr->arp_hln = ETHER_ADDR_LEN;
        arp_hdr->arp_pln = sizeof(uint32_t);
index db437a9c2c50a54c949daa5888c3b404fa70ada5..2c20f44ead0e1ffdf362a47f50e86dc81515e316 100644 (file)
@@ -4497,7 +4497,7 @@ test_alb_change_mac_in_reply_sent(void)
                        0);
        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_ARP_OP_REPLY);
        rte_eth_tx_burst(test_params->bonded_port_id, 0, &pkt, 1);
 
        pkt = rte_pktmbuf_alloc(test_params->mbuf_pool);
@@ -4507,7 +4507,7 @@ test_alb_change_mac_in_reply_sent(void)
                        0);
        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_ARP_OP_REPLY);
        rte_eth_tx_burst(test_params->bonded_port_id, 0, &pkt, 1);
 
        pkt = rte_pktmbuf_alloc(test_params->mbuf_pool);
@@ -4517,7 +4517,7 @@ test_alb_change_mac_in_reply_sent(void)
                        0);
        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_ARP_OP_REPLY);
        rte_eth_tx_burst(test_params->bonded_port_id, 0, &pkt, 1);
 
        pkt = rte_pktmbuf_alloc(test_params->mbuf_pool);
@@ -4527,7 +4527,7 @@ test_alb_change_mac_in_reply_sent(void)
                        0);
        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_ARP_OP_REPLY);
        rte_eth_tx_burst(test_params->bonded_port_id, 0, &pkt, 1);
 
        slave_mac1 =
@@ -4610,7 +4610,7 @@ test_alb_reply_from_client(void)
                        0);
        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);
+                       RTE_ARP_OP_REPLY);
        virtual_ethdev_add_mbufs_to_rx_queue(test_params->slave_port_ids[0], &pkt,
                        1);
 
@@ -4621,7 +4621,7 @@ test_alb_reply_from_client(void)
                        0);
        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);
+                       RTE_ARP_OP_REPLY);
        virtual_ethdev_add_mbufs_to_rx_queue(test_params->slave_port_ids[0], &pkt,
                        1);
 
@@ -4632,7 +4632,7 @@ test_alb_reply_from_client(void)
                        0);
        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);
+                       RTE_ARP_OP_REPLY);
        virtual_ethdev_add_mbufs_to_rx_queue(test_params->slave_port_ids[0], &pkt,
                        1);
 
@@ -4643,7 +4643,7 @@ test_alb_reply_from_client(void)
                        0);
        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);
+                       RTE_ARP_OP_REPLY);
        virtual_ethdev_add_mbufs_to_rx_queue(test_params->slave_port_ids[0], &pkt,
                        1);
 
@@ -4742,7 +4742,7 @@ test_alb_receive_vlan_reply(void)
        vlan_pkt->eth_proto = rte_cpu_to_be_16(ETHER_TYPE_ARP);
        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);
+                       RTE_ARP_OP_REPLY);
        virtual_ethdev_add_mbufs_to_rx_queue(test_params->slave_port_ids[0], &pkt,
                        1);