diff options
author | santosh.shilimkar@oracle.com <santosh.shilimkar@oracle.com> | 2015-08-22 15:45:25 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-08-25 13:35:29 -0700 |
commit | e1f475a738e4c861d8aff84b737a0538680cbe05 (patch) | |
tree | 68b9d4a40628c1e3e9e89d51ee489ef35b6a3264 | |
parent | 1bc7b863f230e429dd7a06c0956ada7933d69f50 (diff) | |
download | op-kernel-dev-e1f475a738e4c861d8aff84b737a0538680cbe05.zip op-kernel-dev-e1f475a738e4c861d8aff84b737a0538680cbe05.tar.gz |
RDS: don't update ip address tables if the address hasn't changed
If the ip address tables hasn't changed, there is no need to remove
them only to be added back again.
Lets fix it.
Reviewed-by: Ajaykumar Hotchandani <ajaykumar.hotchandani@oracle.com>
Signed-off-by: Santosh Shilimkar <ssantosh@kernel.org>
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/rds/ib_rdma.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/net/rds/ib_rdma.c b/net/rds/ib_rdma.c index 657ba9f..e49c956 100644 --- a/net/rds/ib_rdma.c +++ b/net/rds/ib_rdma.c @@ -151,12 +151,17 @@ int rds_ib_update_ipaddr(struct rds_ib_device *rds_ibdev, __be32 ipaddr) struct rds_ib_device *rds_ibdev_old; rds_ibdev_old = rds_ib_get_device(ipaddr); - if (rds_ibdev_old) { + if (!rds_ibdev_old) + return rds_ib_add_ipaddr(rds_ibdev, ipaddr); + + if (rds_ibdev_old != rds_ibdev) { rds_ib_remove_ipaddr(rds_ibdev_old, ipaddr); rds_ib_dev_put(rds_ibdev_old); + return rds_ib_add_ipaddr(rds_ibdev, ipaddr); } + rds_ib_dev_put(rds_ibdev_old); - return rds_ib_add_ipaddr(rds_ibdev, ipaddr); + return 0; } void rds_ib_add_conn(struct rds_ib_device *rds_ibdev, struct rds_connection *conn) |