aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2019-08-19 04:25:37 -0400
committerDavid Howells <dhowells@redhat.com>2019-08-27 05:03:26 -0400
commitb311e68420aa52098591988d0d6868b0b7463c0f (patch)
treeb386071d7b4cf5866ceb9736349a1404ff4ac5e5
parenta641fd00d05a5ae38c5a3d50d4da10283b15287b (diff)
rxrpc: Add a private skb flag to indicate transmission-phase skbs
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>
-rw-r--r--net/rxrpc/ar-internal.h1
-rw-r--r--net/rxrpc/sendmsg.c3
2 files changed, 3 insertions, 1 deletions
diff --git a/net/rxrpc/ar-internal.h b/net/rxrpc/ar-internal.h
index 20d7907a5bc6..63d3a91ce5e9 100644
--- a/net/rxrpc/ar-internal.h
+++ b/net/rxrpc/ar-internal.h
@@ -188,6 +188,7 @@ struct rxrpc_skb_priv {
188 u8 nr_subpackets; /* Number of subpackets */ 188 u8 nr_subpackets; /* Number of subpackets */
189 u8 rx_flags; /* Received packet flags */ 189 u8 rx_flags; /* Received packet flags */
190#define RXRPC_SKB_INCL_LAST 0x01 /* - Includes last packet */ 190#define RXRPC_SKB_INCL_LAST 0x01 /* - Includes last packet */
191#define RXRPC_SKB_TX_BUFFER 0x02 /* - Is transmit buffer */
191 union { 192 union {
192 int remain; /* amount of space remaining for next write */ 193 int remain; /* amount of space remaining for next write */
193 194
diff --git a/net/rxrpc/sendmsg.c b/net/rxrpc/sendmsg.c
index bae14438f869..472dc3b7d91f 100644
--- a/net/rxrpc/sendmsg.c
+++ b/net/rxrpc/sendmsg.c
@@ -336,6 +336,8 @@ static int rxrpc_send_data(struct rxrpc_sock *rx,
336 if (!skb) 336 if (!skb)
337 goto maybe_error; 337 goto maybe_error;
338 338
339 sp = rxrpc_skb(skb);
340 sp->rx_flags |= RXRPC_SKB_TX_BUFFER;
339 rxrpc_new_skb(skb, rxrpc_skb_tx_new); 341 rxrpc_new_skb(skb, rxrpc_skb_tx_new);
340 342
341 _debug("ALLOC SEND %p", skb); 343 _debug("ALLOC SEND %p", skb);
@@ -346,7 +348,6 @@ static int rxrpc_send_data(struct rxrpc_sock *rx,
346 skb_reserve(skb, call->conn->security_size); 348 skb_reserve(skb, call->conn->security_size);
347 skb->len += call->conn->security_size; 349 skb->len += call->conn->security_size;
348 350
349 sp = rxrpc_skb(skb);
350 sp->remain = chunk; 351 sp->remain = chunk;
351 if (sp->remain > skb_tailroom(skb)) 352 if (sp->remain > skb_tailroom(skb))
352 sp->remain = skb_tailroom(skb); 353 sp->remain = skb_tailroom(skb);