Let the drop_frags_rule take care of dropping the fragmented packet.

This allows both slight streamlining the common case and small
clean-up of the xlate interface.

Signed-off-by: Jarno Rajahalme <[email protected]>
---
 ofproto/ofproto-dpif-xlate.c |   18 +++++-------------
 ofproto/ofproto-dpif-xlate.h |    2 +-
 ofproto/ofproto-dpif.c       |    2 +-
 3 files changed, 7 insertions(+), 15 deletions(-)

diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c
index e9cef62..c8227f9 100644
--- a/ofproto/ofproto-dpif-xlate.c
+++ b/ofproto/ofproto-dpif-xlate.c
@@ -93,7 +93,6 @@ struct xbridge {
     struct rule_dpif *miss_rule;
     struct rule_dpif *no_packet_in_rule;
 
-    enum ofp_config_flags frag;   /* Fragmentation handling. */
     bool has_in_band;             /* Bridge has in band control? */
     bool forward_bpdu;            /* Bridge forwards STP BPDUs? */
 
@@ -369,7 +368,7 @@ static void xlate_xbridge_set(struct xbridge *, struct dpif 
*,
                               const struct mbridge *,
                               const struct dpif_sflow *,
                               const struct dpif_ipfix *,
-                              const struct netflow *, enum ofp_config_flags,
+                              const struct netflow *,
                               bool forward_bpdu, bool has_in_band,
                               bool enable_recirc,
                               bool variable_length_userdata,
@@ -435,7 +434,7 @@ xlate_xbridge_set(struct xbridge *xbridge,
                   const struct mbridge *mbridge,
                   const struct dpif_sflow *sflow,
                   const struct dpif_ipfix *ipfix,
-                  const struct netflow *netflow, enum ofp_config_flags frag,
+                  const struct netflow *netflow,
                   bool forward_bpdu, bool has_in_band,
                   bool enable_recirc,
                   bool variable_length_userdata,
@@ -485,7 +484,6 @@ xlate_xbridge_set(struct xbridge *xbridge,
     xbridge->dpif = dpif;
     xbridge->forward_bpdu = forward_bpdu;
     xbridge->has_in_band = has_in_band;
-    xbridge->frag = frag;
     xbridge->miss_rule = miss_rule;
     xbridge->no_packet_in_rule = no_packet_in_rule;
     xbridge->enable_recirc = enable_recirc;
@@ -571,7 +569,7 @@ xlate_xbridge_copy(struct xbridge *xbridge)
                       xbridge->no_packet_in_rule, xbridge->ml, xbridge->stp,
                       xbridge->rstp, xbridge->ms, xbridge->mbridge,
                       xbridge->sflow, xbridge->ipfix, xbridge->netflow,
-                      xbridge->frag, xbridge->forward_bpdu,
+                      xbridge->forward_bpdu,
                       xbridge->has_in_band, xbridge->enable_recirc,
                       xbridge->variable_length_userdata,
                       xbridge->max_mpls_depth, xbridge->masked_set_action);
@@ -725,7 +723,7 @@ xlate_ofproto_set(struct ofproto_dpif *ofproto, const char 
*name,
                   const struct mbridge *mbridge,
                   const struct dpif_sflow *sflow,
                   const struct dpif_ipfix *ipfix,
-                  const struct netflow *netflow, enum ofp_config_flags frag,
+                  const struct netflow *netflow,
                   bool forward_bpdu, bool has_in_band, bool enable_recirc,
                   bool variable_length_userdata, size_t max_mpls_depth,
                   bool masked_set_action)
@@ -746,7 +744,7 @@ xlate_ofproto_set(struct ofproto_dpif *ofproto, const char 
*name,
     xbridge->name = xstrdup(name);
 
     xlate_xbridge_set(xbridge, dpif, miss_rule, no_packet_in_rule, ml, stp,
-                      rstp, ms, mbridge, sflow, ipfix, netflow, frag,
+                      rstp, ms, mbridge, sflow, ipfix, netflow,
                       forward_bpdu, has_in_band, enable_recirc,
                       variable_length_userdata, max_mpls_depth,
                       masked_set_action);
@@ -4262,12 +4260,6 @@ xlate_actions(struct xlate_in *xin, struct xlate_out 
*xout)
         }
     }
 
-    /* Drop frags if needed after ingress stats are taken care of (above). */
-    if (OVS_UNLIKELY(flow->nw_frag & FLOW_NW_FRAG_ANY
-                     && ctx.xbridge->frag == OFPC_FRAG_DROP)) {
-        return;
-    }
-
     xout->fail_open = ctx.rule && rule_dpif_is_fail_open(ctx.rule);
 
     if (xin->ofpacts) {
diff --git a/ofproto/ofproto-dpif-xlate.h b/ofproto/ofproto-dpif-xlate.h
index 5ef20b1..2ec1604 100644
--- a/ofproto/ofproto-dpif-xlate.h
+++ b/ofproto/ofproto-dpif-xlate.h
@@ -150,7 +150,7 @@ void xlate_ofproto_set(struct ofproto_dpif *, const char 
*name,
                        struct rstp *, const struct mcast_snooping *,
                        const struct mbridge *, const struct dpif_sflow *,
                        const struct dpif_ipfix *, const struct netflow *,
-                       enum ofp_config_flags, bool forward_bpdu,
+                       bool forward_bpdu,
                        bool has_in_band, bool enable_recirc,
                        bool variable_length_userdata,
                        size_t mpls_label_stack_length,
diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c
index 102cbd7..023bcef 100644
--- a/ofproto/ofproto-dpif.c
+++ b/ofproto/ofproto-dpif.c
@@ -618,7 +618,7 @@ type_run(const char *type)
                               ofproto->no_packet_in_rule, ofproto->ml,
                               ofproto->stp, ofproto->rstp, ofproto->ms,
                               ofproto->mbridge, ofproto->sflow, ofproto->ipfix,
-                              ofproto->netflow, ofproto->up.frag_handling,
+                              ofproto->netflow,
                               ofproto->up.forward_bpdu,
                               connmgr_has_in_band(ofproto->up.connmgr),
                               ofproto->backer->enable_recirc,
-- 
1.7.10.4

_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev

Reply via email to