All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Miller <davem@redhat.com>
To: jakub.kicinski@netronome.com
Cc: netdev@vger.kernel.org, simon.horman@netronome.com,
	rolf.neugebauer@netronome.com
Subject: Re: [PATCH net-next v4 2/2] net: add driver for Netronome NFP4000/NFP6000 NIC VFs
Date: Mon, 30 Nov 2015 10:42:26 -0500 (EST)	[thread overview]
Message-ID: <20151130.104226.1974076120162436486.davem@redhat.com> (raw)
In-Reply-To: <1448465944-32294-3-git-send-email-jakub.kicinski@netronome.com>

From: Jakub Kicinski <jakub.kicinski@netronome.com>
Date: Wed, 25 Nov 2015 15:39:04 +0000

> +config NFP_NET_DEBUG
> +	bool "Debug support for Netronome(R) NFP3200/NFP6000 NIC drivers"
> +	depends on NFP_NET || NFP_NETVF
> +	---help---
> +	  Enable extra sanity checks and debugfs support in
> +	  Netronome(R) NFP3200/NFP6000 NIC PF and VF drivers.
> +	  Note: selecting this option may adversely impact
> +		performance.
 ...
> +#ifdef CONFIG_NFP_NET_DEBUG
> +#define nn_assert(cond, fmt, args...)					\
> +	do {								\
> +		if (unlikely(!(cond))) {				\
> +			pr_err("assertion %s failed\n", #cond);		\
> +			pr_err(fmt, ## args);				\
> +			BUG();						\
> +		}							\
> +	} while (0)
> +#else
> +#define nn_assert(cond, fmt, args...)	do { } while (0)
> +#endif

This is really not appropriate.

Use WARN_ON() et al. as appropriate to assert things, and in particular
_AVOID_ BUG() in pretty much all cases and attempt to continue running
somehow with error handling paths etc.

Use of BUG() is discouraged in all except the most extreme cases where
the kernel cannot continue to execute at all.

Thanks.

  reply	other threads:[~2015-11-30 15:42 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-27 18:15 [PATCHv2 0/2] Netronome NFP4000/NFP6000 NIC VF driver Jakub Kicinski
2015-10-27 18:15 ` [PATCHv2 1/2] pci_ids: add Netronome Systems vendor Jakub Kicinski
2015-10-27 18:15 ` [PATCHv2 2/2] net: add driver for Netronome NFP4000/NFP6000 NIC VFs Jakub Kicinski
2015-10-30 10:27   ` David Miller
2015-11-23 11:04     ` [PATCH net-next v3 0/2] Netronome NFP4000/NFP6000 NIC VF driver Jakub Kicinski
2015-11-23 11:04       ` [PATCH net-next v3 1/2] pci_ids: add Netronome Systems vendor Jakub Kicinski
2015-11-23 11:04       ` [PATCH net-next v3 2/2] net: add driver for Netronome NFP4000/NFP6000 NIC VFs Jakub Kicinski
2015-11-24 19:25         ` David Miller
2015-11-24 19:53           ` Jakub Kicinski
2015-11-25 15:39 ` [PATCH net-next v4 0/2] Netronome NFP4000/NFP6000 NIC VF driver Jakub Kicinski
2015-11-25 15:39   ` [PATCH net-next v4 1/2] pci_ids: add Netronome Systems vendor Jakub Kicinski
2015-11-25 15:39   ` [PATCH net-next v4 2/2] net: add driver for Netronome NFP4000/NFP6000 NIC VFs Jakub Kicinski
2015-11-30 15:42     ` David Miller [this message]
2015-12-01 14:55 ` [PATCH net-next v5 0/2] Netronome NFP4000/NFP6000 NIC VF driver Jakub Kicinski
2015-12-01 14:55   ` [PATCH net-next v5 1/2] pci_ids: add Netronome Systems vendor Jakub Kicinski
2015-12-01 14:55   ` [PATCH net-next v5 2/2] net: add driver for Netronome NFP4000/NFP6000 NIC VFs Jakub Kicinski
2015-12-03 19:18   ` [PATCH net-next v5 0/2] Netronome NFP4000/NFP6000 NIC VF driver David Miller

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=20151130.104226.1974076120162436486.davem@redhat.com \
    --to=davem@redhat.com \
    --cc=jakub.kicinski@netronome.com \
    --cc=netdev@vger.kernel.org \
    --cc=rolf.neugebauer@netronome.com \
    --cc=simon.horman@netronome.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.