Commit c601171d authored by Karsten Graul's avatar Karsten Graul Committed by David S. Miller

net/smc: provide smc mode in smc_diag.c

Rename field diag_fallback into diag_mode and set the smc mode of a
connection explicitly.
Signed-off-by: default avatarKarsten Graul <kgraul@linux.ibm.com>
Signed-off-by: default avatarUrsula Braun <ubraun@linux.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 9a2ad362
...@@ -20,7 +20,7 @@ struct smc_diag_req { ...@@ -20,7 +20,7 @@ struct smc_diag_req {
struct smc_diag_msg { struct smc_diag_msg {
__u8 diag_family; __u8 diag_family;
__u8 diag_state; __u8 diag_state;
__u8 diag_fallback; __u8 diag_mode;
__u8 diag_shutdown; __u8 diag_shutdown;
struct inet_diag_sockid id; struct inet_diag_sockid id;
...@@ -28,6 +28,13 @@ struct smc_diag_msg { ...@@ -28,6 +28,13 @@ struct smc_diag_msg {
__u64 diag_inode; __u64 diag_inode;
}; };
/* Mode of a connection */
enum {
SMC_DIAG_MODE_SMCR,
SMC_DIAG_MODE_FALLBACK_TCP,
SMC_DIAG_MODE_SMCD,
};
/* Extensions */ /* Extensions */
enum { enum {
......
...@@ -91,7 +91,12 @@ static int __smc_diag_dump(struct sock *sk, struct sk_buff *skb, ...@@ -91,7 +91,12 @@ static int __smc_diag_dump(struct sock *sk, struct sk_buff *skb,
r = nlmsg_data(nlh); r = nlmsg_data(nlh);
smc_diag_msg_common_fill(r, sk); smc_diag_msg_common_fill(r, sk);
r->diag_state = sk->sk_state; r->diag_state = sk->sk_state;
r->diag_fallback = smc->use_fallback; if (smc->use_fallback)
r->diag_mode = SMC_DIAG_MODE_FALLBACK_TCP;
else if (smc->conn.lgr && smc->conn.lgr->is_smcd)
r->diag_mode = SMC_DIAG_MODE_SMCD;
else
r->diag_mode = SMC_DIAG_MODE_SMCR;
user_ns = sk_user_ns(NETLINK_CB(cb->skb).sk); user_ns = sk_user_ns(NETLINK_CB(cb->skb).sk);
if (smc_diag_msg_attrs_fill(sk, skb, r, user_ns)) if (smc_diag_msg_attrs_fill(sk, skb, r, user_ns))
goto errout; goto errout;
......
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