lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e8b4002b415a2174280472b98640dda45d32d11b.camel@mellanox.com>
Date:   Wed, 24 Jul 2019 23:52:37 +0000
From:   Saeed Mahameed <saeedm@...lanox.com>
To:     "snelson@...sando.io" <snelson@...sando.io>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "davem@...emloft.net" <davem@...emloft.net>
Subject: Re: [PATCH v4 net-next 10/19] ionic: Add management of rx filters

On Mon, 2019-07-22 at 14:40 -0700, Shannon Nelson wrote:
> Set up the infrastructure for managing Rx filters.  We can't ask the
> hardware for what filters it has, so we keep a local list of filters
> that we've pushed into the HW.
> 
> Signed-off-by: Shannon Nelson <snelson@...sando.io>
> ---
>  drivers/net/ethernet/pensando/ionic/Makefile  |   4 +-
>  .../net/ethernet/pensando/ionic/ionic_lif.c   |   6 +
>  .../net/ethernet/pensando/ionic/ionic_lif.h   |   2 +
>  .../ethernet/pensando/ionic/ionic_rx_filter.c | 143
> ++++++++++++++++++
>  .../ethernet/pensando/ionic/ionic_rx_filter.h |  35 +++++
>  5 files changed, 188 insertions(+), 2 deletions(-)
>  create mode 100644
> drivers/net/ethernet/pensando/ionic/ionic_rx_filter.c
>  create mode 100644
> drivers/net/ethernet/pensando/ionic/ionic_rx_filter.h
> 
> 

[...]

> +#define RXQ_INDEX_ANY		(0xFFFF)
> +struct rx_filter {
> +	u32 flow_id;
> +	u32 filter_id;
> +	u16 rxq_index;
> +	struct rx_filter_add_cmd cmd;
> +	struct hlist_node by_hash;
> +	struct hlist_node by_id;
> +};
> +
> +#define RX_FILTER_HASH_BITS	10
> +#define RX_FILTER_HLISTS	BIT(RX_FILTER_HASH_BITS)
> +#define RX_FILTER_HLISTS_MASK	(RX_FILTER_HLISTS - 1)
> +struct rx_filters {
> +	spinlock_t lock;				/* filter list lock
> */
> +	struct hlist_head by_hash[RX_FILTER_HLISTS];	/* by skb
> hash */
> +	struct hlist_head by_id[RX_FILTER_HLISTS];	/* by
> filter_id */
> +};
> +
> 

Following Dave's comment on this, you use too generic struct and macro
/define names, i strongly recommend to add a unique prefix to this
driver.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