summaryrefslogtreecommitdiffstats
path: root/src/plugins/quic
AgeCommit message (Expand)AuthorFilesLines
2020-01-15quic: add FEATURE.yamlAloys Augustin1-0/+10
2020-01-14tests: fix worker thread initializationPaul Vinciguerra1-4/+7
2020-01-06quic: call quic_send_packets only once per ctxAloys Augustin1-3/+7
2020-01-02session: fix listener global endpoint lookupFlorin Coras1-1/+1
2019-12-19quic: fix accept failureNathan Skrzypczak1-23/+23
2019-12-18quic: Hotfix crypto context on migrateNathan Skrzypczak1-0/+17
2019-12-17quic: Implement crypto contextsNathan Skrzypczak2-76/+241
2019-12-17quic: update quicly to v0.0.8-vppMathiasRaoul2-6/+8
2019-12-11quic: Add support for unidirectional streamsNathan Skrzypczak1-5/+14
2019-12-11quic: Use per thread next_cidNathan Skrzypczak2-8/+10
2019-12-11quic: Add aggregated quicly statsNathan Skrzypczak1-67/+186
2019-12-11quic: add more detailed statisticsMathiasRaoul2-0/+67
2019-12-10quic: removing quicly_send call from quic_accept_connectionMathiasRaoul1-9/+21
2019-12-06quic: update quicly to v0.0.7-vppMathiasRaoul1-8/+23
2019-12-05tests: quic enable per testcase timeout overridesPaul Vinciguerra1-3/+8
2019-12-04quic: fix stream tx_fifo race conditionNathan Skrzypczak2-27/+61
2019-12-04quic: clean accept/connect error codepathNathan Skrzypczak1-48/+51
2019-12-04quic: refactor connection search fnNathan Skrzypczak1-27/+31
2019-12-04quic: add conn-timeout config optionNathan Skrzypczak2-8/+12
2019-12-04quic: fix import typoNathan Skrzypczak1-1/+1
2019-11-26quic: Refactor for crypto contextsNathan Skrzypczak4-165/+168
2019-11-22quic: Refactor quic rx callback for offloadNathan Skrzypczak2-111/+147
2019-11-22quic: Remove qctx opening poolNathan Skrzypczak2-34/+15
2019-11-20quic: Increase loggingNathan Skrzypczak1-29/+40
2019-11-19quic: handle duplicate packet from quiclyDave Wallace1-2/+15
2019-11-07quic: Add support for ckpair & crypto engineNathan Skrzypczak2-20/+49
2019-11-06docs: add spellcheck to 'make docs' sphinx docsPaul Vinciguerra1-1/+1
2019-11-06quic: free qctx after udp cleanupNathan Skrzypczak1-22/+58
2019-11-05misc: Fix python scripts shebang lineRenato Botelho do Couto1-1/+1
2019-11-04quic: enhance error reportingDave Wallace2-6/+24
2019-11-04quic: remove redundant function callsDave Wallace1-2/+0
2019-11-01quic: fifo size is u32Dave Wallace3-18/+32
2019-10-31quic: fix wrong error checkingDave Wallace1-6/+1
2019-10-31quic: disable failing testFlorin Coras1-0/+1
2019-10-30quic: fix quicly fifo size mismatchDave Wallace1-3/+13
2019-10-30quic: fix typosPaul Vinciguerra1-4/+4
2019-10-22tests: quic add big stream extended testsDave Wallace1-10/+65
2019-10-22tests: enable vpp_echo to run in gdbDave Wallace1-7/+22
2019-10-21quic: Add PICOTLS_INCLUDE_DIR var to CMakeLists.Mathias Raoul1-0/+6
2019-10-11hsa: vpp_echo refactor quic nclients argDave Wallace1-2/+2
2019-10-09hsa: use crypto_engine_type_t for TLSNathan Skrzypczak1-1/+1
2019-10-09session: Add certificate storeNathan Skrzypczak2-10/+11
2019-10-09hsa: fix vpp_echo session closeDave Wallace1-37/+47
2019-10-08hsa: make vpp_echo use mq instead of bapiNathan Skrzypczak2-7/+1
2019-10-08session: add is_migrating flagNathan Skrzypczak2-49/+38
2019-10-07quic: fix wrong condition in update_fifo_sizeMathiasRaoul1-1/+1
2019-10-07quic: Refactor naming & clibsNathan Skrzypczak2-277/+209
2019-10-04quic: make quic fifo size configurable via cliMathiasRaoul2-6/+83
2019-10-04quic: update quicly to v0.0.5MathiasRaoul1-49/+12
2019-10-01quic: Create custom event loggerMathiasRaoul1-2/+39
(packed)) { uint32_t magic; uint32_t seq_num; uint32_t test; uint32_t ctrl_handle; uint32_t num_test_sessions; uint32_t verbose; uint32_t address_ip6; uint32_t transport_udp; uint32_t transport_tls; uint64_t rxbuf_size; uint64_t txbuf_size; uint64_t num_writes; uint64_t total_bytes; } vcl_test_cfg_t; typedef struct { uint64_t rx_xacts; uint64_t rx_bytes; uint32_t rx_eagain; uint32_t rx_incomp; uint64_t tx_xacts; uint64_t tx_bytes; uint32_t tx_eagain; uint32_t tx_incomp; struct timespec start; struct timespec stop; } vcl_test_stats_t; typedef struct { int fd; uint32_t txbuf_size; char *txbuf; uint32_t rxbuf_size; char *rxbuf; vcl_test_cfg_t cfg; vcl_test_stats_t stats; } vcl_test_session_t; /* * TLS server cert and keys to be used for testing only */ char vcl_test_crt_rsa[] = "-----BEGIN CERTIFICATE-----\r\n" "MIID5zCCAs+gAwIBAgIJALeMYCEHrTtJMA0GCSqGSIb3DQEBCwUAMIGJMQswCQYD\r\n" "VQQGEwJVUzELMAkGA1UECAwCQ0ExETAPBgNVBAcMCFNhbiBKb3NlMQ4wDAYDVQQK\r\n" "DAVDaXNjbzEOMAwGA1UECwwFZmQuaW8xFjAUBgNVBAMMDXRlc3R0bHMuZmQuaW8x\r\n" "IjAgBgkqhkiG9w0BCQEWE3ZwcC1kZXZAbGlzdHMuZmQuaW8wHhcNMTgwMzA1MjEx\r\n" "NTEyWhcNMjgwMzAyMjExNTEyWjCBiTELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAkNB\r\n" "MREwDwYDVQQHDAhTYW4gSm9zZTEOMAwGA1UECgwFQ2lzY28xDjAMBgNVBAsMBWZk\r\n" "LmlvMRYwFAYDVQQDDA10ZXN0dGxzLmZkLmlvMSIwIAYJKoZIhvcNAQkBFhN2cHAt\r\n" "ZGV2QGxpc3RzLmZkLmlvMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA\r\n" "4C1k8a1DuStgggqT4o09fP9sJ2dC54bxhS/Xk2VEfaIZ222WSo4X/syRVfVy9Yah\r\n" "cpI1zJ/RDxaZSFhgA+nPZBrFMsrULkrdAOpOVj8eDEp9JuWdO2ODSoFnCvLxcYWB\r\n" "Yc5kHryJpEaGJl1sFQSesnzMFty/59ta0stk0Fp8r5NhIjWvSovGzPo6Bhz+VS2c\r\n" "ebIZh4x1t2hHaFcgm0qJoJ6DceReWCW8w+yOVovTolGGq+bpb2Hn7MnRSZ2K2NdL\r\n" "+aLXpkZbS/AODP1FF2vTO1mYL290LO7/51vJmPXNKSDYMy5EvILr5/VqtjsFCwRL\r\n" "Q4jcM/+GeHSAFWx4qIv0BwIDAQABo1AwTjAdBgNVHQ4EFgQUWa1SOB37xmT53tZQ\r\n" "aXuLLhRI7U8wHwYDVR0jBBgwFoAUWa1SOB37xmT53tZQaXuLLhRI7U8wDAYDVR0T\r\n" "BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEAoUht13W4ya27NVzQuCMvqPWL3VM4\r\n" "3xbPFk02FaGz/WupPu276zGlzJAZrbuDcQowwwU1Ni1Yygxl96s1c2M5rHDTrOKG\r\n" "rK0hbkSFBo+i6I8u4HiiQ4rYmG0Hv6+sXn3of0HsbtDPGgWZoipPWDljPYEURu3e\r\n" "3HRe/Dtsj9CakBoSDzs8ndWaBR+f4sM9Tk1cjD46Gq2T/qpSPXqKxEUXlzhdCAn4\r\n" "twub17Bq2kykHpppCwPg5M+v30tHG/R2Go15MeFWbEJthFk3TZMjKL7UFs7fH+x2\r\n" "wSonXb++jY+KmCb93C+soABBizE57g/KmiR2IxQ/LMjDik01RSUIaM0lLA==\r\n" "-----END CERTIFICATE-----\r\n"; uint32_t vcl_test_crt_rsa_len = sizeof (vcl_test_crt_rsa); char vcl_test_key_rsa[] = "-----BEGIN PRIVATE KEY-----\r\n" "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDgLWTxrUO5K2CC\r\n" "CpPijT18/2wnZ0LnhvGFL9eTZUR9ohnbbZZKjhf+zJFV9XL1hqFykjXMn9EPFplI\r\n" "WGAD6c9kGsUyytQuSt0A6k5WPx4MSn0m5Z07Y4NKgWcK8vFxhYFhzmQevImkRoYm\r\n" "XWwVBJ6yfMwW3L/n21rSy2TQWnyvk2EiNa9Ki8bM+joGHP5VLZx5shmHjHW3aEdo\r\n" "VyCbSomgnoNx5F5YJbzD7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FX3lRfAAQKBgGQt\r\n" "K5i7IhCFDjb/+3IPLgOAK7mZvsvZ4eXD33TQ2eZgtut1PXtBtNl17/b85uv293Fm\r\n" "VDISVcsk3eLNS8zIiT6afUoWlxAwXEs0v5WRfjl4radkGvgGiJpJYvyeM67877RB\r\n" "EDSKc/X8ESLfOB44iGvZUEMG6zJFscx9DgN25iQZAoGAbyd+JEWwdVH9/K3IH1t2\r\n" "PBkZX17kNWv+iVM1WyFjbe++vfKZCrOJiyiqhDeEqgrP3AuNMlaaduC3VRC3G5oV\r\n" "Mj1tlhDWQ/qhvKdCKNdIVQYDE75nw+FRWV8yYkHAnXYW3tNoweDIwixE0hkPR1bc\r\n" "oEjPLVNtx8SOj/M4rhaPT3I=\r\n" "-----END PRIVATE KEY-----\r\n"; uint32_t vcl_test_key_rsa_len = sizeof (vcl_test_key_rsa); static inline void vcl_test_stats_accumulate (vcl_test_stats_t * accum, vcl_test_stats_t * incr) { accum->rx_xacts += incr->rx_xacts; accum->rx_bytes += incr->rx_bytes; accum->rx_eagain += incr->rx_eagain; accum->rx_incomp += incr->rx_incomp; accum->tx_xacts += incr->tx_xacts; accum->tx_bytes += incr->tx_bytes; accum->tx_eagain += incr->tx_eagain; accum->tx_incomp += incr->tx_incomp; } static inline void vcl_test_cfg_init (vcl_test_cfg_t * cfg) { cfg->magic = VCL_TEST_CFG_CTRL_MAGIC; cfg->test = VCL_TEST_TYPE_NONE; cfg->ctrl_handle = ~0; cfg->num_test_sessions = 1; cfg->verbose = 0; cfg->rxbuf_size = VCL_TEST_CFG_RXBUF_SIZE_DEF; cfg->num_writes = VCL_TEST_CFG_NUM_WRITES_DEF; cfg->txbuf_size = VCL_TEST_CFG_TXBUF_SIZE_DEF; cfg->total_bytes = cfg->num_writes * cfg->txbuf_size; } static inline int vcl_test_cfg_verify (vcl_test_cfg_t * cfg, vcl_test_cfg_t * valid_cfg) { /* Note: txbuf & rxbuf on server are the same buffer, * so txbuf_size is not included in this check. */ return ((cfg->magic == valid_cfg->magic) && (cfg->test == valid_cfg->test) && (cfg->verbose == valid_cfg->verbose) && (cfg->rxbuf_size == valid_cfg->rxbuf_size) && (cfg->num_writes == valid_cfg->num_writes) && (cfg->total_bytes == valid_cfg->total_bytes)); } static inline void vcl_test_buf_alloc (vcl_test_cfg_t * cfg, uint8_t is_rxbuf, uint8_t ** buf, uint32_t * bufsize) { uint32_t alloc_size = is_rxbuf ? cfg->rxbuf_size : cfg->txbuf_size; uint8_t *lb = realloc (*buf, (size_t) alloc_size); if (lb) { if (is_rxbuf) cfg->rxbuf_size = *bufsize = alloc_size; else cfg->txbuf_size = *bufsize = alloc_size; *buf = lb; } else { vtwrn ("realloc failed. using buffer size %d instead of %u", *bufsize, alloc_size); } } static inline void vcl_test_session_buf_alloc (vcl_test_session_t * socket) { socket->rxbuf_size = socket->cfg.rxbuf_size; socket->txbuf_size = socket->cfg.txbuf_size; vcl_test_buf_alloc (&socket->cfg, 0 /* is_rxbuf */ , (uint8_t **) & socket->txbuf, &socket->txbuf_size); vcl_test_buf_alloc (&socket->cfg, 1 /* is_rxbuf */ , (uint8_t **) & socket->rxbuf, &socket->rxbuf_size); } static inline char * vcl_test_type_str (vcl_test_t t) { switch (t) { case VCL_TEST_TYPE_NONE: return "NONE"; case VCL_TEST_TYPE_ECHO: return "ECHO"; case VCL_TEST_TYPE_UNI: return "UNI"; case VCL_TEST_TYPE_BI: return "BI"; case VCL_TEST_TYPE_EXIT: return "EXIT"; default: return "Unknown"; } } static inline void vcl_test_cfg_dump (vcl_test_cfg_t * cfg, uint8_t is_client) { char *spc = " "; printf (" test config (%p):\n" VCL_TEST_SEPARATOR_STRING " magic: 0x%08x\n" " seq_num: 0x%08x\n" "%-5s test: %s (%d)\n" " ctrl handle: %d (0x%x)\n" "%-5s num test sockets: %u (0x%08x)\n" "%-5s verbose: %s (%d)\n" "%-5s rxbuf size: %lu (0x%08lx)\n" "%-5s txbuf size: %lu (0x%08lx)\n" "%-5s num writes: %lu (0x%08lx)\n" " client tx bytes: %lu (0x%08lx)\n" VCL_TEST_SEPARATOR_STRING, (void *) cfg, cfg->magic, cfg->seq_num, is_client && (cfg->test == VCL_TEST_TYPE_UNI) ? "'" VCL_TEST_TOKEN_RUN_UNI "'" : is_client && (cfg->test == VCL_TEST_TYPE_BI) ? "'" VCL_TEST_TOKEN_RUN_BI "'" : spc, vcl_test_type_str (cfg->test), cfg->test, cfg->ctrl_handle, cfg->ctrl_handle, is_client ? "'" VCL_TEST_TOKEN_NUM_TEST_SESS "'" : spc, cfg->num_test_sessions, cfg->num_test_sessions, is_client ? "'" VCL_TEST_TOKEN_VERBOSE "'" : spc, cfg->verbose ? "on" : "off", cfg->verbose, is_client ? "'" VCL_TEST_TOKEN_RXBUF_SIZE "'" : spc, cfg->rxbuf_size, cfg->rxbuf_size, is_client ? "'" VCL_TEST_TOKEN_TXBUF_SIZE "'" : spc, cfg->txbuf_size, cfg->txbuf_size, is_client ? "'" VCL_TEST_TOKEN_NUM_WRITES "'" : spc, cfg->num_writes, cfg->num_writes, cfg->total_bytes, cfg->total_bytes); } static inline void vcl_test_stats_dump (char *header, vcl_test_stats_t * stats, uint8_t show_rx, uint8_t show_tx, uint8_t verbose) { struct timespec diff; double duration, rate; uint64_t total_bytes; if ((stats->stop.tv_nsec - stats->start.tv_nsec) < 0) { diff.tv_sec = stats->stop.tv_sec - stats->start.tv_sec - 1; diff.tv_nsec = stats->stop.tv_nsec - stats->start.tv_nsec + 1e9; } else { diff.tv_sec = stats->stop.tv_sec - stats->start.tv_sec; diff.tv_nsec = stats->stop.tv_nsec - stats->start.tv_nsec; } duration = (double) diff.tv_sec + (1e-9 * diff.tv_nsec); total_bytes = stats->tx_bytes + stats->rx_bytes; rate = (double) total_bytes *8 / duration / 1e9; printf ("\n%s: Streamed %lu bytes\n" " in %lf seconds (%lf Gbps %s-duplex)!\n", header, total_bytes, duration, rate, (show_rx && show_tx) ? "full" : "half"); if (show_tx) { printf (VCL_TEST_SEPARATOR_STRING " tx stats (0x%p):\n" VCL_TEST_SEPARATOR_STRING " writes: %lu (0x%08lx)\n" " tx bytes: %lu (0x%08lx)\n" " tx eagain: %u (0x%08x)\n" " tx incomplete: %u (0x%08x)\n", (void *) stats, stats->tx_xacts, stats->tx_xacts, stats->tx_bytes, stats->tx_bytes, stats->tx_eagain, stats->tx_eagain, stats->tx_incomp, stats->tx_incomp); } if (show_rx) { printf (VCL_TEST_SEPARATOR_STRING " rx stats (0x%p):\n" VCL_TEST_SEPARATOR_STRING " reads: %lu (0x%08lx)\n" " rx bytes: %lu (0x%08lx)\n" " rx eagain: %u (0x%08x)\n" " rx incomplete: %u (0x%08x)\n", (void *) stats, stats->rx_xacts, stats->rx_xacts, stats->rx_bytes, stats->rx_bytes, stats->rx_eagain, stats->rx_eagain, stats->rx_incomp, stats->rx_incomp); } if (verbose) printf (" start.tv_sec: %ld\n" " start.tv_nsec: %ld\n" " stop.tv_sec: %ld\n" " stop.tv_nsec: %ld\n", stats->start.tv_sec, stats->start.tv_nsec, stats->stop.tv_sec, stats->stop.tv_nsec); printf (VCL_TEST_SEPARATOR_STRING); } static inline int vcl_comp_tspec (struct timespec *a, struct timespec *b) { if (a->tv_sec < b->tv_sec) return -1; else if (a->tv_sec > b->tv_sec) return 1; else if (a->tv_nsec < b->tv_nsec) return -1; else if (a->tv_nsec > b->tv_nsec) return 1; else return 0; } static inline int vcl_test_read (int fd, uint8_t * buf, uint32_t nbytes, vcl_test_stats_t * stats) { int rx_bytes, errno_val; do { if (stats) stats->rx_xacts++; rx_bytes = vppcom_session_read (fd, buf, nbytes); if (rx_bytes < 0) { errno = -rx_bytes; rx_bytes = -1; } if (stats) { if ((rx_bytes == 0) || ((rx_bytes < 0) && ((errno == EAGAIN) || (errno == EWOULDBLOCK)))) stats->rx_eagain++; else if (rx_bytes < nbytes) stats->rx_incomp++; } } while ((rx_bytes == 0) || ((rx_bytes < 0) && ((errno == EAGAIN) || (errno == EWOULDBLOCK)))); if (rx_bytes < 0) { vterr ("vppcom_session_read()", -errno); } else if (stats) stats->rx_bytes += rx_bytes; return (rx_bytes); } static inline int vcl_test_read_ds (int fd, vppcom_data_segments_t ds, vcl_test_stats_t * stats) { int rx_bytes, errno_val; do { if (stats) stats->rx_xacts++; rx_bytes = vppcom_session_read_segments (fd, ds); if (rx_bytes < 0) { errno = -rx_bytes; rx_bytes = -1; } if (stats) { if ((rx_bytes == 0) || ((rx_bytes < 0) && ((errno == EAGAIN) || (errno == EWOULDBLOCK)))) stats->rx_eagain++; } } while ((rx_bytes == 0) || ((rx_bytes < 0) && ((errno == EAGAIN) || (errno == EWOULDBLOCK)))); if (rx_bytes < 0) { vterr ("vppcom_session_read()", -errno); } else if (stats) stats->rx_bytes += rx_bytes; return (rx_bytes); } static inline int vcl_test_write (int fd, uint8_t * buf, uint32_t nbytes, vcl_test_stats_t * stats, uint32_t verbose) { int tx_bytes = 0, nbytes_left = nbytes, rv; do { if (stats) stats->tx_xacts++; rv = vppcom_session_write (fd, buf, nbytes_left); if (rv < 0) { errno = -rv; rv = -1; } if (rv < 0) { if ((errno == EAGAIN) || (errno == EWOULDBLOCK)) { if (stats) stats->tx_eagain++; break; } else break; } tx_bytes += rv; if (tx_bytes != nbytes) { nbytes_left = nbytes_left - rv; if (stats) stats->tx_incomp++; } } while (tx_bytes != nbytes); if (tx_bytes < 0) { vterr ("vpcom_session_write", -errno); } else if (stats) stats->tx_bytes += tx_bytes; return (tx_bytes); } #endif /* __vcl_test_h__ */ /* * fd.io coding-style-patch-verification: ON * * Local Variables: * eval: (c-set-style "gnu") * End: */