Skip to content

[action] [PR:3911] [sfputil] Use host lane mask as part of rx-output enable/disable#185

Merged
mssonicbld merged 1 commit intoAzure:202412from
mssonicbld:cherry/msft-202412/3911
Jun 13, 2025
Merged

[action] [PR:3911] [sfputil] Use host lane mask as part of rx-output enable/disable#185
mssonicbld merged 1 commit intoAzure:202412from
mssonicbld:cherry/msft-202412/3911

Conversation

@mssonicbld
Copy link
Copy Markdown
Collaborator

What I did

We need to use host lane mask instead of media lane mask as part of sfputil debug rx-output EthernetXX enable/disable CLI.
In addition to the above, following needs to be enhanced

  1. Need to fail CLI if the tx_disable_channel or rx_disable_channel fails
  2. Verify the Rx and Tx output status after enabling/disabling Rx/Tx
  3. Modify get_subport function to return subport as 1 if the subport field is not found in PORT table of CONFIG_DB

How I did it

Addressed the above issues in What I did section

How to verify it

  1. Verified rx-output disable and enable
  2. Verified tx-output disable and enable
  3. Verified rx-output disable and enable CLI on a device which did not have subport as part of the PORT table in CONFIG_DB

Previous command output (if the output of a command-line utility has changed)

The CLI used to fail if subport field is not defined in the PORT table of CONFIG_DB

root@sonic:/home/admin# sfputil debug rx-output Ethernet144 enable
Ethernet144: subport is not present in CONFIG_DB

root@sonic:/home/admin# redis-cli -n 4 hgetall "PORT|Ethernet144"
 1) "admin_status"
 2) "up"
 3) "alias"
 4) "Ethernet19/1"
 5) "index"
 6) "19"
 7) "lanes"
 8) "145,146,147,148,149,150,151,152"
 9) "mtu"
10) "9100"
11) "speed"
12) "400000"
root@sonic:/home/admin#

New command output (if the output of a command-line utility has changed)

With the new changes, the CLI is now supported

root@sonic:/home/admin# sfputil debug rx-output Ethernet144 enable
Field 'subport' not found in table 'PORT' for key 'Ethernet144' in CONFIG_DB.
Ethernet144: RX output enabled on subport 1
root@sonic:/home/admin#

<!--
    Please make sure you've read and understood our contributing guidelines:
    https://github.com/Azure/SONiC/blob/gh-pages/CONTRIBUTING.md

    ** Make sure all your commits include a signature generated with `git commit -s` **

    If this is a bug fix, make sure your description includes "closes #xxxx",
    "fixes #xxxx" or "resolves #xxxx" so that GitHub automatically closes the related
    issue when the PR is merged.

    If you are adding/modifying/removing any command or utility script, please also
    make sure to add/modify/remove any unit tests from the tests
    directory as appropriate.

    If you are modifying or removing an existing 'show', 'config' or 'sonic-clear'
    subcommand, or you are adding a new subcommand, please make sure you also
    update the Command Line Reference Guide (doc/Command-Reference.md) to reflect
    your changes.

    Please provide the following information:
-->

#### What I did
We need to use host lane mask instead of media lane mask as part of sfputil debug rx-output EthernetXX enable/disable CLI.
In addition to the above, following needs to be enhanced
1. Need to fail CLI if the tx_disable_channel or rx_disable_channel fails
2. Verify the Rx and Tx output status after enabling/disabling Rx/Tx
3. Modify get_subport function to return subport as 1 if the subport field is not found in PORT table of CONFIG_DB

#### How I did it
Addressed the above issues in `What I did` section

#### How to verify it
1. Verified rx-output disable and enable
2. Verified tx-output disable and enable
3. Verified rx-output disable and enable CLI on a device which did not have subport as part of the `PORT` table in `CONFIG_DB`

#### Previous command output (if the output of a command-line utility has changed)
The CLI used to fail if subport field is not defined in the PORT table of CONFIG_DB
```
root@sonic:/home/admin# sfputil debug rx-output Ethernet144 enable
Ethernet144: subport is not present in CONFIG_DB

root@sonic:/home/admin# redis-cli -n 4 hgetall "PORT|Ethernet144"
 1) "admin_status"
 2) "up"
 3) "alias"
 4) "Ethernet19/1"
 5) "index"
 6) "19"
 7) "lanes"
 8) "145,146,147,148,149,150,151,152"
 9) "mtu"
10) "9100"
11) "speed"
12) "400000"
root@sonic:/home/admin#
```

#### New command output (if the output of a command-line utility has changed)
With the new changes, the CLI is now supported

```
root@sonic:/home/admin# sfputil debug rx-output Ethernet144 enable
Field 'subport' not found in table 'PORT' for key 'Ethernet144' in CONFIG_DB.
Ethernet144: RX output enabled on subport 1
root@sonic:/home/admin#
```
@mssonicbld
Copy link
Copy Markdown
Collaborator Author

Original PR: sonic-net/sonic-utilities#3911

@mssonicbld
Copy link
Copy Markdown
Collaborator Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld mssonicbld merged commit 09597f2 into Azure:202412 Jun 13, 2025
4 of 6 checks passed
mssonicbld added a commit that referenced this pull request Jun 14, 2025
```<br>* 7253618 - (HEAD -> 202503) Merge branch '202412' of https://github.com/Azure/sonic-utilities.msft into 202503 (2025-06-14) [Sonic Automation]
* 09597f2 - (base/202412) [sfputil] Use host lane mask as part of rx-output enable/disable (#185) (2025-06-14) [mssonicbld]<br>```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant