aboutsummaryrefslogtreecommitdiffstats
path: root/examples/l4fwd
diff options
context:
space:
mode:
Diffstat (limited to 'examples/l4fwd')
-rw-r--r--examples/l4fwd/main.c3
-rw-r--r--examples/l4fwd/pkt.c2
-rw-r--r--examples/l4fwd/port.h11
3 files changed, 6 insertions, 10 deletions
diff --git a/examples/l4fwd/main.c b/examples/l4fwd/main.c
index ff572be..9396403 100644
--- a/examples/l4fwd/main.c
+++ b/examples/l4fwd/main.c
@@ -68,8 +68,7 @@ static char proto_name[3][10] = {"udp", "tcp", ""};
static const struct rte_eth_conf port_conf_default = {
.rxmode = {
- .hw_vlan_strip = 1,
- .jumbo_frame = 0,
+ .offloads = DEV_RX_OFFLOAD_VLAN_STRIP,
},
};
diff --git a/examples/l4fwd/pkt.c b/examples/l4fwd/pkt.c
index 6dfad0e..43aa9c8 100644
--- a/examples/l4fwd/pkt.c
+++ b/examples/l4fwd/pkt.c
@@ -946,7 +946,7 @@ setup_rx_cb(const struct netbe_port *uprt, struct netbe_lcore *lc,
{
int32_t rc;
uint32_t i, n, smask;
- void *cb;
+ const void *cb;
const struct ptype2cb *ptype2cb;
static const struct ptype2cb tcp_ptype2cb[] = {
diff --git a/examples/l4fwd/port.h b/examples/l4fwd/port.h
index b727b1b..a154844 100644
--- a/examples/l4fwd/port.h
+++ b/examples/l4fwd/port.h
@@ -180,16 +180,18 @@ port_init(struct netbe_port *uprt, uint32_t proto)
if ((uprt->rx_offload & RX_CSUM_OFFLOAD) != 0) {
RTE_LOG(ERR, USER1, "%s(%u): enabling RX csum offload;\n",
__func__, uprt->id);
- port_conf.rxmode.hw_ip_checksum = 1;
+ port_conf.rxmode.offloads |= uprt->rx_offload & RX_CSUM_OFFLOAD;
}
port_conf.rxmode.max_rx_pkt_len = uprt->mtu + ETHER_CRC_LEN;
if (port_conf.rxmode.max_rx_pkt_len > ETHER_MAX_LEN)
- port_conf.rxmode.jumbo_frame = 1;
+ port_conf.rxmode.offloads |= DEV_RX_OFFLOAD_JUMBO_FRAME;
rc = update_rss_conf(uprt, &dev_info, &port_conf, proto);
if (rc != 0)
return rc;
+ port_conf.txmode.offloads = uprt->tx_offload;
+
rc = rte_eth_dev_configure(uprt->id, uprt->nb_lcore, uprt->nb_lcore,
&port_conf);
RTE_LOG(NOTICE, USER1,
@@ -220,11 +222,6 @@ queue_init(struct netbe_port *uprt, struct rte_mempool *mp)
nb_txd = RTE_MIN(TX_RING_SIZE, dev_info.tx_desc_lim.nb_max);
dev_info.default_txconf.tx_free_thresh = nb_txd / 2;
- if (uprt->tx_offload != 0) {
- RTE_LOG(ERR, USER1, "%s(%u): enabling full featured TX;\n",
- __func__, uprt->id);
- dev_info.default_txconf.txq_flags = 0;
- }
for (q = 0; q < uprt->nb_lcore; q++) {
rc = rte_eth_rx_queue_setup(uprt->id, q, nb_rxd,