Commit 3881ac44 authored by Ursula Braun's avatar Ursula Braun Committed by David S. Miller

af_iucv: add HiperSockets transport

The current transport mechanism for af_iucv is the z/VM offered
communications facility IUCV. To provide equivalent support when
running Linux in an LPAR, HiperSockets transport is added to the
AF_IUCV address family. It requires explicit binding of an AF_IUCV
socket to a HiperSockets device. A new packet_type ETH_P_AF_IUCV
is announced. An af_iucv specific transport header is defined
preceding the skb data. A small protocol is implemented for
connecting and for flow control/congestion management.
Signed-off-by: default avatarUrsula Braun <ursula.braun@de.ibm.com>
Signed-off-by: default avatarFrank Blaschka <frank.blaschka@de.ibm.com>
Reviewed-by: default avatarHendrik Brueckner <brueckner@linux.vnet.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4dc83dfd
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include <linux/list.h> #include <linux/list.h>
#include <linux/poll.h> #include <linux/poll.h>
#include <linux/socket.h> #include <linux/socket.h>
#include <net/iucv/iucv.h>
#ifndef AF_IUCV #ifndef AF_IUCV
#define AF_IUCV 32 #define AF_IUCV 32
...@@ -33,6 +34,7 @@ enum { ...@@ -33,6 +34,7 @@ enum {
}; };
#define IUCV_QUEUELEN_DEFAULT 65535 #define IUCV_QUEUELEN_DEFAULT 65535
#define IUCV_HIPER_MSGLIM_DEFAULT 128
#define IUCV_CONN_TIMEOUT (HZ * 40) #define IUCV_CONN_TIMEOUT (HZ * 40)
#define IUCV_DISCONN_TIMEOUT (HZ * 2) #define IUCV_DISCONN_TIMEOUT (HZ * 2)
#define IUCV_CONN_IDLE_TIMEOUT (HZ * 60) #define IUCV_CONN_IDLE_TIMEOUT (HZ * 60)
...@@ -57,8 +59,51 @@ struct sock_msg_q { ...@@ -57,8 +59,51 @@ struct sock_msg_q {
spinlock_t lock; spinlock_t lock;
}; };
#define AF_IUCV_FLAG_ACK 0x1
#define AF_IUCV_FLAG_SYN 0x2
#define AF_IUCV_FLAG_FIN 0x4
#define AF_IUCV_FLAG_WIN 0x8
struct af_iucv_trans_hdr {
u16 magic;
u8 version;
u8 flags;
u16 window;
char destNodeID[8];
char destUserID[8];
char destAppName[16];
char srcNodeID[8];
char srcUserID[8];
char srcAppName[16]; /* => 70 bytes */
struct iucv_message iucv_hdr; /* => 33 bytes */
u8 pad; /* total 104 bytes */
} __packed;
enum iucv_tx_notify {
/* transmission of skb is completed and was successful */
TX_NOTIFY_OK = 0,
/* target is unreachable */
TX_NOTIFY_UNREACHABLE = 1,
/* transfer pending queue full */
TX_NOTIFY_TPQFULL = 2,
/* general error */
TX_NOTIFY_GENERALERROR = 3,
/* transmission of skb is pending - may interleave
* with TX_NOTIFY_DELAYED_* */
TX_NOTIFY_PENDING = 4,
/* transmission of skb was done successfully (delayed) */
TX_NOTIFY_DELAYED_OK = 5,
/* target unreachable (detected delayed) */
TX_NOTIFY_DELAYED_UNREACHABLE = 6,
/* general error (detected delayed) */
TX_NOTIFY_DELAYED_GENERALERROR = 7,
};
#define iucv_sk(__sk) ((struct iucv_sock *) __sk) #define iucv_sk(__sk) ((struct iucv_sock *) __sk)
#define AF_IUCV_TRANS_IUCV 0
#define AF_IUCV_TRANS_HIPER 1
struct iucv_sock { struct iucv_sock {
struct sock sk; struct sock sk;
char src_user_id[8]; char src_user_id[8];
...@@ -75,6 +120,13 @@ struct iucv_sock { ...@@ -75,6 +120,13 @@ struct iucv_sock {
unsigned int send_tag; unsigned int send_tag;
u8 flags; u8 flags;
u16 msglimit; u16 msglimit;
u16 msglimit_peer;
atomic_t msg_sent;
atomic_t msg_recv;
atomic_t pendings;
int transport;
void (*sk_txnotify)(struct sk_buff *skb,
enum iucv_tx_notify n);
}; };
/* iucv socket options (SOL_IUCV) */ /* iucv socket options (SOL_IUCV) */
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment