[PATCH 3/4] net/colo.c: No need to track conn_list for filter-rewriter

Zhang Chen posted 4 patches 3 years, 11 months ago
Maintainers: Zhang Chen <chen.zhang@intel.com>, Li Zhijian <lizhijian@fujitsu.com>, Jason Wang <jasowang@redhat.com>
There is a newer version of this series
[PATCH 3/4] net/colo.c: No need to track conn_list for filter-rewriter
Posted by Zhang Chen 3 years, 11 months ago
Filter-rewriter no need to track connection in conn_list.
This patch fix the glib g_queue_is_empty assertion when COLO guest
keep a lot of network connection.

Signed-off-by: Zhang Chen <chen.zhang@intel.com>
---
 net/colo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/colo.c b/net/colo.c
index 1f8162f59f..694f3c93ef 100644
--- a/net/colo.c
+++ b/net/colo.c
@@ -218,7 +218,7 @@ Connection *connection_get(GHashTable *connection_track_table,
             /*
              * clear the conn_list
              */
-            while (!g_queue_is_empty(conn_list)) {
+            while (conn_list && !g_queue_is_empty(conn_list)) {
                 connection_destroy(g_queue_pop_head(conn_list));
             }
         }
-- 
2.25.1
Re: [PATCH 3/4] net/colo.c: No need to track conn_list for filter-rewriter
Posted by lizhijian@fujitsu.com 3 years, 10 months ago

On 09/03/2022 16:38, Zhang Chen wrote:
> Filter-rewriter no need to track connection in conn_list.
> This patch fix the glib g_queue_is_empty assertion when COLO guest
> keep a lot of network connection.
>
> Signed-off-by: Zhang Chen <chen.zhang@intel.com>
LGTM.

Reviewed-by: Li Zhijian <lizhijian@fujitsu.com>


> ---
>   net/colo.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/colo.c b/net/colo.c
> index 1f8162f59f..694f3c93ef 100644
> --- a/net/colo.c
> +++ b/net/colo.c
> @@ -218,7 +218,7 @@ Connection *connection_get(GHashTable *connection_track_table,
>               /*
>                * clear the conn_list
>                */
> -            while (!g_queue_is_empty(conn_list)) {
> +            while (conn_list && !g_queue_is_empty(conn_list)) {
>                   connection_destroy(g_queue_pop_head(conn_list));
>               }
>           }