[ofa-general] [PATCH 3/3] rds-stress: fix RDS congestion monitoring

Olaf Kirch olaf.kirch at oracle.com
Wed May 7 03:53:56 PDT 2008


commit 4dacd1a8270aa226bfff157af4519fa33c820253
Author: Olaf Kirch <olaf.kirch at oracle.com>
Date:   Wed May 7 10:42:55 2008 +0200

    Fix RDS congestion monitoring
    
    The RDS congestion monitoring code tries to help applications deal with
    remote congestion more efficiently. If enabled, an application that tried
    to send to a congested port will receive a notification as soon as the
    port becomes uncongested again. For efficiency reasons, the application
    isn't given a complete 8K congestion bitmap, but a 64bit mask that
    represents the ports having changed, with port N being represented by
    (1 << (port % 64))
    
    The macro used to translate port numbers to the mask bit shifted integer
    1, not 1ULL, resulting in undefined behavior when (port % 64) >= 32
    
    Signed-off-by: Olaf Kirch <olaf.kirch at oracle.com>

diff --git a/net/ib_rds.h b/net/ib_rds.h
index cea73fc..e098036 100644
--- a/net/ib_rds.h
+++ b/net/ib_rds.h
@@ -176,7 +176,7 @@ struct rds_info_tcp_socket {
  */
 #define RDS_CONG_MONITOR_SIZE	64
 #define RDS_CONG_MONITOR_BIT(port)  (((unsigned int) port) % RDS_CONG_MONITOR_SIZE)
-#define RDS_CONG_MONITOR_MASK(port) (1 << RDS_CONG_MONITOR_BIT(port))
+#define RDS_CONG_MONITOR_MASK(port) (1ULL << RDS_CONG_MONITOR_BIT(port))
 
 /*
  * RDMA related types

-- 
Olaf Kirch  |  --- o --- Nous sommes du soleil we love when we play
okir at lst.de |    / | \   sol.dhoop.naytheet.ah kin.ir.samse.qurax



More information about the general mailing list