From: Jes Sorensen <jsorensen@fb.com>
To: Saeed Mahameed <saeedm@mellanox.com>, <netdev@vger.kernel.org>
Cc: <kernel-team@fb.com>, Or Gerlitz <ogerlitz@mellanox.com>,
Tzahi Oved <tzahio@mellanox.com>
Subject: Re: [PATCH RFC net-next 3/4] net/mlx5: Separate between eswitch and MPFS l2 table logic
Date: Mon, 12 Jun 2017 13:52:54 -0400 [thread overview]
Message-ID: <d205ed47-0275-ade7-1fdc-d82001b1dda5@fb.com> (raw)
In-Reply-To: <20170607234214.24723-4-saeedm@mellanox.com>
On 06/07/2017 07:42 PM, Saeed Mahameed wrote:
> Multi-Physical Function Switch (MPFs) is required for when multi-PF
> configuration is enabled to allow passing user configured unicast MAC
> addresses to the requesting PF.
>
> Before this patch eswitch.c used to manage the HW MPFS l2 table,
> eswitch always enabled vport(0) (NIC PF) vport's contexts update on unicast
> mac address list changes, to populate the PF's MPFS L2 table accordingly,
> even if SRIOV was not enabled.
>
> In downstream patch we would like to allow compiling the driver without
> eswitch functionalities, for that we move MPFS l2 table logic out
> of eswitch.c into its own file, and provide Kconfig flag (MLX5_MPFS) to
> allow compiling out MPFS for those who don't want Multi-PF support
>
> NIC PF netdevice will now directly update MPFS l2 table via the new MPFS
> API. VF netdevice has no access to MPFS L2 table, so e-Switch will remain
> responsible of updating its PF MPFS l2 table on behalf of its VFs.
>
> Due to this change we also don't require enabling vport(0) (PF vport)
> unicast mac changes events anymore, for when SRIOV is not enabled.
> Which means eswitch is now activated only on SRIOV activation, and not
> required otherwise.
On overall it looks good - one nit.
> +static int alloc_l2table_index(struct mlx5_mpfs *l2table, u32 *ix)
> +{
> + int err = 0;
> +
> + *ix = find_first_zero_bit(l2table->bitmap, l2table->size);
> + if (*ix >= l2table->size)
> + err = -ENOSPC;
> + else
> + __set_bit(*ix, l2table->bitmap);
> +
> + return err;
> +}
You pass in a pointer for ix but you don't modify it, why not just pass
in the value?.
> +static void free_l2table_index(struct mlx5_mpfs *l2table, u32 ix)
> +{
> + __clear_bit(ix, l2table->bitmap);
> +}
Here you stick to the u32.
Jes
next prev parent reply other threads:[~2017-06-12 17:53 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-07 23:42 [PATCH RFC net-next 0/4] Mellanox, MLX5 E-Switch break down Saeed Mahameed
2017-06-07 23:42 ` [PATCH RFC net-next 1/4] net/mlx5e: Rearrange netdevice ops structures Saeed Mahameed
2017-06-08 7:52 ` Or Gerlitz
2017-06-07 23:42 ` [PATCH RFC net-next 2/4] net/mlx5e: NIC netdev init flow cleanup Saeed Mahameed
2017-06-08 8:30 ` Or Gerlitz
2017-06-07 23:42 ` [PATCH RFC net-next 3/4] net/mlx5: Separate between eswitch and MPFS l2 table logic Saeed Mahameed
2017-06-08 9:13 ` Or Gerlitz
2017-06-08 10:26 ` Saeed Mahameed
2017-06-08 11:12 ` Or Gerlitz
2017-06-08 9:26 ` Or Gerlitz
2017-06-12 17:52 ` Jes Sorensen [this message]
2017-06-13 17:49 ` Saeed Mahameed
2017-06-13 18:18 ` Jes Sorensen
2017-06-07 23:42 ` [PATCH RFC net-next 4/4] net/mlx5: Add CONFIG_MLX5_ESWITCH Kconfig Saeed Mahameed
2017-06-08 9:35 ` Or Gerlitz
2017-06-08 10:32 ` Saeed Mahameed
2017-06-12 18:20 ` Jes Sorensen
2017-06-13 17:58 ` Saeed Mahameed
2017-06-13 18:21 ` Jes Sorensen
2017-06-13 21:53 ` Saeed Mahameed
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=d205ed47-0275-ade7-1fdc-d82001b1dda5@fb.com \
--to=jsorensen@fb.com \
--cc=kernel-team@fb.com \
--cc=netdev@vger.kernel.org \
--cc=ogerlitz@mellanox.com \
--cc=saeedm@mellanox.com \
--cc=tzahio@mellanox.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox