public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Badal Nilawar <badal.nilawar@intel.com>
Cc: dri-devel@lists.freedesktop.org, intel-xe@lists.freedesktop.org,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	rodrigo.vivi@intel.com, wojciech.drewek@intel.com,
	michael.brooks@intel.com, heikki.krogerus@intel.com,
	michael.j.ruhl@intel.com, thomas.hellstrom@linux.intel.com,
	michal.winiarski@intel.com, anshuman.gupta@intel.com,
	jacob.e.keller@intel.com, maarten.lankhorst@linux.intel.com,
	matthew.brost@intel.com, anthony.l.nguyen@intel.com,
	przemyslaw.kitszel@intel.com, mika.westerberg@linux.intel.com,
	singaravelan.nallasellan@intel.com, kelvin.gardiner@intel.com,
	jk@codeconstruct.com.au, matt@codeconstruct.com.au,
	andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com,
	kuba@kernel.org, pabeni@redhat.com, james.ausmus@intel.com
Subject: Re: [RFC PATCH 1/1] xe/xe_mctp_mailbox: Add support for MCTP transport over mailbox
Date: Tue, 5 May 2026 11:23:29 +0300	[thread overview]
Message-ID: <afmpAXjwU16J0RG5@ashevche-desk.local> (raw)
In-Reply-To: <20260504193420.1232842-4-badal.nilawar@intel.com>

On Tue, May 05, 2026 at 01:04:22AM +0530, Badal Nilawar wrote:
> Add support for MCTP transport over the Intel vendor-specific mailbox
> protocol to enable in-band firmware updates for GPU/AMC via PLDM

...

> +#include "xe_device_types.h"

Why is the location of this inclusion is here?

> +#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.

> +#include "xe_mctp_mailbox.h"

...

> +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;

> +	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.

> +	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));
> +}

...

> +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.

> +	dev->flags = IFF_NOARP;
> +	dev->netdev_ops = &mctp_mailbox_netdev_ops;
> +	dev->pcpu_stat_type = NETDEV_PCPU_STAT_DSTATS;
> +}


-- 
With Best Regards,
Andy Shevchenko



  parent reply	other threads:[~2026-05-05  8:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-04 19:34 [RFC PATCH 0/1] Proposal for in-band firmware update over PLDM-MCTP Badal Nilawar
2026-05-04 19:34 ` [RFC PATCH 1/1] xe/xe_mctp_mailbox: Add support for MCTP transport over mailbox Badal Nilawar
2026-05-05  2:15   ` Jeremy Kerr
2026-05-05  8:23   ` Andy Shevchenko [this message]
2026-05-05  2:15 ` [RFC PATCH 0/1] Proposal for in-band firmware update over PLDM-MCTP Jeremy Kerr

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=afmpAXjwU16J0RG5@ashevche-desk.local \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=anshuman.gupta@intel.com \
    --cc=anthony.l.nguyen@intel.com \
    --cc=badal.nilawar@intel.com \
    --cc=davem@davemloft.net \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=edumazet@google.com \
    --cc=heikki.krogerus@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=jacob.e.keller@intel.com \
    --cc=james.ausmus@intel.com \
    --cc=jk@codeconstruct.com.au \
    --cc=kelvin.gardiner@intel.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=matt@codeconstruct.com.au \
    --cc=matthew.brost@intel.com \
    --cc=michael.brooks@intel.com \
    --cc=michael.j.ruhl@intel.com \
    --cc=michal.winiarski@intel.com \
    --cc=mika.westerberg@linux.intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=przemyslaw.kitszel@intel.com \
    --cc=rodrigo.vivi@intel.com \
    --cc=singaravelan.nallasellan@intel.com \
    --cc=thomas.hellstrom@linux.intel.com \
    --cc=wojciech.drewek@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox