From: Olivier Matz <olivier.matz@6wind.com>
To: "Ananyev, Konstantin" <konstantin.ananyev@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
"Andrew Rybchenko" <arybchenko@solarflare.com>,
"Richardson, Bruce" <bruce.richardson@intel.com>,
"Wang, Haiyue" <haiyue.wang@intel.com>,
"Jerin Jacob Kollanukkaran" <jerinj@marvell.com>,
"Wiles, Keith" <keith.wiles@intel.com>,
"Morten Brørup" <mb@smartsharesystems.com>,
"Stephen Hemminger" <stephen@networkplumber.org>,
"Thomas Monjalon" <thomas@monjalon.net>
Subject: Re: [dpdk-dev] [PATCH v2] mbuf: support dynamic fields and flags
Date: Wed, 23 Oct 2019 13:45:57 +0200 [thread overview]
Message-ID: <20191023114557.GL25286@glumotte.dev.6wind.com> (raw)
In-Reply-To: <20191023101946.GH25286@glumotte.dev.6wind.com>
On Wed, Oct 23, 2019 at 12:19:46PM +0200, Olivier Matz wrote:
> On Tue, Oct 22, 2019 at 10:51:51PM +0000, Ananyev, Konstantin wrote:
(...)
> > > +/* Allocate and initialize the shared memory. Assume tailq is locked */
> > > +static int
> > > +init_shared_mem(void)
> > > +{
> > > + const struct rte_memzone *mz;
> > > + uint64_t mask;
> > > +
> > > + if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
> > > + mz = rte_memzone_reserve_aligned(RTE_MBUF_DYN_MZNAME,
> > > + sizeof(struct mbuf_dyn_shm),
> > > + SOCKET_ID_ANY, 0,
> > > + RTE_CACHE_LINE_SIZE);
> > > + } else {
> > > + mz = rte_memzone_lookup(RTE_MBUF_DYN_MZNAME);
> > > + }
> > > + if (mz == NULL)
> > > + return -1;
> > > +
> > > + shm = mz->addr;
> > > +
> > > +#define mark_free(field) \
> > > + memset(&shm->free_space[offsetof(struct rte_mbuf, field)], \
> > > + 1, sizeof(((struct rte_mbuf *)0)->field))
> >
> > Still think it would look nicer without multi-line macro defines/undef in the middle of the function.
>
> I rather think that macro helps to make the code more readable, but it's
> probably just a matter of taste. Will someone puts a contract on me if I
> keep it like this? If yes I'll do the change ;)
More seriously, do you prefer if I move the macro definition above the
function?
next prev parent reply other threads:[~2019-10-23 11:45 UTC|newest]
Thread overview: 64+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-10 9:29 [dpdk-dev] [RFC] " Olivier Matz
2019-07-10 17:14 ` Wang, Haiyue
2019-07-11 7:26 ` Olivier Matz
2019-07-11 8:04 ` Wang, Haiyue
2019-07-11 8:20 ` Olivier Matz
2019-07-11 8:34 ` Wang, Haiyue
2019-07-11 15:31 ` Stephen Hemminger
2019-07-12 9:18 ` Olivier Matz
2019-07-10 17:49 ` Stephen Hemminger
2019-07-10 18:12 ` Wiles, Keith
2019-07-11 7:53 ` Olivier Matz
2019-07-11 14:37 ` Wiles, Keith
2019-07-12 9:06 ` Olivier Matz
2019-07-11 7:36 ` Olivier Matz
2019-07-12 12:23 ` Jerin Jacob Kollanukkaran
2019-07-16 9:39 ` Olivier Matz
2019-07-16 14:43 ` Stephen Hemminger
2019-07-11 9:24 ` Thomas Monjalon
2019-07-12 14:54 ` Andrew Rybchenko
2019-07-16 9:49 ` Olivier Matz
2019-07-16 11:31 ` [dpdk-dev] ***Spam*** " Andrew Rybchenko
2019-09-18 16:54 ` [dpdk-dev] [PATCH] " Olivier Matz
2019-09-21 4:54 ` Wang, Haiyue
2019-09-23 8:31 ` Olivier Matz
2019-09-23 11:01 ` Wang, Haiyue
2019-09-21 8:28 ` Wiles, Keith
2019-09-23 8:56 ` Morten Brørup
2019-09-23 9:41 ` Olivier Matz
2019-09-23 9:13 ` Olivier Matz
2019-09-23 15:14 ` Wiles, Keith
2019-09-23 16:16 ` Olivier Matz
2019-09-23 17:14 ` Wiles, Keith
2019-09-23 16:09 ` Wiles, Keith
2019-10-01 10:49 ` Ananyev, Konstantin
2019-10-17 7:54 ` Olivier Matz
2019-10-17 11:58 ` Ananyev, Konstantin
2019-10-17 12:58 ` Olivier Matz
2019-10-17 14:42 ` [dpdk-dev] [PATCH v2] " Olivier Matz
2019-10-18 2:47 ` Wang, Haiyue
2019-10-18 7:53 ` Olivier Matz
2019-10-18 8:28 ` Wang, Haiyue
2019-10-18 9:47 ` Olivier Matz
2019-10-18 11:24 ` Wang, Haiyue
2019-10-22 22:51 ` Ananyev, Konstantin
2019-10-23 3:16 ` Wang, Haiyue
2019-10-23 10:21 ` Olivier Matz
2019-10-23 15:00 ` Stephen Hemminger
2019-10-23 15:12 ` Wang, Haiyue
2019-10-23 10:19 ` Olivier Matz
2019-10-23 11:45 ` Olivier Matz [this message]
2019-10-23 11:49 ` Ananyev, Konstantin
2019-10-23 12:00 ` Shahaf Shuler
2019-10-23 13:33 ` Olivier Matz
2019-10-24 4:54 ` Shahaf Shuler
2019-10-24 7:07 ` Olivier Matz
2019-10-24 7:38 ` Slava Ovsiienko
2019-10-24 7:56 ` Olivier Matz
2019-10-24 8:13 ` [dpdk-dev] [PATCH v3] " Olivier Matz
2019-10-24 15:30 ` Stephen Hemminger
2019-10-24 15:44 ` Thomas Monjalon
2019-10-24 17:07 ` Stephen Hemminger
2019-10-24 16:40 ` Thomas Monjalon
2019-10-26 12:39 ` [dpdk-dev] [PATCH v4] " Olivier Matz
2019-10-26 17:04 ` Thomas Monjalon
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=20191023114557.GL25286@glumotte.dev.6wind.com \
--to=olivier.matz@6wind.com \
--cc=arybchenko@solarflare.com \
--cc=bruce.richardson@intel.com \
--cc=dev@dpdk.org \
--cc=haiyue.wang@intel.com \
--cc=jerinj@marvell.com \
--cc=keith.wiles@intel.com \
--cc=konstantin.ananyev@intel.com \
--cc=mb@smartsharesystems.com \
--cc=stephen@networkplumber.org \
--cc=thomas@monjalon.net \
/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).