Skip to content

Commit

Permalink
net/af_iucv: remove GFP_DMA restriction for HiperTransport
Browse files Browse the repository at this point in the history
af_iucv sockets over z/VM IUCV require that their skbs are allocated
in DMA memory. This restriction doesn't apply to connections over
HiperSockets. So only set this limit for z/VM IUCV sockets, thereby
increasing the likelihood that the large (and linear!) allocations for
HiperTransport messages succeed.

Fixes: 3881ac4 ("af_iucv: add HiperSockets transport")
Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
Reviewed-by: Ursula Braun <ubraun@linux.ibm.com>
Reviewed-by: Hendrik Brueckner <brueckner@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Julian Wiedmann authored and David S. Miller committed Jun 19, 2019
1 parent 48620e3 commit fdbf632
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion net/iucv/af_iucv.c
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,6 @@ static struct sock *iucv_sock_alloc(struct socket *sock, int proto, gfp_t prio,

sk->sk_destruct = iucv_sock_destruct;
sk->sk_sndtimeo = IUCV_CONN_TIMEOUT;
sk->sk_allocation = GFP_DMA;

sock_reset_flag(sk, SOCK_ZAPPED);

Expand Down Expand Up @@ -782,6 +781,7 @@ static int iucv_sock_bind(struct socket *sock, struct sockaddr *addr,
memcpy(iucv->src_user_id, iucv_userid, 8);
sk->sk_state = IUCV_BOUND;
iucv->transport = AF_IUCV_TRANS_IUCV;
sk->sk_allocation |= GFP_DMA;
if (!iucv->msglimit)
iucv->msglimit = IUCV_QUEUELEN_DEFAULT;
goto done_unlock;
Expand All @@ -806,6 +806,8 @@ static int iucv_sock_autobind(struct sock *sk)
return -EPROTO;

memcpy(iucv->src_user_id, iucv_userid, 8);
iucv->transport = AF_IUCV_TRANS_IUCV;
sk->sk_allocation |= GFP_DMA;

write_lock_bh(&iucv_sk_list.lock);
__iucv_auto_name(iucv);
Expand Down Expand Up @@ -1781,6 +1783,8 @@ static int iucv_callback_connreq(struct iucv_path *path,

niucv = iucv_sk(nsk);
iucv_sock_init(nsk, sk);
niucv->transport = AF_IUCV_TRANS_IUCV;
nsk->sk_allocation |= GFP_DMA;

/* Set the new iucv_sock */
memcpy(niucv->dst_name, ipuser + 8, 8);
Expand Down

0 comments on commit fdbf632

Please sign in to comment.