I am sharing complete procedure here so that you can help me in this. On Ubuntu 4.4.0-31-generic I installed OVS 2.10.90 on it as follows.
apt-get install git git clone https://github.com/openvswitch/ovs.git cd ovs apt install build-essential libssl1.0.0 libcap-ng-utils sudo add-apt-repository ppa:deadsnakes/ppa sudo apt-get update sudo apt-get install python2.7 libnuma-dev libtool autoconf automake wget python-six libvirt-bin sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo apt-get update sudo apt-get install g++-4.9 gcc-multilib apt-get install libpcap-dev apt-get install iperf ./boot.sh ./configure make make install #to use the kernel module that was shipped with ovs 2.10.90 config_file="/etc/depmod.d/openvswitch.conf" for module in datapath/linux/*.ko; do modname="$(basename ${module})" echo "override ${modname%.ko} * extra" >> "$config_file" echo "override ${modname%.ko} * weak-updates" >> "$config_file" done depmod -a #loading openvswitch /sbin/modprobe openvswitch export PATH=$PATH:/usr/local/share/openvswitch/scripts ovs-ctl start Then I ran following script to test meter function in kernel-space datapath: ovs-vsctl add-br br0 ovs-vsctl set bridge br0 protocols=OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15 ovs-ofctl -O OpenFlow15 add-meter br0 meter=100,kbps,band=type=drop,rate=300000 However I got this error. OFPT_ERROR (OF1.5) (xid=0x2): OFPMMFC_INVALID_METER OFPT_METER_MOD (OF1.5) (xid=0x2): ADD meter=100 kbps bands= type=drop rate=300000 I checked ovs-vswitchd.log as well. Got: 2019-01-04T13:11:16.221Z|00037|connmgr|INFO|br0<->unix#3: sending OFPMMFC_INVALID_METER error reply to OFPT_METER_MOD message Useful info: *ovs-vsctl list bridge br0* _uuid : bd776aad-3a88-4d38-a7a2-6be57723f04b auto_attach : [] controller : [] datapath_id : "0000ae6a77bd384d" datapath_type : "" datapath_version : "<unknown>" external_ids : {} fail_mode : [] flood_vlans : [] flow_tables : {} ipfix : [] mcast_snooping_enable: false mirrors : [] name : "br0" netflow : [] other_config : {} ports : [ae6edd93-c2a2-4f61-bb9a-c319c2fc0e2f] protocols : ["OpenFlow10", "OpenFlow11", "OpenFlow12", "OpenFlow13", "OpenFlow14", "OpenFlow15"] rstp_enable : false rstp_status : {} sflow : [] status : {} stp_enable : false *ovs-vsctl list open-vswitch* _uuid : 752ea415-0b53-4180-9ee8-abb7262985b1 bridges : [bd776aad-3a88-4d38-a7a2-6be57723f04b] cur_cfg : 2 datapath_types : [netdev, system] db_version : "7.16.1" dpdk_initialized : false dpdk_version : none external_ids : {hostname=ubuntu, rundir="/usr/local/var/run/openvswitch", system-id=""} iface_types : [erspan, geneve, gre, internal, "ip6erspan", "ip6gre", lisp, patch, stt, system, tap, vxlan] manager_options : [] next_cfg : 2 other_config : {} ovs_version : "2.10.90" ssl : [] statistics : {} system_type : Ubuntu system_version : "14.04-trusty" Even though it says here <http://docs.openvswitch.org/en/latest/faq/qos/>, still I am not able to add meter in *kernal-space datapath*. Please let me if you have tried it and are meters actually been implemented in kernel datapath in Open vSwitch 2.10.90? Best Regards, Ramzah Rehman On Sat, Dec 29, 2018 at 9:28 AM Ramzah Rehman <[email protected]> wrote: > Is there a way to check which kernel module you're using? > > On Sat, Dec 29, 2018, 3:20 AM Justin Pettit <[email protected] wrote: > >> (Please don't drop the list.) >> >> If you are using the OVS kernel module that ships with a 4.15 kernel, I >> would expect there to be a problem. (I would also expect there to be a >> message logged from that probe.) However, if you use the kernel module >> that ships with OVS (regardless of the kernel it's compiled against), I >> would expect it to work. >> >> --Justin >> >> >> > On Dec 28, 2018, at 12:09 PM, Ramzah Rehman <[email protected]> >> wrote: >> > >> > I don't get " the kernel module has broken implementation error". >> > >> > I'm using the kernel module that's part of ovs 2.10. are you implying >> that using kernel module of ovs 2.10 would not lead to meter error when I >> try to add meter in kernel datapath? >> > >> > On Sat, Dec 29, 2018, 12:57 AM Justin Pettit <[email protected] wrote: >> > I think meters are broken up to kernel 4.18.0, which is when this patch >> was added: >> > >> > https://github.com/torvalds/linux/commit/25432eba9cd >> > >> > This commit probes for that condition in ovs-vswitchd: >> > >> > https://github.com/openvswitch/ovs/commit/92d0d515d6 >> > >> > Do you see "The kernel module has a broken meter implementation." in >> your ovs-vswitchd logs? >> > >> > I will see if I can get that fix applied to 4.15, 4.16, and 4.17 >> branches in the upstream kernel. In the meantime, you should be able to >> use the kernel module that's included as part of OVS 2.10. >> > >> > --Justin >> > >> > >> > > On Dec 28, 2018, at 12:55 AM, Ramzah Rehman <[email protected]> >> wrote: >> > > >> > > Here is the log error when I try to add a meter: >> > > #ovs-ofctl -O OpenFlow15 add-meter br0 >> meter=100,kbps,band=type=drop,rate=300000 >> > > >> > > Error in ovs-vswitchd.log: >> > > 2018-12-28T08:52:06.462Z|00653|connmgr|INFO|br0<->unix#224: sending >> OFPMMFC_INVALID_METER error reply to OFPT_METER_MOD message >> > > >> > > The kernel verion I updated to is: >> > > #uname -a >> > > Linux ubuntu 4.15.1-041501-generic #201802031831 SMP Sat Feb 3 >> 18:32:13 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux >> > > >> > > Could it be that that updating kernel to a supported version i.e. >> 4.15.1 does not work? >> > > >> > > >> > > Best Regards, >> > > Ramzah Rehman >> > > >> > > >> > > On Thu, Dec 27, 2018 at 8:44 PM Ben Pfaff <[email protected]> wrote: >> > > Check the OVS log for a message that mentions meters. >> > > >> > > On Thu, Dec 27, 2018 at 08:30:54PM +0500, Ramzah Rehman wrote: >> > > > I have Ubuntu 14.04.5 with kernel version 4.4. I updated kernel >> version to >> > > > 4.15.1 which supports kernel datapaths. >> > > > >> > > > I don't want to use DPDK since I don't have DPDK compatible >> network cards. >> > > > >> > > > On Thu, Dec 27, 2018, 8:24 PM Ben Pfaff <[email protected] wrote: >> > > > >> > > > > On Thu, Dec 27, 2018 at 12:02:50PM +0500, Ramzah Rehman wrote: >> > > > > > It is mentioned in FAQ of QoS that "Open vSwitch 2.10 has >> implemented >> > > > > > meters in the Linux kernel datapath " which means we can use >> meters in >> > > > > > kernel datapath. However, when I try to add meter, I get >> > > > > > OFPMMFC_INVALID_METER error. This is what I did. >> > > > > > >> > > > > > #ovs-vsctl add-br br0 >> > > > > > #ovs-vsctl set bridge br0 >> > > > > > >> > > > > >> protocols=OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15 >> > > > > > #ovs-ofctl -O OpenFlow15 add-meter br0 >> > > > > > meter=100,kbps,band=type=drop,rate=300000 >> > > > > > OFPT_ERROR (OF1.3) (xid=0x2): OFPMMFC_INVALID_METER >> > > > > > OFPT_METER_MOD (OF1.3) (xid=0x2): ADD meter=100 kbps bands= >> > > > > > type=drop rate=300000 >> > > > > > >> > > > > > Please let me what I am doing wrong. >> > > > > >> > > > > Probably the kernel module you're using doesn't support meters. >> > > > > >> > > > > > One important thing to mention here is that when I set the type >> of >> > > > > > switch to netdev like this: >> > > > > > >> > > > > > #ovs-vsctl set bridge br0 datapath_type=netdev >> > > > > > >> > > > > > I can add meters without any error. What's the reason? >> > > > > >> > > > > Each datapath has its own meter implementation, so when you switch >> > > > > datapaths you get different behavior. >> > > > > >> > > > > > There's one problem with this as well, I cannot achieve >> throughput >> > > > > > more than 500Mbps on 1Gbps link once I set the datapath type to >> > > > > > netdev. >> > > > > >> > > > > Probably you should use DPDK if you want high performance from the >> > > > > userspace datapath. >> > > > > >> > > _______________________________________________ >> > > discuss mailing list >> > > [email protected] >> > > https://mail.openvswitch.org/mailman/listinfo/ovs-discuss >> > >> >>
_______________________________________________ discuss mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-discuss
