DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Xuanziyang (William, Chip Application Design Logic and Hardware Development Dept IT_Products & Solutions)" <xuanziyang2@huawei.com>
To: Ferruh Yigit <ferruh.yigit@intel.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: "Wangxiaoyun (Cloud,
	Network Chip Application Development Dept)"
	<cloud.wangxiaoyun@huawei.com>,
	zhouguoyang <zhouguoyang@huawei.com>,
	Shahar Belkar <shahar.belkar@huawei.com>,
	"stephen@networkplumber.org" <stephen@networkplumber.org>,
	Luoxianjun <luoxianjun@huawei.com>
Subject: Re: [dpdk-dev] [PATCH v4 07/11] net/hinic/base: add various headers
Date: Wed, 12 Jun 2019 14:24:40 +0000	[thread overview]
Message-ID: <EA3B33EA29B44042A5337C4DC59AF4505EEE4367@dggeml512-mbx.china.huawei.com> (raw)


> On 6/6/2019 12:06 PM, Ziyang Xuan wrote:
> > Add various headers that define mgmt commands, cmdq commands, rx
> data
> > structures, tx data structures and basic defines for use in the code.
> >
> > Signed-off-by: Ziyang Xuan <xuanziyang2@huawei.com>
> 
> <...>
> 
> > +#define PMD_DRV_LOG(level, fmt, args...) \
> > +	rte_log(RTE_LOG_ ## level, hinic_logtype, \
> > +		HINIC_DRIVER_NAME": " fmt "\n", ##args)
> > +
> > +#define HINIC_ASSERT_EN
> > +
> > +#ifdef HINIC_ASSERT_EN
> > +#define HINIC_ASSERT(exp)	\
> > +	do {			\
> > +		if (!(exp)) {	\
> > +			rte_panic("line%d\tassert \"" #exp "\" failed\n", \
> > +				  __LINE__);	\
> > +		}		\
> > +	} while (0)
> > +#else
> > +#define HINIC_ASSERT(exp)	do {} while (0)
> > +#endif
> 
> So you are enabling asserting by default? Which can cause "rte_panic()" ?
> 
> Please make sure asserting is disabled by default, and please tie this to the
> "CONFIG_RTE_ENABLE_ASSERT" config option. So it that option is disabled
> hinic also should disable the assertions.

I checked the places where use rte_panic, most of them can use code logic to guarantee correctness. And I have referenced other PMDs like mlx5, they use
rte_panic directly but use custom encapsulation, so I delete custom encapsulation  above and the most rte_panic usage, and use directly like mlx5.

Is it OK?

             reply	other threads:[~2019-06-12 14:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-12 14:24 Xuanziyang (William, Chip Application Design Logic and Hardware Development Dept IT_Products & Solutions) [this message]
2019-06-14 15:37 ` Ferruh Yigit
  -- strict thread matches above, loose matches on Subject: below --
2019-06-06 11:04 [dpdk-dev] [PATCH v4 00/11] A new net PMD - hinic Ziyang Xuan
2019-06-06 11:17 ` [dpdk-dev] [PATCH v4 07/11] net/hinic/base: add various headers Ziyang Xuan
2019-06-06 11:06   ` Ziyang Xuan
2019-06-11 16:04   ` 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=EA3B33EA29B44042A5337C4DC59AF4505EEE4367@dggeml512-mbx.china.huawei.com \
    --to=xuanziyang2@huawei.com \
    --cc=cloud.wangxiaoyun@huawei.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=luoxianjun@huawei.com \
    --cc=shahar.belkar@huawei.com \
    --cc=stephen@networkplumber.org \
    --cc=zhouguoyang@huawei.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).