Skip to content
Snippets Groups Projects
Commit 4a037c02 authored by System User's avatar System User
Browse files

COM GBE: make script generic

parent 640d6f57
No related branches found
No related tags found
No related merge requests found
......@@ -114,7 +114,7 @@ def cellnode_configure_comlbp(node_tangopath, seqoffset=0):
def centralnode_configure_comgbe(node_tangopath, npsc):
"""
Configure the ComGBE
Automatically set the number of bpm/psc packets and MAC length.
Automatically set the number of psc packets and MAC length.
PARAMETERS
----------
......@@ -122,7 +122,8 @@ def centralnode_configure_comgbe(node_tangopath, npsc):
The target fofbnode tango path, ie 'ans/dg/fofb-centralnode'
npsc:
Number of total PSC, hence the number of expected PSC packets.
ncomGBE:
Number of GBE communication link for PSC
RETURN
------
success: boolean
......@@ -140,13 +141,13 @@ def centralnode_configure_comgbe(node_tangopath, npsc):
#logger.debug("{} bpm allowed in the ethernet frame on {}".format(nbpm, node_tangopath))
logger.debug("{} psc expected in the ethernet frame on {}".format(npsc, node_tangopath))
logger.debug("Configure packeter npackets to {}".format(npsc-1))
prx["ccnpack4_npackets"] = npsc-1
for n in range(1):
prx["ccnpacketh{}_npackets".format(n)] = npsc-1
maclen = npsc*6+10
logger.debug("Configure packeter framesize (mac length) to {}".format(maclen))
prx["ccnpack4_framesize"] = maclen
prx["ccnpacketh{}_framesize".format(n)] = maclen
logger.info("Configuration of Com GBE done on {}.".format(node_tangopath))
return True
......
......@@ -319,9 +319,8 @@ def reset_gbe(node_tangopath, ccnif=[]):
logger.error("Failed to obtain tango proxy or to ping to {}".format(node_tangopath))
return False
logger.debug("in reset")
ccnif = [0]
if len(ccnif) == 0:
ccnif = [O]
ccnif = [int(a[6]) for a in prx.get_attribute_list() if "gigeth" in a if "reset" in a]
logger.info("Reset GBE on {}".format(node_tangopath))
for n in ccnif:
prx["gigeth{}_reset".format(n)] = 1
......@@ -360,15 +359,15 @@ def start_gbe(node_tangopath, ccnif=[]):
logger.error("Failed to obtain tango proxy or to ping to {}".format(node_tangopath))
return False
if len(ccnif) == 0:
ccnif = [4]
ccnif = [4]
ccnif = [int(a[10]) for a in prx.get_attribute_list() if "ccnpacketh" in a if "control" in a]
logger.info("Reset GBE on {}".format(node_tangopath))
logger.info("Starting GBE on {}".format(node_tangopath))
ack_gbe(node_tangopath, ccnif)
for n in ccnif:
if 'central' in node_tangopath:
prx["ccnpack{}_control".format(n)] = 1
prx["ccnpacketh{}_control".format(n)] = 1
else:
pass
......@@ -400,16 +399,15 @@ def ack_gbe(node_tangopath, ccnif=[]):
return False
if len(ccnif) == 0:
ccnif = [4]
ccnif = [4]
ccnif = [int(a[10]) for a in prx.get_attribute_list() if "ccnpacketh" in a if "control" in a]
logger.info("Ack GBE error on {}".format(node_tangopath))
for n in ccnif:
prx["ccnpack{}_reset_error".format(n)] = 1
prx["ccnpacketh{}_reset_error".format(n)] = 1
time.sleep(1)
for n in ccnif:
prx["ccnpack{}_reset_error".format(n)] = 0
prx["ccnpacketh{}_reset_error".format(n)] = 0
logger.info("ACK GBE error on {} done".format(node_tangopath))
return True
......@@ -424,7 +422,6 @@ def stop_gbe(node_tangopath, ccnif=[]):
The target fofbnode tango path, ie 'ans/dg/fofb-centralenode'
ccnif: list(int)
First only one node
List of the interface to stop. If empty, all the possible interface will be stopped.
RETURNS
......@@ -438,13 +435,13 @@ def stop_gbe(node_tangopath, ccnif=[]):
except tango.DevFailed:
logger.error("Failed to obtain tango proxy or to ping to {}".format(node_tangopath))
return False
ccnif = [4]
if len(ccnif) == 0:
ccnif = [4]
ccnif = [int(a[10]) for a in prx.get_attribute_list() if "ccnpacketh" in a if "control" in a]
logger.info("Ack GBE error on {}".format(node_tangopath))
logger.info("Stopping GBE com on {}".format(node_tangopath))
for n in ccnif:
if 'central' in node_tangopath:
prx["ccnpack{}_control".format(n)] = False
prx["ccnpacketh{}_control".format(n)] = False
return True
###################################################################################################
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment