mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-25 20:14:25 +08:00
ixgbe: Add PF support for VF promiscuous mode
This patch extends the xcast mailbox message to include support for unicast promiscuous mode. To allow a VF to enter this mode the PF must be in promiscuous mode. A later patch will add the support needed in the VF driver (ixgbevf) Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
This commit is contained in:
parent
41e544cdad
commit
07eea570ac
@ -159,6 +159,7 @@ enum ixgbevf_xcast_modes {
|
||||
IXGBEVF_XCAST_MODE_NONE = 0,
|
||||
IXGBEVF_XCAST_MODE_MULTI,
|
||||
IXGBEVF_XCAST_MODE_ALLMULTI,
|
||||
IXGBEVF_XCAST_MODE_PROMISC,
|
||||
};
|
||||
|
||||
struct vf_macvlans {
|
||||
|
@ -74,6 +74,7 @@ enum ixgbe_pfvf_api_rev {
|
||||
ixgbe_mbox_api_20, /* API version 2.0, solaris Phase1 VF driver */
|
||||
ixgbe_mbox_api_11, /* API version 1.1, linux/freebsd VF driver */
|
||||
ixgbe_mbox_api_12, /* API version 1.2, linux/freebsd VF driver */
|
||||
ixgbe_mbox_api_13, /* API version 1.3, linux/freebsd VF driver */
|
||||
/* This value should always be last */
|
||||
ixgbe_mbox_api_unknown, /* indicates that API version is not known */
|
||||
};
|
||||
|
@ -512,6 +512,7 @@ static s32 ixgbe_set_vf_lpe(struct ixgbe_adapter *adapter, u32 *msgbuf, u32 vf)
|
||||
switch (adapter->vfinfo[vf].vf_api) {
|
||||
case ixgbe_mbox_api_11:
|
||||
case ixgbe_mbox_api_12:
|
||||
case ixgbe_mbox_api_13:
|
||||
/*
|
||||
* Version 1.1 supports jumbo frames on VFs if PF has
|
||||
* jumbo frames enabled which means legacy VFs are
|
||||
@ -979,6 +980,7 @@ static int ixgbe_negotiate_vf_api(struct ixgbe_adapter *adapter,
|
||||
case ixgbe_mbox_api_10:
|
||||
case ixgbe_mbox_api_11:
|
||||
case ixgbe_mbox_api_12:
|
||||
case ixgbe_mbox_api_13:
|
||||
adapter->vfinfo[vf].vf_api = api;
|
||||
return 0;
|
||||
default:
|
||||
@ -1003,6 +1005,7 @@ static int ixgbe_get_vf_queues(struct ixgbe_adapter *adapter,
|
||||
case ixgbe_mbox_api_20:
|
||||
case ixgbe_mbox_api_11:
|
||||
case ixgbe_mbox_api_12:
|
||||
case ixgbe_mbox_api_13:
|
||||
break;
|
||||
default:
|
||||
return -1;
|
||||
@ -1042,8 +1045,13 @@ static int ixgbe_get_vf_reta(struct ixgbe_adapter *adapter, u32 *msgbuf, u32 vf)
|
||||
return -EPERM;
|
||||
|
||||
/* verify the PF is supporting the correct API */
|
||||
if (adapter->vfinfo[vf].vf_api != ixgbe_mbox_api_12)
|
||||
switch (adapter->vfinfo[vf].vf_api) {
|
||||
case ixgbe_mbox_api_13:
|
||||
case ixgbe_mbox_api_12:
|
||||
break;
|
||||
default:
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
|
||||
/* This mailbox command is supported (required) only for 82599 and x540
|
||||
* VFs which support up to 4 RSS queues. Therefore we will compress the
|
||||
@ -1069,8 +1077,13 @@ static int ixgbe_get_vf_rss_key(struct ixgbe_adapter *adapter,
|
||||
return -EPERM;
|
||||
|
||||
/* verify the PF is supporting the correct API */
|
||||
if (adapter->vfinfo[vf].vf_api != ixgbe_mbox_api_12)
|
||||
switch (adapter->vfinfo[vf].vf_api) {
|
||||
case ixgbe_mbox_api_13:
|
||||
case ixgbe_mbox_api_12:
|
||||
break;
|
||||
default:
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
|
||||
memcpy(rss_key, adapter->rss_key, sizeof(adapter->rss_key));
|
||||
|
||||
@ -1082,11 +1095,16 @@ static int ixgbe_update_vf_xcast_mode(struct ixgbe_adapter *adapter,
|
||||
{
|
||||
struct ixgbe_hw *hw = &adapter->hw;
|
||||
int xcast_mode = msgbuf[1];
|
||||
u32 vmolr, disable, enable;
|
||||
u32 vmolr, fctrl, disable, enable;
|
||||
|
||||
/* verify the PF is supporting the correct APIs */
|
||||
switch (adapter->vfinfo[vf].vf_api) {
|
||||
case ixgbe_mbox_api_12:
|
||||
/* promisc introduced in 1.3 version */
|
||||
if (xcast_mode == IXGBEVF_XCAST_MODE_PROMISC)
|
||||
return -EOPNOTSUPP;
|
||||
/* Fall threw */
|
||||
case ixgbe_mbox_api_13:
|
||||
break;
|
||||
default:
|
||||
return -EOPNOTSUPP;
|
||||
@ -1102,17 +1120,34 @@ static int ixgbe_update_vf_xcast_mode(struct ixgbe_adapter *adapter,
|
||||
|
||||
switch (xcast_mode) {
|
||||
case IXGBEVF_XCAST_MODE_NONE:
|
||||
disable = IXGBE_VMOLR_BAM | IXGBE_VMOLR_ROMPE | IXGBE_VMOLR_MPE;
|
||||
disable = IXGBE_VMOLR_BAM | IXGBE_VMOLR_ROMPE |
|
||||
IXGBE_VMOLR_MPE | IXGBE_VMOLR_UPE | IXGBE_VMOLR_VPE;
|
||||
enable = 0;
|
||||
break;
|
||||
case IXGBEVF_XCAST_MODE_MULTI:
|
||||
disable = IXGBE_VMOLR_MPE;
|
||||
disable = IXGBE_VMOLR_MPE | IXGBE_VMOLR_UPE | IXGBE_VMOLR_VPE;
|
||||
enable = IXGBE_VMOLR_BAM | IXGBE_VMOLR_ROMPE;
|
||||
break;
|
||||
case IXGBEVF_XCAST_MODE_ALLMULTI:
|
||||
disable = 0;
|
||||
disable = IXGBE_VMOLR_UPE | IXGBE_VMOLR_VPE;
|
||||
enable = IXGBE_VMOLR_BAM | IXGBE_VMOLR_ROMPE | IXGBE_VMOLR_MPE;
|
||||
break;
|
||||
case IXGBEVF_XCAST_MODE_PROMISC:
|
||||
if (hw->mac.type <= ixgbe_mac_82599EB)
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
fctrl = IXGBE_READ_REG(hw, IXGBE_FCTRL);
|
||||
if (!(fctrl & IXGBE_FCTRL_UPE)) {
|
||||
/* VF promisc requires PF in promisc */
|
||||
e_warn(drv,
|
||||
"Enabling VF promisc requires PF in promisc\n");
|
||||
return -EPERM;
|
||||
}
|
||||
|
||||
disable = 0;
|
||||
enable = IXGBE_VMOLR_BAM | IXGBE_VMOLR_ROMPE |
|
||||
IXGBE_VMOLR_MPE | IXGBE_VMOLR_UPE | IXGBE_VMOLR_VPE;
|
||||
break;
|
||||
default:
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
|
@ -1501,6 +1501,8 @@ enum {
|
||||
#define IXGBE_VT_CTL_POOL_MASK (0x3F << IXGBE_VT_CTL_POOL_SHIFT)
|
||||
|
||||
/* VMOLR bitmasks */
|
||||
#define IXGBE_VMOLR_UPE 0x00400000 /* unicast promiscuous */
|
||||
#define IXGBE_VMOLR_VPE 0x00800000 /* VLAN promiscuous */
|
||||
#define IXGBE_VMOLR_AUPE 0x01000000 /* accept untagged packets */
|
||||
#define IXGBE_VMOLR_ROMPE 0x02000000 /* accept packets in MTA tbl */
|
||||
#define IXGBE_VMOLR_ROPE 0x04000000 /* accept packets in UC tbl */
|
||||
|
Loading…
Reference in New Issue
Block a user