Skip to contentSkip to conversation

Proposal for in-band firmware update over PLDM-MCTP

RFC PATCH In review Badal Nilawar 5 participants 9 messages May 4 – May 12

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

cover Proposal for in-band firmware update over PLDM-MCTP

Problem statement:

The CRI platform includes a dedicated I2C controller for in-band access to AMC. AMC firmware updates leverage PLDM over MCTP, using the I2C controller as the physical transport, enabled by the Linux kernel's MCTP-I2C driver (drivers/net/mctp/mctp-i2c.c), which manages MCTP framing and delivery over the I2C bus.

CRI Inband firmware update flow

        +-----------------------------------+
        |         User Space                |
        |	(PLDM requester/responder)  | 
        |   PLDM client via AF_MCTP socket  |
        +-----------------------------------+
                          |
        +-----------------------------------+
        |        net/mctp core              |
        |   (routing, EID resolution,       |
        |    MCTP framing)                  |
        +-----------------------------------+
                          |
        +-----------------------------------+
        |           mctp-i2c.c              |
        |   MCTP transport over i2c         |
        +-----------------------------------+
                          |
        +-----------------------------------+
        |          AMC Firmware             |
        |	(PLDM requester/responder)  | 
        |  MCTP Decode -> PLDM Processing   |
        +-----------------------------------+

Future GPU platforms may not include a dedicated I2C controller for MCTP access; however, the requirement to support PLDM over MCTP persists. To address this, a vendor-specific mailbox-based transport is proposed to carry MCTP messages between the host and the GPU/AMC.

Solution:

The proposed approach involves implementing an MCTP transport layer with binding type MCTP_PHYS_BINDING_VENDOR (0xFF) and incorporating it either into the drivers/net/mctp/ directory or the drivers/gpu/drm/xe subsystem. The latter is particularly fitting, as Xe is the exclusive consumer of this functionality.

Option 1: MCTP Transport as Part of drivers/gpu/drm/xe Subsystem

Under this design, the Xe KMD takes sole ownership of the MCTP mailbox transport layer. The implementation is introduced as a new source file, xe-mctp-mailbox.c, placed within the drivers/gpu/drm/xe/ driver tree.

Although xe-mctp-mailbox.c resides within the Xe subsystem, it does not operate in isolation from the broader networking stack. It integrates with the standard Linux MCTP stack by registering an MCTP net device via mctp_register_netdev(), allowing the net/mctp core to manage routing, EID resolution, and MCTP framing in the usual way. This means Xe retains direct ownership of the mailbox MMIO interface (status, and data registers via BAR), while still participating as transport in the MCTP network subsystem.

  +--------------------------------------------------+
  |                  User Space                      |
  |         (PLDM Requester / Responder)             |
  |       PLDM Client via AF_MCTP Socket             |
  +--------------------------------------------------+
                         |
                    AF_MCTP API
                         |
  +--------------------------------------------------+
  |              net/mctp Core                       |
  |    (Routing, EID Resolution, MCTP Framing)       |
  +--------------------------------------------------+
            |                        ^
            | mctp_register_netdev() | netdev / mctp_dev ops
            |   (called by Xe KMD)   |
  +--------------------------------------------------+
  | [NEW] drivers/gpu/drm/xe/xe-mctp-mailbox.c       |
  |                                                  |
  |   Owned by  : Xe KMD (drivers/gpu/drm/xe/)       |
  |   - Registers directly as MCTP net device        |
  |   - Implements MCTP transport over Mailbox MMIO  |
  +--------------------------------------------------+
                         |
           Direct MMIO access (BAR registers)
                         |
  +--------------------------------------------------+
  |         Intel Mailbox MMIO Registers             |
  |    (Doorbell, Status, Data Registers via BAR)    |
  +--------------------------------------------------+
                         |
              Hardware Mailbox Interface
                         |
  +--------------------------------------------------+
  |             GPU / AMC Firmware                   |
  |         (PLDM Requester / Responder)             |
  |   Mailbox Handler --> MCTP Decode                |
  |              --> PLDM Processing                 |
  +--------------------------------------------------+

Pros:
+ Tightly coupled with Xe and doesn't polute current generic mctp subsystem with vendor specific mailbox solution.
Cons:
- Not a generic layer; cannot be easily reused or consumed by other drivers or subsystems outside of Xe.

RFC Patch: "xe/xe_mctp_mailbox: Add support for MCTP transport over mailbox"

Option 2: MCTP Transport as Part of net/mctp Subsystem

The MCTP mailbox driver (intel-mctp-mailbox.c) resides under drivers/net/mctp/ and registers itself as an Auxiliary Bus Driver on the Linux auxiliary bus. The Xe KMD is responsible for constructing an Auxiliary Bus Device which encapsulates the mailbox ops and registering it against the MCTP auxiliary bus driver. This binding allows the MCTP layer to send and receive messages through the GPU mailbox interface.

  +--------------------------------------------------+
  |                  User Space                      |
  |         (PLDM Requester / Responder)             |
  |       PLDM Client via AF_MCTP Socket             |
  +--------------------------------------------------+
                         |
                    AF_MCTP API
                         |
  +--------------------------------------------------+
  |              net/mctp Core                       |
  |    (Routing, EID Resolution, MCTP Framing)       |
  +--------------------------------------------------+
                         |
              mctp_dev ops / netdev interface
                         |
  +--------------------------------------------------+
  | [NEW] drivers/net/mctp/intel-mctp-mailbox.c      |
  |                                                  |
  |   Registered as: Auxiliary Bus Driver            |
  |   - Binds to Auxiliary Device exposed by Xe KMD  |
  |   - Accesses mailbox ops shared via aux device   |
  +--------------------------------------------------+
       |                              |
       | auxiliary_driver_register()  | auxiliary_device_register()
       |                              |
  +--------------------+   +-------------------------+
  | Auxiliary Bus      |<->| Auxiliary Device        |
  | Driver             |   | (created by Xe KMD)     |
  | (intel-mctp-       |   | - Contains mailbox_ops  |
  |  mailbox.c)        |   |                         |
  | drivers/net/mctp/  |   |                         |
  +--------------------+   +-------------------------+
                         |
              mailbox_ops (send/recv via MMIO)
                         |
  +--------------------------------------------------+
  |         Intel Mailbox MMIO Registers             |
  |    (Status, Data Registers via BAR)              |
  +--------------------------------------------------+
                         |
              Hardware Mailbox Interface
                         |
  +--------------------------------------------------+
  |             GPU / AMC Firmware                   |
  |       (PLDM Requester / Responder)               |
  |   Mailbox Handler --> MCTP Decode                |
  |       --> PLDM Processing                        |
  +--------------------------------------------------+

Pros:
+ Natively part of the MCTP stack.
+ Consistent with existing MCTP transport implementations such as mctp-i2c and mctp-i3c. Probe occurs naturally when the auxiliary device is created, following standard kernel device model patterns.
Cons:
- Introduction of vendor specific cases along with current generic mctp entries

Open for other ideas and suggestions.

Note: This RFC is prepared with AI assistance (e.g. GitHub Copilot etc).

Badal Nilawar (1):
xe/xe_mctp_mailbox: Add support for MCTP transport over mailbox

 drivers/gpu/drm/xe/Makefile          |   1 +
 drivers/gpu/drm/xe/xe_device.c       |   3 +
 drivers/gpu/drm/xe/xe_device_types.h |   4 +
 drivers/gpu/drm/xe/xe_mctp_mailbox.c | 186 +++++++++++++++++++++++++++
 drivers/gpu/drm/xe/xe_mctp_mailbox.h |  14 ++
 5 files changed, 208 insertions(+)
 create mode 100644 drivers/gpu/drm/xe/xe_mctp_mailbox.c
 create mode 100644 drivers/gpu/drm/xe/xe_mctp_mailbox.h
Signature · 1 line
2.54.0
#1 lore raw

RFC PATCH 1/1 xe/xe_mctp_mailbox: Add support for MCTP transport over mailbox

Add support for MCTP transport over the Intel vendor-specific mailbox protocol to enable in-band firmware updates for GPU/AMC via PLDM

---
 drivers/gpu/drm/xe/Makefile          |   1 +
 drivers/gpu/drm/xe/xe_device.c       |   3 +
 drivers/gpu/drm/xe/xe_device_types.h |   4 +
 drivers/gpu/drm/xe/xe_mctp_mailbox.c | 186 +++++++++++++++++++++++++++
 drivers/gpu/drm/xe/xe_mctp_mailbox.h |  14 ++
 5 files changed, 208 insertions(+)
 create mode 100644 drivers/gpu/drm/xe/xe_mctp_mailbox.c
 create mode 100644 drivers/gpu/drm/xe/xe_mctp_mailbox.h
drivers/gpu/drm/xe/Makefile +1 -0
index 09661f079d03..d427152bc3fd 100644
@@ -89,6 +89,7 @@ xe-y += xe_bb.o \
 	xe_late_bind_fw.o \
 	xe_lrc.o \
 	xe_mem_pool.o \
+	xe_mctp_mailbox.o \
 	xe_migrate.o \
 	xe_mmio.o \
 	xe_mmio_gem.o \
drivers/gpu/drm/xe/xe_device.c +3 -0
index 4b45b617a039..ebf456f580d1 100644
@@ -49,6 +49,7 @@
 #include "xe_i2c.h"
 #include "xe_irq.h"
 #include "xe_late_bind_fw.h"
+#include "xe_mctp_mailbox.h"
 #include "xe_mmio.h"
 #include "xe_module.h"
 #include "xe_nvm.h"
@@ -1065,6 +1066,8 @@ int xe_device_probe(struct xe_device *xe)
 	for_each_gt(gt, xe, id)
 		xe_gt_sanitize_freq(gt);
 
+	xe_mctp_mailbox_init(xe);
+
 	xe_vsec_init(xe);
 
 	err = xe_sriov_init_late(xe);
drivers/gpu/drm/xe/xe_device_types.h +4 -0
index 89437de3001a..9cfe70428c71 100644
@@ -38,6 +38,7 @@
 struct drm_pagemap_shrinker;
 struct intel_display;
 struct intel_dg_nvm_dev;
+struct xe_mctp_mailbox;
 struct xe_ggtt;
 struct xe_i2c;
 struct xe_pat_ops;
@@ -500,6 +501,9 @@ struct xe_device {
 		struct llist_head async_list;
 	} bo_device;
 
+	/** @mctp_mailbox: mctp mailbox */
+	struct xe_mctp_mailbox *mctp_mailbox;
+
 	/** @pmu: performance monitoring unit */
 	struct xe_pmu pmu;
 
drivers/gpu/drm/xe/xe_mctp_mailbox.c new file +186 -0

186 lines not on this page · raw message

drivers/gpu/drm/xe/xe_mctp_mailbox.h new file +14 -0
new file mode 100644
index 000000000000..318ae173aaa1
@@ -0,0 +1,14 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ *
+ * Copyright 2026 Intel Corporation
+ */
+
+#ifndef _XE_MCTP_MAILBOX_H_
+#define _XE_MCTP_MAILBOX_H_
+
+struct xe_device;
+
+int xe_mctp_mailbox_init(struct xe_device *xe);
+
+#endif /* _XE_MCTP_MAILBOX_H_ */
Signature · 1 line
2.54.0
#2 lore raw

Re: [RFC PATCH 1/1] xe/xe_mctp_mailbox: Add support for MCTP transport over mailbox

Hi Badal,

Quoted 2 lines

Add support for MCTP transport over the Intel vendor-specific mailbox protocol to enable in-band firmware updates for GPU/AMC via PLDM

I know this is an RFC, but you're missing the distinctive part, around the hardware interactions on the transport side. The skeleton of a MCTP driver is mostly the same as existing transport drivers, so there's not a lot to comment on at present.

Some items on the parts here though:

I'd suggest not using the term "MCTP over mailbox" / mctp_mailbox in general; there are lots of "mailbox" implementations around, including the proposed PCC mailbox driver. Perhaps "MCTP over Xe mailbox"?

drivers/gpu/drm/xe/xe_mctp_mailbox.c line 1

Quoted 7 lines
drivers/gpu/drm/xe/xe_mctp_mailbox.c new file +1 -0
new file mode 100644
index 000000000000..f1a81208a9a1
@@ -0,0 +1,186 @@
+// SPDX-License-Identifier: MIT

This will need to include GPLv2.

Quoted 28 lines
drivers/gpu/drm/xe/xe_mctp_mailbox.c new file +28 -0
+/*
+ * MCTP-over-MAILBOX transport for Xe.
+ *
+ * Copyright 2026 Intel Corporation
+ */
+
+#include "xe_device_types.h"
+
+#include <linux/netdevice.h>
+#include <linux/jiffies.h>
+#include <linux/workqueue.h>
+
+#include <net/mctp.h>
+#include <net/mctpdevice.h>
+#include <net/pkt_sched.h>
+
+#include <uapi/linux/if_arp.h>
+
+#include "xe_mctp_mailbox.h"
+
+#define XE_MCTP_MAILBOX_RX_POLL_MS 100
+
+/** @mctp_mailbox: Struct for mctp over mailbox */
+struct xe_mctp_mailbox {
+       /** @mctp_mailbox.netdev: network device  */
+       struct net_device *netdev;
+       /** @running: true while netdev is opened */
+       bool running;

drivers/gpu/drm/xe/xe_mctp_mailbox.c line 39

Quoted 10 lines
drivers/gpu/drm/xe/xe_mctp_mailbox.c new file +10 -0
+       /** @work: worker to handle mctp requests from firmware */
+       struct delayed_work work;
+       /** @wq: workqueue to schecdule mctp rx worker */
+       struct workqueue_struct *wq;
+};
+
+/*
+ * mailbox protocol is interrupt free so for receive path i.e. endpoint to host
+ * there is no irq available so rx handler need to be polled in worker periodically.
+ */

