summaryrefslogtreecommitdiffstats
path: root/net/rds/af_rds.c
diff options
context:
space:
mode:
authorSantosh Shilimkar <santosh.shilimkar@oracle.com>2018-10-13 21:36:49 +0800
committerSantosh Shilimkar <santosh.shilimkar@oracle.com>2019-02-04 14:59:13 -0800
commit56dc8bce9f761cf61258e25d96dec4072273d8db (patch)
tree99e56197db9d11e8aa3b02d8e354cbadf9843410 /net/rds/af_rds.c
parent3eb450367d0823226515ee24712ed08eccb33eb9 (diff)
downloadlinux-56dc8bce9f761cf61258e25d96dec4072273d8db.tar.bz2
rds: add transport specific tos_map hook
RDMA transport maps user tos to underline virtual lanes(VL) for IB or DSCP values. RDMA CM transport abstract thats for RDS. TCP transport makes use of default priority 0 and maps all user tos values to it. Reviewed-by: Sowmini Varadhan <sowmini.varadhan@oracle.com> Signed-off-by: Santosh Shilimkar <santosh.shilimkar@oracle.com> [yanjun.zhu@oracle.com: Adapted original patch with ipv6 changes] Signed-off-by: Zhu Yanjun <yanjun.zhu@oracle.com>
Diffstat (limited to 'net/rds/af_rds.c')
-rw-r--r--net/rds/af_rds.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/net/rds/af_rds.c b/net/rds/af_rds.c
index 904515858037..d6cc97fbbbb0 100644
--- a/net/rds/af_rds.c
+++ b/net/rds/af_rds.c
@@ -255,16 +255,18 @@ static __poll_t rds_poll(struct file *file, struct socket *sock,
static int rds_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
{
struct rds_sock *rs = rds_sk_to_rs(sock->sk);
- rds_tos_t tos;
+ rds_tos_t utos, tos = 0;
switch (cmd) {
case SIOCRDSSETTOS:
- if (get_user(tos, (rds_tos_t __user *)arg))
+ if (get_user(utos, (rds_tos_t __user *)arg))
return -EFAULT;
if (rs->rs_transport &&
- rs->rs_transport->t_type == RDS_TRANS_TCP)
- tos = 0;
+ rs->rs_transport->get_tos_map)
+ tos = rs->rs_transport->get_tos_map(utos);
+ else
+ return -ENOIOCTLCMD;
spin_lock_bh(&rds_sock_lock);
if (rs->rs_tos || rs->rs_conn) {