* [dpdk-dev] [PATCH] ixgbe: check scatter_enable in set_mtu
@ 2017-04-28 6:11 Jia Yu
2017-05-02 0:51 ` Lu, Wenzhuo
0 siblings, 1 reply; 5+ messages in thread
From: Jia Yu @ 2017-04-28 6:11 UTC (permalink / raw)
To: wenzhuo.lu, konstantin.ananyev; +Cc: dev, Jia Yu
There exists case that software sets mtu (i.e jumbo frame) of
ixgbe device when it's stopped. Before the fix, scattered_rx
is cleared during device stop, and setting jumbo frame mtu
after device stop will always fail as scattered_rx is 0.
Signed-off-by: Jia Yu <jyu@vmware.com>
---
drivers/net/ixgbe/ixgbe_ethdev.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 7b856bb..aa5ba8c 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -4671,6 +4671,7 @@ ixgbe_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
struct ixgbe_hw *hw;
struct rte_eth_dev_info dev_info;
uint32_t frame_size = mtu + ETHER_HDR_LEN + ETHER_CRC_LEN;
+ struct rte_eth_rxmode *rx_conf = &dev->data->dev_conf.rxmode;
ixgbe_dev_info_get(dev, &dev_info);
@@ -4681,7 +4682,7 @@ ixgbe_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
/* refuse mtu that requires the support of scattered packets when this
* feature has not been enabled before.
*/
- if (!dev->data->scattered_rx &&
+ if (!rx_conf->enable_scatter &&
(frame_size + 2 * IXGBE_VLAN_TAG_SIZE >
dev->data->min_rx_buf_size - RTE_PKTMBUF_HEADROOM))
return -EINVAL;
@@ -5939,6 +5940,7 @@ ixgbevf_dev_set_mtu(struct rte_eth_dev *dev, uint16_t mtu)
{
struct ixgbe_hw *hw;
uint32_t max_frame = mtu + ETHER_HDR_LEN + ETHER_CRC_LEN;
+ struct rte_eth_rxmode *rx_conf = &dev->data->dev_conf.rxmode;
hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
@@ -5948,7 +5950,7 @@ ixgbevf_dev_set_mtu(struct rte_eth_dev *dev, uint16_t mtu)
/* refuse mtu that requires the support of scattered packets when this
* feature has not been enabled before.
*/
- if (!dev->data->scattered_rx &&
+ if (!rx_conf->enable_scatter &&
(max_frame + 2 * IXGBE_VLAN_TAG_SIZE >
dev->data->min_rx_buf_size - RTE_PKTMBUF_HEADROOM))
return -EINVAL;
--
2.7.4
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-dev] [PATCH] ixgbe: check scatter_enable in set_mtu
2017-04-28 6:11 [dpdk-dev] [PATCH] ixgbe: check scatter_enable in set_mtu Jia Yu
@ 2017-05-02 0:51 ` Lu, Wenzhuo
2017-05-05 15:18 ` Thomas Monjalon
0 siblings, 1 reply; 5+ messages in thread
From: Lu, Wenzhuo @ 2017-05-02 0:51 UTC (permalink / raw)
To: Jia Yu, Ananyev, Konstantin; +Cc: dev
Hi,
> -----Original Message-----
> From: Jia Yu [mailto:jyu@vmware.com]
> Sent: Friday, April 28, 2017 2:12 PM
> To: Lu, Wenzhuo; Ananyev, Konstantin
> Cc: dev@dpdk.org; Jia Yu
> Subject: [PATCH] ixgbe: check scatter_enable in set_mtu
>
> There exists case that software sets mtu (i.e jumbo frame) of ixgbe device
> when it's stopped. Before the fix, scattered_rx is cleared during device stop,
> and setting jumbo frame mtu after device stop will always fail as
> scattered_rx is 0.
>
> Signed-off-by: Jia Yu <jyu@vmware.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-dev] [PATCH] ixgbe: check scatter_enable in set_mtu
2017-05-02 0:51 ` Lu, Wenzhuo
@ 2017-05-05 15:18 ` Thomas Monjalon
0 siblings, 0 replies; 5+ messages in thread
From: Thomas Monjalon @ 2017-05-05 15:18 UTC (permalink / raw)
To: Jia Yu; +Cc: dev, Lu, Wenzhuo, Ananyev, Konstantin
02/05/2017 02:51, Lu, Wenzhuo:
> From: Jia Yu [mailto:jyu@vmware.com]
> >
> > There exists case that software sets mtu (i.e jumbo frame) of ixgbe device
> > when it's stopped. Before the fix, scattered_rx is cleared during device stop,
> > and setting jumbo frame mtu after device stop will always fail as
> > scattered_rx is 0.
> >
> > Signed-off-by: Jia Yu <jyu@vmware.com>
> Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Applied, thanks
^ permalink raw reply [flat|nested] 5+ messages in thread
* [dpdk-dev] [PATCH] ixgbe: check scatter_enable in set_mtu
@ 2017-04-27 21:12 Jia Yu
2017-04-28 0:49 ` Lu, Wenzhuo
0 siblings, 1 reply; 5+ messages in thread
From: Jia Yu @ 2017-04-27 21:12 UTC (permalink / raw)
To: wenzhuo.lu, konstantin.ananyev; +Cc: dev, Jia Yu
There exists case that software sets mtu (i.e jumbo frame) of
ixgbe device when it's stopped. Before the fix, scattered_rx
is cleared during device stop, and setting jumbo frame mtu
after device stop will always fail as scattered_rx is 0.
---
drivers/net/ixgbe/ixgbe_ethdev.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 7b856bb..aa5ba8c 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -4671,6 +4671,7 @@ ixgbe_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
struct ixgbe_hw *hw;
struct rte_eth_dev_info dev_info;
uint32_t frame_size = mtu + ETHER_HDR_LEN + ETHER_CRC_LEN;
+ struct rte_eth_rxmode *rx_conf = &dev->data->dev_conf.rxmode;
ixgbe_dev_info_get(dev, &dev_info);
@@ -4681,7 +4682,7 @@ ixgbe_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
/* refuse mtu that requires the support of scattered packets when this
* feature has not been enabled before.
*/
- if (!dev->data->scattered_rx &&
+ if (!rx_conf->enable_scatter &&
(frame_size + 2 * IXGBE_VLAN_TAG_SIZE >
dev->data->min_rx_buf_size - RTE_PKTMBUF_HEADROOM))
return -EINVAL;
@@ -5939,6 +5940,7 @@ ixgbevf_dev_set_mtu(struct rte_eth_dev *dev, uint16_t mtu)
{
struct ixgbe_hw *hw;
uint32_t max_frame = mtu + ETHER_HDR_LEN + ETHER_CRC_LEN;
+ struct rte_eth_rxmode *rx_conf = &dev->data->dev_conf.rxmode;
hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
@@ -5948,7 +5950,7 @@ ixgbevf_dev_set_mtu(struct rte_eth_dev *dev, uint16_t mtu)
/* refuse mtu that requires the support of scattered packets when this
* feature has not been enabled before.
*/
- if (!dev->data->scattered_rx &&
+ if (!rx_conf->enable_scatter &&
(max_frame + 2 * IXGBE_VLAN_TAG_SIZE >
dev->data->min_rx_buf_size - RTE_PKTMBUF_HEADROOM))
return -EINVAL;
--
2.7.4
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-dev] [PATCH] ixgbe: check scatter_enable in set_mtu
2017-04-27 21:12 Jia Yu
@ 2017-04-28 0:49 ` Lu, Wenzhuo
0 siblings, 0 replies; 5+ messages in thread
From: Lu, Wenzhuo @ 2017-04-28 0:49 UTC (permalink / raw)
To: Jia Yu, Ananyev, Konstantin; +Cc: dev
Hi Jia,
> -----Original Message-----
> From: Jia Yu [mailto:jyu@vmware.com]
> Sent: Friday, April 28, 2017 5:13 AM
> To: Lu, Wenzhuo; Ananyev, Konstantin
> Cc: dev@dpdk.org; Jia Yu
> Subject: [PATCH] ixgbe: check scatter_enable in set_mtu
>
> There exists case that software sets mtu (i.e jumbo frame) of ixgbe device
> when it's stopped. Before the fix, scattered_rx is cleared during device stop,
> and setting jumbo frame mtu after device stop will always fail as
> scattered_rx is 0.
> ---
> drivers/net/ixgbe/ixgbe_ethdev.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
I'd like to ack this patch, but I found not sign-off. Would you like to send a new version with sign-off? And you can add my ack in it.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-05-05 15:18 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-28 6:11 [dpdk-dev] [PATCH] ixgbe: check scatter_enable in set_mtu Jia Yu
2017-05-02 0:51 ` Lu, Wenzhuo
2017-05-05 15:18 ` Thomas Monjalon
-- strict thread matches above, loose matches on Subject: below --
2017-04-27 21:12 Jia Yu
2017-04-28 0:49 ` Lu, Wenzhuo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).