[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1a3387e7-dbe3-905a-4b7a-ef2cd776cb33@intel.com>
Date: Thu, 19 Jan 2023 15:57:54 -0800
From: Jacob Keller <jacob.e.keller@...el.com>
To: <alejandro.lucero-palau@....com>, <netdev@...r.kernel.org>,
<linux-net-drivers@....com>
CC: <davem@...emloft.net>, <kuba@...nel.org>, <pabeni@...hat.com>,
<edumazet@...gle.com>, <habetsm@...il.com>,
<ecree.xilinx@...il.com>
Subject: Re: [PATCH net-next 3/7] sfc: add mport lookup based on driver's
mport data
On 1/19/2023 3:31 AM, alejandro.lucero-palau@....com wrote:
> +int efx_mae_lookup_mport(struct efx_nic *efx, u32 vf_idx, u32 *id)
> +{
> + struct ef100_nic_data *nic_data = efx->nic_data;
> + struct efx_mae *mae = efx->mae;
> + struct rhashtable_iter walk;
> + struct mae_mport_desc *m;
> + int rc = -ENOENT;
> +
> + rhashtable_walk_enter(&mae->mports_ht, &walk);
> + rhashtable_walk_start(&walk);
> + while ((m = rhashtable_walk_next(&walk)) != NULL) {
> + if (m->mport_type == MAE_MPORT_DESC_MPORT_TYPE_VNIC &&
> + m->interface_idx == nic_data->local_mae_intf &&
> + m->pf_idx == 0 &&
> + m->vf_idx == vf_idx) {
> + *id = m->mport_id;
> + rc = 0;
> + break;
> + }
> + }
> + rhashtable_walk_stop(&walk);
> + rhashtable_walk_exit(&walk);
Curious if you have any reasoning for why you chose rhashtable vs
another structure (such as a simpler hash table of linked lists or xarray).
At any rate,
Reviewed-by: Jacob Keller <jacob.e.keller@...el.com>
Powered by blists - more mailing lists