From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Moti Haimovsky <motih@mellanox.com>, shahafs@mellanox.com
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH v5 4/4] net/mlx5: support e-switch flow count action
Date: Mon, 22 Oct 2018 10:14:58 +0100 [thread overview]
Message-ID: <70ed889a-4556-2441-4869-959c819316e5@intel.com> (raw)
In-Reply-To: <1539887363-27858-5-git-send-email-motih@mellanox.com>
On 10/18/2018 7:29 PM, Moti Haimovsky wrote:
> +/**
> + * Parse flower action section in the message retrieving the requested
> + * attribute from the first action that provides it.
> + *
> + * @param opt
> + * flower section in the Netlink message received.
> + * @param rta_type
> + * The backward sequence of rta_types, as written in the attribute table,
> + * we need to traverse in order to get to the requested object.
> + * @param idx
> + * Current location in rta_type table.
> + * @param[out] data
> + * data retrieved from the message query.
> + *
> + * @return
> + * 0 if data was found and retrieved, -1 otherwise.
> + */
> +static int
> +flow_tcf_nl_action_parse_and_get(const struct rtattr *arg,
> + uint16_t rta_type[], int idx, void *data)
> +{
> + struct rtattr *tb[TCA_ACT_MAX_PRIO + 1];
> + int i;
> +
> + if (arg == NULL || idx < 0)
> + return -1;
> + flow_tcf_nl_parse_rtattr(tb, TCA_ACT_MAX_PRIO,
> + RTA_DATA(arg), RTA_PAYLOAD(arg));
> + switch (rta_type[idx]) {
> + /*
> + * flow counters are stored in the actions defined by the flow
> + * and not in the flow itself, therefore we need to traverse the
> + * flower chain of actions in search for them.
> + *
> + * Note that the index is not decremented here.
> + */
> + case TCA_ACT_STATS:
> + for (i = 0; i <= TCA_ACT_MAX_PRIO; i++) {
> + if (tb[i] &&
> + !flow_tcf_nl_parse_one_action_and_get(tb[i],
> + rta_type,
> + idx, data))
> + return 0;
> + }
> + break;
> + default:
> + break;
> + }
> + return -1;
> +}
Getting following build error with clang, will not pull from mlx tree until
issue resolved, thanks.
.../drivers/net/mlx5/mlx5_flow_tcf.c:2507:6: warning: cast from 'const struct
rtattr *' to 'char *' drops const qualifier [-Wcast-qual]
RTA_DATA(arg), RTA_PAYLOAD(arg));
^
/usr/include/linux/rtnetlink.h:183:42: note: expanded from macro 'RTA_DATA'
#define RTA_DATA(rta) ((void*)(((char*)(rta)) + RTA_LENGTH(0)))
^
.../drivers/net/mlx5/mlx5_flow_tcf.c:2593:31: warning: cast from 'const struct
nlmsghdr *' to 'char *' drops const qualifier [-Wcast-qual]
struct tcmsg *t = NLMSG_DATA(nlh);
next prev parent reply other threads:[~2018-10-22 9:15 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-11 13:04 [dpdk-dev] [PATCH v2 0/2] " Mordechay Haimovsky
2018-10-11 13:04 ` [dpdk-dev] [PATCH v2 1/2] net/mlx5: refactor TC-flow infrastructure Mordechay Haimovsky
2018-10-14 11:07 ` Shahaf Shuler
2018-10-11 13:04 ` [dpdk-dev] [PATCH v2 2/2] net/mlx5: support e-switch flow count action Mordechay Haimovsky
2018-10-14 11:07 ` Shahaf Shuler
2018-10-16 23:50 ` [dpdk-dev] [PATCH v3 0/2] " Mordechay Haimovsky
2018-10-16 23:50 ` [dpdk-dev] [PATCH v3 1/2] net/mlx5: refactor TC-flow infrastructure Mordechay Haimovsky
2018-10-16 23:50 ` [dpdk-dev] [PATCH v3 2/2] net/mlx5: support e-switch flow count action Mordechay Haimovsky
2018-10-17 17:24 ` [dpdk-dev] [PATCH v4 0/3] " Moti Haimovsky
2018-10-17 17:24 ` [dpdk-dev] [PATCH v4 1/3] net/mlx5: refactor TC-flow infrastructure Moti Haimovsky
2018-10-17 17:24 ` [dpdk-dev] [PATCH v4 2/3] net/mlx5: add flow query abstraction interface Moti Haimovsky
2018-10-17 17:24 ` [dpdk-dev] [PATCH v4 3/3] net/mlx5: support e-switch flow count action Moti Haimovsky
2018-10-18 18:29 ` [dpdk-dev] [PATCH v5 0/4] " Moti Haimovsky
2018-10-21 8:23 ` Shahaf Shuler
2018-10-18 18:29 ` [dpdk-dev] [PATCH v5 1/4] net/mlx5: refactor TC-flow infrastructure Moti Haimovsky
2018-10-18 18:29 ` [dpdk-dev] [PATCH v5 2/4] net/mlx5: tc flow to use the new infrastructure Moti Haimovsky
2018-10-18 18:29 ` [dpdk-dev] [PATCH v5 3/4] net/mlx5: add flow query abstraction interface Moti Haimovsky
2018-10-18 18:29 ` [dpdk-dev] [PATCH v5 4/4] net/mlx5: support e-switch flow count action Moti Haimovsky
2018-10-22 9:14 ` Ferruh Yigit [this message]
2018-10-22 20:10 ` Shahaf Shuler
2018-10-23 8:40 ` Ferruh Yigit
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=70ed889a-4556-2441-4869-959c819316e5@intel.com \
--to=ferruh.yigit@intel.com \
--cc=dev@dpdk.org \
--cc=motih@mellanox.com \
--cc=shahafs@mellanox.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).