All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Or Gerlitz <ogerlitz@mellanox.com>, davem@davemloft.net
Cc: netdev@vger.kernel.org, roland@kernel.org,
	jackm@dev.mellanox.co.il, amirv@mellanox.com
Subject: Re: [PATCH V1 net-next 2/7] mlx4_core: For RoCE, allow slaves to set the GID entry at that slave's index
Date: Tue, 11 Mar 2014 22:12:04 +0300	[thread overview]
Message-ID: <531F6004.4070208@cogentembedded.com> (raw)
In-Reply-To: <1394542976-20095-3-git-send-email-ogerlitz@mellanox.com>

Hello.

On 03/11/2014 04:02 PM, Or Gerlitz wrote:

> From: Jack Morgenstein <jackm@dev.mellanox.co.il>

> For IB transport, the host determines the slave GIDs. For ETH (RoCE),
> however, the slave's GID is determined by the IP address that the slave
> itself assigns to the ETH device used by RoCE.

> In this case, the slave must be able to write its GIDs to the HCA gid table
> (at the GID indices that slave "owns").

> This commit adds processing for the SET_PORT_GID_TABLE opcode modifier
> for the SET_PORT command wrapper (so that slaves may modify their GIDS
> for RoCE).

> Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
> Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
> ---
>   drivers/net/ethernet/mellanox/mlx4/port.c |   27 ++++++++++++++++++++++++++-
>   1 files changed, 26 insertions(+), 1 deletions(-)

> diff --git a/drivers/net/ethernet/mellanox/mlx4/port.c b/drivers/net/ethernet/mellanox/mlx4/port.c
> index 9c063d6..095f74d 100644
> --- a/drivers/net/ethernet/mellanox/mlx4/port.c
> +++ b/drivers/net/ethernet/mellanox/mlx4/port.c
[...]
> @@ -581,6 +584,28 @@ static int mlx4_common_set_port(struct mlx4_dev *dev, int slave, u32 in_mod,
>
>   			gen_context->mtu = cpu_to_be16(master->max_mtu[port]);
>   			break;
> +		case MLX4_SET_PORT_GID_TABLE:
> +			gid_entry = (struct mlx4_roce_gid_entry *)(inbox->buf);
> +			/* check that do not have duplicates */
> +			if (memcmp(gid_entry->raw, zgid_entry.raw, 16)) {
> +				for (i = 0; i < MLX4_ROCE_MAX_GIDS; i++) {
> +					if (slave != i &&
> +					    !memcmp(gid_entry->raw, priv->roce_gids[port - 1][i].raw, 16)) {

    This line is over 80 columns, as checkpatch.pl would have told.

> +						mlx4_warn(dev, "requested gid entry for slave:%d "
> +							  "is a duplicate of slave %d\n",

     checkpatch.pl would have warned not to break up the string literal here 
-- it's an exception from the 80-column rule.

> +							  slave, i);
> +						return -EEXIST;
> +					}
> +				}
> +			}
> +			/* insert slave GID at proper index */
> +			memcpy(priv->roce_gids[port - 1][slave].raw, gid_entry->raw, 16);

    This line is over 80 columns.

> +			/* rewrite roce port gids table to FW */
> +			for (i = 0; i < MLX4_ROCE_MAX_GIDS; i++) {
> +				memcpy(gid_entry->raw, priv->roce_gids[port - 1][i].raw, 16);

    This one too.

> +				gid_entry++;
> +			}
> +			break;

WBR, Sergei

  reply	other threads:[~2014-03-11 18:12 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-11 13:02 [PATCH V1 net-next 0/7] mlx4: Add SRIOV support for RoCE Or Gerlitz
2014-03-11 13:02 ` [PATCH V1 net-next 1/7] mlx4: Adjust QP1 multiplexing for RoCE/SRIOV Or Gerlitz
2014-03-11 13:02 ` [PATCH V1 net-next 2/7] mlx4_core: For RoCE, allow slaves to set the GID entry at that slave's index Or Gerlitz
2014-03-11 19:12   ` Sergei Shtylyov [this message]
2014-03-11 20:12     ` Or Gerlitz
2014-03-11 13:02 ` [PATCH V1 net-next 3/7] mlx4: In RoCE allow guests to have multiple GIDS Or Gerlitz
2014-03-12  5:00   ` David Miller
2014-03-12  8:49     ` Or Gerlitz
2014-03-11 13:02 ` [PATCH V1 net-next 4/7] mlx4: Add ref counting to port MAC table for RoCE Or Gerlitz
2014-03-11 13:02 ` [PATCH V1 net-next 5/7] mlx4: Implement IP based gids support for RoCE/SRIOV Or Gerlitz
2014-03-11 13:02 ` [PATCH V1 net-next 6/7] mlx4_ib: Fix SIDR support of for UD QPs under SRIOV/RoCE Or Gerlitz
2014-03-11 13:02 ` [PATCH V1 net-next 7/7] mlx4: Activate RoCE/SRIOV Or Gerlitz

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=531F6004.4070208@cogentembedded.com \
    --to=sergei.shtylyov@cogentembedded.com \
    --cc=amirv@mellanox.com \
    --cc=davem@davemloft.net \
    --cc=jackm@dev.mellanox.co.il \
    --cc=netdev@vger.kernel.org \
    --cc=ogerlitz@mellanox.com \
    --cc=roland@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 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.