From: "Stefan Lässer" <stefan.laesser@omicronenergy.com>
To: "Morten Brørup" <mb@smartsharesystems.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: RE: [PATCH] net/af_packet: add timestamp offloading support
Date: Fri, 20 Sep 2024 06:48:51 +0000 [thread overview]
Message-ID: <AM0PR03MB62758F2983B274C4BFE0F7CB966C2@AM0PR03MB6275.eurprd03.prod.outlook.com> (raw)
In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35E9F6CC@smartserver.smartshare.dk>
> > +uint64_t af_packet_timestamp_dynflag; int
> > +af_packet_timestamp_dynfield_offset = -1;
>
> No need to expose these publicly, they should be static.
> This also means that you can remove the af_packet_ prefix.
> > eth_dev_start(struct rte_eth_dev *dev) {
> > struct pmd_internals *internals = dev->data->dev_private;
> > - uint16_t i;
> > +
> > + if (internals->timestamp_offloading) {
> > + /* Register mbuf field and flag for Rx timestamp */
> > + int rc =
> >
> rte_mbuf_dyn_rx_timestamp_register(&af_packet_timestamp_dynfield_offs
> e
> > t,
> > + &af_packet_timestamp_dynflag);
> > + if (rc) {
> > + PMD_LOG(ERR, "Cannot register mbuf field/flag for
> > timestamp");
> > + return rc;
> > + }
> > + }
> >
> > dev->data->dev_link.link_status = RTE_ETH_LINK_UP;
> > +
> > + uint16_t i;
>
> No need to move this down here. Please leave it where it was.
>
> Alternatively, minimize its scope by moving it inside the for loop:
> - for (i = 0; i < internals->nb_queues; i++) {
> + for (uint16_t i = 0; i < internals->nb_queues; i++) {
>
>
> With the two variables made local,
>
> Acked-by: Morten Brørup <mb@smartsharesystems.com>
Thank you very much for your feedback! I have submitted a patch including your recommendations.
I will start with the other patches now.
next prev parent reply other threads:[~2024-09-20 6:48 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-03 11:43 Stefan Laesser
2024-09-03 16:21 ` Stephen Hemminger
2024-09-03 21:11 ` Morten Brørup
2024-09-06 6:22 ` Stefan Lässer
2024-09-06 8:13 ` Morten Brørup
2024-09-11 5:44 ` Stefan Lässer
2024-09-11 6:59 ` Morten Brørup
2024-09-20 6:48 ` Stefan Lässer [this message]
2024-09-20 6:44 ` [PATCH v2] " Stefan Laesser
2024-09-20 7:14 ` [PATCH v3] " Stefan Laesser
2024-09-20 14:29 ` Stephen Hemminger
2024-09-20 16:09 ` Morten Brørup
2024-09-22 3:06 ` Ferruh Yigit
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=AM0PR03MB62758F2983B274C4BFE0F7CB966C2@AM0PR03MB6275.eurprd03.prod.outlook.com \
--to=stefan.laesser@omicronenergy.com \
--cc=dev@dpdk.org \
--cc=mb@smartsharesystems.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).