* [PATCH net-next 0/5] RDS: minor updates for net-next @ 2009-10-30 18:54 Andy Grover 2009-10-30 18:54 ` [PATCH 1/5] RDS: Add GET_MR_FOR_DEST sockopt Andy Grover 2009-10-30 19:23 ` [PATCH net-next 0/5] RDS: minor updates for net-next David Miller 0 siblings, 2 replies; 5+ messages in thread From: Andy Grover @ 2009-10-30 18:54 UTC (permalink / raw) To: netdev; +Cc: rds-devel These patches fix some small issues with RDS, please review and apply if ok. Thanks -- Regards -- Andy ^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/5] RDS: Add GET_MR_FOR_DEST sockopt 2009-10-30 18:54 [PATCH net-next 0/5] RDS: minor updates for net-next Andy Grover @ 2009-10-30 18:54 ` Andy Grover 2009-10-30 19:23 ` [PATCH net-next 0/5] RDS: minor updates for net-next David Miller 1 sibling, 0 replies; 5+ messages in thread From: Andy Grover @ 2009-10-30 18:54 UTC (permalink / raw) To: netdev; +Cc: rds-devel RDS currently supports a GET_MR sockopt to establish a memory region (MR) for a chunk of memory. However, the fastreg method ties a MR to a particular destination. The GET_MR_FOR_DEST sockopt allows the remote machine to be specified, and thus support for fastreg (aka FRWRs). Note that this patch does *not* do all of this - it simply implements the new sockopt in terms of the old one, so applications can begin to use the new sockopt in preparation for cutover to FRWRs. Signed-off-by: Andy Grover <andy.grover@oracle.com> --- include/linux/rds.h | 8 ++++++++ net/rds/af_rds.c | 3 +++ net/rds/rdma.c | 24 ++++++++++++++++++++++++ net/rds/rdma.h | 1 + 4 files changed, 36 insertions(+), 0 deletions(-) diff --git a/include/linux/rds.h b/include/linux/rds.h index 89d46e1..cab4994 100644 --- a/include/linux/rds.h +++ b/include/linux/rds.h @@ -56,6 +56,7 @@ /* deprecated: RDS_BARRIER 4 */ #define RDS_RECVERR 5 #define RDS_CONG_MONITOR 6 +#define RDS_GET_MR_FOR_DEST 7 /* * Control message types for SOL_RDS. @@ -224,6 +225,13 @@ struct rds_get_mr_args { uint64_t flags; }; +struct rds_get_mr_for_dest_args { + struct sockaddr_storage dest_addr; + struct rds_iovec vec; + u_int64_t cookie_addr; + uint64_t flags; +}; + struct rds_free_mr_args { rds_rdma_cookie_t cookie; u_int64_t flags; diff --git a/net/rds/af_rds.c b/net/rds/af_rds.c index a202e5b..2b978dc 100644 --- a/net/rds/af_rds.c +++ b/net/rds/af_rds.c @@ -265,6 +265,9 @@ static int rds_setsockopt(struct socket *sock, int level, int optname, case RDS_GET_MR: ret = rds_get_mr(rs, optval, optlen); break; + case RDS_GET_MR_FOR_DEST: + ret = rds_get_mr_for_dest(rs, optval, optlen); + break; case RDS_FREE_MR: ret = rds_free_mr(rs, optval, optlen); break; diff --git a/net/rds/rdma.c b/net/rds/rdma.c index 8dc83d2..971b5a6 100644 --- a/net/rds/rdma.c +++ b/net/rds/rdma.c @@ -317,6 +317,30 @@ int rds_get_mr(struct rds_sock *rs, char __user *optval, int optlen) return __rds_rdma_map(rs, &args, NULL, NULL); } +int rds_get_mr_for_dest(struct rds_sock *rs, char __user *optval, int optlen) +{ + struct rds_get_mr_for_dest_args args; + struct rds_get_mr_args new_args; + + if (optlen != sizeof(struct rds_get_mr_for_dest_args)) + return -EINVAL; + + if (copy_from_user(&args, (struct rds_get_mr_for_dest_args __user *)optval, + sizeof(struct rds_get_mr_for_dest_args))) + return -EFAULT; + + /* + * Initially, just behave like get_mr(). + * TODO: Implement get_mr as wrapper around this + * and deprecate it. + */ + new_args.vec = args.vec; + new_args.cookie_addr = args.cookie_addr; + new_args.flags = args.flags; + + return __rds_rdma_map(rs, &new_args, NULL, NULL); +} + /* * Free the MR indicated by the given R_Key */ diff --git a/net/rds/rdma.h b/net/rds/rdma.h index 4255120..909c398 100644 --- a/net/rds/rdma.h +++ b/net/rds/rdma.h @@ -61,6 +61,7 @@ static inline u32 rds_rdma_cookie_offset(rds_rdma_cookie_t cookie) } int rds_get_mr(struct rds_sock *rs, char __user *optval, int optlen); +int rds_get_mr_for_dest(struct rds_sock *rs, char __user *optval, int optlen); int rds_free_mr(struct rds_sock *rs, char __user *optval, int optlen); void rds_rdma_drop_keys(struct rds_sock *rs); int rds_cmsg_rdma_args(struct rds_sock *rs, struct rds_message *rm, -- 1.6.3.3 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH net-next 0/5] RDS: minor updates for net-next 2009-10-30 18:54 [PATCH net-next 0/5] RDS: minor updates for net-next Andy Grover 2009-10-30 18:54 ` [PATCH 1/5] RDS: Add GET_MR_FOR_DEST sockopt Andy Grover @ 2009-10-30 19:23 ` David Miller 2009-10-30 21:23 ` Andrew Grover 1 sibling, 1 reply; 5+ messages in thread From: David Miller @ 2009-10-30 19:23 UTC (permalink / raw) To: andy.grover; +Cc: netdev, rds-devel From: Andy Grover <andy.grover@oracle.com> Date: Fri, 30 Oct 2009 11:54:52 -0700 > These patches fix some small issues with RDS, please review and > apply if ok. Adding new socket options is not appropriate for -rc* series submissions. The changes that fix races and panics are fine, the rest is not. Please respin your changes properly for net-2.6, and we can add the socket option and do the other stuff in net-next-2.6 Thanks. ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net-next 0/5] RDS: minor updates for net-next 2009-10-30 19:23 ` [PATCH net-next 0/5] RDS: minor updates for net-next David Miller @ 2009-10-30 21:23 ` Andrew Grover 2009-10-30 22:06 ` David Miller 0 siblings, 1 reply; 5+ messages in thread From: Andrew Grover @ 2009-10-30 21:23 UTC (permalink / raw) To: David Miller; +Cc: andy.grover, netdev, rds-devel On Fri, Oct 30, 2009 at 12:23 PM, David Miller <davem@davemloft.net> wrote: >> These patches fix some small issues with RDS, please review and >> apply if ok. > Adding new socket options is not appropriate for -rc* series > submissions. > > The changes that fix races and panics are fine, the rest is not. > > Please respin your changes properly for net-2.6, and we can add the > socket option and do the other stuff in net-next-2.6 I'm fine with it all going into net-next, actually. Even the fixes are not for showstopper bugs, and RDS is not a widely-used protocol. Thanks -- Regards -- Andy ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net-next 0/5] RDS: minor updates for net-next 2009-10-30 21:23 ` Andrew Grover @ 2009-10-30 22:06 ` David Miller 0 siblings, 0 replies; 5+ messages in thread From: David Miller @ 2009-10-30 22:06 UTC (permalink / raw) To: andy.grover; +Cc: andy.grover, netdev, rds-devel From: Andrew Grover <andy.grover@gmail.com> Date: Fri, 30 Oct 2009 14:23:13 -0700 > On Fri, Oct 30, 2009 at 12:23 PM, David Miller <davem@davemloft.net> wrote: >>> These patches fix some small issues with RDS, please review and >>> apply if ok. >> Adding new socket options is not appropriate for -rc* series >> submissions. >> >> The changes that fix races and panics are fine, the rest is not. >> >> Please respin your changes properly for net-2.6, and we can add the >> socket option and do the other stuff in net-next-2.6 > > I'm fine with it all going into net-next, actually. Even the fixes are > not for showstopper bugs, and RDS is not a widely-used protocol. Okie dokie, I've tossed all 5 patches into net-next-2.6 Thanks! ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-10-30 22:06 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2009-10-30 18:54 [PATCH net-next 0/5] RDS: minor updates for net-next Andy Grover 2009-10-30 18:54 ` [PATCH 1/5] RDS: Add GET_MR_FOR_DEST sockopt Andy Grover 2009-10-30 19:23 ` [PATCH net-next 0/5] RDS: minor updates for net-next David Miller 2009-10-30 21:23 ` Andrew Grover 2009-10-30 22:06 ` David Miller
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox