Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1ad6a73e authored by James Simmons's avatar James Simmons Committed by Greg Kroah-Hartman
Browse files

staging:lustre: rename tcpip handling functions to lnet_* prefix



With all the TCPIP handling done in the lnet layer we should
rename all the functions with the prefix lnet_*. One other
change done was changing the remove argument of lnet_sock_getaddr
from a int to a bool.

Signed-off-by: default avatarJames Simmons <jsimmons@infradead.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 45bd3ebe
Loading
Loading
Loading
Loading
+0 −15
Original line number Diff line number Diff line
@@ -65,21 +65,6 @@ static inline int __is_po2(unsigned long long val)
int libcfs_arch_init(void);
void libcfs_arch_cleanup(void);

/* libcfs tcpip */
int libcfs_ipif_query(char *name, int *up, __u32 *ip, __u32 *mask);
int libcfs_ipif_enumerate(char ***names);
void libcfs_ipif_free_enumeration(char **names, int n);
int libcfs_sock_listen(struct socket **sockp, __u32 ip, int port, int backlog);
int libcfs_sock_accept(struct socket **newsockp, struct socket *sock);
int libcfs_sock_connect(struct socket **sockp, int *fatal,
			__u32 local_ip, int local_port,
			__u32 peer_ip, int peer_port);
int libcfs_sock_setbuf(struct socket *socket, int txbufsize, int rxbufsize);
int libcfs_sock_getbuf(struct socket *socket, int *txbufsize, int *rxbufsize);
int libcfs_sock_getaddr(struct socket *socket, int remote, __u32 *ip, int *port);
int libcfs_sock_write(struct socket *sock, void *buffer, int nob, int timeout);
int libcfs_sock_read(struct socket *sock, void *buffer, int nob, int timeout);

/* need both kernel and user-land acceptor */
#define LNET_ACCEPTOR_MIN_RESERVED_PORT    512
#define LNET_ACCEPTOR_MAX_RESERVED_PORT    1023
+16 −0
Original line number Diff line number Diff line
@@ -639,6 +639,22 @@ int lnet_acceptor_port(void);
int lnet_acceptor_start(void);
void lnet_acceptor_stop(void);

int lnet_ipif_query(char *name, int *up, __u32 *ip, __u32 *mask);
int lnet_ipif_enumerate(char ***names);
void lnet_ipif_free_enumeration(char **names, int n);
int lnet_sock_setbuf(struct socket *socket, int txbufsize, int rxbufsize);
int lnet_sock_getbuf(struct socket *socket, int *txbufsize, int *rxbufsize);
int lnet_sock_getaddr(struct socket *socket, bool remote, __u32 *ip, int *port);
int lnet_sock_write(struct socket *sock, void *buffer, int nob, int timeout);
int lnet_sock_read(struct socket *sock, void *buffer, int nob, int timeout);

int lnet_sock_listen(struct socket **sockp, __u32 ip, int port, int backlog);
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);
void libcfs_sock_release(struct socket *sock);

void lnet_get_tunables(void);
int lnet_peers_start_down(void);
int lnet_peer_buffer_credits(lnet_ni_t *ni);
+1 −1
Original line number Diff line number Diff line
@@ -2617,7 +2617,7 @@ static kib_dev_t *kiblnd_create_dev(char *ifname)
	int up;
	int rc;

	rc = libcfs_ipif_query(ifname, &up, &ip, &netmask);
	rc = lnet_ipif_query(ifname, &up, &ip, &netmask);
	if (rc != 0) {
		CERROR("Can't query IPoIB interface %s: %d\n",
		       ifname, rc);
+5 −6
Original line number Diff line number Diff line
@@ -968,7 +968,7 @@ ksocknal_accept(lnet_ni_t *ni, struct socket *sock)
	__u32 peer_ip;
	int peer_port;

	rc = libcfs_sock_getaddr(sock, 1, &peer_ip, &peer_port);
	rc = lnet_sock_getaddr(sock, 1, &peer_ip, &peer_port);
	LASSERT(rc == 0);		      /* we succeeded before */

	LIBCFS_ALLOC(cr, sizeof(*cr));
@@ -2594,7 +2594,7 @@ ksocknal_enumerate_interfaces(ksock_net_t *net)
	int rc;
	int n;

	n = libcfs_ipif_enumerate(&names);
	n = lnet_ipif_enumerate(&names);
	if (n <= 0) {
		CERROR("Can't enumerate interfaces: %d\n", n);
		return n;
@@ -2608,7 +2608,7 @@ ksocknal_enumerate_interfaces(ksock_net_t *net)
		if (!strcmp(names[i], "lo")) /* skip the loopback IF */
			continue;

		rc = libcfs_ipif_query(names[i], &up, &ip, &mask);
		rc = lnet_ipif_query(names[i], &up, &ip, &mask);
		if (rc != 0) {
			CWARN("Can't get interface %s info: %d\n",
			      names[i], rc);
@@ -2634,7 +2634,7 @@ ksocknal_enumerate_interfaces(ksock_net_t *net)
		j++;
	}

	libcfs_ipif_free_enumeration(names, n);
	lnet_ipif_free_enumeration(names, n);

	if (j == 0)
		CERROR("Can't find any usable interfaces\n");
@@ -2796,8 +2796,7 @@ ksocknal_startup(lnet_ni_t *ni)
			if (ni->ni_interfaces[i] == NULL)
				break;

			rc = libcfs_ipif_query(
				ni->ni_interfaces[i], &up,
			rc = lnet_ipif_query(ni->ni_interfaces[i], &up,
				&net->ksnn_interfaces[i].ksni_ipaddr,
				&net->ksnn_interfaces[i].ksni_netmask);

+3 −3
Original line number Diff line number Diff line
@@ -1707,7 +1707,7 @@ ksocknal_recv_hello (lnet_ni_t *ni, ksock_conn_t *conn,
	timeout = active ? *ksocknal_tunables.ksnd_timeout :
			    lnet_acceptor_timeout();

	rc = libcfs_sock_read(sock, &hello->kshm_magic, sizeof (hello->kshm_magic), timeout);
	rc = lnet_sock_read(sock, &hello->kshm_magic, sizeof (hello->kshm_magic), timeout);
	if (rc != 0) {
		CERROR("Error %d reading HELLO from %pI4h\n",
			rc, &conn->ksnc_ipaddr);
@@ -1726,7 +1726,7 @@ ksocknal_recv_hello (lnet_ni_t *ni, ksock_conn_t *conn,
		return -EPROTO;
	}

	rc = libcfs_sock_read(sock, &hello->kshm_version,
	rc = lnet_sock_read(sock, &hello->kshm_version,
			    sizeof(hello->kshm_version), timeout);
	if (rc != 0) {
		CERROR("Error %d reading HELLO from %pI4h\n",
Loading