Commit 324255ed authored by Claes Sjofors's avatar Claes Sjofors

Qcom, configuration of min and max resend time

parent c0688e77
...@@ -91,6 +91,8 @@ ...@@ -91,6 +91,8 @@
#define RTT_RXMAX 10000 /* ms */ #define RTT_RXMAX 10000 /* ms */
#define RACK_TMO 1 #define RACK_TMO 1
#define max(Dragon,Eagle) ((Dragon) > (Eagle) ? (Dragon) : (Eagle))
typedef enum { typedef enum {
eAction__ = 0, eAction__ = 0,
eAction_export, eAction_export,
...@@ -981,6 +983,8 @@ get_tmo ( ...@@ -981,6 +983,8 @@ get_tmo (
link_stalled(lp); link_stalled(lp);
} else if (do_inc) { } else if (do_inc) {
lp->np->link.rtt_rto *= 2; lp->np->link.rtt_rto *= 2;
if (lp->np->link.rtt_rto > lp->np->link.rtt_rxmax)
lp->np->link.rtt_rto = lp->np->link.rtt_rxmax;
} }
return (time_tClock) (time_Clock(NULL, NULL) + rto); return (time_tClock) (time_Clock(NULL, NULL) + rto);
...@@ -1535,6 +1539,7 @@ new_link ( ...@@ -1535,6 +1539,7 @@ new_link (
sLink *lp; sLink *lp;
sEseg *sp; sEseg *sp;
static int tics_per_sec = 0; static int tics_per_sec = 0;
int rtt_rxmin, rtt_rxmax;
if (nid == qdb->my_node->nid) return NULL; if (nid == qdb->my_node->nid) return NULL;
if (nid == qdb->no_node->nid) return NULL; if (nid == qdb->no_node->nid) return NULL;
...@@ -1553,12 +1558,15 @@ new_link ( ...@@ -1553,12 +1558,15 @@ new_link (
pwr_Assert(lp->np != NULL); pwr_Assert(lp->np != NULL);
rtt_rxmin = max( RTT_RXMIN, max(lp->np->min_resend_time,qdb->my_node->min_resend_time));
rtt_rxmax = max( RTT_RXMAX, max(lp->np->max_resend_time,qdb->my_node->max_resend_time));
que_Create(NULL, &lp->q_in); que_Create(NULL, &lp->q_in);
lst_Init(NULL, &lp->lh_send, NULL); lst_Init(NULL, &lp->lh_send, NULL);
lst_Init(NULL, &lp->lh_win, NULL); lst_Init(NULL, &lp->lh_win, NULL);
lp->np->link.win_max = 1; lp->np->link.win_max = 1;
lp->np->link.rtt_rxmax = (RTT_RXMAX * tics_per_sec) / 1000; lp->np->link.rtt_rxmax = (rtt_rxmax * tics_per_sec) / 1000;
lp->np->link.rtt_rxmin = (RTT_RXMIN * tics_per_sec) / 1000; lp->np->link.rtt_rxmin = (rtt_rxmin * tics_per_sec) / 1000;
lp->tmo.c.action = eAction_tmo; lp->tmo.c.action = eAction_tmo;
if (mp != NULL) { if (mp != NULL) {
......
...@@ -675,6 +675,8 @@ typedef struct { ...@@ -675,6 +675,8 @@ typedef struct {
void *mon; /* Monitor private data. */ void *mon; /* Monitor private data. */
qcom_eNodeConnection connection; /* Type of connection */ qcom_eNodeConnection connection; /* Type of connection */
pwr_tUInt32 min_resend_time;
pwr_tUInt32 max_resend_time;
} qdb_sNode; } qdb_sNode;
typedef struct { typedef struct {
......
...@@ -69,6 +69,8 @@ addNode ( ...@@ -69,6 +69,8 @@ addNode (
memcpy(&np->arp.arp_pa.sa_data, &np->sa.sin_addr.s_addr, sizeof(np->sa.sin_addr.s_addr)); memcpy(&np->arp.arp_pa.sa_data, &np->sa.sin_addr.s_addr, sizeof(np->sa.sin_addr.s_addr));
np->connection = nep->connection; np->connection = nep->connection;
np->min_resend_time = nep->min_resend_time;
np->max_resend_time = nep->max_resend_time;
return np; return np;
} }
...@@ -125,6 +127,8 @@ qini_ParseFile ( ...@@ -125,6 +127,8 @@ qini_ParseFile (
char s_naddr[80]; char s_naddr[80];
char s_port[80]; char s_port[80];
char s_connection[80]; char s_connection[80];
char s_min_resend_time[80];
char s_max_resend_time[80];
pwr_tNodeId nid; pwr_tNodeId nid;
struct in_addr naddr; struct in_addr naddr;
qini_sNode *nep; qini_sNode *nep;
...@@ -137,7 +141,8 @@ qini_ParseFile ( ...@@ -137,7 +141,8 @@ qini_ParseFile (
continue; continue;
} }
n = sscanf(s, "%s %s %s %s %s", name, s_nid, s_naddr, s_port, s_connection); n = sscanf(s, "%s %s %s %s %s %s %s", name, s_nid, s_naddr, s_port, s_connection,
s_min_resend_time, s_max_resend_time);
if (n < 3) { if (n < 3) {
errh_Error("error in line, <wrong number of arguments>, skip to next line.\n>> %s", s); errh_Error("error in line, <wrong number of arguments>, skip to next line.\n>> %s", s);
(*errors)++; (*errors)++;
...@@ -175,6 +180,8 @@ qini_ParseFile ( ...@@ -175,6 +180,8 @@ qini_ParseFile (
nep->naddr.s_addr = htonl(naddr.s_addr); nep->naddr.s_addr = htonl(naddr.s_addr);
if (n > 3) nep->port = htons(atoi(s_port)); if (n > 3) nep->port = htons(atoi(s_port));
if (n > 4) nep->connection = atoi(s_connection); if (n > 4) nep->connection = atoi(s_connection);
if (n > 5) nep->min_resend_time = atoi(s_min_resend_time);
if (n > 6) nep->max_resend_time = atoi(s_max_resend_time);
memset(&arpreq, 0, sizeof(arpreq)); memset(&arpreq, 0, sizeof(arpreq));
memcpy(&arpreq.arp_pa.sa_data, &naddr, sizeof(naddr)); memcpy(&arpreq.arp_pa.sa_data, &naddr, sizeof(naddr));
inet_GetArpEntry(&sts, 0, &arpreq); inet_GetArpEntry(&sts, 0, &arpreq);
......
...@@ -109,6 +109,8 @@ typedef struct { ...@@ -109,6 +109,8 @@ typedef struct {
struct in_addr naddr; struct in_addr naddr;
int port; int port;
qcom_eNodeConnection connection; qcom_eNodeConnection connection;
unsigned int min_resend_time;
unsigned int max_resend_time;
pwr_tBoolean connect; pwr_tBoolean connect;
} qini_sNode; } qini_sNode;
......
...@@ -109,6 +109,22 @@ SObject pwrb:Class ...@@ -109,6 +109,22 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$String80" Attr TypeRef = "pwrs:Type-$String80"
EndBody EndBody
EndObject EndObject
!/**
! QCom minimum resend time in seconds.
!*/
Object QComMinResendTime $Attribute 7
Body SysBody
Attr TypeRef = "pwrs:Type-$Float32"
EndBody
EndObject
!/**
! QCom maxium resend time in seconds.
!*/
Object QComMaxResendTime $Attribute 8
Body SysBody
Attr TypeRef = "pwrs:Type-$Float32"
EndBody
EndObject
EndObject EndObject
EndObject EndObject
EndSObject EndSObject
...@@ -182,6 +182,22 @@ SObject pwrb:Class ...@@ -182,6 +182,22 @@ SObject pwrb:Class
Attr TypeRef = "pwrb:Type-RemoteShellEnum" Attr TypeRef = "pwrb:Type-RemoteShellEnum"
EndBody EndBody
EndObject EndObject
!/**
! QCom minimum resend time in seconds.
!*/
Object QComMinResendTime $Attribute 12
Body SysBody
Attr TypeRef = "pwrs:Type-$Float32"
EndBody
EndObject
!/**
! QCom maxium resend time in seconds.
!*/
Object QComMaxResendTime $Attribute 13
Body SysBody
Attr TypeRef = "pwrs:Type-$Float32"
EndBody
EndObject
EndObject EndObject
Object PostCreate $DbCallBack Object PostCreate $DbCallBack
Body SysBody Body SysBody
......
...@@ -154,6 +154,22 @@ SObject pwrb:Class ...@@ -154,6 +154,22 @@ SObject pwrb:Class
Attr TypeRef = "pwrb:Type-RemoteShellEnum" Attr TypeRef = "pwrb:Type-RemoteShellEnum"
EndBody EndBody
EndObject EndObject
!/**
! QCom minimum resend time in seconds.
!*/
Object QComMinResendTime $Attribute 10
Body SysBody
Attr TypeRef = "pwrs:Type-$Float32"
EndBody
EndObject
!/**
! QCom maxium resend time in seconds.
!*/
Object QComMaxResendTime $Attribute 11
Body SysBody
Attr TypeRef = "pwrs:Type-$Float32"
EndBody
EndObject
EndObject EndObject
Object PostCreate $DbCallBack Object PostCreate $DbCallBack
Body SysBody Body SysBody
......
...@@ -89,7 +89,8 @@ ...@@ -89,7 +89,8 @@
class lfu_nodeconf { class lfu_nodeconf {
public: public:
lfu_nodeconf() : isfriend(0), port(0), vid(0), connection(0) lfu_nodeconf() : isfriend(0), port(0), vid(0), connection(0),
qcom_min_resend_time(0), qcom_max_resend_time(0)
{ strcpy( address, ""); strcpy( nodename, "");} { strcpy( address, ""); strcpy( nodename, "");}
int isfriend; int isfriend;
pwr_tOid oid; pwr_tOid oid;
...@@ -99,6 +100,8 @@ public: ...@@ -99,6 +100,8 @@ public:
pwr_tUInt32 port; pwr_tUInt32 port;
pwr_tVid vid; pwr_tVid vid;
pwr_tEnum connection; pwr_tEnum connection;
pwr_tFloat32 qcom_min_resend_time;
pwr_tFloat32 qcom_max_resend_time;
}; };
...@@ -1481,6 +1484,20 @@ pwr_tStatus lfu_SaveDirectoryVolume( ...@@ -1481,6 +1484,20 @@ pwr_tStatus lfu_SaveDirectoryVolume(
a.value( &nc.port); a.value( &nc.port);
if ( !a) return sts; if ( !a) return sts;
// Get attribute QComMinResendTime
a = sp->attribute( nodeo.oid(), "RtBody", "QComMinResendTime");
if ( !a) return a.sts();
a.value( &nc.qcom_min_resend_time);
if ( !a) return sts;
// Get attribute QComMaxResendTime
a = sp->attribute( nodeo.oid(), "RtBody", "QComMaxResendTime");
if ( !a) return a.sts();
a.value( &nc.qcom_max_resend_time);
if ( !a) return sts;
if ( !strcmp( nc.nodename, "")) { if ( !strcmp( nc.nodename, "")) {
char msg[200]; char msg[200];
sprintf( msg, "Error in NodeConfig object '%s', NodeName is missing\n", sprintf( msg, "Error in NodeConfig object '%s', NodeName is missing\n",
...@@ -1569,6 +1586,20 @@ pwr_tStatus lfu_SaveDirectoryVolume( ...@@ -1569,6 +1586,20 @@ pwr_tStatus lfu_SaveDirectoryVolume(
a.value( volstr); a.value( volstr);
if ( !a) return sts; if ( !a) return sts;
// Get attribute QComMinResendTime
a = sp->attribute( nodeo.oid(), "RtBody", "QComMinResendTime");
if ( !a) return a.sts();
a.value( &nc.qcom_min_resend_time);
if ( !a) return sts;
// Get attribute QComMaxResendTime
a = sp->attribute( nodeo.oid(), "RtBody", "QComMaxResendTime");
if ( !a) return a.sts();
a.value( &nc.qcom_max_resend_time);
if ( !a) return sts;
/* Check that the name is in the global volume list */ /* Check that the name is in the global volume list */
found = 0; found = 0;
volumelist_ptr = volumelist; volumelist_ptr = volumelist;
...@@ -1641,8 +1672,10 @@ pwr_tStatus lfu_SaveDirectoryVolume( ...@@ -1641,8 +1672,10 @@ pwr_tStatus lfu_SaveDirectoryVolume(
for ( int i = 0; i < (int)nodevect.size(); i++) { for ( int i = 0; i < (int)nodevect.size(); i++) {
lfu_nodeconf nc = nodevect[i]; lfu_nodeconf nc = nodevect[i];
fprintf( fp, "%s %s %s %d %d\n", nc.nodename, fprintf( fp, "%s %s %s %d %d %d %d\n", nc.nodename,
cdh_VolumeIdToString( NULL, nc.vid, 0, 0), nc.address, nc.port, nc.connection); cdh_VolumeIdToString( NULL, nc.vid, 0, 0), nc.address, nc.port,
nc.connection, int(nc.qcom_min_resend_time * 1000),
int(nc.qcom_max_resend_time * 1000));
} }
// Add specific FriendNodes for the node // Add specific FriendNodes for the node
...@@ -1689,6 +1722,20 @@ pwr_tStatus lfu_SaveDirectoryVolume( ...@@ -1689,6 +1722,20 @@ pwr_tStatus lfu_SaveDirectoryVolume(
a.value( volstr); a.value( volstr);
if ( !a) return sts; if ( !a) return sts;
// Get attribute QComMaxResendTime
a = sp->attribute( fnodeo.oid(), "RtBody", "QComMinResendTime");
if ( !a) return a.sts();
a.value( &nc.qcom_min_resend_time);
if ( !a) return sts;
// Get attribute QComMaxResendTime
a = sp->attribute( fnodeo.oid(), "RtBody", "QComMaxResendTime");
if ( !a) return a.sts();
a.value( &nc.qcom_max_resend_time);
if ( !a) return sts;
/* Check that the name is in the global volume list */ /* Check that the name is in the global volume list */
found = 0; found = 0;
volumelist_ptr = volumelist; volumelist_ptr = volumelist;
...@@ -1708,8 +1755,10 @@ pwr_tStatus lfu_SaveDirectoryVolume( ...@@ -1708,8 +1755,10 @@ pwr_tStatus lfu_SaveDirectoryVolume(
syntax_error = 1; syntax_error = 1;
} }
fprintf( fp, "%s %s %s %d %d\n", nc.nodename, fprintf( fp, "%s %s %s %d %d %d %d\n", nc.nodename,
cdh_VolumeIdToString( NULL, nc.vid, 0, 0), nc.address, nc.port, nc.connection); cdh_VolumeIdToString( NULL, nc.vid, 0, 0), nc.address, nc.port,
nc.connection, (int)(nc.qcom_min_resend_time * 1000),
(int)(nc.qcom_max_resend_time * 1000));
break; break;
} }
default: ; default: ;
......
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