From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gandalf.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id 1E4CE5A0275 for ; Thu, 7 Dec 2023 06:54:02 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202312; t=1701928435; bh=EYPnckTwE9cN9EhOSZys70CCMNn9a0VaufPGTRG8zt4=; h=From:To:Cc:Subject:Date:From; b=GxLRMBo+p3cAMNxt8fGme0PbSEYaPN042X3OVUF7IwlkVtCV62wdUeIZ5s3/OidUe zXkWyKMiSqrTw9J0EOhmnN/jrjwc6l6AUfQbEUzQuXpgFHGtpzIOgjlcQ+DD9DY2WQ bgMCVCN3V7dKNbkRY8U2qeZ9VXYSS2BujfRmY3OB8N+4n8owlxyktvSHzyqglYGHBY FMytAI1Q95Dc86ZFKIDZIOqOkQFDksadhsv399UDHoYBfKwY4YdqDiCYEYNeaUpUSx fPF0FENh+jZf80mtifcb007pqnqtKKOQPRAPXJG5XaFdsKc1IHNt1dWT9VonPdkVvh /jLf09uQgOZBg== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4Sm3Nz5fSPz4wnv; Thu, 7 Dec 2023 16:53:55 +1100 (AEDT) From: David Gibson To: Stefano Brivio , passt-dev@passt.top Subject: [PATCH v2 0/4] TCP hash table changes, in preparation for flow table Date: Thu, 7 Dec 2023 16:53:49 +1100 Message-ID: <20231207055353.1245933-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: RQNBKE5B6QRBRQJL33JRSVUWHFPL47NK X-Message-ID-Hash: RQNBKE5B6QRBRQJL33JRSVUWHFPL47NK 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: I now have an in-progress draft of a unified hash table to go with the unified flow table. This turns out to be easier if we first make some preliminary changes to the structure of the TCP hash table. So, here are those. Changes since v1: * Use while loops instead of some equivalent, but hard to read for loops for the hash probing. * Switch from probing forwards through hash buckets to probing backwards. This makes the code closer to the version in Knuth its based on, and thus easier to see if we've made a mistake in adaptation. * Improve the helpers for modular arithmetic in use * Correct an error where we had things exactly the wrong way around when finding entries to move during removal. * Add a patch fixing a conceptual / documentation problem in some adjacent code David Gibson (4): tcp: Fix conceptually incorrect byte-order switch in tcp_tap_handler() tcp: Switch hash table to linear probing instead of chaining tcp: Implement hash table with indices rather than pointers tcp: Don't account for hash table size in tcp_hash() flow.h | 11 +++++ tcp.c | 143 ++++++++++++++++++++++++++++------------------------- tcp_conn.h | 2 - util.h | 28 +++++++++++ 4 files changed, 114 insertions(+), 70 deletions(-) -- 2.43.0