From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gandalf.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id A08485A0274 for ; Tue, 16 Jan 2024 01:50:52 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202312; t=1705366246; bh=N7nKWUDt6uQeYVLbJD6HGr8beOlhxsYagZd4NJ+Zl4I=; h=From:To:Cc:Subject:Date:From; b=nYpkQ1GFKWkcU89ITPLPObEEk9NiI37zThtyBQjFcKU4l0FoSquxiw5NT2lmZpimb PNAX2wQXiiAspvyBOias60Kr5RZefHq/1mlcuYHWO+E+0A2lJpIQatnUdc4t6AkkFE TNIZ0j14hTD/3P9aAcltof4oABR9Y193n0/Q5N+S1Brlc5jUFRf/rXeifiIN+cmMk5 +pS8ybHpxuTgz1ty9evrxg0PaxjH648XYv/efVCtAx//pRFtGnRtu2Np4bWBPMs18k TlXyFe52l+/V4ReiQGFo+bSsJ1/KWAQZRIGEWbhGr89ybmY9rlCTylGAXPlSDA9Zw5 jtCyFn/ziNpBQ== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4TDVmk1lCrz4wb5; Tue, 16 Jan 2024 11:50:46 +1100 (AEDT) From: David Gibson To: Stefano Brivio , passt-dev@passt.top Subject: [PATCH v4 00/13] Manage more flow related things from generic flow code Date: Tue, 16 Jan 2024 11:50:30 +1100 Message-ID: <20240116005043.2212259-1-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.43.0 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: PIPSWBFHQFXPANSBIUKJV2BT2Z5A2ZBY X-Message-ID-Hash: PIPSWBFHQFXPANSBIUKJV2BT2Z5A2ZBY X-MailFrom: dgibson@gandalf.ozlabs.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: David Gibson X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: There are a number of things that are more-or-less general to flows which are still explicitly handled in tcp.c and tcp_splice.c including allocation and freeing of flow entries, and dispatch of deferred and timer functions. Even without adding more fields to the common flow structure, we can handle a number of these in a more flow-centric way. Unlike v1 this version is based on the hash table rework series. Changes since v3: * Rebased on current tree, plus patches for some test failures * Renamed "free blocks" to "free clusters" in flow allocation scheme * Fixed bug where we wouldn't properly merge adjacent free clusters together during deferred handling * Improved theory of operation comments about flow allocation scheme Changes since v2: * Realised the prealloc/commit functions where confusing and worked poorly for some future stuff. Replaced with alloc/alloc_cancel * Fixed a bug where newly allocated flow entries might not be 0-filled, because of the free tracking information in there. This could cause very subtle problems. Changes since v1: * Store the timestamp of last flow timers run in a global, rather than a ctx field * Rebased on the TCP hash table rework * Add patches 9..13/13 with changes to allocation and freeing of flow entries. David Gibson (13): flow: Make flow_table.h #include the protocol specific headers it needs treewide: Standardise on 'now' for current timestamp variables tcp, tcp_splice: Remove redundant handling from tcp_timer() tcp, tcp_splice: Move per-type cleanup logic into per-type helpers flow, tcp: Add flow-centric dispatch for deferred flow handling flow, tcp: Add handling for per-flow timers epoll: Better handling of number of epoll types tcp, tcp_splice: Avoid double layered dispatch for connected TCP sockets flow: Move flow_log_() to near top of flow.c flow: Move flow_count from context structure to a global flow: Abstract allocation of new flows with helper function flow: Enforce that freeing of closed flows must happen in deferred handlers flow: Avoid moving flow entries to compact table flow.c | 235 +++++++++++++++++++++++++++++++++++++++++++-------- flow.h | 5 +- flow_table.h | 20 +++++ icmp.c | 12 +-- icmp.h | 2 +- log.c | 34 ++++---- passt.c | 20 +++-- passt.h | 9 +- tcp.c | 143 +++++++++---------------------- tcp.h | 2 +- tcp_conn.h | 8 +- tcp_splice.c | 49 +++++------ tcp_splice.h | 4 +- udp.c | 16 ++-- udp.h | 2 +- 15 files changed, 339 insertions(+), 222 deletions(-) -- 2.43.0