Successfully build based on ASK and run k8s, cdx pending

This commit is contained in:
2026-05-10 04:35:55 +08:00
parent 9c6fb5194e
commit 9fd18cfe6f
11 changed files with 403 additions and 271 deletions

View File

@@ -0,0 +1,24 @@
From c772418b42580bcf9d9b863e742df7ae3f921176 Mon Sep 17 00:00:00 2001
From: test <test@example.com>
Date: Sat, 9 May 2026 16:59:25 +0000
Subject: [PATCH 1/2] cdx: do not start dpa_app from kernel module
diff --git a/cdx/cdx_main.c b/cdx/cdx_main.c
index 2d7b72b..ec763cb 100644
--- a/cdx/cdx_main.c
+++ b/cdx/cdx_main.c
@@ -8,8 +8,8 @@
*
*/
-//uncomment to start dpa_app from cdx module
-#define START_DPA_APP 1
+// Start dpa_app from userspace service ordering instead of kernel module init.
+// #define START_DPA_APP 1
#define DEFINE_GLOBALS
#include "portdefs.h"
--
2.47.3

View File

@@ -0,0 +1,39 @@
From 919ea304abf495a7142639e51555508fa1b23a30 Mon Sep 17 00:00:00 2001
From: test <test@example.com>
Date: Sat, 9 May 2026 16:59:28 +0000
Subject: [PATCH 2/2] cdx: do not fail module init for absent optional offloads
diff --git a/cdx/cdx_main.c b/cdx/cdx_main.c
index ec763cb..641121b 100644
--- a/cdx/cdx_main.c
+++ b/cdx/cdx_main.c
@@ -195,16 +195,17 @@ static int __init cdx_module_init(void)
#ifdef CFG_WIFI_OFFLOAD
rc = dpaa_vwd_init();
if (rc != 0) {
- printk("%s::vwd_driver_init failed\n", __func__);
- goto exit;
+ printk(KERN_WARNING "%s::vwd_driver_init failed rc %d; continuing without wifi offload\n",
+ __func__, rc);
+ rc = 0;
}
#endif
- // initialize global fragmentation params
- if (cdx_init_frag_module()) {
- printk("%s::cdx_init_frag_module failed\n", __func__);
- rc = -EIO;
- goto exit;
- }
+ /*
+ * The vendor fragmentation path assumes its BMan pool/config exists and
+ * can crash in bman_free_pool() when this board profile does not provide
+ * it. Keep CDX usable without the optional fragmentation offload path.
+ */
+ printk(KERN_WARNING "%s::skipping cdx_init_frag_module on this platform\n", __func__);
#ifdef DPA_IPSEC_OFFLOAD
if (cdx_dpa_ipsec_init()) {
--
2.47.3

View File

@@ -0,0 +1,76 @@
--- a/cdx/dpa_wifi.c 2026-05-08 15:39:41.418608108 +0000
+++ b/cdx/dpa_wifi.c 2026-05-08 15:39:41.434536563 +0000
@@ -840,17 +840,15 @@
/* Get a page frag to store the SGTable, or a full page if the errata
* is in place and we need to avoid crossing a 4k boundary.
*/
-#ifdef FM_ERRATUM_A050385
if (unlikely(fm_has_errata_a050385())) {
struct page *new_page = alloc_page(GFP_ATOMIC);
if (unlikely(!new_page))
return -ENOMEM;
sgt_buf = page_address(new_page);
- }
- else
-#endif
+ } else {
sgt_buf = netdev_alloc_frag(priv->eth_priv->tx_headroom + sgt_size);
+ }
if (unlikely(!sgt_buf)) {
dev_err(dpa_bp->dev, "netdev_alloc_frag() failed\n");
@@ -1082,11 +1080,7 @@
/* We do not support Jumbo frames on LS1043 and thus we edit
* the skb truesize only when the 4k errata is not present.
*/
-#ifdef FM_ERRATUM_A050385
if (likely(!fm_has_errata_a050385())) {
-#else
- if (likely(!dpaa_errata_a010022)) {
-#endif
skb->truesize = SKB_TRUESIZE(dpa_fd_length(fd));
}
}
@@ -1152,11 +1146,8 @@
err = custom_vwd_skb_to_sg_fd(priv, skb, &fd);
INCR_PER_CPU_STAT(vap_dev->vap_stats, pkts_tx_sg);
#else
-#ifdef FM_ERRATUM_A050385
if (unlikely(fm_has_errata_a050385()) && a050385_check_skb(skb, priv->eth_priv))
skb_need_wa = true;
-#endif
-
nonlinear = skb_is_nonlinear(skb);
@@ -1217,7 +1208,6 @@
* more fragments than we support. In this case,
* we have no choice but to linearize it ourselves.
*/
-#ifdef FM_ERRATUM_A050385
/* No point in linearizing the skb now if we are going
* to realign and linearize it again further down due
* to the A050385 errata
@@ -1226,13 +1216,11 @@
skb_need_wa = true;
else
err = __skb_linearize(skb);
-#endif
}
if (unlikely(!skb || err < 0))
/* Common out-of-memory error path */
goto skb_to_fd_failed;
-#ifdef FM_ERRATUM_A050385
/* Verify the skb a second time if it has been updated since
* the previous check
*/
@@ -1248,7 +1236,6 @@
dev_kfree_skb(skb);
skb = nskb;
}
-#endif
err = vwd_skb_to_contig_fd(priv, skb, &fd, &offset);
}

