Page MenuHomeFreeBSD

bnxt: Add support for Flow control setting using sysctl
ClosedPublic

Authored by bhargava.marreddy_broadcom.com on Oct 6 2017, 6:27 AM.

Details

Summary

Created sysctl node dev.bnxt.0.fc with following options.

A. dev.bnxt.0.fc.autoneg
B. dev.bnxt.0.fc.rx
C. dev.bnxt.0.fc.tx

Description:-
dev.bnxt.0.fc: flow ctrl
dev.bnxt.0.fc.autoneg: Enable or Disable Autoneg Flow Ctrl: 0 / 1
dev.bnxt.0.fc.rx: Enable or Disable Tx Flow Ctrl: 0 / 1
dev.bnxt.0.fc.tx: Enable or Disable Tx Flow Ctrl: 0 / 1

Test Plan

Verified using Stratus 100G NIC, able to verify pause_rx, pause_tx & pause_autoneg by turning on / off individually.

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Fixed issue of double notification (in the kernel logs) after changing flow control setting in case of pause_autoneg.

Sean, Stephen,

Can you please review the patch and commit if no changes required?

Thanks

shurd requested changes to this revision.Oct 23 2017, 5:08 PM

Minor changes.

sys/dev/bnxt/bnxt.h
214 ↗(On Diff #33736)

Why not put the 'A' in the macro name? ie: BNXT_IS_FLOW_CTRL_CHANGED()

298 ↗(On Diff #33736)

Why are these uint16_t? It seems they are all used as bools.

sys/dev/bnxt/bnxt_sysctl.c
1328 ↗(On Diff #33736)

Is the word "pause" required in these names? If so, perhaps it should be in the partent oid name since it's a prefix to all values under it?

sys/dev/bnxt/if_bnxt.c
2089 ↗(On Diff #33736)

Why the extra blank line?

This revision now requires changes to proceed.Oct 23 2017, 5:08 PM
bhargava.marreddy_broadcom.com marked 4 inline comments as done.Oct 24 2017, 2:05 PM
bhargava.marreddy_broadcom.com added inline comments.
sys/dev/bnxt/bnxt.h
214 ↗(On Diff #33736)

Taken care.

298 ↗(On Diff #33736)

Taken care.

sys/dev/bnxt/bnxt_sysctl.c
1328 ↗(On Diff #33736)

Taken care by removing prefix pause_.
But not added it in parent oid as it is defined as "fc". hope this should be fine. Please let me know.

sys/dev/bnxt/if_bnxt.c
2089 ↗(On Diff #33736)

Taken care.

bhargava.marreddy_broadcom.com marked 4 inline comments as done.
bhargava.marreddy_broadcom.com edited the summary of this revision. (Show Details)

Taken care of review comments.

shurd accepted this revision.Oct 24 2017, 7:31 PM

Looks good to me.

This revision is now accepted and ready to land.Oct 24 2017, 7:31 PM
sbruno accepted this revision.Oct 24 2017, 8:18 PM
This revision was automatically updated to reflect the committed changes.