[ovs-dev] [v4 8/8] dpif-netlink: Offloading meter to tc police action

2022-05-02 Thread Jianbo Liu via dev
OVS meters are created in advance and openflow rules refer to them by their unique ID. New tc_police API is used to offload them. By calling the API, police actions are created and meters are mapped to them. These actions then can be used in tc filter rules by the index. Signed-off-by: Jianbo Liu

[ovs-dev] [v4 5/8] netdev-offload-tc: Implement meter offload API for tc

2022-05-02 Thread Jianbo Liu via dev
For dpif-netlink, meters are mapped by tc to police actions with one-to-one relationship. Implement meter offload API to set/get/del the police action, and a hmap is used to save the mappings. An id-pool is used to manage all the available police indexes, which are 0x1000-0x1fff, reserved

[ovs-dev] [v4 6/8] netdev-offload-tc: Cleanup police actions with reserved indexes on startup

2022-05-02 Thread Jianbo Liu via dev
As the police actions with indexes of 0x1000-0x1fff are reserved for meter offload, to provide a clean environment for OVS, these reserved police actions should be deleted on startup. So dump all the police actions, delete those actions with indexes in this range. Signed-off-by: Jianbo

[ovs-dev] [v4 7/8] netdev-offload-tc: Offloading rules with police actions

2022-05-02 Thread Jianbo Liu via dev
When offloading rule, tc should be filled with police index, instead of meter id. As meter is mapped to police action, and the mapping is inserted into meter_id_to_police_idx hmap, this hmap is used to find the police index. Besides, an action cookie is added to save meter id on rule creation, so

[ovs-dev] [v4 4/8] netdev-linux: Add functions to manipulate tc police action

2022-05-02 Thread Jianbo Liu via dev
Add helpers to add, delete and get stats of police action with the specified index. Signed-off-by: Jianbo Liu --- lib/netdev-linux.c | 133 + lib/netdev-linux.h | 6 ++ lib/tc.c | 21 +++ lib/tc.h | 6 ++ 4 files changed,

[ovs-dev] [v4 3/8] netdev-linux: Refactor put police action netlink message

2022-05-02 Thread Jianbo Liu via dev
To reuse the code for manipulating police action, move the common initialization code to a function, and change PPS parameters as meter pktps is in unit of packet per second. null_police is redundant because either BPS or PPS, not both, can be configured in one message. So the police passed in to

[ovs-dev] [v4 2/8] tc: Add support parsing tc police action

2022-05-02 Thread Jianbo Liu via dev
Add function to parse police action from netlink message, and meter id can be retrieved from action cockie as it will be saved there in later patch. Signed-off-by: Jianbo Liu --- lib/netdev-offload-tc.c | 4 +++ lib/tc.c| 59 + lib/tc.h

[ovs-dev] [v4 0/8] Add support for ovs metering with tc offload

2022-05-02 Thread Jianbo Liu via dev
This series is to add support for tc offloading of ovs metering, and enhance OVS to use new kernel feature which offload tc police action to hardware. To do the offloading, new APIs for meter are added in netdev-offload, and OVS meters are mapped to tc police actions with one-to-one relationship

[ovs-dev] [v4 1/8] netdev-offload: Add meter offload API

2022-05-02 Thread Jianbo Liu via dev
Add API to offload meter to HW, and the corresponding functions to call the meter callbacks from all the registered flow API providers. The interfaces are like those related to meter in dpif_class, in order to pass necessary info to HW. Signed-off-by: Jianbo Liu ---

Re: [ovs-dev] [ovs-dev, v3, 0/8] Add support for ovs metering with tc offload

2022-05-02 Thread Jianbo Liu via dev
On Fri, 2022-04-29 at 20:50 +0200, Ilya Maximets wrote: > On 4/29/22 20:01, Ilya Maximets wrote: > > On 4/29/22 05:28, Jianbo Liu wrote: > > > On Thu, 2022-04-28 at 14:00 +0200, Ilya Maximets wrote: > > > > On 4/28/22 13:49, Ilya Maximets wrote: > > > > > On 4/28/22 11:06, Jianbo Liu wrote: > > >

Re: [ovs-dev] [PATCH v3 01/18] python: add generic Key-Value parser

2022-05-02 Thread Terry Wilson
LGTM Acked-by: Terry Wilson On Fri, Mar 11, 2022 at 9:22 AM Adrian Moreno wrote: > > Most of ofproto and dpif flows are based on key-value pairs. These > key-value pairs can be represented in several ways, eg: key:value, > key=value, key(value). > > Add the following classes that allow parsing

Re: [ovs-dev] [PATCH] python: Raise AttributeError from uuid_to_row

2022-05-02 Thread Ilya Maximets
On 5/2/22 15:31, Terry Wilson wrote: > Prior to 4e3966e64, when calling _uuid_to_row, it would raise an > AttributeError when trying to access base.ref_table.rows if the > referenced table was not registered. When called from > Row.__getattr__(), this would appropriately raise an AttributeError. >

Re: [ovs-dev] [PATCH ovn v4 00/15] Support multiple requested-chassis

2022-05-02 Thread Ihar Hrachyshka
On Wed, Apr 20, 2022 at 3:16 PM Numan Siddique wrote: > > On Wed, Apr 20, 2022 at 1:15 PM Ihar Hrachyshka wrote: > > > > Thanks for your review. See below. > > > > On Tue, Apr 19, 2022 at 11:43 AM Numan Siddique wrote: > > > > > > On Tue, Mar 29, 2022 at 8:47 PM Ihar Hrachyshka > > > wrote: >

Re: [ovs-dev] [PATCH ovn] ci: ovn-kubernetes: Add missing socat package

2022-05-02 Thread Mark Michelson
Good catch Ales, Acked-by: Mark Michelson On 4/29/22 03:43, Ales Musil wrote: Signed-off-by: Ales Musil --- .ci/ovn-kubernetes/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/ovn-kubernetes/Dockerfile b/.ci/ovn-kubernetes/Dockerfile index

[ovs-dev] [PATCH] python: Raise AttributeError from uuid_to_row

2022-05-02 Thread Terry Wilson
Prior to 4e3966e64, when calling _uuid_to_row, it would raise an AttributeError when trying to access base.ref_table.rows if the referenced table was not registered. When called from Row.__getattr__(), this would appropriately raise an AttributeError. After 4e3966e64, a KeyError would be raised,