[dpdk-dev] [PATCH v3 18/24] net/bnxt: add support for flow filter ops
Ferruh Yigit
ferruh.yigit at intel.com
Thu Sep 28 18:05:23 CEST 2017
On 9/28/2017 3:13 PM, Ajit Khaparde wrote:
> This patch adds support for flow validate/create/destroy/flush,
> ethertype add/del ops
>
> Signed-off-by: Ajit Khaparde <ajit.khaparde at broadcom.com>
> --
> v1->v2: incorporate review comments.
> v2->v3: fix 32-bit builds.
<...>
> +static struct rte_flow *
> +bnxt_flow_create(struct rte_eth_dev *dev,
> + const struct rte_flow_attr *attr,
> + const struct rte_flow_item pattern[],
> + const struct rte_flow_action actions[],
> + struct rte_flow_error *error)
> +{
> + struct bnxt *bp = (struct bnxt *)dev->data->dev_private;
> + struct bnxt_filter_info *filter;
> + struct bnxt_vnic_info *vnic;
> + struct rte_flow *flow;
> + unsigned int i;
> + int ret = 0;
> +
> + flow = rte_zmalloc("bnxt_flow", sizeof(struct rte_flow), 0);
> + if (!flow) {
> + rte_flow_error_set(error, ENOMEM,
> + RTE_FLOW_ERROR_TYPE_HANDLE, NULL,
> + "Failed to allocate memory");
> + return flow;
> + }
> +
> + ret = bnxt_flow_agrs_validate(attr, pattern, actions, error);
> + if (ret != 0) {
Hi Ajit,
clang is giving following [1] build error here. Error log is quite
verbose, clang even suggests multiple solutions :)
[1]
.../dpdk/drivers/net/bnxt/bnxt_filter.c:923:6: error: variable 'filter'
is used uninitialized whenever 'if' condition is true
[-Werror,-Wsometimes-uninitialized]
if (ret != 0) {
^~~~~~~~
.../dpdk/drivers/net/bnxt/bnxt_filter.c:965:23: note: uninitialized use
occurs here
bnxt_free_filter(bp, filter);
^~~~~~
.../dpdk/drivers/net/bnxt/bnxt_filter.c:923:2: note: remove the 'if' if
its condition is always false
if (ret != 0) {
^~~~~~~~~~~~~~~
.../dpdk/drivers/net/bnxt/bnxt_filter.c:908:33: note: initialize the
variable 'filter' to silence this warning
struct bnxt_filter_info *filter;
^
= NULL
More information about the dev
mailing list