All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <horms@verge.net.au>
To: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Cc: netdev@vger.kernel.org, gospo@redhat.com,
	Greg Rose <gregory.v.rose@intel.com>,
	Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Subject: Re: [RFC PATCH 01/12] ixgbe: Mailbox header and code module
Date: Thu, 10 Dec 2009 11:50:18 +1100	[thread overview]
Message-ID: <20091210005018.GH4163@verge.net.au> (raw)
In-Reply-To: <20091208221258.28373.16663.stgit@localhost.localdomain>

On Tue, Dec 08, 2009 at 02:13:12PM -0800, Jeff Kirsher wrote:
> From: Greg Rose <gregory.v.rose@intel.com>
> 
> The 82599 virtual function device and the master 82599 physical function
> device implement a mailbox utility for communication between the devices
> using some SRAM scratch memory and a doorbell/answering mechanism enabled
> via interrupt and/or polling.  This C module and accompanying header
> file implement the base functions for use of this feature.
> 
> Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
> Acked-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> ---
> 
>  drivers/net/ixgbe/ixgbe_mbx.c |  480 +++++++++++++++++++++++++++++++++++++++++
>  drivers/net/ixgbe/ixgbe_mbx.h |   96 ++++++++
>  2 files changed, 576 insertions(+), 0 deletions(-)
>  create mode 100644 drivers/net/ixgbe/ixgbe_mbx.c
>  create mode 100644 drivers/net/ixgbe/ixgbe_mbx.h
> 
> diff --git a/drivers/net/ixgbe/ixgbe_mbx.c b/drivers/net/ixgbe/ixgbe_mbx.c
> new file mode 100644
> index 0000000..5cd5ae8
> --- /dev/null
> +++ b/drivers/net/ixgbe/ixgbe_mbx.c

[snip]

> +/**
> + *  ixgbe_init_mbx_params_pf - set initial values for pf mailbox
> + *  @hw: pointer to the HW structure
> + *
> + *  Initializes the hw->mbx struct to correct values for pf mailbox
> + */
> +s32 ixgbe_init_mbx_params_pf(struct ixgbe_hw *hw)
> +{
> +	struct ixgbe_mbx_info *mbx = &hw->mbx;
> +
> +	if (hw->mac.type == ixgbe_mac_82599EB) {
> +		mbx->timeout = 0;
> +		mbx->usec_delay = 0;
> +
> +		mbx->size = IXGBE_VFMAILBOX_SIZE;
> +
> +		mbx->stats.msgs_tx = 0;
> +		mbx->stats.msgs_rx = 0;
> +		mbx->stats.reqs = 0;
> +		mbx->stats.acks = 0;
> +		mbx->stats.rsts = 0;
> +	}
> +
> +	return 0;
> +}

Does ixgbe_init_mbx_params_pf() need a return value?
The only caller seems to ignore it.

Also, I prefer the following idiom, but in this case
it doesn't seem to offer any advantage:

void ixgbe_init_mbx_params_pf(struct ixgbe_hw *hw)
{
	struct ixgbe_mbx_info *mbx = &hw->mbx;

	if (hw->mac.type != ixgbe_mac_82599EB)
		return;

	mbx->timeout = 0;
	mbx->usec_delay = 0;

	mbx->size = IXGBE_VFMAILBOX_SIZE;

	mbx->stats.msgs_tx = 0;
	mbx->stats.msgs_rx = 0;
	mbx->stats.reqs = 0;
	mbx->stats.acks = 0;
	mbx->stats.rsts = 0;
}

  parent reply	other threads:[~2009-12-10  0:50 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-08 22:13 [RFC PATCH 01/12] ixgbe: Mailbox header and code module Jeff Kirsher
2009-12-08 22:13 ` [RFC PATCH 02/12] ixgbe: Add SR-IOV specific features Jeff Kirsher
2009-12-08 22:13 ` [RFC PATCH 03/12] ixgbe: Add SR-IOV register, structure and bit defines Jeff Kirsher
2009-12-10  0:06   ` Simon Horman
2009-12-08 22:14 ` [RFC PATCH 04/12] ixgbe: Add SR-IOV feature enablement code Jeff Kirsher
2009-12-08 22:14 ` [RFC PATCH 05/12] ixgbe: Add SR-IOV features to main module Jeff Kirsher
2009-12-10  0:45   ` Simon Horman
2009-12-10  0:49     ` Rose, Gregory V
2009-12-10  1:04       ` Simon Horman
2009-12-08 22:14 ` [RFC PATCH 06/12] ixgbe: Add SR-IOV specific modules to driver Makefile Jeff Kirsher
2009-12-10  0:17   ` Simon Horman
2009-12-08 22:15 ` [RFC PATCH 07/12] ixgbevf: Macros, data structures, useful defines and registers Jeff Kirsher
2009-12-08 22:15 ` [RFC PATCH 08/12] ixgbevf: 82599 Virtual Function core functions and header Jeff Kirsher
2009-12-08 22:15 ` [RFC PATCH 09/12] ixgbevf: Mailbox communication Jeff Kirsher
2009-12-08 22:16 ` [RFC PATCH 10/12] ixgbevf: Driver main and ethool interface module and main header Jeff Kirsher
2009-12-09 17:57   ` Ben Hutchings
2009-12-09 18:02     ` Rose, Gregory V
2009-12-08 22:16 ` [RFC PATCH 11/12] ixgbevf: Driver Makefile Jeff Kirsher
2009-12-08 22:16 ` [RFC PATCH 12/12] ixgbevf: Kconfig, Makefile and Documentation Jeff Kirsher
2009-12-08 22:41   ` Randy Dunlap
2009-12-08 22:49     ` Rose, Gregory V
2009-12-10  0:59       ` Simon Horman
2009-12-10  1:04         ` Rose, Gregory V
2009-12-10  0:50 ` Simon Horman [this message]
2009-12-10  0:53   ` [RFC PATCH 01/12] ixgbe: Mailbox header and code module Rose, Gregory V

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=20091210005018.GH4163@verge.net.au \
    --to=horms@verge.net.au \
    --cc=gospo@redhat.com \
    --cc=gregory.v.rose@intel.com \
    --cc=jeffrey.t.kirsher@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=peter.p.waskiewicz.jr@intel.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.