linux-hyperv.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Dexuan Cui <decui@microsoft.com>
Cc: davem@davemloft.net, kuba@kernel.org, kys@microsoft.com,
	haiyangz@microsoft.com, sthemmin@microsoft.com,
	wei.liu@kernel.org, liuwe@microsoft.com, netdev@vger.kernel.org,
	leon@kernel.org, andrew@lunn.ch, bernd@petrovitsch.priv.at,
	rdunlap@infradead.org, shacharr@microsoft.com,
	linux-kernel@vger.kernel.org, linux-hyperv@vger.kernel.org
Subject: Re: [PATCH v6 net-next] net: mana: Add a driver for Microsoft Azure Network Adapter (MANA)
Date: Thu, 15 Apr 2021 14:15:25 -0700	[thread overview]
Message-ID: <20210415141525.69c12844@hermes.local> (raw)
In-Reply-To: <20210415054519.12944-1-decui@microsoft.com>

On Wed, 14 Apr 2021 22:45:19 -0700
Dexuan Cui <decui@microsoft.com> wrote:

> +static int mana_probe_port(struct mana_context *ac, int port_idx,
> +			   struct net_device **ndev_storage)
> +{
> +	struct gdma_context *gc = ac->gdma_dev->gdma_context;
> +	struct mana_port_context *apc;
> +	struct net_device *ndev;
> +	int err;
> +
> +	ndev = alloc_etherdev_mq(sizeof(struct mana_port_context),
> +				 gc->max_num_queues);
> +	if (!ndev)
> +		return -ENOMEM;
> +
> +	*ndev_storage = ndev;
> +
> +	apc = netdev_priv(ndev);
> +	apc->ac = ac;
> +	apc->ndev = ndev;
> +	apc->max_queues = gc->max_num_queues;
> +	apc->num_queues = min_t(uint, gc->max_num_queues, MANA_MAX_NUM_QUEUES);
> +	apc->port_handle = INVALID_MANA_HANDLE;
> +	apc->port_idx = port_idx;
> +
> +	ndev->netdev_ops = &mana_devops;
> +	ndev->ethtool_ops = &mana_ethtool_ops;
> +	ndev->mtu = ETH_DATA_LEN;
> +	ndev->max_mtu = ndev->mtu;
> +	ndev->min_mtu = ndev->mtu;
> +	ndev->needed_headroom = MANA_HEADROOM;
> +	SET_NETDEV_DEV(ndev, gc->dev);
> +
> +	netif_carrier_off(ndev);
> +
> +	get_random_bytes(apc->hashkey, MANA_HASH_KEY_SIZE);

Current practice for network drivers is to use netdev_rss_key_fill() for this.

  parent reply	other threads:[~2021-04-15 21:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20210415054519.12944-1-decui@microsoft.com>
2021-04-15 17:44 ` [PATCH v6 net-next] net: mana: Add a driver for Microsoft Azure Network Adapter (MANA) Jakub Kicinski
2021-04-15 18:14   ` Dexuan Cui
2021-04-15 21:07 ` Stephen Hemminger
2021-04-15 21:08   ` Haiyang Zhang
2021-04-15 21:15 ` Stephen Hemminger [this message]
2021-04-15 21:27   ` Dexuan Cui

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=20210415141525.69c12844@hermes.local \
    --to=stephen@networkplumber.org \
    --cc=andrew@lunn.ch \
    --cc=bernd@petrovitsch.priv.at \
    --cc=davem@davemloft.net \
    --cc=decui@microsoft.com \
    --cc=haiyangz@microsoft.com \
    --cc=kuba@kernel.org \
    --cc=kys@microsoft.com \
    --cc=leon@kernel.org \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liuwe@microsoft.com \
    --cc=netdev@vger.kernel.org \
    --cc=rdunlap@infradead.org \
    --cc=shacharr@microsoft.com \
    --cc=sthemmin@microsoft.com \
    --cc=wei.liu@kernel.org \
    /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).