This is unfortunate - there's no facility you can use to trigger RX?

Quoted 15 lines
drivers/gpu/drm/xe/xe_mctp_mailbox.c new file +15 -0
+static void mctp_mailbox_rx_handler(struct work_struct *work)
+{
+       struct xe_mctp_mailbox *mctp_mailbox =
+               container_of(work, struct xe_mctp_mailbox, work.work);
+       struct net_device *netdev = mctp_mailbox->netdev;
+
+       if (!netdev)
+               return;
+
+       dev_hold(netdev);
+
+       /*
+        * if (mctp_mailbox_rx_ready()) {
+        * Get data over MAILBOX
+        * Allocate skb and copy rx data to skb

drivers/gpu/drm/xe/xe_mctp_mailbox.c line 64

Quoted 10 lines
drivers/gpu/drm/xe/xe_mctp_mailbox.c new file +10 -0
+        * Queue skb to upper layer
+        * netif_rx(skb);
+       }
+        */
+       dev_put(netdev);
+
+       if (mctp_mailbox->running)
+               queue_delayed_work(mctp_mailbox->wq, &mctp_mailbox->work,
+                                  msecs_to_jiffies(XE_MCTP_MAILBOX_RX_POLL_MS));
+}

One packet per 100ms will mean you will very likely miss a retry timeout on fragmented messages. You probably want to schedule the next RX immediately until the mailbox is empty, assuming that will work with the semantics of the Xe mailbox.

Even then, a single-packet (worst-case) transmission delay of 100ms is getting a bit large. It may be necessary to increase the polling frequency, but that has downsides. Hence the question about an RX notification facility.

Quoted 42 lines
drivers/gpu/drm/xe/xe_mctp_mailbox.c new file +42 -0
+
+static netdev_tx_t mctp_mailbox_start_xmit(struct sk_buff *skb,
+                                          struct net_device *dev)
+{
+       /* RFC stub: send skb over MAILBOX */
+       dev_dstats_tx_dropped(dev);
+       kfree_skb(skb);
+
+       return NETDEV_TX_OK;
+}
+
+static int mctp_mailbox_open(struct net_device *dev)
+{
+       struct xe_mctp_mailbox *mctp_mailbox = netdev_priv(dev);
+
+       mctp_mailbox->running = true;
+       netif_start_queue(dev);
+
+       queue_delayed_work(mctp_mailbox->wq, &mctp_mailbox->work, 0);
+
+       return 0;
+}
+
+static int mctp_mailbox_stop(struct net_device *dev)
+{
+       struct xe_mctp_mailbox *mctp_mailbox = netdev_priv(dev);
+
+       mctp_mailbox->running = false;
+       netif_stop_queue(dev);
+
+       cancel_delayed_work_sync(&mctp_mailbox->work);
+       flush_workqueue(mctp_mailbox->wq);
+
+       return 0;
+}
+
+static const struct net_device_ops mctp_mailbox_netdev_ops = {
+       .ndo_start_xmit = mctp_mailbox_start_xmit,
+       .ndo_open = mctp_mailbox_open,
+       .ndo_stop = mctp_mailbox_stop,
+};
+

drivers/gpu/drm/xe/xe_mctp_mailbox.c line 116

Quoted 10 lines
drivers/gpu/drm/xe/xe_mctp_mailbox.c new file +10 -0
+static void mctp_mailbox_netdev_setup(struct net_device *dev)
+{
+       /* Populate netdev structure */
+       dev->type = ARPHRD_MCTP;
+       /*
+        *      dev->mtu = MCTP_MAILBOX_MTU_MIN;
+        *      dev->min_mtu = MCTP_MAILBOX_MTU_MIN;
+        *      dev->max_mtu = MCTP_MAILBOX_MTU_MAX;
+        *
+        *      dev->hard_header_len = sizeof(struct mctp_mailbox_hdr);

What's in struct mctp_mailbox_hdr? I assume you don't need to handle any physical addressing, but can you confirm?

Quoted 32 lines
drivers/gpu/drm/xe/xe_mctp_mailbox.c new file +32 -0
+        *      dev->tx_queue_len = DEFAULT_TX_QUEUE_LEN;
+        */
+       dev->flags = IFF_NOARP;
+       dev->netdev_ops = &mctp_mailbox_netdev_ops;
+       dev->pcpu_stat_type = NETDEV_PCPU_STAT_DSTATS;
+}
+
+static void xe_mctp_mailbox_fini(void *arg)
+{
+       struct xe_device *xe = arg;
+       struct xe_mctp_mailbox *mctp_mailbox = xe->mctp_mailbox;
+       struct net_device *netdev;
+
+       if (!mctp_mailbox)
+               return;
+
+       netdev = mctp_mailbox->netdev;
+       if (!netdev) {
+               xe->mctp_mailbox = NULL;
+               return;
+       }
+
+       if (mctp_mailbox->wq) {
+               mctp_mailbox->running = false;
+               cancel_delayed_work_sync(&mctp_mailbox->work);
+               destroy_workqueue(mctp_mailbox->wq);
+               mctp_mailbox->wq = NULL;
+       }
+
+       xe->mctp_mailbox = NULL;
+       mctp_unregister_netdev(netdev);
+       free_netdev(netdev);

drivers/gpu/drm/xe/xe_mctp_mailbox.c line 158

Quoted 10 lines
drivers/gpu/drm/xe/xe_mctp_mailbox.c new file +10 -0
+}
+
+int xe_mctp_mailbox_init(struct xe_device *xe)
+{
+       struct xe_mctp_mailbox *mctp_mailbox;
+       struct net_device *netdev;
+       int ret, err;
+
+       netdev = alloc_netdev(sizeof(*mctp_mailbox), "mctp_mailbox%d", NET_NAME_ENUM,
+                             mctp_mailbox_netdev_setup);

I'd suggest mctpxe%d here. We don't tend to have underscores in netdev names, and 'mailbox' is quite generic.

Can you tie the name to the instance of the GPU (and then use NET_NAME_PREDICTABLE) perhaps?

Quoted 18 lines
drivers/gpu/drm/xe/xe_mctp_mailbox.c new file +18 -0
+       if (!netdev)
+               return -ENOMEM;
+
+       SET_NETDEV_DEV(netdev, xe->drm.dev);
+       mctp_mailbox = netdev_priv(netdev);
+       mctp_mailbox->netdev = netdev;
+
+       ret = mctp_register_netdev(netdev, NULL, MCTP_PHYS_BINDING_VENDOR);
+       if (ret) {
+               free_netdev(netdev);
+               return ret;
+       }
+
+       INIT_DELAYED_WORK(&mctp_mailbox->work, mctp_mailbox_rx_handler);
+       mctp_mailbox->wq = alloc_ordered_workqueue("mctp-mailbox-ordered-wq", 0);
+       if (!mctp_mailbox->wq) {
+               mctp_unregister_netdev(netdev);
+               free_netdev(netdev);

drivers/gpu/drm/xe/xe_mctp_mailbox.c line 186

Quoted 10 lines
drivers/gpu/drm/xe/xe_mctp_mailbox.c new file +10 -0
+               return -ENOMEM;
+       }
+
+       xe->mctp_mailbox = mctp_mailbox;
+       err = devm_add_action_or_reset(xe->drm.dev, xe_mctp_mailbox_fini, xe);
+       if (err)
+               return err;
+
+       return 0;
+}

Cheers,

Jeremy

#3 lore raw

Re: [RFC PATCH 1/1] xe/xe_mctp_mailbox: Add support for MCTP transport over mailbox

In reply to Badal Nilawar
Quoted 2 lines · Badal Nilawar

Add support for MCTP transport over the Intel vendor-specific mailbox protocol to enable in-band firmware updates for GPU/AMC via PLDM

...

Quoted 1 line

+#include "xe_device_types.h"

Why is the location of this inclusion is here?

drivers/gpu/drm/xe/xe_mctp_mailbox.c line 19

Quoted 10 lines
drivers/gpu/drm/xe/xe_mctp_mailbox.c new file +10 -0
+#include <linux/netdevice.h>
+#include <linux/jiffies.h>
+#include <linux/workqueue.h>
+
+#include <net/mctp.h>
+#include <net/mctpdevice.h>
+#include <net/pkt_sched.h>
+
+#include <uapi/linux/if_arp.h>
+

The above doesn't sound like more generic than linux/* ones. Move it here.

Quoted 1 line

+#include "xe_mctp_mailbox.h"

...

drivers/gpu/drm/xe/xe_mctp_mailbox.c line 47

Quoted 9 lines
drivers/gpu/drm/xe/xe_mctp_mailbox.c new file +8 -0
+static void mctp_mailbox_rx_handler(struct work_struct *work)
+{
+	struct xe_mctp_mailbox *mctp_mailbox =
+		container_of(work, struct xe_mctp_mailbox, work.work);
 
+	struct net_device *netdev = mctp_mailbox->netdev;
+
+	if (!netdev)
+		return;

This is bad style from maintenance perspective. Use

	struct net_device *netdev;

	netdev = mctp_mailbox->netdev;
	if (!netdev)
		return;

drivers/gpu/drm/xe/xe_mctp_mailbox.c line 58

Quoted 10 lines
drivers/gpu/drm/xe/xe_mctp_mailbox.c new file +10 -0
+	dev_hold(netdev);
+
+	/*
+	 * if (mctp_mailbox_rx_ready()) {
+	 * Get data over MAILBOX
+	 * Allocate skb and copy rx data to skb
+	 * Queue skb to upper layer
+	 * netif_rx(skb);
+	}
+	 */

What is this?! If you want to put a nice comment, format it accordingly.

Quoted 6 lines
drivers/gpu/drm/xe/xe_mctp_mailbox.c new file +6 -0
+	dev_put(netdev);
+
+	if (mctp_mailbox->running)
+		queue_delayed_work(mctp_mailbox->wq, &mctp_mailbox->work,
+				   msecs_to_jiffies(XE_MCTP_MAILBOX_RX_POLL_MS));
+}

...

drivers/gpu/drm/xe/xe_mctp_mailbox.c line 118

Quoted 12 lines
drivers/gpu/drm/xe/xe_mctp_mailbox.c new file +12 -0
+static void mctp_mailbox_netdev_setup(struct net_device *dev)
+{
+	/* Populate netdev structure */
+	dev->type = ARPHRD_MCTP;
+	/*
+	 *	dev->mtu = MCTP_MAILBOX_MTU_MIN;
+	 *	dev->min_mtu = MCTP_MAILBOX_MTU_MIN;
+	 *	dev->max_mtu = MCTP_MAILBOX_MTU_MAX;
+	 *
+	 *	dev->hard_header_len = sizeof(struct mctp_mailbox_hdr);
+	 *	dev->tx_queue_len = DEFAULT_TX_QUEUE_LEN;
+	 */

Even for RFC these should not exist in this form. Always add the respective FIXME/TODO/et cetera to explain the commented out code.

Quoted 4 lines
drivers/gpu/drm/xe/xe_mctp_mailbox.c new file +4 -0
+	dev->flags = IFF_NOARP;
+	dev->netdev_ops = &mctp_mailbox_netdev_ops;
+	dev->pcpu_stat_type = NETDEV_PCPU_STAT_DSTATS;
+}
Signature · 2 lines
With Best Regards,
Andy Shevchenko
#4 lore raw

Re: [RFC PATCH 1/1] xe/xe_mctp_mailbox: Add support for MCTP transport over mailbox

In reply to Badal Nilawar
kernel test robot noticed the following build errors:

Hi Badal,

[This is a private test report for your RFC patch.] kernel test robot noticed the following build errors:

