Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F164033610
D1660.id3413.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D1660.id3413.diff
View Options
Index: sys/dev/ixl/if_ixl.c
===================================================================
--- sys/dev/ixl/if_ixl.c
+++ sys/dev/ixl/if_ixl.c
@@ -397,6 +397,7 @@
u16 bus;
int error = 0;
#ifdef PCI_IOV
+ nvlist_t *pf_schema, *vf_schema;
int iov_error;
#endif
@@ -723,7 +724,11 @@
#ifdef PCI_IOV
/* SR-IOV is only supported when MSI-X is in use. */
if (pf->msix > 1) {
- iov_error = pci_iov_attach(dev, NULL, NULL);
+ pf_schema = pci_iov_schema_alloc_node();
+ vf_schema = pci_iov_schema_alloc_node();
+ pci_iov_schema_add_unicast_mac(vf_schema, "mac-addr", 0, NULL);
+
+ iov_error = pci_iov_attach(dev, pf_schema, vf_schema);
if (iov_error != 0)
device_printf(dev,
"Failed to initialize SR-IOV (error=%d)\n",
@@ -6628,6 +6633,8 @@
char sysctl_name[QUEUE_NAME_LEN];
struct ixl_pf *pf;
struct ixl_vf *vf;
+ const void *mac;
+ size_t size;
int error;
pf = device_get_softc(dev);
@@ -6644,6 +6651,12 @@
if (error != 0)
goto out;
+ if (nvlist_exists_binary(params, "mac-addr")) {
+ mac = nvlist_get_binary(params, "mac-addr", &size);
+ bcopy(mac, vf->mac, ETHER_ADDR_LEN);
+ } else
+ vf->vf_flags |= VF_FLAG_SET_MAC_CAP;
+
vf->vf_flags |= VF_FLAG_VLAN_CAP;
ixl_reset_vf(pf, vf);
Index: sys/dev/ixl/ixl.h
===================================================================
--- sys/dev/ixl/ixl.h
+++ sys/dev/ixl/ixl.h
@@ -46,7 +46,6 @@
#include <sys/malloc.h>
#include <sys/kernel.h>
#include <sys/module.h>
-#include <sys/nv.h>
#include <sys/sockio.h>
#include <sys/eventhandler.h>
@@ -91,6 +90,11 @@
#include <sys/smp.h>
#include <machine/smp.h>
+#ifdef PCI_IOV
+#include <sys/nv.h>
+#include <sys/iov_schema.h>
+#endif
+
#include "i40e_type.h"
#include "i40e_prototype.h"
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Jul 29, 3:19 AM (18 h, 32 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35662127
Default Alt Text
D1660.id3413.diff (1 KB)
Attached To
Mode
D1660: Add support for mac-addr parameter
Attached
Detach File
Event Timeline
Log In to Comment