mirror of
https://github.com/EndPositive/slipstream.git
synced 2025-10-08 12:25:04 +00:00
Enable GSO
This commit is contained in:
parent
9fe5ecf667
commit
cf7bf11c59
2 changed files with 14 additions and 15 deletions
|
|
@ -808,7 +808,7 @@ int picoquic_slipstream_client(int listen_port, char const* resolver_addresses_f
|
|||
// And ensure that gso is on
|
||||
// $ ethtool -k lo | grep generic-segmentation-offload
|
||||
// generic-segmentation-offload: on
|
||||
param.do_not_use_gso = 1;
|
||||
param.do_not_use_gso = 0;
|
||||
|
||||
param.is_client = 1;
|
||||
param.decode = client_decode;
|
||||
|
|
|
|||
|
|
@ -50,14 +50,24 @@ static int udp_gso_available = 0;
|
|||
#endif
|
||||
|
||||
|
||||
int slipstream_packet_loop_(picoquic_network_thread_ctx_t* thread_ctx, picoquic_socket_ctx_t* s_ctx,
|
||||
size_t send_buffer_size, size_t send_msg_size, size_t* send_msg_ptr) {
|
||||
int slipstream_packet_loop_(picoquic_network_thread_ctx_t* thread_ctx, picoquic_socket_ctx_t* s_ctx) {
|
||||
picoquic_quic_t* quic = thread_ctx->quic;
|
||||
picoquic_packet_loop_param_t* param = thread_ctx->param;
|
||||
const picoquic_packet_loop_cb_fn loop_callback = thread_ctx->loop_callback;
|
||||
void* loop_callback_ctx = thread_ctx->loop_callback_ctx;
|
||||
slot_t slots[PICOQUIC_PACKET_LOOP_RECV_MAX] = {0};
|
||||
|
||||
size_t send_buffer_size = param->socket_buffer_size;
|
||||
size_t send_msg_size = 0;
|
||||
size_t* send_msg_ptr = NULL;
|
||||
if (udp_gso_available && !param->do_not_use_gso) {
|
||||
send_buffer_size = 0xFFFF;
|
||||
send_msg_ptr = &send_msg_size;
|
||||
}
|
||||
if (send_buffer_size == 0) {
|
||||
send_buffer_size = 0xffff;
|
||||
}
|
||||
|
||||
while (!thread_ctx->thread_should_close) {
|
||||
if (loop_callback) {
|
||||
loop_callback(quic, picoquic_packet_loop_before_select, loop_callback_ctx, s_ctx);
|
||||
|
|
@ -311,19 +321,8 @@ void* slipstream_packet_loop(picoquic_network_thread_ctx_t* thread_ctx) {
|
|||
return NULL;
|
||||
}
|
||||
|
||||
size_t send_buffer_size = param->socket_buffer_size;
|
||||
size_t send_msg_size = 0;
|
||||
size_t* send_msg_ptr = NULL;
|
||||
if (udp_gso_available && !param->do_not_use_gso) {
|
||||
send_buffer_size = 0xFFFF;
|
||||
send_msg_ptr = &send_msg_size;
|
||||
}
|
||||
if (send_buffer_size == 0) {
|
||||
send_buffer_size = 0xffff;
|
||||
}
|
||||
|
||||
thread_ctx->thread_is_ready = 1;
|
||||
thread_ctx->return_code = slipstream_packet_loop_(thread_ctx, &s_ctx, send_buffer_size, send_msg_size, send_msg_ptr);
|
||||
thread_ctx->return_code = slipstream_packet_loop_(thread_ctx, &s_ctx);
|
||||
thread_ctx->thread_is_ready = 0;
|
||||
|
||||
/* Close the sockets */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue