[v2,02/13] net/dpaa: fix jumbo buffer config
diff mbox series

Message ID 1537277516-8876-3-git-send-email-hemant.agrawal@nxp.com
State Superseded, archived
Delegated to: Ferruh Yigit
Headers show
Series
  • NXP DPAA driver enhancements
Related show

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Hemant Agrawal Sept. 18, 2018, 1:31 p.m. UTC
Avoid return after the jumbo buffer config in dev config API

Fixes: 9658ac3a4ef6 ("net/dpaa: set the correct frame size in device MTU")
Cc: stable@dpdk.org

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 drivers/net/dpaa/dpaa_ethdev.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

Comments

Thomas Monjalon Sept. 18, 2018, 2:03 p.m. UTC | #1
18/09/2018 15:31, Hemant Agrawal:
> Avoid return after the jumbo buffer config in dev config API
> 
> Fixes: 9658ac3a4ef6 ("net/dpaa: set the correct frame size in device MTU")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>

Thanks for adding some comments in this series.

About this fix, would it be easier to understand if explaining
what is the bug first?
Hemant Agrawal Sept. 18, 2018, 4:22 p.m. UTC | #2
On 9/18/2018 7:33 PM, Thomas Monjalon wrote:
> 18/09/2018 15:31, Hemant Agrawal:
>> Avoid return after the jumbo buffer config in dev config API
>>
>> Fixes: 9658ac3a4ef6 ("net/dpaa: set the correct frame size in device MTU")
>> Cc: stable@dpdk.org
>>
>> Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
> Thanks for adding some comments in this series.
>
> About this fix, would it be easier to understand if explaining
> what is the bug first?
>
>
yes. I can be more specific here.
1. the dev->data->mtu was not getting updated earlier for the jumbo 
buffer config.
2. we don't expect to return error, if this config fails. A debug err 
log is ok.  DPAA1 - supports jumbo by default, enable/disable may give 
errors.

Patch
diff mbox series

diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c
index b9bd557..db166f5 100644
--- a/drivers/net/dpaa/dpaa_ethdev.c
+++ b/drivers/net/dpaa/dpaa_ethdev.c
@@ -195,11 +195,17 @@  dpaa_eth_dev_configure(struct rte_eth_dev *dev)
 	if (rx_offloads & DEV_RX_OFFLOAD_JUMBO_FRAME) {
 		if (dev->data->dev_conf.rxmode.max_rx_pkt_len <=
 		    DPAA_MAX_RX_PKT_LEN) {
+			DPAA_PMD_DEBUG("enabling jumbo");
 			fman_if_set_maxfrm(dpaa_intf->fif,
 				dev->data->dev_conf.rxmode.max_rx_pkt_len);
-			return 0;
+			dev->data->mtu =
+				dev->data->dev_conf.rxmode.max_rx_pkt_len -
+				ETHER_HDR_LEN - ETHER_CRC_LEN - VLAN_TAG_SIZE;
 		} else {
-			return -1;
+			DPAA_PMD_ERR("enabling jumbo err conf max len=%d "
+				"supported is %d",
+				dev->data->dev_conf.rxmode.max_rx_pkt_len,
+				DPAA_MAX_RX_PKT_LEN);
 		}
 	}
 	return 0;