diff --git a/CHANGELOG.md b/CHANGELOG.md index a09961b32..61f8076fe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -106,6 +106,11 @@ and `spdk_thread_poll`. Poll groups per session have been replaced by SPDK threads per vhost controller. +### sock + +Remove `spdk_sock_set_priority` function since the feature to set the sock priority will be +contained in two new functions, i.e., `spdk_sock_listen_ext` and `spdk_sock_connect_ext`. + ## v20.01 ### bdev diff --git a/include/spdk/sock.h b/include/spdk/sock.h index 6bbf8dcfb..62854c2b6 100644 --- a/include/spdk/sock.h +++ b/include/spdk/sock.h @@ -217,16 +217,6 @@ int spdk_sock_set_recvlowat(struct spdk_sock *sock, int nbytes); */ int spdk_sock_set_recvbuf(struct spdk_sock *sock, int sz); -/** - * Set priority for the given socket. - * - * \param sock Socket to set the priority. - * \param priority Priority given by the user. - * - * \return 0 on success, -1 on failure. - */ -int spdk_sock_set_priority(struct spdk_sock *sock, int priority); - /** * Set send buffer size for the given socket. * diff --git a/include/spdk_internal/sock.h b/include/spdk_internal/sock.h index e057bdeca..356e38272 100644 --- a/include/spdk_internal/sock.h +++ b/include/spdk_internal/sock.h @@ -105,7 +105,6 @@ struct spdk_net_impl { int (*set_recvlowat)(struct spdk_sock *sock, int nbytes); int (*set_recvbuf)(struct spdk_sock *sock, int sz); int (*set_sendbuf)(struct spdk_sock *sock, int sz); - int (*set_priority)(struct spdk_sock *sock, int priority); bool (*is_ipv6)(struct spdk_sock *sock); bool (*is_ipv4)(struct spdk_sock *sock); diff --git a/lib/nvmf/tcp.c b/lib/nvmf/tcp.c index c6a0c4b8c..cac1ac6fc 100644 --- a/lib/nvmf/tcp.c +++ b/lib/nvmf/tcp.c @@ -875,15 +875,6 @@ _spdk_nvmf_tcp_handle_connect(struct spdk_nvmf_transport *transport, SPDK_DEBUGLOG(SPDK_LOG_NVMF_TCP, "New connection accepted on %s port %s\n", port->trid->traddr, port->trid->trsvcid); - if (transport->opts.sock_priority) { - rc = spdk_sock_set_priority(sock, transport->opts.sock_priority); - if (rc) { - SPDK_ERRLOG("Failed to set the priority of the socket\n"); - spdk_sock_close(&sock); - return; - } - } - tqpair = calloc(1, sizeof(struct spdk_nvmf_tcp_qpair)); if (tqpair == NULL) { SPDK_ERRLOG("Could not allocate new connection.\n"); diff --git a/lib/sock/Makefile b/lib/sock/Makefile index 06ce29584..b5d8302fe 100644 --- a/lib/sock/Makefile +++ b/lib/sock/Makefile @@ -34,7 +34,7 @@ SPDK_ROOT_DIR := $(abspath $(CURDIR)/../..) include $(SPDK_ROOT_DIR)/mk/spdk.common.mk -SO_VER := 2 +SO_VER := 3 SO_MINOR := 0 SO_SUFFIX := $(SO_VER).$(SO_MINOR) diff --git a/lib/sock/sock.c b/lib/sock/sock.c index dbd862e16..7ef0fead3 100644 --- a/lib/sock/sock.c +++ b/lib/sock/sock.c @@ -357,12 +357,6 @@ spdk_sock_set_sendbuf(struct spdk_sock *sock, int sz) return sock->net_impl->set_sendbuf(sock, sz); } -int -spdk_sock_set_priority(struct spdk_sock *sock, int priority) -{ - return sock->net_impl->set_priority(sock, priority); -} - bool spdk_sock_is_ipv6(struct spdk_sock *sock) { diff --git a/module/sock/posix/posix.c b/module/sock/posix/posix.c index 2a6df7abc..83d511238 100644 --- a/module/sock/posix/posix.c +++ b/module/sock/posix/posix.c @@ -920,22 +920,6 @@ spdk_posix_sock_set_recvlowat(struct spdk_sock *_sock, int nbytes) return 0; } -static int -spdk_posix_sock_set_priority(struct spdk_sock *_sock, int priority) -{ - int rc = 0; - -#if defined(SO_PRIORITY) - struct spdk_posix_sock *sock = __posix_sock(_sock); - - assert(sock != NULL); - - rc = setsockopt(sock->fd, SOL_SOCKET, SO_PRIORITY, - &priority, sizeof(priority)); -#endif - return rc; -} - static bool spdk_posix_sock_is_ipv6(struct spdk_sock *_sock) { @@ -1242,7 +1226,6 @@ static struct spdk_net_impl g_posix_net_impl = { .set_recvlowat = spdk_posix_sock_set_recvlowat, .set_recvbuf = spdk_posix_sock_set_recvbuf, .set_sendbuf = spdk_posix_sock_set_sendbuf, - .set_priority = spdk_posix_sock_set_priority, .is_ipv6 = spdk_posix_sock_is_ipv6, .is_ipv4 = spdk_posix_sock_is_ipv4, .is_connected = spdk_posix_sock_is_connected, diff --git a/module/sock/uring/uring.c b/module/sock/uring/uring.c index febd4656a..ad0973eed 100644 --- a/module/sock/uring/uring.c +++ b/module/sock/uring/uring.c @@ -1007,22 +1007,6 @@ spdk_uring_sock_set_recvlowat(struct spdk_sock *_sock, int nbytes) return 0; } -static int -spdk_uring_sock_set_priority(struct spdk_sock *_sock, int priority) -{ - int rc = 0; - -#if defined(SO_PRIORITY) - struct spdk_uring_sock *sock = __uring_sock(_sock); - - assert(sock != NULL); - - rc = setsockopt(sock->fd, SOL_SOCKET, SO_PRIORITY, - &priority, sizeof(priority)); -#endif - return rc; -} - static bool spdk_uring_sock_is_ipv6(struct spdk_sock *_sock) { @@ -1253,7 +1237,6 @@ static struct spdk_net_impl g_uring_net_impl = { .set_recvlowat = spdk_uring_sock_set_recvlowat, .set_recvbuf = spdk_uring_sock_set_recvbuf, .set_sendbuf = spdk_uring_sock_set_sendbuf, - .set_priority = spdk_uring_sock_set_priority, .is_ipv6 = spdk_uring_sock_is_ipv6, .is_ipv4 = spdk_uring_sock_is_ipv4, .is_connected = spdk_uring_sock_is_connected, diff --git a/module/sock/vpp/vpp.c b/module/sock/vpp/vpp.c index 6049b8670..2c66f003e 100644 --- a/module/sock/vpp/vpp.c +++ b/module/sock/vpp/vpp.c @@ -1134,14 +1134,6 @@ spdk_vpp_sock_set_sendbuf(struct spdk_sock *_sock, int sz) return 0; } -static int -spdk_vpp_sock_set_priority(struct spdk_sock *_sock, int priority) -{ - assert(g_svm.vpp_initialized); - - return 0; -} - static bool spdk_vpp_sock_is_ipv6(struct spdk_sock *_sock) { @@ -1604,7 +1596,6 @@ static struct spdk_net_impl g_vpp_net_impl = { .set_recvlowat = spdk_vpp_sock_set_recvlowat, .set_recvbuf = spdk_vpp_sock_set_recvbuf, .set_sendbuf = spdk_vpp_sock_set_sendbuf, - .set_priority = spdk_vpp_sock_set_priority, .is_ipv6 = spdk_vpp_sock_is_ipv6, .is_ipv4 = spdk_vpp_sock_is_ipv4, .is_connected = spdk_vpp_sock_is_connected, diff --git a/test/unit/lib/sock/sock.c/sock_ut.c b/test/unit/lib/sock/sock.c/sock_ut.c index 9b157427c..17b90d12e 100644 --- a/test/unit/lib/sock/sock.c/sock_ut.c +++ b/test/unit/lib/sock/sock.c/sock_ut.c @@ -266,12 +266,6 @@ spdk_ut_sock_get_placement_id(struct spdk_sock *_sock, int *placement_id) return -1; } -static int -spdk_ut_sock_set_priority(struct spdk_sock *_sock, int priority) -{ - return 0; -} - static struct spdk_sock_group_impl * spdk_ut_sock_group_impl_create(void) { @@ -344,7 +338,6 @@ static struct spdk_net_impl g_ut_net_impl = { .set_recvlowat = spdk_ut_sock_set_recvlowat, .set_recvbuf = spdk_ut_sock_set_recvbuf, .set_sendbuf = spdk_ut_sock_set_sendbuf, - .set_priority = spdk_ut_sock_set_priority, .is_ipv6 = spdk_ut_sock_is_ipv6, .is_ipv4 = spdk_ut_sock_is_ipv4, .is_connected = spdk_ut_sock_is_connected,