X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Fvhost%2Fvhost_user.h;h=c946cc2ef4829c76a384dfa91cfcfe648545d232;hb=a2dfcd1ff609f5a4fd3b65774618a35c5c9f73c6;hp=16fe03f8891cc7aa6e9e2594baa58c698ab3be0d;hpb=99a2dd955fba6e4cc23b77d590a033650ced9c45;p=dpdk.git diff --git a/lib/vhost/vhost_user.h b/lib/vhost/vhost_user.h index 16fe03f889..c946cc2ef4 100644 --- a/lib/vhost/vhost_user.h +++ b/lib/vhost/vhost_user.h @@ -149,9 +149,17 @@ typedef struct VhostUserMsg { VhostUserVringArea area; VhostUserInflight inflight; } payload; + /* Nothing should be added after the payload */ +} __rte_packed VhostUserMsg; + +/* Note: this structure and VhostUserMsg can't be changed carelessly as + * external message handlers rely on them. + */ +struct __rte_packed vhu_msg_context { + VhostUserMsg msg; int fds[VHOST_MEMORY_MAX_NREGIONS]; int fd_num; -} __rte_packed VhostUserMsg; +}; #define VHOST_USER_HDR_SIZE offsetof(VhostUserMsg, payload.u64) @@ -164,8 +172,8 @@ int vhost_user_msg_handler(int vid, int fd); int vhost_user_iotlb_miss(struct virtio_net *dev, uint64_t iova, uint8_t perm); /* socket.c */ -int read_fd_message(int sockfd, char *buf, int buflen, int *fds, int max_fds, +int read_fd_message(char *ifname, int sockfd, char *buf, int buflen, int *fds, int max_fds, int *fd_num); -int send_fd_message(int sockfd, char *buf, int buflen, int *fds, int fd_num); +int send_fd_message(char *ifname, int sockfd, char *buf, int buflen, int *fds, int fd_num); #endif