git.droids-corp.org
/
dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
cryptodev: add asymmetric session user data API
[dpdk.git]
/
examples
/
l2fwd-event
/
l2fwd_common.c
diff --git
a/examples/l2fwd-event/l2fwd_common.c
b/examples/l2fwd-event/l2fwd_common.c
index
ab341e5
..
cf3d1b8
100644
(file)
--- a/
examples/l2fwd-event/l2fwd_common.c
+++ b/
examples/l2fwd-event/l2fwd_common.c
@@
-11,11
+11,10
@@
l2fwd_event_init_ports(struct l2fwd_resources *rsrc)
uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT;
struct rte_eth_conf port_conf = {
.rxmode = {
uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT;
struct rte_eth_conf port_conf = {
.rxmode = {
- .max_rx_pkt_len = RTE_ETHER_MAX_LEN,
.split_hdr_size = 0,
},
.txmode = {
.split_hdr_size = 0,
},
.txmode = {
- .mq_mode = ETH_MQ_TX_NONE,
+ .mq_mode =
RTE_
ETH_MQ_TX_NONE,
},
};
uint16_t nb_ports_available = 0;
},
};
uint16_t nb_ports_available = 0;
@@
-23,9
+22,9
@@
l2fwd_event_init_ports(struct l2fwd_resources *rsrc)
int ret;
if (rsrc->event_mode) {
int ret;
if (rsrc->event_mode) {
- port_conf.rxmode.mq_mode = ETH_MQ_RX_RSS;
+ port_conf.rxmode.mq_mode =
RTE_
ETH_MQ_RX_RSS;
port_conf.rx_adv_conf.rss_conf.rss_key = NULL;
port_conf.rx_adv_conf.rss_conf.rss_key = NULL;
- port_conf.rx_adv_conf.rss_conf.rss_hf = ETH_RSS_IP;
+ port_conf.rx_adv_conf.rss_conf.rss_hf =
RTE_
ETH_RSS_IP;
}
/* Initialise each port */
}
/* Initialise each port */
@@
-61,13
+60,15
@@
l2fwd_event_init_ports(struct l2fwd_resources *rsrc)
local_port_conf.rx_adv_conf.rss_conf.rss_hf);
}
local_port_conf.rx_adv_conf.rss_conf.rss_hf);
}
- if (dev_info.tx_offload_capa &
DEV
_TX_OFFLOAD_MBUF_FAST_FREE)
+ if (dev_info.tx_offload_capa &
RTE_ETH
_TX_OFFLOAD_MBUF_FAST_FREE)
local_port_conf.txmode.offloads |=
local_port_conf.txmode.offloads |=
- DEV_TX_OFFLOAD_MBUF_FAST_FREE;
+ RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE;
+ /* Configure RX and TX queue. 8< */
ret = rte_eth_dev_configure(port_id, 1, 1, &local_port_conf);
if (ret < 0)
rte_panic("Cannot configure device: err=%d, port=%u\n",
ret, port_id);
ret = rte_eth_dev_configure(port_id, 1, 1, &local_port_conf);
if (ret < 0)
rte_panic("Cannot configure device: err=%d, port=%u\n",
ret, port_id);
+ /* >8 End of configuration RX and TX queue. */
ret = rte_eth_dev_adjust_nb_rx_tx_desc(port_id, &nb_rxd,
&nb_txd);
ret = rte_eth_dev_adjust_nb_rx_tx_desc(port_id, &nb_rxd,
&nb_txd);
@@
-81,6
+82,7
@@
l2fwd_event_init_ports(struct l2fwd_resources *rsrc)
fflush(stdout);
rxq_conf = dev_info.default_rxconf;
rxq_conf.offloads = local_port_conf.rxmode.offloads;
fflush(stdout);
rxq_conf = dev_info.default_rxconf;
rxq_conf.offloads = local_port_conf.rxmode.offloads;
+ /* Using lcore to poll one or several ports. 8< */
ret = rte_eth_rx_queue_setup(port_id, 0, nb_rxd,
rte_eth_dev_socket_id(port_id),
&rxq_conf,
ret = rte_eth_rx_queue_setup(port_id, 0, nb_rxd,
rte_eth_dev_socket_id(port_id),
&rxq_conf,
@@
-89,7
+91,9
@@
l2fwd_event_init_ports(struct l2fwd_resources *rsrc)
rte_panic("rte_eth_rx_queue_setup:err=%d, port=%u\n",
ret, port_id);
rte_panic("rte_eth_rx_queue_setup:err=%d, port=%u\n",
ret, port_id);
- /* init one TX queue on each port */
+ /* >8 End of using lcore to poll one or several ports. */
+
+ /* Init one TX queue on each port. 8< */
fflush(stdout);
txq_conf = dev_info.default_txconf;
txq_conf.offloads = local_port_conf.txmode.offloads;
fflush(stdout);
txq_conf = dev_info.default_txconf;
txq_conf.offloads = local_port_conf.txmode.offloads;
@@
-99,17
+103,13
@@
l2fwd_event_init_ports(struct l2fwd_resources *rsrc)
if (ret < 0)
rte_panic("rte_eth_tx_queue_setup:err=%d, port=%u\n",
ret, port_id);
if (ret < 0)
rte_panic("rte_eth_tx_queue_setup:err=%d, port=%u\n",
ret, port_id);
+ /* >8 End of init one TX queue on each port. */
rte_eth_promiscuous_enable(port_id);
rte_eth_promiscuous_enable(port_id);
- printf("Port %u,MAC address:
%02X:%02X:%02X:%02X:%02X:%02X
\n\n",
+ printf("Port %u,MAC address:
" RTE_ETHER_ADDR_PRT_FMT "
\n\n",
port_id,
port_id,
- rsrc->eth_addr[port_id].addr_bytes[0],
- rsrc->eth_addr[port_id].addr_bytes[1],
- rsrc->eth_addr[port_id].addr_bytes[2],
- rsrc->eth_addr[port_id].addr_bytes[3],
- rsrc->eth_addr[port_id].addr_bytes[4],
- rsrc->eth_addr[port_id].addr_bytes[5]);
+ RTE_ETHER_ADDR_BYTES(&rsrc->eth_addr[port_id]));
}
return nb_ports_available;
}
return nb_ports_available;