summaryrefslogtreecommitdiffstats
path: root/net/rds/rds.h
diff options
context:
space:
mode:
authorSowmini Varadhan <sowmini.varadhan@oracle.com>2018-03-06 07:22:34 -0800
committerDavid S. Miller <davem@davemloft.net>2018-03-07 18:05:57 -0500
commit9426bbc6de99b8649d897b94e8f5916b58195643 (patch)
treed93a41326f290e18a791ab19fcb02434ed0e14c1 /net/rds/rds.h
parentd40a126b16ea851f858f97b0e214d97c8355cecb (diff)
downloadlinux-9426bbc6de99b8649d897b94e8f5916b58195643.tar.bz2
rds: use list structure to track information for zerocopy completion notification
Commit 401910db4cd4 ("rds: deliver zerocopy completion notification with data") removes support fo r zerocopy completion notification on the sk_error_queue, thus we no longer need to track the cookie information in sk_buff structures. This commit removes the struct sk_buff_head rs_zcookie_queue by a simpler list that results in a smaller memory footprint as well as more efficient memory_allocation time. Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com> Acked-by: Willem de Bruijn <willemb@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/rds/rds.h')
-rw-r--r--net/rds/rds.h23
1 files changed, 17 insertions, 6 deletions
diff --git a/net/rds/rds.h b/net/rds/rds.h
index 33b16353d8f3..74cd27c661de 100644
--- a/net/rds/rds.h
+++ b/net/rds/rds.h
@@ -357,16 +357,27 @@ static inline u32 rds_rdma_cookie_offset(rds_rdma_cookie_t cookie)
#define RDS_MSG_FLUSH 8
struct rds_znotifier {
- struct list_head z_list;
struct mmpin z_mmp;
u32 z_cookie;
};
-#define RDS_ZCOPY_SKB(__skb) ((struct rds_znotifier *)&((__skb)->cb[0]))
+struct rds_msg_zcopy_info {
+ struct list_head rs_zcookie_next;
+ union {
+ struct rds_znotifier znotif;
+ struct rds_zcopy_cookies zcookies;
+ };
+};
-static inline struct sk_buff *rds_skb_from_znotifier(struct rds_znotifier *z)
+struct rds_msg_zcopy_queue {
+ struct list_head zcookie_head;
+ spinlock_t lock; /* protects zcookie_head queue */
+};
+
+static inline void rds_message_zcopy_queue_init(struct rds_msg_zcopy_queue *q)
{
- return container_of((void *)z, struct sk_buff, cb);
+ spin_lock_init(&q->lock);
+ INIT_LIST_HEAD(&q->zcookie_head);
}
struct rds_message {
@@ -603,8 +614,7 @@ struct rds_sock {
/* Socket receive path trace points*/
u8 rs_rx_traces;
u8 rs_rx_trace[RDS_MSG_RX_DGRAM_TRACE_MAX];
-
- struct sk_buff_head rs_zcookie_queue;
+ struct rds_msg_zcopy_queue rs_zcookie_queue;
};
static inline struct rds_sock *rds_sk_to_rs(const struct sock *sk)
@@ -803,6 +813,7 @@ void rds_message_addref(struct rds_message *rm);
void rds_message_put(struct rds_message *rm);
void rds_message_wait(struct rds_message *rm);
void rds_message_unmapped(struct rds_message *rm);
+void rds_notify_msg_zcopy_purge(struct rds_msg_zcopy_queue *info);
static inline void rds_message_make_checksum(struct rds_header *hdr)
{