#include <rte_memory.h>
#include <rte_memcpy.h>
#include <rte_memzone.h>
-#include <rte_tailq.h>
#include <rte_eal.h>
#include <rte_per_lcore.h>
#include <rte_launch.h>
#define MAX_JUMBO_PKT_LEN 9600
-#define BUF_SIZE 2048
+#define BUF_SIZE RTE_MBUF_DEFAULT_DATAROOM
#define MBUF_SIZE \
(BUF_SIZE + sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM)
txmb->tail = 0;
}
- return (fill);
+ return fill;
}
/* Enqueue a single packet, and send burst if queue is filled */
if(++txmb->head == len)
txmb->head = 0;
- return (0);
+ return 0;
}
static inline void
struct rte_ip_frag_death_row *dr;
struct rx_queue *rxq;
void *d_addr_bytes;
- uint8_t next_hop, dst_port;
+ uint32_t next_hop_ipv4;
+ uint8_t next_hop_ipv6, dst_port;
rxq = &qconf->rx_queue_list[queue];
dst_port = portid;
/* if packet is IPv4 */
- if (m->ol_flags & (PKT_RX_IPV4_HDR)) {
+ if (RTE_ETH_IS_IPV4_HDR(m->packet_type)) {
struct ipv4_hdr *ip_hdr;
uint32_t ip_dst;
ip_dst = rte_be_to_cpu_32(ip_hdr->dst_addr);
/* Find destination port */
- if (rte_lpm_lookup(rxq->lpm, ip_dst, &next_hop) == 0 &&
- (enabled_port_mask & 1 << next_hop) != 0) {
- dst_port = next_hop;
+ if (rte_lpm_lookup(rxq->lpm, ip_dst, &next_hop_ipv4) == 0 &&
+ (enabled_port_mask & 1 << next_hop_ipv4) != 0) {
+ dst_port = next_hop_ipv4;
}
eth_hdr->ether_type = rte_be_to_cpu_16(ETHER_TYPE_IPv4);
- }
- /* if packet is IPv6 */
- else if (m->ol_flags & (PKT_RX_IPV6_HDR | PKT_RX_IPV6_HDR_EXT)) {
+ } else if (RTE_ETH_IS_IPV6_HDR(m->packet_type)) {
+ /* if packet is IPv6 */
struct ipv6_extension_fragment *frag_hdr;
struct ipv6_hdr *ip_hdr;
}
/* Find destination port */
- if (rte_lpm6_lookup(rxq->lpm6, ip_hdr->dst_addr, &next_hop) == 0 &&
- (enabled_port_mask & 1 << next_hop) != 0) {
- dst_port = next_hop;
+ if (rte_lpm6_lookup(rxq->lpm6, ip_hdr->dst_addr, &next_hop_ipv6) == 0 &&
+ (enabled_port_mask & 1 << next_hop_ipv6) != 0) {
+ dst_port = next_hop_ipv6;
}
eth_hdr->ether_type = rte_be_to_cpu_16(ETHER_TYPE_IPv6);
errno = 0;
v = strtoul(str, &end, 10);
if (errno != 0 || *end != '\0')
- return (-EINVAL);
+ return -EINVAL;
if (v < min || v > max)
- return (-EINVAL);
+ return -EINVAL;
*val = (uint32_t)v;
- return (0);
+ return 0;
}
static int
errno = 0;
v = strtoul(str, &end, 10);
if (errno != 0)
- return (-EINVAL);
+ return -EINVAL;
if (*end != '\0') {
if (strncmp(frmt_sec, end, sizeof(frmt_sec)) == 0)
v *= MS_PER_S;
else if (strncmp(frmt_msec, end, sizeof (frmt_msec)) != 0)
- return (-EINVAL);
+ return -EINVAL;
}
if (v < min || v > max)
- return (-EINVAL);
+ return -EINVAL;
*val = (uint32_t)v;
- return (0);
+ return 0;
}
static int
optarg,
lgopts[option_index].name);
print_usage(prgname);
- return (ret);
+ return ret;
}
}
optarg,
lgopts[option_index].name);
print_usage(prgname);
- return (ret);
+ return ret;
}
}