Skip to content

Commit 452446f

Browse files
committed
Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue
Tony Nguyen says: ==================== Intel Wired LAN Driver Updates 2025-04-11 (ice, i40e, ixgbe, igc, e1000e) For ice: Mateusz and Larysa add support for LLDP packets to be received on a VF and transmitted by a VF in switchdev mode. Additional information: https://lore.kernel.org/intel-wired-lan/[email protected]/ Karol adds timesync support for E825C devices using 2xNAC (Network Acceleration Complex) configuration. 2xNAC mode is the mode in which IO die is housing two complexes and each of them has its own PHY connected to it. Martyna adds messaging to clarify filter errors when recipe space is exhausted. Colin Ian King adds static modifier to a const array to avoid stack usage. For i40e: Kyungwook Boo changes variable declaration types to prevent possible underflow. For ixgbe: Rand Deeb adjusts retry values so that retries are attempted. For igc: Rui Salvaterra sets VLAN offloads to be enabled as default. For e1000e: Piotr Wejman converts driver to use newer hardware timestamping API. * '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue: net: e1000e: convert to ndo_hwtstamp_get() and ndo_hwtstamp_set() igc: enable HW vlan tag insertion/stripping by default ixgbe: Fix unreachable retry logic in combined and byte I2C write functions i40e: fix MMIO write access to an invalid page in i40e_clear_hw ice: make const read-only array dflt_rules static ice: improve error message for insufficient filter space ice: enable timesync operation on 2xNAC E825 devices ice: refactor ice_sbq_msg_dev enum ice: remove SW side band access workaround for E825 ice: enable LLDP TX for VFs through tc ice: support egress drop rules on PF ice: remove headers argument from ice_tc_count_lkups ice: receive LLDP on trusted VFs ice: do not add LLDP-specific filter if not necessary ice: fix check for existing switch rule ==================== Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents 63c5e95 + 39aa687 commit 452446f

29 files changed

+685
-192
lines changed

