cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Alexander Aring <aahringo@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [RFC PATCH dlm/next 12/16] fs: dlm: remove unaligned memory access handling
Date: Fri, 13 Nov 2020 17:58:10 -0500	[thread overview]
Message-ID: <20201113225814.461167-13-aahringo@redhat.com> (raw)
In-Reply-To: <20201113225814.461167-1-aahringo@redhat.com>

This patch removes unaligned memory access handling for receiving
midcomms messages. The allocated receive buffer is always memory aligned
as the code shows, but each dlm message length and their structure fields
are always aligned to 4 bytes addresses so it should be fine to remove
this special handling.

Signed-off-by: Alexander Aring <aahringo@redhat.com>
---
 fs/dlm/midcomms.c | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/fs/dlm/midcomms.c b/fs/dlm/midcomms.c
index e058e017c77d..b146842be54a 100644
--- a/fs/dlm/midcomms.c
+++ b/fs/dlm/midcomms.c
@@ -22,8 +22,6 @@
  * into packets and sends them to the comms layer.
  */
 
-#include <asm/unaligned.h>
-
 #include "dlm_internal.h"
 #include "lowcomms.h"
 #include "config.h"
@@ -96,7 +94,7 @@ int dlm_process_incoming_buffer(int nodeid, unsigned char *buf, int len)
 		/* no message should be more than this otherwise we
 		 * cannot deliver this message to upper layers
 		 */
-		msglen = get_unaligned_le16(&hd->h_length);
+		msglen = le16_to_cpu(hd->h_length);
 		if (msglen > DEFAULT_BUFFER_SIZE) {
 			log_print("received invalid length header: %u, will abort message parsing",
 				  msglen);
@@ -132,14 +130,6 @@ int dlm_process_incoming_buffer(int nodeid, unsigned char *buf, int len)
 			goto skip;
 		}
 
-		/* for aligned memory access, we just copy current message
-		 * to begin of the buffer which contains already parsed buffer
-		 * data and should provide align access for upper layers
-		 * because the start address of the buffer has a aligned
-		 * address. This memmove can be removed when the upperlayer
-		 * is capable of unaligned memory access.
-		 */
-		memmove(buf, ptr, msglen);
 		dlm_receive_buffer((union dlm_packet *)buf, nodeid);
 
 skip:
-- 
2.26.2



  parent reply	other threads:[~2020-11-13 22:58 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-13 22:57 [Cluster-devel] [RFC PATCH dlm/next 00/16] fs: dlm: introduce dlm retransmission layer Alexander Aring
2020-11-13 22:57 ` [Cluster-devel] [RFC PATCH dlm/next 01/16] fs: dlm: add errno handling to check callback Alexander Aring
2020-11-13 22:58 ` [Cluster-devel] [RFC PATCH dlm/next 02/16] fs: dlm: add check if dlm is currently running Alexander Aring
2020-11-13 22:58 ` [Cluster-devel] [RFC PATCH dlm/next 03/16] fs: dlm: add check for minimum allocation length Alexander Aring
2020-11-13 22:58 ` [Cluster-devel] [RFC PATCH dlm/next 04/16] fs: dlm: public utils header utils Alexander Aring
2020-11-13 22:58 ` [Cluster-devel] [RFC PATCH dlm/next 05/16] fs: dlm: use GFP_ZERO for page buffer Alexander Aring
2020-11-13 22:58 ` [Cluster-devel] [RFC PATCH dlm/next 06/16] fs: dlm: simplify writequeue handling Alexander Aring
2020-11-13 22:58 ` [Cluster-devel] [RFC PATCH dlm/next 07/16] fs: dlm: add more midcomms hooks Alexander Aring
2020-11-13 22:58 ` [Cluster-devel] [RFC PATCH dlm/next 08/16] fs: dlm: make buffer handling per msg Alexander Aring
2020-11-13 22:58 ` [Cluster-devel] [RFC PATCH dlm/next 09/16] fs: dlm: make new buffer handling softirq ready Alexander Aring
2020-11-13 22:58 ` [Cluster-devel] [RFC PATCH dlm/next 10/16] fs: dlm: add functionality to retransmit a message Alexander Aring
2020-11-13 22:58 ` [Cluster-devel] [RFC PATCH dlm/next 11/16] fs: dlm: move out some hash functionality Alexander Aring
2020-11-13 22:58 ` Alexander Aring [this message]
2020-11-24 14:50   ` [Cluster-devel] [RFC PATCH dlm/next 12/16] fs: dlm: remove unaligned memory access handling Alexander Ahring Oder Aring
2020-11-13 22:58 ` [Cluster-devel] [RFC PATCH dlm/next 13/16] fs: dlm: check on minimum header size Alexander Aring
2020-11-13 22:58 ` [Cluster-devel] [RFC PATCH dlm/next 14/16] fs: dlm: add union in dlm header for lockspace id Alexander Aring
2020-11-13 22:58 ` [Cluster-devel] [RFC PATCH dlm/next 15/16] fs: dlm: add reliable connection if reconnect Alexander Aring
2020-11-16 18:45   ` Alexander Ahring Oder Aring
2020-11-17 18:48   ` Alexander Ahring Oder Aring
2020-11-23 22:40   ` Alexander Ahring Oder Aring
2020-11-13 22:58 ` [Cluster-devel] [RFC PATCH dlm/next 16/16] fs: dlm: don't allow half transmitted messages Alexander Aring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201113225814.461167-13-aahringo@redhat.com \
    --to=aahringo@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).