[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAE4R7bBGgXvYbaXFrQHnA=YX3KZHXi5T4aH=-UH81RUqUm4+vQ@mail.gmail.com>
Date: Sat, 25 Jul 2015 22:15:04 -0700
From: Scott Feldman <sfeldma@...il.com>
To: Jiri Pirko <jiri@...nulli.us>
Cc: Netdev <netdev@...r.kernel.org>,
"David S. Miller" <davem@...emloft.net>, idosch@...lanox.com,
eladr@...lanox.com,
"ogerlitz@...lanox.com" <ogerlitz@...lanox.com>,
Roopa Prabhu <roopa@...ulusnetworks.com>,
Florian Fainelli <f.fainelli@...il.com>,
Thomas Graf <tgraf@...g.ch>,
Alexei Starovoitov <ast@...mgrid.com>,
Jamal Hadi Salim <jhs@...atatu.com>,
Daniel Borkmann <daniel@...earbox.net>,
john fastabend <john.fastabend@...il.com>,
"simon.horman@...ronome.com" <simon.horman@...ronome.com>,
John Linville <linville@...driver.com>,
Andy Gospodarek <andy@...yhouse.net>,
Shrijeet Mukherjee <shm@...ulusnetworks.com>,
"nhorman@...driver.com" <nhorman@...driver.com>,
Jiri Pirko <jiri@...lanox.com>
Subject: Re: [patch net-next 2/4] mlxsw: Add PCI bus implementation
On Thu, Jul 23, 2015 at 8:43 AM, Jiri Pirko <jiri@...nulli.us> wrote:
> From: Jiri Pirko <jiri@...lanox.com>
>
> Add PCI bus implementation for Mellanox Technologies Switch ASICs. This
> includes firmware initialization, async queues manipulation and command
> interface implementation.
>
> Signed-off-by: Jiri Pirko <jiri@...lanox.com>
> Signed-off-by: Ido Schimmel <idosch@...lanox.com>
> Signed-off-by: Elad Raz <eladr@...lanox.com>
> ---
[cut]
> +static int mlxsw_pci_fw_area_init(struct mlxsw_pci *mlxsw_pci, char *mbox,
> + u16 num_pages)
> +{
> + struct mlxsw_pci_mem_item *mem_item;
> + int i;
> + int err;
Need to init err to zero here
> +
> + mlxsw_pci->fw_area.items = kcalloc(num_pages, sizeof(*mem_item),
> + GFP_KERNEL);
> + if (!mlxsw_pci->fw_area.items)
> + return -ENOMEM;
> + mlxsw_pci->fw_area.num_pages = num_pages;
> +
> + mlxsw_cmd_mbox_zero(mbox);
> + for (i = 0; i < num_pages; i++) {
> + mem_item = &mlxsw_pci->fw_area.items[i];
> +
> + mem_item->size = MLXSW_PCI_PAGE_SIZE;
> + mem_item->buf = pci_alloc_consistent(mlxsw_pci->pdev,
> + mem_item->size,
> + &mem_item->mapaddr);
> + if (!mem_item->buf)
> + goto err_alloc;
> + mlxsw_cmd_mbox_map_fa_pa_set(mbox, i, mem_item->mapaddr);
> + mlxsw_cmd_mbox_map_fa_log2size_set(mbox, i, 0); /* 1 page */
> + }
> +
> + err = mlxsw_cmd_map_fa(mlxsw_pci->core, mbox, num_pages);
> + if (err)
> + goto err_cmd_map_fa;
> +
> + return 0;
> +
> +err_cmd_map_fa:
> +err_alloc:
> + for (i--; i >= 0; i--) {
> + mem_item = &mlxsw_pci->fw_area.items[i];
> +
> + pci_free_consistent(mlxsw_pci->pdev, mem_item->size,
> + mem_item->buf, mem_item->mapaddr);
> + }
> + kfree(mlxsw_pci->fw_area.items);
> + return err;
> +}
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists