Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetr Tesarik <ptesarik@suse.cz>2019-07-20 00:05:45 +0200
committerPetr Tesarik <ptesarik@suse.cz>2019-07-20 00:06:00 +0200
commit41d0dfad2f49c5db6007014c409d5310b994358e (patch)
treeaf08a306c91d0eabf38579f02e5ced613c83008d
parent93da7308154b1ab34336fce8a0480168a919730b (diff)
net/af_iucv: build proper skbs for HiperTransport (bsc#1142221
LTC#179332).
-rw-r--r--patches.suse/net-af_iucv-build-proper-skbs-for-hipertransport89
-rw-r--r--series.conf1
2 files changed, 90 insertions, 0 deletions
diff --git a/patches.suse/net-af_iucv-build-proper-skbs-for-hipertransport b/patches.suse/net-af_iucv-build-proper-skbs-for-hipertransport
new file mode 100644
index 0000000000..21ebaa90c5
--- /dev/null
+++ b/patches.suse/net-af_iucv-build-proper-skbs-for-hipertransport
@@ -0,0 +1,89 @@
+From: Julian Wiedmann <jwi@linux.ibm.com>
+Date: Tue, 18 Jun 2019 20:43:00 +0200
+Subject: net/af_iucv: build proper skbs for HiperTransport
+Git-commit: 238965b71b968dc5b3c0fe430e946f488322c4b5
+Patch-mainline: v5.2-rc1
+References: bsc#1142221 LTC#179332
+
+The HiperSockets-based transport path in af_iucv is still too closely
+entangled with qeth.
+With commit a647a02512ca ("s390/qeth: speed-up L3 IQD xmit"), the
+relevant xmit code in qeth has begun to use skb_cow_head(). So to avoid
+unnecessary skb head expansions, af_iucv must learn to
+1) respect dev->needed_headroom when allocating skbs, and
+2) drop the header reference before cloning the skb.
+
+While at it, also stop hard-coding the LL-header creation stage and just
+use the appropriate helper.
+
+Fixes: a647a02512ca ("s390/qeth: speed-up L3 IQD xmit")
+Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Acked-by: Petr Tesarik <ptesarik@suse.com>
+---
+ net/iucv/af_iucv.c | 16 +++++++++++-----
+ 1 file changed, 11 insertions(+), 5 deletions(-)
+
+--- a/net/iucv/af_iucv.c
++++ b/net/iucv/af_iucv.c
+@@ -13,6 +13,7 @@
+ #define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
+
+ #include <linux/module.h>
++#include <linux/netdevice.h>
+ #include <linux/types.h>
+ #include <linux/list.h>
+ #include <linux/errno.h>
+@@ -347,14 +348,14 @@ static int afiucv_hs_send(struct iucv_me
+ if (imsg)
+ memcpy(&phs_hdr->iucv_hdr, imsg, sizeof(struct iucv_message));
+
+- skb_push(skb, ETH_HLEN);
+- memset(skb->data, 0, ETH_HLEN);
+-
+ skb->dev = iucv->hs_dev;
+ if (!skb->dev) {
+ err = -ENODEV;
+ goto err_free;
+ }
++
++ dev_hard_header(skb, skb->dev, ETH_P_AF_IUCV, NULL, NULL, skb->len);
++
+ if (!(skb->dev->flags & IFF_UP) || !netif_carrier_ok(skb->dev)) {
+ err = -ENETDOWN;
+ goto err_free;
+@@ -367,6 +368,8 @@ static int afiucv_hs_send(struct iucv_me
+ skb_trim(skb, skb->dev->mtu);
+ }
+ skb->protocol = ETH_P_AF_IUCV;
++
++ __skb_header_release(skb);
+ nskb = skb_clone(skb, GFP_ATOMIC);
+ if (!nskb) {
+ err = -ENOMEM;
+@@ -466,12 +469,14 @@ static void iucv_sever_path(struct sock
+ /* Send controlling flags through an IUCV socket for HIPER transport */
+ static int iucv_send_ctrl(struct sock *sk, u8 flags)
+ {
++ struct iucv_sock *iucv = iucv_sk(sk);
+ int err = 0;
+ int blen;
+ struct sk_buff *skb;
+ u8 shutdown = 0;
+
+- blen = sizeof(struct af_iucv_trans_hdr) + ETH_HLEN;
++ blen = sizeof(struct af_iucv_trans_hdr) +
++ LL_RESERVED_SPACE(iucv->hs_dev);
+ if (sk->sk_shutdown & SEND_SHUTDOWN) {
+ /* controlling flags should be sent anyway */
+ shutdown = sk->sk_shutdown;
+@@ -1134,7 +1139,8 @@ static int iucv_sock_sendmsg(struct sock
+ * segmented records using the MSG_EOR flag), but
+ * for SOCK_STREAM we might want to improve it in future */
+ if (iucv->transport == AF_IUCV_TRANS_HIPER) {
+- headroom = sizeof(struct af_iucv_trans_hdr) + ETH_HLEN;
++ headroom = sizeof(struct af_iucv_trans_hdr) +
++ LL_RESERVED_SPACE(iucv->hs_dev);
+ linear = len;
+ } else {
+ if (len < PAGE_SIZE) {
diff --git a/series.conf b/series.conf
index 592df78d76..fd1fb5b988 100644
--- a/series.conf
+++ b/series.conf
@@ -47705,6 +47705,7 @@
patches.drivers/IB-hfi1-Create-inline-to-get-extended-headers.patch
patches.drivers/net-udp_gso-Allow-TX-timestamp-with-UDP-GSO.patch
patches.suse/net-af_iucv-remove-gfp_dma-restriction-for-hipertransport
+ patches.suse/net-af_iucv-build-proper-skbs-for-hipertransport
patches.drivers/net-hns3-Fix-inconsistent-indenting.patch
patches.fixes/tcp-refine-memory-limit-test-in-tcp_fragment.patch
patches.drivers/Bluetooth-Fix-regression-with-minimum-encryption-key.patch