summaryrefslogtreecommitdiff
path: root/drivers/net/bnxt/bnxt_rxr.c
diff options
context:
space:
mode:
authorSantoshkumar Karanappa Rastapur <santosh.rastapur@broadcom.com>2019-10-02 10:17:31 -0700
committerFerruh Yigit <ferruh.yigit@intel.com>2019-10-08 12:14:30 +0200
commit09aac391a50c8ea7ed3e87389bd97bb1dca97734 (patch)
treed24fd402002dd409347b60a477201f9a972a2401 /drivers/net/bnxt/bnxt_rxr.c
parentd43fe8ea0c40c5534d83950bff08aa89457a3fd7 (diff)
downloaddpdk-next-eventdev-09aac391a50c8ea7ed3e87389bd97bb1dca97734.zip
dpdk-next-eventdev-09aac391a50c8ea7ed3e87389bd97bb1dca97734.tar.gz
dpdk-next-eventdev-09aac391a50c8ea7ed3e87389bd97bb1dca97734.tar.xz
net/bnxt: fix forwarding with higher mbuf size
Maximum frame length supported by hw is 9600 bytes. When user launches testpmd with --mbuf-size=9729, we are posting buffer descriptors of size 9601 to the ring. This was causing packets getting discarded. Fixes: daef48efe5e5 ("net/bnxt: support set MTU") Cc: stable@dpdk.org Signed-off-by: Santoshkumar Karanappa Rastapur <santosh.rastapur@broadcom.com> Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com> Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com> Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com> Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
Diffstat (limited to 'drivers/net/bnxt/bnxt_rxr.c')
-rw-r--r--drivers/net/bnxt/bnxt_rxr.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/net/bnxt/bnxt_rxr.c b/drivers/net/bnxt/bnxt_rxr.c
index 28487fb..f60880c 100644
--- a/drivers/net/bnxt/bnxt_rxr.c
+++ b/drivers/net/bnxt/bnxt_rxr.c
@@ -713,9 +713,7 @@ int bnxt_init_rx_ring_struct(struct bnxt_rx_queue *rxq, unsigned int socket_id)
struct bnxt_rx_ring_info *rxr;
struct bnxt_ring *ring;
- rxq->rx_buf_use_size = BNXT_MAX_MTU + RTE_ETHER_HDR_LEN +
- RTE_ETHER_CRC_LEN + (2 * VLAN_TAG_SIZE);
- rxq->rx_buf_size = rxq->rx_buf_use_size + sizeof(struct rte_mbuf);
+ rxq->rx_buf_size = BNXT_MAX_PKT_LEN + sizeof(struct rte_mbuf);
rxr = rte_zmalloc_socket("bnxt_rx_ring",
sizeof(struct bnxt_rx_ring_info),
@@ -826,8 +824,7 @@ int bnxt_init_one_rx_ring(struct bnxt_rx_queue *rxq)
uint16_t size;
size = rte_pktmbuf_data_room_size(rxq->mb_pool) - RTE_PKTMBUF_HEADROOM;
- if (rxq->rx_buf_use_size <= size)
- size = rxq->rx_buf_use_size;
+ size = RTE_MIN(BNXT_MAX_PKT_LEN, size);
type = RX_PROD_PKT_BD_TYPE_RX_PROD_PKT | RX_PROD_PKT_BD_FLAGS_EOP_PAD;