On Wednesday 28 June 2017 09:15 PM, Ferruh Yigit wrote:
On 6/16/2017 6:40 AM, Shreyansh Jain wrote:
Signed-off-by: Hemant Agrawal <hemant.agra...@nxp.com>
Signed-off-by: Shreyansh Jain <shreyansh.j...@nxp.com>
<...>
static int
+dpaa_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
+{
+ struct dpaa_if *dpaa_intf = dev->data->dev_private;
+
+ PMD_INIT_FUNC_TRACE();
+
+ if (mtu < ETHER_MIN_MTU)
+ return -EINVAL;
+
+ fman_if_set_maxfrm(dpaa_intf->fif, mtu);
+
+ if (mtu > ETHER_MAX_LEN)
+ return -1
Is it OK to have this check after fman_if_set_maxfrm() ?
Indeed - bad code. I will fix this.
+ dev->data->dev_conf.rxmode.jumbo_frame = 0;
+
+ dev->data->dev_conf.rxmode.max_rx_pkt_len = mtu;
I think this only makes sense when jumbo_frame is 1, although not hurts
to set...
Yes, that is true. But, I though it would be better for debugging
purpose. Does it hurt keeping it?
+ return 0;
+}
<...>