aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSasha Neftin <sasha.neftin@intel.com>2025-02-07 12:45:22 +0000
committerKevin Bowling <kbowling@FreeBSD.org>2026-08-11 19:43:36 +0000
commit8e8755e011955d12abab7c2be324429cccf0b975 (patch)
treec801e340432ab15225a3b58e4efe883fdf52e9cc
parent0fc30789dff08d62c5c830e9aa8c5a0ca9080ad9 (diff)
e1000: improve NVM checksum handling
DPDK commit message net/e1000/base: improve NVM checksum handling When reading NVM checksum, we may encounter the following scenarios: - Checksum may be invalid, and can be updated - Checksum may be invalid but cannot be updated because NVM is read-only For the latter case, we should just ignore invalid checksum and not attempt to update it. Signed-off-by: Sasha Neftin <sasha.neftin@intel.com> Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com> Obtained from: DPDK (5241c17f0d) MFC after: 2 weeks
-rw-r--r--sys/dev/e1000/e1000_ich8lan.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/sys/dev/e1000/e1000_ich8lan.c b/sys/dev/e1000/e1000_ich8lan.c
index d454b2ede3dc..1a67f4d8f42d 100644
--- a/sys/dev/e1000/e1000_ich8lan.c
+++ b/sys/dev/e1000/e1000_ich8lan.c
@@ -4436,13 +4436,20 @@ static s32 e1000_validate_nvm_checksum_ich8lan(struct e1000_hw *hw)
return ret_val;
if (!(data & valid_csum_mask)) {
- data |= valid_csum_mask;
- ret_val = hw->nvm.ops.write(hw, word, 1, &data);
- if (ret_val)
- return ret_val;
- ret_val = hw->nvm.ops.update(hw);
- if (ret_val)
- return ret_val;
+ DEBUGOUT("NVM checksum valid bit not set\n");
+
+ if (hw->mac.type < e1000_pch_tgp) {
+ data |= valid_csum_mask;
+ ret_val = hw->nvm.ops.write(hw, word, 1, &data);
+ if (ret_val)
+ return ret_val;
+ ret_val = hw->nvm.ops.update(hw);
+ if (ret_val)
+ return ret_val;
+ } else if (hw->mac.type == e1000_pch_tgp) {
+ /* Transitional TGP images may omit the valid bit. */
+ return E1000_SUCCESS;
+ }
}
return e1000_validate_nvm_checksum_generic(hw);