Skip to content

Commit

Permalink
make MAX_BUF_LEN 65536
Browse files Browse the repository at this point in the history
  • Loading branch information
saubhik committed Mar 1, 2022
1 parent b1fbecf commit 7d385ad
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
3 changes: 1 addition & 2 deletions client.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ host_addr 10.10.1.2
host_netmask 255.255.255.0
host_gateway 0.0.0.0
runtime_kthreads 4
runtime_guaranteed_kthreads 4
runtime_priority lc
runtime_priority be
2 changes: 1 addition & 1 deletion runtime/net/defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include "../defs.h"

/* Maximum buffer for TX packets */
#define MAX_BUF_LEN 64000
#define MAX_BUF_LEN 65536

extern struct mempool net_tx_buf_mp;

Expand Down
5 changes: 3 additions & 2 deletions runtime/net/udp.c
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,6 @@ static void udp_tx_release_mbuf(struct mbuf *m)
ssize_t udp_write_to(udpconn_t *c, const void *buf, size_t len,
const struct netaddr *raddr)
{
// log_info("udp_write_to() with len = %ld", len);
struct netaddr addr;
ssize_t ret;
struct mbuf *m;
Expand All @@ -421,8 +420,10 @@ ssize_t udp_write_to(udpconn_t *c, const void *buf, size_t len,
sizeof(struct ip_hdr) + sizeof(struct udp_hdr);
const uint8_t pkthdrsz = hdrsz - sizeof(struct tx_net_hdr);

if (len > MAX_BUF_LEN)
if (len > MAX_BUF_LEN) {
log_info("udp_write_to: len = %zu > MAX_BUF_LEN = %d", len, MAX_BUF_LEN);
return -EMSGSIZE;
}

if (!raddr) {
if (c->e.match == TRANS_MATCH_3TUPLE)
Expand Down
3 changes: 1 addition & 2 deletions server.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ host_addr 10.10.1.1
host_netmask 255.255.255.0
host_gateway 0.0.0.0
runtime_kthreads 4
runtime_guaranteed_kthreads 4
runtime_priority lc
runtime_priority be

0 comments on commit 7d385ad

Please sign in to comment.