Netdev List
 help / color / mirror / Atom feed
From: Jes Sorensen <jsorensen@fb.com>
To: Saeed Mahameed <saeedm@dev.mellanox.co.il>
Cc: Saeed Mahameed <saeedm@mellanox.com>,
	Linux Netdev List <netdev@vger.kernel.org>,
	Kernel Team <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: Tue, 13 Jun 2017 14:18:03 -0400	[thread overview]
Message-ID: <08f01bc7-6899-0587-c49c-209895e99424@fb.com> (raw)
In-Reply-To: <CALzJLG-QeLp95diOuH+CFjX3rzChS4cne0ZKmHZg+1ZHFgCh1w@mail.gmail.com>

On 06/13/2017 01:49 PM, Saeed Mahameed wrote:
> On Mon, Jun 12, 2017 at 8:52 PM, Jes Sorensen <jsorensen@fb.com> wrote:
>> 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?.
>>
> 
> we do modify ix:
>     *ix = find_first_zero_bit(l2table->bitmap, l2table->size);
> 
> The idea is to find the next free index and return it to the caller

I clearly need new glasses :(

Jes

  reply	other threads:[~2017-06-13 18:18 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
2017-06-13 17:49     ` Saeed Mahameed
2017-06-13 18:18       ` Jes Sorensen [this message]
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=08f01bc7-6899-0587-c49c-209895e99424@fb.com \
    --to=jsorensen@fb.com \
    --cc=kernel-team@fb.com \
    --cc=netdev@vger.kernel.org \
    --cc=ogerlitz@mellanox.com \
    --cc=saeedm@dev.mellanox.co.il \
    --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