FreeBSD Bugzilla – Attachment 222466 Details for
Bug 253535
em - VF interface invalid MAC address
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
em VF MAC address patch
if_em_vf_mac.patch (text/plain), 1.10 KB, created by
Balaev PA
on 2021-02-15 13:22:19 UTC
(
hide
)
Description:
em VF MAC address patch
Filename:
MIME Type:
Creator:
Balaev PA
Created:
2021-02-15 13:22:19 UTC
Size:
1.10 KB
patch
obsolete
>diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c >index b24280dae..7ca3e8645 100644 >--- a/sys/dev/e1000/if_em.c >+++ b/sys/dev/e1000/if_em.c >@@ -1065,11 +1065,21 @@ em_if_attach_pre(if_ctx_t ctx) > } > > if (!em_is_valid_ether_addr(hw->mac.addr)) { >- device_printf(dev, "Invalid MAC address\n"); >- error = EIO; >- goto err_late; >+ if (adapter->vf_ifp) { >+ u8 addr[ETHER_ADDR_LEN]; >+ device_printf(dev, "Generate a random address\n"); >+ arc4rand(&addr, sizeof(addr), 0); >+ addr[0] &= 0xFE; /* unicast */ >+ addr[0] |= 0x02; /* locally administrated */ >+ bcopy(addr, adapter->hw.mac.addr, sizeof(addr)); >+ } else { >+ device_printf(dev, "Invalid MAC address\n"); >+ error = EIO; >+ goto err_late; >+ } > } > >+ > /* Disable ULP support */ > e1000_disable_ulp_lpt_lp(hw, TRUE); > >@@ -1927,6 +1937,13 @@ em_identify_hardware(if_ctx_t ctx) > device_printf(dev, "Setup init failure\n"); > return; > } >+ >+ /* Are we a VF device? */ >+ if ((adapter->hw.mac.type == e1000_vfadapt) || >+ (adapter->hw.mac.type == e1000_vfadapt_i350)) >+ adapter->vf_ifp = 1; >+ else >+ adapter->vf_ifp = 0; > } > > static int
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 253535
: 222466