* Re: [dpdk-dev] [PATCH] net/ixgbevf: remove MTU setting limitation
2019-04-03 2:25 ` Zhao1, Wei
@ 2019-04-03 2:25 ` Zhao1, Wei
2019-04-03 12:36 ` David Harton (dharton)
2019-04-05 7:49 ` Zhang, Qi Z
2 siblings, 0 replies; 10+ messages in thread
From: Zhao1, Wei @ 2019-04-03 2:25 UTC (permalink / raw)
To: David Harton, dev; +Cc: Lu, Wenzhuo, Ananyev, Konstantin, Zhang, Qi Z
HI,
Why not add some more code
"
if (rx_conf->offloads & DEV_RX_OFFLOAD_SCATTER)
dev->data->scattered_rx = 1;
"
Into ixgbevf_dev_rx_init() to enable scatter mode when start device?
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of David Harton
> Sent: Wednesday, April 3, 2019 9:19 AM
> To: dev@dpdk.org
> Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Ananyev, Konstantin
> <konstantin.ananyev@intel.com>; David Harton <dharton@cisco.com>
> Subject: [dpdk-dev] [PATCH] net/ixgbevf: remove MTU setting limitation
>
> Currently, if requested MTU is bigger than mbuf size and scattered receive is
> not enabled, setting MTU to that value fails.
>
> This patch allows setting this special MTU when device is stopped, because
> scattered_rx will be re-configured during next port start and driver may
> enable scattered receive according new MTU value.
>
> After this patch, driver may select different receive function automatically
> after MTU set, according MTU values selected.
>
> Signed-off-by: David Harton <dharton@cisco.com>
> ---
> drivers/net/ixgbe/ixgbe_ethdev.c | 12 +++++++-----
> 1 file changed, 7 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c
> b/drivers/net/ixgbe/ixgbe_ethdev.c
> index feec85634..0b962c8db 100644
> --- a/drivers/net/ixgbe/ixgbe_ethdev.c
> +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
> @@ -6346,20 +6346,22 @@ ixgbevf_dev_set_mtu(struct rte_eth_dev *dev,
> uint16_t mtu) {
> struct ixgbe_hw *hw;
> uint32_t max_frame = mtu + IXGBE_ETH_OVERHEAD;
> - struct rte_eth_rxmode *rx_conf = &dev->data->dev_conf.rxmode;
> + struct rte_eth_dev_data *dev_data = dev->data;
>
> hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
>
> if ((mtu < ETHER_MIN_MTU) || (max_frame >
> ETHER_MAX_JUMBO_FRAME_LEN))
> return -EINVAL;
>
> - /* refuse mtu that requires the support of scattered packets when
> this
> - * feature has not been enabled before.
> + /* If device is started, refuse mtu that requires the support of
> + * scattered packets when this feature has not been enabled before.
> */
> - if (!(rx_conf->offloads & DEV_RX_OFFLOAD_SCATTER) &&
> + if (dev_data->dev_started && !dev_data->scattered_rx &&
> (max_frame + 2 * IXGBE_VLAN_TAG_SIZE >
> - dev->data->min_rx_buf_size - RTE_PKTMBUF_HEADROOM))
> + dev->data->min_rx_buf_size - RTE_PKTMBUF_HEADROOM)) {
> + PMD_INIT_LOG(ERR, "Stop port first.");
> return -EINVAL;
> + }
>
> /*
> * When supported by the underlying PF driver, use the
> IXGBE_VF_SET_MTU
> --
> 2.19.1
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [dpdk-dev] [PATCH] net/ixgbevf: remove MTU setting limitation
2019-04-03 2:25 ` Zhao1, Wei
2019-04-03 2:25 ` Zhao1, Wei
@ 2019-04-03 12:36 ` David Harton (dharton)
2019-04-03 12:36 ` David Harton (dharton)
2019-04-08 6:13 ` Zhao1, Wei
2019-04-05 7:49 ` Zhang, Qi Z
2 siblings, 2 replies; 10+ messages in thread
From: David Harton (dharton) @ 2019-04-03 12:36 UTC (permalink / raw)
To: Zhao1, Wei, dev; +Cc: Lu, Wenzhuo, Ananyev, Konstantin, Zhang, Qi Z
Hi,
> -----Original Message-----
> From: Zhao1, Wei <wei.zhao1@intel.com>
> Sent: Tuesday, April 02, 2019 10:26 PM
> To: David Harton (dharton) <dharton@cisco.com>; dev@dpdk.org
> Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Ananyev, Konstantin
> <konstantin.ananyev@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>
> Subject: RE: [dpdk-dev] [PATCH] net/ixgbevf: remove MTU setting limitation
>
> HI,
>
> Why not add some more code
> "
> if (rx_conf->offloads & DEV_RX_OFFLOAD_SCATTER)
> dev->data->scattered_rx = 1;
> "
>
> Into ixgbevf_dev_rx_init() to enable scatter mode when start device?
I don't think it's necessary is it?
Doesn't this code in ixgbevf_dev_rx_init() handle it?
if (rxmode->offloads & DEV_RX_OFFLOAD_SCATTER ||
/* It adds dual VLAN length for supporting dual VLAN */
(rxmode->max_rx_pkt_len +
2 * IXGBE_VLAN_TAG_SIZE) > buf_size) {
if (!dev->data->scattered_rx)
PMD_INIT_LOG(DEBUG, "forcing scatter mode");
dev->data->scattered_rx = 1;
}
Regards,
Dave
>
>
> Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
>
>
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of David Harton
> > Sent: Wednesday, April 3, 2019 9:19 AM
> > To: dev@dpdk.org
> > Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Ananyev, Konstantin
> > <konstantin.ananyev@intel.com>; David Harton <dharton@cisco.com>
> > Subject: [dpdk-dev] [PATCH] net/ixgbevf: remove MTU setting limitation
> >
> > Currently, if requested MTU is bigger than mbuf size and scattered
> > receive is not enabled, setting MTU to that value fails.
> >
> > This patch allows setting this special MTU when device is stopped,
> > because scattered_rx will be re-configured during next port start and
> > driver may enable scattered receive according new MTU value.
> >
> > After this patch, driver may select different receive function
> > automatically after MTU set, according MTU values selected.
> >
> > Signed-off-by: David Harton <dharton@cisco.com>
> > ---
> > drivers/net/ixgbe/ixgbe_ethdev.c | 12 +++++++-----
> > 1 file changed, 7 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c
> > b/drivers/net/ixgbe/ixgbe_ethdev.c
> > index feec85634..0b962c8db 100644
> > --- a/drivers/net/ixgbe/ixgbe_ethdev.c
> > +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
> > @@ -6346,20 +6346,22 @@ ixgbevf_dev_set_mtu(struct rte_eth_dev *dev,
> > uint16_t mtu) {
> > struct ixgbe_hw *hw;
> > uint32_t max_frame = mtu + IXGBE_ETH_OVERHEAD;
> > - struct rte_eth_rxmode *rx_conf = &dev->data->dev_conf.rxmode;
> > + struct rte_eth_dev_data *dev_data = dev->data;
> >
> > hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
> >
> > if ((mtu < ETHER_MIN_MTU) || (max_frame >
> > ETHER_MAX_JUMBO_FRAME_LEN))
> > return -EINVAL;
> >
> > - /* refuse mtu that requires the support of scattered packets when
> > this
> > - * feature has not been enabled before.
> > + /* If device is started, refuse mtu that requires the support of
> > + * scattered packets when this feature has not been enabled before.
> > */
> > - if (!(rx_conf->offloads & DEV_RX_OFFLOAD_SCATTER) &&
> > + if (dev_data->dev_started && !dev_data->scattered_rx &&
> > (max_frame + 2 * IXGBE_VLAN_TAG_SIZE >
> > - dev->data->min_rx_buf_size - RTE_PKTMBUF_HEADROOM))
> > + dev->data->min_rx_buf_size - RTE_PKTMBUF_HEADROOM)) {
> > + PMD_INIT_LOG(ERR, "Stop port first.");
> > return -EINVAL;
> > + }
> >
> > /*
> > * When supported by the underlying PF driver, use the
> > IXGBE_VF_SET_MTU
> > --
> > 2.19.1
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [dpdk-dev] [PATCH] net/ixgbevf: remove MTU setting limitation
2019-04-03 12:36 ` David Harton (dharton)
@ 2019-04-03 12:36 ` David Harton (dharton)
2019-04-08 6:13 ` Zhao1, Wei
1 sibling, 0 replies; 10+ messages in thread
From: David Harton (dharton) @ 2019-04-03 12:36 UTC (permalink / raw)
To: Zhao1, Wei, dev; +Cc: Lu, Wenzhuo, Ananyev, Konstantin, Zhang, Qi Z
Hi,
> -----Original Message-----
> From: Zhao1, Wei <wei.zhao1@intel.com>
> Sent: Tuesday, April 02, 2019 10:26 PM
> To: David Harton (dharton) <dharton@cisco.com>; dev@dpdk.org
> Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Ananyev, Konstantin
> <konstantin.ananyev@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>
> Subject: RE: [dpdk-dev] [PATCH] net/ixgbevf: remove MTU setting limitation
>
> HI,
>
> Why not add some more code
> "
> if (rx_conf->offloads & DEV_RX_OFFLOAD_SCATTER)
> dev->data->scattered_rx = 1;
> "
>
> Into ixgbevf_dev_rx_init() to enable scatter mode when start device?
I don't think it's necessary is it?
Doesn't this code in ixgbevf_dev_rx_init() handle it?
if (rxmode->offloads & DEV_RX_OFFLOAD_SCATTER ||
/* It adds dual VLAN length for supporting dual VLAN */
(rxmode->max_rx_pkt_len +
2 * IXGBE_VLAN_TAG_SIZE) > buf_size) {
if (!dev->data->scattered_rx)
PMD_INIT_LOG(DEBUG, "forcing scatter mode");
dev->data->scattered_rx = 1;
}
Regards,
Dave
>
>
> Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
>
>
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of David Harton
> > Sent: Wednesday, April 3, 2019 9:19 AM
> > To: dev@dpdk.org
> > Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Ananyev, Konstantin
> > <konstantin.ananyev@intel.com>; David Harton <dharton@cisco.com>
> > Subject: [dpdk-dev] [PATCH] net/ixgbevf: remove MTU setting limitation
> >
> > Currently, if requested MTU is bigger than mbuf size and scattered
> > receive is not enabled, setting MTU to that value fails.
> >
> > This patch allows setting this special MTU when device is stopped,
> > because scattered_rx will be re-configured during next port start and
> > driver may enable scattered receive according new MTU value.
> >
> > After this patch, driver may select different receive function
> > automatically after MTU set, according MTU values selected.
> >
> > Signed-off-by: David Harton <dharton@cisco.com>
> > ---
> > drivers/net/ixgbe/ixgbe_ethdev.c | 12 +++++++-----
> > 1 file changed, 7 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c
> > b/drivers/net/ixgbe/ixgbe_ethdev.c
> > index feec85634..0b962c8db 100644
> > --- a/drivers/net/ixgbe/ixgbe_ethdev.c
> > +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
> > @@ -6346,20 +6346,22 @@ ixgbevf_dev_set_mtu(struct rte_eth_dev *dev,
> > uint16_t mtu) {
> > struct ixgbe_hw *hw;
> > uint32_t max_frame = mtu + IXGBE_ETH_OVERHEAD;
> > - struct rte_eth_rxmode *rx_conf = &dev->data->dev_conf.rxmode;
> > + struct rte_eth_dev_data *dev_data = dev->data;
> >
> > hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
> >
> > if ((mtu < ETHER_MIN_MTU) || (max_frame >
> > ETHER_MAX_JUMBO_FRAME_LEN))
> > return -EINVAL;
> >
> > - /* refuse mtu that requires the support of scattered packets when
> > this
> > - * feature has not been enabled before.
> > + /* If device is started, refuse mtu that requires the support of
> > + * scattered packets when this feature has not been enabled before.
> > */
> > - if (!(rx_conf->offloads & DEV_RX_OFFLOAD_SCATTER) &&
> > + if (dev_data->dev_started && !dev_data->scattered_rx &&
> > (max_frame + 2 * IXGBE_VLAN_TAG_SIZE >
> > - dev->data->min_rx_buf_size - RTE_PKTMBUF_HEADROOM))
> > + dev->data->min_rx_buf_size - RTE_PKTMBUF_HEADROOM)) {
> > + PMD_INIT_LOG(ERR, "Stop port first.");
> > return -EINVAL;
> > + }
> >
> > /*
> > * When supported by the underlying PF driver, use the
> > IXGBE_VF_SET_MTU
> > --
> > 2.19.1
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [dpdk-dev] [PATCH] net/ixgbevf: remove MTU setting limitation
2019-04-03 12:36 ` David Harton (dharton)
2019-04-03 12:36 ` David Harton (dharton)
@ 2019-04-08 6:13 ` Zhao1, Wei
2019-04-08 6:13 ` Zhao1, Wei
1 sibling, 1 reply; 10+ messages in thread
From: Zhao1, Wei @ 2019-04-08 6:13 UTC (permalink / raw)
To: David Harton (dharton), dev; +Cc: Lu, Wenzhuo, Ananyev, Konstantin, Zhang, Qi Z
Hi,
> -----Original Message-----
> From: David Harton (dharton) [mailto:dharton@cisco.com]
> Sent: Wednesday, April 3, 2019 8:36 PM
> To: Zhao1, Wei <wei.zhao1@intel.com>; dev@dpdk.org
> Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Ananyev, Konstantin
> <konstantin.ananyev@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>
> Subject: RE: [dpdk-dev] [PATCH] net/ixgbevf: remove MTU setting limitation
>
> Hi,
>
> > -----Original Message-----
> > From: Zhao1, Wei <wei.zhao1@intel.com>
> > Sent: Tuesday, April 02, 2019 10:26 PM
> > To: David Harton (dharton) <dharton@cisco.com>; dev@dpdk.org
> > Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Ananyev, Konstantin
> > <konstantin.ananyev@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>
> > Subject: RE: [dpdk-dev] [PATCH] net/ixgbevf: remove MTU setting
> > limitation
> >
> > HI,
> >
> > Why not add some more code
> > "
> > if (rx_conf->offloads & DEV_RX_OFFLOAD_SCATTER)
> > dev->data->scattered_rx = 1;
> > "
> >
> > Into ixgbevf_dev_rx_init() to enable scatter mode when start device?
>
> I don't think it's necessary is it?
>
> Doesn't this code in ixgbevf_dev_rx_init() handle it?
Sorry, miss that code.
>
> if (rxmode->offloads & DEV_RX_OFFLOAD_SCATTER ||
> /* It adds dual VLAN length for supporting dual VLAN */
> (rxmode->max_rx_pkt_len +
> 2 * IXGBE_VLAN_TAG_SIZE) > buf_size) {
> if (!dev->data->scattered_rx)
> PMD_INIT_LOG(DEBUG, "forcing scatter mode");
> dev->data->scattered_rx = 1;
> }
>
> Regards,
> Dave
>
> >
> >
> > Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
> >
> >
> > > -----Original Message-----
> > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of David Harton
> > > Sent: Wednesday, April 3, 2019 9:19 AM
> > > To: dev@dpdk.org
> > > Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Ananyev, Konstantin
> > > <konstantin.ananyev@intel.com>; David Harton <dharton@cisco.com>
> > > Subject: [dpdk-dev] [PATCH] net/ixgbevf: remove MTU setting
> > > limitation
> > >
> > > Currently, if requested MTU is bigger than mbuf size and scattered
> > > receive is not enabled, setting MTU to that value fails.
> > >
> > > This patch allows setting this special MTU when device is stopped,
> > > because scattered_rx will be re-configured during next port start
> > > and driver may enable scattered receive according new MTU value.
> > >
> > > After this patch, driver may select different receive function
> > > automatically after MTU set, according MTU values selected.
> > >
> > > Signed-off-by: David Harton <dharton@cisco.com>
> > > ---
> > > drivers/net/ixgbe/ixgbe_ethdev.c | 12 +++++++-----
> > > 1 file changed, 7 insertions(+), 5 deletions(-)
> > >
> > > diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c
> > > b/drivers/net/ixgbe/ixgbe_ethdev.c
> > > index feec85634..0b962c8db 100644
> > > --- a/drivers/net/ixgbe/ixgbe_ethdev.c
> > > +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
> > > @@ -6346,20 +6346,22 @@ ixgbevf_dev_set_mtu(struct rte_eth_dev
> *dev,
> > > uint16_t mtu) {
> > > struct ixgbe_hw *hw;
> > > uint32_t max_frame = mtu + IXGBE_ETH_OVERHEAD;
> > > - struct rte_eth_rxmode *rx_conf = &dev->data->dev_conf.rxmode;
> > > + struct rte_eth_dev_data *dev_data = dev->data;
> > >
> > > hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
> > >
> > > if ((mtu < ETHER_MIN_MTU) || (max_frame >
> > > ETHER_MAX_JUMBO_FRAME_LEN))
> > > return -EINVAL;
> > >
> > > - /* refuse mtu that requires the support of scattered packets when
> > > this
> > > - * feature has not been enabled before.
> > > + /* If device is started, refuse mtu that requires the support of
> > > + * scattered packets when this feature has not been enabled before.
> > > */
> > > - if (!(rx_conf->offloads & DEV_RX_OFFLOAD_SCATTER) &&
> > > + if (dev_data->dev_started && !dev_data->scattered_rx &&
> > > (max_frame + 2 * IXGBE_VLAN_TAG_SIZE >
> > > - dev->data->min_rx_buf_size - RTE_PKTMBUF_HEADROOM))
> > > + dev->data->min_rx_buf_size - RTE_PKTMBUF_HEADROOM)) {
> > > + PMD_INIT_LOG(ERR, "Stop port first.");
> > > return -EINVAL;
> > > + }
> > >
> > > /*
> > > * When supported by the underlying PF driver, use the
> > > IXGBE_VF_SET_MTU
> > > --
> > > 2.19.1
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [dpdk-dev] [PATCH] net/ixgbevf: remove MTU setting limitation
2019-04-08 6:13 ` Zhao1, Wei
@ 2019-04-08 6:13 ` Zhao1, Wei
0 siblings, 0 replies; 10+ messages in thread
From: Zhao1, Wei @ 2019-04-08 6:13 UTC (permalink / raw)
To: David Harton (dharton), dev; +Cc: Lu, Wenzhuo, Ananyev, Konstantin, Zhang, Qi Z
Hi,
> -----Original Message-----
> From: David Harton (dharton) [mailto:dharton@cisco.com]
> Sent: Wednesday, April 3, 2019 8:36 PM
> To: Zhao1, Wei <wei.zhao1@intel.com>; dev@dpdk.org
> Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Ananyev, Konstantin
> <konstantin.ananyev@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>
> Subject: RE: [dpdk-dev] [PATCH] net/ixgbevf: remove MTU setting limitation
>
> Hi,
>
> > -----Original Message-----
> > From: Zhao1, Wei <wei.zhao1@intel.com>
> > Sent: Tuesday, April 02, 2019 10:26 PM
> > To: David Harton (dharton) <dharton@cisco.com>; dev@dpdk.org
> > Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Ananyev, Konstantin
> > <konstantin.ananyev@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>
> > Subject: RE: [dpdk-dev] [PATCH] net/ixgbevf: remove MTU setting
> > limitation
> >
> > HI,
> >
> > Why not add some more code
> > "
> > if (rx_conf->offloads & DEV_RX_OFFLOAD_SCATTER)
> > dev->data->scattered_rx = 1;
> > "
> >
> > Into ixgbevf_dev_rx_init() to enable scatter mode when start device?
>
> I don't think it's necessary is it?
>
> Doesn't this code in ixgbevf_dev_rx_init() handle it?
Sorry, miss that code.
>
> if (rxmode->offloads & DEV_RX_OFFLOAD_SCATTER ||
> /* It adds dual VLAN length for supporting dual VLAN */
> (rxmode->max_rx_pkt_len +
> 2 * IXGBE_VLAN_TAG_SIZE) > buf_size) {
> if (!dev->data->scattered_rx)
> PMD_INIT_LOG(DEBUG, "forcing scatter mode");
> dev->data->scattered_rx = 1;
> }
>
> Regards,
> Dave
>
> >
> >
> > Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
> >
> >
> > > -----Original Message-----
> > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of David Harton
> > > Sent: Wednesday, April 3, 2019 9:19 AM
> > > To: dev@dpdk.org
> > > Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Ananyev, Konstantin
> > > <konstantin.ananyev@intel.com>; David Harton <dharton@cisco.com>
> > > Subject: [dpdk-dev] [PATCH] net/ixgbevf: remove MTU setting
> > > limitation
> > >
> > > Currently, if requested MTU is bigger than mbuf size and scattered
> > > receive is not enabled, setting MTU to that value fails.
> > >
> > > This patch allows setting this special MTU when device is stopped,
> > > because scattered_rx will be re-configured during next port start
> > > and driver may enable scattered receive according new MTU value.
> > >
> > > After this patch, driver may select different receive function
> > > automatically after MTU set, according MTU values selected.
> > >
> > > Signed-off-by: David Harton <dharton@cisco.com>
> > > ---
> > > drivers/net/ixgbe/ixgbe_ethdev.c | 12 +++++++-----
> > > 1 file changed, 7 insertions(+), 5 deletions(-)
> > >
> > > diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c
> > > b/drivers/net/ixgbe/ixgbe_ethdev.c
> > > index feec85634..0b962c8db 100644
> > > --- a/drivers/net/ixgbe/ixgbe_ethdev.c
> > > +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
> > > @@ -6346,20 +6346,22 @@ ixgbevf_dev_set_mtu(struct rte_eth_dev
> *dev,
> > > uint16_t mtu) {
> > > struct ixgbe_hw *hw;
> > > uint32_t max_frame = mtu + IXGBE_ETH_OVERHEAD;
> > > - struct rte_eth_rxmode *rx_conf = &dev->data->dev_conf.rxmode;
> > > + struct rte_eth_dev_data *dev_data = dev->data;
> > >
> > > hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
> > >
> > > if ((mtu < ETHER_MIN_MTU) || (max_frame >
> > > ETHER_MAX_JUMBO_FRAME_LEN))
> > > return -EINVAL;
> > >
> > > - /* refuse mtu that requires the support of scattered packets when
> > > this
> > > - * feature has not been enabled before.
> > > + /* If device is started, refuse mtu that requires the support of
> > > + * scattered packets when this feature has not been enabled before.
> > > */
> > > - if (!(rx_conf->offloads & DEV_RX_OFFLOAD_SCATTER) &&
> > > + if (dev_data->dev_started && !dev_data->scattered_rx &&
> > > (max_frame + 2 * IXGBE_VLAN_TAG_SIZE >
> > > - dev->data->min_rx_buf_size - RTE_PKTMBUF_HEADROOM))
> > > + dev->data->min_rx_buf_size - RTE_PKTMBUF_HEADROOM)) {
> > > + PMD_INIT_LOG(ERR, "Stop port first.");
> > > return -EINVAL;
> > > + }
> > >
> > > /*
> > > * When supported by the underlying PF driver, use the
> > > IXGBE_VF_SET_MTU
> > > --
> > > 2.19.1
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [dpdk-dev] [PATCH] net/ixgbevf: remove MTU setting limitation
2019-04-03 2:25 ` Zhao1, Wei
2019-04-03 2:25 ` Zhao1, Wei
2019-04-03 12:36 ` David Harton (dharton)
@ 2019-04-05 7:49 ` Zhang, Qi Z
2019-04-05 7:49 ` Zhang, Qi Z
2 siblings, 1 reply; 10+ messages in thread
From: Zhang, Qi Z @ 2019-04-05 7:49 UTC (permalink / raw)
To: Zhao1, Wei, David Harton, dev; +Cc: Lu, Wenzhuo, Ananyev, Konstantin
> -----Original Message-----
> From: Zhao1, Wei
> Sent: Wednesday, April 3, 2019 10:26 AM
> To: David Harton <dharton@cisco.com>; dev@dpdk.org
> Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Ananyev, Konstantin
> <konstantin.ananyev@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>
> Subject: RE: [dpdk-dev] [PATCH] net/ixgbevf: remove MTU setting limitation
>
> HI,
>
> Why not add some more code
> "
> if (rx_conf->offloads & DEV_RX_OFFLOAD_SCATTER)
> dev->data->scattered_rx = 1;
> "
>
> Into ixgbevf_dev_rx_init() to enable scatter mode when start device?
>
>
> Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
>
>
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of David Harton
> > Sent: Wednesday, April 3, 2019 9:19 AM
> > To: dev@dpdk.org
> > Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Ananyev, Konstantin
> > <konstantin.ananyev@intel.com>; David Harton <dharton@cisco.com>
> > Subject: [dpdk-dev] [PATCH] net/ixgbevf: remove MTU setting limitation
> >
> > Currently, if requested MTU is bigger than mbuf size and scattered
> > receive is not enabled, setting MTU to that value fails.
> >
> > This patch allows setting this special MTU when device is stopped,
> > because scattered_rx will be re-configured during next port start and
> > driver may enable scattered receive according new MTU value.
> >
> > After this patch, driver may select different receive function
> > automatically after MTU set, according MTU values selected.
> >
> > Signed-off-by: David Harton <dharton@cisco.com>
Applied to dpdk-next-net-intel.
Thanks
Qi
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [dpdk-dev] [PATCH] net/ixgbevf: remove MTU setting limitation
2019-04-05 7:49 ` Zhang, Qi Z
@ 2019-04-05 7:49 ` Zhang, Qi Z
0 siblings, 0 replies; 10+ messages in thread
From: Zhang, Qi Z @ 2019-04-05 7:49 UTC (permalink / raw)
To: Zhao1, Wei, David Harton, dev; +Cc: Lu, Wenzhuo, Ananyev, Konstantin
> -----Original Message-----
> From: Zhao1, Wei
> Sent: Wednesday, April 3, 2019 10:26 AM
> To: David Harton <dharton@cisco.com>; dev@dpdk.org
> Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Ananyev, Konstantin
> <konstantin.ananyev@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>
> Subject: RE: [dpdk-dev] [PATCH] net/ixgbevf: remove MTU setting limitation
>
> HI,
>
> Why not add some more code
> "
> if (rx_conf->offloads & DEV_RX_OFFLOAD_SCATTER)
> dev->data->scattered_rx = 1;
> "
>
> Into ixgbevf_dev_rx_init() to enable scatter mode when start device?
>
>
> Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
>
>
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of David Harton
> > Sent: Wednesday, April 3, 2019 9:19 AM
> > To: dev@dpdk.org
> > Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Ananyev, Konstantin
> > <konstantin.ananyev@intel.com>; David Harton <dharton@cisco.com>
> > Subject: [dpdk-dev] [PATCH] net/ixgbevf: remove MTU setting limitation
> >
> > Currently, if requested MTU is bigger than mbuf size and scattered
> > receive is not enabled, setting MTU to that value fails.
> >
> > This patch allows setting this special MTU when device is stopped,
> > because scattered_rx will be re-configured during next port start and
> > driver may enable scattered receive according new MTU value.
> >
> > After this patch, driver may select different receive function
> > automatically after MTU set, according MTU values selected.
> >
> > Signed-off-by: David Harton <dharton@cisco.com>
Applied to dpdk-next-net-intel.
Thanks
Qi
^ permalink raw reply [flat|nested] 10+ messages in thread