drivers/net/ethernet/intel/e1000e/e1000.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ struct e1000_adapter {
319319
u16 tx_ring_count;
320320
u16 rx_ring_count;
321321

322-
struct hwtstamp_config hwtstamp_config;
322+
struct kernel_hwtstamp_config hwtstamp_config;
323323
struct delayed_work systim_overflow_work;
324324
struct sk_buff *tx_hwtstamp_skb;
325325
unsigned long tx_hwtstamp_start;

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

Lines changed: 37 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -3574,6 +3574,7 @@ s32 e1000e_get_base_timinca(struct e1000_adapter *adapter, u32 *timinca)
35743574
* e1000e_config_hwtstamp - configure the hwtstamp registers and enable/disable
35753575
* @adapter: board private structure
35763576
* @config: timestamp configuration
3577+
* @extack: netlink extended ACK for error report
35773578
*
35783579
* Outgoing time stamping can be enabled and disabled. Play nice and
35793580
* disable it when requested, although it shouldn't cause any overhead
@@ -3587,7 +3588,8 @@ s32 e1000e_get_base_timinca(struct e1000_adapter *adapter, u32 *timinca)
35873588
* exception of "all V2 events regardless of level 2 or 4".
35883589
**/
35893590
static int e1000e_config_hwtstamp(struct e1000_adapter *adapter,
3590-
struct hwtstamp_config *config)
3591+
struct kernel_hwtstamp_config *config,
3592+
struct netlink_ext_ack *extack)
35913593
{
35923594
struct e1000_hw *hw = &adapter->hw;
35933595
u32 tsync_tx_ctl = E1000_TSYNCTXCTL_ENABLED;
@@ -3598,8 +3600,10 @@ static int e1000e_config_hwtstamp(struct e1000_adapter *adapter,
35983600
bool is_l2 = false;
35993601
u32 regval;
36003602

3601-
if (!(adapter->flags & FLAG_HAS_HW_TIMESTAMP))
3603+
if (!(adapter->flags & FLAG_HAS_HW_TIMESTAMP)) {
3604+
NL_SET_ERR_MSG(extack, "No HW timestamp support");
36023605
return -EINVAL;
3606+
}
36033607

36043608
switch (config->tx_type) {
36053609
case HWTSTAMP_TX_OFF:
@@ -3608,6 +3612,7 @@ static int e1000e_config_hwtstamp(struct e1000_adapter *adapter,
36083612
case HWTSTAMP_TX_ON:
36093613
break;
36103614
default:
3615+
NL_SET_ERR_MSG(extack, "Unsupported TX HW timestamp type");
36113616
return -ERANGE;
36123617
}
36133618

@@ -3681,6 +3686,7 @@ static int e1000e_config_hwtstamp(struct e1000_adapter *adapter,
36813686
config->rx_filter = HWTSTAMP_FILTER_ALL;
36823687
break;
36833688
default:
3689+
NL_SET_ERR_MSG(extack, "Unsupported RX HW timestamp filter");
36843690
return -ERANGE;
36853691
}
36863692

@@ -3693,7 +3699,8 @@ static int e1000e_config_hwtstamp(struct e1000_adapter *adapter,
36933699
ew32(TSYNCTXCTL, regval);
36943700
if ((er32(TSYNCTXCTL) & E1000_TSYNCTXCTL_ENABLED) !=
36953701
(regval & E1000_TSYNCTXCTL_ENABLED)) {
3696-
e_err("Timesync Tx Control register not set as expected\n");
3702+
NL_SET_ERR_MSG(extack,
3703+
"Timesync Tx Control register not set as expected");
36973704
return -EAGAIN;
36983705
}
36993706

@@ -3706,7 +3713,8 @@ static int e1000e_config_hwtstamp(struct e1000_adapter *adapter,
37063713
E1000_TSYNCRXCTL_TYPE_MASK)) !=
37073714
(regval & (E1000_TSYNCRXCTL_ENABLED |
37083715
E1000_TSYNCRXCTL_TYPE_MASK))) {
3709-
e_err("Timesync Rx Control register not set as expected\n");
3716+
NL_SET_ERR_MSG(extack,
3717+
"Timesync Rx Control register not set as expected");
37103718
return -EAGAIN;
37113719
}
37123720

@@ -3901,6 +3909,7 @@ static void e1000e_systim_reset(struct e1000_adapter *adapter)
39013909
{
39023910
struct ptp_clock_info *info = &adapter->ptp_clock_info;
39033911
struct e1000_hw *hw = &adapter->hw;
3912+
struct netlink_ext_ack extack = {};
39043913
unsigned long flags;
39053914
u32 timinca;
39063915
s32 ret_val;
@@ -3932,7 +3941,12 @@ static void e1000e_systim_reset(struct e1000_adapter *adapter)
39323941
spin_unlock_irqrestore(&adapter->systim_lock, flags);
39333942

39343943
/* restore the previous hwtstamp configuration settings */
3935-
e1000e_config_hwtstamp(adapter, &adapter->hwtstamp_config);
3944+
ret_val = e1000e_config_hwtstamp(adapter, &adapter->hwtstamp_config,
3945+
&extack);
3946+
if (ret_val) {
3947+
if (extack._msg)
3948+
e_err("%s\n", extack._msg);
3949+
}
39363950
}
39373951

39383952
/**
@@ -6079,8 +6093,7 @@ static int e1000_change_mtu(struct net_device *netdev, int new_mtu)
60796093
return 0;
60806094
}
60816095

6082-
static int e1000_mii_ioctl(struct net_device *netdev, struct ifreq *ifr,
6083-
int cmd)
6096+
static int e1000_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
60846097
{
60856098
struct e1000_adapter *adapter = netdev_priv(netdev);
60866099
struct mii_ioctl_data *data = if_mii(ifr);
@@ -6140,7 +6153,8 @@ static int e1000_mii_ioctl(struct net_device *netdev, struct ifreq *ifr,
61406153
/**
61416154
* e1000e_hwtstamp_set - control hardware time stamping
61426155
* @netdev: network interface device structure
6143-
* @ifr: interface request
6156+
* @config: timestamp configuration
6157+
* @extack: netlink extended ACK report
61446158
*
61456159
* Outgoing time stamping can be enabled and disabled. Play nice and
61466160
* disable it when requested, although it shouldn't cause any overhead
@@ -6153,20 +6167,18 @@ static int e1000_mii_ioctl(struct net_device *netdev, struct ifreq *ifr,
61536167
* specified. Matching the kind of event packet is not supported, with the
61546168
* exception of "all V2 events regardless of level 2 or 4".
61556169
**/
6156-
static int e1000e_hwtstamp_set(struct net_device *netdev, struct ifreq *ifr)
6170+
static int e1000e_hwtstamp_set(struct net_device *netdev,
6171+
struct kernel_hwtstamp_config *config,
6172+
struct netlink_ext_ack *extack)
61576173
{
61586174
struct e1000_adapter *adapter = netdev_priv(netdev);
6159-
struct hwtstamp_config config;
61606175
int ret_val;
61616176

6162-
if (copy_from_user(&config, ifr->ifr_data, sizeof(config)))
6163-
return -EFAULT;
6164-
6165-
ret_val = e1000e_config_hwtstamp(adapter, &config);
6177+
ret_val = e1000e_config_hwtstamp(adapter, config, extack);
61666178
if (ret_val)
61676179
return ret_val;
61686180

6169-
switch (config.rx_filter) {
6181+
switch (config->rx_filter) {
61706182
case HWTSTAMP_FILTER_PTP_V2_L4_SYNC:
61716183
case HWTSTAMP_FILTER_PTP_V2_L2_SYNC:
61726184
case HWTSTAMP_FILTER_PTP_V2_SYNC:
@@ -6178,38 +6190,23 @@ static int e1000e_hwtstamp_set(struct net_device *netdev, struct ifreq *ifr)
61786190
* by hardware so notify the caller the requested packets plus
61796191
* some others are time stamped.
61806192
*/
6181-
config.rx_filter = HWTSTAMP_FILTER_SOME;
6193+
config->rx_filter = HWTSTAMP_FILTER_SOME;
61826194
break;
61836195
default:
61846196
break;
61856197
}
61866198

6187-
return copy_to_user(ifr->ifr_data, &config,
6188-
sizeof(config)) ? -EFAULT : 0;
6199+
return 0;
61896200
}
61906201

6191-
static int e1000e_hwtstamp_get(struct net_device *netdev, struct ifreq *ifr)
6202+
static int e1000e_hwtstamp_get(struct net_device *netdev,
6203+
struct kernel_hwtstamp_config *kernel_config)
61926204
{
61936205
struct e1000_adapter *adapter = netdev_priv(netdev);
61946206

6195-
return copy_to_user(ifr->ifr_data, &adapter->hwtstamp_config,
6196-
sizeof(adapter->hwtstamp_config)) ? -EFAULT : 0;
6197-
}
6207+
*kernel_config = adapter->hwtstamp_config;
61986208

6199-
static int e1000_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
6200-
{
6201-
switch (cmd) {
6202-
case SIOCGMIIPHY:
6203-
case SIOCGMIIREG:
6204-
case SIOCSMIIREG:
6205-
return e1000_mii_ioctl(netdev, ifr, cmd);
6206-
case SIOCSHWTSTAMP:
6207-
return e1000e_hwtstamp_set(netdev, ifr);
6208-
case SIOCGHWTSTAMP:
6209-
return e1000e_hwtstamp_get(netdev, ifr);
6210-
default:
6211-
return -EOPNOTSUPP;
6212-
}
6209+
return 0;
62136210
}
62146211

62156212
static int e1000_init_phy_wakeup(struct e1000_adapter *adapter, u32 wufc)
@@ -7346,9 +7343,11 @@ static const struct net_device_ops e1000e_netdev_ops = {
73467343
#ifdef CONFIG_NET_POLL_CONTROLLER
73477344
.ndo_poll_controller = e1000_netpoll,
73487345
#endif
7349-
.ndo_set_features = e1000_set_features,
7350-
.ndo_fix_features = e1000_fix_features,
7346+
.ndo_set_features = e1000_set_features,
7347+
.ndo_fix_features = e1000_fix_features,
73517348
.ndo_features_check = passthru_features_check,
7349+
.ndo_hwtstamp_get = e1000e_hwtstamp_get,
7350+
.ndo_hwtstamp_set = e1000e_hwtstamp_set,
73527351
};
73537352

73547353
/**

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -817,10 +817,11 @@ int i40e_pf_reset(struct i40e_hw *hw)
817817
void i40e_clear_hw(struct i40e_hw *hw)
818818
{
819819
u32 num_queues, base_queue;
820-
u32 num_pf_int;
821-
u32 num_vf_int;
820+
s32 num_pf_int;
821+
s32 num_vf_int;
822822
u32 num_vfs;
823-
u32 i, j;
823+
s32 i;
824+
u32 j;
824825
u32 val;
825826
u32 eol = 0x7ff;
826827

drivers/net/ethernet/intel/ice/ice.h

Lines changed: 59 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,6 @@
193193

194194
#define ice_pf_to_dev(pf) (&((pf)->pdev->dev))
195195

196-
#define ice_pf_src_tmr_owned(pf) ((pf)->hw.func_caps.ts_func_info.src_tmr_owned)
197-
198196
enum ice_feature {
199197
ICE_F_DSCP,
200198
ICE_F_PHY_RCLK,
@@ -515,6 +513,7 @@ enum ice_pf_flags {
515513
ICE_FLAG_MTU_CHANGED,
516514
ICE_FLAG_GNSS, /* GNSS successfully initialized */
517515
ICE_FLAG_DPLL, /* SyncE/PTP dplls initialized */
516+
ICE_FLAG_LLDP_AQ_FLTR,
518517
ICE_PF_FLAGS_NBITS /* must be last */
519518
};
520519

@@ -1045,4 +1044,62 @@ static inline void ice_clear_rdma_cap(struct ice_pf *pf)
10451044
}
10461045

10471046
extern const struct xdp_metadata_ops ice_xdp_md_ops;
1047+
1048+
/**
1049+
* ice_is_dual - Check if given config is multi-NAC
1050+
* @hw: pointer to HW structure
1051+
*
1052+
* Return: true if the device is running in mutli-NAC (Network
1053+
* Acceleration Complex) configuration variant, false otherwise
1054+
* (always false for non-E825 devices).
1055+
*/
1056+
static inline bool ice_is_dual(struct ice_hw *hw)
1057+
{
1058+
return hw->mac_type == ICE_MAC_GENERIC_3K_E825 &&
1059+
(hw->dev_caps.nac_topo.mode & ICE_NAC_TOPO_DUAL_M);
1060+
}
1061+
1062+
/**
1063+
* ice_is_primary - Check if given device belongs to the primary complex
1064+
* @hw: pointer to HW structure
1065+
*
1066+
* Check if given PF/HW is running on primary complex in multi-NAC
1067+
* configuration.
1068+
*
1069+
* Return: true if the device is dual, false otherwise (always true
1070+
* for non-E825 devices).
1071+
*/
1072+
static inline bool ice_is_primary(struct ice_hw *hw)
1073+
{
1074+
return hw->mac_type != ICE_MAC_GENERIC_3K_E825 ||
1075+
!ice_is_dual(hw) ||
1076+
(hw->dev_caps.nac_topo.mode & ICE_NAC_TOPO_PRIMARY_M);
1077+
}
1078+
1079+
/**
1080+
* ice_pf_src_tmr_owned - Check if a primary timer is owned by PF
1081+
* @pf: pointer to PF structure
1082+
*
1083+
* Return: true if PF owns primary timer, false otherwise.
1084+
*/
1085+
static inline bool ice_pf_src_tmr_owned(struct ice_pf *pf)
1086+
{
1087+
return pf->hw.func_caps.ts_func_info.src_tmr_owned &&
1088+
ice_is_primary(&pf->hw);
1089+
}
1090+
1091+
/**
1092+
* ice_get_primary_hw - Get pointer to primary ice_hw structure
1093+
* @pf: pointer to PF structure
1094+
*
1095+
* Return: A pointer to ice_hw structure with access to timesync
1096+
* register space.
1097+
*/
1098+
static inline struct ice_hw *ice_get_primary_hw(struct ice_pf *pf)
1099+
{
1100+
if (!pf->adapter->ctrl_pf)
1101+
return &pf->hw;
1102+
else
1103+
return &pf->adapter->ctrl_pf->hw;
1104+
}
10481105
#endif /* _ICE_H_ */

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

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1135,6 +1135,8 @@ int ice_init_hw(struct ice_hw *hw)
11351135
}
11361136
}
11371137

