All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: netdev@vger.kernel.org
Cc: dhowells@redhat.com, linux-afs@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH net 5/7] rxrpc: Add a private skb flag to indicate transmission-phase skbs
Date: Thu, 29 Aug 2019 14:08:08 +0100	[thread overview]
Message-ID: <156708408801.26102.11592449726244941243.stgit@warthog.procyon.org.uk> (raw)
In-Reply-To: <156708405310.26102.7954021163316252673.stgit@warthog.procyon.org.uk>

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 |    1 +
 net/rxrpc/sendmsg.c     |    3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)

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 {
 	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 */
 
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,
 			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);


  parent reply	other threads:[~2019-08-29 13:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20190901065603.432-1-hdanton@sina.com>
2019-08-29 13:07 ` [PATCH net 0/7] rxrpc: Fix use of skb_cow_data() David Howells
2019-08-29 13:07   ` [PATCH net 1/7] rxrpc: Improve jumbo packet counting David Howells
2019-08-29 13:07   ` [PATCH net 2/7] rxrpc: Use info in skbuff instead of reparsing a jumbo packet David Howells
2019-08-29 13:07   ` [PATCH net 3/7] rxrpc: Pass the input handler's data skb reference to the Rx ring David Howells
2019-08-29 13:08   ` [PATCH net 4/7] rxrpc: Abstract out rxtx ring cleanup David Howells
2019-08-29 13:08   ` David Howells [this message]
2019-08-29 13:08   ` [PATCH net 6/7] rxrpc: Use the tx-phase skb flag to simplify tracing David Howells
2019-08-29 13:08   ` [PATCH net 7/7] rxrpc: Use skb_unshare() rather than skb_cow_data() David Howells
2019-08-30 21:55   ` [PATCH net 0/7] rxrpc: Fix use of skb_cow_data() David Miller
2019-09-01  7:11   ` [PATCH net 7/7] rxrpc: Use skb_unshare() rather than skb_cow_data() David Howells

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=156708408801.26102.11592449726244941243.stgit@warthog.procyon.org.uk \
    --to=dhowells@redhat.com \
    --cc=linux-afs@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.