mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2025-01-13 09:15:02 +08:00
Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue
Tony Nguyen says: ==================== 40GbE Intel Wired LAN Driver Updates 2022-03-17 This series contains updates to i40e and igb drivers. Tom Rix moves a conversion to little endian to occur only when the value is used for i40e. He also zeros out a structure to resolve possible use of garbage value for igb as reported by clang. * '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue: igb: zero hwtstamp by default i40e: little endian only valid checksums ==================== Link: https://lore.kernel.org/r/20220317160236.3534321-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
commit
49270afa03
@ -682,10 +682,11 @@ i40e_status i40e_update_nvm_checksum(struct i40e_hw *hw)
|
||||
__le16 le_sum;
|
||||
|
||||
ret_code = i40e_calc_nvm_checksum(hw, &checksum);
|
||||
le_sum = cpu_to_le16(checksum);
|
||||
if (!ret_code)
|
||||
if (!ret_code) {
|
||||
le_sum = cpu_to_le16(checksum);
|
||||
ret_code = i40e_write_nvm_aq(hw, 0x00, I40E_SR_SW_CHECKSUM_WORD,
|
||||
1, &le_sum, true);
|
||||
}
|
||||
|
||||
return ret_code;
|
||||
}
|
||||
|
@ -165,23 +165,21 @@ static void igb_ptp_systim_to_hwtstamp(struct igb_adapter *adapter,
|
||||
unsigned long flags;
|
||||
u64 ns;
|
||||
|
||||
memset(hwtstamps, 0, sizeof(*hwtstamps));
|
||||
|
||||
switch (adapter->hw.mac.type) {
|
||||
case e1000_82576:
|
||||
case e1000_82580:
|
||||
case e1000_i354:
|
||||
case e1000_i350:
|
||||
spin_lock_irqsave(&adapter->tmreg_lock, flags);
|
||||
|
||||
ns = timecounter_cyc2time(&adapter->tc, systim);
|
||||
|
||||
spin_unlock_irqrestore(&adapter->tmreg_lock, flags);
|
||||
|
||||
memset(hwtstamps, 0, sizeof(*hwtstamps));
|
||||
hwtstamps->hwtstamp = ns_to_ktime(ns);
|
||||
break;
|
||||
case e1000_i210:
|
||||
case e1000_i211:
|
||||
memset(hwtstamps, 0, sizeof(*hwtstamps));
|
||||
/* Upper 32 bits contain s, lower 32 bits contain ns. */
|
||||
hwtstamps->hwtstamp = ktime_set(systim >> 32,
|
||||
systim & 0xFFFFFFFF);
|
||||
|
Loading…
Reference in New Issue
Block a user