net/virtio: add mtu set in virtio
PATCH v5 1/1 net/virtio: add mtu set in virtio
Virtio interfaces should also support setting of mtu, as in case of cloud it is expected to have the consistent mtu across the infrastructure that the dhcp server sends and not hardcoded to 1500(default).
In case when GRE/VXLAN tunneling is used, it adds overheads to the total size of 1518, and in that cases the DHCP server corrects the L3 MTU to 1454 to take care of the overhead. BUt since virtio interfaces was not having the mtu set that mtu sent by dhcp was ignored and teh instance will still send packets with 1500 mtu which afetr encapsulation will become more than 1518 and eventually gets dropped in the infrastructure. This issue can be solved by honoring the mtu 1454 sent by dhcp server, which this below patch will take care.
Changes in v5: Incorporated review comments.
Changes in v4: Incorporated review comments.
Changes in v3: Corrected few style errors as reported by sys-stv. Changes in v2: Incorporated review comments.
--- drivers/net/virtio/virtio_ethdev.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)
drivers/net/virtio/virtio_ethdev.c +17 -0
@@ -653,12 +653,20 @@ virtio_dev_allmulticast_disable(struct rte_eth_dev *dev)PMD_INIT_LOG (ERR ,"Failed to disable allmulticast" ); } +#define VLAN_TAG_SIZE 4/* 802.3ac tag (not DMA'd) */ + +static int virtio_mtu_set (struct rte_eth_dev *dev,uint16_t mtu) +{ +struct rte_eth_dev_info dev_info; +uint32_t ether_hdr_len =ETHER_HDR_LEN +ETHER_CRC_LEN +VLAN_TAG_SIZE ; +uint32_t frame_size = mtu + ether_hdr_len; + +virtio_dev_info_get (dev, &dev_info); + +if (frame_size <ETHER_MIN_MTU || frame_size > dev_info.max_rx_pktlen) { +PMD_INIT_LOG (ERR ,"MTU should be between %d and %d\n" , + (ETHER_MIN_MTU - ether_hdr_len), + (dev_info.max_rx_pktlen - ether_hdr_len)); +return -EINVAL ; + } +return 0 ;
+}
@@ -677,7 +685,6 @@ static const struct eth_dev_ops virtio_eth_dev_ops = {
.allmulticast_enable = virtio_dev_allmulticast_enable,
.allmulticast_disable = virtio_dev_allmulticast_disable,
+ .mtu_set = virtio_mtu_set,
.dev_infos_get = virtio_dev_info_get,
.stats_get = virtio_dev_stats_get,
.xstats_get = virtio_dev_xstats_get,Signature · 1 line
2.9.3.windows.1
Quoted 2 lines
Hi Souvik,
There are some very basic errors in this patch, particularly with respect to format.
Review comments are inline - please address same and resubmit the patch. I also recommend running $DPDK_DIR/utilities/checkpatch.py on any future submissions.
Thanks,
Mark
Quoted 1 line
As a general comment, please capitalize 'MTU' throughout the commit message.
Quoted 1 line
Virtio interfaces should also support setting of mtu, as in case of cloud
'also' is redundant in the above sentence - please remove it.
Quoted 2 lines
it is expected to have the consistent mtu across the infrastructure that the dhcp server sends and not hardcoded to 1500(default).
Try to make the problem statement here more general, before going into specifics.
i.e. something along the lines of
"Virtio interfaces do not currently allow the user to specify a particular Maximum Transmission Unit (MTU).
Consequently, the MTU of Virtio interfaces is typically set to the Ethernet default value of 1500.
This is problematic in the case of cloud deployments, in which a specific (and potentially non-standard) MTU needs to be set by a DHCP server, and honored by all interfaces across the traffic path. ...., etc., etc."
Quoted 1 line
In case when GRE/VXLAN tunneling is used, it adds overheads to the total
Please be specific in your description - what is 'it' in the above context?
Quoted 2 lines
size of 1518, and in that cases the DHCP server corrects the L3 MTU to 1454 to take care of the overhead. BUt since virtio interfaces was not having the
Should be lowercase 'u' in 'But'
Quoted 1 line
mtu set that mtu sent by dhcp was ignored and teh instance will still send
Typo - 'teh'
Quoted 1 line
packets with 1500 mtu which afetr encapsulation will become more than 1518
Typo - 'afetr'
Quoted 3 lines
and eventually gets dropped in the infrastructure. This issue can be solved by honoring the mtu 1454 sent by dhcp server, which this below patch will take care.
Explain how the patch resolves the issue (i.e. by adding an additional 'set_mtu' function to the Virtio driver, which can be leveraged by the dhcp server/controller).
Quoted 3 lines
Changes in v5: Incorporated review comments.
It is implicit that a new patch version incorporates review comments.
To make things easier for the reviewer, please provide concise descriptions of the changes made/review comments addressed.
For example:
v5:
- Fix log message for out-of-bounds MTU parameter in virtio_mtu_set
- Calculate frame size, based on 'mtu' parameter, for upper bounds check in virtio_mtu_set
- ....
- etc., etc.
Quoted 7 lines
Changes in v4: Incorporated review comments.
Changes in v3: Corrected few style errors as reported by sys-stv. Changes in v2: Incorporated review comments.Signed-off-by Souvik Dey <[email protected]>---
Version history should not be part of the commit message - please move it to below this dashed line.
Quoted 8 lines
drivers/net/virtio/virtio_ethdev.c| 19 +++++++++++++++++++1 file changed, 19 insertions(+)drivers/net/virtio/virtio_ethdev.c +0
-0
drivers/net/virtio/virtio_ethdev.c virtio_dev_allmulticast_disable(struct rte_eth_dev *dev) · line 658
Quoted 6 lines
drivers/net/virtio/virtio_ethdev.c +3
-0@@ -653,12 +653,20 @@ virtio_dev_allmulticast_disable(struct rte_eth_dev *dev)PMD_INIT_LOG (ERR ,"Failed to disable allmulticast" ); } +#define VLAN_TAG_SIZE 4/* 802.3ac tag (not DMA'd) */ + +static int virtio_mtu_set (struct rte_eth_dev *dev,uint16_t mtu)
Additional whitespace between 'int' and 'virtio_mtu_set' - please remove.
Quoted 24 lines
drivers/net/virtio/virtio_ethdev.c +16
-1+{ +struct rte_eth_dev_info dev_info; +uint32_t ether_hdr_len =ETHER_HDR_LEN +ETHER_CRC_LEN +VLAN_TAG_SIZE ; +uint32_t frame_size = mtu + ether_hdr_len; + +virtio_dev_info_get (dev, &dev_info); + +if (frame_size <ETHER_MIN_MTU || frame_size > dev_info.max_rx_pktlen) { +PMD_INIT_LOG (ERR ,"MTU should be between %d and %d\n" , + (ETHER_MIN_MTU - ether_hdr_len), + (dev_info.max_rx_pktlen - ether_hdr_len)); +return -EINVAL ; + } +return 0 ; +}@@ -677,7 +685,6 @@ static const struct eth_dev_ops virtio_eth_dev_ops = { .allmulticast_enable = virtio_dev_allmulticast_enable, .allmulticast_disable = virtio_dev_allmulticast_disable, + .mtu_set = virtio_mtu_set, .dev_infos_get = virtio_dev_info_get, .stats_get = virtio_dev_stats_get, .xstats_get = virtio_dev_xstats_get, --2.9.3.windows.1
PATCH v6 1/1 net/virtio: add set_mtu in virtio
In reply to souvikdey33Virtio interfaces do not currently allow the user to specify a particular Maximum Transmission Unit (MTU).Consequently, the MTU of Virtio interfaces is typically set to the Ethernet default value of 1500.
This is problematic in the case of cloud deployments, in which a specific (and potentially non-standard) MTU needs to be set by a DHCP server, which needs to be honored by all interfaces across the traffic path.To acheive this Virtio interfaces should support setting of MTU.
In case when GRE/VXLAN tunneling is used for internal communication, there will be an overhead added by the infrastructure in the packet over and above the ETHER MTU of 1518. So to take care of this overhead in these cases the DHCP server corrects the L3 MTU to 1454. But since virtio interfaces was not having the MTU set functionality that MTU sent by the DHCP server was ignored and the instance will still send packets with 1500 MTU which after encapsulation will become more than 1518 and eventually gets dropped in the infrastructure.
By adding an additional 'set_mtu' function to the Virtio driver, we can honor the MTU sent by the DHCP server. The dhcp server/controller can then leverage this 'set_mtu' functionality to resolve the above mentioned issue of packets getting dropped due to incorrect size.
---
Changes in v6:
- Description of change corrected
- Corrected the identations
- Corrected the subject line too
- The From line was also not correct
- Re-submitting as the below patch was not proper
Changes in v5:
- Fix log message for out-of-bounds MTU parameter in virtio_mtu_set
- Calculate frame size, based on 'mtu' parameter
- Corrected the upper bound and lower bound checks in virtio_mtu_set Changes in v4: Incorporated review comments.
Changes in v3: Corrected few style errors as reported by sys-stv. Changes in v2: Incorporated review comments.
drivers/net/virtio/virtio_ethdev.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)
drivers/net/virtio/virtio_ethdev.c +17 -0
@@ -653,12 +653,20 @@ virtio_dev_allmulticast_disable(struct rte_eth_dev *dev)PMD_INIT_LOG (ERR ,"Failed to disable allmulticast" ); } +#define VLAN_TAG_SIZE 4/* 802.3ac tag (not DMA'd) */ + +static int virtio_mtu_set (struct rte_eth_dev *dev,uint16_t mtu) +{ +struct rte_eth_dev_info dev_info; +uint32_t ether_hdr_len =ETHER_HDR_LEN +ETHER_CRC_LEN +VLAN_TAG_SIZE ; +uint32_t frame_size = mtu + ether_hdr_len; + +virtio_dev_info_get (dev, &dev_info); + +if (mtu <ETHER_MIN_MTU || frame_size > dev_info.max_rx_pktlen) { +PMD_INIT_LOG (ERR ,"MTU should be between %d and %d\n" , +ETHER_MIN_MTU , + (dev_info.max_rx_pktlen - ether_hdr_len)); +return -EINVAL ; + } +return 0 ;
+}
/*
* dev_ops for virtio, bare necessities for basic operation */
@@ -677,7 +685,6 @@ static const struct eth_dev_ops virtio_eth_dev_ops = {
.allmulticast_enable = virtio_dev_allmulticast_enable, .allmulticast_disable = virtio_dev_allmulticast_disable, + .mtu_set = virtio_mtu_set, .dev_infos_get = virtio_dev_info_get, .stats_get = virtio_dev_stats_get, .xstats_get = virtio_dev_xstats_get,
Signature · 1 line
2.9.3.windows.1
PATCH v7 1/1 net/virtio: add set_mtu in virtio
Virtio interfaces do not currently allow the user to specify a particular Maximum Transmission Unit (MTU).Consequently, the MTU of Virtio interfaces is typically set to the Ethernet default value of 1500.
This is problematic in the case of cloud deployments, in which a specific (and potentially non-standard) MTU needs to be set by a DHCP server, which needs to be honored by all interfaces across the traffic path.To acheive this Virtio interfaces should support setting of MTU.
In case when GRE/VXLAN tunneling is used for internal communication, there will be an overhead added by the infrastructure in the packet over and above the ETHER MTU of 1518. So to take care of this overhead in these cases the DHCP server corrects the L3 MTU to 1454. But since virtio interfaces was not having the MTU set functionality that MTU sent by the DHCP server was ignored and the instance will still send packets with 1500 MTU which after encapsulation will become more than 1518 and eventually gets dropped in the infrastructure.
By adding an additional 'set_mtu' function to the Virtio driver, we can honor the MTU sent by the DHCP server. The dhcp server/controller can then leverage this 'set_mtu' functionality to resolve the above mentioned issue of packets getting dropped due to incorrect size.
---
Changes in v7:
- Replaced the CRC_LEN with the merge rx buf header length.
- Changed the frame_len max validation to VIRTIO_MAX_RX_PKTLEN. Changes in v6:
- Description of change corrected
- Corrected the identations
- Corrected the subject line too
- The From line was also not correct
- Re-submitting as the below patch was not proper
Changes in v5:
- Fix log message for out-of-bounds MTU parameter in virtio_mtu_set
- Calculate frame size, based on 'mtu' parameter
- Corrected the upper bound and lower bound checks in virtio_mtu_set Changes in v4: Incorporated review comments.
Changes in v3: Corrected few style errors as reported by sys-stv. Changes in v2: Incorporated review comments.
drivers/net/virtio/virtio_ethdev.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
drivers/net/virtio/virtio_ethdev.c +15 -0
@@ -653,12 +653,20 @@ virtio_dev_allmulticast_disable(struct rte_eth_dev *dev)PMD_INIT_LOG (ERR ,"Failed to disable allmulticast" ); } +#define VLAN_TAG_LEN 4/* 802.3ac tag (not DMA'd) */ +static int virtio_mtu_set (struct rte_eth_dev *dev,uint16_t mtu) +{ +struct virtio_hw *hw = dev->data->dev_private; +uint32_t ether_hdr_len =ETHER_HDR_LEN +VLAN_TAG_LEN + + hw->vtnet_hdr_size; +uint32_t frame_size = mtu + ether_hdr_len; + +if (mtu <ETHER_MIN_MTU || frame_size >VIRTIO_MAX_RX_PKTLEN ) { +PMD_INIT_LOG (ERR ,"MTU should be between %d and %d\n" , +ETHER_MIN_MTU ,VIRTIO_MAX_RX_PKTLEN ); +return -EINVAL ; + } +return 0 ; +}/*
* dev_ops for virtio, bare necessities for basic operation */
@@ -677,7 +685,6 @@ static const struct eth_dev_ops virtio_eth_dev_ops = {
.allmulticast_enable = virtio_dev_allmulticast_enable, .allmulticast_disable = virtio_dev_allmulticast_disable, + .mtu_set = virtio_mtu_set, .dev_infos_get = virtio_dev_info_get, .stats_get = virtio_dev_stats_get, .xstats_get = virtio_dev_xstats_get,
Signature · 1 line
2.9.3.windows.1
Re: [PATCH v7] net/virtio: add set_mtu in virtio
Hi Liu/Stephen/Mark,
I have submitted Version 7 of this patch. Do let me know if this looks proper.
--
Regards,
Souvik
-----Original Message-----
From: Dey, Souvik
Sent: Thursday, September 29, 2016 4:32 PM
To: [email protected]; [email protected]; [email protected]; [email protected]
Cc: Dey, Souvik <[email protected]>
Subject: [PATCH v7] net/virtio: add set_mtu in virtio
Virtio interfaces do not currently allow the user to specify a particular Maximum Transmission Unit (MTU).Consequently, the MTU of Virtio interfaces is typically set to the Ethernet default value of 1500.
This is problematic in the case of cloud deployments, in which a specific (and potentially non-standard) MTU needs to be set by a DHCP server, which needs to be honored by all interfaces across the traffic path.To acheive this Virtio interfaces should support setting of MTU.
In case when GRE/VXLAN tunneling is used for internal communication, there will be an overhead added by the infrastructure in the packet over and above the ETHER MTU of 1518. So to take care of this overhead in these cases the DHCP server corrects the L3 MTU to 1454. But since virtio interfaces was not having the MTU set functionality that MTU sent by the DHCP server was ignored and the instance will still send packets with 1500 MTU which after encapsulation will become more than 1518 and eventually gets dropped in the infrastructure.
By adding an additional 'set_mtu' function to the Virtio driver, we can honor the MTU sent by the DHCP server. The dhcp server/controller can then leverage this 'set_mtu' functionality to resolve the above mentioned issue of packets getting dropped due to incorrect size.
---
Changes in v7:
- Replaced the CRC_LEN with the merge rx buf header length.
- Changed the frame_len max validation to VIRTIO_MAX_RX_PKTLEN. Changes in v6:
- Description of change corrected
- Corrected the identations
- Corrected the subject line too
- The From line was also not correct
- Re-submitting as the below patch was not proper
Changes in v5:
- Fix log message for out-of-bounds MTU parameter in virtio_mtu_set
- Calculate frame size, based on 'mtu' parameter
- Corrected the upper bound and lower bound checks in virtio_mtu_set Changes in v4: Incorporated review comments.
Changes in v3: Corrected few style errors as reported by sys-stv. Changes in v2: Incorporated review comments.
drivers/net/virtio/virtio_ethdev.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
drivers/net/virtio/virtio_ethdev.c +15 -0
@@ -653,12 +653,20 @@ virtio_dev_allmulticast_disable(struct rte_eth_dev *dev)PMD_INIT_LOG (ERR ,"Failed to disable allmulticast" ); } +#define VLAN_TAG_LEN 4/* 802.3ac tag (not DMA'd) */ +static int virtio_mtu_set (struct rte_eth_dev *dev,uint16_t mtu) +{ +struct virtio_hw *hw = dev->data->dev_private; +uint32_t ether_hdr_len =ETHER_HDR_LEN +VLAN_TAG_LEN + + hw->vtnet_hdr_size; +uint32_t frame_size = mtu + ether_hdr_len; + +if (mtu <ETHER_MIN_MTU || frame_size >VIRTIO_MAX_RX_PKTLEN ) { +PMD_INIT_LOG (ERR ,"MTU should be between %d and %d\n" , +ETHER_MIN_MTU ,VIRTIO_MAX_RX_PKTLEN ); +return -EINVAL ; + } +return 0 ; +}/*
* dev_ops for virtio, bare necessities for basic operation */
@@ -677,7 +685,6 @@ static const struct eth_dev_ops virtio_eth_dev_ops = {
.allmulticast_enable = virtio_dev_allmulticast_enable, .allmulticast_disable = virtio_dev_allmulticast_disable, + .mtu_set = virtio_mtu_set, .dev_infos_get = virtio_dev_info_get, .stats_get = virtio_dev_stats_get, .xstats_get = virtio_dev_xstats_get,
Signature · 1 line
2.9.3.windows.1
Re: [PATCH v7] net/virtio: add set_mtu in virtio
In reply to DeyHi All,
Is there any further comments or modifications required for this patch, or what next steps do you guys suggest here ?
--
Regards,
Souvik
-----Original Message-----
From: Dey, Souvik
Sent: Saturday, October 1, 2016 10:09 AM
To: [email protected]; [email protected]; [email protected]; [email protected]
Subject: RE: [PATCH v7] net/virtio: add set_mtu in virtio
Hi Liu/Stephen/Mark,
I have submitted Version 7 of this patch. Do let me know if this looks proper.
--
Regards,
Souvik
-----Original Message-----
From: Dey, Souvik
Sent: Thursday, September 29, 2016 4:32 PM
To: [email protected]; [email protected]; [email protected]; [email protected]
Cc: Dey, Souvik <[email protected]>
Subject: [PATCH v7] net/virtio: add set_mtu in virtio
Virtio interfaces do not currently allow the user to specify a particular Maximum Transmission Unit (MTU).Consequently, the MTU of Virtio interfaces is typically set to the Ethernet default value of 1500.
This is problematic in the case of cloud deployments, in which a specific (and potentially non-standard) MTU needs to be set by a DHCP server, which needs to be honored by all interfaces across the traffic path.To acheive this Virtio interfaces should support setting of MTU.
In case when GRE/VXLAN tunneling is used for internal communication, there will be an overhead added by the infrastructure in the packet over and above the ETHER MTU of 1518. So to take care of this overhead in these cases the DHCP server corrects the L3 MTU to 1454. But since virtio interfaces was not having the MTU set functionality that MTU sent by the DHCP server was ignored and the instance will still send packets with 1500 MTU which after encapsulation will become more than 1518 and eventually gets dropped in the infrastructure.
By adding an additional 'set_mtu' function to the Virtio driver, we can honor the MTU sent by the DHCP server. The dhcp server/controller can then leverage this 'set_mtu' functionality to resolve the above mentioned issue of packets getting dropped due to incorrect size.
---
Changes in v7:
- Replaced the CRC_LEN with the merge rx buf header length.
- Changed the frame_len max validation to VIRTIO_MAX_RX_PKTLEN. Changes in v6:
- Description of change corrected
- Corrected the identations
- Corrected the subject line too
- The From line was also not correct
- Re-submitting as the below patch was not proper
Changes in v5:
- Fix log message for out-of-bounds MTU parameter in virtio_mtu_set
- Calculate frame size, based on 'mtu' parameter
- Corrected the upper bound and lower bound checks in virtio_mtu_set Changes in v4: Incorporated review comments.
Changes in v3: Corrected few style errors as reported by sys-stv. Changes in v2: Incorporated review comments.
drivers/net/virtio/virtio_ethdev.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
drivers/net/virtio/virtio_ethdev.c +15 -0
@@ -653,12 +653,20 @@ virtio_dev_allmulticast_disable(struct rte_eth_dev *dev)PMD_INIT_LOG (ERR ,"Failed to disable allmulticast" ); } +#define VLAN_TAG_LEN 4/* 802.3ac tag (not DMA'd) */ +static int virtio_mtu_set (struct rte_eth_dev *dev,uint16_t mtu) +{ +struct virtio_hw *hw = dev->data->dev_private; +uint32_t ether_hdr_len =ETHER_HDR_LEN +VLAN_TAG_LEN + + hw->vtnet_hdr_size; +uint32_t frame_size = mtu + ether_hdr_len; + +if (mtu <ETHER_MIN_MTU || frame_size >VIRTIO_MAX_RX_PKTLEN ) { +PMD_INIT_LOG (ERR ,"MTU should be between %d and %d\n" , +ETHER_MIN_MTU ,VIRTIO_MAX_RX_PKTLEN ); +return -EINVAL ; + } +return 0 ; +}/*
* dev_ops for virtio, bare necessities for basic operation */
@@ -677,7 +685,6 @@ static const struct eth_dev_ops virtio_eth_dev_ops = {
.allmulticast_enable = virtio_dev_allmulticast_enable, .allmulticast_disable = virtio_dev_allmulticast_disable, + .mtu_set = virtio_mtu_set, .dev_infos_get = virtio_dev_info_get, .stats_get = virtio_dev_stats_get, .xstats_get = virtio_dev_xstats_get,
Signature · 1 line
2.9.3.windows.1
Re: [PATCH v7] net/virtio: add set_mtu in virtio
Quoted 3 lines
Hi All,
Is there any further comments or modifications required for this patch, or what next
steps do you guys suggest here ?
Hi Souvik,
Some minor comments inline.
Thanks,
Mark
Quoted 78 lines
--
Regards,
Souvik-----Original Message-----
From: Dey, Souvik
Sent: Saturday, October 1, 2016 10:09 AM
To: [email protected]; [email protected]; [email protected]; [email protected]
Subject: RE: [PATCH v7] net/virtio: addset_mtuin virtioHi Liu/Stephen/Mark,
I have submitted Version 7 of this patch. Do let me know if this looks proper.
--
Regards,
Souvik-----Original Message-----
From: Dey, Souvik
Sent: Thursday, September 29, 2016 4:32 PM
To: [email protected]; [email protected]; [email protected]; [email protected]
Cc: Dey, Souvik <[email protected]>
Subject: [PATCH v7] net/virtio: addset_mtuin virtioVirtio interfaces do not currently allow the user to specify a particular Maximum Transmission Unit (MTU).Consequently, the MTU of Virtio interfaces is typically set to the Ethernet default value of 1500.
This is problematic in the case of cloud deployments, in which a specific (and potentially non-standard) MTU needs to be set by a DHCP server, which needs to be honored by all interfaces across the traffic path.To achieve this Virtio interfaces should support setting of MTU.
In case when GRE/VXLAN tunneling is used for internal communication, there will be an overhead added by the infrastructure in the packet over and above the ETHER MTU of 1518. So to take care of this overhead in these cases the DHCP server corrects the L3 MTU to 1454. But since virtio interfaces was not having the MTU set functionality that MTU sent by the DHCP server was ignored and the instance will still send packets with 1500 MTU which after encapsulation will become more than 1518 and eventually gets dropped in the infrastructure.
By adding an additional 'set_mtu' function to the Virtio driver, we can honor the MTU sent by the DHCP server. The dhcp server/controller can then leverage this 'set_mtu' functionality to resolve the above mentioned issue of packets getting dropped due to incorrect size.Signed-off-by Souvik Dey <[email protected]>---
Changes in v7:
- Replaced theCRC_LENwith the merge rx buf header length.
- Changed theframe_lenmax validation toVIRTIO_MAX_RX_PKTLEN. Changes in v6:
- Description of change corrected
- Corrected the identations
- Corrected the subject line too
- The From line was also not correct
- Re-submitting as the below patch was not proper
Changes in v5:
- Fix log message for out-of-bounds MTU parameter invirtio_mtu_set
- Calculate frame size, based on 'mtu' parameter
- Corrected the upper bound and lower bound checks invirtio_mtu_setChanges in v4: Incorporated review comments.
Changes in v3: Corrected few style errors as reported by sys-stv. Changes in v2: Incorporated review comments.
drivers/net/virtio/virtio_ethdev.c| 16 ++++++++++++++++1 file changed, 16 insertions(+)drivers/net/virtio/virtio_ethdev.c +0
-0
drivers/net/virtio/virtio_ethdev.c virtio_dev_allmulticast_disable(struct rte_eth_dev *dev) · line 656
Quoted 4 lines
drivers/net/virtio/virtio_ethdev.c +1
-0@@ -653,12 +653,20 @@ virtio_dev_allmulticast_disable(struct rte_eth_dev *dev)PMD_INIT_LOG (ERR ,"Failed to disable allmulticast" ); } +#define VLAN_TAG_LEN 4/* 802.3ac tag (not DMA'd) */
There should be a blank line between the #define and the function prototype beneath.
drivers/net/virtio/virtio_ethdev.c virtio_dev_allmulticast_disable(struct rte_eth_dev *dev) · line 661
Quoted 5 lines
drivers/net/virtio/virtio_ethdev.c +5
-0+static int virtio_mtu_set (struct rte_eth_dev *dev,uint16_t mtu) +{ +struct virtio_hw *hw = dev->data->dev_private; +uint32_t ether_hdr_len =ETHER_HDR_LEN +VLAN_TAG_LEN + + hw->vtnet_hdr_size;
I'll rely on Stephen and Yuanhan's judgment for this.
drivers/net/virtio/virtio_ethdev.c virtio_dev_allmulticast_disable(struct rte_eth_dev *dev) · line 666
Quoted 5 lines
drivers/net/virtio/virtio_ethdev.c +5
-0+uint32_t frame_size = mtu + ether_hdr_len; + +if (mtu <ETHER_MIN_MTU || frame_size >VIRTIO_MAX_RX_PKTLEN ) { +PMD_INIT_LOG (ERR ,"MTU should be between %d and %d\n" , +ETHER_MIN_MTU ,VIRTIO_MAX_RX_PKTLEN );
Shouldn't last format print parameter should be (VIRTIO_MAX_RX_PKTLEN - ether_hdr_len)? i.e PMD_INIT_LOG(ERR, "MTU should........%d\n",
ETHER_MIN_MTU, (VIRTIO_MAX_RX_PKTLEN - ether_hdr_len));
Quoted 17 lines
drivers/net/virtio/virtio_ethdev.c +5
-1+return -EINVAL ; + } +return 0 ; +}/* * dev_ops for virtio, bare necessities for basic operation */ @@ -677,7 +685,6 @@ static const struct eth_dev_ops virtio_eth_dev_ops = { .allmulticast_enable = virtio_dev_allmulticast_enable, .allmulticast_disable = virtio_dev_allmulticast_disable, + .mtu_set = virtio_mtu_set, .dev_infos_get = virtio_dev_info_get, .stats_get = virtio_dev_stats_get, .xstats_get = virtio_dev_xstats_get, --2.9.3.windows.1
Re: [PATCH v7] net/virtio: add set_mtu in virtio
Yes Mark, I have modified the patch with the below comments.
drivers/net/virtio/virtio_ethdev.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
drivers/net/virtio/virtio_ethdev.c +16 -0
@@ -653,12 +653,20 @@ virtio_dev_allmulticast_disable(struct rte_eth_dev *dev)PMD_INIT_LOG (ERR ,"Failed to disable allmulticast" ); } +#define VLAN_TAG_LEN 4/* 802.3ac tag (not DMA'd) */ + +static int virtio_mtu_set (struct rte_eth_dev *dev,uint16_t mtu) +{ +struct virtio_hw *hw = dev->data->dev_private; +uint32_t ether_hdr_len =ETHER_HDR_LEN +VLAN_TAG_LEN + + hw->vtnet_hdr_size; +uint32_t frame_size = mtu + ether_hdr_len; + +if (mtu <ETHER_MIN_MTU || frame_size >VIRTIO_MAX_RX_PKTLEN ) { +PMD_INIT_LOG (ERR ,"MTU should be between %d and %d\n" , +ETHER_MIN_MTU , (VIRTIO_MAX_RX_PKTLEN - ether_hdr_len)); +return -EINVAL ; + } +return 0 ; +}
Let mem know if this looks good or we have few more comments.
--
Regards,
Souvik
-----Original Message-----
From: Kavanagh, Mark B [mailto:[email protected]]
Sent: Wednesday, October 5, 2016 4:16 AM
To: Dey, Souvik <[email protected]>; [email protected]; [email protected]
Cc: [email protected]
Subject: RE: [PATCH v7] net/virtio: add set_mtu in virtio
Quoted 3 lines
Hi All,
Is there any further comments or modifications required for this
patch, or what next steps do you guys suggest here ?
Hi Souvik,
Some minor comments inline.
Thanks,
Mark
Quoted 78 lines
--
Regards,
Souvik-----Original Message-----
From: Dey, Souvik
Sent: Saturday, October 1, 2016 10:09 AM
To: [email protected]; [email protected]; [email protected]; [email protected]
Subject: RE: [PATCH v7] net/virtio: addset_mtuin virtioHi Liu/Stephen/Mark,
I have submitted Version 7 of this patch. Do let me know if this looks proper.
--
Regards,
Souvik-----Original Message-----
From: Dey, Souvik
Sent: Thursday, September 29, 2016 4:32 PM
To: [email protected]; [email protected]; [email protected]; [email protected]
Cc: Dey, Souvik <[email protected]>
Subject: [PATCH v7] net/virtio: addset_mtuin virtioVirtio interfaces do not currently allow the user to specify a particular Maximum Transmission Unit (MTU).Consequently, the MTU of Virtio interfaces is typically set to the Ethernet default value of 1500. This is problematic in the case of cloud deployments, in which a specific (and potentially non-standard) MTU needs to be set by a DHCP server, which needs to be honored by all interfaces across the traffic path.To achieve this Virtio interfaces should support setting of MTU. In case when GRE/VXLAN tunneling is used for internal communication, there will be an overhead added by the infrastructure in the packet over and above the ETHER MTU of 1518. So to take care of this overhead in these cases the DHCP server corrects the L3 MTU to 1454. But since virtio interfaces was not having the MTU set functionality that MTU sent by the DHCP server was ignored and the instance will still send packets with 1500 MTU which after encapsulation will become more than 1518 and eventually gets dropped in the infrastructure.
By adding an additional 'set_mtu' function to the Virtio driver, we can honor the MTU sent by the DHCP server. The dhcp server/controller can then leverage this 'set_mtu' functionality to resolve the above mentioned issue of packets getting dropped due to incorrect size.Signed-off-by Souvik Dey <[email protected]>---
Changes in v7:
- Replaced theCRC_LENwith the merge rx buf header length.
- Changed theframe_lenmax validation toVIRTIO_MAX_RX_PKTLEN. Changes in v6:
- Description of change corrected
- Corrected the identations
- Corrected the subject line too
- The From line was also not correct
- Re-submitting as the below patch was not proper Changes in v5:
- Fix log message for out-of-bounds MTU parameter invirtio_mtu_set
- Calculate frame size, based on 'mtu' parameter
- Corrected the upper bound and lower bound checks invirtio_mtu_setChanges in v4: Incorporated review comments.
Changes in v3: Corrected few style errors as reported by sys-stv. Changes in v2: Incorporated review comments.
drivers/net/virtio/virtio_ethdev.c| 16 ++++++++++++++++1 file changed, 16 insertions(+)drivers/net/virtio/virtio_ethdev.c +0
-0
drivers/net/virtio/virtio_ethdev.c virtio_dev_allmulticast_disable(struct rte_eth_dev *dev) · line 655
Quoted 3 lines
drivers/net/virtio/virtio_ethdev.c +1
-0@@ -653,12 +653,20 @@ virtio_dev_allmulticast_disable(struct rte_eth_dev *dev)PMD_INIT_LOG (ERR ,"Failed to disable allmulticast" ); } +#define VLAN_TAG_LEN 4/* 802.3ac tag (not DMA'd) */
There should be a blank line between the #define and the function prototype beneath.
drivers/net/virtio/virtio_ethdev.c virtio_dev_allmulticast_disable(struct rte_eth_dev *dev) · line 659
Quoted 4 lines
drivers/net/virtio/virtio_ethdev.c +4
-0+static int virtio_mtu_set (struct rte_eth_dev *dev,uint16_t mtu) { +struct virtio_hw *hw = dev->data->dev_private; +uint32_t ether_hdr_len =ETHER_HDR_LEN +VLAN_TAG_LEN + + hw->vtnet_hdr_size;
I'll rely on Stephen and Yuanhan's judgment for this.
drivers/net/virtio/virtio_ethdev.c virtio_dev_allmulticast_disable(struct rte_eth_dev *dev) · line 664
Quoted 5 lines
drivers/net/virtio/virtio_ethdev.c +5
-0+uint32_t frame_size = mtu + ether_hdr_len; + +if (mtu <ETHER_MIN_MTU || frame_size >VIRTIO_MAX_RX_PKTLEN ) { +PMD_INIT_LOG (ERR ,"MTU should be between %d and %d\n" , +ETHER_MIN_MTU ,VIRTIO_MAX_RX_PKTLEN );
Shouldn't last format print parameter should be (VIRTIO_MAX_RX_PKTLEN - ether_hdr_len)? i.e PMD_INIT_LOG(ERR, "MTU should........%d\n",
ETHER_MIN_MTU, (VIRTIO_MAX_RX_PKTLEN - ether_hdr_len));
Quoted 17 lines
drivers/net/virtio/virtio_ethdev.c +5
-1+return -EINVAL ; + } +return 0 ; +}/* * dev_ops for virtio, bare necessities for basic operation */ @@ -677,7 +685,6 @@ static const struct eth_dev_ops virtio_eth_dev_ops = { .allmulticast_enable = virtio_dev_allmulticast_enable, .allmulticast_disable = virtio_dev_allmulticast_disable, + .mtu_set = virtio_mtu_set, .dev_infos_get = virtio_dev_info_get, .stats_get = virtio_dev_stats_get, .xstats_get = virtio_dev_xstats_get, --2.9.3.windows.1
Re: [PATCH v7] net/virtio: add set_mtu in virtio
Hi Stephen/Liu,
Any other comments or suggestions for this. If the below patch looks fine then please do suggest the next steps .
--
Regards,
Souvik
-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Dey, Souvik
Sent: Wednesday, October 5, 2016 10:05 AM
To: Kavanagh, Mark B <[email protected]>; [email protected]; [email protected]
Cc: [email protected]
Subject: Re: [dpdk-dev] [PATCH v7] net/virtio: add set_mtu in virtio
Yes Mark, I have modified the patch with the below comments.
drivers/net/virtio/virtio_ethdev.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
drivers/net/virtio/virtio_ethdev.c +15 -0
@@ -653,12 +653,20 @@ virtio_dev_allmulticast_disable(struct rte_eth_dev *dev)PMD_INIT_LOG (ERR ,"Failed to disable allmulticast" ); } +#define VLAN_TAG_LEN 4/* 802.3ac tag (not DMA'd) */ + +static int virtio_mtu_set (struct rte_eth_dev *dev,uint16_t mtu) { +struct virtio_hw *hw = dev->data->dev_private; +uint32_t ether_hdr_len =ETHER_HDR_LEN +VLAN_TAG_LEN + + hw->vtnet_hdr_size; +uint32_t frame_size = mtu + ether_hdr_len; + +if (mtu <ETHER_MIN_MTU || frame_size >VIRTIO_MAX_RX_PKTLEN ) { +PMD_INIT_LOG (ERR ,"MTU should be between %d and %d\n" , +ETHER_MIN_MTU , (VIRTIO_MAX_RX_PKTLEN - ether_hdr_len)); +return -EINVAL ; + } +return 0 ; +}
Let mem know if this looks good or we have few more comments.
--
Regards,
Souvik
-----Original Message-----
From: Kavanagh, Mark B [mailto:[email protected]]
Sent: Wednesday, October 5, 2016 4:16 AM
To: Dey, Souvik <[email protected]>; [email protected]; [email protected]
Cc: [email protected]
Subject: RE: [PATCH v7] net/virtio: add set_mtu in virtio
Quoted 3 lines
Hi All,
Is there any further comments or modifications required for this
patch, or what next steps do you guys suggest here ?
Hi Souvik,
Some minor comments inline.
Thanks,
Mark
Quoted 78 lines
--
Regards,
Souvik-----Original Message-----
From: Dey, Souvik
Sent: Saturday, October 1, 2016 10:09 AM
To: [email protected]; [email protected]; [email protected]; [email protected]
Subject: RE: [PATCH v7] net/virtio: addset_mtuin virtioHi Liu/Stephen/Mark,
I have submitted Version 7 of this patch. Do let me know if this looks proper.
--
Regards,
Souvik-----Original Message-----
From: Dey, Souvik
Sent: Thursday, September 29, 2016 4:32 PM
To: [email protected]; [email protected]; [email protected]; [email protected]
Cc: Dey, Souvik <[email protected]>
Subject: [PATCH v7] net/virtio: addset_mtuin virtioVirtio interfaces do not currently allow the user to specify a particular Maximum Transmission Unit (MTU).Consequently, the MTU of Virtio interfaces is typically set to the Ethernet default value of 1500. This is problematic in the case of cloud deployments, in which a specific (and potentially non-standard) MTU needs to be set by a DHCP server, which needs to be honored by all interfaces across the traffic path.To achieve this Virtio interfaces should support setting of MTU. In case when GRE/VXLAN tunneling is used for internal communication, there will be an overhead added by the infrastructure in the packet over and above the ETHER MTU of 1518. So to take care of this overhead in these cases the DHCP server corrects the L3 MTU to 1454. But since virtio interfaces was not having the MTU set functionality that MTU sent by the DHCP server was ignored and the instance will still send packets with 1500 MTU which after encapsulation will become more than 1518 and eventually gets dropped in the infrastructure.
By adding an additional 'set_mtu' function to the Virtio driver, we can honor the MTU sent by the DHCP server. The dhcp server/controller can then leverage this 'set_mtu' functionality to resolve the above mentioned issue of packets getting dropped due to incorrect size.Signed-off-by Souvik Dey <[email protected]>---
Changes in v7:
- Replaced theCRC_LENwith the merge rx buf header length.
- Changed theframe_lenmax validation toVIRTIO_MAX_RX_PKTLEN. Changes in v6:
- Description of change corrected
- Corrected the identations
- Corrected the subject line too
- The From line was also not correct
- Re-submitting as the below patch was not proper Changes in v5:
- Fix log message for out-of-bounds MTU parameter invirtio_mtu_set
- Calculate frame size, based on 'mtu' parameter
- Corrected the upper bound and lower bound checks invirtio_mtu_setChanges in v4: Incorporated review comments.
Changes in v3: Corrected few style errors as reported by sys-stv. Changes in v2: Incorporated review comments.
drivers/net/virtio/virtio_ethdev.c| 16 ++++++++++++++++1 file changed, 16 insertions(+)drivers/net/virtio/virtio_ethdev.c +0
-0
drivers/net/virtio/virtio_ethdev.c virtio_dev_allmulticast_disable(struct rte_eth_dev *dev) · line 655
Quoted 3 lines
drivers/net/virtio/virtio_ethdev.c +1
-0@@ -653,12 +653,20 @@ virtio_dev_allmulticast_disable(struct rte_eth_dev *dev)PMD_INIT_LOG (ERR ,"Failed to disable allmulticast" ); } +#define VLAN_TAG_LEN 4/* 802.3ac tag (not DMA'd) */
There should be a blank line between the #define and the function prototype beneath.
drivers/net/virtio/virtio_ethdev.c virtio_dev_allmulticast_disable(struct rte_eth_dev *dev) · line 659
Quoted 4 lines
drivers/net/virtio/virtio_ethdev.c +4
-0+static int virtio_mtu_set (struct rte_eth_dev *dev,uint16_t mtu) { +struct virtio_hw *hw = dev->data->dev_private; +uint32_t ether_hdr_len =ETHER_HDR_LEN +VLAN_TAG_LEN + + hw->vtnet_hdr_size;
I'll rely on Stephen and Yuanhan's judgment for this.
drivers/net/virtio/virtio_ethdev.c virtio_dev_allmulticast_disable(struct rte_eth_dev *dev) · line 664
Quoted 5 lines
drivers/net/virtio/virtio_ethdev.c +5
-0+uint32_t frame_size = mtu + ether_hdr_len; + +if (mtu <ETHER_MIN_MTU || frame_size >VIRTIO_MAX_RX_PKTLEN ) { +PMD_INIT_LOG (ERR ,"MTU should be between %d and %d\n" , +ETHER_MIN_MTU ,VIRTIO_MAX_RX_PKTLEN );
Shouldn't last format print parameter should be (VIRTIO_MAX_RX_PKTLEN - ether_hdr_len)? i.e PMD_INIT_LOG(ERR, "MTU should........%d\n",
ETHER_MIN_MTU, (VIRTIO_MAX_RX_PKTLEN - ether_hdr_len));
Quoted 17 lines
drivers/net/virtio/virtio_ethdev.c +5
-1+return -EINVAL ; + } +return 0 ; +}/* * dev_ops for virtio, bare necessities for basic operation */ @@ -677,7 +685,6 @@ static const struct eth_dev_ops virtio_eth_dev_ops = { .allmulticast_enable = virtio_dev_allmulticast_enable, .allmulticast_disable = virtio_dev_allmulticast_disable, + .mtu_set = virtio_mtu_set, .dev_infos_get = virtio_dev_info_get, .stats_get = virtio_dev_stats_get, .xstats_get = virtio_dev_xstats_get, --2.9.3.windows.1
Re: [PATCH v7] net/virtio: add set_mtu in virtio
Quoted 4 lines
Hi Stephen/Liu,
Any other comments or suggestions for this. If the below patch looks fine then please
do suggest the next steps .
Hi Souvik,
Just to let you know that Yuanhan is out of office on account of public holidays in PRC.
AFAIA he should be back online from next week.
Thanks,
Mark
Quoted 183 lines
--
Regards,
Souvik-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Dey, Souvik
Sent: Wednesday, October 5, 2016 10:05 AM
To: Kavanagh, Mark B <[email protected]>; [email protected]; [email protected]
Cc: [email protected]
Subject: Re: [dpdk-dev] [PATCH v7] net/virtio: addset_mtuin virtioYes Mark, I have modified the patch with the below comments.
drivers/net/virtio/virtio_ethdev.c| 17 +++++++++++++++++1 file changed, 17 insertions(+)drivers/net/virtio/virtio_ethdev.c +15
-0@@ -653,12 +653,20 @@ virtio_dev_allmulticast_disable(struct rte_eth_dev *dev)PMD_INIT_LOG (ERR ,"Failed to disable allmulticast" ); } +#define VLAN_TAG_LEN 4/* 802.3ac tag (not DMA'd) */ + +static int virtio_mtu_set (struct rte_eth_dev *dev,uint16_t mtu) { +struct virtio_hw *hw = dev->data->dev_private; +uint32_t ether_hdr_len =ETHER_HDR_LEN +VLAN_TAG_LEN + + hw->vtnet_hdr_size; +uint32_t frame_size = mtu + ether_hdr_len; + +if (mtu <ETHER_MIN_MTU || frame_size >VIRTIO_MAX_RX_PKTLEN ) { +PMD_INIT_LOG (ERR ,"MTU should be between %d and %d\n" , +ETHER_MIN_MTU , (VIRTIO_MAX_RX_PKTLEN - ether_hdr_len)); +return -EINVAL ; + } +return 0 ; +}Let mem know if this looks good or we have few more comments.
--
Regards,
Souvik-----Original Message-----
From: Kavanagh, Mark B [mailto:[email protected]]
Sent: Wednesday, October 5, 2016 4:16 AM
To: Dey, Souvik <[email protected]>; [email protected]; [email protected]
Cc: [email protected]
Subject: RE: [PATCH v7] net/virtio: addset_mtuin virtioQuoted 3 lines
Hi All,
Is there any further comments or modifications required for this
patch, or what next steps do you guys suggest here ?Hi Souvik,
Some minor comments inline.
Thanks,
MarkQuoted 78 lines
--
Regards,
Souvik-----Original Message-----
From: Dey, Souvik
Sent: Saturday, October 1, 2016 10:09 AM
To: [email protected]; [email protected]; [email protected]; [email protected]
Subject: RE: [PATCH v7] net/virtio: addset_mtuin virtioHi Liu/Stephen/Mark,
I have submitted Version 7 of this patch. Do let me know if this looks proper.
--
Regards,
Souvik-----Original Message-----
From: Dey, Souvik
Sent: Thursday, September 29, 2016 4:32 PM
To: [email protected]; [email protected]; [email protected]; [email protected]
Cc: Dey, Souvik <[email protected]>
Subject: [PATCH v7] net/virtio: addset_mtuin virtioVirtio interfaces do not currently allow the user to specify a particular Maximum Transmission Unit (MTU).Consequently, the MTU of Virtio interfaces is typically set to the Ethernet default value of 1500. This is problematic in the case of cloud deployments, in which a specific (and potentially non-standard) MTU needs to be set by a DHCP server, which needs to be honored by all interfaces across the traffic path.To achieve this Virtio interfaces should support setting of MTU. In case when GRE/VXLAN tunneling is used for internal communication, there will be an overhead added by the infrastructure in the packet over and above the ETHER MTU of 1518. So to take care of this overhead in these cases the DHCP server corrects the L3 MTU to 1454. But since virtio interfaces was not having the MTU set functionality that MTU sent by the DHCP server was ignored and the instance will still send packets with 1500 MTU which after encapsulation will become more than 1518 and eventually gets dropped in the infrastructure.
By adding an additional 'set_mtu' function to the Virtio driver, we can honor the MTU sent by the DHCP server. The dhcp server/controller can then leverage this 'set_mtu' functionality to resolve the above mentioned issue of packets getting dropped due to incorrect size.Signed-off-by Souvik Dey <[email protected]>---
Changes in v7:
- Replaced theCRC_LENwith the merge rx buf header length.
- Changed theframe_lenmax validation toVIRTIO_MAX_RX_PKTLEN. Changes in v6:
- Description of change corrected
- Corrected the identations
- Corrected the subject line too
- The From line was also not correct
- Re-submitting as the below patch was not proper Changes in v5:
- Fix log message for out-of-bounds MTU parameter invirtio_mtu_set
- Calculate frame size, based on 'mtu' parameter
- Corrected the upper bound and lower bound checks invirtio_mtu_setChanges in v4: Incorporated review comments.
Changes in v3: Corrected few style errors as reported by sys-stv. Changes in v2: Incorporated review comments.
drivers/net/virtio/virtio_ethdev.c| 16 ++++++++++++++++1 file changed, 16 insertions(+)drivers/net/virtio/virtio_ethdev.c +0
-0drivers/net/virtio/virtio_ethdev.c virtio_dev_allmulticast_disable(struct rte_eth_dev *dev) · line 655
Quoted 3 lines
drivers/net/virtio/virtio_ethdev.c +1
-0@@ -653,12 +653,20 @@ virtio_dev_allmulticast_disable(struct rte_eth_dev *dev)PMD_INIT_LOG (ERR ,"Failed to disable allmulticast" ); } +#define VLAN_TAG_LEN 4/* 802.3ac tag (not DMA'd) */ There should be a blank line between the #define and the function prototype beneath.
drivers/net/virtio/virtio_ethdev.c virtio_dev_allmulticast_disable(struct rte_eth_dev *dev) · line 660
Quoted 4 lines
drivers/net/virtio/virtio_ethdev.c +4
-0+static int virtio_mtu_set (struct rte_eth_dev *dev,uint16_t mtu) { +struct virtio_hw *hw = dev->data->dev_private; +uint32_t ether_hdr_len =ETHER_HDR_LEN +VLAN_TAG_LEN + + hw->vtnet_hdr_size;I'll rely on Stephen and Yuanhan's judgment for this.
drivers/net/virtio/virtio_ethdev.c virtio_dev_allmulticast_disable(struct rte_eth_dev *dev)
Quoted 5 lines
drivers/net/virtio/virtio_ethdev.c +5
-0+uint32_t frame_size = mtu + ether_hdr_len; + +if (mtu <ETHER_MIN_MTU || frame_size >VIRTIO_MAX_RX_PKTLEN ) { +PMD_INIT_LOG (ERR ,"MTU should be between %d and %d\n" , +ETHER_MIN_MTU ,VIRTIO_MAX_RX_PKTLEN );Shouldn't last format print parameter should be (
VIRTIO_MAX_RX_PKTLEN-ether_hdr_len)? i.e PMD_INIT_LOG(ERR, "MTU should........%d\n",ETHER_MIN_MTU, (VIRTIO_MAX_RX_PKTLEN - ether_hdr_len));Quoted 17 lines
drivers/net/virtio/virtio_ethdev.c +5
-1+return -EINVAL ; + } +return 0 ; +}/* * dev_ops for virtio, bare necessities for basic operation */ @@ -677,7 +685,6 @@ static const struct eth_dev_ops virtio_eth_dev_ops = { .allmulticast_enable = virtio_dev_allmulticast_enable, .allmulticast_disable = virtio_dev_allmulticast_disable, + .mtu_set = virtio_mtu_set, .dev_infos_get = virtio_dev_info_get, .stats_get = virtio_dev_stats_get, .xstats_get = virtio_dev_xstats_get, --2.9.3.windows.1
Re: [PATCH v7] net/virtio: add set_mtu in virtio
I think current patch is fine. If someone has later problem with it on some scenario we can fix the bug then.
Please merge
Re: [PATCH v7] net/virtio: add set_mtu in virtio
Hi Stephen,
As I am new to this patch submission, I did not get what you exactly meant my “Please merge”, do you mean that you Ack the patch and it can be upstreamed or you want me submit a new version or something. Sorry for my ignorance.
Thanks
--
Souvik
From: Stephen Hemminger [mailto:[email protected]]
Sent: Thursday, October 6, 2016 6:30 PM
To: Kavanagh, Mark B <[email protected]>
Cc: Dey, Souvik <[email protected]>; [email protected]; [email protected]
Subject: Re: [PATCH v7] net/virtio: add set_mtu in virtio
I think current patch is fine. If someone has later problem with it on some scenario we can fix the bug then. Please merge
Re: [PATCH v7] net/virtio: add set_mtu in virtio
In reply to DeyQuoted 12 lines · Dey
/*
*dev_opsfor virtio, bare necessities for basic operation */(quoted diff) +1
-0@@ -677,7 +685,6 @@ static const struct eth_dev_ops virtio_eth_dev_ops = { .allmulticast_enable = virtio_dev_allmulticast_enable, .allmulticast_disable = virtio_dev_allmulticast_disable, + .mtu_set = virtio_mtu_set, .dev_infos_get = virtio_dev_info_get, .stats_get = virtio_dev_stats_get, .xstats_get = virtio_dev_xstats_get,Signature · 1 line
2.9.3.windows.1
Your patch is malformed: I got an error while trying to apply it.
patch: **** malformed patch at line 167: * dev_ops for virtio,
bare necessities for basic operation
Seems like the way you were generating the patch is wrong.
Anyway, I applied it manually, with the "- frame_size" fix as well as few more minor coding style fixes.
So applied to dpdk-next-virtio.
--yliu
Re: [PATCH v7] net/virtio: add set_mtu in virtio
Quoted 20 lines · Dey
Quoted 11 lines
/*
*dev_opsfor virtio, bare necessities for basic operation */(quoted diff) +1
-1@@ -677,7 +685,6 @@ static const struct eth_dev_ops virtio_eth_dev_ops = { .allmulticast_enable = virtio_dev_allmulticast_enable, .allmulticast_disable = virtio_dev_allmulticast_disable, + .mtu_set = virtio_mtu_set, .dev_infos_get = virtio_dev_info_get, .stats_get = virtio_dev_stats_get, .xstats_get = virtio_dev_xstats_get, --Quoted 1 line
2.9.3.windows.1
Your patch is malformed: I got an error while trying to apply it.
patch: **** malformed patch at line 167: *
dev_opsfor virtio,
bare necessities for basic operation
Quoted 6 lines
Seems like the way you were generating the patch is wrong.
Anyway, I applied it manually, with the "-
frame_size" fix as well as few more minor coding style fixes.So applied to dpdk-next-virtio.
Hi Yuanhan/Souvik,
Given my contributions to this patch (and in particular since comments from here - http://dpdk.org/ml/archives/dev/2016-September/047208.html - were copied directly into the commit message), I think that I should have been added as co-author of the patch?
Let me know if you think that I am mistaken.
Thanks in advance,
Mark
Quoted 2 lines
--yliu
Re: [PATCH v7] net/virtio: add set_mtu in virtio
Quoted 22 lines · Mark B
Quoted 22 lines · Dey
Quoted 11 lines
/*
*dev_opsfor virtio, bare necessities for basic operation */(quoted diff) +1
-1@@ -677,7 +685,6 @@ static const struct eth_dev_ops virtio_eth_dev_ops = { .allmulticast_enable = virtio_dev_allmulticast_enable, .allmulticast_disable = virtio_dev_allmulticast_disable, + .mtu_set = virtio_mtu_set, .dev_infos_get = virtio_dev_info_get, .stats_get = virtio_dev_stats_get, .xstats_get = virtio_dev_xstats_get, --Quoted 1 line
2.9.3.windows.1
Your patch is malformed: I got an error while trying to apply it.
patch: **** malformed patch at line 167: *
dev_opsfor virtio,
bare necessities for basic operationSeems like the way you were generating the patch is wrong.
Quoted 8 lines
Quoted 4 lines
Anyway, I applied it manually, with the "-
frame_size" fix as well as few more minor coding style fixes.So applied to dpdk-next-virtio.
Hi Yuanhan/Souvik,
Given my contributions to this patch (and in particular since comments from here - http://dpdk.org/ml/archives/dev/2016-September/047208.html - were copied directly into the commit message), I think that I should have been added as co-author of the patch?
Mark,
I appreciate your contributions here. But for this case, I think it might not be enough for adding you as the co-author: you don't co-write the code with Souvik after all.
However, I'd suggest you to add your "Reviewed-by" if a patch looks to you after your review effort. This is another way to recognize your contributions to a patch.
Thanks.
--yliu
Quoted 7 lines
Let me know if you think that I am mistaken.
Thanks in advance,
MarkQuoted 2 lines
--yliu
Kavanagh, Mark B
Reviewed-byRe: [PATCH v7] net/virtio: add set_mtu in virtio
Quoted 44 lines
-----Original Message-----
From: Yuanhan Liu [mailto:[email protected]]
Sent: Tuesday, October 11, 2016 5:01 AM
To: Kavanagh, Mark B <[email protected]>
Cc: Dey <[email protected]>; [email protected]; [email protected]
Subject: Re: [PATCH v7] net/virtio: addset_mtuin virtioQuoted 22 lines · Mark B
Quoted 22 lines · Dey
Quoted 11 lines
/*
*dev_opsfor virtio, bare necessities for basic operation */(quoted diff) +1
-1@@ -677,7 +685,6 @@ static const struct eth_dev_ops virtio_eth_dev_ops = { .allmulticast_enable = virtio_dev_allmulticast_enable, .allmulticast_disable = virtio_dev_allmulticast_disable, + .mtu_set = virtio_mtu_set, .dev_infos_get = virtio_dev_info_get, .stats_get = virtio_dev_stats_get, .xstats_get = virtio_dev_xstats_get, --Quoted 1 line
2.9.3.windows.1
Your patch is malformed: I got an error while trying to apply it.
patch: **** malformed patch at line 167: *
dev_opsfor virtio,
bare necessities for basic operationSeems like the way you were generating the patch is wrong.
Quoted 8 lines
Quoted 4 lines
Anyway, I applied it manually, with the "-
frame_size" fix as well as few more minor coding style fixes.So applied to dpdk-next-virtio.
Hi Yuanhan/Souvik,
Given my contributions to this patch (and in particular since comments from here -
http://dpdk.org/ml/archives/dev/2016-September/047208.html - were copied directly into the commit message), I think that I should have been added as co-author of the patch?
Mark,
Quoted 7 lines
I appreciate your contributions here. But for this case, I think it might not be enough for adding you as the co-author: you don't co-write the code with Souvik after all.
However, I'd suggest you to add your "Reviewed-by" if a patch looks to you after your review effort. This is another way to recognize your contributions to a patch.
No problem Yuanhan - thanks for clarifying.
Quoted 13 lines
Thanks.
--yliuQuoted 7 lines
Let me know if you think that I am mistaken.
Thanks in advance,
MarkQuoted 2 lines
--yliu