From: David Laight <David.Laight@ACULAB.COM>
To: 'Brett Creeley' <bcreeley@amd.com>,
'Shannon Nelson' <shannon.nelson@amd.com>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"davem@davemloft.net" <davem@davemloft.net>,
"kuba@kernel.org" <kuba@kernel.org>,
"edumazet@google.com" <edumazet@google.com>,
"pabeni@redhat.com" <pabeni@redhat.com>
Cc: "brett.creeley@amd.com" <brett.creeley@amd.com>,
"drivers@pensando.io" <drivers@pensando.io>
Subject: RE: [PATCH net-next 7/8] ionic: Use an u16 for rx_copybreak
Date: Tue, 18 Jun 2024 08:16:15 +0000 [thread overview]
Message-ID: <0cdbc7079c5640ad9cfd2ea8a36eb54c@AcuMS.aculab.com> (raw)
In-Reply-To: <64876a57-9ac4-4725-8af3-67944ba6ea95@amd.com>
From: Brett Creeley
> Sent: 17 June 2024 17:25
>
> On 6/15/2024 2:20 PM, David Laight wrote:
> >
> > From: Shannon Nelson
> >> Sent: 11 June 2024 00:07
> >>
> >> From: Brett Creeley <brett.creeley@amd.com>
> >>
> >> To make space for other data members on the first cache line reduce
> >> rx_copybreak from an u32 to u16. The max Rx buffer size we support
> >> is (u16)-1 anyway so this makes sense.
> >>
> >> Signed-off-by: Brett Creeley <brett.creeley@amd.com>
> >> Signed-off-by: Shannon Nelson <shannon.nelson@amd.com>
> >> ---
> >> drivers/net/ethernet/pensando/ionic/ionic_ethtool.c | 10 +++++++++-
> >> drivers/net/ethernet/pensando/ionic/ionic_lif.h | 2 +-
> >> 2 files changed, 10 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c
> >> b/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c
> >> index 91183965a6b7..26acd82cf6bc 100644
> >> --- a/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c
> >> +++ b/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c
> >> @@ -872,10 +872,18 @@ static int ionic_set_tunable(struct net_device *dev,
> >> const void *data)
> >> {
> >> struct ionic_lif *lif = netdev_priv(dev);
> >> + u32 rx_copybreak, max_rx_copybreak;
> >>
> >> switch (tuna->id) {
> >> case ETHTOOL_RX_COPYBREAK:
> >> - lif->rx_copybreak = *(u32 *)data;
> >> + rx_copybreak = *(u32 *)data;
> >> + max_rx_copybreak = min_t(u32, U16_MAX, IONIC_MAX_BUF_LEN);
> >
> > I doubt that needs to be min_t() or that you really need the temporary.
>
> IMHO the temporary variable here makes it more readable than comparing
> directly to the casted/de-referenced opaque data pointer and then
> assigning to the rx_copybreak member if it's a valid value.
...
I was thinking of the temporary for the result of min().
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
next prev parent reply other threads:[~2024-06-18 8:16 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-10 23:06 [PATCH net-next 0/8] ionic: rework fix for doorbell miss Shannon Nelson
2024-06-10 23:06 ` [PATCH net-next 1/8] ionic: remove missed doorbell per-queue timer Shannon Nelson
2024-06-10 23:07 ` [PATCH net-next 2/8] ionic: Keep interrupt affinity up to date Shannon Nelson
2024-06-10 23:07 ` [PATCH net-next 3/8] ionic: add private workqueue per-device Shannon Nelson
2024-06-13 1:08 ` Jakub Kicinski
2024-06-13 20:38 ` Nelson, Shannon
2024-06-13 22:19 ` Jakub Kicinski
2024-06-13 22:40 ` Nelson, Shannon
2024-06-10 23:07 ` [PATCH net-next 4/8] ionic: add work item for missed-doorbell check Shannon Nelson
2024-06-13 1:19 ` Jakub Kicinski
2024-06-13 20:38 ` Nelson, Shannon
2024-06-14 1:26 ` Przemek Kitszel
2024-06-10 23:07 ` [PATCH net-next 5/8] ionic: add per-queue napi_schedule for doorbell check Shannon Nelson
2024-06-10 23:07 ` [PATCH net-next 6/8] ionic: check for queue deadline in doorbell_napi_work Shannon Nelson
2024-06-10 23:07 ` [PATCH net-next 7/8] ionic: Use an u16 for rx_copybreak Shannon Nelson
2024-06-15 21:20 ` David Laight
2024-06-16 1:28 ` Andrew Lunn
2024-06-16 10:27 ` David Laight
2024-06-17 16:24 ` Brett Creeley
2024-06-18 8:16 ` David Laight [this message]
2024-06-18 16:11 ` Brett Creeley
2024-06-10 23:07 ` [PATCH net-next 8/8] ionic: Only run the doorbell workaround for certain asic_type Shannon Nelson
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=0cdbc7079c5640ad9cfd2ea8a36eb54c@AcuMS.aculab.com \
--to=david.laight@aculab.com \
--cc=bcreeley@amd.com \
--cc=brett.creeley@amd.com \
--cc=davem@davemloft.net \
--cc=drivers@pensando.io \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=shannon.nelson@amd.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).