[auto build test ERROR on drm-xe/drm-xe-next]
[also build test ERROR on drm-misc/drm-misc-next drm-tip/drm-tip linus/master v7.1-rc3 next-20260508] [If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Badal-Nilawar/xe-xe_mctp_mailbox-Add-support-for-MCTP-transport-over-mailbox/20260512-014830
base:   https://gitlab.freedesktop.org/drm/xe/kernel.git drm-xe-next
patch link:    https://lore.kernel.org/r/20260504193420.1232842-4-badal.nilawar%40intel.com
patch subject: [RFC PATCH 1/1] xe/xe_mctp_mailbox: Add support for MCTP transport over mailbox
config: i386-randconfig-017-20260512 (https://download.01.org/0day-ci/archive/20260512/[email protected]/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260512/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

ld: drivers/gpu/drm/xe/xe_mctp_mailbox.o: in function `xe_mctp_mailbox_fini':

>> drivers/gpu/drm/xe/xe_mctp_mailbox.c:147:(.text+0x81): undefined reference to `mctp_unregister_netdev'
   ld: drivers/gpu/drm/xe/xe_mctp_mailbox.o: in function `xe_mctp_mailbox_init':
>> drivers/gpu/drm/xe/xe_mctp_mailbox.c:166:(.text+0x2d0): undefined reference to `mctp_register_netdev'
>> ld: drivers/gpu/drm/xe/xe_mctp_mailbox.c:175:(.text+0x37c): undefined reference to `mctp_unregister_netdev'

vim +147 drivers/gpu/drm/xe/xe_mctp_mailbox.c

123
124 static void xe_mctp_mailbox_fini(void *arg)
125 {
126 struct xe_device *xe = arg;
127 struct xe_mctp_mailbox *mctp_mailbox = xe->mctp_mailbox;
128 struct net_device *netdev;
129
130 if (!mctp_mailbox)
131 return;
132
133 netdev = mctp_mailbox->netdev;
134 if (!netdev) {
135 xe->mctp_mailbox = NULL;
136 return;
137 }
138
139 if (mctp_mailbox->wq) {
140 mctp_mailbox->running = false;
141 cancel_delayed_work_sync(&mctp_mailbox->work);
142 destroy_workqueue(mctp_mailbox->wq);
143 mctp_mailbox->wq = NULL;
144 }
145
146 xe->mctp_mailbox = NULL;

 > 147		mctp_unregister_netdev(netdev);
   148		free_netdev(netdev);
   149	}
   150	
   151	int xe_mctp_mailbox_init(struct xe_device *xe)
   152	{
   153		struct xe_mctp_mailbox *mctp_mailbox;
   154		struct net_device *netdev;
   155		int ret, err;
   156	
   157		netdev = alloc_netdev(sizeof(*mctp_mailbox), "mctp_mailbox%d", NET_NAME_ENUM,
   158				      mctp_mailbox_netdev_setup);
   159		if (!netdev)
   160			return -ENOMEM;
   161	
   162		SET_NETDEV_DEV(netdev, xe->drm.dev);
   163		mctp_mailbox = netdev_priv(netdev);
   164		mctp_mailbox->netdev = netdev;
   165	
 > 166		ret = mctp_register_netdev(netdev, NULL, MCTP_PHYS_BINDING_VENDOR);
   167		if (ret) {
   168			free_netdev(netdev);
   169			return ret;
   170		}
   171	
   172		INIT_DELAYED_WORK(&mctp_mailbox->work, mctp_mailbox_rx_handler);
   173		mctp_mailbox->wq = alloc_ordered_workqueue("mctp-mailbox-ordered-wq", 0);
   174		if (!mctp_mailbox->wq) {
 > 175			mctp_unregister_netdev(netdev);
Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
#5 lore raw

Re: [RFC PATCH 1/1] xe/xe_mctp_mailbox: Add support for MCTP transport over mailbox

In reply to Badal Nilawar
kernel test robot noticed the following build errors:

Hi Badal,

[This is a private test report for your RFC patch.] kernel test robot noticed the following build errors:

[auto build test ERROR on drm-xe/drm-xe-next]
[also build test ERROR on drm-misc/drm-misc-next drm-tip/drm-tip linus/master v7.1-rc3 next-20260508] [If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Badal-Nilawar/xe-xe_mctp_mailbox-Add-support-for-MCTP-transport-over-mailbox/20260512-014830
base:   https://gitlab.freedesktop.org/drm/xe/kernel.git drm-xe-next
patch link:    https://lore.kernel.org/r/20260504193420.1232842-4-badal.nilawar%40intel.com
patch subject: [RFC PATCH 1/1] xe/xe_mctp_mailbox: Add support for MCTP transport over mailbox
config: powerpc64-randconfig-001-20260512 (https://download.01.org/0day-ci/archive/20260512/[email protected]/config)
compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260512/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

>> ld.lld: error: undefined symbol: mctp_register_netdev
   >>> referenced by xe_mctp_mailbox.c:166 (drivers/gpu/drm/xe/xe_mctp_mailbox.c:166)
   >>>               drivers/gpu/drm/xe/xe_mctp_mailbox.o:(xe_mctp_mailbox_init) in archive vmlinux.a
--
>> ld.lld: error: undefined symbol: mctp_unregister_netdev
   >>> referenced by xe_mctp_mailbox.c:147 (drivers/gpu/drm/xe/xe_mctp_mailbox.c:147)
   >>>               drivers/gpu/drm/xe/xe_mctp_mailbox.o:(xe_mctp_mailbox_init) in archive vmlinux.a
   >>> referenced by xe_mctp_mailbox.c:175 (drivers/gpu/drm/xe/xe_mctp_mailbox.c:175)
   >>>               drivers/gpu/drm/xe/xe_mctp_mailbox.o:(xe_mctp_mailbox_init) in archive vmlinux.a
   >>> referenced by xe_mctp_mailbox.c:147 (drivers/gpu/drm/xe/xe_mctp_mailbox.c:147)
   >>>               drivers/gpu/drm/xe/xe_mctp_mailbox.o:(xe_mctp_mailbox_fini) in archive vmlinux.a
Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
#6 lore raw

✗ CI.checkpatch: warning for Proposal for in-band firmware update over PLDM-MCTP

In reply to Badal Nilawar
== Series Details ==

== Series Details ==

Series: Proposal for in-band firmware update over PLDM-MCTP
URL : https://patchwork.freedesktop.org/series/165927/
State : warning

== Summary ==

+ KERNEL=/kernel
+ git clone https://gitlab.freedesktop.org/drm/maintainer-tools mt Cloning into 'mt'...
warning: redirecting to https://gitlab.freedesktop.org/drm/maintainer-tools.git/
+ git -C mt rev-list -n1 origin/master c8c12e558adaef7a4d125d83b6e1f8824bc13b82
+ cd /kernel
+ git config --global --add safe.directory /kernel
+ git log -n1
commit f2b3d771bffd77de9e704c97a97c54e3948b6227

Author: Badal Nilawar <[email protected]>
Date:   Tue May 5 01:04:22 2026 +0530

xe/xe_mctp_mailbox: Add support for MCTP transport over mailbox

Add support for MCTP transport over the Intel vendor-specific mailbox protocol to enable in-band firmware updates for GPU/AMC via PLDM

+ /mt/dim checkpatch 9160312bed536c4b78ad3736fc1aaf25ed78bccd drm-intel f2b3d771bffd xe/xe_mctp_mailbox: Add support for MCTP transport over mailbox -:68: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating? #68:
new file mode 100644

total: 0 errors, 1 warnings, 0 checks, 238 lines checked

#7 lore raw

✗ CI.KUnit: failure for Proposal for in-band firmware update over PLDM-MCTP

In reply to Badal Nilawar
== Series Details ==

== Series Details ==

Series: Proposal for in-band firmware update over PLDM-MCTP
URL : https://patchwork.freedesktop.org/series/165927/
State : failure

== Summary ==

+ trap cleanup EXIT
+ /kernel/tools/testing/kunit/kunit.py run --kunitconfig /kernel/drivers/gpu/drm/xe/.kunitconfig [19:28:55] Configuring KUnit Kernel ...
Generating .config ...
Populating config with:

$ make ARCH=um O=.kunit olddefconfig
[19:28:59] Building KUnit Kernel ...
Populating config with:
$ make ARCH=um O=.kunit olddefconfig
Building with:
$ make all compile_commands.json scripts_gdb ARCH=um O=.kunit --jobs=48
ERROR:root:/usr/bin/ld: drivers/gpu/drm/xe/xe_mctp_mailbox.o: in function `xe_mctp_mailbox_fini':
xe_mctp_mailbox.c:(.text+0x9f): undefined reference to `mctp_unregister_netdev'
/usr/bin/ld: xe_mctp_mailbox.c:(.text+0xb0): undefined reference to `free_netdev'
/usr/bin/ld: drivers/gpu/drm/xe/xe_mctp_mailbox.o: in function `mctp_mailbox_start_xmit':
xe_mctp_mailbox.c:(.text+0x135): undefined reference to `sk_skb_reason_drop'
/usr/bin/ld: drivers/gpu/drm/xe/xe_mctp_mailbox.o: in function `xe_mctp_mailbox_init':
xe_mctp_mailbox.c:(.text+0x2c1): undefined reference to `alloc_netdev_mqs'
/usr/bin/ld: xe_mctp_mailbox.c:(.text+0x2fc): undefined reference to `mctp_register_netdev'
/usr/bin/ld: xe_mctp_mailbox.c:(.text+0x432): undefined reference to `free_netdev'
/usr/bin/ld: xe_mctp_mailbox.c:(.text+0x448): undefined reference to `mctp_unregister_netdev'
/usr/bin/ld: xe_mctp_mailbox.c:(.text+0x45a): undefined reference to `free_netdev'
collect2: error: ld returned 1 exit status
make[3]: *** [../scripts/Makefile.vmlinux:72: vmlinux.unstripped] Error 1
make[2]: *** [/kernel/Makefile:1335: vmlinux] Error 2
make[1]: *** [/kernel/Makefile:248: __sub-make] Error 2
make: *** [Makefile:248: __sub-make] Error 2

+ cleanup
++ stat -c %u:%g /kernel
+ chown -R 1003:1003 /kernel

#8 lore raw
In reply to Badal Nilawar

Hi Badal,

Thanks for sending this RFC through! It's good to have some early input on the structure here.

Quoted 1 line

Problem statement:

This is exceptionally verbose for "we would like to add a MCTP transport driver". :)

Quoted 1 line

Option 1: MCTP Transport as Part of drivers/gpu/drm/xe Subsystem

This sounds like the best approach to me. The MCTP transport drivers in drivers/net/mctp are intended to be fairly hardware-agnostic, and all are spec compliant. I see no issue with having your own code do a mctp_register_netdev() from elsewhere in the tree.

I'll also reply on 1/1 with some implementation comments.

Quoted 1 line

Note: This RFC is prepared with AI assistance (e.g. GitHub Copilot etc).

Then please ensure you have read Documentation/process/coding-assistants.rst, as you are missing the Attribution requirements from that.

Cheers,

Jeremy