IB/isert: set rdma cm afonly flag
authorMax Gurtovoy <mgurtovoy@nvidia.com>
Mon, 24 May 2021 08:52:25 +0000 (11:52 +0300)
committerJason Gunthorpe <jgg@nvidia.com>
Fri, 28 May 2021 23:24:52 +0000 (20:24 -0300)
This will allow both IPv4 and IPv6 sockets to bind a single port at the
same time. Same behaviour is implemented in NVMe/RDMA target.

Link: https://lore.kernel.org/r/20210524085225.29064-1-mgurtovoy@nvidia.com
Reviewed-by: Alaa Hleihel <alaa@nvidia.com>
Reviewed-by: Israel Rukshin <israelr@nvidia.com>
Signed-off-by: Max Gurtovoy <mgurtovoy@nvidia.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/ulp/isert/ib_isert.c

index 18266f0..160efef 100644 (file)
@@ -2231,6 +2231,16 @@ isert_setup_id(struct isert_np *isert_np)
        }
        isert_dbg("id %p context %p\n", id, id->context);
 
+       /*
+        * Allow both IPv4 and IPv6 sockets to bind a single port
+        * at the same time.
+        */
+       ret = rdma_set_afonly(id, 1);
+       if (ret) {
+               isert_err("rdma_set_afonly() failed: %d\n", ret);
+               goto out_id;
+       }
+
        ret = rdma_bind_addr(id, sa);
        if (ret) {
                isert_err("rdma_bind_addr() failed: %d\n", ret);