1138+
hw->lane_num = ice_get_phy_lane_number(hw);
1139+
11381140
return 0;
11391141
err_unroll_fltr_mgmt_struct:
11401142
ice_cleanup_fltr_mgmt_struct(hw);
@@ -3434,7 +3436,7 @@ int ice_aq_get_fec_stats(struct ice_hw *hw, u16 pcs_quad, u16 pcs_port,
34343436
msg.msg_addr_low = lower_16_bits(reg_offset);
34353437
msg.msg_addr_high = receiver_id;
34363438
msg.opcode = ice_sbq_msg_rd;
3437-
msg.dest_dev = rmn_0;
3439+
msg.dest_dev = ice_sbq_dev_phy_0;
34383440

34393441
err = ice_sbq_rw_reg(hw, &msg, flag);
34403442
if (err)
@@ -4082,10 +4084,12 @@ int ice_get_phy_lane_number(struct ice_hw *hw)
40824084
continue;
40834085

40844086
if (hw->pf_id == lport) {
4087+
if (hw->mac_type == ICE_MAC_GENERIC_3K_E825 &&
4088+
ice_is_dual(hw) && !ice_is_primary(hw))
4089+
lane += ICE_PORTS_PER_QUAD;
40854090
kfree(options);
40864091
return lane;
40874092
}
4088-
40894093
lport++;
40904094
}
40914095

