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


 359  *
 360  * -----------
 361  * Future Work
 362  * -----------
 363  *
 364  * At the moment the i40e_t driver is rather bare bones, allowing us to start
 365  * getting data flowing and folks using it while we develop additional features.
 366  * While bugs have been filed to cover this future work, the following gives an
 367  * overview of expected work:
 368  *
 369  *  o DMA binding and breaking up the locking in ring recycling.
 370  *  o Enhanced detection of device errors
 371  *  o Participation in IRM
 372  *  o FMA device reset
 373  *  o Stall detection, temperature error detection, etc.
 374  *  o More dynamic resource pools
 375  */
 376 
 377 #include "i40e_sw.h"
 378 
 379 static char i40e_ident[] = "Intel 10/40Gb Ethernet v1.0.3";
 380 
 381 /*
 382  * The i40e_glock primarily protects the lists below and the i40e_device_t
 383  * structures.
 384  */
 385 static kmutex_t i40e_glock;
 386 static list_t i40e_glist;
 387 static list_t i40e_dlist;
 388 
 389 /*
 390  * Access attributes for register mapping.
 391  */
 392 static ddi_device_acc_attr_t i40e_regs_acc_attr = {
 393         DDI_DEVICE_ATTR_V1,
 394         DDI_STRUCTURE_LE_ACC,
 395         DDI_STRICTORDER_ACC,
 396         DDI_FLAGERR_ACC
 397 };
 398 
 399 /*


2267             i40e->i40e_resources.ifr_nmacfilt_used);
2268 
2269         err = i40e_aq_remove_macvlan(hw, I40E_DEF_VSI_SEID(i40e), &filt, 1,
2270             NULL);
2271         if (err == I40E_SUCCESS) {
2272                 i40e_log(i40e,
2273                     "Removed L2 filter from Default VSI with SEID %u",
2274                     I40E_DEF_VSI_SEID(i40e));
2275         } else if (hw->aq.asq_last_status == ENOENT) {
2276                 i40e_log(i40e,
2277                     "No L2 filter for Default VSI with SEID %u",
2278                     I40E_DEF_VSI_SEID(i40e));
2279         } else {
2280                 i40e_error(i40e, "Failed to remove L2 filter from"
2281                     " Default VSI with SEID %u: %d (%d)",
2282                     I40E_DEF_VSI_SEID(i40e), err, hw->aq.asq_last_status);
2283 
2284                 return (B_FALSE);
2285         }
2286 





























2287         /*
2288          *  As mentioned above, the controller created an implicit L2
2289          *  filter for the primary MAC. We want to remove both the
2290          *  filter and decrement the filter count. However, not all
2291          *  controllers count this implicit filter against the total
2292          *  MAC filter count. So here we are making sure it is either
2293          *  one or zero. If it is one, then we know it is for the
2294          *  implicit filter and we should decrement since we just
2295          *  removed the filter above. If it is zero then we know the
2296          *  controller that does not count the implicit filter, and it
2297          *  was enough to just remove it; we leave the count alone.
2298          *  But if it is neither, then we have never seen a controller
2299          *  like this before and we should fail to attach.
2300          *
2301          *  It is unfortunate that this code must exist but the
2302          *  behavior of this implicit L2 filter and its corresponding
2303          *  count were dicovered through empirical testing. The
2304          *  programming manuals hint at this filter but do not
2305          *  explicitly call out the exact behavior.
2306          */




 359  *
 360  * -----------
 361  * Future Work
 362  * -----------
 363  *
 364  * At the moment the i40e_t driver is rather bare bones, allowing us to start
 365  * getting data flowing and folks using it while we develop additional features.
 366  * While bugs have been filed to cover this future work, the following gives an
 367  * overview of expected work:
 368  *
 369  *  o DMA binding and breaking up the locking in ring recycling.
 370  *  o Enhanced detection of device errors
 371  *  o Participation in IRM
 372  *  o FMA device reset
 373  *  o Stall detection, temperature error detection, etc.
 374  *  o More dynamic resource pools
 375  */
 376 
 377 #include "i40e_sw.h"
 378 
 379 static char i40e_ident[] = "Intel 10/40Gb Ethern0t v1.0.3";
 380 
 381 /*
 382  * The i40e_glock primarily protects the lists below and the i40e_device_t
 383  * structures.
 384  */
 385 static kmutex_t i40e_glock;
 386 static list_t i40e_glist;
 387 static list_t i40e_dlist;
 388 
 389 /*
 390  * Access attributes for register mapping.
 391  */
 392 static ddi_device_acc_attr_t i40e_regs_acc_attr = {
 393         DDI_DEVICE_ATTR_V1,
 394         DDI_STRUCTURE_LE_ACC,
 395         DDI_STRICTORDER_ACC,
 396         DDI_FLAGERR_ACC
 397 };
 398 
 399 /*


2267             i40e->i40e_resources.ifr_nmacfilt_used);
2268 
2269         err = i40e_aq_remove_macvlan(hw, I40E_DEF_VSI_SEID(i40e), &filt, 1,
2270             NULL);
2271         if (err == I40E_SUCCESS) {
2272                 i40e_log(i40e,
2273                     "Removed L2 filter from Default VSI with SEID %u",
2274                     I40E_DEF_VSI_SEID(i40e));
2275         } else if (hw->aq.asq_last_status == ENOENT) {
2276                 i40e_log(i40e,
2277                     "No L2 filter for Default VSI with SEID %u",
2278                     I40E_DEF_VSI_SEID(i40e));
2279         } else {
2280                 i40e_error(i40e, "Failed to remove L2 filter from"
2281                     " Default VSI with SEID %u: %d (%d)",
2282                     I40E_DEF_VSI_SEID(i40e), err, hw->aq.asq_last_status);
2283 
2284                 return (B_FALSE);
2285         }
2286 
2287 #if 0
2288         bzero(&filt, sizeof (filt));
2289         bcopy(hw->mac.port_addr, filt.mac_addr, ETHERADDRL);
2290         filt.flags = I40E_AQC_MACVLAN_DEL_PERFECT_MATCH |
2291             I40E_AQC_MACVLAN_DEL_IGNORE_VLAN;
2292         filt.vlan_tag = 0;
2293 
2294         ASSERT3U(i40e->i40e_resources.ifr_nmacfilt_used, <=, 1);
2295         i40e_log(i40e, "Num L2 filters (2nd try): %u",
2296             i40e->i40e_resources.ifr_nmacfilt_used);
2297 
2298         err = i40e_aq_remove_macvlan(hw, I40E_DEF_VSI_SEID(i40e), &filt, 1,
2299             NULL);
2300         if (err == I40E_SUCCESS) {
2301                 i40e_log(i40e,
2302                     "(2nd try) Removed L2 filter from Default VSI with SEID %u",
2303                     I40E_DEF_VSI_SEID(i40e));
2304         } else if (hw->aq.asq_last_status == ENOENT) {
2305                 i40e_log(i40e,
2306                     "(2nd try) No L2 filter for Default VSI with SEID %u",
2307                     I40E_DEF_VSI_SEID(i40e));
2308         } else {
2309                 i40e_error(i40e, "(2nd try) Failed to remove L2 filter from"
2310                     " Default VSI with SEID %u: %d (%d)",
2311                     I40E_DEF_VSI_SEID(i40e), err, hw->aq.asq_last_status);
2312 
2313                 return (B_FALSE);
2314         }
2315 #endif
2316         /*
2317          *  As mentioned above, the controller created an implicit L2
2318          *  filter for the primary MAC. We want to remove both the
2319          *  filter and decrement the filter count. However, not all
2320          *  controllers count this implicit filter against the total
2321          *  MAC filter count. So here we are making sure it is either
2322          *  one or zero. If it is one, then we know it is for the
2323          *  implicit filter and we should decrement since we just
2324          *  removed the filter above. If it is zero then we know the
2325          *  controller that does not count the implicit filter, and it
2326          *  was enough to just remove it; we leave the count alone.
2327          *  But if it is neither, then we have never seen a controller
2328          *  like this before and we should fail to attach.
2329          *
2330          *  It is unfortunate that this code must exist but the
2331          *  behavior of this implicit L2 filter and its corresponding
2332          *  count were dicovered through empirical testing. The
2333          *  programming manuals hint at this filter but do not
2334          *  explicitly call out the exact behavior.
2335          */