Skip to content

Commit ce82fb0

Browse files
author
CKI KWF Bot
committed
Merge: idpf: driver update to v6.15-rc7
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-10/-/merge_requests/791 JIRA: https://issues.redhat.com/browse/RHEL-79686 JIRA: https://issues.redhat.com/browse/RHEL-78633 JIRA: https://issues.redhat.com/browse/RHEL-82472 CVE: CVE-2025-22065 CVE: CVE-2025-22116 CVE: CVE-2025-21890 CVE: CVE-2024-58057 This updates the idpf driver to the current upstream (v6.15-rc7 + a fix from net.git). Skipped commits: - 61bf000 ("dim: pass dim_sample to net_dim() by reference") - This is in a CNB (RHEL-89803), no dependency. - deab38f ("idpf: use napi's irq affinity") - This will come in a CNB (RHEL-83024). Signed-off-by: Michal Schmidt <mschmidt@redhat.com> Approved-by: José Ignacio Tornos Martínez <jtornosm@redhat.com> Approved-by: Marcelo Ricardo Leitner <mleitner@redhat.com> Approved-by: Corinna Vinschen <vinschen@redhat.com> Approved-by: Kamal Heib <kheib@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: CKI GitLab Kmaint Pipeline Bot <26919896-cki-kmaint-pipeline-bot@users.noreply.gitlab.com>
2 parents a8c2512 + 9701fe4 commit ce82fb0

File tree

9 files changed

+194
-137
lines changed

9 files changed

+194
-137
lines changed

drivers/net/ethernet/intel/idpf/idpf.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ enum idpf_vport_state {
143143
* @vport_id: Vport identifier
144144
* @link_speed_mbps: Link speed in mbps
145145
* @vport_idx: Relative vport index
146+
* @max_tx_hdr_size: Max header length hardware can support
146147
* @state: See enum idpf_vport_state
147148
* @netstats: Packet and byte stats
148149
* @stats_lock: Lock to protect stats update
@@ -153,6 +154,7 @@ struct idpf_netdev_priv {
153154
u32 vport_id;
154155
u32 link_speed_mbps;
155156
u16 vport_idx;
157+
u16 max_tx_hdr_size;
156158
enum idpf_vport_state state;
157159
struct rtnl_link_stats64 netstats;
158160
spinlock_t stats_lock;
@@ -629,13 +631,13 @@ bool idpf_is_capability_ena(struct idpf_adapter *adapter, bool all,
629631
VIRTCHNL2_CAP_RX_HSPLIT_AT_L4V4 |\
630632
VIRTCHNL2_CAP_RX_HSPLIT_AT_L4V6)
631633

632-
#define IDPF_CAP_RX_CSUM_L4V4 (\
633-
VIRTCHNL2_CAP_RX_CSUM_L4_IPV4_TCP |\
634-
VIRTCHNL2_CAP_RX_CSUM_L4_IPV4_UDP)
634+
#define IDPF_CAP_TX_CSUM_L4V4 (\
635+
VIRTCHNL2_CAP_TX_CSUM_L4_IPV4_TCP |\
636+
VIRTCHNL2_CAP_TX_CSUM_L4_IPV4_UDP)
635637

636-
#define IDPF_CAP_RX_CSUM_L4V6 (\
637-
VIRTCHNL2_CAP_RX_CSUM_L4_IPV6_TCP |\
638-
VIRTCHNL2_CAP_RX_CSUM_L4_IPV6_UDP)
638+
#define IDPF_CAP_TX_CSUM_L4V6 (\
639+
VIRTCHNL2_CAP_TX_CSUM_L4_IPV6_TCP |\
640+
VIRTCHNL2_CAP_TX_CSUM_L4_IPV6_UDP)
639641

640642
#define IDPF_CAP_RX_CSUM (\
641643
VIRTCHNL2_CAP_RX_CSUM_L3_IPV4 |\
@@ -644,11 +646,9 @@ bool idpf_is_capability_ena(struct idpf_adapter *adapter, bool all,
644646
VIRTCHNL2_CAP_RX_CSUM_L4_IPV6_TCP |\
645647
VIRTCHNL2_CAP_RX_CSUM_L4_IPV6_UDP)
646648

647-
#define IDPF_CAP_SCTP_CSUM (\
649+
#define IDPF_CAP_TX_SCTP_CSUM (\
648650
VIRTCHNL2_CAP_TX_CSUM_L4_IPV4_SCTP |\
649-
VIRTCHNL2_CAP_TX_CSUM_L4_IPV6_SCTP |\
650-
VIRTCHNL2_CAP_RX_CSUM_L4_IPV4_SCTP |\
651-
VIRTCHNL2_CAP_RX_CSUM_L4_IPV6_SCTP)
651+
VIRTCHNL2_CAP_TX_CSUM_L4_IPV6_SCTP)
652652

653653
#define IDPF_CAP_TUNNEL_TX_CSUM (\
654654
VIRTCHNL2_CAP_TX_CSUM_L3_SINGLE_TUNNEL |\

drivers/net/ethernet/intel/idpf/idpf_controlq.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,9 @@ int idpf_ctlq_clean_sq(struct idpf_ctlq_info *cq, u16 *clean_count,
376376
if (!(le16_to_cpu(desc->flags) & IDPF_CTLQ_FLAG_DD))
377377
break;
378378

379+
/* Ensure no other fields are read until DD flag is checked */
380+
dma_rmb();
381+
379382
/* strip off FW internal code */
380383
desc_err = le16_to_cpu(desc->ret_val) & 0xff;
381384

@@ -563,6 +566,9 @@ int idpf_ctlq_recv(struct idpf_ctlq_info *cq, u16 *num_q_msg,
563566
if (!(flags & IDPF_CTLQ_FLAG_DD))
564567
break;
565568

569+
/* Ensure no other fields are read until DD flag is checked */
570+
dma_rmb();
571+
566572
q_msg[i].vmvf_type = (flags &
567573
(IDPF_CTLQ_FLAG_FTYPE_VM |
568574
IDPF_CTLQ_FLAG_FTYPE_PF)) >>

drivers/net/ethernet/intel/idpf/idpf_lib.c

Lines changed: 58 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -703,8 +703,10 @@ static int idpf_cfg_netdev(struct idpf_vport *vport)
703703
{
704704
struct idpf_adapter *adapter = vport->adapter;
705705
struct idpf_vport_config *vport_config;
706+
netdev_features_t other_offloads = 0;
707+
netdev_features_t csum_offloads = 0;
708+
netdev_features_t tso_offloads = 0;
706709
netdev_features_t dflt_features;
707-
netdev_features_t offloads = 0;
708710
struct idpf_netdev_priv *np;
709711
struct net_device *netdev;
710712
u16 idx = vport->idx;
@@ -721,6 +723,7 @@ static int idpf_cfg_netdev(struct idpf_vport *vport)
721723
np->vport = vport;
722724
np->vport_idx = vport->idx;
723725
np->vport_id = vport->vport_id;
726+
np->max_tx_hdr_size = idpf_get_max_tx_hdr_size(adapter);
724727
vport->netdev = netdev;
725728

726729
return idpf_init_mac_addr(vport, netdev);
@@ -738,6 +741,7 @@ static int idpf_cfg_netdev(struct idpf_vport *vport)
738741
np->adapter = adapter;
739742
np->vport_idx = vport->idx;
740743
np->vport_id = vport->vport_id;
744+
np->max_tx_hdr_size = idpf_get_max_tx_hdr_size(adapter);
741745

742746
spin_lock_init(&np->stats_lock);
743747

@@ -766,53 +770,32 @@ static int idpf_cfg_netdev(struct idpf_vport *vport)
766770

767771
if (idpf_is_cap_ena_all(adapter, IDPF_RSS_CAPS, IDPF_CAP_RSS))
768772
dflt_features |= NETIF_F_RXHASH;
769-
if (idpf_is_cap_ena_all(adapter, IDPF_CSUM_CAPS, IDPF_CAP_RX_CSUM_L4V4))
770-
dflt_features |= NETIF_F_IP_CSUM;
771-
if (idpf_is_cap_ena_all(adapter, IDPF_CSUM_CAPS, IDPF_CAP_RX_CSUM_L4V6))
772-
dflt_features |= NETIF_F_IPV6_CSUM;
773+
if (idpf_is_cap_ena_all(adapter, IDPF_CSUM_CAPS, IDPF_CAP_TX_CSUM_L4V4))
774+
csum_offloads |= NETIF_F_IP_CSUM;
775+
if (idpf_is_cap_ena_all(adapter, IDPF_CSUM_CAPS, IDPF_CAP_TX_CSUM_L4V6))
776+
csum_offloads |= NETIF_F_IPV6_CSUM;
773777
if (idpf_is_cap_ena(adapter, IDPF_CSUM_CAPS, IDPF_CAP_RX_CSUM))
774-
dflt_features |= NETIF_F_RXCSUM;
775-
if (idpf_is_cap_ena_all(adapter, IDPF_CSUM_CAPS, IDPF_CAP_SCTP_CSUM))
776-
dflt_features |= NETIF_F_SCTP_CRC;
778+
csum_offloads |= NETIF_F_RXCSUM;
779+
if (idpf_is_cap_ena_all(adapter, IDPF_CSUM_CAPS, IDPF_CAP_TX_SCTP_CSUM))
780+
csum_offloads |= NETIF_F_SCTP_CRC;
777781

778782
if (idpf_is_cap_ena(adapter, IDPF_SEG_CAPS, VIRTCHNL2_CAP_SEG_IPV4_TCP))
779-
dflt_features |= NETIF_F_TSO;
783+
tso_offloads |= NETIF_F_TSO;
780784
if (idpf_is_cap_ena(adapter, IDPF_SEG_CAPS, VIRTCHNL2_CAP_SEG_IPV6_TCP))
781-
dflt_features |= NETIF_F_TSO6;
785+
tso_offloads |= NETIF_F_TSO6;
782786
if (idpf_is_cap_ena_all(adapter, IDPF_SEG_CAPS,
783787
VIRTCHNL2_CAP_SEG_IPV4_UDP |
784788
VIRTCHNL2_CAP_SEG_IPV6_UDP))
785-
dflt_features |= NETIF_F_GSO_UDP_L4;
789+
tso_offloads |= NETIF_F_GSO_UDP_L4;
786790
if (idpf_is_cap_ena_all(adapter, IDPF_RSC_CAPS, IDPF_CAP_RSC))
787-
offloads |= NETIF_F_GRO_HW;
788-
/* advertise to stack only if offloads for encapsulated packets is
789-
* supported
790-
*/
791-
if (idpf_is_cap_ena(vport->adapter, IDPF_SEG_CAPS,
792-
VIRTCHNL2_CAP_SEG_TX_SINGLE_TUNNEL)) {
793-
offloads |= NETIF_F_GSO_UDP_TUNNEL |
794-
NETIF_F_GSO_GRE |
795-
NETIF_F_GSO_GRE_CSUM |
796-
NETIF_F_GSO_PARTIAL |
797-
NETIF_F_GSO_UDP_TUNNEL_CSUM |
798-
NETIF_F_GSO_IPXIP4 |
799-
NETIF_F_GSO_IPXIP6 |
800-
0;
801-
802-
if (!idpf_is_cap_ena_all(vport->adapter, IDPF_CSUM_CAPS,
803-
IDPF_CAP_TUNNEL_TX_CSUM))
804-
netdev->gso_partial_features |=
805-
NETIF_F_GSO_UDP_TUNNEL_CSUM;
806-
807-
netdev->gso_partial_features |= NETIF_F_GSO_GRE_CSUM;
808-
offloads |= NETIF_F_TSO_MANGLEID;
809-
}
791+
other_offloads |= NETIF_F_GRO_HW;
810792
if (idpf_is_cap_ena(adapter, IDPF_OTHER_CAPS, VIRTCHNL2_CAP_LOOPBACK))
811-
offloads |= NETIF_F_LOOPBACK;
793+
other_offloads |= NETIF_F_LOOPBACK;
812794

813-
netdev->features |= dflt_features;
814-
netdev->hw_features |= dflt_features | offloads;
815-
netdev->hw_enc_features |= dflt_features | offloads;
795+
netdev->features |= dflt_features | csum_offloads | tso_offloads;
796+
netdev->hw_features |= netdev->features | other_offloads;
797+
netdev->vlan_features |= netdev->features | other_offloads;
798+
netdev->hw_enc_features |= dflt_features | other_offloads;
816799
idpf_set_ethtool_ops(netdev);
817800
SET_NETDEV_DEV(netdev, &adapter->pdev->dev);
818801

@@ -927,15 +910,19 @@ static int idpf_stop(struct net_device *netdev)
927910
static void idpf_decfg_netdev(struct idpf_vport *vport)
928911
{
929912
struct idpf_adapter *adapter = vport->adapter;
913+
u16 idx = vport->idx;
930914

931915
kfree(vport->rx_ptype_lkup);
932916
vport->rx_ptype_lkup = NULL;
933917

934-
unregister_netdev(vport->netdev);
935-
free_netdev(vport->netdev);
918+
if (test_and_clear_bit(IDPF_VPORT_REG_NETDEV,
919+
adapter->vport_config[idx]->flags)) {
920+
unregister_netdev(vport->netdev);
921+
free_netdev(vport->netdev);
922+
}
936923
vport->netdev = NULL;
937924

938-
adapter->netdevs[vport->idx] = NULL;
925+
adapter->netdevs[idx] = NULL;
939926
}
940927

941928
/**
@@ -1127,11 +1114,9 @@ static struct idpf_vport *idpf_vport_alloc(struct idpf_adapter *adapter,
11271114

11281115
num_max_q = max(max_q->max_txq, max_q->max_rxq);
11291116
vport->q_vector_idxs = kcalloc(num_max_q, sizeof(u16), GFP_KERNEL);
1130-
if (!vport->q_vector_idxs) {
1131-
kfree(vport);
1117+
if (!vport->q_vector_idxs)
1118+
goto free_vport;
11321119

1133-
return NULL;
1134-
}
11351120
idpf_vport_init(vport, max_q);
11361121

11371122
/* This alloc is done separate from the LUT because it's not strictly
@@ -1141,11 +1126,9 @@ static struct idpf_vport *idpf_vport_alloc(struct idpf_adapter *adapter,
11411126
*/
11421127
rss_data = &adapter->vport_config[idx]->user_config.rss_data;
11431128
rss_data->rss_key = kzalloc(rss_data->rss_key_size, GFP_KERNEL);
1144-
if (!rss_data->rss_key) {
1145-
kfree(vport);
1129+
if (!rss_data->rss_key)
1130+
goto free_vector_idxs;
11461131

1147-
return NULL;
1148-
}
11491132
/* Initialize default rss key */
11501133
netdev_rss_key_fill((void *)rss_data->rss_key, rss_data->rss_key_size);
11511134

@@ -1158,6 +1141,13 @@ static struct idpf_vport *idpf_vport_alloc(struct idpf_adapter *adapter,
11581141
adapter->next_vport = idpf_get_free_slot(adapter);
11591142

11601143
return vport;
1144+
1145+
free_vector_idxs:
1146+
kfree(vport->q_vector_idxs);
1147+
free_vport:
1148+
kfree(vport);
1149+
1150+
return NULL;
11611151
}
11621152

11631153
/**
@@ -1536,13 +1526,22 @@ void idpf_init_task(struct work_struct *work)
15361526
}
15371527

15381528
for (index = 0; index < adapter->max_vports; index++) {
1539-
if (adapter->netdevs[index] &&
1540-
!test_bit(IDPF_VPORT_REG_NETDEV,
1541-
adapter->vport_config[index]->flags)) {
1542-
register_netdev(adapter->netdevs[index]);
1543-
set_bit(IDPF_VPORT_REG_NETDEV,
1544-
adapter->vport_config[index]->flags);
1529+
struct net_device *netdev = adapter->netdevs[index];
1530+
struct idpf_vport_config *vport_config;
1531+
1532+
vport_config = adapter->vport_config[index];
1533+
1534+
if (!netdev ||
1535+
test_bit(IDPF_VPORT_REG_NETDEV, vport_config->flags))
1536+
continue;
1537+
1538+
err = register_netdev(netdev);
1539+
if (err) {
1540+
dev_err(&pdev->dev, "failed to register netdev for vport %d: %pe\n",
1541+
index, ERR_PTR(err));
1542+
continue;
15451543
}
1544+
set_bit(IDPF_VPORT_REG_NETDEV, vport_config->flags);
15461545
}
15471546

15481547
/* As all the required vports are created, clear the reset flag
@@ -2205,8 +2204,8 @@ static netdev_features_t idpf_features_check(struct sk_buff *skb,
22052204
struct net_device *netdev,
22062205
netdev_features_t features)
22072206
{
2208-
struct idpf_vport *vport = idpf_netdev_to_vport(netdev);
2209-
struct idpf_adapter *adapter = vport->adapter;
2207+
struct idpf_netdev_priv *np = netdev_priv(netdev);
2208+
u16 max_tx_hdr_size = np->max_tx_hdr_size;
22102209
size_t len;
22112210

22122211
/* No point in doing any of this if neither checksum nor GSO are
@@ -2229,7 +2228,7 @@ static netdev_features_t idpf_features_check(struct sk_buff *skb,
22292228
goto unsupported;
22302229

22312230
len = skb_network_header_len(skb);
2232-
if (unlikely(len > idpf_get_max_tx_hdr_size(adapter)))
2231+
if (unlikely(len > max_tx_hdr_size))
22332232
goto unsupported;
22342233

22352234
if (!skb->encapsulation)
@@ -2242,7 +2241,7 @@ static netdev_features_t idpf_features_check(struct sk_buff *skb,
22422241

22432242
/* IPLEN can support at most 127 dwords */
22442243
len = skb_inner_network_header_len(skb);
2245-
if (unlikely(len > idpf_get_max_tx_hdr_size(adapter)))
2244+
if (unlikely(len > max_tx_hdr_size))
22462245
goto unsupported;
22472246

22482247
/* No need to validate L4LEN as TCP is the only protocol with a

drivers/net/ethernet/intel/idpf/idpf_main.c

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,12 @@ static void idpf_remove(struct pci_dev *pdev)
8787
*/
8888
static void idpf_shutdown(struct pci_dev *pdev)
8989
{
90-
idpf_remove(pdev);
90+
struct idpf_adapter *adapter = pci_get_drvdata(pdev);
91+
92+
cancel_delayed_work_sync(&adapter->serv_task);
93+
cancel_delayed_work_sync(&adapter->vc_event_task);
94+
idpf_vc_core_deinit(adapter);
95+
idpf_deinit_dflt_mbx(adapter);
9196

9297
if (system_state == SYSTEM_POWER_OFF)
9398
pci_set_power_state(pdev, PCI_D3hot);
@@ -174,7 +179,8 @@ static int idpf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
174179
pci_set_master(pdev);
175180
pci_set_drvdata(pdev, adapter);
176181

177-
adapter->init_wq = alloc_workqueue("%s-%s-init", 0, 0,
182+
adapter->init_wq = alloc_workqueue("%s-%s-init",
183+
WQ_UNBOUND | WQ_MEM_RECLAIM, 0,
178184
dev_driver_string(dev),
179185
dev_name(dev));
180186
if (!adapter->init_wq) {
@@ -183,7 +189,8 @@ static int idpf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
183189
goto err_free;
184190
}
185191

186-
adapter->serv_wq = alloc_workqueue("%s-%s-service", 0, 0,
192+
adapter->serv_wq = alloc_workqueue("%s-%s-service",
193+
WQ_UNBOUND | WQ_MEM_RECLAIM, 0,
187194
dev_driver_string(dev),
188195
dev_name(dev));
189196
if (!adapter->serv_wq) {
@@ -192,7 +199,8 @@ static int idpf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
192199
goto err_serv_wq_alloc;
193200
}
194201

195-
adapter->mbx_wq = alloc_workqueue("%s-%s-mbx", 0, 0,
202+
adapter->mbx_wq = alloc_workqueue("%s-%s-mbx",
203+
WQ_UNBOUND | WQ_MEM_RECLAIM, 0,
196204
dev_driver_string(dev),
197205
dev_name(dev));
198206
if (!adapter->mbx_wq) {
@@ -201,7 +209,8 @@ static int idpf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
201209
goto err_mbx_wq_alloc;
202210
}
203211

204-
adapter->stats_wq = alloc_workqueue("%s-%s-stats", 0, 0,
212+
adapter->stats_wq = alloc_workqueue("%s-%s-stats",
213+
WQ_UNBOUND | WQ_MEM_RECLAIM, 0,
205214
dev_driver_string(dev),
206215
dev_name(dev));
207216
if (!adapter->stats_wq) {
@@ -210,7 +219,8 @@ static int idpf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
210219
goto err_stats_wq_alloc;
211220
}
212221

213-
adapter->vc_event_wq = alloc_workqueue("%s-%s-vc_event", 0, 0,
222+
adapter->vc_event_wq = alloc_workqueue("%s-%s-vc_event",
223+
WQ_UNBOUND | WQ_MEM_RECLAIM, 0,
214224
dev_driver_string(dev),
215225
dev_name(dev));
216226
if (!adapter->vc_event_wq) {

0 commit comments

Comments
 (0)