Print this page
2869 duplicate packets with vnics over aggrs

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/io/aggr/aggr_recv.c
          +++ new/usr/src/uts/common/io/aggr/aggr_recv.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 2008 Sun Microsystems, Inc.  All rights reserved.
  23   23   * Use is subject to license terms.
       24 + * Copyright 2012 OmniTI Computer Consulting, Inc  All rights reserved.
  24   25   */
  25   26  
  26   27  /*
  27   28   * IEEE 802.3ad Link Aggregation - Receive
  28   29   *
  29   30   * Implements the collector function.
  30   31   * Manages the RX resources exposed by a link aggregation group.
  31   32   */
  32   33  
  33   34  #include <sys/sysmacros.h>
↓ open down ↓ 27 lines elided ↑ open up ↑
  61   62  
  62   63                  if (nmp != NULL)
  63   64                          aggr_mac_rx(grp->lg_mh, mrh, nmp);
  64   65          }
  65   66  
  66   67          aggr_lacp_rx_enqueue(port, mp);
  67   68  }
  68   69  
  69   70  /*
  70   71   * Callback function invoked by MAC service module when packets are
  71      - * made available by a MAC port.
       72 + * made available by a MAC port, both in promisc_on mode and not.
  72   73   */
  73   74  /* ARGSUSED */
  74      -void
  75      -aggr_recv_cb(void *arg, mac_resource_handle_t mrh, mblk_t *mp,
  76      -    boolean_t loopback)
       75 +static void
       76 +aggr_recv_path_cb(void *arg, mac_resource_handle_t mrh, mblk_t *mp,
       77 +    boolean_t loopback, boolean_t promisc_path)
  77   78  {
  78   79          aggr_port_t *port = (aggr_port_t *)arg;
  79   80          aggr_grp_t *grp = port->lp_grp;
  80   81  
       82 +        /* In the case where lp_promisc_on has been turned on to
       83 +         * compensate for insufficient hardware MAC matching and
       84 +         * hardware rings are not in use we will fall back to
       85 +         * using flows for delivery which can result in duplicates
       86 +         * pushed up the stack. Only respect the chosen path.
       87 +         */
       88 +        if (port->lp_promisc_on != promisc_path) {
       89 +                freemsgchain(mp);
       90 +                return;
       91 +        }
       92 +
  81   93          if (grp->lg_lacp_mode == AGGR_LACP_OFF) {
  82   94                  aggr_mac_rx(grp->lg_mh, mrh, mp);
  83   95          } else {
  84   96                  mblk_t *cmp, *last, *head;
  85   97                  struct ether_header *ehp;
  86   98                  uint16_t sap;
  87   99  
  88  100                  /* filter out slow protocol packets (LACP & Marker) */
  89  101                  last = NULL;
  90  102                  head = cmp = mp;
↓ open down ↓ 62 lines elided ↑ open up ↑
 153  165                                  cmp = cmp->b_next;
 154  166                          }
 155  167                  }
 156  168                  if (head != NULL) {
 157  169                          if (port->lp_collector_enabled)
 158  170                                  aggr_mac_rx(grp->lg_mh, mrh, head);
 159  171                          else
 160  172                                  freemsgchain(head);
 161  173                  }
 162  174          }
      175 +}
      176 +
      177 +/* ARGSUSED */
      178 +void
      179 +aggr_recv_cb(void *arg, mac_resource_handle_t mrh, mblk_t *mp,
      180 +    boolean_t loopback)
      181 +{
      182 +        aggr_recv_path_cb(arg, mrh, mp, loopback, B_FALSE);
      183 +}
      184 +
      185 +/* ARGSUSED */
      186 +void
      187 +aggr_recv_promisc_cb(void *arg, mac_resource_handle_t mrh, mblk_t *mp,
      188 +    boolean_t loopback)
      189 +{
      190 +        aggr_recv_path_cb(arg, mrh, mp, loopback, B_TRUE);
 163  191  }
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX