MCPcopy Create free account
hub / github.com/F-Stack/f-stack / check_input

Function check_input

dpdk/lib/eal/common/eal_common_proc.c:798–836  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

796}
797
798static int
799check_input(const struct rte_mp_msg *msg)
800{
801 if (msg == NULL) {
802 RTE_LOG(ERR, EAL, "Msg cannot be NULL\n");
803 rte_errno = EINVAL;
804 return -1;
805 }
806
807 if (validate_action_name(msg->name) != 0)
808 return -1;
809
810 if (msg->len_param < 0) {
811 RTE_LOG(ERR, EAL, "Message data length is negative\n");
812 rte_errno = EINVAL;
813 return -1;
814 }
815
816 if (msg->num_fds < 0) {
817 RTE_LOG(ERR, EAL, "Number of fd's is negative\n");
818 rte_errno = EINVAL;
819 return -1;
820 }
821
822 if (msg->len_param > RTE_MP_MAX_PARAM_LEN) {
823 RTE_LOG(ERR, EAL, "Message data is too long\n");
824 rte_errno = E2BIG;
825 return -1;
826 }
827
828 if (msg->num_fds > RTE_MP_MAX_FD_NUM) {
829 RTE_LOG(ERR, EAL, "Cannot send more than %d FDs\n",
830 RTE_MP_MAX_FD_NUM);
831 rte_errno = E2BIG;
832 return -1;
833 }
834
835 return 0;
836}
837
838int
839rte_mp_sendmsg(struct rte_mp_msg *msg)

Callers 4

rte_mp_sendmsgFunction · 0.70
rte_mp_request_syncFunction · 0.70
rte_mp_request_asyncFunction · 0.70
rte_mp_replyFunction · 0.70

Calls 1

validate_action_nameFunction · 0.85

Tested by

no test coverage detected