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