Print this page
11493 aggr needs support for multiple pseudo rx groups
Portions contributed by: Dan McDonald <danmcd@joyent.com>
Reviewed by: Patrick Mooney <patrick.mooney@joyent.com>
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Reviewed by: Robert Mustacchi <rm@joyent.com>

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 ↓ 14 lines elided ↑ open up ↑
  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   24   * Copyright 2012 OmniTI Computer Consulting, Inc  All rights reserved.
       25 + * Copyright 2018 Joyent, Inc.
  25   26   */
  26   27  
  27   28  /*
  28   29   * IEEE 802.3ad Link Aggregation - Receive
  29   30   *
  30   31   * Implements the collector function.
  31   32   * Manages the RX resources exposed by a link aggregation group.
  32   33   */
  33   34  
  34   35  #include <sys/sysmacros.h>
↓ open down ↓ 14 lines elided ↑ open up ↑
  49   50                  aggr_pseudo_rx_ring_t   *ring = (aggr_pseudo_rx_ring_t *)mrh;
  50   51                  mac_rx_ring(lg_mh, ring->arr_rh, mp, ring->arr_gen);
  51   52          }
  52   53  }
  53   54  
  54   55  void
  55   56  aggr_recv_lacp(aggr_port_t *port, mac_resource_handle_t mrh, mblk_t *mp)
  56   57  {
  57   58          aggr_grp_t *grp = port->lp_grp;
  58   59  
  59      -        /* in promiscuous mode, send copy of packet up */
       60 +        /* In promiscuous mode, pass copy of packet up. */
  60   61          if (grp->lg_promisc) {
  61   62                  mblk_t *nmp = copymsg(mp);
  62   63  
  63   64                  if (nmp != NULL)
  64   65                          aggr_mac_rx(grp->lg_mh, mrh, nmp);
  65   66          }
  66   67  
  67   68          aggr_lacp_rx_enqueue(port, mp);
  68   69  }
  69   70  
  70   71  /*
  71   72   * Callback function invoked by MAC service module when packets are
  72   73   * made available by a MAC port, both in promisc_on mode and not.
  73   74   */
  74   75  /* ARGSUSED */
  75   76  static void
  76   77  aggr_recv_path_cb(void *arg, mac_resource_handle_t mrh, mblk_t *mp,
  77      -    boolean_t loopback, boolean_t promisc_path)
       78 +    boolean_t loopback)
  78   79  {
  79   80          aggr_port_t *port = (aggr_port_t *)arg;
  80   81          aggr_grp_t *grp = port->lp_grp;
  81   82  
  82      -        /*
  83      -         * In the case where lp_promisc_on has been turned on to
  84      -         * compensate for insufficient hardware MAC matching and
  85      -         * hardware rings are not in use we will fall back to
  86      -         * using flows for delivery which can result in duplicates
  87      -         * pushed up the stack. Only respect the chosen path.
  88      -         */
  89      -        if (port->lp_promisc_on != promisc_path) {
  90      -                freemsgchain(mp);
  91      -                return;
  92      -        }
  93      -
  94   83          if (grp->lg_lacp_mode == AGGR_LACP_OFF) {
  95   84                  aggr_mac_rx(grp->lg_mh, mrh, mp);
  96   85          } else {
  97   86                  mblk_t *cmp, *last, *head;
  98   87                  struct ether_header *ehp;
  99   88                  uint16_t sap;
 100   89  
 101   90                  /* filter out slow protocol packets (LACP & Marker) */
 102   91                  last = NULL;
 103   92                  head = cmp = mp;
↓ open down ↓ 64 lines elided ↑ open up ↑
 168  157                  }
 169  158                  if (head != NULL) {
 170  159                          if (port->lp_collector_enabled)
 171  160                                  aggr_mac_rx(grp->lg_mh, mrh, head);
 172  161                          else
 173  162                                  freemsgchain(head);
 174  163                  }
 175  164          }
 176  165  }
 177  166  
 178      -/* ARGSUSED */
 179  167  void
 180  168  aggr_recv_cb(void *arg, mac_resource_handle_t mrh, mblk_t *mp,
 181  169      boolean_t loopback)
 182  170  {
 183      -        aggr_recv_path_cb(arg, mrh, mp, loopback, B_FALSE);
 184      -}
 185      -
 186      -/* ARGSUSED */
 187      -void
 188      -aggr_recv_promisc_cb(void *arg, mac_resource_handle_t mrh, mblk_t *mp,
 189      -    boolean_t loopback)
 190      -{
 191      -        aggr_recv_path_cb(arg, mrh, mp, loopback, B_TRUE);
      171 +        aggr_recv_path_cb(arg, mrh, mp, loopback);
 192  172  }
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX