Page MenuHomeFreeBSD

bnxt: Add support for new phy_types and speeds - Part #2

Authored by on Nov 1 2017, 10:51 AM.


  1. For ifmr->ifm_active, consider new phy_types and speeds.
  2. Remove all workarounds while updating ifmr->ifm_active.
  3. For BNXT_IFMEDIA_ADD, added Three more speeds IFM_10G_T, IFM_2500_T & IFM_2500_KX.

Considered all review comments of while preparing this patch.

Diff Detail

rS FreeBSD src repository
Lint Skipped
Unit Tests Skipped

Event Timeline

shurd requested changes to this revision.Nov 2 2017, 5:21 PM

This seems to be a very complex and fragile way of looking up the supported media type by speed. Why not just loop through ifm_list looking for a matching speed? Something like this:

struct ifmedia_entry *next;
uint64_t target_baudrate = bnxt_get_baudrate(softc->link_info);
int match = IFM_UNKNOWN;

LIST_FOREACH(next, &(iflib_get_media(ctx)->ifm_list), ifm_list) {
    if (ifmedia_baudrate(next->ifm_media) == target_baudrate) {
        match = next->ifm_media;
ifmr->ifm_active |= match;

Since you already have a list of supported media types?

This revision now requires changes to proceed.Nov 2 2017, 5:21 PM

I agree with you!! Thanks for the suggestion.

Only case needs to be taken care is, after media/phy change, bnxt_add_media_types() should get called prior to this bnxt_media_status().
Any way, I'll take care of that in other patch which is under review process currently.

This revision is now accepted and ready to land.Nov 3 2017, 7:11 PM
sbruno accepted this revision.Nov 6 2017, 3:52 PM
shurd closed this revision.Nov 6 2017, 9:32 PM

committed as r325488