diff mbox series

[ovs-dev,v1] ovs-tcpdump: Fix bond port unable to capture jumbo frames.

Message ID SY4PR01MB84389A4F80A5A14C4AC26809CD5C9@SY4PR01MB8438.ausprd01.prod.outlook.com
State Accepted
Commit ccd26e79e5d24dd19e59d53337b51ce167966530
Headers show
Series [ovs-dev,v1] ovs-tcpdump: Fix bond port unable to capture jumbo frames. | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/github-robot-_Build_and_Test success github build: passed
ovsrobot/intel-ovs-compilation success test: success

Commit Message

miter Oct. 6, 2022, 7:11 a.m. UTC
From: Lin Huang <linhuang@ruijie.com.cn>

Currently the ovs-tcpdump utility creates a tap port to capture the
frames of a bond port.

If a user want to capture the packets from the bond port which member
interface's mtu is more than 1500. By default the utility creates a
tap port which mtu is 1500, regardless the member interface's mtu config.
So that user cann't get the bond port frames which mtu is lager than 1500.

This patch fix this issiue by checking the member interface's mtu and
set maximal mtu value to the tap port.

Signed-off-by: Lin Huang <linhuang@ruijie.com.cn>
---
 utilities/ovs-tcpdump.in | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Aaron Conole Oct. 10, 2022, 8:07 p.m. UTC | #1
miterv@outlook.com writes:

> From: Lin Huang <linhuang@ruijie.com.cn>
>
> Currently the ovs-tcpdump utility creates a tap port to capture the
> frames of a bond port.
>
> If a user want to capture the packets from the bond port which member
> interface's mtu is more than 1500. By default the utility creates a
> tap port which mtu is 1500, regardless the member interface's mtu config.
> So that user cann't get the bond port frames which mtu is lager than 1500.
>
> This patch fix this issiue by checking the member interface's mtu and
> set maximal mtu value to the tap port.
>
> Signed-off-by: Lin Huang <linhuang@ruijie.com.cn>
> ---

I did some basic testing with this, and it seems to work for me.

patch subject for an update patch is typically v2, but I guess you
started at '0' for this series ;)

Acked-by: Aaron Conole <aconole@redhat.com>
Ilya Maximets Oct. 11, 2022, 10:04 p.m. UTC | #2
On 10/10/22 22:07, Aaron Conole wrote:
> miterv@outlook.com writes:
> 
>> From: Lin Huang <linhuang@ruijie.com.cn>
>>
>> Currently the ovs-tcpdump utility creates a tap port to capture the
>> frames of a bond port.
>>
>> If a user want to capture the packets from the bond port which member
>> interface's mtu is more than 1500. By default the utility creates a
>> tap port which mtu is 1500, regardless the member interface's mtu config.
>> So that user cann't get the bond port frames which mtu is lager than 1500.
>>
>> This patch fix this issiue by checking the member interface's mtu and
>> set maximal mtu value to the tap port.
>>
>> Signed-off-by: Lin Huang <linhuang@ruijie.com.cn>
>> ---
> 
> I did some basic testing with this, and it seems to work for me.
> 
> patch subject for an update patch is typically v2, but I guess you
> started at '0' for this series ;)
> 
> Acked-by: Aaron Conole <aconole@redhat.com>
> 

Thanks!  Applied and backported down to 2.17.

Best regards, Ilya Maximets.
diff mbox series

Patch

diff --git a/utilities/ovs-tcpdump.in b/utilities/ovs-tcpdump.in
index 7fd26e405..e12bab889 100755
--- a/utilities/ovs-tcpdump.in
+++ b/utilities/ovs-tcpdump.in
@@ -225,6 +225,13 @@  class OVSDB(object):
     def interface_mtu(self, intf_name):
         try:
             intf = self._find_row_by_name('Interface', intf_name)
+            if intf is None:
+                mtu = 1500
+                port = self._find_row_by_name('Port', intf_name)
+                for intf in port.interfaces:
+                    if mtu < intf.mtu[0]:
+                        mtu = intf.mtu[0]
+                return mtu
             return intf.mtu[0]
         except Exception:
             return None