Patch "net/af_iucv: don't use paged skbs for TX on HiperSockets" has been added to the 4.9-stable tree
Subsystems (3)
This is a note to let you know that I've just added the patch titled
net/af_iucv: don't use paged skbs for TX on HiperSockets
to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
net-af_iucv-don-t-use-paged-skbs-for-tx-on-hipersockets.patch
and it can be found in the queue-4.9 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From
dc5367bcc556e97555fc94a32cd1aadbebdff47eMon Sep 17 00:00:00 2001
From: Julian Wiedmann <[email protected]>
Date: Tue, 10 Jan 2017 17:10:34 +0100
Subject: net/af_iucv: don't use paged skbs for TX on HiperSockets
From: Julian Wiedmann <[email protected]>
commit dc5367bcc556e97555fc94a32cd1aadbebdff47e upstream.
With commit e53743994e21
("af_iucv: use paged SKBs for big outbound messages"), we transmit paged skbs for both of AF_IUCV's transport modes (IUCV or HiperSockets).
The qeth driver for Layer 3 HiperSockets currently doesn't support NETIF_F_SG, so these skbs would just be linearized again by the stack.
Avoid that overhead by using paged skbs only for IUCV transport.
cc stable, since this also circumvents a significant skb leak when sending large messages (where the skb then needs to be linearized).
--- net/iucv/af_iucv.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-)
net/iucv/af_iucv.c +14 -11
@@ -1036,7 +1036,8 @@ static int iucv_sock_sendmsg(struct sock {struct sock *sk = sock->sk;struct iucv_sock *iucv =iucv_sk (sk); -size_t headroom, linear; +size_t headroom =0 ; +size_t linear;struct sk_buff *skb;struct iucv_message txmsg = {0 };struct cmsghdr *cmsg;
@@ -1114,18 +1115,20 @@ static int iucv_sock_sendmsg(struct sock* this is fine for SOCK_SEQPACKET (unless we want to support * segmented records using the MSG_EOR flag), but * for SOCK_STREAM we might want to improve it in future */ - headroom = (iucv->transport ==AF_IUCV_TRANS_HIPER ) - ?sizeof (struct af_iucv_trans_hdr ) +ETH_HLEN :0 ; -if (headroom + len <PAGE_SIZE ) { +if (iucv->transport ==AF_IUCV_TRANS_HIPER ) { + headroom =sizeof (struct af_iucv_trans_hdr ) +ETH_HLEN ; linear = len; }else { -/* In nonlinear "classic" iucv skb, -* reserve space for iucv_array -*/ -if (iucv->transport !=AF_IUCV_TRANS_HIPER ) - headroom +=sizeof (struct iucv_array ) * - (MAX_SKB_FRAGS +1 ); - linear =PAGE_SIZE - headroom; +if (len <PAGE_SIZE ) { + linear = len; + }else { +/* In nonlinear "classic" iucv skb, +* reserve space for iucv_array +*/ + headroom =sizeof (struct iucv_array ) * + (MAX_SKB_FRAGS +1 ); + linear =PAGE_SIZE - headroom; + } } skb =sock_alloc_send_pskb (sk, headroom + linear, len - linear, noblock, &err,0 );
Patches currently in stable-queue which might be from [email protected] are
queue-4.9/net-af_iucv-don-t-use-paged-skbs-for-tx-on-hipersockets.patch