Skip to content

Commit f606dc2

Browse files
author
bluenet13
committed
support writev/readv socket api, fix epollout and tcp timestamp issue
1 parent 8cad872 commit f606dc2

File tree

4 files changed

+27
-1
lines changed

4 files changed

+27
-1
lines changed

ans/ans_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -936,7 +936,7 @@ int main(int argc, char **argv)
936936
printf("core mask: %x, sockets number:%d, lcore number:%d \n", ans_user_conf.lcore_mask, ans_user_conf.socket_nb, ans_user_conf.lcore_nb);
937937

938938
printf("start to init ans \n");
939-
init_conf.max_sock_conn = ans_user_conf.lcore_nb * 64 * 1024;
939+
init_conf.max_sock_conn = ans_user_conf.lcore_nb * 128 * 1024;
940940

941941
init_conf.lcore_mask = ans_user_conf.lcore_mask;
942942
for(i = 0 ; i < MAX_NB_SOCKETS; i++)

librte_ans/librte_ans.a

2.31 KB
Binary file not shown.

librte_anssock/include/anssock_intf.h

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,19 @@ ssize_t anssock_send(int sockfd, const void *buf, size_t len, int flags);
134134
*/
135135
ssize_t anssock_write(int fd, const void *buf, size_t count);
136136

137+
/**
138+
* Writes iovcnt buffers of data described by iov to the file associated with the file descriptor fd ("gather output").
139+
* Write user data via socket. This is nonblocking function, so shall check EAGAIN.
140+
*
141+
* @param
142+
* @param
143+
*
144+
* @return
145+
* On success, these calls return the number of characters sent. On error, -1 is returned, and errno is set appropriately.
146+
* If errno is EAGAIN, no buffer for sending data.
147+
*/
148+
ssize_t anssock_writev(int fd, const struct iovec *iov, int iovcnt);
149+
137150
/**
138151
* Receive user data from socket. This function is designed as nonblocking function, so shall not set socket as nonblocking and work with epoll.
139152
*
@@ -173,6 +186,19 @@ ssize_t anssock_recv(int sockfd, void *buf, size_t len, int flags);
173186
*/
174187
ssize_t anssock_read(int fd, void *buf, size_t count);
175188

189+
190+
/**
191+
* Reads iovcnt buffers from the file associated with the file descriptor fd into the buffers described by iov ("scatter input").
192+
*
193+
* @param
194+
* @param
195+
*
196+
* @return
197+
* These calls return the number of bytes received, or -1 if an error occurred. In the event of an error, errno is set to indicate the error.
198+
* If errno is EAGAIN, no data are present to be received.
199+
*/
200+
ssize_t anssock_readv(int fd, const struct iovec *iov, int iovcnt);
201+
176202
/**
177203
* Listen for connections on a socket
178204
*

librte_anssock/librte_anssock.a

-9.69 KB
Binary file not shown.

0 commit comments

Comments
 (0)