Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ static const char igb_driver_string[] =
static const char igb_copyright[] =
"Copyright (c) 2007-2013 Intel Corporation.";

static DEFINE_PCI_DEVICE_TABLE(igb_pci_tbl) = {
const struct pci_device_id igb_pci_tbl[] = {
{ PCI_VDEVICE(INTEL, E1000_DEV_ID_I354_BACKPLANE_1GBPS) },
{ PCI_VDEVICE(INTEL, E1000_DEV_ID_I354_SGMII) },
{ PCI_VDEVICE(INTEL, E1000_DEV_ID_I354_BACKPLANE_2_5GBPS) },
Expand Down Expand Up @@ -195,7 +195,11 @@ static void igb_process_mdd_event(struct igb_adapter *);
#ifdef IFLA_VF_MAX
static int igb_ndo_set_vf_mac( struct net_device *netdev, int vf, u8 *mac);
static int igb_ndo_set_vf_vlan(struct net_device *netdev,
#ifdef HAVE_VF_VLAN_PROTO
int vf, u16 vlan, u8 qos, __be16 vlan_proto);
#else
int vf, u16 vlan, u8 qos);
#endif
#ifdef HAVE_VF_SPOOFCHK_CONFIGURE
static int igb_ndo_set_vf_spoofchk(struct net_device *netdev, int vf,
bool setting);
Expand Down Expand Up @@ -6411,14 +6415,24 @@ static void igb_set_vmvir(struct igb_adapter *adapter, u32 vid, u32 vf)
}

static int igb_ndo_set_vf_vlan(struct net_device *netdev,
#ifdef HAVE_VF_VLAN_PROTO
int vf, u16 vlan, u8 qos, __be16 vlan_proto)
#else
int vf, u16 vlan, u8 qos)
#endif
{
int err = 0;
struct igb_adapter *adapter = netdev_priv(netdev);

/* VLAN IDs accepted range 0-4094 */
if ((vf >= adapter->vfs_allocated_count) || (vlan > VLAN_VID_MASK-1) || (qos > 7))
return -EINVAL;

#ifdef HAVE_VF_VLAN_PROTO
if (vlan_proto != htons(ETH_P_8021Q))
return -EPROTONOSUPPORT;
#endif

if (vlan || qos) {
err = igb_vlvf_set(adapter, vlan, !!vlan, vf);
if (err)
Expand Down Expand Up @@ -6579,7 +6593,12 @@ static inline void igb_vf_reset(struct igb_adapter *adapter, u32 vf)
if (adapter->vf_data[vf].pf_vlan)
igb_ndo_set_vf_vlan(adapter->netdev, vf,
adapter->vf_data[vf].pf_vlan,
#ifdef HAVE_VF_VLAN_PROTO
adapter->vf_data[vf].pf_qos,
htons(ETH_P_8021Q));
#else
adapter->vf_data[vf].pf_qos);
#endif
else
igb_clear_vf_vfta(adapter, vf);
#endif
Expand Down
5 changes: 5 additions & 0 deletions lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h
Original file line number Diff line number Diff line change
Expand Up @@ -3915,4 +3915,9 @@ skb_set_hash(struct sk_buff *skb, __u32 hash, __always_unused int type)
/* ndo_bridge_getlink adds new filter_mask and vlan_fill parameters */
#define HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK_VLAN_FILL
#endif /* >= 4.2.0 */

#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(4,9,0) )
#define HAVE_VF_VLAN_PROTO
#endif /* >= 4.9.0 */

#endif /* _KCOMPAT_H_ */
2 changes: 1 addition & 1 deletion lib/librte_eal/linuxapp/kni/ethtool/ixgbe/ixgbe_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const char ixgbe_driver_version[] = DRV_VERSION;
* { Vendor ID, Device ID, SubVendor ID, SubDevice ID,
* Class, Class Mask, private data (not used) }
*/
DEFINE_PCI_DEVICE_TABLE(ixgbe_pci_tbl) = {
const struct pci_device_id ixgbe_pci_tbl[] = {
{PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82598)},
{PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82598AF_DUAL_PORT)},
{PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82598AF_SINGLE_PORT)},
Expand Down