aboutsummaryrefslogtreecommitdiff
path: root/datapath/flow.h
diff options
context:
space:
mode:
authorPravin B Shelar <pshelar@nicira.com>2011-11-01 10:13:16 -0700
committerPravin B Shelar <pshelar@nicira.com>2011-11-01 10:13:16 -0700
commitabff858b5ad310a529d5a5ac2a230ee4ac9736db (patch)
treeac2cb7524dc3267adf07e0df61d2aab5ee78836f /datapath/flow.h
parent7f4ae491b0fb5fb513e22ed2bd1829c5cd42e71c (diff)
datapath: Convert kernel priority actions into match/set.
Following patch adds skb-priority to flow key. So userspace will know what was priority when packet arrived and we can remove the pop/reset priority action. It's no longer necessary to have a special action for pop that is based on the kernel remembering original skb->priority. Userspace can just emit a set priority action with the original value. Since the priority field is a match field with just a normal set action, we can convert it into the new model for actions that are based on matches. Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com> Bug #7715
Diffstat (limited to 'datapath/flow.h')
-rw-r--r--datapath/flow.h14
1 files changed, 9 insertions, 5 deletions
diff --git a/datapath/flow.h b/datapath/flow.h
index 484ea626..e68269e0 100644
--- a/datapath/flow.h
+++ b/datapath/flow.h
@@ -36,8 +36,11 @@ struct sw_flow_actions {
struct sw_flow_key {
struct {
- __be64 tun_id; /* Encapsulating tunnel ID. */
- u16 in_port; /* Input switch port (or USHRT_MAX). */
+ __be64 tun_id; /* Encapsulating tunnel ID. */
+ u32 priority; /* Packet QoS priority. */
+ u16 in_port; /* Input switch port (or USHRT_MAX). */
+ } phy;
+ 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. */
@@ -138,6 +141,7 @@ u64 flow_used_time(unsigned long flow_jiffies);
*
* struct pad nl hdr total
* ------ --- ------ -----
+ * OVS_KEY_ATTR_PRIORITY 4 -- 4 8
* OVS_KEY_ATTR_TUN_ID 8 -- 4 12
* OVS_KEY_ATTR_IN_PORT 4 -- 4 8
* OVS_KEY_ATTR_ETHERNET 12 -- 4 16
@@ -147,14 +151,14 @@ u64 flow_used_time(unsigned long flow_jiffies);
* OVS_KEY_ATTR_ICMPV6 2 2 4 8
* OVS_KEY_ATTR_ND 28 -- 4 32
* -------------------------------------------------
- * total 132
+ * total 140
*/
-#define FLOW_BUFSIZE 132
+#define FLOW_BUFSIZE 140
int flow_to_nlattrs(const struct sw_flow_key *, struct sk_buff *);
int flow_from_nlattrs(struct sw_flow_key *swkey, int *key_lenp,
const struct nlattr *);
-int flow_metadata_from_nlattrs(u16 *in_port, __be64 *tun_id,
+int flow_metadata_from_nlattrs(u32 *priority, u16 *in_port, __be64 *tun_id,
const struct nlattr *);
#define TBL_MIN_BUCKETS 1024