@@ -6011,15 +6015,21 @@ bool ice_fw_supports_lldp_fltr_ctrl(struct ice_hw *hw)
60116015
/**
60126016
* ice_lldp_fltr_add_remove - add or remove a LLDP Rx switch filter
60136017
* @hw: pointer to HW struct
6014-
* @vsi_num: absolute HW index for VSI
6018+
* @vsi: VSI to add the filter to
60156019
* @add: boolean for if adding or removing a filter
6020+
*
6021+
* Return: 0 on success, -EOPNOTSUPP if the operation cannot be performed
6022+
* with this HW or VSI, otherwise an error corresponding to
6023+
* the AQ transaction result.
60166024
*/
6017-
int
6018-
ice_lldp_fltr_add_remove(struct ice_hw *hw, u16 vsi_num, bool add)
6025+
int ice_lldp_fltr_add_remove(struct ice_hw *hw, struct ice_vsi *vsi, bool add)
60196026
{
60206027
struct ice_aqc_lldp_filter_ctrl *cmd;
60216028
struct ice_aq_desc desc;
60226029

6030+
if (vsi->type != ICE_VSI_PF || !ice_fw_supports_lldp_fltr_ctrl(hw))
6031+
return -EOPNOTSUPP;
6032+
60236033
cmd = &desc.params.lldp_filter_ctrl;
60246034

60256035
ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_lldp_filter_ctrl);
@@ -6029,7 +6039,7 @@ ice_lldp_fltr_add_remove(struct ice_hw *hw, u16 vsi_num, bool add)
60296039
else
60306040
cmd->cmd_flags = ICE_AQC_LLDP_FILTER_ACTION_DELETE;
60316041

