From 3fbdcdb0321bbd42377a54948cbb4aecc658a4c8 Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Wed, 3 May 2017 13:59:35 -0400 Subject: [PATCH] EPICS_CA_AUTO_MAX_ARRAY_BYTES -> EPICS_CA_AUTO_ARRAY_BYTES --- configure/CONFIG_ENV | 2 +- documentation/RELEASE_NOTES.html | 19 +++++++++++-------- src/ca/client/CAref.html | 10 ++++++++++ src/ca/client/cac.cpp | 8 ++++---- src/ioc/rsrv/caservertask.c | 8 ++++---- src/libCom/env/envDefs.h | 2 +- 6 files changed, 31 insertions(+), 18 deletions(-) diff --git a/configure/CONFIG_ENV b/configure/CONFIG_ENV index 39f3a05d6..1565b2ec9 100644 --- a/configure/CONFIG_ENV +++ b/configure/CONFIG_ENV @@ -35,7 +35,7 @@ EPICS_CA_CONN_TMO=30.0 EPICS_CA_REPEATER_PORT=5065 EPICS_CA_SERVER_PORT=5064 EPICS_CA_MAX_ARRAY_BYTES=16384 -EPICS_CA_AUTO_MAX_ARRAY_BYTES=NO +EPICS_CA_AUTO_ARRAY_BYTES=YES EPICS_CA_BEACON_PERIOD=15.0 EPICS_CA_MAX_SEARCH_PERIOD=300.0 EPICS_CA_MCAST_TTL=1 diff --git a/documentation/RELEASE_NOTES.html b/documentation/RELEASE_NOTES.html index e59b86559..0c69d60ad 100644 --- a/documentation/RELEASE_NOTES.html +++ b/documentation/RELEASE_NOTES.html @@ -29,14 +29,17 @@ CA search or beacon packets sent.

EPICS_CA_MAX_ARRAY_BYTES is optional

-With this change libca, RSRV, and PCAS no longer need to use EPICS_CA_MAX_ARRAY_BYTES -to set a maximum allocation size. -The large array free-list is replaced with individual allocations -when a send/receiver buffer larger than 16KB is needed. -Add new configuration parameter EPICS_CA_AUTO_MAX_ARRAY_BYTES which defaults to NO. -libca and RSRV respect EPICS_CA_AUTO_MAX_ARRAY_BYTES=YES. -PCAS ignores EPICS_CA_AUTO_MAX_ARRAY_BYTES=YES, and thus now ignores EPICS_CA_MAX_ARRAY_BYTES entirely. -

+A new configuration environment variable EPICS_CA_AUTO_ARRAY_BYTES is used by libca and RSRV +(CA clients and IOC CA server). +The default EPICS_CA_AUTO_ARRAY_BYTES=YES removes the limitation of EPICS_CA_MAX_ARRAY_BYTES +and always attempts to allocate sufficient for a request. +The value of EPICS_CA_MAX_ARRAY_BYTES is ignored. + +

Explicitly setting EPICS_CA_AUTO_ARRAY_BYTES=NO continues to honor EPICS_CA_AUTO_ARRAY_BYTES +as in previous releases.

+ +

The PCAS server (used by cagateway) now always acts as if EPICS_CA_AUTO_ARRAY_BYTES=YES were +set.

Channel Access "modernization"

diff --git a/src/ca/client/CAref.html b/src/ca/client/CAref.html index 2bdd0b452..46a0fc9e5 100644 --- a/src/ca/client/CAref.html +++ b/src/ca/client/CAref.html @@ -314,6 +314,11 @@ is used.

i >= 16384 16384 + + EPICS_CA_AUTO_ARRAY_BYTES + i >= YES + YES + EPICS_CA_MAX_SEARCH_PERIOD r > 60 seconds @@ -754,6 +759,11 @@ buffers that are used for ordinary communication. If EPICS_CA_MAX_ARRAY_BYTES is larger than 16384 then a second free list of larger data buffers is established and used only after a client send its first large array request.

