[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <568CCA2C.1080500@mellanox.com>
Date: Wed, 6 Jan 2016 10:02:52 +0200
From: Or Gerlitz <ogerlitz@...lanox.com>
To: Saeed Mahameed <saeedm@...lanox.com>,
Maor Gottlieb <maorg@...lanox.com>
CC: "David S. Miller" <davem@...emloft.net>, <netdev@...r.kernel.org>,
"Doug Ledford" <dledford@...hat.com>,
Eran Ben Elisha <eranbe@...lanox.com>,
"Tal Alon" <talal@...lanox.com>, Majd Dibbiny <majd@...lanox.com>,
Matan Barak <matanb@...lanox.com>,
Moni Shoua <monis@...lanox.com>, <saeedm@....mellanox.co.il>
Subject: Re: [PATCH net-next 11/12] IB/mlx5: Add flow steering utilities
On 1/5/2016 10:04 PM, Saeed Mahameed wrote:
> +static bool is_valid_attr(struct ib_flow_attr *flow_attr)
> +{
> + union ib_flow_spec *ib_spec = (union ib_flow_spec *)(flow_attr + 1);
> + bool has_ipv4_spec = false;
> + bool eth_type_ipv4 = true;
> + unsigned int spec_index;
> +
> + /* Validate that ehtertype is correct */
typo s/ehtertype/ethertype/ -- better if you grep all comments in the
patches and run them through speller
> + for (spec_index = 0; spec_index < flow_attr->num_of_specs; spec_index++) {
> + if (ib_spec->type == IB_FLOW_SPEC_ETH &&
> + ib_spec->eth.mask.ether_type) {
> + eth_type_ipv4 = ib_spec->eth.mask.ether_type == 0xffff &&
sparse complains here on this
drivers/infiniband/hw/mlx5//main.c:1006:58: warning: restricted __be16
degrades to integer
even if this isn't real bug, make the tool happy, so we'll have the
driver keep being clean from such warns
> + ib_spec->eth.val.ether_type == htons(ETH_P_IP);
> + } else if (ib_spec->type == IB_FLOW_SPEC_IPV4) {
> + has_ipv4_spec = true;
> + }
> + ib_spec = (void *)ib_spec + ib_spec->size;
> + }
> + return !has_ipv4_spec || eth_type_ipv4;
> +}
--
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