summaryrefslogtreecommitdiff
path: root/include/rxrpc
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2016-03-04 18:53:46 +0300
committerDavid Howells <dhowells@redhat.com>2016-03-04 18:53:46 +0300
commit0d12f8a4027d021c9cc942f09f38d28288020c5d (patch)
tree751f54f93f15d9c0146cf2e4243dbfc25fd1cc6d /include/rxrpc
parent4c198ad17a7253cc8ef3ff39bfe73d6b5e65ceef (diff)
downloadlinux-0d12f8a4027d021c9cc942f09f38d28288020c5d.tar.xz
rxrpc: Keep the skb private record of the Rx header in host byte order
Currently, a copy of the Rx packet header is copied into the the sk_buff private data so that we can advance the pointer into the buffer, potentially discarding the original. At the moment, this copy is held in network byte order, but this means we're doing a lot of unnecessary translations. The reasons it was done this way are that we need the values in network byte order occasionally and we can use the copy, slightly modified, as part of an iov array when sending an ack or an abort packet. However, it seems more reasonable on review that it would be better kept in host byte order and that we make up a new header when we want to send another packet. To this end, rename the original header struct to rxrpc_wire_header (with BE fields) and institute a variant called rxrpc_host_header that has host order fields. Change the struct in the sk_buff private data into an rxrpc_host_header and translate the values when filling it in. This further allows us to keep values kept in various structures in host byte order rather than network byte order and allows removal of some fields that are byteswapped duplicates. Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'include/rxrpc')
-rw-r--r--include/rxrpc/packet.h4
1 files changed, 1 insertions, 3 deletions
diff --git a/include/rxrpc/packet.h b/include/rxrpc/packet.h
index 4dce116bfd80..de1e67988ada 100644
--- a/include/rxrpc/packet.h
+++ b/include/rxrpc/packet.h
@@ -22,7 +22,7 @@ typedef __be32 rxrpc_serial_net_t; /* on-the-wire Rx message serial number */
* on-the-wire Rx packet header
* - all multibyte fields should be in network byte order
*/
-struct rxrpc_header {
+struct rxrpc_wire_header {
__be32 epoch; /* client boot timestamp */
__be32 cid; /* connection and channel ID */
@@ -68,8 +68,6 @@ struct rxrpc_header {
} __packed;
-#define __rxrpc_header_off(X) offsetof(struct rxrpc_header,X)
-
extern const char *rxrpc_pkts[];
/*****************************************************************************/