All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arkadi Sharshevsky <arkadis@mellanox.com>
To: David Ahern <dsahern@gmail.com>, Jiri Pirko <jiri@resnulli.us>,
	netdev@vger.kernel.org
Cc: davem@davemloft.net, idosch@mellanox.com, mlxsw@mellanox.com
Subject: Re: [patch net-next 11/12] mlxsw: spectrum_dpipe: Add support for IPv4 host table dump
Date: Sun, 27 Aug 2017 11:31:03 +0300	[thread overview]
Message-ID: <ee012822-1080-fb83-bd8a-72053162d359@mellanox.com> (raw)
In-Reply-To: <a4335a01-a98b-573c-9747-b4039188340c@gmail.com>



On 08/25/2017 10:51 PM, David Ahern wrote:
> On 8/25/17 2:26 AM, Arkadi Sharshevsky wrote:
>>
>>
>> On 08/24/2017 10:26 PM, David Ahern wrote:
>>> On 8/23/17 11:40 PM, Jiri Pirko wrote:
>>>> +static int
>>>> +mlxsw_sp_dpipe_table_host_entries_get(struct mlxsw_sp *mlxsw_sp,
>>>> +				      struct devlink_dpipe_entry *entry,
>>>> +				      bool counters_enabled,
>>>> +				      struct devlink_dpipe_dump_ctx *dump_ctx,
>>>> +				      int type)
>>>> +{
>>>> +	int rif_neigh_count = 0;
>>>> +	int rif_neigh_skip = 0;
>>>> +	int neigh_count = 0;
>>>> +	int rif_count;
>>>> +	int i, j;
>>>> +	int err;
>>>> +
>>>> +	rtnl_lock();
>>>
>>> Why does a h/w driver dumping its tables need the rtnl lock?
>>>
>>
>> This table represents the hw IPv4 arp table, and the
>> driver depends on rtnl to be held.
>>
> 
> Meaning mlxsw does not have its own locks protecting data structures --
> e.g., rif adds and deletes, so it is relying on rtnl?
> 
> Also, this dpipe capability seems to be just dumping data structures
> maintained by the driver. ie., you can compare the mlxsw view of
> networking state to IPv4 and IPv6 level tables. Any plans to offer a
> command that reads data from the h/w and passes that back to the user?
> i.e, a command to compare kernel tables to h/w state?
> 

So this infra should provide several things-

1) Reveal the interactions between various hardware tables
2) Counters for this tables
3) Debugabillity

The first two can be achieved right now. Regarding debugabillity, which
is a bit vague, the current assumption is that the drivers internal data
structures are synced with hardware (which is no always true), and maybe
are not synced with the kernel, so this can be achieved right now by
dumping the internal state of the driver. Furthermore, the counters are
dumped from the hardware and give the user additional indication.

I completely agree that the hardware should be dumped in order to
validate the internal data structures are really synced with HW. This
could be usable for observing data corruptions inside the ASIC and
various complex bugs.

In order to address that I though about maybe add a flag called
"validate_hw" so that during the dump the driver<-->hw state could be
validated.

What do you think about it?

Thanks,
Arkadi

  reply	other threads:[~2017-08-27  8:31 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-24  6:39 [patch net-next 00/12] mlxsw: Add IPv4 host dpipe table Jiri Pirko
2017-08-24  6:39 ` [patch net-next 01/12] devlink: Add Ethernet header for dpipe Jiri Pirko
2017-08-24  6:40 ` [patch net-next 02/12] devlink: Add IPv4 " Jiri Pirko
2017-08-24  6:40 ` [patch net-next 03/12] mlxsw: spectrum_dpipe: Fix erif table op name space Jiri Pirko
2017-08-24  6:40 ` [patch net-next 04/12] devlink: Add support for dynamic table size Jiri Pirko
2017-08-24  6:40 ` [patch net-next 05/12] devlink: Move dpipe entry clear function into devlink Jiri Pirko
2017-08-24  6:40 ` [patch net-next 06/12] mlxsw: spectrum_router: Add helpers for neighbor access Jiri Pirko
2017-08-24  6:40 ` [patch net-next 07/12] mlxsw: spectrum_dpipe: Fix label name Jiri Pirko
2017-08-24  6:40 ` [patch net-next 08/12] mlxsw: spectrum_dpipe: Add IPv4 host table initial support Jiri Pirko
2017-08-24  6:40 ` [patch net-next 09/12] mlxsw: reg: Make flow counter set type enum to be shared Jiri Pirko
2017-08-24  6:40 ` [patch net-next 10/12] mlxsw: spectrum_router: Add support for setting counters on neighbors Jiri Pirko
2017-08-24  6:40 ` [patch net-next 11/12] mlxsw: spectrum_dpipe: Add support for IPv4 host table dump Jiri Pirko
2017-08-24 19:26   ` David Ahern
2017-08-25  9:26     ` Arkadi Sharshevsky
2017-08-25 19:51       ` David Ahern
2017-08-27  8:31         ` Arkadi Sharshevsky [this message]
2017-08-29  2:57           ` David Ahern
2017-08-29  7:55             ` Jiri Pirko
2017-08-24  6:40 ` [patch net-next 12/12] mlxsw: spectrum_dpipe: Add support for controlling neighbor counters Jiri Pirko
2017-08-24 19:28   ` David Ahern
2017-08-24 16:33 ` [patch net-next 00/12] mlxsw: Add IPv4 host dpipe table David Miller

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=ee012822-1080-fb83-bd8a-72053162d359@mellanox.com \
    --to=arkadis@mellanox.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@gmail.com \
    --cc=idosch@mellanox.com \
    --cc=jiri@resnulli.us \
    --cc=mlxsw@mellanox.com \
    --cc=netdev@vger.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.