rxrpc: Add a private skb flag to indicate transmission-phase skbs
authorDavid Howells <dhowells@redhat.com>
Mon, 19 Aug 2019 08:25:37 +0000 (09:25 +0100)
committerDavid Howells <dhowells@redhat.com>
Tue, 27 Aug 2019 09:03:26 +0000 (10:03 +0100)
Add a flag in the private data on an skbuff to indicate that this is a
transmission-phase buffer rather than a receive-phase buffer.

Signed-off-by: David Howells <dhowells@redhat.com>
net/rxrpc/ar-internal.h
net/rxrpc/sendmsg.c

index 20d7907..63d3a91 100644 (file)
@@ -188,6 +188,7 @@ struct rxrpc_skb_priv {
        u8              nr_subpackets;          /* Number of subpackets */
        u8              rx_flags;               /* Received packet flags */
 #define RXRPC_SKB_INCL_LAST    0x01            /* - Includes last packet */
+#define RXRPC_SKB_TX_BUFFER    0x02            /* - Is transmit buffer */
        union {
                int             remain;         /* amount of space remaining for next write */
 
index bae1443..472dc3b 100644 (file)
@@ -336,6 +336,8 @@ static int rxrpc_send_data(struct rxrpc_sock *rx,
                        if (!skb)
                                goto maybe_error;
 
+                       sp = rxrpc_skb(skb);
+                       sp->rx_flags |= RXRPC_SKB_TX_BUFFER;
                        rxrpc_new_skb(skb, rxrpc_skb_tx_new);
 
                        _debug("ALLOC SEND %p", skb);
@@ -346,7 +348,6 @@ static int rxrpc_send_data(struct rxrpc_sock *rx,
                        skb_reserve(skb, call->conn->security_size);
                        skb->len += call->conn->security_size;
 
-                       sp = rxrpc_skb(skb);
                        sp->remain = chunk;
                        if (sp->remain > skb_tailroom(skb))
                                sp->remain = skb_tailroom(skb);