public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Jiri Pirko <jiri-rHqAuBHg3fBzbRFIqnYvSA@public•gmane.org>
To: John Fastabend <john.fastabend-Re5JQEeQqe8AvxtiuMwx3w@public•gmane.org>
Cc: ryazanov.s.a-Re5JQEeQqe8AvxtiuMwx3w@public•gmane.org,
	jasowang-H+wXaHxf7aLQT0dZR+AlfA@public•gmane.org,
	john.r.fastabend-ral2JQCrhuEAvxtiuMwx3w@public•gmane.org,
	Neil.Jerram-QnUH15yq9NYqDJ6do+/SaQ@public•gmane.org,
	edumazet-hpIqsD4AKlfQT0dZR+AlfA@public•gmane.org,
	andy-QlMahl40kYEqcZcGjlUOXw@public•gmane.org,
	dev-yBygre7rU0TnMu66kgdUjQ@public•gmane.org,
	nbd-p3rKhJxN3npAfugRpC6u6w@public•gmane.org,
	f.fainelli-Re5JQEeQqe8AvxtiuMwx3w@public•gmane.org,
	ronye-VPRAkNaXOzVWk0Htik3J/w@public•gmane.org,
	jeffrey.t.kirsher-ral2JQCrhuEAvxtiuMwx3w@public•gmane.org,
	ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public•gmane.org,
	ben-/+tVBieCtBitmTQ+vhA3Yw@public•gmane.org,
	buytenh-OLH4Qvv75CYX/NnBR394Jw@public•gmane.org,
	roopa-qUQiAmfTcIp+XZJcv9eMoEEOCMrvLtNR@public•gmane.org,
	jhs-jkUAjuhPggJWk0Htik3J/w@public•gmane.org,
	aviadr-VPRAkNaXOzVWk0Htik3J/w@public•gmane.org,
	nicolas.dichtel-pdR9zngts4EAvxtiuMwx3w@public•gmane.org,
	vyasevic-H+wXaHxf7aLQT0dZR+AlfA@public•gmane.org,
	nhorman-2XuSBdqkA4R54TAoqtyWWQ@public•gmane.org,
	netdev-u79uwXL29TY76Z2rM5mHXA@public•gmane.org,
	stephen-OTpzqLSitTUnbdJkjeBofR2eb7JE58TQ@public•gmane.org,
	dborkman-H+wXaHxf7aLQT0dZR+AlfA@public•gmane.org,
	ebiederm-aS9lmoZGLiVWk0Htik3J/w@public•gmane.org,
	davem-fT/PcQaiUtIeIZ0/mPfg9Q@public•gmane.org
Subject: Re: [patch net-next 01/13] openvswitch: split flow structures into ovs specific and generic ones
Date: Thu, 4 Sep 2014 14:09:07 +0200	[thread overview]
Message-ID: <20140904120907.GD1867@nanopsycho.lan> (raw)
In-Reply-To: <540731B9.4010603-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

Wed, Sep 03, 2014 at 05:20:25PM CEST, john.fastabend-Re5JQEeQqe8AvxtiuMwx3w@public•gmane.org wrote:
>On 09/03/2014 02:24 AM, Jiri Pirko wrote:
>>After this, flow related structures can be used in other code.
>>
>>Signed-off-by: Jiri Pirko <jiri-rHqAuBHg3fBzbRFIqnYvSA@public•gmane.org>
>>---
>
>Hi Jiri,
>
>As I indicated before I'm looking into integrating this with some
>hardware here. Progress is a bit slow but starting to look at it.The
>i40e/ixgbe driver being one open source example with very limited
>support for tables, flow matches, etc. And then a closed source driver
>with much more flexibility. What I don't have is a middle of the road
>switch to work with something better then a host nic but not as
>flexible as a TOR.
>
>Couple questions my assumption here is I can extend the flow_key
>as needed to support additional match criteria my hardware has.
>I scanned the ./net/openvswitch source and I didn't catch any
>place that would break but might need to take a closer look.
>Similarly the actions set will need to be extended. For example
>if I want to use this with i40e a OVS_ACTION_ATTR_QUEUE could
>be used to steer packets to the queue. With this in mind we
>will want a follow up patch to rename OVS_ACTION_ATTR_* to
>FLOW_ACTION_ATTR_*
>
>Also I have some filters that can match on offset/length/mask
>tuples. As far as I can tell this is going to have to be yet
>another interface? Or would it be worth the effort to define
>the flow key more generically. My initial guess is I'll just
>write a separate interface. I think this is what Jamal referred
>to as another "classifier".

I'm thinking about using some more generic match key. It would
incorporate ovs key and possible other classifiers (as your
off/len/mask) as well. Drivers will have free will to implement whatever
the hw supports.

Will do it for the next version of the patchset (most probably after I
return from holliday, Sep 15).


>
>Thanks,
>John
>
>[...]
>
>>+
>>+struct sw_flow_key_ipv4_tunnel {
>>+	__be64 tun_id;
>>+	__be32 ipv4_src;
>>+	__be32 ipv4_dst;
>>+	__be16 tun_flags;
>>+	u8   ipv4_tos;
>>+	u8   ipv4_ttl;
>>+};
>>+
>>+struct sw_flow_key {
>>+	struct sw_flow_key_ipv4_tunnel tun_key;  /* Encapsulating tunnel key. */
>>+	struct {
>>+		u32	priority;	/* Packet QoS priority. */
>>+		u32	skb_mark;	/* SKB mark. */
>>+		u16	in_port;	/* Input switch port (or DP_MAX_PORTS). */
>>+	} __packed phy; /* Safe when right after 'tun_key'. */
>>+	struct {
>>+		u8     src[ETH_ALEN];	/* Ethernet source address. */
>>+		u8     dst[ETH_ALEN];	/* Ethernet destination address. */
>>+		__be16 tci;		/* 0 if no VLAN, VLAN_TAG_PRESENT set otherwise. */
>>+		__be16 type;		/* Ethernet frame type. */
>>+	} eth;
>>+	struct {
>>+		u8     proto;		/* IP protocol or lower 8 bits of ARP opcode. */
>>+		u8     tos;		/* IP ToS. */
>>+		u8     ttl;		/* IP TTL/hop limit. */
>>+		u8     frag;		/* One of OVS_FRAG_TYPE_*. */
>>+	} ip;
>>+	struct {
>>+		__be16 src;		/* TCP/UDP/SCTP source port. */
>>+		__be16 dst;		/* TCP/UDP/SCTP destination port. */
>>+		__be16 flags;		/* TCP flags. */
>>+	} tp;
>>+	union {
>>+		struct {
>>+			struct {
>>+				__be32 src;	/* IP source address. */
>>+				__be32 dst;	/* IP destination address. */
>>+			} addr;
>>+			struct {
>>+				u8 sha[ETH_ALEN];	/* ARP source hardware address. */
>>+				u8 tha[ETH_ALEN];	/* ARP target hardware address. */
>>+			} arp;
>>+		} ipv4;
>>+		struct {
>>+			struct {
>>+				struct in6_addr src;	/* IPv6 source address. */
>>+				struct in6_addr dst;	/* IPv6 destination address. */
>>+			} addr;
>>+			__be32 label;			/* IPv6 flow label. */
>>+			struct {
>>+				struct in6_addr target;	/* ND target address. */
>>+				u8 sll[ETH_ALEN];	/* ND source link layer address. */
>>+				u8 tll[ETH_ALEN];	/* ND target link layer address. */
>>+			} nd;
>>+		} ipv6;
>>+	};
>>+} __aligned(BITS_PER_LONG/8); /* Ensure that we can do comparisons as longs. */
>>+
>>+struct sw_flow_key_range {
>>+	unsigned short int start;
>>+	unsigned short int end;
>>+};
>>+
>>+struct sw_flow_mask {
>>+	struct sw_flow_key_range range;
>>+	struct sw_flow_key key;
>>+};
>>+
>>+struct sw_flow_action {
>>+};
>>+
>>+struct sw_flow_actions {
>>+	unsigned count;
>>+	struct sw_flow_action actions[0];
>>+};
>>+
>>+struct sw_flow {
>>+	struct sw_flow_key key;
>>+	struct sw_flow_key unmasked_key;
>>+	struct sw_flow_mask *mask;
>>+	struct sw_flow_actions *actions;
>>+};
>>+
>
>
>-- 
>John Fastabend         Intel Corporation

  parent reply	other threads:[~2014-09-04 12:09 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-03  9:24 [patch net-next 00/13] introduce rocker switch driver with openvswitch hardware accelerated datapath Jiri Pirko
2014-09-03  9:24 ` [patch net-next 01/13] openvswitch: split flow structures into ovs specific and generic ones Jiri Pirko
     [not found]   ` <1409736300-12303-2-git-send-email-jiri-rHqAuBHg3fBzbRFIqnYvSA@public.gmane.org>
2014-09-03 15:20     ` John Fastabend
     [not found]       ` <540731B9.4010603-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-09-03 18:42         ` Pravin Shelar
     [not found]           ` <CALnjE+rk26Om1O5_Q=8tn7eAyh4Ywen-1+UD_nCVj_geZY1HuQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-09-04 12:25             ` Jiri Pirko
2014-09-04 12:09         ` Jiri Pirko [this message]
2014-09-03 21:11       ` Jamal Hadi Salim
2014-09-03 18:41   ` Pravin Shelar
2014-09-03 21:22     ` Jamal Hadi Salim
     [not found]       ` <54078694.5040104-jkUAjuhPggJWk0Htik3J/w@public.gmane.org>
2014-09-03 21:59         ` Pravin Shelar
     [not found]           ` <CALnjE+qUqSK7kHSi5BZuA0hzFjMcZ8TCTd9JRG1PPmMfDmAQOA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-09-04  1:54             ` Jamal Hadi Salim
     [not found]     ` <CALnjE+pscRmfhaWgkWCunJfjvG04RiNUAj6nefSFHrknQTC+xw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-09-04 12:33       ` Jiri Pirko
     [not found]         ` <20140904123323.GF1867-6KJVSR23iU5sFDB2n11ItA@public.gmane.org>
2014-09-04 20:46           ` Pravin Shelar
2014-09-17  8:34             ` Jiri Pirko
2014-09-17 22:07               ` Jesse Gross
2014-09-03  9:24 ` [patch net-next 02/13] net: rename netdev_phys_port_id to more generic name Jiri Pirko
     [not found] ` <1409736300-12303-1-git-send-email-jiri-rHqAuBHg3fBzbRFIqnYvSA@public.gmane.org>
2014-09-03  9:24   ` [patch net-next 03/13] net: introduce generic switch devices support Jiri Pirko
     [not found]     ` <1409736300-12303-4-git-send-email-jiri-rHqAuBHg3fBzbRFIqnYvSA@public.gmane.org>
2014-09-03 15:46       ` John Fastabend
     [not found]         ` <540737CF.4000402-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-09-04 12:46           ` Jiri Pirko
2014-09-03  9:24   ` [patch net-next 04/13] rtnl: expose physical switch id for particular device Jiri Pirko
2014-09-03  9:24   ` [patch net-next 05/13] net-sysfs: " Jiri Pirko
2014-09-03  9:24   ` [patch net-next 06/13] net: introduce dummy switch Jiri Pirko
2014-09-03  9:24   ` [patch net-next 07/13] dsa: implement ndo_swdev_get_id Jiri Pirko
     [not found]     ` <1409736300-12303-8-git-send-email-jiri-rHqAuBHg3fBzbRFIqnYvSA@public.gmane.org>
2014-09-03 23:20       ` Florian Fainelli
     [not found]         ` <5407A25A.8050401-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-09-04 12:47           ` Jiri Pirko
     [not found]             ` <20140904124701.GH1867-6KJVSR23iU5sFDB2n11ItA@public.gmane.org>
2014-09-05  4:43               ` Felix Fietkau
2014-09-05  5:52                 ` Jiri Pirko
2014-09-03  9:24   ` [patch net-next 10/13] openvswitch: add support for datapath hardware offload Jiri Pirko
     [not found]     ` <1409736300-12303-11-git-send-email-jiri-rHqAuBHg3fBzbRFIqnYvSA@public.gmane.org>
2014-09-03 16:37       ` John Fastabend
     [not found]         ` <540743B4.9080500-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-09-04 12:48           ` Jiri Pirko
     [not found]             ` <20140904124837.GI1867-6KJVSR23iU5sFDB2n11ItA@public.gmane.org>
2014-09-05  3:59               ` Simon Horman
2014-09-03  9:24   ` [patch net-next 11/13] sw_flow: add misc section to key with in_port_ifindex field Jiri Pirko
2014-09-03  9:24   ` [patch net-next 12/13] rocker: introduce rocker switch driver Jiri Pirko
2014-09-03  9:24 ` [patch net-next 08/13] net: introduce netdev_phys_item_ids_match helper Jiri Pirko
2014-09-03  9:24 ` [patch net-next 09/13] openvswitch: introduce vport_op get_netdev Jiri Pirko
2014-09-03  9:25 ` [patch net-next 13/13] switchdev: introduce Netlink API Jiri Pirko
2014-09-08 13:54 ` [patch net-next 00/13] introduce rocker switch driver with openvswitch hardware accelerated datapath Thomas Graf
2014-09-09 21:09   ` Alexei Starovoitov
2014-09-15 12:43     ` Thomas Graf
2014-09-16 15:58   ` Jiri Pirko
     [not found]     ` <20140916155832.GA1869-6KJVSR23iU488b5SBfVpbw@public.gmane.org>
2015-06-29  5:44       ` Neelakantam Gaddam
     [not found]         ` <CAOv37=BNU1-+kgTR6RUqxw7snJL6=5g-rLYhuPc1F-V0B1k7tA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-06-29  5:46           ` Jiri Pirko

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=20140904120907.GD1867@nanopsycho.lan \
    --to=jiri-rhqaubhg3fbzbrfiqnyvsa@public$(echo .)gmane.org \
    --cc=Neil.Jerram-QnUH15yq9NYqDJ6do+/SaQ@public$(echo .)gmane.org \
    --cc=andy-QlMahl40kYEqcZcGjlUOXw@public$(echo .)gmane.org \
    --cc=aviadr-VPRAkNaXOzVWk0Htik3J/w@public$(echo .)gmane.org \
    --cc=ben-/+tVBieCtBitmTQ+vhA3Yw@public$(echo .)gmane.org \
    --cc=buytenh-OLH4Qvv75CYX/NnBR394Jw@public$(echo .)gmane.org \
    --cc=davem-fT/PcQaiUtIeIZ0/mPfg9Q@public$(echo .)gmane.org \
    --cc=dborkman-H+wXaHxf7aLQT0dZR+AlfA@public$(echo .)gmane.org \
    --cc=dev-yBygre7rU0TnMu66kgdUjQ@public$(echo .)gmane.org \
    --cc=ebiederm-aS9lmoZGLiVWk0Htik3J/w@public$(echo .)gmane.org \
    --cc=edumazet-hpIqsD4AKlfQT0dZR+AlfA@public$(echo .)gmane.org \
    --cc=f.fainelli-Re5JQEeQqe8AvxtiuMwx3w@public$(echo .)gmane.org \
    --cc=jasowang-H+wXaHxf7aLQT0dZR+AlfA@public$(echo .)gmane.org \
    --cc=jeffrey.t.kirsher-ral2JQCrhuEAvxtiuMwx3w@public$(echo .)gmane.org \
    --cc=jhs-jkUAjuhPggJWk0Htik3J/w@public$(echo .)gmane.org \
    --cc=john.fastabend-Re5JQEeQqe8AvxtiuMwx3w@public$(echo .)gmane.org \
    --cc=john.r.fastabend-ral2JQCrhuEAvxtiuMwx3w@public$(echo .)gmane.org \
    --cc=nbd-p3rKhJxN3npAfugRpC6u6w@public$(echo .)gmane.org \
    --cc=netdev-u79uwXL29TY76Z2rM5mHXA@public$(echo .)gmane.org \
    --cc=nhorman-2XuSBdqkA4R54TAoqtyWWQ@public$(echo .)gmane.org \
    --cc=nicolas.dichtel-pdR9zngts4EAvxtiuMwx3w@public$(echo .)gmane.org \
    --cc=ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public$(echo .)gmane.org \
    --cc=ronye-VPRAkNaXOzVWk0Htik3J/w@public$(echo .)gmane.org \
    --cc=roopa-qUQiAmfTcIp+XZJcv9eMoEEOCMrvLtNR@public$(echo .)gmane.org \
    --cc=ryazanov.s.a-Re5JQEeQqe8AvxtiuMwx3w@public$(echo .)gmane.org \
    --cc=stephen-OTpzqLSitTUnbdJkjeBofR2eb7JE58TQ@public$(echo .)gmane.org \
    --cc=vyasevic-H+wXaHxf7aLQT0dZR+AlfA@public$(echo .)gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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