From: Pascal Mazon <pascal.mazon@6wind.com>
To: "Wiles, Keith" <keith.wiles@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH 4/4] net/tap: add basic flow API patterns and actions
Date: Mon, 6 Mar 2017 15:22:29 +0100 [thread overview]
Message-ID: <20170306152229.3f422e21@paques.dev.6wind.com> (raw)
In-Reply-To: <DE3A7F21-7BE0-4FE5-BB67-7CE6861C37C0@intel.com>
On Fri, 3 Mar 2017 15:47:58 +0000
"Wiles, Keith" <keith.wiles@intel.com> wrote:
>
> > On Mar 3, 2017, at 4:45 AM, Pascal Mazon <pascal.mazon@6wind.com>
> > wrote:
> >
> > Supported flow rules are now mapped to TC rules on the tap
> > netdevice. The netlink message used for creating the TC rule is
> > stored in struct rte_flow. That way, by simply changing a metadata
> > in it, we can require for the rule deletion without further parsing.
> >
> > Supported items:
> > - eth: src and dst (with variable masks), and eth_type (0xffff
> > mask).
> > - vlan: vid, pcp, tpid, but not eid.
> > - ipv4/6: src and dst (with variable masks), and ip_proto (0xffff
> > mask).
> > - udp/tcp: src and dst port (0xffff) mask.
> >
> > Supported actions:
> > - DROP
> > - QUEUE
> > - PASSTHRU
> >
> > It is generally not possible to provide a "last" item. However, if
> > the "last" item, once masked, is identical to the masked spec, then
> > it is supported.
> >
> > Only IPv4/6 and MAC addresses can use a variable mask. All other
> > items need a full mask (exact match).
> >
> > Support for VLAN requires kernel headers >= 4.9, checked using
> > auto-config.sh.
> >
> > Signed-off-by: Pascal Mazon <pascal.mazon@6wind.com>
> > Acked-by: Olga Shern <olgas@mellanox.com>
> > —
>
> …
>
> > /**
> > @@ -120,13 +965,33 @@ tap_flow_create(struct rte_eth_dev *dev,
> > * @see rte_flow_ops
> > */
> > static int
> > -tap_flow_destroy(struct rte_eth_dev *dev __rte_unused,
> > +tap_flow_destroy(struct rte_eth_dev *dev,
> > struct rte_flow *flow,
> > - struct rte_flow_error *error __rte_unused)
> > + struct rte_flow_error *error)
> > {
> > + struct pmd_internals *pmd = dev->data->dev_private;
> > + int ret = 0;
> > +
> > LIST_REMOVE(flow, next);
> > + flow->msg.nh.nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK;
> > + flow->msg.nh.nlmsg_type = RTM_DELTFILTER;
> > +
> > + ret = nl_send(pmd->nlsk_fd, &flow->msg.nh);
> > + if (ret < 0) {
> > + rte_flow_error_set(error, ENOTSUP,
> > RTE_FLOW_ERROR_TYPE_HANDLE,
> > + NULL, "couldn't send request to
> > kernel");
> > + goto end;
> > + }
> > + ret = nl_recv_ack(pmd->nlsk_fd);
> > + if (ret < 0) {
> > + rte_flow_error_set(error, ENOTSUP,
> > RTE_FLOW_ERROR_TYPE_HANDLE,
> > + NULL,
> > + "couldn't receive kernel ack to
> > our request");
> > + goto end;
>
> This goto is not required.
>
Indeed!
I'll fix that in v2.
Regards,
Pascal
> > + }
> > +end:
> > rte_free(flow);
> > - return 0;
> > + return ret;
> > }
> >
> > /**
> > diff --git a/drivers/net/tap/tap_flow.h b/drivers/net/tap/tap_flow.h
> > index 377a9f7b758a..a05e945df523 100644
> > --- a/drivers/net/tap/tap_flow.h
> > +++ b/drivers/net/tap/tap_flow.h
> > @@ -37,6 +37,18 @@
> > #include <rte_flow.h>
> > #include <rte_flow_driver.h>
> >
> > +/**
> > + * In TC, priority 0 means we require the kernel to allocate one
> > for us.
> > + * In rte_flow, however, we want the priority 0 to be the most
> > important one.
> > + * Use an offset to have the most important priority being 1 in TC.
> > + */
> > +#define PRIORITY_OFFSET 1
> > +#define PRIORITY_MASK (0xfff)
> > +#define MAX_PRIORITY (PRIORITY_MASK - PRIORITY_OFFSET)
> > +#define GROUP_MASK (0xf)
> > +#define GROUP_SHIFT 12
> > +#define MAX_GROUP GROUP_MASK
> > +
> > int tap_dev_filter_ctrl(struct rte_eth_dev *dev,
> > enum rte_filter_type filter_type,
> > enum rte_filter_op filter_op,
> > --
> > 2.8.0.rc0
> >
>
> Regards,
> Keith
>
next prev parent reply other threads:[~2017-03-06 14:22 UTC|newest]
Thread overview: 57+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-03 10:45 [dpdk-dev] [PATCH 0/4] net/tap: support flow API Pascal Mazon
2017-03-03 10:45 ` [dpdk-dev] [PATCH 1/4] net/tap: move private elements to external header Pascal Mazon
2017-03-03 15:38 ` Wiles, Keith
2017-03-06 14:18 ` Pascal Mazon
2017-03-06 14:51 ` Wiles, Keith
2017-03-03 10:45 ` [dpdk-dev] [PATCH 2/4] net/tap: add preliminary support for rte_flow Pascal Mazon
2017-03-03 10:45 ` [dpdk-dev] [PATCH 3/4] net/tap: add netlink back-end for flow API Pascal Mazon
2017-03-03 10:45 ` [dpdk-dev] [PATCH 4/4] net/tap: add basic flow API patterns and actions Pascal Mazon
2017-03-03 15:47 ` Wiles, Keith
2017-03-06 14:22 ` Pascal Mazon [this message]
2017-03-03 15:54 ` [dpdk-dev] [PATCH 0/4] net/tap: support flow API Wiles, Keith
2017-03-06 17:05 ` [dpdk-dev] [PATCH v2 " Pascal Mazon
2017-03-06 17:05 ` [dpdk-dev] [PATCH v2 1/4] net/tap: move private elements to external header Pascal Mazon
2017-03-06 17:05 ` [dpdk-dev] [PATCH v2 2/4] net/tap: add preliminary support for rte_flow Pascal Mazon
2017-03-06 17:05 ` [dpdk-dev] [PATCH v2 3/4] net/tap: add netlink back-end for flow API Pascal Mazon
2017-03-06 17:05 ` [dpdk-dev] [PATCH v2 4/4] net/tap: add basic flow API patterns and actions Pascal Mazon
2017-03-07 15:05 ` [dpdk-dev] [PATCH v2 0/4] net/tap: support flow API Pascal Mazon
2017-03-07 15:08 ` Wiles, Keith
2017-03-07 16:35 ` [dpdk-dev] [PATCH v3 " Pascal Mazon
2017-03-07 16:35 ` [dpdk-dev] [PATCH v3 1/4] net/tap: move private elements to external header Pascal Mazon
2017-03-09 15:28 ` Ferruh Yigit
2017-03-10 9:40 ` Pascal Mazon
2017-03-07 16:35 ` [dpdk-dev] [PATCH v3 2/4] net/tap: add preliminary support for rte_flow Pascal Mazon
2017-03-07 16:35 ` [dpdk-dev] [PATCH v3 3/4] net/tap: add netlink back-end for flow API Pascal Mazon
2017-03-09 15:29 ` Ferruh Yigit
2017-03-10 9:39 ` Pascal Mazon
2017-03-07 16:35 ` [dpdk-dev] [PATCH v3 4/4] net/tap: add basic flow API patterns and actions Pascal Mazon
2017-03-14 8:29 ` [dpdk-dev] [PATCH v4 0/4] net/tap: support flow API Pascal Mazon
2017-03-14 8:29 ` [dpdk-dev] [PATCH v4 1/4] net/tap: move private elements to external header Pascal Mazon
2017-03-14 14:05 ` Wiles, Keith
2017-03-14 8:29 ` [dpdk-dev] [PATCH v4 2/4] net/tap: add preliminary support for rte_flow Pascal Mazon
2017-03-14 8:29 ` [dpdk-dev] [PATCH v4 3/4] net/tap: add netlink back-end for flow API Pascal Mazon
2017-03-14 14:03 ` Wiles, Keith
2017-03-14 8:29 ` [dpdk-dev] [PATCH v4 4/4] net/tap: add basic flow API patterns and actions Pascal Mazon
2017-03-15 14:54 ` [dpdk-dev] [PATCH v5 0/4] net/tap: support flow API Pascal Mazon
2017-03-15 14:54 ` [dpdk-dev] [PATCH v5 1/4] net/tap: move private elements to external header Pascal Mazon
2017-03-21 15:32 ` Wiles, Keith
2017-03-21 16:57 ` Pascal Mazon
2017-03-15 14:54 ` [dpdk-dev] [PATCH v5 2/4] net/tap: add preliminary support for rte_flow Pascal Mazon
2017-03-21 15:35 ` Wiles, Keith
2017-03-15 14:54 ` [dpdk-dev] [PATCH v5 3/4] net/tap: add netlink back-end for flow API Pascal Mazon
2017-03-15 14:54 ` [dpdk-dev] [PATCH v5 4/4] net/tap: add basic flow API patterns and actions Pascal Mazon
2017-03-21 17:10 ` Ferruh Yigit
2017-03-21 15:48 ` [dpdk-dev] [PATCH v5 0/4] net/tap: support flow API Wiles, Keith
2017-03-22 9:48 ` [dpdk-dev] [PATCH v6 " Pascal Mazon
2017-03-22 9:48 ` [dpdk-dev] [PATCH v6 1/4] net/tap: move private elements to external header Pascal Mazon
2017-03-22 9:48 ` [dpdk-dev] [PATCH v6 2/4] net/tap: add preliminary support for rte_flow Pascal Mazon
2017-03-22 9:48 ` [dpdk-dev] [PATCH v6 3/4] net/tap: add netlink back-end for flow API Pascal Mazon
2017-03-22 9:48 ` [dpdk-dev] [PATCH v6 4/4] net/tap: add basic flow API patterns and actions Pascal Mazon
2017-03-22 13:56 ` Ferruh Yigit
2017-03-22 14:22 ` [dpdk-dev] [PATCH v6 0/4] net/tap: support flow API Wiles, Keith
2017-03-23 8:33 ` [dpdk-dev] [PATCH v7 " Pascal Mazon
2017-03-23 8:33 ` [dpdk-dev] [PATCH v7 1/4] net/tap: move private elements to external header Pascal Mazon
2017-03-23 8:33 ` [dpdk-dev] [PATCH v7 2/4] net/tap: add preliminary support for rte_flow Pascal Mazon
2017-03-23 8:33 ` [dpdk-dev] [PATCH v7 3/4] net/tap: add netlink back-end for flow API Pascal Mazon
2017-03-23 8:33 ` [dpdk-dev] [PATCH v7 4/4] net/tap: add basic flow API patterns and actions Pascal Mazon
2017-03-23 12:50 ` [dpdk-dev] [PATCH v7 0/4] net/tap: support flow API 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=20170306152229.3f422e21@paques.dev.6wind.com \
--to=pascal.mazon@6wind.com \
--cc=dev@dpdk.org \
--cc=keith.wiles@intel.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).