6032-
cmd->vsi_num = cpu_to_le16(vsi_num);
6042+
cmd->vsi_num = cpu_to_le16(vsi->vsi_num);
60336043

60346044
return ice_aq_send_cmd(hw, &desc, NULL, 0, NULL);
60356045
}

drivers/net/ethernet/intel/ice/ice_common.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,8 +290,7 @@ int
290290
ice_aq_set_lldp_mib(struct ice_hw *hw, u8 mib_type, void *buf, u16 buf_size,
291291
struct ice_sq_cd *cd);
292292
bool ice_fw_supports_lldp_fltr_ctrl(struct ice_hw *hw);
293-
int
294-
ice_lldp_fltr_add_remove(struct ice_hw *hw, u16 vsi_num, bool add);
293+
int ice_lldp_fltr_add_remove(struct ice_hw *hw, struct ice_vsi *vsi, bool add);
295294
int ice_lldp_execute_pending_mib(struct ice_hw *hw);
296295
int
297296
ice_aq_read_i2c(struct ice_hw *hw, struct ice_aqc_link_topo_addr topo_addr,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -846,7 +846,7 @@ int ice_init_pf_dcb(struct ice_pf *pf, bool locked)
846846
goto dcb_init_err;
847847
}
848848

849-
ice_cfg_sw_lldp(pf_vsi, false, true);
849+
ice_cfg_sw_rx_lldp(pf, true);
850850

851851
pf->dcbx_cap = ice_dcb_get_mode(port_info, true);
852852
return 0;

0 commit comments

Comments
 (0)