+

Beginning with R3.16.1, EPICS_CA_AUTO_ARRAY_BYTES=YES (the default) will ignore +EPICS_CA_MAX_ARRAY_BYTES and attempt to allocate sufficient buffer space +as needed. Setting EPICS_CA_AUTO_ARRAY_BYTES=NO will continue to respect +EPICS_CA_MAX_ARRAY_BYTES.

+

The CA client library uses EPICS_CA_MAX_ARRAY_BYTES to determines the maximum array that it will send or receive. Likewise, the CA server uses EPICS_CA_MAX_ARRAY_BYTES to determine the maximum array that it may send or diff --git a/src/ca/client/cac.cpp b/src/ca/client/cac.cpp index f1d7f0903..a7430e406 100644 --- a/src/ca/client/cac.cpp +++ b/src/ca/client/cac.cpp @@ -219,11 +219,11 @@ cac::cac ( throw std::bad_alloc (); } - int caLimitArray; - if(envGetBoolConfigParam(&EPICS_CA_AUTO_MAX_ARRAY_BYTES, &caLimitArray)) - caLimitArray = 0; + int autoMaxBytes; + if(envGetBoolConfigParam(&EPICS_CA_AUTO_ARRAY_BYTES, &autoMaxBytes)) + autoMaxBytes = 1; - if(caLimitArray) { + if(!autoMaxBytes) { freeListInitPvt ( &this->tcpLargeRecvBufFreeList, this->maxRecvBytesTCP, 1 ); if ( ! this->tcpLargeRecvBufFreeList ) { throw std::bad_alloc (); diff --git a/src/ioc/rsrv/caservertask.c b/src/ioc/rsrv/caservertask.c index 8beb1fae2..83a19f510 100644 --- a/src/ioc/rsrv/caservertask.c +++ b/src/ioc/rsrv/caservertask.c @@ -485,7 +485,7 @@ int rsrv_init (void) long maxBytesAsALong; long status; SOCKET *socks; - int caLimitArray; + int autoMaxBytes; clientQlock = epicsMutexMustCreate(); @@ -545,10 +545,10 @@ int rsrv_init (void) } } - if(envGetBoolConfigParam(&EPICS_CA_AUTO_MAX_ARRAY_BYTES, &caLimitArray)) - caLimitArray = 0; + if(envGetBoolConfigParam(&EPICS_CA_AUTO_ARRAY_BYTES, &autoMaxBytes)) + autoMaxBytes = 1; - if (caLimitArray) + if (!autoMaxBytes) freeListInitPvt ( &rsrvLargeBufFreeListTCP, rsrvSizeofLargeBufTCP, 1 ); else rsrvLargeBufFreeListTCP = NULL; diff --git a/src/libCom/env/envDefs.h b/src/libCom/env/envDefs.h index 2d213cc7b..650f8ee58 100644 --- a/src/libCom/env/envDefs.h +++ b/src/libCom/env/envDefs.h @@ -48,7 +48,7 @@ epicsShareExtern const ENV_PARAM EPICS_CA_AUTO_ADDR_LIST; epicsShareExtern const ENV_PARAM EPICS_CA_REPEATER_PORT; epicsShareExtern const ENV_PARAM EPICS_CA_SERVER_PORT; epicsShareExtern const ENV_PARAM EPICS_CA_MAX_ARRAY_BYTES; -epicsShareExtern const ENV_PARAM EPICS_CA_AUTO_MAX_ARRAY_BYTES; +epicsShareExtern const ENV_PARAM EPICS_CA_AUTO_ARRAY_BYTES; epicsShareExtern const ENV_PARAM EPICS_CA_MAX_SEARCH_PERIOD; epicsShareExtern const ENV_PARAM EPICS_CA_NAME_SERVERS; epicsShareExtern const ENV_PARAM EPICS_CA_MCAST_TTL;