mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
ix, ixv: Update link status with autonegotiated baudrate value
Use autonegotiated link speed value while updating link status to iflib. This patch is part of change made in NetBSD kernel by Masanobu Saitoh, NetBSD maintainer. Differential Revision: https://reviews.freebsd.org/D19176 Approved by: erj
This commit is contained in:
parent
66f2f9ee08
commit
a0302c9231
4 changed files with 38 additions and 2 deletions
|
|
@ -3679,7 +3679,8 @@ ixgbe_if_update_admin_status(if_ctx_t ctx)
|
|||
/* Update DMA coalescing config */
|
||||
ixgbe_config_dmac(sc);
|
||||
/* should actually be negotiated value */
|
||||
iflib_link_state_change(ctx, LINK_STATE_UP, IF_Gbps(10));
|
||||
iflib_link_state_change(ctx, LINK_STATE_UP,
|
||||
ixgbe_link_speed_to_baudrate(adapter->link_speed));
|
||||
|
||||
if (sc->feat_en & IXGBE_FEATURE_SRIOV)
|
||||
ixgbe_ping_all_vfs(sc);
|
||||
|
|
|
|||
|
|
@ -937,7 +937,7 @@ ixv_if_update_admin_status(if_ctx_t ctx)
|
|||
"Full Duplex");
|
||||
sc->link_active = true;
|
||||
iflib_link_state_change(ctx, LINK_STATE_UP,
|
||||
IF_Gbps(10));
|
||||
ixgbe_link_speed_to_baudrate(adapter->link_speed));
|
||||
}
|
||||
} else { /* Link down */
|
||||
if (sc->link_active == true) {
|
||||
|
|
|
|||
|
|
@ -530,6 +530,8 @@ ixv_check_ether_addr(u8 *addr)
|
|||
return (status);
|
||||
}
|
||||
|
||||
uint64_t ixgbe_link_speed_to_baudrate(ixgbe_link_speed speed);
|
||||
|
||||
/* Shared Prototypes */
|
||||
|
||||
int ixgbe_allocate_queues(struct ixgbe_softc *);
|
||||
|
|
|
|||
|
|
@ -76,3 +76,36 @@ ixgbe_write_reg_array(struct ixgbe_hw *hw, u32 reg, u32 offset, u32 val)
|
|||
((struct ixgbe_softc *)hw->back)->osdep.mem_bus_space_handle,
|
||||
reg + (offset << 2), val);
|
||||
}
|
||||
|
||||
uint64_t
|
||||
ixgbe_link_speed_to_baudrate(ixgbe_link_speed speed)
|
||||
{
|
||||
uint64_t baudrate;
|
||||
|
||||
switch (speed) {
|
||||
case IXGBE_LINK_SPEED_10GB_FULL:
|
||||
baudrate = IF_Gbps(10);
|
||||
break;
|
||||
case IXGBE_LINK_SPEED_5GB_FULL:
|
||||
baudrate = IF_Gbps(5);
|
||||
break;
|
||||
case IXGBE_LINK_SPEED_2_5GB_FULL:
|
||||
baudrate = IF_Mbps(2500);
|
||||
break;
|
||||
case IXGBE_LINK_SPEED_1GB_FULL:
|
||||
baudrate = IF_Gbps(1);
|
||||
break;
|
||||
case IXGBE_LINK_SPEED_100_FULL:
|
||||
baudrate = IF_Mbps(100);
|
||||
break;
|
||||
case IXGBE_LINK_SPEED_10_FULL:
|
||||
baudrate = IF_Mbps(10);
|
||||
break;
|
||||
case IXGBE_LINK_SPEED_UNKNOWN:
|
||||
default:
|
||||
baudrate = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
return baudrate;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue