Merge branch 'intel-wired-lan-driver-updates-2025-03-10-ice-ixgbe'

Tony Nguyen says:

====================
Intel Wired LAN Driver Updates 2025-03-10 (ice, ixgbe)

For ice:

Paul adds generic checksum support for E830 devices.

Karol refactors PTP code related to E825C; simplifying PHY register info
struct, utilizing GENMASK, removing unused defines, etc.

For ixgbe:

Piotr adds PTP support for E610 devices.

Jedrzej adds reporting when overheating is detected on E610 devices.

The following are changes since commit 8ef890df40:
  net: move misc netdev_lock flavors to a separate header
and are available in the git repository at:
  git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue 100GbE
====================

Link: https://patch.msgid.link/20250310174502.3708121-1-anthony.l.nguyen@intel.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
This commit is contained in:
Paolo Abeni
2025-03-18 10:15:52 +01:00
14 changed files with 146 additions and 95 deletions

View File

@@ -201,6 +201,7 @@ enum ice_feature {
ICE_F_SMA_CTRL,
ICE_F_CGU,
ICE_F_GNSS,
ICE_F_GCS,
ICE_F_ROCE_LAG,
ICE_F_SRIOV_LAG,
ICE_F_MBX_LIMIT,

View File

@@ -229,7 +229,7 @@ struct ice_32b_rx_flex_desc_nic {
__le16 status_error1;
u8 flexi_flags2;
u8 ts_low;
__le16 l2tag2_1st;
__le16 raw_csum;
__le16 l2tag2_2nd;
/* Qword 3 */
@@ -478,10 +478,15 @@ enum ice_tx_desc_len_fields {
struct ice_tx_ctx_desc {
__le32 tunneling_params;
__le16 l2tag2;
__le16 rsvd;
__le16 gcs;
__le64 qw1;
};
#define ICE_TX_GCS_DESC_START_M GENMASK(7, 0)
#define ICE_TX_GCS_DESC_OFFSET_M GENMASK(11, 8)
#define ICE_TX_GCS_DESC_TYPE_M GENMASK(14, 12)
#define ICE_TX_GCS_DESC_CSUM_PSH 1
#define ICE_TXD_CTX_QW1_CMD_S 4
#define ICE_TXD_CTX_QW1_CMD_M (0x7FUL << ICE_TXD_CTX_QW1_CMD_S)

View File

@@ -1431,6 +1431,10 @@ static int ice_vsi_alloc_rings(struct ice_vsi *vsi)
ring->dev = dev;
ring->count = vsi->num_rx_desc;
ring->cached_phctime = pf->ptp.cached_phc_time;
if (ice_is_feature_supported(pf, ICE_F_GCS))
ring->flags |= ICE_RX_FLAGS_RING_GCS;
WRITE_ONCE(vsi->rx_rings[i], ring);
}
@@ -3899,8 +3903,10 @@ void ice_init_feature_support(struct ice_pf *pf)
break;
}
if (pf->hw.mac_type == ICE_MAC_E830)
if (pf->hw.mac_type == ICE_MAC_E830) {
ice_set_feature_support(pf, ICE_F_MBX_LIMIT);
ice_set_feature_support(pf, ICE_F_GCS);
}
}
/**

View File

@@ -3634,6 +3634,12 @@ void ice_set_netdev_features(struct net_device *netdev)
/* Allow core to manage IRQs affinity */
netif_set_affinity_auto(netdev);
/* Mutual exclusivity for TSO and GCS is enforced by the set features
* ndo callback.
*/
if (ice_is_feature_supported(pf, ICE_F_GCS))
netdev->hw_features |= NETIF_F_HW_CSUM;
netif_set_tso_max_size(netdev, ICE_MAX_TSO_SIZE);
}
@@ -6549,6 +6555,18 @@ ice_set_features(struct net_device *netdev, netdev_features_t features)
if (changed & NETIF_F_LOOPBACK)
ret = ice_set_loopback(vsi, !!(features & NETIF_F_LOOPBACK));
/* Due to E830 hardware limitations, TSO (NETIF_F_ALL_TSO) with GCS
* (NETIF_F_HW_CSUM) is not supported.
*/
if (ice_is_feature_supported(pf, ICE_F_GCS) &&
((features & NETIF_F_HW_CSUM) && (features & NETIF_F_ALL_TSO))) {
if (netdev->features & NETIF_F_HW_CSUM)
dev_err(ice_pf_to_dev(pf), "To enable TSO, you must first disable HW checksum.\n");
else
dev_err(ice_pf_to_dev(pf), "To enable HW checksum, you must first disable TSO.\n");
return -EIO;
}
return ret;
}

