netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Shenwei Wang <shenwei.wang@nxp.com>
Cc: Wei Fang <wei.fang@nxp.com>, Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Jesper Dangaard Brouer <hawk@kernel.org>,
	John Fastabend <john.fastabend@gmail.com>,
	Clark Wang <xiaoning.wang@nxp.com>,
	Stanislav Fomichev <sdf@fomichev.me>,
	imx@lists.linux.dev, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-imx@nxp.com,
	Andrew Lunn <andrew@lunn.ch>, Frank Li <frank.li@nxp.com>
Subject: Re: [PATCH v6 net-next 1/6] net: fec: use a member variable for maximum buffer size
Date: Tue, 9 Sep 2025 17:00:53 -0700	[thread overview]
Message-ID: <20250909170053.6d0eb1b7@kernel.org> (raw)
In-Reply-To: <20250908161755.608704-2-shenwei.wang@nxp.com>

On Mon,  8 Sep 2025 11:17:50 -0500 Shenwei Wang wrote:
> -#define	OPT_FRAME_SIZE	(PKT_MAXBUF_SIZE << 16)
> -#else
> -#define	OPT_FRAME_SIZE	0
> +#define	OPT_ARCH_HAS_MAX_FL
>  #endif

> +#ifdef OPT_ARCH_HAS_MAX_FL
> +	rcntl |= fep->max_buf_size << 16;
> +#endif

We try to avoid ifdefs inside C functions, they make compilation
coverage harder. Could you define OPT_ARCH_HAS_MAX_FL to 0 or 1
depending on the platform, and then use:

	if (OPT_ARCH_HAS_MAX_FL)
		rcntl |= fep->max_buf_size << 16;

The compiler will eliminate the condition if it's a constant,
but its slightly easier to read and lets the compiler see the code
regardless of the arch.

  parent reply	other threads:[~2025-09-10  0:00 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-08 16:17 [PATCH v6 net-next 0/6] net: fec: add the Jumbo frame support Shenwei Wang
2025-09-08 16:17 ` [PATCH v6 net-next 1/6] net: fec: use a member variable for maximum buffer size Shenwei Wang
2025-09-09  2:12   ` Wei Fang
2025-09-09 14:37     ` Shenwei Wang
2025-09-10  3:08       ` Wei Fang
2025-09-10  0:00   ` Jakub Kicinski [this message]
2025-09-08 16:17 ` [PATCH v6 net-next 2/6] net: fec: add pagepool_order to support variable page size Shenwei Wang
2025-09-08 16:17 ` [PATCH v6 net-next 3/6] net: fec: update MAX_FL based on the current MTU Shenwei Wang
2025-09-09  2:16   ` Wei Fang
2025-09-08 16:17 ` [PATCH v6 net-next 4/6] net: fec: add rx_frame_size to support configurable RX length Shenwei Wang
2025-09-09  2:20   ` Wei Fang
2025-09-08 16:17 ` [PATCH v6 net-next 5/6] net: fec: add change_mtu to support dynamic buffer allocation Shenwei Wang
2025-09-09  2:58   ` Wei Fang
2025-09-08 16:17 ` [PATCH v6 net-next 6/6] net: fec: enable the Jumbo frame support for i.MX8QM Shenwei Wang
2025-09-09  2:52   ` Wei Fang

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=20250909170053.6d0eb1b7@kernel.org \
    --to=kuba@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=andrew@lunn.ch \
    --cc=ast@kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=frank.li@nxp.com \
    --cc=hawk@kernel.org \
    --cc=imx@lists.linux.dev \
    --cc=john.fastabend@gmail.com \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sdf@fomichev.me \
    --cc=shenwei.wang@nxp.com \
    --cc=wei.fang@nxp.com \
    --cc=xiaoning.wang@nxp.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;
as well as URLs for NNTP newsgroup(s).