]) # LN_EXPORT_KMAP_TO_PAG
#
-# LN_CONFIG_SOCK_ACCEPT
-#
-# 4.11 commit cdfbabfb2f0ce983fdaa42f20e5f7842178fc01e added a flag
-# to handle a possible lockdep condition kernel socket accept.
-#
-AC_DEFUN([LN_CONFIG_SOCK_ACCEPT], [
-tmp_flags="$EXTRA_KCFLAGS"
-EXTRA_KCFLAGS="-Werror"
-LB_CHECK_COMPILE([if 'struct sock' accept function requires a bool argument],
-kern_sock_flag, [
- #include <linux/net.h>
-],[
- ((struct socket *)0)->ops->accept(NULL, NULL, O_NONBLOCK, false);
-],[
- AC_DEFINE(HAVE_KERN_SOCK_ACCEPT_FLAG_ARG, 1,
- ['struct sock' accept function requires bool argument])
-])
-EXTRA_KCFLAGS="$tmp_flags"
-]) # LN_CONFIG_SOCK_ACCEPT
-
-#
# LN_HAVE_ORACLE_OFED_EXTENSIONS
#
# Oracle UEK 5
LN_CONFIG_SK_DATA_READY
# 4.x
LN_CONFIG_SOCK_CREATE_KERN
-# 4.11
-LN_CONFIG_SOCK_ACCEPT
# 4.14
LN_HAVE_ORACLE_OFED_EXTENSIONS
# 4.17
int lnet_sock_listen(struct socket **sockp, __u32 ip, int port, int backlog,
struct net *ns);
-int lnet_sock_accept(struct socket **newsockp, struct socket *sock);
int lnet_sock_connect(struct socket **sockp, int *fatal,
__u32 local_ip, int local_port,
__u32 peer_ip, int peer_port, struct net *ns);
if (!atomic_read(&lnet_acceptor_state.pta_ready))
continue;
atomic_set(&lnet_acceptor_state.pta_ready, 0);
- rc = lnet_sock_accept(&newsock, lnet_acceptor_state.pta_sock);
+ rc = kernel_accept(lnet_acceptor_state.pta_sock, &newsock,
+ SOCK_NONBLOCK);
if (rc != 0) {
if (rc != -EAGAIN) {
CWARN("Accept error %d: pausing...\n", rc);
}
int
-lnet_sock_accept(struct socket **newsockp, struct socket *sock)
-{
- struct socket *newsock;
- int rc;
-
- /* XXX this should add a ref to sock->ops->owner, if
- * TCP could be a module */
- rc = sock_create_lite(PF_PACKET, sock->type, IPPROTO_TCP, &newsock);
- if (rc) {
- CERROR("Can't allocate socket\n");
- return rc;
- }
-
- newsock->ops = sock->ops;
-
-#ifdef HAVE_KERN_SOCK_ACCEPT_FLAG_ARG
- rc = sock->ops->accept(sock, newsock, O_NONBLOCK, false);
-#else
- rc = sock->ops->accept(sock, newsock, O_NONBLOCK);
-#endif
- if (rc != 0)
- goto failed;
-
- *newsockp = newsock;
- return 0;
-
-failed:
- sock_release(newsock);
- return rc;
-}
-
-int
lnet_sock_connect(struct socket **sockp, int *fatal,
__u32 local_ip, int local_port,
__u32 peer_ip, int peer_port,