Skip to content

[orchagent]:add local_discriminator for BFD session to state_db#2587

Merged
siqbal1986 merged 1 commit intosonic-net:202012from
baorliu:cisco-baorliu-bfd-local-discriminator
Jan 11, 2023
Merged

[orchagent]:add local_discriminator for BFD session to state_db#2587
siqbal1986 merged 1 commit intosonic-net:202012from
baorliu:cisco-baorliu-bfd-local-discriminator

Conversation

@baorliu
Copy link
Contributor

@baorliu baorliu commented Dec 22, 2022

What I did
Add local_discriminator to state DB when bfdorch create_bfd_session.

Why I did it
For upcoming BFD debugging related CLI, user need to use local_discriminator to specify which BFD session they want to debug. current show bfd CLI does not have this information (the local_discriminator is not in state DB).
Also, this is local_discriminator printed into syslog, user may want to correlate this local_discriminator to BFD session.

How I verified it
with modified code, and modified show bfd python script, the local discriminator can be shown in 'show bfd' cmd:
(show "NA" if there is no local_discriminator in state DB.)
modification for "show bfd" script will be committed separately in another PR.

cisco@sonic:/var/tmp$ show bfd sum
Total number of BFD sessions: 1
Peer Addr    Interface    Vrf      State    Type          Local Addr      TX Interval    RX Interval    Multiplier  Multihop    Local Discriminator
-----------  -----------  -------  -------  ------------  ------------  -------------  -------------  ------------  ----------  ---------------------
192.85.2.24  default      default  Down     async_active  192.85.2.29            1000           1000             3  true        NA
cisco@sonic:/var/tmp$ show bfd peer 192.85.2.24
Total number of BFD sessions for peer IP 192.85.2.24: 1
Peer Addr    Interface    Vrf      State    Type          Local Addr      TX Interval    RX Interval    Multiplier  Multihop    Local Discriminator
-----------  -----------  -------  -------  ------------  ------------  -------------  -------------  ------------  ----------  ---------------------
192.85.2.24  default      default  Down     async_active  192.85.2.29            1000           1000             3  true        NA
cisco@sonic:/var/tmp$ docker exec -i swss swssconfig /dev/stdin < bfd.cfg
cisco@sonic:/var/tmp$ show bfd peer 192.85.2.24
Total number of BFD sessions for peer IP 192.85.2.24: 1
Peer Addr    Interface    Vrf      State    Type          Local Addr      TX Interval    RX Interval    Multiplier  Multihop      Local Discriminator
-----------  -----------  -------  -------  ------------  ------------  -------------  -------------  ------------  ----------  ---------------------
192.85.2.24  default      default  Down     async_active  192.85.2.29            1000           1000             3  true                            1
cisco@sonic:/var/tmp$ show bfd sum
Total number of BFD sessions: 1
Peer Addr    Interface    Vrf      State    Type          Local Addr      TX Interval    RX Interval    Multiplier  Multihop      Local Discriminator
-----------  -----------  -------  -------  ------------  ------------  -------------  -------------  ------------  ----------  ---------------------
192.85.2.24  default      default  Down     async_active  192.85.2.29            1000           1000             3  true                            1

Details if related
Example of BFD session entry in state DB with local_discriminator:

"BFD_SESSION_TABLE|default|default|192.85.2.24": {
    "expireat": 1667599670.656455, 
    "ttl": -0.001, 
    "type": "hash", 
    "value": {
      "local_addr": "192.85.2.29", 
      "local_discriminator": "1", 
      "multihop": "true", 
      "multiplier": "3", 
      "rx_interval": "1000", 
      "state": "Down", 
      "tx_interval": "1000", 
      "type": "async_active"
    }
  },

Add local_discriminator to state DB for 'show bfd' cmd to show local discriminator. User can use this local discriminator to specify a BFD session when using BFD debugging command or checking syslog.
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Dec 22, 2022

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: baorliu / name: Baorong Liu (97a93f8)

@prsunny
Copy link
Collaborator

prsunny commented Dec 22, 2022

@baorliu , please sign CLA. Can you also raise the PR to master with a VS test?

@prsunny prsunny requested a review from siqbal1986 December 22, 2022 18:50
@prsunny
Copy link
Collaborator

prsunny commented Jan 6, 2023

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants