net/tcp: Rename TCP2 to TCP

TCP2 is no longer needed as it is the unique implementation since the
legacy one has been removed.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This commit is contained in:
Tomasz Bursztyka 2021-11-10 14:39:42 +01:00 committed by Christopher Friedt
commit 32db35a721
19 changed files with 38 additions and 43 deletions

View file

@ -252,10 +252,10 @@ __net_socket struct net_context {
net_pkt_get_pool_func_t data_pool; net_pkt_get_pool_func_t data_pool;
#endif /* CONFIG_NET_CONTEXT_NET_PKT_POOL */ #endif /* CONFIG_NET_CONTEXT_NET_PKT_POOL */
#if defined(CONFIG_NET_TCP2) #if defined(CONFIG_NET_TCP)
/** TCP connection information */ /** TCP connection information */
void *tcp; void *tcp;
#endif /* CONFIG_NET_TCP2 */ #endif /* CONFIG_NET_TCP */
#if defined(CONFIG_NET_CONTEXT_SYNC_RECV) #if defined(CONFIG_NET_CONTEXT_SYNC_RECV)
/** /**

View file

@ -128,7 +128,7 @@ struct net_pkt {
struct net_linkaddr lladdr_src; struct net_linkaddr lladdr_src;
struct net_linkaddr lladdr_dst; struct net_linkaddr lladdr_dst;
#if defined(CONFIG_NET_TCP2) #if defined(CONFIG_NET_TCP)
/** Allow placing the packet into sys_slist_t */ /** Allow placing the packet into sys_slist_t */
sys_snode_t next; sys_snode_t next;
#endif #endif

View file

@ -7,7 +7,7 @@
#define MY_PORT 4242 #define MY_PORT 4242
#if defined(CONFIG_NET_SOCKETS_SOCKOPT_TLS) || defined(CONFIG_NET_TCP2) || \ #if defined(CONFIG_NET_SOCKETS_SOCKOPT_TLS) || defined(CONFIG_NET_TCP) || \
defined(CONFIG_COVERAGE) defined(CONFIG_COVERAGE)
#define STACK_SIZE 4096 #define STACK_SIZE 4096
#else #else

View file

@ -7,10 +7,10 @@ Overview
******** ********
This application is used together with the TTCN-3 based sanity check This application is used together with the TTCN-3 based sanity check
to validate the functionality of the experimental TCP (TCP2). to validate the functionality of the TCP.
Building, Running and executing TTCN-3 based Sanity Check for TCP2 Building, Running and executing TTCN-3 based Sanity Check for TCP
****************************************************************** *****************************************************************
Compile and start the `net-test-tools`_: Compile and start the `net-test-tools`_:
@ -29,7 +29,7 @@ Build the TCP sample app:
cmake -DBOARD=qemu_x86 -DOVERLAY_CONFIG="overlay-slip.conf" .. cmake -DBOARD=qemu_x86 -DOVERLAY_CONFIG="overlay-slip.conf" ..
make run make run
Compile and run the TCP2 sanity check `net-test-suites`_: Compile and run the TCP sanity check `net-test-suites`_:
.. code-block:: console .. code-block:: console

View file

@ -1,3 +1,3 @@
sample: sample:
description: A sample for running TTCN-3 based sanity check for TCP2 description: A sample for running TTCN-3 based sanity check for TCP
name: tcp name: tcp

View file

@ -25,13 +25,13 @@ do { \
/* /*
* This application is used together with the TTCN-3 based sanity check * This application is used together with the TTCN-3 based sanity check
* to validate the functionality of the experimental TCP (TCP2). * to validate the functionality of the TCP.
* *
* samples/net/sockets/tcp/README.rst * samples/net/sockets/tcp/README.rst
* *
* Eventually UDP based test protocol might be terminated in the user space * Eventually UDP based test protocol might be terminated in the user space
* (see udp() below), but at the moment it's just a dummy loop * (see udp() below), but at the moment it's just a dummy loop
* to keep the sample running in order to execute TTCN-3 TCP2 sanity check. * to keep the sample running in order to execute TTCN-3 TCP sanity check.
*/ */
void main(void) void main(void)
{ {

View file

@ -15,9 +15,9 @@ if NET_BUF
config NET_BUF_USER_DATA_SIZE config NET_BUF_USER_DATA_SIZE
int "Size of user_data available in every network buffer" int "Size of user_data available in every network buffer"
default 8 if ((BT || NET_TCP2) && 64BIT) || BT_ISO default 8 if ((BT || NET_TCP) && 64BIT) || BT_ISO
default 4 default 4
range 4 65535 if BT || NET_TCP2 range 4 65535 if BT || NET_TCP
range 0 65535 range 0 65535
help help
Amount of memory reserved in each network buffer for user data. In Amount of memory reserved in each network buffer for user data. In

View file

@ -34,7 +34,7 @@ zephyr_library_sources_ifdef(CONFIG_NET_IPV6_MLD ipv6_mld.c)
zephyr_library_sources_ifdef(CONFIG_NET_IPV6_FRAGMENT ipv6_fragment.c) zephyr_library_sources_ifdef(CONFIG_NET_IPV6_FRAGMENT ipv6_fragment.c)
zephyr_library_sources_ifdef(CONFIG_NET_ROUTE route.c) zephyr_library_sources_ifdef(CONFIG_NET_ROUTE route.c)
zephyr_library_sources_ifdef(CONFIG_NET_STATISTICS net_stats.c) zephyr_library_sources_ifdef(CONFIG_NET_STATISTICS net_stats.c)
zephyr_library_sources_ifdef(CONFIG_NET_TCP2 connection.c tcp2.c) zephyr_library_sources_ifdef(CONFIG_NET_TCP connection.c tcp.c)
zephyr_library_sources_ifdef(CONFIG_NET_TEST_PROTOCOL tp.c) zephyr_library_sources_ifdef(CONFIG_NET_TEST_PROTOCOL tp.c)
zephyr_library_sources_ifdef(CONFIG_NET_TRICKLE trickle.c) zephyr_library_sources_ifdef(CONFIG_NET_TRICKLE trickle.c)
zephyr_library_sources_ifdef(CONFIG_NET_UDP connection.c udp.c) zephyr_library_sources_ifdef(CONFIG_NET_UDP connection.c udp.c)

View file

@ -423,7 +423,7 @@ config NET_TCP_RETRY_COUNT
config NET_TCP_MAX_SEND_WINDOW_SIZE config NET_TCP_MAX_SEND_WINDOW_SIZE
int "Maximum sending window size to use" int "Maximum sending window size to use"
depends on NET_TCP2 depends on NET_TCP
default 0 default 0
range 0 65535 range 0 65535
help help
@ -433,7 +433,7 @@ config NET_TCP_MAX_SEND_WINDOW_SIZE
config NET_TCP_RECV_QUEUE_TIMEOUT config NET_TCP_RECV_QUEUE_TIMEOUT
int "How long to queue received data (in ms)" int "How long to queue received data (in ms)"
depends on NET_TCP2 depends on NET_TCP
default 100 default 100
range 0 10000 range 0 10000
help help
@ -467,11 +467,6 @@ config NET_TCP_ISN_RFC6528
RFC 6528 chapter 3. https://tools.ietf.org/html/rfc6528 RFC 6528 chapter 3. https://tools.ietf.org/html/rfc6528
If this is not set, then sys_rand32_get() is used for ISN value. If this is not set, then sys_rand32_get() is used for ISN value.
config NET_TCP2
bool
default y
depends on NET_TCP
config NET_TEST_PROTOCOL config NET_TEST_PROTOCOL
bool "Enable JSON based test protocol (UDP)" bool "Enable JSON based test protocol (UDP)"
help help

View file

@ -37,8 +37,8 @@ LOG_MODULE_REGISTER(net_ctx, CONFIG_NET_CONTEXT_LOG_LEVEL);
#include "tcp_internal.h" #include "tcp_internal.h"
#include "net_stats.h" #include "net_stats.h"
#if IS_ENABLED(CONFIG_NET_TCP2) #if IS_ENABLED(CONFIG_NET_TCP)
#include "tcp2.h" #include "tcp.h"
#endif #endif
#ifndef EPFNOSUPPORT #ifndef EPFNOSUPPORT

View file

@ -1454,14 +1454,14 @@ static void conn_handler_cb(struct net_conn *conn, void *user_data)
#endif /* CONFIG_NET_CONN_LOG_LEVEL >= LOG_LEVEL_DBG */ #endif /* CONFIG_NET_CONN_LOG_LEVEL >= LOG_LEVEL_DBG */
#if CONFIG_NET_TCP_LOG_LEVEL >= LOG_LEVEL_DBG #if CONFIG_NET_TCP_LOG_LEVEL >= LOG_LEVEL_DBG
struct tcp2_detail_info { struct tcp_detail_info {
int printed_send_queue_header; int printed_send_queue_header;
int printed_details; int printed_details;
int count; int count;
}; };
#endif #endif
#if defined(CONFIG_NET_TCP2) && \ #if defined(CONFIG_NET_TCP) && \
(defined(CONFIG_NET_OFFLOAD) || defined(CONFIG_NET_NATIVE)) (defined(CONFIG_NET_OFFLOAD) || defined(CONFIG_NET_NATIVE))
static void tcp_cb(struct tcp *conn, void *user_data) static void tcp_cb(struct tcp *conn, void *user_data)
{ {
@ -1485,7 +1485,7 @@ static void tcp_sent_list_cb(struct tcp *conn, void *user_data)
{ {
struct net_shell_user_data *data = user_data; struct net_shell_user_data *data = user_data;
const struct shell *shell = data->shell; const struct shell *shell = data->shell;
struct tcp2_detail_info *details = data->user_data; struct tcp_detail_info *details = data->user_data;
struct net_pkt *pkt; struct net_pkt *pkt;
sys_snode_t *node; sys_snode_t *node;
@ -1554,7 +1554,7 @@ static void tcp_sent_list_cb(struct tcp *conn, void *user_data)
details->printed_send_queue_header = true; details->printed_send_queue_header = true;
} }
#endif /* CONFIG_NET_TCP_LOG_LEVEL >= LOG_LEVEL_DBG */ #endif /* CONFIG_NET_TCP_LOG_LEVEL >= LOG_LEVEL_DBG */
#endif /* TCP2 */ #endif /* TCP */
#if defined(CONFIG_NET_IPV6_FRAGMENT) #if defined(CONFIG_NET_IPV6_FRAGMENT)
static void ipv6_frag_cb(struct net_ipv6_reassembly *reass, static void ipv6_frag_cb(struct net_ipv6_reassembly *reass,
@ -2040,18 +2040,18 @@ static int cmd_net_conn(const struct shell *shell, size_t argc, char *argv[])
} else { } else {
#if CONFIG_NET_TCP_LOG_LEVEL >= LOG_LEVEL_DBG #if CONFIG_NET_TCP_LOG_LEVEL >= LOG_LEVEL_DBG
/* Print information about pending packets */ /* Print information about pending packets */
struct tcp2_detail_info details; struct tcp_detail_info details;
count = 0; count = 0;
if (IS_ENABLED(CONFIG_NET_TCP2)) { if (IS_ENABLED(CONFIG_NET_TCP)) {
memset(&details, 0, sizeof(details)); memset(&details, 0, sizeof(details));
user_data.user_data = &details; user_data.user_data = &details;
} }
net_tcp_foreach(tcp_sent_list_cb, &user_data); net_tcp_foreach(tcp_sent_list_cb, &user_data);
if (IS_ENABLED(CONFIG_NET_TCP2)) { if (IS_ENABLED(CONFIG_NET_TCP)) {
if (details.count == 0) { if (details.count == 0) {
PR("No active connections.\n"); PR("No active connections.\n");
} }

View file

@ -2813,7 +2813,7 @@ const char *net_tcp_state_str(enum tcp_state state)
void net_tcp_init(void) void net_tcp_init(void)
{ {
#if defined(CONFIG_NET_TEST_PROTOCOL) #if defined(CONFIG_NET_TEST_PROTOCOL)
/* Register inputs for TTCN-3 based TCP2 sanity check */ /* Register inputs for TTCN-3 based TCP sanity check */
test_cb_register(AF_INET, IPPROTO_TCP, 4242, 4242, tcp_input); test_cb_register(AF_INET, IPPROTO_TCP, 4242, 4242, tcp_input);
test_cb_register(AF_INET6, IPPROTO_TCP, 4242, 4242, tcp_input); test_cb_register(AF_INET6, IPPROTO_TCP, 4242, 4242, tcp_input);
test_cb_register(AF_INET, IPPROTO_UDP, 4242, 4242, tp_input); test_cb_register(AF_INET, IPPROTO_UDP, 4242, 4242, tp_input);

View file

@ -21,11 +21,11 @@
* into the ip stack and the socket layer less intrusive. * into the ip stack and the socket layer less intrusive.
* *
* Semantically cleaner use is possible (and might be exposed), * Semantically cleaner use is possible (and might be exposed),
* look into the unit test tests/net/tcp2 for insights. * look into the unit test tests/net/tcp for insights.
*/ */
#ifndef TCP2_H #ifndef TCP_H
#define TCP2_H #define TCP_H
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
@ -142,4 +142,4 @@ void tcp_input(struct net_pkt *pkt);
} }
#endif #endif
#endif /* TCP2_H */ #endif /* TCP_H */

View file

@ -28,7 +28,7 @@ extern "C" {
#endif #endif
#include "tcp2_priv.h" #include "tcp_private.h"
/** /**
* @brief Calculates and returns the MSS for a given TCP context * @brief Calculates and returns the MSS for a given TCP context

View file

@ -1,6 +1,6 @@
/* main.c - Application main entry point /* main.c - Application main entry point
* *
* This is a self-contained test for exercising the TCP2 protocol stack. Both * This is a self-contained test for exercising the TCP protocol stack. Both
* the server and client side run on ths same device using a DUMMY interface * the server and client side run on ths same device using a DUMMY interface
* as a loopback of the IP packets. * as a loopback of the IP packets.
* *
@ -29,8 +29,8 @@ LOG_MODULE_REGISTER(net_test, CONFIG_NET_TCP_LOG_LEVEL);
#include "ipv4.h" #include "ipv4.h"
#include "ipv6.h" #include "ipv6.h"
#include "tcp2.h" #include "tcp.h"
#include "tcp2_priv.h" #include "tcp_private.h"
#include "net_stats.h" #include "net_stats.h"
#include <ztest.h> #include <ztest.h>
@ -1475,7 +1475,7 @@ static void test_server_timeout_out_of_order_data(void)
} }
/* Because the pending seq values are not sequential, /* Because the pending seq values are not sequential,
* the recv queue in tcp2 should timeout. * the recv queue in tcp should timeout.
*/ */
ret = k_sem_take(&test_sem, ret = k_sem_take(&test_sem,
K_MSEC(CONFIG_NET_TCP_RECV_QUEUE_TIMEOUT + 10)); K_MSEC(CONFIG_NET_TCP_RECV_QUEUE_TIMEOUT + 10));

View file

@ -1,10 +1,10 @@
common: common:
depends_on: netif depends_on: netif
tags: net tcp2 tags: net tcp
tests: tests:
net.tcp2.simple: net.tcp.simple:
extra_configs: extra_configs:
- CONFIG_NET_TCP_RECV_QUEUE_TIMEOUT=1000 - CONFIG_NET_TCP_RECV_QUEUE_TIMEOUT=1000
net.tcp2.no_recv_queue: net.tcp.no_recv_queue:
extra_configs: extra_configs:
- CONFIG_NET_TCP_RECV_QUEUE_TIMEOUT=0 - CONFIG_NET_TCP_RECV_QUEUE_TIMEOUT=0