Skip to content

Commit

Permalink
net/iavf: fix Tx preparation
Browse files Browse the repository at this point in the history
[ upstream commit 0f536bae86b30e82ba95c279f1d6f9095d7f5b6e ]

1. check nb_segs > Tx ring size for TSO case.
2. report nb_mtu_seg_max and nb_seg_max in dev_info.

Fixes: a2b29a7 ("net/avf: enable basic Rx Tx")

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
  • Loading branch information
qzhan16 authored and kevintraynor committed Nov 16, 2023
1 parent cfd4195 commit 93bbc6d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions drivers/net/iavf/iavf_ethdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -1148,6 +1148,8 @@ iavf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
.nb_max = IAVF_MAX_RING_DESC,
.nb_min = IAVF_MIN_RING_DESC,
.nb_align = IAVF_ALIGN_RING_DESC,
.nb_mtu_seg_max = IAVF_TX_MAX_MTU_SEG,
.nb_seg_max = IAVF_MAX_RING_DESC,
};

return 0;
Expand Down
3 changes: 2 additions & 1 deletion drivers/net/iavf/iavf_rxtx.c
Original file line number Diff line number Diff line change
Expand Up @@ -2804,7 +2804,8 @@ iavf_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
return i;
}
} else if ((m->tso_segsz < IAVF_MIN_TSO_MSS) ||
(m->tso_segsz > IAVF_MAX_TSO_MSS)) {
(m->tso_segsz > IAVF_MAX_TSO_MSS) ||
(m->nb_segs > txq->nb_tx_desc)) {
/* MSS outside the range are considered malicious */
rte_errno = EINVAL;
return i;
Expand Down

0 comments on commit 93bbc6d

Please sign in to comment.