From: John Fastabend <john.r.fastabend-ral2JQCrhuEAvxtiuMwx3w@public•gmane.org>
To: Jesse Gross <jesse-l0M0P4e3n4LQT0dZR+AlfA@public•gmane.org>
Cc: "dev-yBygre7rU0TnMu66kgdUjQ@public•gmane.org"
<dev-yBygre7rU0TnMu66kgdUjQ@public•gmane.org>,
"netdev-u79uwXL29TY76Z2rM5mHXA@public•gmane.org"
<netdev-u79uwXL29TY76Z2rM5mHXA@public•gmane.org>,
"David S. Miller" <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public•gmane.org>
Subject: Re: [PATCH net-next 4/4] net: Add Open vSwitch kernel components.
Date: Sat, 19 Nov 2011 20:55:59 -0800 [thread overview]
Message-ID: <4EC8885F.3090607@intel.com> (raw)
In-Reply-To: <CAEP_g=8EpR_Z54ZvGZzFAeCVwVED3SUrddvLt7-aQ76Q919ekQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
On 11/19/2011 3:06 PM, Jesse Gross wrote:
> On Fri, Nov 18, 2011 at 9:30 PM, John Fastabend
> <john.r.fastabend-ral2JQCrhuEAvxtiuMwx3w@public•gmane.org> wrote:
>> On 11/18/2011 3:12 PM, Jesse Gross wrote:
>>> + */
>>> +enum ovs_frag_type {
>>> + OVS_FRAG_TYPE_NONE,
>>> + OVS_FRAG_TYPE_FIRST,
>>> + OVS_FRAG_TYPE_LATER,
>>> + __OVS_FRAG_TYPE_MAX
>>> +};
>>> +
>>> +#define OVS_FRAG_TYPE_MAX (__OVS_FRAG_TYPE_MAX - 1)
>>> +
>>> +struct ovs_key_ethernet {
>>> + __u8 eth_src[6];
>>> + __u8 eth_dst[6];
>>> +};
>>> +
>>> +struct ovs_key_ipv4 {
>>> + __be32 ipv4_src;
>>> + __be32 ipv4_dst;
>>> + __u8 ipv4_proto;
>>> + __u8 ipv4_tos;
>>> + __u8 ipv4_ttl;
>>> + __u8 ipv4_frag; /* One of OVS_FRAG_TYPE_*. */
>>> +};
>>> +
>>> +struct ovs_key_ipv6 {
>>> + __be32 ipv6_src[4];
>>> + __be32 ipv6_dst[4];
>>> + __be32 ipv6_label; /* 20-bits in least-significant bits. */
>>> + __u8 ipv6_proto;
>>> + __u8 ipv6_tclass;
>>> + __u8 ipv6_hlimit;
>>> + __u8 ipv6_frag; /* One of OVS_FRAG_TYPE_*. */
>>> +};
>>> +
>>> +struct ovs_key_tcp {
>>> + __be16 tcp_src;
>>> + __be16 tcp_dst;
>>> +};
>>> +
>>> +struct ovs_key_udp {
>>> + __be16 udp_src;
>>> + __be16 udp_dst;
>>> +};
>>> +
>>> +struct ovs_key_icmp {
>>> + __u8 icmp_type;
>>> + __u8 icmp_code;
>>> +};
>>> +
>>> +struct ovs_key_icmpv6 {
>>> + __u8 icmpv6_type;
>>> + __u8 icmpv6_code;
>>> +};
>>> +
>>> +struct ovs_key_arp {
>>> + __be32 arp_sip;
>>> + __be32 arp_tip;
>>> + __be16 arp_op;
>>> + __u8 arp_sha[6];
>>> + __u8 arp_tha[6];
>>> +};
>>> +
>>> +struct ovs_key_nd {
>>> + __u32 nd_target[4];
>>> + __u8 nd_sll[6];
>>> + __u8 nd_tll[6];
>>> +};
>>> +
>>
>> We already have defines for many of these headers
>> struct arphdr {
>> __be16 ar_hrd; /* format of hardware address */
>> __be16 ar_pro; /* format of protocol address */
>> unsigned char ar_hln; /* length of hardware address */
>> unsigned char ar_pln; /* length of protocol address */
>> __be16 ar_op; /* ARP opcode (command) */
>>
>> #if 0
>> /*
>> * Ethernet looks like this : This bit is variable sized however...
>> */
>> unsigned char ar_sha[ETH_ALEN]; /* sender hardware address */
>> unsigned char ar_sip[4]; /* sender IP address */
>> unsigned char ar_tha[ETH_ALEN]; /* target hardware address */
>> unsigned char ar_tip[4]; /* target IP address */
>> #endif
>>
>> };
>>
>> Do we have to redefine them here?
>
> These aren't packet format definitions, they're keys for describing a
> flow to userspace. For example, they don't contain checksums or
> lengths because those vary on a per-packet basis.
OK thanks for explaining. I get it now, the other responses seem reasonable
as well.
Thanks,
John.
next prev parent reply other threads:[~2011-11-20 4:55 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-18 23:12 [GIT PULL net-next] Open vSwitch Jesse Gross
[not found] ` <1321657938-21761-1-git-send-email-jesse-l0M0P4e3n4LQT0dZR+AlfA@public.gmane.org>
2011-11-18 23:12 ` [PATCH net-next 1/4] genetlink: Add genl_notify() Jesse Gross
2011-11-18 23:12 ` [PATCH net-next 2/4] genetlink: Add lockdep_genl_is_held() Jesse Gross
2011-11-18 23:12 ` [PATCH net-next 3/4] vlan: Move vlan_set_encap_proto() to vlan header file Jesse Gross
2011-11-18 23:12 ` [PATCH net-next 4/4] net: Add Open vSwitch kernel components Jesse Gross
[not found] ` <1321657938-21761-5-git-send-email-jesse-l0M0P4e3n4LQT0dZR+AlfA@public.gmane.org>
2011-11-18 23:23 ` Stephen Hemminger
[not found] ` <20111118152334.2c2a9761-We1ePj4FEcvRI77zikRAJc56i+j3xesD0e7PPNI6Mm0@public.gmane.org>
2011-11-19 0:58 ` Jesse Gross
[not found] ` <CAEP_g=8PjK3GWuDVT36UVxWsQsGwf1WGYXZDCdax+3XqX5-T4A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-11-19 1:09 ` Stephen Hemminger
[not found] ` <93c2cdf4-43be-4a83-88a6-8f4c8a45e581-bX68f012229Xuxj3zoTs5AC/G2K4zDHf@public.gmane.org>
2011-11-19 1:37 ` David Miller
[not found] ` <20111118.203732.971277374822526847.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2011-11-19 18:19 ` Jesse Gross
2011-11-19 5:30 ` John Fastabend
[not found] ` <4EC73EDB.1010204-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2011-11-19 23:06 ` Jesse Gross
[not found] ` <CAEP_g=8EpR_Z54ZvGZzFAeCVwVED3SUrddvLt7-aQ76Q919ekQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-11-20 4:55 ` John Fastabend [this message]
2011-11-21 12:20 ` jamal
2011-11-21 12:29 ` jamal
2011-11-22 23:11 ` Jesse Gross
2011-11-22 23:11 ` Jesse Gross
[not found] ` <CAEP_g=8puZh8hihoyoHTc4f6cBu4jiDJQ6tqk6suQxR=dchyjA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-11-22 23:19 ` David Miller
[not found] ` <20111122.181930.1186109067515095173.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2011-11-23 1:34 ` Jesse Gross
[not found] ` <CAEP_g=8EqkfRq4XmGy_8-f1FrXrvjHNBT6u70a_2mqDnyp2Miw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-11-23 1:42 ` David Miller
2011-11-23 1:45 ` Jamal Hadi Salim
2011-11-23 2:30 ` John Fastabend
[not found] ` <4ECC5AAB.8000605-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2011-11-23 3:07 ` Jamal Hadi Salim
2011-11-23 5:37 ` Chris Wright
2011-11-24 2:34 ` Justin Pettit
[not found] ` <E521938A-E5E5-48CE-B784-6BF38ED274AE-l0M0P4e3n4LQT0dZR+AlfA@public.gmane.org>
2011-11-24 13:25 ` jamal
2011-11-27 7:17 ` Justin Pettit
[not found] ` <198A6700-6BB3-4639-A2AC-C306DFB24CE0-l0M0P4e3n4LQT0dZR+AlfA@public.gmane.org>
2011-11-27 18:00 ` jamal
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=4EC8885F.3090607@intel.com \
--to=john.r.fastabend-ral2jqcrhueavxtiumwx3w@public$(echo .)gmane.org \
--cc=davem-fT/PcQaiUtIeIZ0/mPfg9Q@public$(echo .)gmane.org \
--cc=dev-yBygre7rU0TnMu66kgdUjQ@public$(echo .)gmane.org \
--cc=jesse-l0M0P4e3n4LQT0dZR+AlfA@public$(echo .)gmane.org \
--cc=netdev-u79uwXL29TY76Z2rM5mHXA@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