View File

@@ -0,0 +1,52 @@
--- a/cdx/devoh.c
+++ b/cdx/devoh.c
@@ -313,6 +313,7 @@
uint32_t port_idx;
uint8_t oh_iface_name[8]="";
+ printk(KERN_INFO "%s::adding OH iface name=%s\n", __func__, name);
if (sscanf(name, "dpa-fman%d-oh@%d", &fman_idx,
&port_idx) != 2) {
@@ -331,6 +332,8 @@
DPA_ERROR("%s::oh_port_driver_get_port_info failed\n", __func__);
return FAILURE;
}
+ printk(KERN_INFO "%s::OH port info name=%s channel=%u default_fqid=0x%x err_fqid=0x%x\n",
+ __func__, name, info.channel_id, info.default_fqid, info.err_fqid);
//ethernet/physical iface type
iface_info = (struct dpa_iface_info *)
kzalloc(sizeof(struct dpa_iface_info), GFP_KERNEL);
@@ -358,6 +361,10 @@
__func__, name);
goto err_ret;
}
+ printk(KERN_INFO "%s::CDX OH iface config found name=%s fman=%u port_idx=%u portid=%u max_dist=%u\n",
+ __func__, name,
+ iface_info->oh_info.fman_idx, iface_info->oh_info.port_idx,
+ iface_info->oh_info.portid, iface_info->oh_info.max_dist);
if (cdx_create_dir_in_procfs(&iface_info->pcd_proc_entry, oh_iface_name, PCD_DIR)) {
DPA_ERROR("%s:: create pcd proc entry failed %s\n",
__func__, name);
@@ -581,6 +588,10 @@
#endif
}
//add fqid information into of port list
+ printk(KERN_INFO "%s::created OH FQs name=%s fman=%u port_idx=%u rx_default_fqid=0x%x rx_err_fqid=0x%x channel=0x%x\n",
+ __func__, dpa_oh_iface_info->name, iface_info->fman_idx,
+ iface_info->port_idx, iface_info->fqinfo[RX_DEFA_FQ].fq_base,
+ iface_info->fqinfo[RX_ERR_FQ].fq_base, iface_info->channel_id);
port_info->fm_idx = iface_info->fman_idx;
port_info->ohinfo = iface_info;
port_info->channel = iface_info->channel_id;
@@ -600,6 +611,10 @@
}
offline_port_info[iface_info->fman_idx][iface_info->port_idx].flags |=
(OF_FQID_VALID | PORT_VALID);
+ printk(KERN_INFO "%s::OH port registered name=%s fman=%u port_idx=%u flags=0x%x\n",
+ __func__, port_info->name, iface_info->fman_idx,
+ iface_info->port_idx,
+ offline_port_info[iface_info->fman_idx][iface_info->port_idx].flags);
return 0;
}