Commit 1635bb54 authored by Zhu Yanjun's avatar Zhu Yanjun Committed by David S. Miller

net: rds: use memset to optimize the recv

The function rds_inc_init is in recv process. To use memset can optimize
the function rds_inc_init.
The test result:

     Before:
     1) + 24.950 us   |        rds_inc_init [rds]();
     After:
     1) + 10.990 us   |        rds_inc_init [rds]();
Acked-by: default avatarSantosh Shilimkar <santosh.shilimkar@oracle.com>
Signed-off-by: default avatarZhu Yanjun <yanjun.zhu@oracle.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0185e2e6
...@@ -43,8 +43,6 @@ ...@@ -43,8 +43,6 @@
void rds_inc_init(struct rds_incoming *inc, struct rds_connection *conn, void rds_inc_init(struct rds_incoming *inc, struct rds_connection *conn,
struct in6_addr *saddr) struct in6_addr *saddr)
{ {
int i;
refcount_set(&inc->i_refcount, 1); refcount_set(&inc->i_refcount, 1);
INIT_LIST_HEAD(&inc->i_item); INIT_LIST_HEAD(&inc->i_item);
inc->i_conn = conn; inc->i_conn = conn;
...@@ -52,8 +50,7 @@ void rds_inc_init(struct rds_incoming *inc, struct rds_connection *conn, ...@@ -52,8 +50,7 @@ void rds_inc_init(struct rds_incoming *inc, struct rds_connection *conn,
inc->i_rdma_cookie = 0; inc->i_rdma_cookie = 0;
inc->i_rx_tstamp = ktime_set(0, 0); inc->i_rx_tstamp = ktime_set(0, 0);
for (i = 0; i < RDS_RX_MAX_TRACES; i++) memset(inc->i_rx_lat_trace, 0, sizeof(inc->i_rx_lat_trace));
inc->i_rx_lat_trace[i] = 0;
} }
EXPORT_SYMBOL_GPL(rds_inc_init); EXPORT_SYMBOL_GPL(rds_inc_init);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment