ixgbe: Avoid a signed shift while assembling the PHY ID
The PHY identifier word is promoted to signed int when the cast is
applied after the shift. Cast the 16-bit register value first so
identifiers with their high bit set are assembled as unsigned data.
MFC after: 2 weeks
e1000: Avoid signed shifts while assembling PHY IDs
PHY identifier words are promoted to signed int when the cast is applied
after the shift. Cast each 16-bit register value first so identifiers
with their high bit set are assembled as unsigned data.
MFC after: 2 weeks
ixgbe: Avoid a signed shift while assembling the PBA number
The EEPROM word is promoted to signed int before the left shift when
the cast is applied to the complete expression. Cast the word first so
all 16-bit values are shifted as unsigned data.
This is the ixgbe counterpart of the e1000 correction imported from
DPDK commit b932270c66.
MFC after: 2 weeks
igc: Check PHY control register reads
Do not modify a zero-initialized PHY control value when its preceding
read failed. Leave the PHY unchanged when the void power helpers cannot
read its current state.
This follows the defensive checks added to the corresponding e1000
helpers.
MFC after: 2 weeks
igc: Avoid a signed shift while assembling the PHY ID
The PHY identifier word is promoted to signed int when the cast is
applied after the shift. Cast the 16-bit register value first so
identifiers with their high bit set are assembled as unsigned data.
MFC after: 2 weeks
igc: Export EEE Low Power Idle counters
The driver already accumulates the clear-on-read transmit and receive
LPI event counters. Expose the 64-bit totals under the per-device eee
sysctl node.
MFC after: 2 weeks
ixgbe: Avoid signed overflow in LED register masks
LED index three shifts the blink bit into bit 31. Convert the base to
the register width before shifting so the operation is unsigned.
This is the ixgbe counterpart of the e1000 correction imported from
DPDK commit 214cb0d7f1.
MFC after: 2 weeks
ixl: Avoid a signed PHY capability shift
The PHY capability display examines all 32 bits of the firmware bitmap.
Use an unsigned value so examining bit 31 does not shift a signed
integer into its sign bit.
MFC after: 2 weeks
e1000: Avoid a signed manageability VLAN bitmap shift
A manageability VLAN can select bit 31 of its VFTA register. Use an
unsigned value when constructing the register mask.
MFC after: 2 weeks
ixgbe: Use unsigned register bitmap shifts
VLAN, VMDq, and VF reset bit indices can reach 31. Use unsigned
values when constructing their 32-bit register masks so the shifts do
not operate on signed integers.
MFC after: 2 weeks
igc: Avoid a signed multicast bitmap shift
The multicast hash bit can be 31. Use an unsigned value so setting the
bit cannot shift a signed integer into its sign bit.
MFC after: 2 weeks
e1000: Avoid a signed multicast bitmap shift
The multicast hash bit can be 31. Use an unsigned value so setting the
bit cannot shift a signed integer into its sign bit.
MFC after: 2 weeks
igbv: Accept reset NACKs when no MAC is assigned
A reset NACK from a Linux PF means that the reset completed but no
permanent MAC address was assigned. Treat that response as a
successful reset with a zero permanent address so attach can generate
a local address instead of retrying a live mailbox.
FreeBSD PFs also use a one-dword reset NACK while retained queues are
being sanitized. Seed the otherwise unused request payload and accept
only the three-dword, zero-filled NACK used by Linux, preserving the
FreeBSD retry contract.
MFC after: 2 weeks
igc: fix MAC address hash bit shift
DPDK commit message
net/e1000/base: fix MAC address hash bit shift
In e1000_hash_mc_addr_generic() the expression:
"mc_addr[4] >> 8 - bit_shift", right shifting "mc_addr[4]"
shift by more than 7 bits always yields zero, so hash becomes not so
different. Add initialization with bit_shift = 1, and add a loop
condition to ensure bit_shift will be always in [1..8] range.
Fixes: af75078fece3 ("first public release")
Cc: stable at dpdk.org
Signed-off-by: Aleksandr Loktionov <aleksandr.loktionov at intel.com>
Signed-off-by: Anatoly Burakov <anatoly.burakov at intel.com>
[4 lines not shown]
igc: fix iterator type
DPDK commit message
net/e1000/base: fix iterator type
Fix static analysis warning about comparison between types of
incompatible width, which might lead to an infinite loop due to
overflow.
Fixes: af75078fece3 ("first public release")
Cc: stable at dpdk.org
Signed-off-by: Amir Avivi <amir.avivi at intel.com>
Signed-off-by: Anatoly Burakov <anatoly.burakov at intel.com>
Acked-by: Bruce Richardson <bruce.richardson at intel.com>
Obtained from: DPDK (3d36053991)
MFC after: 2 weeks
e1000: fix data type in MAC hash
DPDK commit message
net/e1000/base: fix data type in MAC hash
One of the bit shifts in MAC hash calculation triggers a static analysis
warning about a potential overflow. Fix the data type to avoid this.
Fixes: af75078fece3 ("first public release")
Cc: stable at dpdk.org
Signed-off-by: Barbara Skobiej <barbara.skobiej at intel.com>
Signed-off-by: Anatoly Burakov <anatoly.burakov at intel.com>
Acked-by: Bruce Richardson <bruce.richardson at intel.com>
Obtained from: DPDK (458734aaac)
MFC after: 2 weeks
ixgbe: Avoid a signed multicast bitmap shift
The multicast vector bit can be 31. Use an unsigned value so setting
the bit cannot shift a signed integer into its sign bit.
MFC after: 2 weeks
igc: fix data type in MAC hash
DPDK commit message
net/e1000/base: fix data type in MAC hash
One of the bit shifts in MAC hash calculation triggers a static analysis
warning about a potential overflow. Fix the data type to avoid this.
Fixes: af75078fece3 ("first public release")
Cc: stable at dpdk.org
Signed-off-by: Barbara Skobiej <barbara.skobiej at intel.com>
Signed-off-by: Anatoly Burakov <anatoly.burakov at intel.com>
Acked-by: Bruce Richardson <bruce.richardson at intel.com>
Obtained from: DPDK (458734aaac)
MFC after: 2 weeks
e1000: Verify i210 and i211 multicast table writes
The i210 and i211 can occasionally fail to accept multicast table
writes, particularly while addresses are added and removed rapidly.
Read the table back and rewrite mismatches for up to three passes.
This prevents multicast reception from retaining stale filter state
while keeping the workaround limited to the affected controllers.
MFC after: 2 weeks
e1000: fix reset for 82580
DPDK commit message
net/e1000/base: fix reset for 82580
Fix setting device reset status bit in e1000_reset_hw_82580() function
for 82580 by first reading the register value, and then setting the
device reset bit.
Fixes: af75078fece3 ("first public release")
Cc: stable at dpdk.org
Signed-off-by: Barbara Skobiej <barbara.skobiej at intel.com>
Signed-off-by: Anatoly Burakov <anatoly.burakov at intel.com>
Acked-by: Bruce Richardson <bruce.richardson at intel.com>
Obtained from: DPDK (88a1eb79ef)
MFC after: 2 weeks
e1000: fix MAC address hash bit shift
DPDK commit message
net/e1000/base: fix MAC address hash bit shift
In e1000_hash_mc_addr_generic() the expression:
"mc_addr[4] >> 8 - bit_shift", right shifting "mc_addr[4]"
shift by more than 7 bits always yields zero, so hash becomes not so
different. Add initialization with bit_shift = 1, and add a loop
condition to ensure bit_shift will be always in [1..8] range.
Fixes: af75078fece3 ("first public release")
Cc: stable at dpdk.org
Signed-off-by: Aleksandr Loktionov <aleksandr.loktionov at intel.com>
Signed-off-by: Anatoly Burakov <anatoly.burakov at intel.com>
[4 lines not shown]
sound: Retire sndcard_func
sndcard_func is used as an ivar which passes around device info to the
PCM and MIDI children in snd_csa(4) and snd_emu10kx(4). Simplify this
and retire the need for sndcard_func, by 1) making an ivar only what
used to be stored in sndcard_func->varinfo, 2) replacing
sndcard_func->func with a child comparison, where needed, for instance
in csa_detach().
sndcard_func is harmless in reality, but there is no reason to have the
additional complexity. This way we also avoid the structure allocations.
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
e1000: Export EEE Low Power Idle counters
Accumulate the clear-on-read transmit and receive LPI event counters
on EEE capable PCH and I350 family devices. Expose the 64-bit totals
under the per-device eee sysctl node.
MFC after: 2 weeks
e1000: add LPI counters
DPDK commit message
net/e1000/base: add LPI counters
Add new fields in structure to indicate if EEE LPI entries have been
observed on Tx and Rx path.
Signed-off-by: Sasha Neftin <sasha.neftin at intel.com>
Signed-off-by: Anatoly Burakov <anatoly.burakov at intel.com>
Acked-by: Bruce Richardson <bruce.richardson at intel.com>
Obtained from: DPDK (2e8078ee69)
MFC after: 2 weeks
e1000: fix unchecked return
DPDK commit message
net/e1000/base: fix unchecked return
Static analysis has detected a write that is not checked for errors,
leading to ignored error return value. Add a check.
Fixes: edcdb3c5f71b ("e1000/base: fix link flap on 82579")
Cc: stable at dpdk.org
Signed-off-by: Dima Ruinskiy <dima.ruinskiy at intel.com>
Signed-off-by: Anatoly Burakov <anatoly.burakov at intel.com>
Acked-by: Bruce Richardson <bruce.richardson at intel.com>
Obtained from: DPDK (b0b6b50c20)
MFC after: 2 weeks
e1000: Allow more time for PCH ULP exit
Firmware may take up to one second to unconfigure ULP, and affected
Lenovo systems have required nearly two seconds. Allow 2.5 seconds
before treating the transition as a PHY failure.
This extends DPDK commit 7aa4c34581a5 using the field-tested bound
from Linux commit 3cf31b1a9eff.
MFC after: 2 weeks