[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

[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 \

[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

[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

[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 ---

[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

[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

[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 ---

[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 ---

[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,

[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,

[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

[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

[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

[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,

[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

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

2019-10-16 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 |

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

2019-10-16 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

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

2019-10-16 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

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

2019-10-16 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

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

2019-10-16 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 --- net/openvswitch/flow_table.c | 33

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

2019-10-16 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 v4 04/10] net: openvswitch: optimize flow mask cache hash collision

2019-10-16 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

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

2019-10-16 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 | 14 +- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git

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

2019-10-16 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 v4 07/10] net: openvswitch: add likely in flow_lookup

2019-10-16 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 --- net/openvswitch/flow_table.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git

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

2019-10-16 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 --- net/openvswitch/flow_table.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/net/openvswitch/flow_table.c

[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

[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 v5 02/10] net: openvswitch: convert mask list in mask array

2019-10-29 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 |

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

2019-10-29 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

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

2019-10-29 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

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

2019-10-29 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

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

2019-10-29 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 v5 03/10] net: openvswitch: shrink the mask array if necessary

2019-10-29 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 v5 06/10] net: openvswitch: simplify the flow_hash

2019-10-29 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 | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/net/openvswitch/flow_table.c

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

2019-10-29 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

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

2019-10-29 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

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

2019-10-29 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 | 185 +++ 1 file changed, 97 insertions(+), 88

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

2019-10-29 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 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

[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 |

[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

[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

[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 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 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

[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

[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

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

2019-10-11 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 --- net/openvswitch/flow_table.c | 14 +- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/net/openvswitch/flow_table.c

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

2019-10-11 Thread xiangxia . m . yue
From: Tonghao Zhang The most case *index < ma->count, and flow-mask is not NULL. We add un/likely for performance. Signed-off-by: Tonghao Zhang --- net/openvswitch/flow_table.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/net/openvswitch/flow_table.c

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

2019-10-11 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

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

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

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

2019-10-11 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 |

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

2019-10-11 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 v3 00/10] optimize openvswitch flow looking up

2019-10-11 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

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

2019-10-11 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. This patch optimizes mask-array operation: * Inserting, insert it [ma->count- 1] directly. * Removing, only change

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

2019-10-11 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 --- net/openvswitch/flow_table.c | 33 +++-- 1 file

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

2019-10-11 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

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

2019-10-11 Thread xiangxia . m . yue
From: Tonghao Zhang Simplify the code and remove the unnecessary BUILD_BUG_ON. Signed-off-by: Tonghao Zhang --- net/openvswitch/flow_table.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/net/openvswitch/flow_table.c b/net/openvswitch/flow_table.c index

[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

[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

[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

[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

[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

[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

[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

[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

[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

[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 +-

[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

[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 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 *

[ovs-dev] [PATCH ovs 1/2] dpif-netdev: Expand the meter capacity using cmap

2020-03-14 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

[ovs-dev] [PATCH ovs 2/2] dpif-netdev: Add meter cache for performance

2020-03-14 Thread xiangxia . m . yue
From: Tonghao Zhang The cmap can address the meter capacity issue, but using cmap, there is 1% performance loss compared with previous array implementation. This patch add a meter cache in dp_netdev for fast lookup. With this patch, forwarding between p0 and p1, is 4,929,904 pps, the test

[ovs-dev] [PATCH v2 1/2] dpif-netdev: Expand the meter capacity using cmap

2020-03-15 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

[ovs-dev] [PATCH v2 2/2] dpif-netdev: Add meter cache for performance

2020-03-15 Thread xiangxia . m . yue
From: Tonghao Zhang The cmap can address the meter capacity issue, but using cmap, there is 1% performance loss compared with previous array implementation. This patch add a meter cache in dp_netdev for fast lookup. With this patch, forwarding between p0 and p1, is 4,929,904 pps, the test method

[ovs-dev] [PATCH ovs] netdev-offload-tc: Use accurately function to check dl_type.

2020-04-11 Thread xiangxia . m . yue
From: Tonghao Zhang When offloading the flows which matching the vlan feild, there is an error[1]. Then we can't offload them, though TC flower supports this. To fix it, we should use the *dl_type_is_ip_any* instead of *is_ip_any*. Use ovs-appctl command to reproduce it. $ ovs-appctl

[ovs-dev] [PATCH net-next v2 0/5] expand meter tables and fix bug

2020-04-18 Thread xiangxia . m . yue
From: Tonghao Zhang The patch set expands or shrink the meter table when necessary. and other patch fixes bug or improve codes. Tonghao Zhang (5): net: openvswitch: expand the meters supported number net: openvswitch: set max limitation to meters net: openvswitch: remove the unnecessary

[ovs-dev] [PATCH net-next v2 1/5] net: openvswitch: expand the meters supported number

2020-04-18 Thread xiangxia . m . yue
From: Tonghao Zhang In kernel datapath of Open vSwitch, there are only 1024 buckets of meter in one dp. If installing more than 1024 (e.g. 8192) meters, it may lead to the performance drop. But in some case, for example, Open vSwitch used as edge gateway, there should be 200,000+ at least,

[ovs-dev] [PATCH net-next v2 3/5] net: openvswitch: remove the unnecessary check

2020-04-18 Thread xiangxia . m . yue
From: Tonghao Zhang Before calling the ovs_meter_cmd_reply_stats, "meter" is checked, so don't check it agin in that function. Cc: Pravin B Shelar Cc: Andy Zhou Signed-off-by: Tonghao Zhang --- net/openvswitch/meter.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff

[ovs-dev] [PATCH net-next v2 2/5] net: openvswitch: set max limitation to meters

2020-04-18 Thread xiangxia . m . yue
From: Tonghao Zhang Don't allow user to create meter unlimitedly, which may cause to consume a large amount of kernel memory. The 200,000 meters may be fine in general case. Cc: Pravin B Shelar Cc: Andy Zhou Signed-off-by: Tonghao Zhang --- net/openvswitch/meter.c | 21 +++--

[ovs-dev] [PATCH net-next v2 4/5] net: openvswitch: make EINVAL return value more obvious

2020-04-18 Thread xiangxia . m . yue
From: Tonghao Zhang Cc: Pravin B Shelar Cc: Andy Zhou Signed-off-by: Tonghao Zhang --- net/openvswitch/meter.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/net/openvswitch/meter.c b/net/openvswitch/meter.c index f552c64ae8df..77fe39cf4f18 100644 ---

[ovs-dev] [PATCH net-next v2 5/5] net: openvswitch: use u64 for meter bucket

2020-04-18 Thread xiangxia . m . yue
From: Tonghao Zhang When setting the meter rate to 4+Gbps, there is an overflow, the meters don't work as expected. Cc: Pravin B Shelar Cc: Andy Zhou Signed-off-by: Tonghao Zhang --- net/openvswitch/meter.c | 2 +- net/openvswitch/meter.h | 2 +- 2 files changed, 2 insertions(+), 2

[ovs-dev] [PATCH] net: openvswitch: ovs_ct_exit to be done under ovs_lock

2020-04-19 Thread xiangxia . m . yue
From: Tonghao Zhang syzbot wrote: | = | WARNING: suspicious RCU usage | 5.7.0-rc1+ #45 Not tainted | - | net/openvswitch/conntrack.c:1898 RCU-list traversed in non-reader section!! | | other info that might help us debug this: |

[ovs-dev] [PATCH ovs] dpif-netdev: Delete the flow limit in dpif-netdev

2020-03-16 Thread xiangxia . m . yue
From: Tonghao Zhang The max number of flow in dpif-netdev is MAX_FLOWS, the previous patch[1] try to install more flows, and introduce the subcommand "dpif-netdev/pmd-set-max-flow" to change the max flow limitation. But 'other_config:flow-limit' option can limit that too. As Ilya Maximets say

[ovs-dev] [PATCH net-next v1 1/3] net: openvswitch: expand the meters number supported

2020-03-28 Thread xiangxia . m . yue
From: Tonghao Zhang In kernel datapath of Open vSwitch, there are only 1024 buckets of meter in one dp. If installing more than 1024 (e.g. 8192) meters, it may lead to the performance drop. But in some case, for example, Open vSwitch used as edge gateway, there should be 200,000+ at least,

[ovs-dev] [PATCH net-next v1 2/3] net: openvswitch: set max limitation to meters

2020-03-28 Thread xiangxia . m . yue
From: Tonghao Zhang Don't allow user to create meter unlimitedly, which may cause to consume a large amount of kernel memory. The 200,000 meters may be fine in general case. Cc: Pravin B Shelar Cc: Andy Zhou Signed-off-by: Tonghao Zhang --- net/openvswitch/meter.c | 14 +-

[ovs-dev] [PATCH net-next v1 3/3] net: openvswitch: remove the unnecessary check

2020-03-28 Thread xiangxia . m . yue
From: Tonghao Zhang Before calling the ovs_meter_cmd_reply_stats, "meter" is checked, so don't check it agin in that function. Cc: Pravin B Shelar Cc: Andy Zhou Signed-off-by: Tonghao Zhang --- net/openvswitch/meter.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff

[ovs-dev] [PATCH] net: openvswitch: use hlist_for_each_entry_rcu instead of hlist_for_each_entry

2020-04-01 Thread xiangxia . m . yue
From: Tonghao Zhang The struct sw_flow is protected by RCU, when traversing them, use hlist_for_each_entry_rcu. Signed-off-by: Tonghao Zhang --- net/openvswitch/flow_table.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/net/openvswitch/flow_table.c

[ovs-dev] [PATCH net-next v4 3/5] net: openvswitch: remove the unnecessary check

2020-04-23 Thread xiangxia . m . yue
From: Tonghao Zhang Before invoking the ovs_meter_cmd_reply_stats, "meter" was checked, so don't check it agin in that function. Cc: Pravin B Shelar Cc: Andy Zhou Signed-off-by: Tonghao Zhang Acked-by: Pravin B Shelar --- net/openvswitch/meter.c | 9 - 1 file changed, 4

[ovs-dev] [PATCH net-next v4 1/5] net: openvswitch: expand the meters supported number

2020-04-23 Thread xiangxia . m . yue
From: Tonghao Zhang In kernel datapath of Open vSwitch, there are only 1024 buckets of meter in one datapath. If installing more than 1024 (e.g. 8192) meters, it may lead to the performance drop. But in some case, for example, Open vSwitch used as edge gateway, there should be 20K at least,

[ovs-dev] [PATCH net-next v4 0/5] expand meter tables and fix bug

2020-04-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 (5): net: openvswitch: expand the meters supported number net: openvswitch: set max limitation to meters net: openvswitch: remove the unnecessary

[ovs-dev] [PATCH net-next v4 5/5] net: openvswitch: use u64 for meter bucket

2020-04-23 Thread xiangxia . m . yue
From: Tonghao Zhang When setting the meter rate to 4+Gbps, there is an overflow, the meters don't work as expected. Cc: Pravin B Shelar Cc: Andy Zhou Signed-off-by: Tonghao Zhang Acked-by: Pravin B Shelar --- net/openvswitch/meter.c | 2 +- net/openvswitch/meter.h | 2 +- 2 files changed,

[ovs-dev] [PATCH net-next v4 2/5] net: openvswitch: set max limitation to meters

2020-04-23 Thread xiangxia . m . yue
From: Tonghao Zhang Don't allow user to create meter unlimitedly, which may cause to consume a large amount of kernel memory. The max number supported is decided by physical memory and 20K meters as default. Cc: Pravin B Shelar Cc: Andy Zhou Signed-off-by: Tonghao Zhang Acked-by: Pravin B

[ovs-dev] [PATCH net-next v4 4/5] net: openvswitch: make EINVAL return value more obvious

2020-04-23 Thread xiangxia . m . yue
From: Tonghao Zhang Cc: Pravin B Shelar Cc: Andy Zhou Signed-off-by: Tonghao Zhang Acked-by: Pravin B Shelar --- net/openvswitch/meter.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/net/openvswitch/meter.c b/net/openvswitch/meter.c index

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

2020-04-30 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 u32 instead of u64 for buckets

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

2020-04-30 Thread xiangxia . m . yue
From: Tonghao Zhang When setting the meter rate to 4+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 Signed-off-by: Tonghao Zhang --- include/openvswitch/ofp-meter.h | 2 +- lib/dpif-netdev.c

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

2020-04-30 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

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

2020-04-30 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. Cc: Ilya Maximets Cc: William Tu Cc: Jarno Rajahalme Cc: Ben Pfaff Cc: Andy Zhou Signed-off-by: Tonghao Zhang --- lib/dpif-netdev.c | 7 +-- 1

  1   2   >