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;
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 */
}
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;
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;
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;
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
{
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;
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 |
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));
* 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 ||
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));
}
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 ||
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;
}
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;
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
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
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;
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
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
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:
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:
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:
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;
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);
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;
}
* 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. */
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;
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;
}
/**
* 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. */
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;
}
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;