From patchwork Thu Apr 1 02:13:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arne Schwabe X-Patchwork-Id: 1693 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director13.mail.ord1d.rsapps.net ([172.30.191.6]) by backend30.mail.ord1d.rsapps.net with LMTP id YKuINEHHZWByDAAAIUCqbw (envelope-from ) for ; Thu, 01 Apr 2021 09:14:41 -0400 Received: from proxy1.mail.ord1d.rsapps.net ([172.30.191.6]) by director13.mail.ord1d.rsapps.net with LMTP id QLslNEHHZWCdPgAA91zNiA (envelope-from ) for ; Thu, 01 Apr 2021 09:14:41 -0400 Received: from smtp4.gate.ord1d ([172.30.191.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy1.mail.ord1d.rsapps.net with LMTPS id UIOjM0HHZWDZEQAAasrz9Q (envelope-from ) for ; Thu, 01 Apr 2021 09:14:41 -0400 X-Spam-Threshold: 95 X-Spam-Score: 0 X-Spam-Flag: NO X-Virus-Scanned: OK X-Orig-To: openvpnslackdevel@openvpn.net X-Originating-Ip: [216.105.38.7] Authentication-Results: smtp4.gate.ord1d.rsapps.net; iprev=pass policy.iprev="216.105.38.7"; spf=pass smtp.mailfrom="openvpn-devel-bounces@lists.sourceforge.net" smtp.helo="lists.sourceforge.net"; dkim=fail (signature verification failed) header.d=sourceforge.net; dkim=fail (signature verification failed) header.d=sf.net; dmarc=none (p=nil; dis=none) header.from=rfc2549.org X-Suspicious-Flag: YES X-Classification-ID: 373c9c92-92ec-11eb-b1e3-525400760ffc-1-1 Received: from [216.105.38.7] ([216.105.38.7:60268] helo=lists.sourceforge.net) by smtp4.gate.ord1d.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id CB/AF-10941-047C5606; Thu, 01 Apr 2021 09:14:40 -0400 Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1lRx8y-0001BR-2d; Thu, 01 Apr 2021 13:13:52 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lRx8w-0001BE-6L for openvpn-devel@lists.sourceforge.net; Thu, 01 Apr 2021 13:13:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=References:In-Reply-To:Message-Id:Date:Subject:To: From:Sender:Reply-To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=8LqDpQT9oz+mBz7M9Mtg9LGU4yofdyUq0IbDDdzo3ZA=; b=CgRqgHXvfEU8EIy81gHgg9tDyK G3HzJpgqZi+WhNrpp25VlX3hsLkboNBYwsjCPmgEbId9qOHXy4kNXIsqa0TzXKrcfrQd8NncbDeMo rCAL9bHM5LpwiSRbVgzdbwbnbXoddgJQDfbia56JViyQ182J0A6bu5MFrFNf6VAwW7og=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=References:In-Reply-To:Message-Id:Date:Subject:To:From:Sender:Reply-To:Cc :MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=8LqDpQT9oz+mBz7M9Mtg9LGU4yofdyUq0IbDDdzo3ZA=; b=DI2TF1wQCvQv9676nLAeJG4C9J MuUYk0tejIDsVrGbU9RQk7EhA2yYhHe5YaTfawwVLOvgK+BbbNDh1ftCu/IpyaKiNgqbmJ4kg3LVb 9ACOw9jmz+bO5TbUJVyycUgl1V9UOYpQEwu6GNKtn7TxrCT/WIa92OXMNgqnCkQ0j2Z0=; Received: from mail.blinkt.de ([192.26.174.232]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.2) id 1lRx8s-0036af-JD for openvpn-devel@lists.sourceforge.net; Thu, 01 Apr 2021 13:13:50 +0000 Received: from kamera.blinkt.de ([2001:638:502:390:20c:29ff:fec8:535c]) by mail.blinkt.de with smtp (Exim 4.94 (FreeBSD)) (envelope-from ) id 1lRx8j-000J7t-OD for openvpn-devel@lists.sourceforge.net; Thu, 01 Apr 2021 15:13:37 +0200 Received: (nullmailer pid 3732 invoked by uid 10006); Thu, 01 Apr 2021 13:13:37 -0000 From: Arne Schwabe To: openvpn-devel@lists.sourceforge.net Date: Thu, 1 Apr 2021 15:13:24 +0200 Message-Id: <20210401131337.3684-2-arne@rfc2549.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210401131337.3684-1-arne@rfc2549.org> References: <20210401131337.3684-1-arne@rfc2549.org> X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: rfc2549.org] 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 0.0 SPF_NONE SPF: sender does not publish an SPF Record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-Headers-End: 1lRx8s-0036af-JD Subject: [Openvpn-devel] [PATCH 01/14] Remove code for aligning non-swapped compression X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox This is an optimisation for memory alignment for lzo. Compression is deprecated so this optimisation is not very important anymore. Furthermore it is conditionally compiled on !defined(ENABLE_LZ4), which makes the code not compiled in by default anyway. Signed-off-by: Arne Schwabe Acked-by: Gert Doering --- src/openvpn/comp.h | 6 ------ src/openvpn/init.c | 31 ------------------------------- src/openvpn/mtu.h | 6 ------ 3 files changed, 43 deletions(-) diff --git a/src/openvpn/comp.h b/src/openvpn/comp.h index 5c0322ca6..5c9d77fe1 100644 --- a/src/openvpn/comp.h +++ b/src/openvpn/comp.h @@ -198,11 +198,5 @@ comp_non_stub_enabled(const struct compress_options *info) && info->alg != COMP_ALG_UNDEF; } -static inline bool -comp_unswapped_prefix(const struct compress_options *info) -{ - return !(info->flags & COMP_F_SWAP); -} - #endif /* USE_COMP */ #endif /* ifndef OPENVPN_COMP_H */ diff --git a/src/openvpn/init.c b/src/openvpn/init.c index 132d47e4e..1a6015452 100644 --- a/src/openvpn/init.c +++ b/src/openvpn/init.c @@ -3082,37 +3082,6 @@ do_init_frame(struct context *c) { comp_add_to_extra_frame(&c->c2.frame); -#if !defined(ENABLE_LZ4) - /* - * Compression usage affects buffer alignment when non-swapped algs - * such as LZO is used. - * Newer algs like LZ4 and comp-stub with COMP_F_SWAP don't need - * any special alignment because of the control-byte swap approach. - * LZO alignment (on the other hand) is problematic because - * the presence of the control byte means that either the output of - * decryption must be written to an unaligned buffer, or the input - * to compression (or packet dispatch if packet is uncompressed) - * must be read from an unaligned buffer. - * This code tries to align the input to compression (or packet - * dispatch if packet is uncompressed) at the cost of requiring - * decryption output to be written to an unaligned buffer, so - * it's more of a tradeoff than an optimal solution and we don't - * include it when we are doing a modern build with LZ4. - * Strictly speaking, on the server it would be better to execute - * this code for every connection after we decide the compression - * method, but currently the frame code doesn't appear to be - * flexible enough for this, since the frame is already established - * before it is known which compression options will be pushed. - */ - if (comp_unswapped_prefix(&c->options.comp) && CIPHER_ENABLED(c)) - { - frame_add_to_align_adjust(&c->c2.frame, COMP_PREFIX_LEN); - frame_or_align_flags(&c->c2.frame, - FRAME_HEADROOM_MARKER_FRAGMENT - |FRAME_HEADROOM_MARKER_DECRYPT); - } -#endif - #ifdef ENABLE_FRAGMENT comp_add_to_extra_frame(&c->c2.frame_fragment_omit); /* omit compression frame delta from final frame_fragment */ #endif diff --git a/src/openvpn/mtu.h b/src/openvpn/mtu.h index 0c8bdf8ba..92cbe1874 100644 --- a/src/openvpn/mtu.h +++ b/src/openvpn/mtu.h @@ -300,12 +300,6 @@ frame_add_to_extra_buffer(struct frame *frame, const int increment) frame->extra_buffer += increment; } -static inline void -frame_add_to_align_adjust(struct frame *frame, const int increment) -{ - frame->align_adjust += increment; -} - static inline void frame_align_to_extra_frame(struct frame *frame) {