All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <jakub.kicinski@netronome.com>
To: Shannon Nelson <snelson@pensando.io>
Cc: netdev@vger.kernel.org, davem@davemloft.net
Subject: Re: [PATCH v6 net-next 02/19] ionic: Add basic framework for IONIC Network device driver
Date: Thu, 29 Aug 2019 15:38:25 -0700	[thread overview]
Message-ID: <20190829153825.396efbf5@cakuba.netronome.com> (raw)
In-Reply-To: <20190829182720.68419-3-snelson@pensando.io>

On Thu, 29 Aug 2019 11:27:03 -0700, Shannon Nelson wrote:
> This patch adds a basic driver framework for the Pensando IONIC
> network device.  There is no functionality right now other than
> the ability to load and unload.
> 
> Signed-off-by: Shannon Nelson <snelson@pensando.io>

> diff --git a/drivers/net/ethernet/pensando/ionic/ionic_devlink.c b/drivers/net/ethernet/pensando/ionic/ionic_devlink.c
> new file mode 100644
> index 000000000000..6892409cd64b
> --- /dev/null
> +++ b/drivers/net/ethernet/pensando/ionic/ionic_devlink.c
> @@ -0,0 +1,44 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/* Copyright(c) 2017 - 2019 Pensando Systems, Inc */
> +
> +#include <linux/module.h>
> +#include <linux/netdevice.h>
> +
> +#include "ionic.h"
> +#include "ionic_bus.h"
> +#include "ionic_devlink.h"
> +
> +static int ionic_dl_info_get(struct devlink *dl, struct devlink_info_req *req,
> +			     struct netlink_ext_ack *extack)
> +{
> +	devlink_info_driver_name_put(req, IONIC_DRV_NAME);

This may fail, should the error not be propagated?

> +	return 0;
> +}
> +
> +static const struct devlink_ops ionic_dl_ops = {
> +	.info_get	= ionic_dl_info_get,
> +};
> +
> +struct ionic *ionic_devlink_alloc(struct device *dev)
> +{
> +	struct ionic *ionic;
> +	struct devlink *dl;
> +
> +	dl = devlink_alloc(&ionic_dl_ops, sizeof(struct ionic));
> +	if (!dl) {
> +		dev_warn(dev, "devlink_alloc failed");

missing new line at the end of warning, but the warning is unnecessary,
if memory allocation fails kernel will generate a big OOM splat, anyway

> +		return NULL;
> +	}
> +
> +	ionic = devlink_priv(dl);
> +
> +	return ionic;

return devlink_priv(dl);

> +}
> +
> +void ionic_devlink_free(struct ionic *ionic)
> +{
> +	struct devlink *dl = priv_to_devlink(ionic);
> +
> +	devlink_free(dl);
> +}

  reply	other threads:[~2019-08-29 22:38 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-29 18:27 [PATCH v6 net-next 00/19] ionic: Add ionic driver Shannon Nelson
2019-08-29 18:27 ` [PATCH v6 net-next 01/19] devlink: Add new info version tags for ASIC and FW Shannon Nelson
2019-08-29 22:33   ` Jakub Kicinski
2019-08-29 18:27 ` [PATCH v6 net-next 02/19] ionic: Add basic framework for IONIC Network device driver Shannon Nelson
2019-08-29 22:38   ` Jakub Kicinski [this message]
2019-08-30 19:02     ` Shannon Nelson
2019-08-29 18:27 ` [PATCH v6 net-next 03/19] ionic: Add hardware init and device commands Shannon Nelson
2019-08-29 18:27 ` [PATCH v6 net-next 04/19] ionic: Add port management commands Shannon Nelson
2019-08-29 22:46   ` Jakub Kicinski
2019-08-30 19:18     ` Shannon Nelson
2019-08-29 18:27 ` [PATCH v6 net-next 05/19] ionic: Add basic lif support Shannon Nelson
2019-08-29 18:27 ` [PATCH v6 net-next 06/19] ionic: Add interrupts and doorbells Shannon Nelson
2019-08-29 18:27 ` [PATCH v6 net-next 07/19] ionic: Add basic adminq support Shannon Nelson
2019-08-29 22:52   ` Jakub Kicinski
2019-08-30 19:31     ` Shannon Nelson
2019-08-30 22:16       ` Jakub Kicinski
2019-08-30 22:17         ` David Miller
2019-08-30 23:18           ` Shannon Nelson
2019-08-29 18:27 ` [PATCH v6 net-next 08/19] ionic: Add adminq action Shannon Nelson
2019-08-29 18:27 ` [PATCH v6 net-next 09/19] ionic: Add notifyq support Shannon Nelson
2019-08-29 18:27 ` [PATCH v6 net-next 10/19] ionic: Add the basic NDO callbacks for netdev support Shannon Nelson
2019-08-29 18:27 ` [PATCH v6 net-next 11/19] ionic: Add management of rx filters Shannon Nelson
2019-08-29 18:27 ` [PATCH v6 net-next 12/19] ionic: Add Rx filter and rx_mode ndo support Shannon Nelson
2019-08-29 23:06   ` Jakub Kicinski
2019-08-30 19:35     ` Shannon Nelson
2019-08-29 18:27 ` [PATCH v6 net-next 13/19] ionic: Add async link status check and basic stats Shannon Nelson
2019-08-29 18:27 ` [PATCH v6 net-next 14/19] ionic: Add initial ethtool support Shannon Nelson
2019-08-29 23:10   ` Jakub Kicinski
2019-08-30 21:25     ` Shannon Nelson
2019-08-30 22:16       ` Jakub Kicinski
2019-09-01 19:52         ` Andrew Lunn
2019-08-29 18:27 ` [PATCH v6 net-next 15/19] ionic: Add Tx and Rx handling Shannon Nelson
2019-08-29 23:18   ` Jakub Kicinski
2019-08-30 23:57     ` Shannon Nelson
2019-08-29 23:33   ` Jakub Kicinski
2019-08-30 21:44     ` Shannon Nelson
2019-08-30 22:21       ` Jakub Kicinski
2019-08-29 18:27 ` [PATCH v6 net-next 16/19] ionic: Add netdev-event handling Shannon Nelson
2019-08-29 23:37   ` Jakub Kicinski
2019-08-30 21:36     ` Shannon Nelson
2019-08-30 22:24       ` Jakub Kicinski
2019-08-29 18:27 ` [PATCH v6 net-next 17/19] ionic: Add driver stats Shannon Nelson
2019-08-29 18:27 ` [PATCH v6 net-next 18/19] ionic: Add RSS support Shannon Nelson
2019-08-29 18:27 ` [PATCH v6 net-next 19/19] ionic: Add coalesce and other features 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=20190829153825.396efbf5@cakuba.netronome.com \
    --to=jakub.kicinski@netronome.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=snelson@pensando.io \
    /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.