Whamcloud - gitweb
LU-10391 socklnd: use interface index to track local addr
[fs/lustre-release.git] / lnet / klnds / socklnd / socklnd.h
index 2b37222..a6b760c 100644 (file)
@@ -108,6 +108,7 @@ struct ksock_sched {
 #define KSOCK_THREAD_SID(id)           ((id) & ((1UL << KSOCK_CPT_SHIFT) - 1))
 
 struct ksock_interface {                       /* in-use interface */
 #define KSOCK_THREAD_SID(id)           ((id) & ((1UL << KSOCK_CPT_SHIFT) - 1))
 
 struct ksock_interface {                       /* in-use interface */
+       int             ksni_index;             /* Linux interface index */
        __u32           ksni_ipaddr;            /* interface's IP address */
        __u32           ksni_netmask;           /* interface's network mask */
        int             ksni_nroutes;           /* # routes using (active) */
        __u32           ksni_ipaddr;            /* interface's IP address */
        __u32           ksni_netmask;           /* interface's network mask */
        int             ksni_nroutes;           /* # routes using (active) */
@@ -364,21 +365,23 @@ struct ksock_conn {
 };
 
 struct ksock_route {
 };
 
 struct ksock_route {
-       struct list_head   ksnr_list;           /* chain on peer_ni route list */
-       struct list_head   ksnr_connd_list;     /* chain on ksnr_connd_routes */
-       struct ksock_peer_ni *ksnr_peer;        /* owning peer_ni */
-       atomic_t           ksnr_refcount;       /* # users */
-       time64_t           ksnr_timeout;        /* when (in secs) reconnection can happen next */
-       time64_t           ksnr_retry_interval; /* how long between retries */
-        __u32                 ksnr_myipaddr;    /* my IP */
-        __u32                 ksnr_ipaddr;      /* IP address to connect to */
-        int                   ksnr_port;        /* port to connect to */
-        unsigned int          ksnr_scheduled:1; /* scheduled for attention */
-        unsigned int          ksnr_connecting:1;/* connection establishment in progress */
-        unsigned int          ksnr_connected:4; /* connections established by type */
-        unsigned int          ksnr_deleted:1;   /* been removed from peer_ni? */
-        unsigned int          ksnr_share_count; /* created explicitly? */
-        int                   ksnr_conn_count;  /* # conns established by this route */
+       struct list_head        ksnr_list;      /* chain on peer_ni route list*/
+       struct list_head        ksnr_connd_list;/* chain on ksnr_connd_routes */
+       struct ksock_peer_ni   *ksnr_peer;      /* owning peer_ni */
+       atomic_t                ksnr_refcount;  /* # users */
+       time64_t                ksnr_timeout;   /* when (in secs) reconnection
+                                                * can happen next
+                                                */
+       time64_t                ksnr_retry_interval;/* secs between retries */
+       int                     ksnr_myiface;   /* interface index */
+       __u32                   ksnr_ipaddr;    /* IP address to connect to */
+       int                     ksnr_port;      /* port to connect to */
+       unsigned int            ksnr_scheduled:1;/* scheduled for attention */
+       unsigned int            ksnr_connecting:1;/* connection in progress */
+       unsigned int            ksnr_connected:4;/* connections by type */
+       unsigned int            ksnr_deleted:1; /* been removed from peer_ni? */
+       unsigned int            ksnr_share_count;/* created explicitly? */
+       int                     ksnr_conn_count;/* # conns for this route */
 };
 
 #define SOCKNAL_KEEPALIVE_PING          1       /* cookie for keepalive ping */
 };
 
 #define SOCKNAL_KEEPALIVE_PING          1       /* cookie for keepalive ping */