diff options
| author | William Tu <[email protected]> | 2016-06-10 18:49:33 +0000 |
|---|---|---|
| committer | David S. Miller <[email protected]> | 2016-06-11 00:58:03 +0000 |
| commit | f2a4d086ed4c588d32fe9b7aa67fead7280e7bf1 (patch) | |
| tree | 7824d6446b4fd259cc7430641fd27475445361ba /net/openvswitch/datapath.h | |
| parent | Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net (diff) | |
| download | kernel-f2a4d086ed4c588d32fe9b7aa67fead7280e7bf1.tar.gz kernel-f2a4d086ed4c588d32fe9b7aa67fead7280e7bf1.zip | |
openvswitch: Add packet truncation support.
The patch adds a new OVS action, OVS_ACTION_ATTR_TRUNC, in order to
truncate packets. A 'max_len' is added for setting up the maximum
packet size, and a 'cutlen' field is to record the number of bytes
to trim the packet when the packet is outputting to a port, or when
the packet is sent to userspace.
Signed-off-by: William Tu <[email protected]>
Cc: Pravin Shelar <[email protected]>
Acked-by: Pravin B Shelar <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'net/openvswitch/datapath.h')
| -rw-r--r-- | net/openvswitch/datapath.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/net/openvswitch/datapath.h b/net/openvswitch/datapath.h index 427e39a045cf..ab85c1cae255 100644 --- a/net/openvswitch/datapath.h +++ b/net/openvswitch/datapath.h @@ -100,11 +100,13 @@ struct datapath { * @input_vport: The original vport packet came in on. This value is cached * when a packet is received by OVS. * @mru: The maximum received fragement size; 0 if the packet is not + * @cutlen: The number of bytes from the packet end to be removed. * fragmented. */ struct ovs_skb_cb { struct vport *input_vport; u16 mru; + u32 cutlen; }; #define OVS_CB(skb) ((struct ovs_skb_cb *)(skb)->cb) @@ -194,7 +196,8 @@ extern struct genl_family dp_vport_genl_family; void ovs_dp_process_packet(struct sk_buff *skb, struct sw_flow_key *key); void ovs_dp_detach_port(struct vport *); int ovs_dp_upcall(struct datapath *, struct sk_buff *, - const struct sw_flow_key *, const struct dp_upcall_info *); + const struct sw_flow_key *, const struct dp_upcall_info *, + uint32_t cutlen); const char *ovs_dp_name(const struct datapath *dp); struct sk_buff *ovs_vport_cmd_build_info(struct vport *, u32 pid, u32 seq, |
