[ovs-dev] [PATCH net-next 0/6] Add dpdk-bond support

2018-04-12 Thread xiangxia . m . yue
From: Tonghao Zhang The bond of openvswitch has not good performance. In some cases we would recommend that you use Linux bonds instead of Open vSwitch bonds. In userspace datapath, we wants use bond to improve bandwidth. The DPDK has implemented it as lib. These patches base DPDK bond to implem

[ovs-dev] [PATCH net-next 1/6] netdev-dpdk: Allow vswitchd to parse devargs as dpdk-bond args

2018-04-12 Thread xiangxia . m . yue
From: Tonghao Zhang If users set the interface options with multi-pci or device names with ',' as a separator, we try to parse it as dpdk-bond args. For example, set an interface as: ovs-vsctl add-port br0 dpdk0 -- \ set Interface dpdk0 type=dpdk \ options:dpdk-devarg

[ovs-dev] [PATCH net-next 2/6] netdev-dpdk: Allow dpdk-ethdev not support setting mtu

2018-04-12 Thread xiangxia . m . yue
From: Tonghao Zhang The bond device in dpdk-17.11 does not support setting mtu, but dpdk upstream supports it now. For more information, see: http://dpdk.org/browse/dpdk/commit/?id=55b58a7374554cd1c86f4a13a0e2f54e9ba6fe4d This patch allows to create bond devices which not support setting mtu.

[ovs-dev] [PATCH net-next 3/6] netdev-dpdk: Add netdev_dpdk_bond struct

2018-04-12 Thread xiangxia . m . yue
From: Tonghao Zhang netdev_dpdk_bond struct will be a member in netdev_dpdk struct. and its init/uinit will be done in the common_construct/destruct. By default, the mode of bond device is active-backup mode. Signed-off-by: Tonghao Zhang --- lib/netdev-dpdk.c | 41 +

[ovs-dev] [PATCH net-next 4/6] netdev-dpdk: Add dpdk-bond support

2018-04-12 Thread xiangxia . m . yue
From: Tonghao Zhang This patch implements, mostly the dpdk-bond support. vswitchd try to parse devargs as dpdk-bond device. If success, create a bond device and add slave ports to it. And the bond device id will be set to dev->port_id as a normal interface. * check pci whether it's valid or

[ovs-dev] [PATCH net-next 5/6] netdev-dpdk: Add check whether dpdk-port is used

2018-04-12 Thread xiangxia . m . yue
From: Tonghao Zhang Extend the function, when looking up the dpdk netdev by port id, if the port id is a slave port id, return its master device. The patch changes the function 'netdev_dpdk_lookup_by_port_id'. Signed-off-by: Tonghao Zhang --- lib/netdev-dpdk.c | 24 ++-- 1

[ovs-dev] [PATCH net-next 6/6] netdev-dpdk: Add dpdk-bond mode setting

2018-04-12 Thread xiangxia . m . yue
From: Tonghao Zhang This patch allows users to set the dpdk-bond mode, such as round_robin, active_backup and balance and so on. ovs-vsctl add-port br0 dpdk0 -- \ set Interface dpdk0 type=dpdk \ options:dpdk-devargs=:06:00.0,:06:00.1 \ options:dpdk

[ovs-dev] [PATCH ovs v2 0/4] expand the meter table and fix bug

2020-05-13 Thread xiangxia . m . yue
From: Tonghao Zhang The patch set expand or shrink the meter table when necessary. and other patches fix bug or improve codes. Tonghao Zhang (4): dpif-netdev: Expand the meters supported number dpif-netdev: Add burst size to buckets dpif-netdev: Use the u64 instead of u32 for buckets Rev

[ovs-dev] [PATCH ovs v2 2/4] dpif-netdev: Add burst size to buckets

2020-05-13 Thread xiangxia . m . yue
From: Tonghao Zhang For now, the meter of the userspace datapath, don't include the bucket burst size to buckets. This patch includes it now. $ ovs-ofctl -O OpenFlow13 add-meter br0 \ 'meter=1 pktps burst stats bands=type=drop rate=1 burst_size=2000' Cc: Ilya Maximets Cc: William T

[ovs-dev] [PATCH ovs v2 1/4] dpif-netdev: Expand the meters supported number

2020-05-13 Thread xiangxia . m . yue
From: Tonghao Zhang For now, ovs-vswitchd use the array of the dp_meter struct to store meter's data, and at most, there are only 65536 (defined by MAX_METERS) meters that can be used. But in some case, for example, in the edge gateway, we should use 200,000, at least, meters for IP address bandw

[ovs-dev] [PATCH ovs v2 3/4] dpif-netdev: Use the u64 instead of u32 for buckets

2020-05-13 Thread xiangxia . m . yue
From: Tonghao Zhang When setting the meter rate to 4.3+Gbps, there is an overflow, the meters don't work as expected. Cc: Ilya Maximets Cc: William Tu Cc: Jarno Rajahalme Cc: Ben Pfaff Cc: Andy Zhou Cc: Pravin Shelar Acked-by: William Tu Signed-off-by: Tonghao Zhang --- include/openvswi

[ovs-dev] [PATCH ovs v2 4/4] Revert "dpif-netdev: includes microsecond delta in meter bucket calculation"

2020-05-13 Thread xiangxia . m . yue
From: Tonghao Zhang This reverts commit 5c41c31ebd64fda821fb733a5784a7a440a794f8. Use the pktgen-dpdk to test the commit 5c41c31ebd64 ("dpif-netdev: includes microsecond delta in meter bucket calculation"), it does't work as expected. And it broken the meter function (e.g. set rate 200Mbps, the

[ovs-dev] [PATCH 3/3] netdev-offload-tc: Use ipv6_addr_is_set instead of is_all_zeros

2020-05-17 Thread xiangxia . m . yue
From: Tonghao Zhang Not bugfix, make the codes more readable. Cc: Simon Horman Cc: Paul Blakey Cc: Roi Dayan Cc: Ben Pfaff Cc: William Tu Cc: Ilya Maximets Signed-off-by: Tonghao Zhang --- lib/netdev-offload-tc.c | 6 ++ lib/tc.c| 6 ++ 2 files changed, 4 insertio

[ovs-dev] [PATCH 1/3] dpif-netlink: Generate ufids for installing TC flowers

2020-05-17 Thread xiangxia . m . yue
From: Tonghao Zhang To support installing the TC flowers to HW, via "ovs-appctl dpctl/add-flow" command, there should be an ufid. This patch will check whether ufid exists, if not, generate an ufid. Should to know that when processing upcall packets, ufid is generated in parse_odp_packet for kern

[ovs-dev] [PATCH 2/3] netdev-offload-tc: Allow to match the IP and port mask of tunnel

2020-05-17 Thread xiangxia . m . yue
From: Tonghao Zhang This patch allows users to offload the TC flower rules with tunnel mask. In some case, mask is useful as wildcards. For example: $ ovs-appctl dpctl/add-flow \ "tunnel(dst=3.3.3.100,src=3.3.3.200/255.255.255.0,tp_dst=4789),\ recirc_id(0),in_port(3),eth(),eth_type(0x080

[ovs-dev] [PATCH ovs-dev v3 0/4] expand the meter table and fix bug.

2020-05-23 Thread xiangxia . m . yue
From: Tonghao Zhang The patch set expand or shrink the meter table when necessary and other patches fix bug or improve codes. Tonghao Zhang (4): dpif-netdev: Expand the meters supported number. dpif-netdev: Add burst size to buckets. dpif-netdev: Use the u64 instead of u32 for buckets. R

[ovs-dev] [PATCH ovs-dev v3 2/4] dpif-netdev: Add burst size to buckets.

2020-05-23 Thread xiangxia . m . yue
From: Tonghao Zhang For now, the meter of the userspace datapath, don't include the bucket burst size to buckets. This patch includes it now. $ ovs-ofctl -O OpenFlow13 add-meter br0 \ 'meter=1 pktps burst stats bands=type=drop rate=1 burst_size=2000' Cc: Ilya Maximets Cc: William T

[ovs-dev] [PATCH ovs-dev v3 3/4] dpif-netdev: Use the u64 instead of u32 for buckets.

2020-05-23 Thread xiangxia . m . yue
From: Tonghao Zhang When setting the meter rate to 4.3+Gbps, there is an overflow, the meters don't work as expected. Cc: Ilya Maximets Cc: William Tu Cc: Jarno Rajahalme Cc: Ben Pfaff Cc: Andy Zhou Cc: Pravin Shelar Acked-by: William Tu Signed-off-by: Tonghao Zhang --- include/openvswi

[ovs-dev] [PATCH ovs-dev v3 4/4] Revert "dpif-netdev: includes microsecond delta in meter bucket calculation".

2020-05-23 Thread xiangxia . m . yue
From: Tonghao Zhang This reverts commit 5c41c31ebd64fda821fb733a5784a7a440a794f8. Use the pktgen-dpdk to test the commit 5c41c31ebd64 ("dpif-netdev: includes microsecond delta in meter bucket calculation"), it does't work as expected. And it broken the meter function (e.g. set rate 200Mbps, the

[ovs-dev] [PATCH ovs-dev v3 1/4] dpif-netdev: Expand the meters supported number.

2020-05-23 Thread xiangxia . m . yue
From: Tonghao Zhang For now, ovs-vswitchd use the array of the dp_meter struct to store meter's data, and at most, there are only 65536 (defined by MAX_METERS) meters that can be used. But in some case, for example, in the edge gateway, we should use 200,000, at least, meters for IP address bandw

[ovs-dev] [PATCH 2/2] dpif-netdev: Return error code when no mark available.

2020-05-23 Thread xiangxia . m . yue
From: Tonghao Zhang The max number of mark is (UINT32_MAX - 1), that is enough to be used. But theoretically, if there are no mark available, the later different flows will shared the mark INVALID_FLOW_MARK, that may break the function. If there are no available mark to be used, return error code

[ovs-dev] [PATCH 1/2] dpif-netdev: Add check mark to avoid ovs-vswitchd crash.

2020-05-23 Thread xiangxia . m . yue
From: Tonghao Zhang When changing the pmd interfaces attribute, ovs-vswitchd will reload pmd and flush offload flows. reload_affected_pmds may be invoked twice or more. In that case, the flows may been queued to "dp_netdev_flow_offload" thread again. For example: $ ovs-vsctl -- set interface op

[ovs-dev] [PATCH v2 1/4] dpif-netlink: Generate ufids for installing TC flowers

2020-06-02 Thread xiangxia . m . yue
From: Tonghao Zhang To support installing the TC flowers to HW, via "ovs-appctl dpctl/add-flow" command, there should be an ufid. This patch will check whether ufid exists, if not, generate an ufid. Should to know that when processing upcall packets, ufid is generated in parse_odp_packet for kern

[ovs-dev] [PATCH v2 0/4] netdev-offload-tc: Allow to match the IP and port mask of tunnel

2020-06-02 Thread xiangxia . m . yue
From: Tonghao Zhang This series patch allows user to match tunnel src/dst address and port with masked values. User can use that to match specified IP address or port and then drop packets (DDOS network attack from a gateway or others) or other actions. patch [1]: allow user install TC Flowers w

[ovs-dev] [PATCH v2 2/4] netdev-offload-tc: Use ipv6_addr_is_set instead of is_all_zeros

2020-06-02 Thread xiangxia . m . yue
From: Tonghao Zhang Not bugfix, make the codes more readable. Cc: Simon Horman Cc: Paul Blakey Cc: Roi Dayan Cc: Ben Pfaff Cc: William Tu Cc: Ilya Maximets Signed-off-by: Tonghao Zhang Acked-by: Roi Dayan --- lib/netdev-offload-tc.c | 6 ++ lib/tc.c| 6 ++ 2 file

[ovs-dev] [PATCH v2 4/4] netdev-offload-tc: Expand tunnel source IPs masked match

2020-06-02 Thread xiangxia . m . yue
From: Tonghao Zhang To support more use case, for example, DDOS, which packets should be dropped in hardware, this patch allows users to match only the tunnel source IPs with masked value. $ ovs-appctl dpctl/add-flow "tunnel(src=2.2.2.0/255.255.255.0,tp_dst=4789,ttl=64),\ recirc_id(2),in_port

[ovs-dev] [PATCH v2 3/4] netdev-offload-tc: Allow to match the IP and port mask of tunnel

2020-06-02 Thread xiangxia . m . yue
From: Tonghao Zhang This patch allows users to offload the TC flower rules with tunnel mask. This patch allows masked match of the following, where previously supported an exact match was supported: * Remote (dst) tunnel endpoint address * Local (src) tunnel endpoint address * Remote (dst) tunnel

[ovs-dev] [PATCH ovs-dev] netdev-offload-tc: Allow installing arp rules to TC dp.

2020-06-04 Thread xiangxia . m . yue
From: Tonghao Zhang This patch allows to install arp rules to tc dp. In the future, arp will be offloaded to hardware to be processed. So OvS enable this now. $ ovs-appctl dpctl/add-flow 'recirc_id(0),in_port(3),eth(),\ eth_type(0x0806),arp(op=2,tha=00:50:56:e1:4b:ab,tip=10.255.1.116)' 2 $ ov

[ovs-dev] [PATCH ovs-dev v2] netdev-offload-tc: Allow installing arp rules to TC dp.

2020-06-05 Thread xiangxia . m . yue
From: Tonghao Zhang This patch allows to install arp rules to tc dp. In the future, arp will be offloaded to hardware to be processed. So OvS enable this now. $ ovs-appctl dpctl/add-flow 'recirc_id(0),in_port(3),eth(),\ eth_type(0x0806),arp(op=2,tha=00:50:56:e1:4b:ab,tip=10.255.1.116)' 2 $ ov

[ovs-dev] [PATCH RESEND ovs-dev v1 0/2] dpif-netdev: avoid ovs-vswitchd crash

2020-06-08 Thread xiangxia . m . yue
From: Tonghao Zhang This patchset add more robust error handling. Tested-at: https://travis-ci.com/github/ovn-open-virtual-networks/ovs/builds/170300796 Tonghao Zhang (2): dpif-netdev: Add check mark to avoid ovs-vswitchd crash. dpif-netdev: Return error code when no mark available. lib/d

[ovs-dev] [PATCH RESEND ovs-dev v1 1/2] dpif-netdev: Add check mark to avoid ovs-vswitchd crash.

2020-06-08 Thread xiangxia . m . yue
From: Tonghao Zhang When changing the pmd interfaces attribute, ovs-vswitchd will reload pmd and flush offload flows. reload_affected_pmds may be invoked twice or more. In that case, the flows may been queued to "dp_netdev_flow_offload" thread again. For example: $ ovs-vsctl -- set interface op

[ovs-dev] [PATCH RESEND ovs-dev v1 2/2] dpif-netdev: Return error code when no mark available.

2020-06-08 Thread xiangxia . m . yue
From: Tonghao Zhang The max number of mark is (UINT32_MAX - 1), that is enough to be used. But theoretically, if there are no mark available, the later different flows will shared the mark INVALID_FLOW_MARK, that may break the function. If there are no available mark to be used, return error code

[ovs-dev] [PATCH ovs-dev v1] netdev-offload: Flush offloaded rules when ports removed

2020-06-11 Thread xiangxia . m . yue
From: Tonghao Zhang When ports were removed from bridge, we should flush the offload rules on the ports. The main reason is two factors: * The ports removed from bridge, will be managed by OvS, so flush the rules which installed by OvS. * If using the TC flower offload, for example, tc rules s

[ovs-dev] [PATCH ovs-dev v1 1/2] dpctl: Fix memory leak in dpctl_dump_flows()

2020-07-16 Thread xiangxia . m . yue
From: Tonghao Zhang Goto label accurately to avoid memleak. Fixes: a692410af0f7 ("dpctl: Expand the flow dump type filter") Cc: Gavi Teitz Signed-off-by: Tonghao Zhang --- lib/dpctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/dpctl.c b/lib/dpctl.c index db2b1f896

[ovs-dev] [PATCH ovs-dev v1 2/2] dpctl-netdev: Add the option "pmd" for dump-flows

2020-07-16 Thread xiangxia . m . yue
From: Tonghao Zhang "ovs-appctl dpctl/dump-flows" added the option "pmd" which allow user to dump pmd specified. That option is useful to dump rules of pmd when we have a large number of rules in dp. Signed-off-by: Tonghao Zhang --- NEWS| 2 ++ lib/dpctl.c | 28 ++

[ovs-dev] [PATCH net-next v6 00/10] optimize openvswitch flow looking up

2019-11-01 Thread xiangxia . m . yue
From: Tonghao Zhang This series patch optimize openvswitch for performance or simplify codes. Patch 1, 2, 4: Port Pravin B Shelar patches to linux upstream with little changes. Patch 5, 6, 7: Optimize the flow looking up and simplify the flow hash. Patch 8, 9: are bugfix. The performance test

[ovs-dev] [PATCH net-next v6 01/10] net: openvswitch: add flow-mask cache for performance

2019-11-01 Thread xiangxia . m . yue
From: Tonghao Zhang The idea of this optimization comes from a patch which is committed in 2014, openvswitch community. The author is Pravin B Shelar. In order to get high performance, I implement it again. Later patches will use it. Pravin B Shelar, says: | On every packet OVS needs to lookup f

[ovs-dev] [PATCH net-next v6 02/10] net: openvswitch: convert mask list in mask array

2019-11-01 Thread xiangxia . m . yue
From: Tonghao Zhang Port the codes to linux upstream and with little changes. Pravin B Shelar, says: | mask caches index of mask in mask_list. On packet recv OVS | need to traverse mask-list to get cached mask. Therefore array | is better for retrieving cached mask. This also allows better | cac

[ovs-dev] [PATCH net-next v6 03/10] net: openvswitch: shrink the mask array if necessary

2019-11-01 Thread xiangxia . m . yue
From: Tonghao Zhang When creating and inserting flow-mask, if there is no available flow-mask, we realloc the mask array. When removing flow-mask, if necessary, we shrink mask array. Signed-off-by: Tonghao Zhang Tested-by: Greg Rose Acked-by: William Tu --- net/openvswitch/flow_table.c | 33

[ovs-dev] [PATCH net-next v6 04/10] net: openvswitch: optimize flow mask cache hash collision

2019-11-01 Thread xiangxia . m . yue
From: Tonghao Zhang Port the codes to linux upstream and with little changes. Pravin B Shelar, says: | In case hash collision on mask cache, OVS does extra flow | lookup. Following patch avoid it. Link: https://github.com/openvswitch/ovs/commit/0e6efbe2712da03522532dc5e84806a96f6a0dd1 Signed-o

[ovs-dev] [PATCH net-next v6 05/10] net: openvswitch: optimize flow-mask looking up

2019-11-01 Thread xiangxia . m . yue
From: Tonghao Zhang The full looking up on flow table traverses all mask array. If mask-array is too large, the number of invalid flow-mask increase, performance will be drop. One bad case, for example: M means flow-mask is valid and NULL of flow-mask means deleted. +---

[ovs-dev] [PATCH net-next v6 07/10] net: openvswitch: add likely in flow_lookup

2019-11-01 Thread xiangxia . m . yue
From: Tonghao Zhang The most case *index < ma->max, and flow-mask is not NULL. We add un/likely for performance. Signed-off-by: Tonghao Zhang Tested-by: Greg Rose Acked-by: William Tu --- net/openvswitch/flow_table.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net

[ovs-dev] [PATCH net-next v6 06/10] net: openvswitch: simplify the flow_hash

2019-11-01 Thread xiangxia . m . yue
From: Tonghao Zhang Simplify the code and remove the unnecessary BUILD_BUG_ON. Signed-off-by: Tonghao Zhang Tested-by: Greg Rose Acked-by: William Tu --- net/openvswitch/flow_table.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/net/openvswitch/flow_table.c b/net

[ovs-dev] [PATCH net-next v6 08/10] net: openvswitch: fix possible memleak on destroy flow-table

2019-11-01 Thread xiangxia . m . yue
From: Tonghao Zhang When we destroy the flow tables which may contain the flow_mask, so release the flow mask struct. Signed-off-by: Tonghao Zhang Tested-by: Greg Rose --- net/openvswitch/flow_table.c | 186 +++ 1 file changed, 98 insertions(+), 88 dele

[ovs-dev] [PATCH net-next v6 09/10] net: openvswitch: don't unlock mutex when changing the user_features fails

2019-11-01 Thread xiangxia . m . yue
From: Tonghao Zhang Unlocking of a not locked mutex is not allowed. Other kernel thread may be in critical section while we unlock it because of setting user_feature fail. Fixes: 95a7233c4 ("net: openvswitch: Set OvS recirc_id from tc chain index") Cc: Paul Blakey Signed-off-by: Tonghao Zhang

[ovs-dev] [PATCH net-next v6 10/10] net: openvswitch: simplify the ovs_dp_cmd_new

2019-11-01 Thread xiangxia . m . yue
From: Tonghao Zhang use the specified functions to init resource. Signed-off-by: Tonghao Zhang Tested-by: Greg Rose --- net/openvswitch/datapath.c | 60 +- 1 file changed, 38 insertions(+), 22 deletions(-) diff --git a/net/openvswitch/datapath.c b/

[ovs-dev] [PATCH net-next] net: openvswitch: select vport upcall portid drectly

2019-11-06 Thread xiangxia . m . yue
From: Tonghao Zhang The commit 69c51582ff786 ("dpif-netlink: don't allocate per thread netlink sockets"), in Open vSwitch ovs-vswitchd, has changed the number of allocated sockets to just one per port by moving the socket array from a per handler structure to a per datapath one. In the kernel dat

[ovs-dev] [PATCH net-next v2] net: openvswitch: select vport upcall portid directly

2019-11-06 Thread xiangxia . m . yue
From: Tonghao Zhang The commit 69c51582ff786 ("dpif-netlink: don't allocate per thread netlink sockets"), in Open vSwitch ovs-vswitchd, has changed the number of allocated sockets to just one per port by moving the socket array from a per handler structure to a per datapath one. In the kernel dat

[ovs-dev] [PATCH net-next] net: openvswitch: add hash info to upcall

2019-11-10 Thread xiangxia . m . yue
From: Tonghao Zhang When using the kernel datapath, the upcall don't add skb hash info relatived. That will introduce some problem, because the hash of skb is very important (e.g. vxlan module uses it for udp src port, tx queue selection on tx path.). For example, there will be one upcall, witho

[ovs-dev] [PATCH net-next v2] net: openvswitch: add hash info to upcall

2019-11-10 Thread xiangxia . m . yue
From: Tonghao Zhang When using the kernel datapath, the upcall don't add skb hash info relatived. That will introduce some problem, because the hash of skb is very important (e.g. vxlan module uses it for udp src port, tx queue selection on tx path.). For example, there will be one upcall, witho

[ovs-dev] [PATCH net-next v3] net: openvswitch: add hash info to upcall

2019-11-12 Thread xiangxia . m . yue
From: Tonghao Zhang When using the kernel datapath, the upcall don't include skb hash info relatived. That will introduce some problem, because the hash of skb is important in kernel stack. For example, VXLAN module uses it to select UDP src port. The tx queue selection may also use the hash in s

[ovs-dev] [PATCH net-next v4] net: openvswitch: add hash info to upcall

2019-11-13 Thread xiangxia . m . yue
From: Tonghao Zhang When using the kernel datapath, the upcall don't include skb hash info relatived. That will introduce some problem, because the hash of skb is important in kernel stack. For example, VXLAN module uses it to select UDP src port. The tx queue selection may also use the hash in s

[ovs-dev] [PATCH net-next] net: openvswitch: don't call pad_packet if not necessary

2019-11-14 Thread xiangxia . m . yue
From: Tonghao Zhang The nla_put_u16/nla_put_u32 makes sure that *attrlen is align. The call tree is that: nla_put_u16/nla_put_u32 -> nla_putattrlen = sizeof(u16) or sizeof(u32) -> __nla_put attrlen -> __nla_reserve attrlen -> skb_put(skb, nla_total_size(attrlen)

[ovs-dev] [PATCH] dpif-netdev: Allow to set max capacity of flow on netdev

2019-12-23 Thread xiangxia . m . yue
From: Tonghao Zhang There may be too many flows (> MAX_FLOWS 65536) on dpif-netdev at same time. For this case, we support the ovs-appctl command to change the flow max number. Signed-off-by: Tonghao Zhang --- lib/dpif-netdev.c | 51 +-- 1 file chang

[ovs-dev] [PATCH] netdev-offload-tc: Add checking when assigning flow api

2019-12-23 Thread xiangxia . m . yue
From: Tonghao Zhang netdev_assign_flow_api will try to init the netdev, if success, the netdev will use the offload api. If we init the type of netdev is dpdk, using the tc offload api (netdev_tc_init_flow_api, which may be called firstly.), the err log always is showing up. This patch adds a add

[ovs-dev] [ovs-dev 1/7] dpif-netdev: Remove dp_meter_* struct to header file

2019-12-27 Thread xiangxia . m . yue
From: Tonghao Zhang This patch will be used in later patch. Signed-off-by: Tonghao Zhang --- lib/dpif-netdev.c | 17 - lib/dpif-netdev.h | 17 + 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c index 8485b54.

[ovs-dev] [ovs-dev 0/7] Support meter action offload

2019-12-27 Thread xiangxia . m . yue
From: Tonghao Zhang This series patch support the meter action offload. We add the general struct, api and implement the dpdk meter offload. Any suggestion is welcome. Tonghao Zhang (7): dpif-netdev: Remove dp_meter_* struct to header file netdev-offload: Pass dpif as an argument to flow_put

[ovs-dev] [ovs-dev 2/7] netdev-offload: Pass dpif as an argument to flow_put

2019-12-27 Thread xiangxia . m . yue
From: Tonghao Zhang When offloading the meter action, we may access the "datapath" resource, such as the meter[] of struct dp_netdev. We will store meter offload info to it. Signed-off-by: Tonghao Zhang --- lib/dpif-netdev.c | 2 +- lib/dpif-netlink.c| 2 +- lib/netde

[ovs-dev] [ovs-dev 4/7] netdev-offload-provider: Add meter offload struct

2019-12-27 Thread xiangxia . m . yue
From: Tonghao Zhang Introduce the meter offload struct and dp_meter use it. Signed-off-by: Tonghao Zhang --- lib/dpif-netdev.h | 2 ++ lib/netdev-offload-provider.h | 10 ++ 2 files changed, 12 insertions(+) diff --git a/lib/dpif-netdev.h b/lib/dpif-netdev.h index b5f5c12

[ovs-dev] [ovs-dev 3/7] dpif-provider: Add dpif provider meter api

2019-12-27 Thread xiangxia . m . yue
From: Tonghao Zhang Add the callback which will be called when we operate the meter offload. Signed-off-by: Tonghao Zhang --- lib/dpif-netdev.c | 3 +++ lib/dpif-netlink.c | 3 +++ lib/dpif-provider.h | 5 lib/dpif.c | 66

[ovs-dev] [ovs-dev 5/7] netdev-dpif: Implement netdev meter offload

2019-12-27 Thread xiangxia . m . yue
From: Tonghao Zhang Implement the meter offload api in the netdev. Signed-off-by: Tonghao Zhang --- lib/dpif-netdev.c | 96 +-- 1 file changed, 93 insertions(+), 3 deletions(-) diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c index 051d090

[ovs-dev] [ovs-dev 6/7] ofp-meter: Add get max-rate function

2019-12-27 Thread xiangxia . m . yue
From: Tonghao Zhang This patch will be used later. Signed-off-by: Tonghao Zhang --- include/openvswitch/ofp-meter.h | 1 + lib/ofp-meter.c | 13 + 2 files changed, 14 insertions(+) diff --git a/include/openvswitch/ofp-meter.h b/include/openvswitch/ofp-meter.h inde

[ovs-dev] [ovs-dev 7/7] netdev-offload-dpdk: Add dpdk offload meter action

2019-12-27 Thread xiangxia . m . yue
From: Tonghao Zhang This patch introduce the dpdk_meter_offload_api struct and implement the meter offload api for dpdk. * ovs-ofctl can create the meter resource but the meter offload action is not created yet. The meter action will be created actually when installing the flow, and the of

[ovs-dev] [ovs-dev v2] dpif-netdev: Allow to set max capacity of flow on netdev

2020-01-08 Thread xiangxia . m . yue
From: Tonghao Zhang For installing more than MAX_FLOWS (65536) flows to netdev datapath. Add the ovs-appctl subcommand "dpif-netdev/pmd-set-max-flow" which can change the flow number which netdev datapath support. Signed-off-by: Tonghao Zhang --- v2: * change int type to atomic_uint32_t * check

[ovs-dev] [ovs-dev v3] dpif-netdev: Allow to set max capacity of flow on netdev.

2020-01-08 Thread xiangxia . m . yue
From: Tonghao Zhang For installing more than MAX_FLOWS (65536) flows to netdev datapath. Add the ovs-appctl subcommand "dpif-netdev/pmd-set-max-flow" which can change the flow number which netdev datapath support. Signed-off-by: Tonghao Zhang --- v3: * change the UINT_MAX to UINT32_MAX * add in

[ovs-dev] [PATCH RESEND ovs-dev] netdev-offload-tc: Add checking when assigning flow api

2020-01-19 Thread xiangxia . m . yue
From: Tonghao Zhang netdev_assign_flow_api will try to init the netdev, if success, the netdev will use the offload api. If we init the type of netdev is dpdk, using the tc offload api (netdev_tc_init_flow_api, which may be called firstly.), the err log always is showing up. This patch adds a add

[ovs-dev] [PATCH] netdev-linux: Don't remove ingress when not configured

2019-04-04 Thread xiangxia . m . yue
From: Tonghao Zhang In some case, we may not use the openvswitch tc to limit the ingress police rate. And before we add the port to openvswitch bridge, we may set the ingress policer, so don't remove the ingress when we configured it in openvswitch. Signed-off-by: Tonghao Zhang --- lib/netdev-

[ovs-dev] [PATCH v3] netdev-linux: Don't remove ingress when not configured

2019-04-09 Thread xiangxia . m . yue
From: Tonghao Zhang In some case, we may not use the openvswitch tc to limit the ingress police rate. And before we add the port to openvswitch bridge, we may set the ingress policer, so don't remove the ingress when we not configured it in openvswitch. Signed-off-by: Tonghao Zhang --- lib/net

[ovs-dev] [PATCH ovs] conntrack: Update the icmp stats accurately.

2020-12-23 Thread xiangxia . m . yue
From: Tonghao Zhang The same icmp packet may traverse conntrack module more than once. Or same icmp packets traverse contranck module in orderly. Don't change stats to CS_ESTABLISHED before receiving reply or related packets. Fixes: b269a1229df2 ("conntrack: Track ICMP type and code.") Cc: Dani

[ovs-dev] [PATCH ovs 1/2] dpif-netdev: Fix the meter buckets overflow.

2021-01-12 Thread xiangxia . m . yue
From: Tonghao Zhang When setting the meter rate to 4.3+Gbps, there is an overflow, the meters don't work as expected. $ ovs-ofctl -O OpenFlow13 add-meter br-int "meter=1 kbps stats bands=type=drop rate=4294968" Before the patch, the buckets of meters was stored in its burst_size of ofputil_met

[ovs-dev] [PATCH ovs 2/2] dpif-netdev: Add the burst size to buckets.

2021-01-12 Thread xiangxia . m . yue
From: Tonghao Zhang For now, the meter of the userspace datapath, don't include the bucket burst size to buckets. This patch includes it now. $ ovs-ofctl -O OpenFlow13 add-meter br0 \ 'meter=1 pktps burst stats bands=type=drop rate=1 burst_size=2000' Signed-off-by: Tonghao Zhang --

[ovs-dev] [PATCH ovs v2] conntrack: Fix the icmp conntrack new state.

2021-01-21 Thread xiangxia . m . yue
From: Tonghao Zhang The same icmp packet may traverse conntrack module more than once. Or same icmp packets traverse contranck module in orderly. Don't change state to CS_ESTABLISHED before receiving reply or related packets. Fixes: a867c010ee91 ("conntrack: Fix conntrack new state") Signed-off

[ovs-dev] [PATCH ovs v2 1/3] dpif-netdev: Fix the meter buckets overflow.

2021-01-21 Thread xiangxia . m . yue
From: Tonghao Zhang When setting the meter rate to 4.3+Gbps, there is an overflow, the meters don't work as expected. $ ovs-ofctl -O OpenFlow13 add-meter br-int "meter=1 kbps stats bands=type=drop rate=4294968" Before the patch, the buckets of meters was stored in its burst_size of ofputil_met

[ovs-dev] [PATCH ovs v2 2/3] dpif-netdev: Add the burst size to buckets.

2021-01-21 Thread xiangxia . m . yue
From: Tonghao Zhang For now, the meter of the userspace datapath, don't include the bucket burst size to buckets. This patch includes it now. $ ovs-ofctl -O OpenFlow13 add-meter br0 \ 'meter=1 pktps burst stats bands=type=drop rate=1 burst_size=2000' Signed-off-by: Tonghao Zhang --

[ovs-dev] [PATCH ovs v2 3/3] tests/dpif-netdev: Update dpif-netdev meter testcase.

2021-01-21 Thread xiangxia . m . yue
From: Tonghao Zhang The buckets used was changed, and now dpif-netdev support burst_size, change the testcase. Signed-off-by: Tonghao Zhang --- tests/dpif-netdev.at | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/dpif-netdev.at b/tests/dpif-netdev.at

[ovs-dev] [PATCH ovs] ofproto-dpif-xlate: Allow specific tunnel packets sent outside.

2021-01-30 Thread xiangxia . m . yue
From: Tonghao Zhang This patch adds more strict limitation to tunnel packets. If the source and destination address are the local address. the tunnel packets will be sent to outside. This is useful, for example, if we upgrade the openvswitch: One OvS may send these packets outside, and the physi

[ovs-dev] [PATCH] rhel: Update build required dpdk.

2021-02-03 Thread xiangxia . m . yue
From: Tonghao Zhang Now OvS supports building with dpdk 20.11, and uses the '--with-dpdk=shared' option in fedora.spec. Then change version of dpdk 17.05.1 to 20.11. Note that dpdk-devel-20.11.x is not released in fedora distro, but use '20.11' is fine. Fixes: 252e1e576443 ("dpdk: Update to use

[ovs-dev] [PATCH RESEND v2 0/3] dpif-netdev meter overflow fixes

2021-02-24 Thread xiangxia . m . yue
From: Tonghao Zhang [resend with cover letter] Patch 1 fixes the meter overflow, with that change, patch 2 adds burst size to buckets which more accurate. Patch 3 change testcase because the way of computing buckets changed. v2: change the testcase. v1: split patches from: http://patchwork.ozl

[ovs-dev] [PATCH RESEND v2 1/3] dpif-netdev: Fix the meter buckets overflow.

2021-02-24 Thread xiangxia . m . yue
From: Tonghao Zhang When setting the meter rate to 4.3+Gbps, there is an overflow, the meters don't work as expected. $ ovs-ofctl -O OpenFlow13 add-meter br-int "meter=1 kbps stats bands=type=drop rate=4294968" Before the patch, the buckets of meters was stored in its burst_size of ofputil_met

[ovs-dev] [PATCH RESEND v2 2/3] dpif-netdev: Add the burst size to buckets.

2021-02-24 Thread xiangxia . m . yue
From: Tonghao Zhang For now, the meter of the userspace datapath, don't include the bucket burst size to buckets. This patch includes it now. $ ovs-ofctl -O OpenFlow13 add-meter br0 \ 'meter=1 pktps burst stats bands=type=drop rate=1 burst_size=2000' Signed-off-by: Tonghao Zhang --

[ovs-dev] [PATCH RESEND v2 3/3] tests/dpif-netdev: Update dpif-netdev meter testcase.

2021-02-24 Thread xiangxia . m . yue
From: Tonghao Zhang The buckets used was changed, and now dpif-netdev support burst_size, change the testcase. Signed-off-by: Tonghao Zhang --- tests/dpif-netdev.at | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/dpif-netdev.at b/tests/dpif-netdev.at

[ovs-dev] [PATCH ovs v3 3/4] dpif-netdev: Add the burst size to buckets.

2021-03-02 Thread xiangxia . m . yue
From: Tonghao Zhang For now, the meter of the userspace datapath, don't include the bucket burst size to total buckets. This patch includes it now. $ ovs-ofctl -O OpenFlow13 add-meter br0 \ 'meter=1 pktps burst stats bands=type=drop rate=1 burst_size=2000' Signed-off-by: Tonghao Zhang

[ovs-dev] [PATCH ovs v3 0/4] dpif-netdev meter fixes bug and improves.

2021-03-02 Thread xiangxia . m . yue
From: Tonghao Zhang v3: * split path1 to #1, #2, #4 * update testcase in every patch. * improve testcase v2: * change the testcase. v1: * split patches from: http://patchwork.ozlabs.org/project/openvswitch/patch/1588244439-58766-2-git-send-email-xiangxia.m@gmail.com/ http://patchwork.ozlabs

[ovs-dev] [PATCH ovs v3 2/4] dpif-netdev: Refactor the buckets calculation.

2021-03-02 Thread xiangxia . m . yue
From: Tonghao Zhang The way that "burst_size" was used as total buckets is very strange. If user set the "burst_size" too smaller while "rate" larger, that may affect the meter normal work. This patch refactor the buckets calculation, and start with a full buckets. Signed-off-by: Tonghao Zhang

[ovs-dev] [PATCH ovs v3 4/4] dpif: Don't set "burst_size" to "rate" if not specified.

2021-03-03 Thread xiangxia . m . yue
From: Tonghao Zhang If user don't set the meter "burst_size", when creating them. OvS will set "brust_size" to "rate", and there will be a double "rate" as burst rate. For example: $ ovs-ofctl -O OpenFlow13 add-meter br0 'meter=1 pktps stats bands=type=drop rate=100' The rate expected is 1

[ovs-dev] [PATCH RESEND ovs v3 4/4] dpif: Don't set "burst_size" to "rate" if not specified.

2021-03-03 Thread xiangxia . m . yue
From: Tonghao Zhang If user don't set the meter "burst_size", when creating them. OvS will set "brust_size" to "rate", and there will be a double "rate" as burst rate. For example: $ ovs-ofctl -O OpenFlow13 add-meter br0 'meter=1 pktps stats bands=type=drop rate=100' The rate expected is 1

[ovs-dev] [PATCH RESEND ovs v3 3/4] dpif-netdev: Add the burst size to buckets.

2021-03-03 Thread xiangxia . m . yue
From: Tonghao Zhang For now, the meter of the userspace datapath, don't include the bucket burst size to total buckets. This patch includes it now. $ ovs-ofctl -O OpenFlow13 add-meter br0 'meter=1 pktps burst stats bands=type=drop rate=1 burst_size=2000' OvS linux kernel module do that in

[ovs-dev] [PATCH RESEND ovs v3 1/4] dpif-netdev: Fix the meter buckets overflow.

2021-03-03 Thread xiangxia . m . yue
From: Tonghao Zhang When setting the meter rate to 4.3+Gbps, there is an overflow, the meters don't work as expected. $ ovs-ofctl -O OpenFlow13 add-meter br-int "meter=1 kbps stats bands=type=drop rate=4294968" It was overflow when we set the rate to 4294968, because "burst_size" in the ofputi

[ovs-dev] [PATCH RESEND ovs v3 2/4] dpif-netdev: Refactor the buckets calculation.

2021-03-03 Thread xiangxia . m . yue
From: Tonghao Zhang The way that "burst_size" was used as total buckets is very strange. If user set the "burst_size" too smaller while "rate" larger, that may affect the meter normal work. This patch refactor the buckets calculation, and start with a full buckets. Signed-off-by: Tonghao Zhang

[ovs-dev] [PATCH RESEND ovs v3 0/4] dpif-netdev meter fixes bug and improves.

2021-03-03 Thread xiangxia . m . yue
From: Tonghao Zhang v3: * split path1 to #1, #2, #4 * update testcase in every patch. * improve testcase v2: * change the testcase. v1: * split patches from: http://patchwork.ozlabs.org/project/openvswitch/patch/1588244439-58766-2-git-send-email-xiangxia.m@gmail.com/ http://patchwork.ozlabs

[ovs-dev] [PATCH ovs v3 1/4] dpif-netdev: Fix the meter buckets overflow.

2021-03-03 Thread xiangxia . m . yue
From: Tonghao Zhang When setting the meter rate to 4.3+Gbps, there is an overflow, the meters don't work as expected. $ ovs-ofctl -O OpenFlow13 add-meter br-int "meter=1 kbps stats bands=type=drop rate=4294968" It was overflow when we set the rate to 4294968, because "burst_size" in the ofputi

[ovs-dev] [PATCH ovs v2] dpctl-netdev: Add the option "pmd" for dump-flows

2020-07-24 Thread xiangxia . m . yue
From: Tonghao Zhang "ovs-appctl dpctl/dump-flows" added the option "pmd" which allow user to dump pmd specified. That option is useful to dump rules of pmd when we have a large number of rules in dp. Signed-off-by: Tonghao Zhang --- v2: * rebase the codes * add usage --- NEWS|

[ovs-dev] [PATCH] net: openvswitch: silence suspicious RCU usage warning

2020-08-05 Thread xiangxia . m . yue
From: Tonghao Zhang ovs_flow_tbl_destroy always is called from RCU callback or error path. It is no need to check if rcu_read_lock or lockdep_ovsl_is_held was held. ovs_dp_cmd_fill_info always is called with ovs_mutex, So use the rcu_dereference_ovsl instead of rcu_dereference in ovs_flow_tbl_ma

[ovs-dev] [PATCH] net: openvswitch: introduce common code for flushing flows

2020-08-10 Thread xiangxia . m . yue
From: Tonghao Zhang To avoid some issues, for example RCU usage warning, we should flush the flows under ovs_lock. This patch refactors table_instance_destroy and introduces table_instance_flow_flush which can be invoked by __dp_destroy or ovs_flow_tbl_flush. Signed-off-by: Tonghao Zhang --- n

[ovs-dev] [PATCH v2] net: openvswitch: introduce common code for flushing flows

2020-08-12 Thread xiangxia . m . yue
From: Tonghao Zhang To avoid some issues, for example RCU usage warning and double free, we should flush the flows under ovs_lock. This patch refactors table_instance_destroy and introduces table_instance_flow_flush which can be invoked by __dp_destroy or ovs_flow_tbl_flush. Fixes: 50b0e61b32ee

[ovs-dev] [PATCH net-next v1 1/3] net: openvswitch: improve coding style

2020-08-18 Thread xiangxia . m . yue
From: Tonghao Zhang Not change the logic, just improve coding style. Cc: Pravin B Shelar Signed-off-by: Tonghao Zhang --- net/openvswitch/actions.c| 5 ++-- net/openvswitch/datapath.c | 35 net/openvswitch/flow_table.c | 44 -

[ovs-dev] [PATCH net-next v1 0/3] net: openvswitch: improve codes

2020-08-18 Thread xiangxia . m . yue
From: Tonghao Zhang This series patches are not bug fix, just improve codes. Tonghao Zhang (3): net: openvswitch: improve coding style net: openvswitch: refactor flow free function net: openvswitch: remove unnused keep_flows net/openvswitch/actions.c| 5 +-- net/openvswitch/datapath

[ovs-dev] [PATCH net-next v1 3/3] net: openvswitch: remove unnused keep_flows

2020-08-18 Thread xiangxia . m . yue
From: Tonghao Zhang keep_flows was introduced by [1], which used as flag to delete flows or not. When rehashing or expanding the table instance, we will not flush the flows. Now don't use it anymore, remove it. [1] - https://github.com/openvswitch/ovs/commit/acd051f1761569205827dc9b037e15568a8d

[ovs-dev] [PATCH net-next v1 2/3] net: openvswitch: refactor flow free function

2020-08-18 Thread xiangxia . m . yue
From: Tonghao Zhang Decrease table->count and ufid_count unconditionally, and add BUG_ON in flush flows function. Cc: Pravin B Shelar Signed-off-by: Tonghao Zhang --- net/openvswitch/flow_table.c | 19 --- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/net/open

[ovs-dev] [PATCH ovs resend v2] dpctl-netdev: Add the option "pmd" for dump-flows

2020-08-23 Thread xiangxia . m . yue
From: Tonghao Zhang "ovs-appctl dpctl/dump-flows" added the option "pmd" which allow user to dump pmd specified. That option is useful to dump rules of pmd when we have a large number of rules in dp. Signed-off-by: Tonghao Zhang --- NEWS| 2 ++ lib/dpctl.c | 28 ++

  1   2   >