if (!numa_support || socket_id == NUMA_NO_CONFIG)
socket_id = port->socket_id;
+ if (port->nb_tx_desc[res->qid] < tx_pkt_nb_segs) {
+ printf("Failed to setup TX queue: not enough descriptors\n");
+ return;
+ }
ret = rte_eth_tx_queue_setup(res->portid,
res->qid,
port->nb_tx_desc[res->qid],
RTE_ETH_FOREACH_DEV(port_id) {
for (queue_id = 0; queue_id < nb_txq; queue_id++) {
ret = get_tx_ring_size(port_id, queue_id, &ring_size);
-
- if (ret)
- return true;
-
+ if (ret) {
+ /* Port may not be initialized yet, can't say
+ * the port is invalid in this stage.
+ */
+ continue;
+ }
if (ring_size < nb_segs) {
- printf("nb segments per TX packets=%u >= "
- "TX queue(%u) ring_size=%u - ignored\n",
+ printf("nb segments per TX packets=%u >= TX "
+ "queue(%u) ring_size=%u - txpkts ignored\n",
nb_segs, queue_id, ring_size);
return true;
}
uint16_t tx_pkt_len;
unsigned int i;
- if (nb_segs_is_invalid(nb_segs))
+ /*
+ * For single segment settings failed check is ignored.
+ * It is a very basic capability to send the single segment
+ * packets, suppose it is always supported.
+ */
+ if (nb_segs > 1 && nb_segs_is_invalid(nb_segs)) {
+ printf("Tx segment size(%u) is not supported - txpkts ignored\n",
+ nb_segs);
return;
+ }
+
+ if (nb_segs > RTE_MAX_SEGS_PER_PKT) {
+ printf("Tx segment size(%u) is bigger than max number of segment(%u)\n",
+ nb_segs, RTE_MAX_SEGS_PER_PKT);
+ return;
+ }
/*
* Check that each segment length is greater or equal than
- * the mbuf data sise.
+ * the mbuf data size.
* Check also that the total packet length is greater or equal than the
* size of an empty UDP/IP packet (sizeof(struct rte_ether_hdr) +
* 20 + 8).