Print this page
6274 MAC tries to use aggr rings from downed links
Reviewed by: Bryan Cantrill <bryan@joyent.com>
Reviewed by: Patrick Mooney <patrick.mooney@joyent.com>
Reviewed by: Dan McDonald <danmcd@omniti.com>
Approved by: Richard Lowe <richlowe@richlowe.net>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/io/mac/mac.c
          +++ new/usr/src/uts/common/io/mac/mac.c
↓ open down ↓ 13 lines elided ↑ open up ↑
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22   22  /*
  23   23   * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  24      - * Copyright (c) 2014, Joyent, Inc.  All rights reserved.
       24 + * Copyright 2015 Joyent, Inc.
  25   25   */
  26   26  
  27   27  /*
  28   28   * MAC Services Module
  29   29   *
  30   30   * The GLDv3 framework locking -  The MAC layer
  31   31   * --------------------------------------------
  32   32   *
  33   33   * The MAC layer is central to the GLD framework and can provide the locking
  34   34   * framework needed for itself and for the use of MAC clients. MAC end points
↓ open down ↓ 1635 lines elided ↑ open up ↑
1670 1670  mblk_t *
1671 1671  mac_hwring_send_priv(mac_client_handle_t mch, mac_ring_handle_t rh, mblk_t *mp)
1672 1672  {
1673 1673          mac_client_impl_t *mcip = (mac_client_impl_t *)mch;
1674 1674          mac_impl_t *mip = mcip->mci_mip;
1675 1675  
1676 1676          MAC_TX(mip, rh, mp, mcip);
1677 1677          return (mp);
1678 1678  }
1679 1679  
     1680 +/*
     1681 + * Private function that is only used by aggr to update the default transmission
     1682 + * ring. Because aggr exposes a pseudo Tx ring even for ports that may
     1683 + * temporarily be down, it may need to update the default ring that is used by
     1684 + * MAC such that it refers to a link that can actively be used to send traffic.
     1685 + * Note that this is different from the case where the port has been removed
     1686 + * from the group. In those cases, all of the rings will be torn down because
     1687 + * the ring will no longer exist. It's important to give aggr a case where the
     1688 + * rings can still exist such that it may be able to continue to send LACP PDUs
     1689 + * to potentially restore the link.
     1690 + *
     1691 + * Finally, we explicitly don't do anything if the ring hasn't been enabled yet.
     1692 + * This is to help out aggr which doesn't really know the internal state that
     1693 + * MAC does about the rings and can't know that it's not quite ready for use
     1694 + * yet.
     1695 + */
     1696 +void
     1697 +mac_hwring_set_default(mac_handle_t mh, mac_ring_handle_t rh)
     1698 +{
     1699 +        mac_impl_t *mip = (mac_impl_t *)mh;
     1700 +        mac_ring_t *ring = (mac_ring_t *)rh;
     1701 +
     1702 +        ASSERT(MAC_PERIM_HELD(mh));
     1703 +        VERIFY(mip->mi_state_flags & MIS_IS_AGGR);
     1704 +
     1705 +        if (ring->mr_state != MR_INUSE)
     1706 +                return;
     1707 +
     1708 +        mip->mi_default_tx_ring = rh;
     1709 +}
     1710 +
1680 1711  int
1681 1712  mac_hwgroup_addmac(mac_group_handle_t gh, const uint8_t *addr)
1682 1713  {
1683 1714          mac_group_t *group = (mac_group_t *)gh;
1684 1715  
1685 1716          return (mac_group_addmac(group, addr));
1686 1717  }
1687 1718  
1688 1719  int
1689 1720  mac_hwgroup_remmac(mac_group_handle_t gh, const uint8_t *addr)
↓ open down ↓ 6305 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX