2008-02-05 Joel Sherrill <joel.sherrill@oarcorp.com>

* libnetworking/kern/uipc_socket2.c,
	libnetworking/netinet/tcp_usrreq.c,
	libnetworking/netinet/udp_usrreq.c,
	libnetworking/rtems/rtems_bsdnet.h, libnetworking/rtems/rtems_glue.c:
	Add configuration parameters for network stack efficiency multiplier
	and default socket buffer sizes. Change default multiplier from 8 to
	2 to match GNU/Linux. This has no impact on performance on the BSPs
	tested.
This commit is contained in:
Joel Sherrill
2008-02-05 22:29:19 +00:00
parent 068d7aa7f1
commit 5c62b53a64
6 changed files with 93 additions and 0 deletions

View File

@@ -1,3 +1,14 @@
2008-02-05 Joel Sherrill <joel.sherrill@oarcorp.com>
* libnetworking/kern/uipc_socket2.c,
libnetworking/netinet/tcp_usrreq.c,
libnetworking/netinet/udp_usrreq.c,
libnetworking/rtems/rtems_bsdnet.h, libnetworking/rtems/rtems_glue.c:
Add configuration parameters for network stack efficiency multiplier
and default socket buffer sizes. Change default multiplier from 8 to
2 to match GNU/Linux. This has no impact on performance on the BSPs
tested.
2008-02-04 Jennifer Averett <jennifer.averett@OARcorp.com> 2008-02-04 Jennifer Averett <jennifer.averett@OARcorp.com>
* rtems/Makefile.am, rtems/include/rtems/rtems/support.h: Added * rtems/Makefile.am, rtems/include/rtems/rtems/support.h: Added

View File

@@ -65,6 +65,15 @@ static u_long sb_efficiency = 8; /* parameter for sbreserve() */
SYSCTL_INT(_kern, OID_AUTO, sockbuf_waste_factor, CTLFLAG_RW, &sb_efficiency, SYSCTL_INT(_kern, OID_AUTO, sockbuf_waste_factor, CTLFLAG_RW, &sb_efficiency,
0, ""); 0, "");
#if defined(__rtems__)
void rtems_set_sb_efficiency(
u_long efficiency
)
{
sb_efficiency = (efficiency == 0) ? 2 : efficiency;
}
#endif
/* /*
* Procedures to manipulate state flags of socket * Procedures to manipulate state flags of socket
* and do appropriate wakeups. Normal sequence from the * and do appropriate wakeups. Normal sequence from the

View File

@@ -730,6 +730,19 @@ u_long tcp_recvspace = 1024*16;
SYSCTL_INT(_net_inet_tcp, TCPCTL_RECVSPACE, recvspace, SYSCTL_INT(_net_inet_tcp, TCPCTL_RECVSPACE, recvspace,
CTLFLAG_RW, &tcp_recvspace , 0, ""); CTLFLAG_RW, &tcp_recvspace , 0, "");
#if defined(__rtems__)
void rtems_set_tcp_buffer_sizes(
u_long sendspace,
u_long recvspace
)
{
if ( sendspace != 0 )
tcp_sendspace = sendspace;
if ( recvspace != 0 )
tcp_recvspace = recvspace;
}
#endif
/* /*
* Attach TCP protocol to socket, allocating * Attach TCP protocol to socket, allocating
* internet protocol control block, tcp control block, * internet protocol control block, tcp control block,

View File

@@ -579,6 +579,19 @@ static u_long udp_recvspace = 40 * (1024 + sizeof(struct sockaddr_in));
SYSCTL_INT(_net_inet_udp, UDPCTL_RECVSPACE, recvspace, CTLFLAG_RW, SYSCTL_INT(_net_inet_udp, UDPCTL_RECVSPACE, recvspace, CTLFLAG_RW,
&udp_recvspace, 0, ""); &udp_recvspace, 0, "");
#if defined(__rtems__)
void rtems_set_udp_buffer_sizes(
u_long sendspace,
u_long recvspace
)
{
if ( sendspace != 0 )
udp_sendspace = sendspace;
if ( recvspace != 0 )
udp_recvspace = recvspace;
}
#endif
/*ARGSUSED*/ /*ARGSUSED*/
int int
udp_usrreq(so, req, m, addr, control) udp_usrreq(so, req, m, addr, control)

View File

@@ -154,6 +154,38 @@ struct rtems_bsdnet_config {
char *log_host; /* BOOTP */ char *log_host; /* BOOTP */
char *name_server[3]; /* BOOTP */ char *name_server[3]; /* BOOTP */
char *ntp_server[3]; /* BOOTP */ char *ntp_server[3]; /* BOOTP */
/*
* Default "multiplier" on buffer size. This is
* claimed by the TCP/IP implementation to be for
* efficiency but you will have to measure the
* benefit for buffering beyond double buffering
* in your own application.
*
* The default value is 2.
*
* See kern/uipc_socket2.c for details.
*/
unsigned long sb_efficiency;
/*
* Default UDP buffer sizes PER SOCKET!!
*
* TX = 9216 -- max datagram size
* RX = 40 * (1024 + sizeof(struct sockaddr_in))
*
* See netinet/udp_usrreq.c for details
*/
unsigned long udp_tx_buf_size;
unsigned long udp_rx_buf_size;
/*
* Default UDP buffer sizes PER SOCKET!!
*
* TX = 16 * 1024
* RX = 16 * 1024
*
* See netinet/tcp_usrreq.c for details
*/
unsigned long tcp_tx_buf_size;
unsigned long tcp_rx_buf_size;
}; };
/* /*

View File

@@ -221,6 +221,9 @@ static int
rtems_bsdnet_initialize (void) rtems_bsdnet_initialize (void)
{ {
rtems_status_code sc; rtems_status_code sc;
extern void rtems_set_udp_buffer_sizes( u_long, u_long );
extern void rtems_set_tcp_buffer_sizes( u_long, u_long );
extern void rtems_set_sb_efficiency( u_long );
/* /*
* Set the priority of all network tasks * Set the priority of all network tasks
@@ -238,6 +241,18 @@ rtems_bsdnet_initialize (void)
if (rtems_bsdnet_config.mbuf_cluster_bytecount) if (rtems_bsdnet_config.mbuf_cluster_bytecount)
nmbclusters = rtems_bsdnet_config.mbuf_cluster_bytecount / MCLBYTES; nmbclusters = rtems_bsdnet_config.mbuf_cluster_bytecount / MCLBYTES;
rtems_set_udp_buffer_sizes(
rtems_bsdnet_config.udp_tx_buf_size,
rtems_bsdnet_config.udp_rx_buf_size
);
rtems_set_tcp_buffer_sizes(
rtems_bsdnet_config.tcp_tx_buf_size,
rtems_bsdnet_config.tcp_rx_buf_size
);
rtems_set_sb_efficiency( rtems_bsdnet_config.sb_efficiency );
/* /*
* Create the task-synchronization semaphore * Create the task-synchronization semaphore
*/ */