rxr: udp socket size max of INT_MAX/2 (#191)

This commit is contained in:
Dhanya Thattil
2020-09-25 10:15:39 +02:00
committed by GitHub
parent f950e32893
commit fe81963873
13 changed files with 74 additions and 61 deletions

View File

@ -717,17 +717,17 @@ class Detector {
/** Default: padding enabled. Disabling padding is the fastest */
void setPartialFramesPadding(bool value, Positions pos = {});
Result<int64_t> getRxUDPSocketBufferSize(Positions pos = {}) const;
Result<int> getRxUDPSocketBufferSize(Positions pos = {}) const;
/** UDP socket buffer size in receiver. Tune rmem_default and rmem_max
* accordingly */
void setRxUDPSocketBufferSize(int64_t udpsockbufsize, Positions pos = {});
* accordingly. Max value is INT_MAX/2. */
void setRxUDPSocketBufferSize(int udpsockbufsize, Positions pos = {});
/** TODO:
* Gets actual udp socket buffer size. Double the size of rx_udpsocksize due
* to kernel bookkeeping.
*/
Result<int64_t> getRxRealUDPSocketBufferSize(Positions pos = {}) const;
Result<int> getRxRealUDPSocketBufferSize(Positions pos = {}) const;
Result<bool> getRxLock(Positions pos = {});

View File

@ -1568,9 +1568,9 @@ class CmdProxy {
INTEGER_COMMAND_VEC_ID(
rx_udpsocksize, getRxUDPSocketBufferSize, setRxUDPSocketBufferSize,
StringTo<int64_t>,
StringTo<int>,
"[n_size]\n\tUDP socket buffer size in receiver. Tune rmem_default and "
"rmem_max accordingly.");
"rmem_max accordingly. Max value is INT_MAX/2.");
GET_COMMAND(rx_realudpsocksize, getRxRealUDPSocketBufferSize,
"\n\tActual udp socket buffer size. Double the size of "

View File

@ -907,16 +907,16 @@ void Detector::setPartialFramesPadding(bool value, Positions pos) {
pimpl->Parallel(&Module::setPartialFramesPadding, pos, value);
}
Result<int64_t> Detector::getRxUDPSocketBufferSize(Positions pos) const {
Result<int> Detector::getRxUDPSocketBufferSize(Positions pos) const {
return pimpl->Parallel(&Module::getReceiverUDPSocketBufferSize, pos);
}
void Detector::setRxUDPSocketBufferSize(int64_t udpsockbufsize, Positions pos) {
void Detector::setRxUDPSocketBufferSize(int udpsockbufsize, Positions pos) {
pimpl->Parallel(&Module::setReceiverUDPSocketBufferSize, pos,
udpsockbufsize);
}
Result<int64_t> Detector::getRxRealUDPSocketBufferSize(Positions pos) const {
Result<int> Detector::getRxRealUDPSocketBufferSize(Positions pos) const {
return pimpl->Parallel(&Module::getReceiverRealUDPSocketBufferSize, pos);
}

View File

@ -844,17 +844,17 @@ void Module::setPartialFramesPadding(bool padding) {
sendToReceiver(F_SET_RECEIVER_PADDING, static_cast<int>(padding), nullptr);
}
int64_t Module::getReceiverUDPSocketBufferSize() const {
int64_t arg = GET_FLAG;
return sendToReceiver<int64_t>(F_RECEIVER_UDP_SOCK_BUF_SIZE, arg);
int Module::getReceiverUDPSocketBufferSize() const {
int arg = GET_FLAG;
return sendToReceiver<int>(F_RECEIVER_UDP_SOCK_BUF_SIZE, arg);
}
int64_t Module::getReceiverRealUDPSocketBufferSize() const {
return sendToReceiver<int64_t>(F_RECEIVER_REAL_UDP_SOCK_BUF_SIZE);
int Module::getReceiverRealUDPSocketBufferSize() const {
return sendToReceiver<int>(F_RECEIVER_REAL_UDP_SOCK_BUF_SIZE);
}
void Module::setReceiverUDPSocketBufferSize(int64_t udpsockbufsize) {
sendToReceiver<int64_t>(F_RECEIVER_UDP_SOCK_BUF_SIZE, udpsockbufsize);
void Module::setReceiverUDPSocketBufferSize(int udpsockbufsize) {
sendToReceiver<int>(F_RECEIVER_UDP_SOCK_BUF_SIZE, udpsockbufsize);
}
bool Module::getReceiverLock() const {

View File

@ -236,9 +236,9 @@ class Module : public virtual slsDetectorDefs {
void setReceiverFramesDiscardPolicy(frameDiscardPolicy f);
bool getPartialFramesPadding() const;
void setPartialFramesPadding(bool padding);
int64_t getReceiverUDPSocketBufferSize() const;
int64_t getReceiverRealUDPSocketBufferSize() const;
void setReceiverUDPSocketBufferSize(int64_t udpsockbufsize);
int getReceiverUDPSocketBufferSize() const;
int getReceiverRealUDPSocketBufferSize() const;
void setReceiverUDPSocketBufferSize(int udpsockbufsize);
bool getReceiverLock() const;
void setReceiverLock(bool lock);
sls::IpAddr getReceiverLastClientIP() const;