]> git.droids-corp.org - dpdk.git/commitdiff
net: add rte prefix to sctp structure
authorOlivier Matz <olivier.matz@6wind.com>
Mon, 18 Mar 2019 17:07:33 +0000 (18:07 +0100)
committerOlivier Matz <olivier.matz@6wind.com>
Mon, 18 Mar 2019 17:12:53 +0000 (18:12 +0100)
Add 'rte_' prefix to structures:
- rename struct sctp_hdr as struct rte_sctp_hdr.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
17 files changed:
app/test-pmd/csumonly.c
app/test/packet_burst_generator.c
app/test/packet_burst_generator.h
app/test/test_flow_classify.c
drivers/net/e1000/igb_rxtx.c
drivers/net/enic/enic_clsf.c
drivers/net/enic/enic_flow.c
drivers/net/i40e/i40e_fdir.c
drivers/net/i40e/i40e_rxtx.c
drivers/net/iavf/iavf_rxtx.c
drivers/net/ice/ice_rxtx.c
drivers/net/ixgbe/ixgbe_rxtx.c
examples/tep_termination/vxlan.c
lib/librte_ethdev/rte_flow.h
lib/librte_net/rte_net.c
lib/librte_net/rte_sctp.h
lib/librte_vhost/virtio_net.c

index c44d14ca55f82ca421c40e23e16942bddfef21b8..6438a394e832897e6cbb5842727371480a37b92d 100644 (file)
@@ -365,7 +365,7 @@ process_inner_cksums(void *l3_hdr, const struct testpmd_offload_info *info,
        struct rte_ipv4_hdr *ipv4_hdr = l3_hdr;
        struct udp_hdr *udp_hdr;
        struct tcp_hdr *tcp_hdr;
-       struct sctp_hdr *sctp_hdr;
+       struct rte_sctp_hdr *sctp_hdr;
        uint64_t ol_flags = 0;
        uint32_t max_pkt_len, tso_segsz = 0;
 
@@ -432,7 +432,7 @@ process_inner_cksums(void *l3_hdr, const struct testpmd_offload_info *info,
                if (info->gso_enable)
                        ol_flags |= PKT_TX_TCP_SEG;
        } else if (info->l4_proto == IPPROTO_SCTP) {
-               sctp_hdr = (struct sctp_hdr *)((char *)l3_hdr + info->l3_len);
+               sctp_hdr = (struct rte_sctp_hdr *)((char *)l3_hdr + info->l3_len);
                sctp_hdr->cksum = 0;
                /* sctp payload must be a multiple of 4 to be
                 * offloaded */
index 886b5f8ac43fcaa5e93c6bb7a086a500bd488841..9aa07e17657646752a0cb4f764544249e69d65e0 100644 (file)
@@ -121,7 +121,7 @@ initialize_tcp_header(struct tcp_hdr *tcp_hdr, uint16_t src_port,
 }
 
 uint16_t
-initialize_sctp_header(struct sctp_hdr *sctp_hdr, uint16_t src_port,
+initialize_sctp_header(struct rte_sctp_hdr *sctp_hdr, uint16_t src_port,
                uint16_t dst_port, uint16_t pkt_data_len)
 {
        uint16_t pkt_len;
@@ -394,7 +394,7 @@ nomore_mbuf:
                                break;
                        case IPPROTO_SCTP:
                                copy_buf_to_pkt(proto_hdr,
-                                       sizeof(struct sctp_hdr), pkt,
+                                       sizeof(struct rte_sctp_hdr), pkt,
                                        eth_hdr_size + sizeof(struct rte_ipv4_hdr));
                                break;
                        default:
@@ -416,7 +416,7 @@ nomore_mbuf:
                                break;
                        case IPPROTO_SCTP:
                                copy_buf_to_pkt(proto_hdr,
-                                       sizeof(struct sctp_hdr), pkt,
+                                       sizeof(struct rte_sctp_hdr), pkt,
                                        eth_hdr_size + sizeof(struct rte_ipv6_hdr));
                                break;
                        default:
index 93efee1f561ca0e462bec15146901dbc7de0a83b..98185c162389bcaa5e1c50648f5bc0dae9de474c 100644 (file)
@@ -42,7 +42,7 @@ initialize_tcp_header(struct tcp_hdr *tcp_hdr, uint16_t src_port,
                uint16_t dst_port, uint16_t pkt_data_len);
 
 uint16_t
-initialize_sctp_header(struct sctp_hdr *sctp_hdr, uint16_t src_port,
+initialize_sctp_header(struct rte_sctp_hdr *sctp_hdr, uint16_t src_port,
                uint16_t dst_port, uint16_t pkt_data_len);
 
 uint16_t
index ad6c481fe7675f329abfe6ebbe92d133c7f064d1..85228486d11afa3e1927aad1be6df501ee800fdc 100644 (file)
@@ -565,7 +565,7 @@ init_ipv4_sctp_traffic(struct rte_mempool *mp,
 {
        struct rte_ether_hdr pkt_eth_hdr;
        struct rte_ipv4_hdr pkt_ipv4_hdr;
-       struct sctp_hdr pkt_sctp_hdr;
+       struct rte_sctp_hdr pkt_sctp_hdr;
        uint32_t src_addr = IPV4_ADDR(11, 12, 13, 14);
        uint32_t dst_addr = IPV4_ADDR(15, 16, 17, 18);
        uint16_t src_port = 10;
index ee51eca975f9b9d0465c6cbd5770b50071f8f380..3bfddc651ff2445657dfd06746249324b769b64e 100644 (file)
@@ -299,7 +299,7 @@ igbe_set_xmit_ctx(struct igb_tx_queue* txq,
                case PKT_TX_SCTP_CKSUM:
                        type_tucmd_mlhl |= E1000_ADVTXD_TUCMD_L4T_SCTP |
                                E1000_ADVTXD_DTYP_CTXT | E1000_ADVTXD_DCMD_DEXT;
-                       mss_l4len_idx |= sizeof(struct sctp_hdr) << E1000_ADVTXD_L4LEN_SHIFT;
+                       mss_l4len_idx |= sizeof(struct rte_sctp_hdr) << E1000_ADVTXD_L4LEN_SHIFT;
                        break;
                default:
                        type_tucmd_mlhl |= E1000_ADVTXD_TUCMD_L4T_RSV |
index 6bdc5a09ab814e218a1b5665fc5d133caa2159ef..6c37e2ec5cc965a1277e490723e194447b77c69e 100644 (file)
@@ -153,7 +153,7 @@ copy_fltr_v2(struct filter_v2 *fltr, const struct rte_eth_fdir_input *input,
                enic_set_layer(gp, FILTER_GENERIC_1_TCP, FILTER_GENERIC_1_L4,
                               &tcp_mask, &tcp_val, sizeof(struct tcp_hdr));
        } else if (input->flow_type == RTE_ETH_FLOW_NONFRAG_IPV4_SCTP) {
-               struct sctp_hdr sctp_mask, sctp_val;
+               struct rte_sctp_hdr sctp_mask, sctp_val;
                memset(&sctp_mask, 0, sizeof(sctp_mask));
                memset(&sctp_val, 0, sizeof(sctp_val));
 
@@ -176,7 +176,7 @@ copy_fltr_v2(struct filter_v2 *fltr, const struct rte_eth_fdir_input *input,
                 * manually set proto_id=sctp below.
                 */
                enic_set_layer(gp, 0, FILTER_GENERIC_1_L4, &sctp_mask,
-                              &sctp_val, sizeof(struct sctp_hdr));
+                              &sctp_val, sizeof(struct rte_sctp_hdr));
        }
 
        if (input->flow_type == RTE_ETH_FLOW_NONFRAG_IPV4_UDP ||
@@ -247,7 +247,7 @@ copy_fltr_v2(struct filter_v2 *fltr, const struct rte_eth_fdir_input *input,
                enic_set_layer(gp, FILTER_GENERIC_1_TCP, FILTER_GENERIC_1_L4,
                               &tcp_mask, &tcp_val, sizeof(struct tcp_hdr));
        } else if (input->flow_type == RTE_ETH_FLOW_NONFRAG_IPV6_SCTP) {
-               struct sctp_hdr sctp_mask, sctp_val;
+               struct rte_sctp_hdr sctp_mask, sctp_val;
                memset(&sctp_mask, 0, sizeof(sctp_mask));
                memset(&sctp_val, 0, sizeof(sctp_val));
 
@@ -265,7 +265,7 @@ copy_fltr_v2(struct filter_v2 *fltr, const struct rte_eth_fdir_input *input,
                }
 
                enic_set_layer(gp, 0, FILTER_GENERIC_1_L4, &sctp_mask,
-                              &sctp_val, sizeof(struct sctp_hdr));
+                              &sctp_val, sizeof(struct rte_sctp_hdr));
        }
 
        if (input->flow_type == RTE_ETH_FLOW_NONFRAG_IPV6_UDP ||
index b1a9bcbdeb7bc0f94e88da6ff923af62796bc912..9dee5d2eeae4140de73297e37fc0257ed37c05d0 100644 (file)
@@ -895,9 +895,9 @@ enic_copy_item_sctp_v2(struct copy_item_args *arg)
                mask = &rte_flow_item_sctp_mask;
 
        memcpy(gp->layer[FILTER_GENERIC_1_L4].mask, &mask->hdr,
-              sizeof(struct sctp_hdr));
+              sizeof(struct rte_sctp_hdr));
        memcpy(gp->layer[FILTER_GENERIC_1_L4].val, &spec->hdr,
-              sizeof(struct sctp_hdr));
+              sizeof(struct rte_sctp_hdr));
        return 0;
 }
 
index b20f30fb40543259b043071ff0dae8218daa3c44..14a82426e17f477accb9572535d662da3aad8c0a 100644 (file)
@@ -801,7 +801,7 @@ i40e_fdir_construct_pkt(struct i40e_pf *pf,
        unsigned char *payload, *ptr;
        struct udp_hdr *udp;
        struct tcp_hdr *tcp;
-       struct sctp_hdr *sctp;
+       struct rte_sctp_hdr *sctp;
        uint8_t size, dst = 0;
        uint8_t i, pit_idx, set_idx = I40E_FLXPLD_L4_IDX; /* use l4 by default*/
        int len;
@@ -841,8 +841,8 @@ i40e_fdir_construct_pkt(struct i40e_pf *pf,
                break;
 
        case RTE_ETH_FLOW_NONFRAG_IPV4_SCTP:
-               sctp = (struct sctp_hdr *)(raw_pkt + len);
-               payload = (unsigned char *)sctp + sizeof(struct sctp_hdr);
+               sctp = (struct rte_sctp_hdr *)(raw_pkt + len);
+               payload = (unsigned char *)sctp + sizeof(struct rte_sctp_hdr);
                /*
                 * The source and destination fields in the transmitted packet
                 * need to be presented in a reversed order with respect
@@ -886,8 +886,8 @@ i40e_fdir_construct_pkt(struct i40e_pf *pf,
                break;
 
        case RTE_ETH_FLOW_NONFRAG_IPV6_SCTP:
-               sctp = (struct sctp_hdr *)(raw_pkt + len);
-               payload = (unsigned char *)sctp + sizeof(struct sctp_hdr);
+               sctp = (struct rte_sctp_hdr *)(raw_pkt + len);
+               payload = (unsigned char *)sctp + sizeof(struct rte_sctp_hdr);
                /*
                 * The source and destination fields in the transmitted packet
                 * need to be presented in a reversed order with respect
@@ -1091,7 +1091,7 @@ i40e_flow_fdir_construct_pkt(struct i40e_pf *pf,
        unsigned char *ptr;
        struct udp_hdr *udp;
        struct tcp_hdr *tcp;
-       struct sctp_hdr *sctp;
+       struct rte_sctp_hdr *sctp;
        struct rte_flow_item_gtp *gtp;
        struct rte_ipv4_hdr *gtp_ipv4;
        struct rte_ipv6_hdr *gtp_ipv6;
@@ -1138,8 +1138,8 @@ i40e_flow_fdir_construct_pkt(struct i40e_pf *pf,
                tcp->dst_port = fdir_input->flow.tcp4_flow.src_port;
                tcp->data_off = I40E_FDIR_TCP_DEFAULT_DATAOFF;
        } else if (pctype == I40E_FILTER_PCTYPE_NONF_IPV4_SCTP) {
-               sctp = (struct sctp_hdr *)(raw_pkt + len);
-               payload = (unsigned char *)sctp + sizeof(struct sctp_hdr);
+               sctp = (struct rte_sctp_hdr *)(raw_pkt + len);
+               payload = (unsigned char *)sctp + sizeof(struct rte_sctp_hdr);
                /**
                 * The source and destination fields in the transmitted packet
                 * need to be presented in a reversed order with respect
@@ -1175,8 +1175,8 @@ i40e_flow_fdir_construct_pkt(struct i40e_pf *pf,
                tcp->src_port = fdir_input->flow.udp6_flow.dst_port;
                tcp->dst_port = fdir_input->flow.udp6_flow.src_port;
        } else if (pctype == I40E_FILTER_PCTYPE_NONF_IPV6_SCTP) {
-               sctp = (struct sctp_hdr *)(raw_pkt + len);
-               payload = (unsigned char *)sctp + sizeof(struct sctp_hdr);
+               sctp = (struct rte_sctp_hdr *)(raw_pkt + len);
+               payload = (unsigned char *)sctp + sizeof(struct rte_sctp_hdr);
                /**
                 * The source and destination fields in the transmitted packet
                 * need to be presented in a reversed order with respect
index 52ce536e0ef8666da88799c54391c38fb59969e0..edd4509eedfde0dd77ef030904ff33681796cb9d 100644 (file)
@@ -307,7 +307,7 @@ i40e_txd_enable_checksum(uint64_t ol_flags,
                break;
        case PKT_TX_SCTP_CKSUM:
                *td_cmd |= I40E_TX_DESC_CMD_L4T_EOFT_SCTP;
-               *td_offset |= (sizeof(struct sctp_hdr) >> 2) <<
+               *td_offset |= (sizeof(struct rte_sctp_hdr) >> 2) <<
                                I40E_TX_DESC_LENGTH_L4_FC_LEN_SHIFT;
                break;
        case PKT_TX_UDP_CKSUM:
index 103a020c8b342dbd8ea8213f929efd19cabb1c1c..7a6750e02c8d09eea3edffe85be8c8672f76e43c 100644 (file)
@@ -1422,7 +1422,7 @@ iavf_txd_enable_checksum(uint64_t ol_flags,
                break;
        case PKT_TX_SCTP_CKSUM:
                *td_cmd |= IAVF_TX_DESC_CMD_L4T_EOFT_SCTP;
-               *td_offset |= (sizeof(struct sctp_hdr) >> 2) <<
+               *td_offset |= (sizeof(struct rte_sctp_hdr) >> 2) <<
                              IAVF_TX_DESC_LENGTH_L4_FC_LEN_SHIFT;
                break;
        case PKT_TX_UDP_CKSUM:
index f0ff0e559fb01035f2b73922fdd31c83d9400a6f..0da853dc41235d8fa1e4d126f2a92363156644d6 100644 (file)
@@ -1738,7 +1738,7 @@ ice_txd_enable_checksum(uint64_t ol_flags,
                break;
        case PKT_TX_SCTP_CKSUM:
                *td_cmd |= ICE_TX_DESC_CMD_L4T_EOFT_SCTP;
-               *td_offset |= (sizeof(struct sctp_hdr) >> 2) <<
+               *td_offset |= (sizeof(struct rte_sctp_hdr) >> 2) <<
                              ICE_TX_DESC_LEN_L4_LEN_S;
                break;
        case PKT_TX_UDP_CKSUM:
index 4d1481e8b0f21c4880091257e61e78d3a6002ee0..c3bb98c24d8d49ee91ae3dc344052545054ee355 100644 (file)
@@ -436,7 +436,7 @@ ixgbe_set_xmit_ctx(struct ixgbe_tx_queue *txq,
                case PKT_TX_SCTP_CKSUM:
                        type_tucmd_mlhl |= IXGBE_ADVTXD_TUCMD_L4T_SCTP |
                                IXGBE_ADVTXD_DTYP_CTXT | IXGBE_ADVTXD_DCMD_DEXT;
-                       mss_l4len_idx |= sizeof(struct sctp_hdr) << IXGBE_ADVTXD_L4LEN_SHIFT;
+                       mss_l4len_idx |= sizeof(struct rte_sctp_hdr) << IXGBE_ADVTXD_L4LEN_SHIFT;
                        tx_offload_mask.l2_len |= ~0;
                        tx_offload_mask.l3_len |= ~0;
                        break;
index 8088d9412f2830a82bebfa6ec52328fbecd7b58e..07a53abc31822798cb054306db47a216cbce6f43 100644 (file)
@@ -77,7 +77,7 @@ process_inner_cksums(struct rte_ether_hdr *eth_hdr, union tunnel_offload_info *i
        struct rte_ipv6_hdr *ipv6_hdr;
        struct udp_hdr *udp_hdr;
        struct tcp_hdr *tcp_hdr;
-       struct sctp_hdr *sctp_hdr;
+       struct rte_sctp_hdr *sctp_hdr;
        uint64_t ol_flags = 0;
 
        info->l2_len = sizeof(struct rte_ether_hdr);
@@ -126,7 +126,7 @@ process_inner_cksums(struct rte_ether_hdr *eth_hdr, union tunnel_offload_info *i
                tcp_hdr->cksum = get_psd_sum(l3_hdr, ethertype, ol_flags);
 
        } else if (l4_proto == IPPROTO_SCTP) {
-               sctp_hdr = (struct sctp_hdr *)((char *)l3_hdr + info->l3_len);
+               sctp_hdr = (struct rte_sctp_hdr *)((char *)l3_hdr + info->l3_len);
                sctp_hdr->cksum = 0;
                ol_flags |= PKT_TX_SCTP_CKSUM;
        }
index 0bf55a62fed24dd5ee1dddff46b1c13d7788fc03..f93427a44c2741c3135dfd158ad20f76bd3dfcd0 100644 (file)
@@ -731,7 +731,7 @@ static const struct rte_flow_item_tcp rte_flow_item_tcp_mask = {
  * Matches a SCTP header.
  */
 struct rte_flow_item_sctp {
-       struct sctp_hdr hdr; /**< SCTP header definition. */
+       struct rte_sctp_hdr hdr; /**< SCTP header definition. */
 };
 
 /** Default mask for RTE_FLOW_ITEM_TYPE_SCTP. */
index 71238348421d0e97805df195c8c81dd9340b7f2d..4a46df58db028f0bbc4465dfafc4298f6f7ecf8c 100644 (file)
@@ -370,7 +370,7 @@ l3:
                hdr_lens->l4_len = (th->data_off & 0xf0) >> 2;
                return pkt_type;
        } else if ((pkt_type & RTE_PTYPE_L4_MASK) == RTE_PTYPE_L4_SCTP) {
-               hdr_lens->l4_len = sizeof(struct sctp_hdr);
+               hdr_lens->l4_len = sizeof(struct rte_sctp_hdr);
                return pkt_type;
        } else {
                uint32_t prev_off = off;
@@ -506,7 +506,7 @@ l3:
                hdr_lens->inner_l4_len = (th->data_off & 0xf0) >> 2;
        } else if ((pkt_type & RTE_PTYPE_INNER_L4_MASK) ==
                        RTE_PTYPE_INNER_L4_SCTP) {
-               hdr_lens->inner_l4_len = sizeof(struct sctp_hdr);
+               hdr_lens->inner_l4_len = sizeof(struct rte_sctp_hdr);
        } else {
                hdr_lens->inner_l4_len = 0;
        }
index bfb7165a6897601641054f2c0292996b71639e54..b3661b0db66770088b5bd92bb0ad421aa395c119 100644 (file)
@@ -23,7 +23,7 @@ extern "C" {
 /**
  * SCTP Header
  */
-struct sctp_hdr {
+struct rte_sctp_hdr {
        uint16_t src_port; /**< Source port. */
        uint16_t dst_port; /**< Destin port. */
        uint32_t tag;      /**< Validation tag. */
index 2960a5c8ac5e6efcc1f614536b72b9832f06f688..720d77ba6c2d48083051a1d9aa09c80d75bce1b9 100644 (file)
@@ -226,7 +226,7 @@ virtio_enqueue_offload(struct rte_mbuf *m_buf, struct virtio_net_hdr *net_hdr)
                                                dgram_cksum));
                        break;
                case PKT_TX_SCTP_CKSUM:
-                       net_hdr->csum_offset = (offsetof(struct sctp_hdr,
+                       net_hdr->csum_offset = (offsetof(struct rte_sctp_hdr,
                                                cksum));
                        break;
                }
@@ -1031,7 +1031,7 @@ vhost_dequeue_offload(struct virtio_net_hdr *hdr, struct rte_mbuf *m)
                                if (l4_proto == IPPROTO_UDP)
                                        m->ol_flags |= PKT_TX_UDP_CKSUM;
                                break;
-                       case (offsetof(struct sctp_hdr, cksum)):
+                       case (offsetof(struct rte_sctp_hdr, cksum)):
                                if (l4_proto == IPPROTO_SCTP)
                                        m->ol_flags |= PKT_TX_SCTP_CKSUM;
                                break;