Skip to content

Commit e63265f

Browse files
author
Paolo Abeni
committed
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 8ef890d: 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>
2 parents 50698b2 + affead2 commit e63265f

File tree

14 files changed

+146
-95
lines changed

14 files changed

+146
-95
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ enum ice_feature {
201201
ICE_F_SMA_CTRL,
202202
ICE_F_CGU,
203203
ICE_F_GNSS,
204+
ICE_F_GCS,
204205
ICE_F_ROCE_LAG,
205206
ICE_F_SRIOV_LAG,
206207
ICE_F_MBX_LIMIT,

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ struct ice_32b_rx_flex_desc_nic {
229229
__le16 status_error1;
230230
u8 flexi_flags2;
231231
u8 ts_low;
232-
__le16 l2tag2_1st;
232+
__le16 raw_csum;
233233
__le16 l2tag2_2nd;
234234

235235
/* Qword 3 */
@@ -478,10 +478,15 @@ enum ice_tx_desc_len_fields {
478478
struct ice_tx_ctx_desc {
479479
__le32 tunneling_params;
480480
__le16 l2tag2;
481-
__le16 rsvd;
481+
__le16 gcs;
482482
__le64 qw1;
483483
};
484484

485+
#define ICE_TX_GCS_DESC_START_M GENMASK(7, 0)
486+
#define ICE_TX_GCS_DESC_OFFSET_M GENMASK(11, 8)
487+
#define ICE_TX_GCS_DESC_TYPE_M GENMASK(14, 12)
488+
#define ICE_TX_GCS_DESC_CSUM_PSH 1
489+
485490
#define ICE_TXD_CTX_QW1_CMD_S 4
486491
#define ICE_TXD_CTX_QW1_CMD_M (0x7FUL << ICE_TXD_CTX_QW1_CMD_S)
487492

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1431,6 +1431,10 @@ static int ice_vsi_alloc_rings(struct ice_vsi *vsi)
14311431
ring->dev = dev;
14321432
ring->count = vsi->num_rx_desc;
14331433
ring->cached_phctime = pf->ptp.cached_phc_time;
1434+
1435+
if (ice_is_feature_supported(pf, ICE_F_GCS))
1436+
ring->flags |= ICE_RX_FLAGS_RING_GCS;
1437+
14341438
WRITE_ONCE(vsi->rx_rings[i], ring);
14351439
}
14361440

@@ -3899,8 +3903,10 @@ void ice_init_feature_support(struct ice_pf *pf)
38993903
break;
39003904
}
39013905

3902-
if (pf->hw.mac_type == ICE_MAC_E830)
3906+
if (pf->hw.mac_type == ICE_MAC_E830) {
39033907
ice_set_feature_support(pf, ICE_F_MBX_LIMIT);
3908+
ice_set_feature_support(pf, ICE_F_GCS);
3909+
}
39043910
}
39053911

39063912
/**

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3634,6 +3634,12 @@ void ice_set_netdev_features(struct net_device *netdev)
36343634
/* Allow core to manage IRQs affinity */
36353635
netif_set_affinity_auto(netdev);
36363636

3637+
/* Mutual exclusivity for TSO and GCS is enforced by the set features
3638+
* ndo callback.
3639+
*/
3640+
if (ice_is_feature_supported(pf, ICE_F_GCS))
3641+
netdev->hw_features |= NETIF_F_HW_CSUM;
3642+
36373643
netif_set_tso_max_size(netdev, ICE_MAX_TSO_SIZE);
36383644
}
36393645

@@ -6549,6 +6555,18 @@ ice_set_features(struct net_device *netdev, netdev_features_t features)
65496555
if (changed & NETIF_F_LOOPBACK)
65506556
ret = ice_set_loopback(vsi, !!(features & NETIF_F_LOOPBACK));
65516557

6558+
/* Due to E830 hardware limitations, TSO (NETIF_F_ALL_TSO) with GCS
6559+
* (NETIF_F_HW_CSUM) is not supported.
6560+
*/
6561+
if (ice_is_feature_supported(pf, ICE_F_GCS) &&
6562+
((features & NETIF_F_HW_CSUM) && (features & NETIF_F_ALL_TSO))) {
6563+
if (netdev->features & NETIF_F_HW_CSUM)
6564+
dev_err(ice_pf_to_dev(pf), "To enable TSO, you must first disable HW checksum.\n");
6565+
else
6566+
dev_err(ice_pf_to_dev(pf), "To enable HW checksum, you must first disable TSO.\n");
6567+
return -EIO;
6568+
}
6569+
65526570
return ret;
65536571
}
65546572

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

Lines changed: 15 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -10,70 +10,25 @@
1010
/* Constants defined for the PTP 1588 clock hardware. */
1111

1212
const struct ice_phy_reg_info_eth56g eth56g_phy_res[NUM_ETH56G_PHY_RES] = {
13-
/* ETH56G_PHY_REG_PTP */
14-
{
15-
/* base_addr */
16-
{
17-
0x092000,
18-
0x126000,
19-
0x1BA000,
20-
0x24E000,
21-
0x2E2000,
22-
},
23-
/* step */
24-
0x98,
13+
[ETH56G_PHY_REG_PTP] = {
14+
.base_addr = 0x092000,
15+
.step = 0x98,
2516
},
26-
/* ETH56G_PHY_MEM_PTP */
27-
{
28-
/* base_addr */
29-
{
30-
0x093000,
31-
0x127000,
32-
0x1BB000,
33-
0x24F000,
34-
0x2E3000,
35-
},
36-
/* step */
37-
0x200,
17+
[ETH56G_PHY_MEM_PTP] = {
18+
.base_addr = 0x093000,
19+
.step = 0x200,
3820
},
39-
/* ETH56G_PHY_REG_XPCS */
40-
{
41-
/* base_addr */
42-
{
43-
0x000000,
44-
0x009400,
45-
0x128000,
46-
0x1BC000,
47-
0x250000,
48-
},
49-
/* step */
50-
0x21000,
21+
[ETH56G_PHY_REG_XPCS] = {
22+
.base_addr = 0x000000,
23+
.step = 0x21000,
5124
},
52-
/* ETH56G_PHY_REG_MAC */
53-
{
54-
/* base_addr */
55-
{
56-
0x085000,
57-
0x119000,
58-
0x1AD000,
59-
0x241000,
60-
0x2D5000,
61-
},
62-
/* step */
63-
0x1000,
25+
[ETH56G_PHY_REG_MAC] = {
26+
.base_addr = 0x085000,
27+
.step = 0x1000,
6428
},
65-
/* ETH56G_PHY_REG_GPCS */
66-
{
67-
/* base_addr */
68-
{
69-
0x084000,
70-
0x118000,
71-
0x1AC000,
72-
0x240000,
73-
0x2D4000,
74-
},
75-
/* step */
76-
0x400,
29+
[ETH56G_PHY_REG_GPCS] = {
30+
.base_addr = 0x084000,
31+
.step = 0x400,
7732
},
7833
};
7934

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

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1010,7 +1010,7 @@ static int ice_phy_res_address_eth56g(struct ice_hw *hw, u8 lane,
10101010

10111011
/* Lanes 4..7 are in fact 0..3 on a second PHY */
10121012
lane %= hw->ptp.ports_per_phy;
1013-
*addr = eth56g_phy_res[res_type].base[0] +
1013+
*addr = eth56g_phy_res[res_type].base_addr +
10141014
lane * eth56g_phy_res[res_type].step + offset;
10151015

10161016
return 0;
@@ -1240,7 +1240,7 @@ static int ice_write_quad_ptp_reg_eth56g(struct ice_hw *hw, u8 port,
12401240
if (port >= hw->ptp.num_lports)
12411241
return -EIO;
12421242

1243-
addr = eth56g_phy_res[ETH56G_PHY_REG_PTP].base[0] + offset;
1243+
addr = eth56g_phy_res[ETH56G_PHY_REG_PTP].base_addr + offset;
12441244

12451245
return ice_write_phy_eth56g(hw, port, addr, val);
12461246
}
@@ -1265,7 +1265,7 @@ static int ice_read_quad_ptp_reg_eth56g(struct ice_hw *hw, u8 port,
12651265
if (port >= hw->ptp.num_lports)
12661266
return -EIO;
12671267

1268-
addr = eth56g_phy_res[ETH56G_PHY_REG_PTP].base[0] + offset;
1268+
addr = eth56g_phy_res[ETH56G_PHY_REG_PTP].base_addr + offset;
12691269

12701270
return ice_read_phy_eth56g(hw, port, addr, val);
12711271
}
@@ -2650,18 +2650,17 @@ static void ice_sb_access_ena_eth56g(struct ice_hw *hw, bool enable)
26502650
}
26512651

26522652
/**
2653-
* ice_ptp_init_phc_eth56g - Perform E82X specific PHC initialization
2653+
* ice_ptp_init_phc_e825 - Perform E825 specific PHC initialization
26542654
* @hw: pointer to HW struct
26552655
*
2656-
* Perform PHC initialization steps specific to E82X devices.
2656+
* Perform E825-specific PTP hardware clock initialization steps.
26572657
*
2658-
* Return:
2659-
* * %0 - success
2660-
* * %other - failed to initialize CGU
2658+
* Return: 0 on success, negative error code otherwise.
26612659
*/
2662-
static int ice_ptp_init_phc_eth56g(struct ice_hw *hw)
2660+
static int ice_ptp_init_phc_e825(struct ice_hw *hw)
26632661
{
26642662
ice_sb_access_ena_eth56g(hw, true);
2663+
26652664
/* Initialize the Clock Generation Unit */
26662665
return ice_init_cgu_e82x(hw);
26672666
}
@@ -6123,7 +6122,7 @@ int ice_ptp_init_phc(struct ice_hw *hw)
61236122
case ICE_MAC_GENERIC:
61246123
return ice_ptp_init_phc_e82x(hw);
61256124
case ICE_MAC_GENERIC_3K_E825:
6126-
return ice_ptp_init_phc_eth56g(hw);
6125+
return ice_ptp_init_phc_e825(hw);
61276126
default:
61286127
return -EOPNOTSUPP;
61296128
}

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

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,14 @@ enum ice_eth56g_link_spd {
6565

6666
/**
6767
* struct ice_phy_reg_info_eth56g - ETH56G PHY register parameters
68-
* @base: base address for each PHY block
68+
* @base_addr: base address for each PHY block
6969
* @step: step between PHY lanes
7070
*
7171
* Characteristic information for the various PHY register parameters in the
7272
* ETH56G devices
7373
*/
7474
struct ice_phy_reg_info_eth56g {
75-
u32 base[NUM_ETH56G_PHY_RES];
75+
u32 base_addr;
7676
u32 step;
7777
};
7878

@@ -780,36 +780,19 @@ static inline bool ice_is_dual(struct ice_hw *hw)
780780
#define PHY_MAC_XIF_TS_SFD_ENA_M ICE_M(0x1, 20)
781781
#define PHY_MAC_XIF_GMII_TS_SEL_M ICE_M(0x1, 21)
782782

783-
/* GPCS config register */
784-
#define PHY_GPCS_CONFIG_REG0 0x268
785-
#define PHY_GPCS_CONFIG_REG0_TX_THR_M ICE_M(0xF, 24)
786-
#define PHY_GPCS_BITSLIP 0x5C
787-
788783
#define PHY_TS_INT_CONFIG_THRESHOLD_M ICE_M(0x3F, 0)
789784
#define PHY_TS_INT_CONFIG_ENA_M BIT(6)
790785

791-
/* 1-step PTP config */
792-
#define PHY_PTP_1STEP_CONFIG 0x270
793-
#define PHY_PTP_1STEP_T1S_UP64_M ICE_M(0xF, 4)
794-
#define PHY_PTP_1STEP_T1S_DELTA_M ICE_M(0xF, 8)
795-
#define PHY_PTP_1STEP_PEER_DELAY(_port) (0x274 + 4 * (_port))
796-
#define PHY_PTP_1STEP_PD_ADD_PD_M ICE_M(0x1, 0)
797-
#define PHY_PTP_1STEP_PD_DELAY_M ICE_M(0x3fffffff, 1)
798-
#define PHY_PTP_1STEP_PD_DLY_V_M ICE_M(0x1, 31)
799-
800786
/* Macros to derive offsets for TimeStampLow and TimeStampHigh */
801787
#define PHY_TSTAMP_L(x) (((x) * 8) + 0)
802788
#define PHY_TSTAMP_U(x) (((x) * 8) + 4)
803789

804-
#define PHY_REG_REVISION 0x85000
805-
806790
#define PHY_REG_DESKEW_0 0x94
807791
#define PHY_REG_DESKEW_0_RLEVEL GENMASK(6, 0)
808792
#define PHY_REG_DESKEW_0_RLEVEL_FRAC GENMASK(9, 7)
809793
#define PHY_REG_DESKEW_0_RLEVEL_FRAC_W 3
810794
#define PHY_REG_DESKEW_0_VALID GENMASK(10, 10)
811795

812-
#define PHY_REG_GPCS_BITSLIP 0x5C
813796
#define PHY_REG_SD_BIT_SLIP(_port_offset) (0x29C + 4 * (_port_offset))
814797
#define PHY_REVISION_ETH56G 0x10200
815798
#define PHY_VENDOR_TXLANE_THRESH 0x2000C
@@ -829,7 +812,21 @@ static inline bool ice_is_dual(struct ice_hw *hw)
829812
#define PHY_MAC_BLOCKTIME 0x50
830813
#define PHY_MAC_MARKERTIME 0x54
831814
#define PHY_MAC_TX_OFFSET 0x58
815+
#define PHY_GPCS_BITSLIP 0x5C
832816

833817
#define PHY_PTP_INT_STATUS 0x7FD140
834818

819+
/* ETH56G registers shared per quad */
820+
/* GPCS config register */
821+
#define PHY_GPCS_CONFIG_REG0 0x268
822+
#define PHY_GPCS_CONFIG_REG0_TX_THR_M GENMASK(27, 24)
823+
/* 1-step PTP config */
824+
#define PHY_PTP_1STEP_CONFIG 0x270
825+
#define PHY_PTP_1STEP_T1S_UP64_M GENMASK(7, 4)
826+
#define PHY_PTP_1STEP_T1S_DELTA_M GENMASK(11, 8)
827+
#define PHY_PTP_1STEP_PEER_DELAY(_quad_lane) (0x274 + 4 * (_quad_lane))
828+
#define PHY_PTP_1STEP_PD_ADD_PD_M BIT(0)
829+
#define PHY_PTP_1STEP_PD_DELAY_M GENMASK(30, 1)
830+
#define PHY_PTP_1STEP_PD_DLY_V_M BIT(31)
831+
835832
#endif /* _ICE_PTP_HW_H_ */

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

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1809,6 +1809,7 @@ ice_tx_map(struct ice_tx_ring *tx_ring, struct ice_tx_buf *first,
18091809
static
18101810
int ice_tx_csum(struct ice_tx_buf *first, struct ice_tx_offload_params *off)
18111811
{
1812+
const struct ice_tx_ring *tx_ring = off->tx_ring;
18121813
u32 l4_len = 0, l3_len = 0, l2_len = 0;
18131814
struct sk_buff *skb = first->skb;
18141815
union {
@@ -1958,6 +1959,30 @@ int ice_tx_csum(struct ice_tx_buf *first, struct ice_tx_offload_params *off)
19581959
l3_len = l4.hdr - ip.hdr;
19591960
offset |= (l3_len / 4) << ICE_TX_DESC_LEN_IPLEN_S;
19601961

1962+
if ((tx_ring->netdev->features & NETIF_F_HW_CSUM) &&
1963+
!(first->tx_flags & ICE_TX_FLAGS_TSO) &&
1964+
!skb_csum_is_sctp(skb)) {
1965+
/* Set GCS */
1966+
u16 csum_start = (skb->csum_start - skb->mac_header) / 2;
1967+
u16 csum_offset = skb->csum_offset / 2;
1968+
u16 gcs_params;
1969+
1970+
gcs_params = FIELD_PREP(ICE_TX_GCS_DESC_START_M, csum_start) |
1971+
FIELD_PREP(ICE_TX_GCS_DESC_OFFSET_M, csum_offset) |
1972+
FIELD_PREP(ICE_TX_GCS_DESC_TYPE_M,
1973+
ICE_TX_GCS_DESC_CSUM_PSH);
1974+
1975+
/* Unlike legacy HW checksums, GCS requires a context
1976+
* descriptor.
1977+
*/
1978+
off->cd_qw1 |= ICE_TX_DESC_DTYPE_CTX;
1979+
off->cd_gcs_params = gcs_params;
1980+
/* Fill out CSO info in data descriptors */
1981+
off->td_offset |= offset;
1982+
off->td_cmd |= cmd;
1983+
return 1;
1984+
}
1985+
19611986
/* Enable L4 checksum offloads */
19621987
switch (l4_proto) {
19631988
case IPPROTO_TCP:
@@ -2441,7 +2466,7 @@ ice_xmit_frame_ring(struct sk_buff *skb, struct ice_tx_ring *tx_ring)
24412466
/* setup context descriptor */
24422467
cdesc->tunneling_params = cpu_to_le32(offload.cd_tunnel_params);
24432468
cdesc->l2tag2 = cpu_to_le16(offload.cd_l2tag2);
2444-
cdesc->rsvd = cpu_to_le16(0);
2469+
cdesc->gcs = cpu_to_le16(offload.cd_gcs_params);
24452470
cdesc->qw1 = cpu_to_le64(offload.cd_qw1);
24462471
}
24472472

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ struct ice_tx_offload_params {
193193
u32 td_l2tag1;
194194
u32 cd_tunnel_params;
195195
u16 cd_l2tag2;
196+
u16 cd_gcs_params;
196197
u8 header_len;
197198
};
198199

@@ -366,6 +367,7 @@ struct ice_rx_ring {
366367
#define ICE_RX_FLAGS_RING_BUILD_SKB BIT(1)
367368
#define ICE_RX_FLAGS_CRC_STRIP_DIS BIT(2)
368369
#define ICE_RX_FLAGS_MULTIDEV BIT(3)
370+
#define ICE_RX_FLAGS_RING_GCS BIT(4)
369371
u8 flags;
370372
/* CL5 - 5th cacheline starts here */
371373
struct xdp_rxq_info xdp_rxq;

0 commit comments

Comments
 (0)