summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlya V. Matveychikov <matvejchikov@gmail.com>2017-11-09 17:54:09 +0400
committerFerruh Yigit <ferruh.yigit@intel.com>2017-11-10 09:17:13 +0000
commit6c293ffd63b3f61a95d8c492d007160874e7a057 (patch)
tree346289daf949485f2e157fd76bc359da9032977f
parent8ec50cd6240a50498989c08661819960d8e75243 (diff)
downloaddpdk-6c293ffd63b3f61a95d8c492d007160874e7a057.zip
dpdk-6c293ffd63b3f61a95d8c492d007160874e7a057.tar.gz
dpdk-6c293ffd63b3f61a95d8c492d007160874e7a057.tar.xz
drivers/net: fix number of segment storage type
Fixes: 97cb466d65c9 ("mbuf: use 2 bytes for port and nb segments") Cc: stable@dpdk.org Signed-off-by: Ilya V. Matveychikov <matvejchikov@gmail.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
-rw-r--r--drivers/net/ark/ark_ethdev_rx.c2
-rw-r--r--drivers/net/i40e/i40e_rxtx.c9
-rw-r--r--drivers/net/ixgbe/ixgbe_rxtx.c2
-rw-r--r--drivers/net/qede/qede_rxtx.c4
-rw-r--r--drivers/net/szedata2/rte_eth_szedata2.c2
5 files changed, 8 insertions, 11 deletions
diff --git a/drivers/net/ark/ark_ethdev_rx.c b/drivers/net/ark/ark_ethdev_rx.c
index a3c0377..987d085 100644
--- a/drivers/net/ark/ark_ethdev_rx.c
+++ b/drivers/net/ark/ark_ethdev_rx.c
@@ -356,7 +356,7 @@ eth_ark_rx_jumbo(struct ark_rx_queue *queue,
uint16_t remaining;
uint16_t data_len;
- uint8_t segments;
+ uint16_t segments;
/* first buf populated by called */
mbuf_prev = mbuf0;
diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c
index 8b4f612..ad06b71 100644
--- a/drivers/net/i40e/i40e_rxtx.c
+++ b/drivers/net/i40e/i40e_rxtx.c
@@ -1473,13 +1473,10 @@ i40e_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
m = tx_pkts[i];
ol_flags = m->ol_flags;
- /**
- * m->nb_segs is uint8_t, so nb_segs is always less than
- * I40E_TX_MAX_SEG.
- * We check only a condition for nb_segs > I40E_TX_MAX_MTU_SEG.
- */
+ /* Check for m->nb_segs to not exceed the limits. */
if (!(ol_flags & PKT_TX_TCP_SEG)) {
- if (m->nb_segs > I40E_TX_MAX_MTU_SEG) {
+ if (m->nb_segs > I40E_TX_MAX_SEG ||
+ m->nb_segs > I40E_TX_MAX_MTU_SEG) {
rte_errno = -EINVAL;
return i;
}
diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
index 012d9ee..9bc8462 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx.c
@@ -2639,7 +2639,7 @@ ixgbe_dev_tx_queue_setup(struct rte_eth_dev *dev,
static void __attribute__((cold))
ixgbe_free_sc_cluster(struct rte_mbuf *m)
{
- uint8_t i, nb_segs = m->nb_segs;
+ uint16_t i, nb_segs = m->nb_segs;
struct rte_mbuf *next_seg;
for (i = 0; i < nb_segs; i++) {
diff --git a/drivers/net/qede/qede_rxtx.c b/drivers/net/qede/qede_rxtx.c
index 8e8536f..01a24e5 100644
--- a/drivers/net/qede/qede_rxtx.c
+++ b/drivers/net/qede/qede_rxtx.c
@@ -1547,14 +1547,14 @@ next_cqe:
/* Populate scatter gather buffer descriptor fields */
-static inline uint8_t
+static inline uint16_t
qede_encode_sg_bd(struct qede_tx_queue *p_txq, struct rte_mbuf *m_seg,
struct eth_tx_2nd_bd **bd2, struct eth_tx_3rd_bd **bd3)
{
struct qede_tx_queue *txq = p_txq;
struct eth_tx_bd *tx_bd = NULL;
dma_addr_t mapping;
- uint8_t nb_segs = 0;
+ uint16_t nb_segs = 0;
/* Check for scattered buffers */
while (m_seg) {
diff --git a/drivers/net/szedata2/rte_eth_szedata2.c b/drivers/net/szedata2/rte_eth_szedata2.c
index 403cfdb..74f151c 100644
--- a/drivers/net/szedata2/rte_eth_szedata2.c
+++ b/drivers/net/szedata2/rte_eth_szedata2.c
@@ -682,7 +682,7 @@ eth_szedata2_tx(void *queue,
uint32_t hwpkt_len;
uint32_t unlock_size;
uint32_t rem_len;
- uint8_t mbuf_segs;
+ uint16_t mbuf_segs;
uint16_t pkt_left = nb_pkts;
if (sze_q->sze == NULL || nb_pkts == 0)