net/octeontx2: fix buffer size assignment
PATCH 1/1 net/octeontx2: fix buffer size assignment
The elt_size field in mempool holds the size of one packet buffer. It can be used to set the lpm_sizem1 field in rq context.
The lpb_sizem1 field in rq context is 12 bit, direct assignment to it was causing overflow of value. Because of this errors were observed while trying inline inbound with large packets. This patch resolves the errors.
--- drivers/net/octeontx2/otx2_ethdev.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/net/octeontx2/otx2_ethdev.c +1 -4
@@ -373,10 +373,7 @@ aq->rq.first_skip = first_skip; aq->rq.later_skip = (sizeof (struct rte_mbuf ) /8 ); aq->rq.flow_tagw =32 ;/* 32-bits */ - aq->rq.lpb_sizem1 =rte_pktmbuf_data_room_size (mp); - aq->rq.lpb_sizem1 +=rte_pktmbuf_priv_size (mp); - aq->rq.lpb_sizem1 +=sizeof (struct rte_mbuf ); - aq->rq.lpb_sizem1 /=8 ; + aq->rq.lpb_sizem1 = mp->elt_size /8 ; aq->rq.lpb_sizem1 -=1 ;/* Expressed in size minus one */ aq->rq.ena =1 ; aq->rq.pb_caching =0x2 ;/* First cache aligned block to LLC */
Signature · 1 line
1.9.3
Quoted 10 lines · Ankur Dwivedi
The
elt_sizefield in mempool holds the size of one packet buffer. It can be used to set thelpm_sizem1field in rq context.The
lpb_sizem1field in rq context is 12 bit, direct assignment to it was causing overflow of value. Because of this errors were observed while trying inline inbound with large packets. This patch resolves the errors.Fixes 094fc8a3a1e2 ("net/octeontx2: add Rx queue setup and release")
Quoted 4 lines
Signed-off-by Ankur Dwivedi <[email protected]>Reviewed-by Nithin Kumar Dabilpuram <[email protected]>Reviewed-by Jerin Jacob Kollanukkaran <[email protected]>
Fixed the name and Applied to dpdk-next-net-mrvl/master. Thanks
Quoted 23 lines
--- drivers/net/octeontx2/otx2_ethdev.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)drivers/net/octeontx2/otx2_ethdev.c +1
-5@@ -373,10 +373,7 @@ aq->rq.first_skip = first_skip; aq->rq.later_skip = (sizeof (struct rte_mbuf ) /8 ); aq->rq.flow_tagw =32 ;/* 32-bits */ - aq->rq.lpb_sizem1 =rte_pktmbuf_data_room_size (mp); - aq->rq.lpb_sizem1 +=rte_pktmbuf_priv_size (mp); - aq->rq.lpb_sizem1 +=sizeof (struct rte_mbuf ); - aq->rq.lpb_sizem1 /=8 ; + aq->rq.lpb_sizem1 = mp->elt_size /8 ; aq->rq.lpb_sizem1 -=1 ;/* Expressed in size minus one */ aq->rq.ena =1 ; aq->rq.pb_caching =0x2 ;/* First cache aligned block to LLC */ --1.9.3