Print this page
13230 i40e has duplicate traffic when used with bhyve/snoop running

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/io/i40e/i40e_gld.c
          +++ new/usr/src/uts/common/io/i40e/i40e_gld.c
↓ open down ↓ 220 lines elided ↑ open up ↑
 221  221          struct i40e_hw *hw = &i40e->i40e_hw_space;
 222  222          int ret = 0, err = 0;
 223  223  
 224  224          mutex_enter(&i40e->i40e_general_lock);
 225  225          if (i40e->i40e_state & I40E_SUSPENDED) {
 226  226                  ret = ECANCELED;
 227  227                  goto done;
 228  228          }
 229  229  
 230  230  
      231 +#if 1
      232 +        /*
      233 +         * XXX KEBE SAYS try this from Linux...
      234 +         *
      235 +         * Their comment says:
      236 +         *
      237 +         * set defport ON for Main VSI instead of true promisc
      238 +         * this way we will get all unicast/multicast and VLAN
      239 +         * promisc behavior but will not get VF or VMDq traffic
      240 +         * replicated on the Main VSI.
      241 +         */
      242 +
      243 +        ret = on ? i40e_aq_set_default_vsi(hw, I40E_DEF_VSI_SEID(i40e), NULL) :
      244 +            i40e_aq_clear_default_vsi(hw, I40E_DEF_VSI_SEID(i40e), NULL);
      245 +        if (ret == I40E_SUCCESS)
      246 +                i40e->i40e_promisc_on = on;
      247 +        else
      248 +                err = EIO;
      249 +#else
 231  250          ret = i40e_aq_set_vsi_unicast_promiscuous(hw, I40E_DEF_VSI_SEID(i40e),
 232  251              on, NULL, B_FALSE);
 233  252          if (ret != I40E_SUCCESS) {
 234  253                  i40e_error(i40e, "failed to %s unicast promiscuity on "
 235  254                      "the default VSI: %d", on == B_TRUE ? "enable" : "disable",
 236  255                      ret);
 237  256                  err = EIO;
 238  257                  goto done;
 239  258          }
 240  259  
↓ open down ↓ 23 lines elided ↑ open up ↑
 264  283                          i40e_error(i40e, "failed to %s unicast promiscuity on "
 265  284                              "the default VSI after toggling multicast failed: "
 266  285                              "%d", on == B_TRUE ? "disable" : "enable", ret);
 267  286                  }
 268  287  
 269  288                  err = EIO;
 270  289                  goto done;
 271  290          } else {
 272  291                  i40e->i40e_promisc_on = on;
 273  292          }
      293 +#endif
 274  294  
 275  295  done:
 276  296          mutex_exit(&i40e->i40e_general_lock);
 277  297          return (err);
 278  298  }
 279  299  
 280  300  /*
 281  301   * See the big theory statement in i40e_main.c for multicast address management.
 282  302   */
 283  303  static int
↓ open down ↓ 1172 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX