Skip to content

Commit ef332fe

Browse files
committed
Merge branch '10GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue
Tony Nguyen says: ==================== Intel Wired LAN Driver Updates 2022-08-24 (ixgbe, i40e) This series contains updates to ixgbe and i40e drivers. Jake stops incorrect resetting of SYSTIME registers when starting cyclecounter for ixgbe. Sylwester corrects a check on source IP address when validating destination for i40e. * '10GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue: i40e: Fix incorrect address type for IPv6 flow rules ixgbe: stop resetting SYSTIME in ixgbe_ptp_start_cyclecounter ==================== Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents 92df825 + bcf3a15 commit ef332fe

File tree

2 files changed

+47
-14
lines changed

2 files changed

+47
-14
lines changed

drivers/net/ethernet/intel/i40e/i40e_ethtool.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4485,7 +4485,7 @@ static int i40e_check_fdir_input_set(struct i40e_vsi *vsi,
44854485
(struct in6_addr *)&ipv6_full_mask))
44864486
new_mask |= I40E_L3_V6_DST_MASK;
44874487
else if (ipv6_addr_any((struct in6_addr *)
4488-
&usr_ip6_spec->ip6src))
4488+
&usr_ip6_spec->ip6dst))
44894489
new_mask &= ~I40E_L3_V6_DST_MASK;
44904490
else
44914491
return -EOPNOTSUPP;

drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c

Lines changed: 46 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1214,7 +1214,6 @@ void ixgbe_ptp_start_cyclecounter(struct ixgbe_adapter *adapter)
12141214
struct cyclecounter cc;
12151215
unsigned long flags;
12161216
u32 incval = 0;
1217-
u32 tsauxc = 0;
12181217
u32 fuse0 = 0;
12191218

12201219
/* For some of the boards below this mask is technically incorrect.
@@ -1249,18 +1248,6 @@ void ixgbe_ptp_start_cyclecounter(struct ixgbe_adapter *adapter)
12491248
case ixgbe_mac_x550em_a:
12501249
case ixgbe_mac_X550:
12511250
cc.read = ixgbe_ptp_read_X550;
1252-
1253-
/* enable SYSTIME counter */
1254-
IXGBE_WRITE_REG(hw, IXGBE_SYSTIMR, 0);
1255-
IXGBE_WRITE_REG(hw, IXGBE_SYSTIML, 0);
1256-
IXGBE_WRITE_REG(hw, IXGBE_SYSTIMH, 0);
1257-
tsauxc = IXGBE_READ_REG(hw, IXGBE_TSAUXC);
1258-
IXGBE_WRITE_REG(hw, IXGBE_TSAUXC,
1259-
tsauxc & ~IXGBE_TSAUXC_DISABLE_SYSTIME);
1260-
IXGBE_WRITE_REG(hw, IXGBE_TSIM, IXGBE_TSIM_TXTS);
1261-
IXGBE_WRITE_REG(hw, IXGBE_EIMS, IXGBE_EIMS_TIMESYNC);
1262-
1263-
IXGBE_WRITE_FLUSH(hw);
12641251
break;
12651252
case ixgbe_mac_X540:
12661253
cc.read = ixgbe_ptp_read_82599;
@@ -1292,6 +1279,50 @@ void ixgbe_ptp_start_cyclecounter(struct ixgbe_adapter *adapter)
12921279
spin_unlock_irqrestore(&adapter->tmreg_lock, flags);
12931280
}
12941281

1282+
/**
1283+
* ixgbe_ptp_init_systime - Initialize SYSTIME registers
1284+
* @adapter: the ixgbe private board structure
1285+
*
1286+
* Initialize and start the SYSTIME registers.
1287+
*/
1288+
static void ixgbe_ptp_init_systime(struct ixgbe_adapter *adapter)
1289+
{
1290+
struct ixgbe_hw *hw = &adapter->hw;
1291+
u32 tsauxc;
1292+
1293+
switch (hw->mac.type) {
1294+
case ixgbe_mac_X550EM_x:
1295+
case ixgbe_mac_x550em_a:
1296+
case ixgbe_mac_X550:
1297+
tsauxc = IXGBE_READ_REG(hw, IXGBE_TSAUXC);
1298+
1299+
/* Reset SYSTIME registers to 0 */
1300+
IXGBE_WRITE_REG(hw, IXGBE_SYSTIMR, 0);
1301+
IXGBE_WRITE_REG(hw, IXGBE_SYSTIML, 0);
1302+
IXGBE_WRITE_REG(hw, IXGBE_SYSTIMH, 0);
1303+
1304+
/* Reset interrupt settings */
1305+
IXGBE_WRITE_REG(hw, IXGBE_TSIM, IXGBE_TSIM_TXTS);
1306+
IXGBE_WRITE_REG(hw, IXGBE_EIMS, IXGBE_EIMS_TIMESYNC);
1307+
1308+
/* Activate the SYSTIME counter */
1309+
IXGBE_WRITE_REG(hw, IXGBE_TSAUXC,
1310+
tsauxc & ~IXGBE_TSAUXC_DISABLE_SYSTIME);
1311+
break;
1312+
case ixgbe_mac_X540:
1313+
case ixgbe_mac_82599EB:
1314+
/* Reset SYSTIME registers to 0 */
1315+
IXGBE_WRITE_REG(hw, IXGBE_SYSTIML, 0);
1316+
IXGBE_WRITE_REG(hw, IXGBE_SYSTIMH, 0);
1317+
break;
1318+
default:
1319+
/* Other devices aren't supported */
1320+
return;
1321+
};
1322+
1323+
IXGBE_WRITE_FLUSH(hw);
1324+
}
1325+
12951326
/**
12961327
* ixgbe_ptp_reset
12971328
* @adapter: the ixgbe private board structure
@@ -1318,6 +1349,8 @@ void ixgbe_ptp_reset(struct ixgbe_adapter *adapter)
13181349

13191350
ixgbe_ptp_start_cyclecounter(adapter);
13201351

1352+
ixgbe_ptp_init_systime(adapter);
1353+
13211354
spin_lock_irqsave(&adapter->tmreg_lock, flags);
13221355
timecounter_init(&adapter->hw_tc, &adapter->hw_cc,
13231356
ktime_to_ns(ktime_get_real()));

0 commit comments

Comments
 (0)