Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enabling debug/undebug feature for quagga/frr #222

Closed
wants to merge 1 commit into from

Conversation

rodnymolina
Copy link
Contributor

@rodnymolina rodnymolina commented Mar 23, 2018

With this PR I'm taking care of the following issues:

 * Fixed debug/undebug cli commands for bgp and zebra processes.
 * Added a new cli command to activate/deactivate the generation of debuging info.
 * Added two separated command structures for Quagga and FRR routing-stacks -- notice that they don't fully match.

New debug/undebug stanzas now look like this (Quagga example below):

    admin@lnos-x1-a-csw01:~$ debug ?
    Usage: debug [OPTIONS] COMMAND [ARGS]...

      SONiC command line - 'debug' command

    Options:
      -?, -h, --help  Show this message and exit.

    Commands:
      bgp      debug bgp events
      disable  disable debugging for routing events
      enable   enable debugging for routing events
      zebra    debug bgp events

    admin@lnos-x1-a-csw01:~$ debug bgp ?
    Usage: debug bgp [OPTIONS] COMMAND [ARGS]...

      debug bgp events

    Options:
      -?, -h, --help  Show this message and exit.

    Commands:
      as4         debug bgp AS4 actions
      events      debug bgp events
      filters     debug bgp filters
      fsm         debug bgp fsm
      keepalives  debug bgp keepalives
      updates     debug bgp updates
      zebra       debug bgp zebra messages

    admin@lnos-x1-a-csw01:~$ debug zebra ?
    Usage: debug zebra [OPTIONS] COMMAND [ARGS]...

      debug bgp events

    Options:
      -?, -h, --help  Show this message and exit.

    Commands:
      events  debug zebra events
      fpm     debug zebra fpm events
      kernel  debug zebra's kernel-interface events
      packet  debug zebra packets
      rib     debug zebra RIB events

With this PR I'm taking care of the following issues:

     * Fixed debug/undebug cli commands for bgp and zebra processes.
     * Added a new cli command to activate/deactivate the generation of debuging info.
     * Added two separated command structures for Quagga and FRR routing-stacks -- notice that they don't fully match.

New debug/undebug stanzas now look like this (Quagga example below):

admin@lnos-x1-a-csw01:~$ debug ?
Usage: debug [OPTIONS] COMMAND [ARGS]...

  SONiC command line - 'debug' command

Options:
  -?, -h, --help  Show this message and exit.

Commands:
  bgp      debug bgp events
  disable  disable debugging for routing events
  enable   enable debugging for routing events
  zebra    debug bgp events

admin@lnos-x1-a-csw01:~$ debug bgp ?
Usage: debug bgp [OPTIONS] COMMAND [ARGS]...

  debug bgp events

Options:
  -?, -h, --help  Show this message and exit.

Commands:
  as4         debug bgp AS4 actions
  events      debug bgp events
  filters     debug bgp filters
  fsm         debug bgp fsm
  keepalives  debug bgp keepalives
  updates     debug bgp updates
  zebra       debug bgp zebra messages

admin@lnos-x1-a-csw01:~$ debug zebra ?
Usage: debug zebra [OPTIONS] COMMAND [ARGS]...

  debug bgp events

Options:
  -?, -h, --help  Show this message and exit.

Commands:
  events  debug zebra events
  fpm     debug zebra fpm events
  kernel  debug zebra's kernel-interface events
  packet  debug zebra packets
  rib     debug zebra RIB events
Copy link
Contributor

@nikos-github nikos-github left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of comments:

  • We shouldn't use undebug as a keyword but the no form. We need to be consistent with what vtysh has and there is no collision with existing commands.
  • All this code is not needed and we shouldn't expose debugs on a case by case basis for FRR. Have a look at how I've done this for the show bgp and clear bgp commands. The entire diffset can be refactored in about 15 lines.

@rodnymolina
Copy link
Contributor Author

New PR/254 was opened as changes were considerable, closing this one now.

stepanblyschak pushed a commit to stepanblyschak/sonic-utilities that referenced this pull request Apr 18, 2022
This PR updates the following commits in 202012

1f32e5c (HEAD -> 202012, origin/202012) [ycable][credo] Fix the is_link_active API for Credo Ycable (sonic-net#260)
c249681 [Y-Cable][Credo] add theading locker to support thread-safe calling, add SKU check for download_firmware API.  (sonic-net#222)

Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
mihirpat1 pushed a commit to mihirpat1/sonic-utilities that referenced this pull request Sep 15, 2023
…add SKU check for download_firmware API. (sonic-net#222)

* [Y-Cable][Credo] fix racing issue of VSC releated APIs

    The VSC protocol didn't allow user to send two or more vsc command to the module simultaneously,
    otherwise unexpected error might occurred.

    To avoid this issue, we can simply to update the download_firmware_status in the the following functions.
    This could help the helper to know vsc is in progress or not.

        * get_firmware_version()
        * download_firmware()
        * activate_firmware()
        * rollback_firmware()
This PR also does add SKU check for download_firmware API.
* [Y-Cable][Credo] add firmware ID checker to avoid update the wrong firmware

Signed-off-by: xinyu <xinyu0123@gmail.com>
mihirpat1 pushed a commit to mihirpat1/sonic-utilities that referenced this pull request Sep 15, 2023
sonic-net#269)

Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>

Due to PR sonic-net#222
the download_firmware_status variable of download_firmware API was not cleaned up, due to which higher layer
could sometimes see wrong values of firmware version.
This PR addresses this issue.

After calling a firmware download and not changing this variable


admin@sonic:~$ show mux firmware version Ethernet0
{
    "version_nic_active": "N/A",
    "version_nic_inactive": "N/A",
    "version_nic_next": "N/A",
    "version_peer_active": "N/A",
    "version_peer_inactive": "N/A",
    "version_peer_next": "N/A",
    "version_self_active": "N/A",
    "version_self_inactive": "N/A",
    "version_self_next": "N/A"
}
after the change

admin@sonic:~$ show mux firmware version Ethernet0
<versionX>
{
    "version_nic_active": "1.0MS",
    "version_nic_inactive": "1.1MS",
    "version_nic_next": "1.0MS",
    "version_peer_active": "1.0MS",
    "version_peer_inactive": "1.1MS",
    "version_peer_next": "1.0MS",
    "version_self_active": "1.0MS",
    "version_self_inactive": "1.1MS",
    "version_self_next": "1.0MS"
}
Description
Motivation and Context
How Has This Been Tested?
Tested on an Arista Device.
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.

2 participants