View File

@@ -10,70 +10,25 @@
/* Constants defined for the PTP 1588 clock hardware. */
const struct ice_phy_reg_info_eth56g eth56g_phy_res[NUM_ETH56G_PHY_RES] = {
/* ETH56G_PHY_REG_PTP */
{
/* base_addr */
{
0x092000,
0x126000,
0x1BA000,
0x24E000,
0x2E2000,
},
/* step */
0x98,
[ETH56G_PHY_REG_PTP] = {
.base_addr = 0x092000,
.step = 0x98,
},
/* ETH56G_PHY_MEM_PTP */
{
/* base_addr */
{
0x093000,
0x127000,
0x1BB000,
0x24F000,
0x2E3000,
},
/* step */
0x200,
[ETH56G_PHY_MEM_PTP] = {
.base_addr = 0x093000,
.step = 0x200,
},
/* ETH56G_PHY_REG_XPCS */
{
/* base_addr */
{
0x000000,
0x009400,
0x128000,
0x1BC000,
0x250000,
},
/* step */
0x21000,
[ETH56G_PHY_REG_XPCS] = {
.base_addr = 0x000000,
.step = 0x21000,
},
/* ETH56G_PHY_REG_MAC */
{
/* base_addr */
{
0x085000,
0x119000,
0x1AD000,
0x241000,
0x2D5000,
},
/* step */
0x1000,
[ETH56G_PHY_REG_MAC] = {
.base_addr = 0x085000,
.step = 0x1000,
},
/* ETH56G_PHY_REG_GPCS */
{
/* base_addr */
{
0x084000,
0x118000,
0x1AC000,
0x240000,
0x2D4000,
},
/* step */
0x400,
[ETH56G_PHY_REG_GPCS] = {
.base_addr = 0x084000,
.step = 0x400,
},
};

View File

@@ -1010,7 +1010,7 @@ static int ice_phy_res_address_eth56g(struct ice_hw *hw, u8 lane,
/* Lanes 4..7 are in fact 0..3 on a second PHY */
lane %= hw->ptp.ports_per_phy;
*addr = eth56g_phy_res[res_type].base[0] +
*addr = eth56g_phy_res[res_type].base_addr +
lane * eth56g_phy_res[res_type].step + offset;
return 0;
@@ -1240,7 +1240,7 @@ static int ice_write_quad_ptp_reg_eth56g(struct ice_hw *hw, u8 port,
if (port >= hw->ptp.num_lports)
return -EIO;
addr = eth56g_phy_res[ETH56G_PHY_REG_PTP].base[0] + offset;
addr = eth56g_phy_res[ETH56G_PHY_REG_PTP].base_addr + offset;
return ice_write_phy_eth56g(hw, port, addr, val);
}
@@ -1265,7 +1265,7 @@ static int ice_read_quad_ptp_reg_eth56g(struct ice_hw *hw, u8 port,
if (port >= hw->ptp.num_lports)
return -EIO;
addr = eth56g_phy_res[ETH56G_PHY_REG_PTP].base[0] + offset;
addr = eth56g_phy_res[ETH56G_PHY_REG_PTP].base_addr + offset;
return ice_read_phy_eth56g(hw, port, addr, val);
}
@@ -2650,18 +2650,17 @@ static void ice_sb_access_ena_eth56g(struct ice_hw *hw, bool enable)
}
/**
* ice_ptp_init_phc_eth56g - Perform E82X specific PHC initialization
* ice_ptp_init_phc_e825 - Perform E825 specific PHC initialization
* @hw: pointer to HW struct
*
* Perform PHC initialization steps specific to E82X devices.
* Perform E825-specific PTP hardware clock initialization steps.
*
* Return:
* * %0 - success
* * %other - failed to initialize CGU
* Return: 0 on success, negative error code otherwise.
*/
static int ice_ptp_init_phc_eth56g(struct ice_hw *hw)
static int ice_ptp_init_phc_e825(struct ice_hw *hw)
{
ice_sb_access_ena_eth56g(hw, true);
/* Initialize the Clock Generation Unit */
return ice_init_cgu_e82x(hw);
}
@@ -6123,7 +6122,7 @@ int ice_ptp_init_phc(struct ice_hw *hw)
case ICE_MAC_GENERIC:
return ice_ptp_init_phc_e82x(hw);
case ICE_MAC_GENERIC_3K_E825:
return ice_ptp_init_phc_eth56g(hw);
return ice_ptp_init_phc_e825(hw);
default:
return -EOPNOTSUPP;
}

View File

@@ -65,14 +65,14 @@ enum ice_eth56g_link_spd {
/**
* struct ice_phy_reg_info_eth56g - ETH56G PHY register parameters
* @base: base address for each PHY block
* @base_addr: base address for each PHY block
* @step: step between PHY lanes
*
* Characteristic information for the various PHY register parameters in the
* ETH56G devices
*/
struct ice_phy_reg_info_eth56g {
u32 base[NUM_ETH56G_PHY_RES];
u32 base_addr;
u32 step;
};
@@ -780,36 +780,19 @@ static inline bool ice_is_dual(struct ice_hw *hw)
#define PHY_MAC_XIF_TS_SFD_ENA_M ICE_M(0x1, 20)
#define PHY_MAC_XIF_GMII_TS_SEL_M ICE_M(0x1, 21)
/* GPCS config register */
#define PHY_GPCS_CONFIG_REG0 0x268
#define PHY_GPCS_CONFIG_REG0_TX_THR_M ICE_M(0xF, 24)
#define PHY_GPCS_BITSLIP 0x5C
#define PHY_TS_INT_CONFIG_THRESHOLD_M ICE_M(0x3F, 0)
#define PHY_TS_INT_CONFIG_ENA_M BIT(6)
/* 1-step PTP config */
#define PHY_PTP_1STEP_CONFIG 0x270
#define PHY_PTP_1STEP_T1S_UP64_M ICE_M(0xF, 4)
#define PHY_PTP_1STEP_T1S_DELTA_M ICE_M(0xF, 8)
#define PHY_PTP_1STEP_PEER_DELAY(_port) (0x274 + 4 * (_port))
#define PHY_PTP_1STEP_PD_ADD_PD_M ICE_M(0x1, 0)
#define PHY_PTP_1STEP_PD_DELAY_M ICE_M(0x3fffffff, 1)
#define PHY_PTP_1STEP_PD_DLY_V_M ICE_M(0x1, 31)
/* Macros to derive offsets for TimeStampLow and TimeStampHigh */
#define PHY_TSTAMP_L(x) (((x) * 8) + 0)
#define PHY_TSTAMP_U(x) (((x) * 8) + 4)
#define PHY_REG_REVISION 0x85000
#define PHY_REG_DESKEW_0 0x94
#define PHY_REG_DESKEW_0_RLEVEL GENMASK(6, 0)
#define PHY_REG_DESKEW_0_RLEVEL_FRAC GENMASK(9, 7)
#define PHY_REG_DESKEW_0_RLEVEL_FRAC_W 3
#define PHY_REG_DESKEW_0_VALID GENMASK(10, 10)
#define PHY_REG_GPCS_BITSLIP 0x5C
#define PHY_REG_SD_BIT_SLIP(_port_offset) (0x29C + 4 * (_port_offset))
#define PHY_REVISION_ETH56G 0x10200
#define PHY_VENDOR_TXLANE_THRESH 0x2000C
@@ -829,7 +812,21 @@ static inline bool ice_is_dual(struct ice_hw *hw)
#define PHY_MAC_BLOCKTIME 0x50
#define PHY_MAC_MARKERTIME 0x54
#define PHY_MAC_TX_OFFSET 0x58
#define PHY_GPCS_BITSLIP 0x5C
#define PHY_PTP_INT_STATUS 0x7FD140
/* ETH56G registers shared per quad */
/* GPCS config register */
#define PHY_GPCS_CONFIG_REG0 0x268
#define PHY_GPCS_CONFIG_REG0_TX_THR_M GENMASK(27, 24)
/* 1-step PTP config */
#define PHY_PTP_1STEP_CONFIG 0x270
#define PHY_PTP_1STEP_T1S_UP64_M GENMASK(7, 4)
#define PHY_PTP_1STEP_T1S_DELTA_M GENMASK(11, 8)
#define PHY_PTP_1STEP_PEER_DELAY(_quad_lane) (0x274 + 4 * (_quad_lane))
#define PHY_PTP_1STEP_PD_ADD_PD_M BIT(0)
#define PHY_PTP_1STEP_PD_DELAY_M GENMASK(30, 1)
#define PHY_PTP_1STEP_PD_DLY_V_M BIT(31)
#endif /* _ICE_PTP_HW_H_ */

View File

@@ -1809,6 +1809,7 @@ ice_tx_map(struct ice_tx_ring *tx_ring, struct ice_tx_buf *first,
static
int ice_tx_csum(struct ice_tx_buf *first, struct ice_tx_offload_params *off)
{
const struct ice_tx_ring *tx_ring = off->tx_ring;
u32 l4_len = 0, l3_len = 0, l2_len = 0;
struct sk_buff *skb = first->skb;
union {
@@ -1958,6 +1959,30 @@ int ice_tx_csum(struct ice_tx_buf *first, struct ice_tx_offload_params *off)
l3_len = l4.hdr - ip.hdr;
offset |= (l3_len / 4) << ICE_TX_DESC_LEN_IPLEN_S;
if ((tx_ring->netdev->features & NETIF_F_HW_CSUM) &&
!(first->tx_flags & ICE_TX_FLAGS_TSO) &&
!skb_csum_is_sctp(skb)) {
/* Set GCS */
u16 csum_start = (skb->csum_start - skb->mac_header) / 2;
u16 csum_offset = skb->csum_offset / 2;
u16 gcs_params;
gcs_params = FIELD_PREP(ICE_TX_GCS_DESC_START_M, csum_start) |
FIELD_PREP(ICE_TX_GCS_DESC_OFFSET_M, csum_offset) |
FIELD_PREP(ICE_TX_GCS_DESC_TYPE_M,
ICE_TX_GCS_DESC_CSUM_PSH);
/* Unlike legacy HW checksums, GCS requires a context
* descriptor.
*/
off->cd_qw1 |= ICE_TX_DESC_DTYPE_CTX;
off->cd_gcs_params = gcs_params;
/* Fill out CSO info in data descriptors */
off->td_offset |= offset;
off->td_cmd |= cmd;
return 1;
}
/* Enable L4 checksum offloads */
switch (l4_proto) {
case IPPROTO_TCP:
@@ -2441,7 +2466,7 @@ ice_xmit_frame_ring(struct sk_buff *skb, struct ice_tx_ring *tx_ring)
/* setup context descriptor */
cdesc->tunneling_params = cpu_to_le32(offload.cd_tunnel_params);
cdesc->l2tag2 = cpu_to_le16(offload.cd_l2tag2);
cdesc->rsvd = cpu_to_le16(0);
cdesc->gcs = cpu_to_le16(offload.cd_gcs_params);
cdesc->qw1 = cpu_to_le64(offload.cd_qw1);
}

View File

@@ -193,6 +193,7 @@ struct ice_tx_offload_params {
u32 td_l2tag1;
u32 cd_tunnel_params;
u16 cd_l2tag2;
u16 cd_gcs_params;
u8 header_len;
};
@@ -366,6 +367,7 @@ struct ice_rx_ring {
#define ICE_RX_FLAGS_RING_BUILD_SKB BIT(1)
#define ICE_RX_FLAGS_CRC_STRIP_DIS BIT(2)
#define ICE_RX_FLAGS_MULTIDEV BIT(3)
#define ICE_RX_FLAGS_RING_GCS BIT(4)
u8 flags;
/* CL5 - 5th cacheline starts here */
struct xdp_rxq_info xdp_rxq;

View File

@@ -80,6 +80,23 @@ ice_rx_hash_to_skb(const struct ice_rx_ring *rx_ring,
libeth_rx_pt_set_hash(skb, hash, decoded);
}
/**
* ice_rx_gcs - Set generic checksum in skb
* @skb: skb currently being received and modified
* @rx_desc: receive descriptor
*/
static void ice_rx_gcs(struct sk_buff *skb,
const union ice_32b_rx_flex_desc *rx_desc)
{
const struct ice_32b_rx_flex_desc_nic *desc;
u16 csum;
desc = (struct ice_32b_rx_flex_desc_nic *)rx_desc;
skb->ip_summed = CHECKSUM_COMPLETE;
csum = (__force u16)desc->raw_csum;
skb->csum = csum_unfold((__force __sum16)swab16(csum));
}
/**
* ice_rx_csum - Indicate in skb if checksum is good
* @ring: the ring we care about
@@ -107,6 +124,15 @@ ice_rx_csum(struct ice_rx_ring *ring, struct sk_buff *skb,
rx_status0 = le16_to_cpu(rx_desc->wb.status_error0);
rx_status1 = le16_to_cpu(rx_desc->wb.status_error1);
if ((ring->flags & ICE_RX_FLAGS_RING_GCS) &&
rx_desc->wb.rxdid == ICE_RXDID_FLEX_NIC &&
(decoded.inner_prot == LIBETH_RX_PT_INNER_TCP ||
decoded.inner_prot == LIBETH_RX_PT_INNER_UDP ||
decoded.inner_prot == LIBETH_RX_PT_INNER_ICMP)) {
ice_rx_gcs(skb, rx_desc);
return;
}
/* check if HW has decoded the packet and checksum */
if (!(rx_status0 & BIT(ICE_RX_FLEX_DESC_STATUS0_L3L4P_S)))
return;

View File

@@ -3185,6 +3185,7 @@ static int ixgbe_get_ts_info(struct net_device *dev,
case ixgbe_mac_X550:
case ixgbe_mac_X550EM_x:
case ixgbe_mac_x550em_a:
case ixgbe_mac_e610:
info->rx_filters |= BIT(HWTSTAMP_FILTER_ALL);
break;
case ixgbe_mac_X540:

View File

@@ -3185,6 +3185,10 @@ static void ixgbe_handle_fw_event(struct ixgbe_adapter *adapter)
case ixgbe_aci_opc_get_link_status:
ixgbe_handle_link_status_event(adapter, &event);
break;
case ixgbe_aci_opc_temp_tca_event:
e_crit(drv, "%s\n", ixgbe_overheat_msg);
ixgbe_down(adapter);
break;
default:
e_warn(hw, "unknown FW async event captured\n");
break;

View File

@@ -140,6 +140,7 @@
* proper mult and shift to convert the cycles into nanoseconds of time.
*/
#define IXGBE_X550_BASE_PERIOD 0xC80000000ULL
#define IXGBE_E610_BASE_PERIOD 0x333333333ULL
#define INCVALUE_MASK 0x7FFFFFFF
#define ISGN 0x80000000
@@ -415,6 +416,7 @@ static void ixgbe_ptp_convert_to_hwtstamp(struct ixgbe_adapter *adapter,
case ixgbe_mac_X550:
case ixgbe_mac_X550EM_x:
case ixgbe_mac_x550em_a:
case ixgbe_mac_e610:
/* Upper 32 bits represent billions of cycles, lower 32 bits
* represent cycles. However, we use timespec64_to_ns for the
* correct math even though the units haven't been corrected
@@ -492,11 +494,13 @@ static int ixgbe_ptp_adjfine_X550(struct ptp_clock_info *ptp, long scaled_ppm)
struct ixgbe_adapter *adapter =
container_of(ptp, struct ixgbe_adapter, ptp_caps);
struct ixgbe_hw *hw = &adapter->hw;
u64 rate, base;
bool neg_adj;
u64 rate;
u32 inca;
neg_adj = diff_by_scaled_ppm(IXGBE_X550_BASE_PERIOD, scaled_ppm, &rate);
base = hw->mac.type == ixgbe_mac_e610 ? IXGBE_E610_BASE_PERIOD :
IXGBE_X550_BASE_PERIOD;
neg_adj = diff_by_scaled_ppm(base, scaled_ppm, &rate);
/* warn if rate is too large */
if (rate >= INCVALUE_MASK)
@@ -559,6 +563,7 @@ static int ixgbe_ptp_gettimex(struct ptp_clock_info *ptp,
case ixgbe_mac_X550:
case ixgbe_mac_X550EM_x:
case ixgbe_mac_x550em_a:
case ixgbe_mac_e610:
/* Upper 32 bits represent billions of cycles, lower 32 bits
* represent cycles. However, we use timespec64_to_ns for the
* correct math even though the units haven't been corrected
@@ -1067,6 +1072,7 @@ static int ixgbe_ptp_set_timestamp_mode(struct ixgbe_adapter *adapter,
case ixgbe_mac_X550:
case ixgbe_mac_X550EM_x:
case ixgbe_mac_x550em_a:
case ixgbe_mac_e610:
/* enable timestamping all packets only if at least some
* packets were requested. Otherwise, play nice and disable
* timestamping
@@ -1233,6 +1239,7 @@ void ixgbe_ptp_start_cyclecounter(struct ixgbe_adapter *adapter)
fallthrough;
case ixgbe_mac_x550em_a:
case ixgbe_mac_X550:
case ixgbe_mac_e610:
cc.read = ixgbe_ptp_read_X550;
break;
case ixgbe_mac_X540:
@@ -1280,6 +1287,7 @@ static void ixgbe_ptp_init_systime(struct ixgbe_adapter *adapter)
case ixgbe_mac_X550EM_x:
case ixgbe_mac_x550em_a:
case ixgbe_mac_X550:
case ixgbe_mac_e610:
tsauxc = IXGBE_READ_REG(hw, IXGBE_TSAUXC);
/* Reset SYSTIME registers to 0 */
@@ -1407,6 +1415,7 @@ static long ixgbe_ptp_create_clock(struct ixgbe_adapter *adapter)
case ixgbe_mac_X550:
case ixgbe_mac_X550EM_x:
case ixgbe_mac_x550em_a:
case ixgbe_mac_e610:
snprintf(adapter->ptp_caps.name, 16, "%s", netdev->name);
adapter->ptp_caps.owner = THIS_MODULE;
adapter->ptp_caps.max_adj = 30000000;

View File

@@ -171,6 +171,9 @@ enum ixgbe_aci_opc {
ixgbe_aci_opc_done_alt_write = 0x0904,
ixgbe_aci_opc_clear_port_alt_write = 0x0906,
/* TCA Events */
ixgbe_aci_opc_temp_tca_event = 0x0C94,
/* debug commands */
ixgbe_aci_opc_debug_dump_internals = 0xFF08,