Print this page
11490 SRS ring polling disabled for VLANs
11491 Want DLS bypass for VLAN traffic
11492 add VLVF bypass to ixgbe core
2869 duplicate packets with vnics over aggrs
11489 DLS stat delete and aggr kstat can deadlock
Portions contributed by: Theo Schlossnagle <jesus@omniti.com>
Reviewed by: Patrick Mooney <patrick.mooney@joyent.com>
Reviewed by: Robert Mustacchi <rm@joyent.com>
Reviewed by: Dan McDonald <danmcd@joyent.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/io/aggr/aggr_port.c
          +++ new/usr/src/uts/common/io/aggr/aggr_port.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   * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
  23   23   * Use is subject to license terms.
       24 + * Copyright 2012 OmniTI Computer Consulting, Inc  All rights reserved.
       25 + * Copyright 2018 Joyent, Inc.
  24   26   */
  25   27  
  26   28  /*
  27   29   * IEEE 802.3ad Link Aggregation - Link Aggregation MAC ports.
  28   30   *
  29   31   * Implements the functions needed to manage the MAC ports that are
  30   32   * part of Link Aggregation groups.
  31   33   */
  32   34  
  33   35  #include <sys/types.h>
↓ open down ↓ 332 lines elided ↑ open up ↑
 366  368                  if (link_duplex == LINK_DUPLEX_FULL)
 367  369                          do_attach |= (port->lp_link_duplex != LINK_DUPLEX_FULL);
 368  370                  else
 369  371                          do_detach |= (port->lp_link_duplex == LINK_DUPLEX_FULL);
 370  372          }
 371  373          port->lp_link_duplex = link_duplex;
 372  374  
 373  375          /* link speed changes? */
 374  376          ifspeed = aggr_port_stat(port, MAC_STAT_IFSPEED);
 375  377          if (port->lp_ifspeed != ifspeed) {
      378 +                mutex_enter(&grp->lg_stat_lock);
      379 +
 376  380                  if (port->lp_state == AGGR_PORT_STATE_ATTACHED)
 377  381                          do_detach |= (ifspeed != grp->lg_ifspeed);
 378  382                  else
 379  383                          do_attach |= (ifspeed == grp->lg_ifspeed);
      384 +
      385 +                mutex_exit(&grp->lg_stat_lock);
 380  386          }
 381  387          port->lp_ifspeed = ifspeed;
 382  388  
 383  389          if (do_attach) {
 384  390                  /* attempt to attach the port to the aggregation */
 385  391                  link_state_changed = aggr_grp_attach_port(grp, port);
 386  392          } else if (do_detach) {
 387  393                  /* detach the port from the aggregation */
 388  394                  link_state_changed = aggr_grp_detach_port(grp, port);
 389  395          }
↓ open down ↓ 131 lines elided ↑ open up ↑
 521  527          int rc;
 522  528  
 523  529          ASSERT(MAC_PERIM_HELD(port->lp_mh));
 524  530  
 525  531          if (on == port->lp_promisc_on)
 526  532                  /* already in desired promiscous mode */
 527  533                  return (0);
 528  534  
 529  535          if (on) {
 530  536                  mac_rx_clear(port->lp_mch);
      537 +
      538 +                /*
      539 +                 * We use the promisc callback because without hardware
      540 +                 * rings, we deliver through flows that will cause duplicate
      541 +                 * delivery of packets when we've flipped into this mode
      542 +                 * to compensate for the lack of hardware MAC matching
      543 +                 */
 531  544                  rc = mac_promisc_add(port->lp_mch, MAC_CLIENT_PROMISC_ALL,
 532      -                    aggr_recv_cb, port, &port->lp_mphp,
      545 +                    aggr_recv_promisc_cb, port, &port->lp_mphp,
 533  546                      MAC_PROMISC_FLAGS_NO_TX_LOOP);
 534  547                  if (rc != 0) {
 535  548                          mac_rx_set(port->lp_mch, aggr_recv_cb, port);
 536  549                          return (rc);
 537  550                  }
 538  551          } else {
 539  552                  mac_promisc_remove(port->lp_mphp);
 540  553                  port->lp_mphp = NULL;
 541  554                  mac_rx_set(port->lp_mch, aggr_recv_cb, port);
 542  555          }
↓ open down ↓ 128 lines elided ↑ open up ↑
 671  684                   */
 672  685                  *pprev = addr->aua_next;
 673  686                  kmem_free(addr, sizeof (aggr_unicst_addr_t));
 674  687                  if (port->lp_prom_addr == NULL && !grp->lg_promisc)
 675  688                          (void) aggr_port_promisc(port, B_FALSE);
 676  689          } else {
 677  690                  ASSERT(port->lp_hwgh != NULL);
 678  691                  (void) mac_hwgroup_remmac(port->lp_hwgh, mac_addr);
 679  692          }
 680  693          mac_perim_exit(pmph);
      694 +}
      695 +
      696 +int
      697 +aggr_port_addvlan(aggr_port_t *port, uint16_t vid)
      698 +{
      699 +        mac_perim_handle_t      pmph;
      700 +        int                     err;
      701 +
      702 +        ASSERT(MAC_PERIM_HELD(port->lp_grp->lg_mh));
      703 +        mac_perim_enter_by_mh(port->lp_mh, &pmph);
      704 +
      705 +        /*
      706 +         * Add the VLAN filter to the HW group if the port has a HW
      707 +         * group. If the port doesn't have a HW group, then it will
      708 +         * implicitly allow tagged traffic to pass and there is
      709 +         * nothing to do.
      710 +         */
      711 +        if (port->lp_hwgh == NULL)
      712 +                return (0);
      713 +
      714 +        err = mac_hwgroup_addvlan(port->lp_hwgh, vid);
      715 +        mac_perim_exit(pmph);
      716 +        return (err);
      717 +}
      718 +
      719 +int
      720 +aggr_port_remvlan(aggr_port_t *port, uint16_t vid)
      721 +{
      722 +        mac_perim_handle_t      pmph;
      723 +        int                     err;
      724 +
      725 +        ASSERT(MAC_PERIM_HELD(port->lp_grp->lg_mh));
      726 +        mac_perim_enter_by_mh(port->lp_mh, &pmph);
      727 +
      728 +        if (port->lp_hwgh == NULL)
      729 +                return (0);
      730 +
      731 +        err = mac_hwgroup_remvlan(port->lp_hwgh, vid);
      732 +        mac_perim_exit(pmph);
      733 +        return (err);
 681  734  }
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX