forked from Imagelibrary/rtems
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:
@@ -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>
|
||||
|
||||
* rtems/Makefile.am, rtems/include/rtems/rtems/support.h: Added
|
||||
|
||||
@@ -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,
|
||||
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
|
||||
* and do appropriate wakeups. Normal sequence from the
|
||||
|
||||
@@ -730,6 +730,19 @@ u_long tcp_recvspace = 1024*16;
|
||||
SYSCTL_INT(_net_inet_tcp, TCPCTL_RECVSPACE, recvspace,
|
||||
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
|
||||
* internet protocol control block, tcp control block,
|
||||
|
||||
@@ -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,
|
||||
&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*/
|
||||
int
|
||||
udp_usrreq(so, req, m, addr, control)
|
||||
|
||||
@@ -154,6 +154,38 @@ struct rtems_bsdnet_config {
|
||||
char *log_host; /* BOOTP */
|
||||
char *name_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;
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
@@ -221,6 +221,9 @@ static int
|
||||
rtems_bsdnet_initialize (void)
|
||||
{
|
||||
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
|
||||
@@ -238,6 +241,18 @@ rtems_bsdnet_initialize (void)
|
||||
if (rtems_bsdnet_config.mbuf_cluster_bytecount)
|
||||
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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user