aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/lacp
AgeCommit message (Expand)AuthorFilesLines
2018-11-27cmake: Add protocol.h to lacp plugin .h includesAlexander Chernavin1-0/+1
2018-11-14Remove c-11 memcpy checks from perf-critical codeDave Barach1-1/+1
2018-10-23c11 safe string handling supportDave Barach3-4/+4
2018-08-27cmake: Fix plugins .h includesMohsin Kazmi1-0/+10
2018-08-25cmake: handle api_test_plugins in add_vpp_plugin macroDamjan Marion1-3/+1
2018-08-25cmake: improve add_vpp_plugin macroDamjan Marion1-3/+6
2018-08-17CMake as an alternative to autotools (experimental)Damjan Marion1-0/+32
2018-08-17lacp: issue with slave interface admin up after it is added to the bond groupSteven1-2/+2
2018-05-25bond: performance harvestingSteven1-7/+7
2018-04-24lacp: deleting the bond subinterface may cause lacp to lose the partner [VPP-...Steven2-15/+8
2018-04-23lacp: partner may time us out if fast-rate is configured [VPP-1247]Steven5-8/+14
2018-04-04Doc updates prior to branchChris Luke1-9/+21
2018-03-30lacp: faster convergence for slow-rate config optionSteven6-18/+29
2018-03-21bond: Add bonding driver and LACP protocolSteven22-0/+3943
umber.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
/*
 * Copyright (c) 2016 Cisco and/or its affiliates.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at:
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef __ADJ_DP_H__
#define __ADJ_DP_H__

#include <vnet/adj/adj.h>
#include <vnet/tunnel/tunnel_dp.h>
#include <vnet/ip/ip4_inlines.h>
#include <vnet/ip/ip6_inlines.h>
#include <vnet/mpls/mpls_lookup.h>

static_always_inline void
adj_midchain_ipip44_fixup (vlib_main_t * vm,
                           const ip_adjacency_t * adj,
                           vlib_buffer_t * b)
{
  tunnel_encap_decap_flags_t flags;
  ip4_header_t *ip4;

  flags = pointer_to_uword (adj->sub_type.midchain.fixup_data);

  ip4 = vlib_buffer_get_current (b);
  ip4->length = clib_host_to_net_u16 (vlib_buffer_length_in_chain (vm, b));

  if (PREDICT_TRUE(TUNNEL_ENCAP_DECAP_FLAG_NONE == flags))
  {
      ip_csum_t sum;
      u16 old,new;

      old = 0;
      new = ip4->length;

      sum = ip4->checksum;
      sum = ip_csum_update (sum, old, new, ip4_header_t, length);
      ip4->checksum = ip_csum_fold (sum);
  }
  else
  {
      tunnel_encap_fixup_4o4 (flags, ip4 + 1, ip4);
      ip4->checksum = ip4_header_checksum (ip4);
  }
}

static_always_inline void
adj_midchain_fixup (vlib_main_t *vm,
                    const ip_adjacency_t *adj,
                    vlib_buffer_t * b,
                    vnet_link_t lt)
{
    if (PREDICT_TRUE(adj->rewrite_header.flags &
                     VNET_REWRITE_FIXUP_IP4_O_4))
        adj_midchain_ipip44_fixup (vm, adj, b);
    else if (adj->sub_type.midchain.fixup_func)
        adj->sub_type.midchain.fixup_func
            (vm, adj, b, adj->sub_type.midchain.fixup_data);

    if (PREDICT_FALSE(adj->rewrite_header.flags &
                      VNET_REWRITE_FIXUP_FLOW_HASH))
    {
        if (VNET_LINK_IP4 == lt)
            vnet_buffer (b)->ip.flow_hash =
                ip4_compute_flow_hash (vlib_buffer_get_current (b) + adj->rewrite_header.data_bytes,
                                       IP_FLOW_HASH_DEFAULT);
        else if (VNET_LINK_IP6 == lt)
            vnet_buffer (b)->ip.flow_hash =
                ip6_compute_flow_hash (vlib_buffer_get_current (b) + adj->rewrite_header.data_bytes,
                                       IP_FLOW_HASH_DEFAULT);
        else if (VNET_LINK_MPLS == lt)
            vnet_buffer (b)->ip.flow_hash =
                mpls_compute_flow_hash (vlib_buffer_get_current (b) + adj->rewrite_header.data_bytes,
                                       IP_FLOW_HASH_DEFAULT);
    }
}

#endif