MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ngbe_clear_rar

Function ngbe_clear_rar

dpdk/drivers/net/ngbe/base/ngbe_hw.c:518–545  ·  view source on GitHub ↗

* ngbe_clear_rar - Remove Rx address register * @hw: pointer to hardware structure * @index: Receive address register to write * * Clears an ethernet address from a receive address register. **/

Source from the content-addressed store, hash-verified

516 * Clears an ethernet address from a receive address register.
517 **/
518s32 ngbe_clear_rar(struct ngbe_hw *hw, u32 index)
519{
520 u32 rar_high;
521 u32 rar_entries = hw->mac.num_rar_entries;
522
523 /* Make sure we are using a valid rar index range */
524 if (index >= rar_entries) {
525 DEBUGOUT("RAR index %d is out of range.", index);
526 return NGBE_ERR_INVALID_ARGUMENT;
527 }
528
529 /*
530 * Some parts put the VMDq setting in the extra RAH bits,
531 * so save everything except the lower 16 bits that hold part
532 * of the address and the address valid bit.
533 */
534 wr32(hw, NGBE_ETHADDRIDX, index);
535 rar_high = rd32(hw, NGBE_ETHADDRH);
536 rar_high &= ~(NGBE_ETHADDRH_AD_MASK | NGBE_ETHADDRH_VLD);
537
538 wr32(hw, NGBE_ETHADDRL, 0);
539 wr32(hw, NGBE_ETHADDRH, rar_high);
540
541 /* clear VMDq pool/queue selection for this RAR */
542 hw->mac.clear_vmdq(hw, index, BIT_MASK32);
543
544 return 0;
545}
546
547/**
548 * ngbe_init_rx_addrs - Initializes receive address filters.

Callers 1

ngbe_remove_rarFunction · 0.85

Calls 2

wr32Function · 0.70
rd32Function · 0.70

Tested by

no test coverage detected