| 796 | } |
| 797 | |
| 798 | static int |
| 799 | check_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 | |
| 838 | int |
| 839 | rte_mp_sendmsg(struct rte_mp_msg *msg) |
no test coverage detected