Skip to content

Commit

Permalink
lib: mgmtd: increase soft-max msg size to 64K
Browse files Browse the repository at this point in the history
- remove unused mgmt client/server constants

Signed-off-by: Christian Hopps <[email protected]>
  • Loading branch information
choppsv1 committed Dec 30, 2023
1 parent 1a7b50a commit 39e0f33
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 38 deletions.
2 changes: 1 addition & 1 deletion lib/mgmt_be_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -1060,7 +1060,7 @@ struct mgmt_be_client *mgmt_be_client_create(const char *client_name,
mgmt_be_client_notify_conenct,
mgmt_be_client_notify_disconenct,
mgmt_be_client_process_msg, MGMTD_BE_MAX_NUM_MSG_PROC,
MGMTD_BE_MAX_NUM_MSG_WRITE, MGMTD_BE_MSG_MAX_LEN, false,
MGMTD_BE_MAX_NUM_MSG_WRITE, MGMTD_BE_MAX_MSG_LEN, false,
"BE-client", MGMTD_DBG_BE_CLIENT_CHECK());

MGMTD_BE_CLIENT_DBG("Initialized client '%s'", client_name);
Expand Down
29 changes: 8 additions & 21 deletions lib/mgmt_be_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,12 @@ extern "C" {
* Constants
***************************************************************/

#define MGMTD_BE_CLIENT_ERROR_STRING_MAX_LEN 32

#define MGMTD_BE_DEFAULT_CONN_RETRY_INTVL_SEC 5

#define MGMTD_BE_MSG_PROC_DELAY_USEC 10
#define MGMTD_BE_MAX_NUM_MSG_PROC 500

#define MGMTD_BE_MSG_WRITE_DELAY_MSEC 1
#define MGMTD_BE_MAX_NUM_MSG_PROC 500
#define MGMTD_BE_MAX_NUM_MSG_WRITE 1000
#define MGMTD_BE_MAX_MSG_LEN (64 * 1024)

#define GMGD_BE_MAX_NUM_REQ_ITEMS 64

#define MGMTD_BE_MSG_MAX_LEN 16384

#define MGMTD_SOCKET_BE_SEND_BUF_SIZE 65535
#define MGMTD_SOCKET_BE_RECV_BUF_SIZE MGMTD_SOCKET_BE_SEND_BUF_SIZE

#define MGMTD_MAX_CFG_CHANGES_IN_BATCH \
((10 * MGMTD_BE_MSG_MAX_LEN) / \
#define MGMTD_MAX_CFG_CHANGES_IN_BATCH \
((10 * MGMTD_BE_MAX_MSG_LEN) / \
(MGMTD_MAX_XPATH_LEN + MGMTD_MAX_YANG_VALUE_LEN))

/*
Expand All @@ -47,11 +34,11 @@ extern "C" {
* that gets added to sent message
*/
#define MGMTD_BE_CFGDATA_PACKING_EFFICIENCY 0.8
#define MGMTD_BE_CFGDATA_MAX_MSG_LEN \
(MGMTD_BE_MSG_MAX_LEN * MGMTD_BE_CFGDATA_PACKING_EFFICIENCY)
#define MGMTD_BE_CFGDATA_MAX_MSG_LEN \
(MGMTD_BE_MAX_MSG_LEN * MGMTD_BE_CFGDATA_PACKING_EFFICIENCY)

#define MGMTD_BE_MAX_BATCH_IDS_IN_REQ \
(MGMTD_BE_MSG_MAX_LEN - 128) / sizeof(uint64_t)
#define MGMTD_BE_MAX_BATCH_IDS_IN_REQ \
(MGMTD_BE_MAX_MSG_LEN - 128) / sizeof(uint64_t)

#define MGMTD_BE_CONTAINER_NODE_VAL "<<container>>"

Expand Down
2 changes: 1 addition & 1 deletion lib/mgmt_fe_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,7 @@ struct mgmt_fe_client *mgmt_fe_client_create(const char *client_name,
mgmt_fe_client_notify_connect,
mgmt_fe_client_notify_disconnect,
mgmt_fe_client_process_msg, MGMTD_FE_MAX_NUM_MSG_PROC,
MGMTD_FE_MAX_NUM_MSG_WRITE, MGMTD_FE_MSG_MAX_LEN, true,
MGMTD_FE_MAX_NUM_MSG_WRITE, MGMTD_FE_MAX_MSG_LEN, true,
"FE-client", MGMTD_DBG_FE_CLIENT_CHECK());

MGMTD_FE_CLIENT_DBG("Initialized client '%s'", client_name);
Expand Down
15 changes: 2 additions & 13 deletions lib/mgmt_fe_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,11 @@ extern "C" {
* connections.
*/

#define MGMTD_FE_CLIENT_ERROR_STRING_MAX_LEN 32

#define MGMTD_FE_DEFAULT_CONN_RETRY_INTVL_SEC 5

#define MGMTD_FE_MSG_PROC_DELAY_USEC 10
#define MGMTD_FE_MAX_NUM_MSG_PROC 500

#define MGMTD_FE_MSG_WRITE_DELAY_MSEC 1
#define MGMTD_FE_MAX_NUM_MSG_PROC 500
#define MGMTD_FE_MAX_NUM_MSG_WRITE 100

#define GMGD_FE_MAX_NUM_REQ_ITEMS 64

#define MGMTD_FE_MSG_MAX_LEN 9000

#define MGMTD_SOCKET_FE_SEND_BUF_SIZE 65535
#define MGMTD_SOCKET_FE_RECV_BUF_SIZE MGMTD_SOCKET_FE_SEND_BUF_SIZE
#define MGMTD_FE_MAX_MSG_LEN (64 * 1024)

/***************************************************************
* Data-structures
Expand Down
2 changes: 1 addition & 1 deletion mgmtd/mgmt_be_adapter.c
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@ struct msg_conn *mgmt_be_create_adapter(int conn_fd, union sockunion *from)
mgmt_be_adapter_process_msg,
MGMTD_BE_MAX_NUM_MSG_PROC,
MGMTD_BE_MAX_NUM_MSG_WRITE,
MGMTD_BE_MSG_MAX_LEN, adapter,
MGMTD_BE_MAX_MSG_LEN, adapter,
"BE-adapter");

adapter->conn->debug = DEBUG_MODE_CHECK(&mgmt_debug_be, DEBUG_MODE_ALL);
Expand Down
2 changes: 1 addition & 1 deletion mgmtd/mgmt_fe_adapter.c
Original file line number Diff line number Diff line change
Expand Up @@ -1344,7 +1344,7 @@ struct msg_conn *mgmt_fe_create_adapter(int conn_fd, union sockunion *from)
adapter->conn = msg_server_conn_create(
mgmt_loop, conn_fd, mgmt_fe_adapter_notify_disconnect,
mgmt_fe_adapter_process_msg, MGMTD_FE_MAX_NUM_MSG_PROC,
MGMTD_FE_MAX_NUM_MSG_WRITE, MGMTD_FE_MSG_MAX_LEN,
MGMTD_FE_MAX_NUM_MSG_WRITE, MGMTD_FE_MAX_MSG_LEN,
adapter, "FE-adapter");

adapter->conn->debug = DEBUG_MODE_CHECK(&mgmt_debug_fe,
Expand Down

0 comments on commit 39e0f33

Please sign in to comment.