Page MenuHomeFreeBSD

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

Authored by bhargava.marreddy_broadcom.com on Nov 1 2017, 10:51 AM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 21 2024, 11:00 AM
Unknown Object (File)
Jan 31 2024, 3:49 AM
Unknown Object (File)
Dec 20 2023, 8:37 AM
Unknown Object (File)
Dec 12 2023, 6:23 PM
Unknown Object (File)
Nov 9 2023, 1:45 AM
Unknown Object (File)
Oct 13 2023, 2:22 AM
Unknown Object (File)
Aug 14 2023, 8:50 PM
Unknown Object (File)
Aug 9 2023, 7:51 AM

Details

Summary
  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 https://reviews.freebsd.org/D12423 while preparing this patch.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
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;
        break;
    }
}
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