Skip to content

Commit 28c0d77

Browse files
committed
Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue
Tony Nguyen says: ==================== Intel Wired LAN Driver Updates 2025-06-17 (ice, e1000e) For ice: Krishna Kumar modifies aRFS match criteria to correctly identify matching filters. Grzegorz fixes a memory leak in eswitch legacy mode. For e1000e: Vitaly sets clock frequency on some Nahum systems which may misreport their value. * '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue: e1000e: set fixed clock frequency indication for Nahum 11 and Nahum 13 ice: fix eswitch code memory leak in reset scenario net: ice: Perform accurate aRFS flow match ==================== Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents ae40962 + 688a0d6 commit 28c0d77

File tree

4 files changed

+69
-7
lines changed

4 files changed

+69
-7
lines changed

drivers/net/ethernet/intel/e1000e/netdev.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3534,9 +3534,6 @@ s32 e1000e_get_base_timinca(struct e1000_adapter *adapter, u32 *timinca)
35343534
case e1000_pch_cnp:
35353535
case e1000_pch_tgp:
35363536
case e1000_pch_adp:
3537-
case e1000_pch_mtp:
3538-
case e1000_pch_lnp:
3539-
case e1000_pch_ptp:
35403537
case e1000_pch_nvp:
35413538
if (er32(TSYNCRXCTL) & E1000_TSYNCRXCTL_SYSCFI) {
35423539
/* Stable 24MHz frequency */
@@ -3552,6 +3549,17 @@ s32 e1000e_get_base_timinca(struct e1000_adapter *adapter, u32 *timinca)
35523549
adapter->cc.shift = shift;
35533550
}
35543551
break;
3552+
case e1000_pch_mtp:
3553+
case e1000_pch_lnp:
3554+
case e1000_pch_ptp:
3555+
/* System firmware can misreport this value, so set it to a
3556+
* stable 38400KHz frequency.
3557+
*/
3558+
incperiod = INCPERIOD_38400KHZ;
3559+
incvalue = INCVALUE_38400KHZ;
3560+
shift = INCVALUE_SHIFT_38400KHZ;
3561+
adapter->cc.shift = shift;
3562+
break;
35553563
case e1000_82574:
35563564
case e1000_82583:
35573565
/* Stable 25MHz frequency */

drivers/net/ethernet/intel/e1000e/ptp.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -295,15 +295,17 @@ void e1000e_ptp_init(struct e1000_adapter *adapter)
295295
case e1000_pch_cnp:
296296
case e1000_pch_tgp:
297297
case e1000_pch_adp:
298-
case e1000_pch_mtp:
299-
case e1000_pch_lnp:
300-
case e1000_pch_ptp:
301298
case e1000_pch_nvp:
302299
if (er32(TSYNCRXCTL) & E1000_TSYNCRXCTL_SYSCFI)
303300
adapter->ptp_clock_info.max_adj = MAX_PPB_24MHZ;
304301
else
305302
adapter->ptp_clock_info.max_adj = MAX_PPB_38400KHZ;
306303
break;
304+
case e1000_pch_mtp:
305+
case e1000_pch_lnp:
306+
case e1000_pch_ptp:
307+
adapter->ptp_clock_info.max_adj = MAX_PPB_38400KHZ;
308+
break;
307309
case e1000_82574:
308310
case e1000_82583:
309311
adapter->ptp_clock_info.max_adj = MAX_PPB_25MHZ;

drivers/net/ethernet/intel/ice/ice_arfs.c

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,50 @@ ice_arfs_is_perfect_flow_set(struct ice_hw *hw, __be16 l3_proto, u8 l4_proto)
377377
return false;
378378
}
379379

380+
/**
381+
* ice_arfs_cmp - Check if aRFS filter matches this flow.
382+
* @fltr_info: filter info of the saved ARFS entry.
383+
* @fk: flow dissector keys.
384+
* @n_proto: One of htons(ETH_P_IP) or htons(ETH_P_IPV6).
385+
* @ip_proto: One of IPPROTO_TCP or IPPROTO_UDP.
386+
*
387+
* Since this function assumes limited values for n_proto and ip_proto, it
388+
* is meant to be called only from ice_rx_flow_steer().
389+
*
390+
* Return:
391+
* * true - fltr_info refers to the same flow as fk.
392+
* * false - fltr_info and fk refer to different flows.
393+
*/
394+
static bool
395+
ice_arfs_cmp(const struct ice_fdir_fltr *fltr_info, const struct flow_keys *fk,
396+
__be16 n_proto, u8 ip_proto)
397+
{
398+
/* Determine if the filter is for IPv4 or IPv6 based on flow_type,
399+
* which is one of ICE_FLTR_PTYPE_NONF_IPV{4,6}_{TCP,UDP}.
400+
*/
401+
bool is_v4 = fltr_info->flow_type == ICE_FLTR_PTYPE_NONF_IPV4_TCP ||
402+
fltr_info->flow_type == ICE_FLTR_PTYPE_NONF_IPV4_UDP;
403+
404+
/* Following checks are arranged in the quickest and most discriminative
405+
* fields first for early failure.
406+
*/
407+
if (is_v4)
408+
return n_proto == htons(ETH_P_IP) &&
409+
fltr_info->ip.v4.src_port == fk->ports.src &&
410+
fltr_info->ip.v4.dst_port == fk->ports.dst &&
411+
fltr_info->ip.v4.src_ip == fk->addrs.v4addrs.src &&
412+
fltr_info->ip.v4.dst_ip == fk->addrs.v4addrs.dst &&
413+
fltr_info->ip.v4.proto == ip_proto;
414+
415+
return fltr_info->ip.v6.src_port == fk->ports.src &&
416+
fltr_info->ip.v6.dst_port == fk->ports.dst &&
417+
fltr_info->ip.v6.proto == ip_proto &&
418+
!memcmp(&fltr_info->ip.v6.src_ip, &fk->addrs.v6addrs.src,
419+
sizeof(struct in6_addr)) &&
420+
!memcmp(&fltr_info->ip.v6.dst_ip, &fk->addrs.v6addrs.dst,
421+
sizeof(struct in6_addr));
422+
}
423+
380424
/**
381425
* ice_rx_flow_steer - steer the Rx flow to where application is being run
382426
* @netdev: ptr to the netdev being adjusted
@@ -448,6 +492,10 @@ ice_rx_flow_steer(struct net_device *netdev, const struct sk_buff *skb,
448492
continue;
449493

450494
fltr_info = &arfs_entry->fltr_info;
495+
496+
if (!ice_arfs_cmp(fltr_info, &fk, n_proto, ip_proto))
497+
continue;
498+
451499
ret = fltr_info->fltr_id;
452500

453501
if (fltr_info->q_index == rxq_idx ||

drivers/net/ethernet/intel/ice/ice_eswitch.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,10 +508,14 @@ ice_eswitch_attach(struct ice_pf *pf, struct ice_repr *repr, unsigned long *id)
508508
*/
509509
int ice_eswitch_attach_vf(struct ice_pf *pf, struct ice_vf *vf)
510510
{
511-
struct ice_repr *repr = ice_repr_create_vf(vf);
512511
struct devlink *devlink = priv_to_devlink(pf);
512+
struct ice_repr *repr;
513513
int err;
514514

515+
if (!ice_is_eswitch_mode_switchdev(pf))
516+
return 0;
517+
518+
repr = ice_repr_create_vf(vf);
515519
if (IS_ERR(repr))
516520
return PTR_ERR(repr);
517521

0 commit comments

Comments
 (0)