i40e: VF's promiscuous attribute is not kept
Subsystems (2)
PATCH 1/11 i40e: VF's promiscuous attribute is not kept
From: Grzegorz Siwik <[email protected]>
This patch fixes a bug where the promiscuous mode was not being kept when the VF switched to a new VLAN.
Now we are config two times a promiscuous mode when we switch VLAN. Without this change when we change VF VLAN we still receive all the packets from previous VLAN and only unicast from new VLAN.
--- .../ethernet/intel/i40e/i40e_virtchnl_pf.c | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+)
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +23 -0
@@ -4016,6 +4016,7 @@ int i40e_ndo_set_vf_port_vlan(struct net_device *netdev, int vf_id, {u16 vlanprio = vlan_id | (qos <<I40E_VLAN_PRIORITY_SHIFT );struct i40e_netdev_priv *np =netdev_priv (netdev); +bool allmulti = false, alluni = false;struct i40e_pf *pf = np->vsi->back;struct i40e_vsi *vsi;struct i40e_vf *vf;
@@ -4100,6 +4101,15 @@ int i40e_ndo_set_vf_port_vlan(struct net_device *netdev, int vf_id, }spin_unlock_bh (&vsi->mac_filter_hash_lock); + +/* disable promisc modes in case they were enabled */ + ret =i40e_config_vf_promiscuous_mode (vf, vf->lan_vsi_id, + allmulti, alluni); +if (ret) { +dev_err (&pf->pdev->dev,"Unable to config VF promiscuous mode\n" ); + goto error_pvid; + } +if (vlan_id || qos) ret =i40e_vsi_add_pvid (vsi, vlanprio);else
@@ -4126,6 +4136,12 @@ int i40e_ndo_set_vf_port_vlan(struct net_device *netdev, int vf_id,spin_unlock_bh (&vsi->mac_filter_hash_lock); +if (test_bit (I40E_VF_STATE_UC_PROMISC , &vf->vf_states)) + alluni = true; + +if (test_bit (I40E_VF_STATE_MC_PROMISC , &vf->vf_states)) + allmulti = true; +/* Schedule the worker thread to take care of applying changes */ i40e_service_event_schedule (vsi->back);
@@ -4138,6 +4154,13 @@ int i40e_ndo_set_vf_port_vlan(struct net_device *netdev, int vf_id,* default LAN MAC address. */ vf->port_vlan_id =le16_to_cpu (vsi->info.pvid); + + ret =i40e_config_vf_promiscuous_mode (vf, vsi->id, allmulti, alluni); +if (ret) { +dev_err (&pf->pdev->dev,"Unable to config vf promiscuous mode\n" ); + goto error_pvid; + } + ret =0 ; error_pvid:
Signature · 1 line
2.19.2
PATCH 2/11 i40e: add new pci id for X710/XXV710 N3000 cards
From: Aleksandr Loktionov <[email protected]>
New device ids are created to support X710/XXV710 N3000 cards.
--- drivers/net/ethernet/intel/i40e/i40e_common.c | 2 ++ drivers/net/ethernet/intel/i40e/i40e_devids.h | 2 ++ drivers/net/ethernet/intel/i40e/i40e_main.c | 2 ++ 3 files changed, 6 insertions(+)
drivers/net/ethernet/intel/i40e/i40e_common.c +2 -0
@@ -32,6 +32,8 @@ static i40e_status i40e_set_mac_type(struct i40e_hw *hw)case I40E_DEV_ID_20G_KR2_A :case I40E_DEV_ID_25G_B :case I40E_DEV_ID_25G_SFP28 : +case I40E_DEV_ID_X710_N3000 : +case I40E_DEV_ID_XXV710_N3000 : hw->mac.type =I40E_MAC_XL710 ;break ;case I40E_DEV_ID_KX_X722 :
drivers/net/ethernet/intel/i40e/i40e_devids.h +2 -0
@@ -5,6 +5,8 @@#define _I40E_DEVIDS_H_/* Device IDs */ +#define I40E_DEV_ID_X710_N3000 0x0CF8 +#define I40E_DEV_ID_XXV710_N3000 0x0D58#define I40E_DEV_ID_SFP_XL710 0x1572#define I40E_DEV_ID_QEMU 0x1574#define I40E_DEV_ID_KX_B 0x1580
drivers/net/ethernet/intel/i40e/i40e_main.c +2 -0
@@ -77,6 +77,8 @@ static const struct pci_device_id i40e_pci_tbl[] = { {PCI_VDEVICE(INTEL, I40E_DEV_ID_SFP_I_X722), 0}, {PCI_VDEVICE(INTEL, I40E_DEV_ID_20G_KR2), 0}, {PCI_VDEVICE(INTEL, I40E_DEV_ID_20G_KR2_A), 0}, + {PCI_VDEVICE(INTEL, I40E_DEV_ID_X710_N3000), 0}, + {PCI_VDEVICE(INTEL, I40E_DEV_ID_XXV710_N3000), 0}, {PCI_VDEVICE(INTEL, I40E_DEV_ID_25G_B), 0}, {PCI_VDEVICE(INTEL, I40E_DEV_ID_25G_SFP28), 0}, /* required last entry */
Signature · 1 line
2.19.2
Bowers
PATCH 2/11 i40e: add new pci id for X710/XXV710 N3000 cards
Quoted 12 lines
-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On Behalf Of Alice Michael
Sent: Friday, March 29, 2019 3:09 PM
To: Michael, Alice <[email protected]>; intel-wired- lan at lists.osuosl.org
Cc: Loktionov, Aleksandr <[email protected]>
Subject: [Intel-wired-lan] [next PATCH S4 02/11] i40e: add new pci id for X710/XXV710 N3000 cardsFrom: Aleksandr Loktionov <[email protected]>
Quoted 8 lines
New device ids are created to support X710/XXV710 N3000 cards.
Signed-off-by Aleksandr Loktionov <[email protected]>--- drivers/net/ethernet/intel/i40e/i40e_common.c | 2 ++ drivers/net/ethernet/intel/i40e/i40e_devids.h | 2 ++ drivers/net/ethernet/intel/i40e/i40e_main.c | 2 ++ 3 files changed, 6 insertions(+)
PATCH 3/11 i40e: Setting VF to VLAN 0 requires restart
In reply to Alice MichaelFrom: Grzegorz Siwik <[email protected]>
This patch fixes a bug where changing VLAN to 0 was not set until VF restart.
Now we are setting pvid info to 0 when we have to change VLAN to 0. Without this change when VF VLAN was changed to 0 nothing happened until VF restart. For changing to VLAN different than 0 it worked correctly.
--- drivers/net/ethernet/intel/i40e/i40e_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_main.c +2 -2
@@ -2970,9 +2970,9 @@ int i40e_vsi_add_pvid(struct i40e_vsi *vsi, u16 vid)**/ void i40e_vsi_remove_pvid (struct i40e_vsi *vsi) { -i40e_vlan_stripping_disable (vsi); - vsi->info.pvid =0 ; + +i40e_vlan_stripping_disable (vsi); }/**
Signature · 1 line
2.19.2
Bowers
PATCH 3/11 i40e: Setting VF to VLAN 0 requires restart
Quoted 14 lines
-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On Behalf Of Alice Michael
Sent: Friday, March 29, 2019 3:09 PM
To: Michael, Alice <[email protected]>; intel-wired-
lan at lists.osuosl.org
Cc: Siwik, Grzegorz <[email protected]>
Subject: [Intel-wired-lan] [next PATCH S4 03/11] i40e: Setting VF to VLAN 0 requires restartFrom: Grzegorz Siwik <[email protected]>
This patch fixes a bug where changing VLAN to 0 was not set until VF restart.
Quoted 8 lines
Now we are setting pvid info to 0 when we have to change VLAN to 0. Without this change when VF VLAN was changed to 0 nothing happened until VF restart. For changing to VLAN different than 0 it worked correctly.
Signed-off-by Grzegorz Siwik <[email protected]>--- drivers/net/ethernet/intel/i40e/i40e_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
PATCH 4/11 i40e: add functions stubs to support EEE
In reply to Alice MichaelFrom: Aleksandr Loktionov <[email protected]>
This patch adds functions stubs to support EEE on/off.
--- drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
drivers/net/ethernet/intel/i40e/i40e_ethtool.c +12 -0
@@ -5141,6 +5141,16 @@ static int i40e_get_module_eeprom(struct net_device *netdev,return 0 ; } +static int i40e_get_eee (struct net_device *netdev,struct ethtool_eee *edata) +{ +return -EOPNOTSUPP ; +} + +static int i40e_set_eee (struct net_device *netdev,struct ethtool_eee *edata) +{ +return -EOPNOTSUPP ; +} +static const struct ethtool_ops i40e_ethtool_ops = { .get_drvinfo = i40e_get_drvinfo, .get_regs_len = i40e_get_regs_len,
@@ -5162,6 +5172,8 @@ static const struct ethtool_ops i40e_ethtool_ops = { .set_rxnfc = i40e_set_rxnfc, .self_test = i40e_diag_test, .get_strings = i40e_get_strings, + .get_eee = i40e_get_eee, + .set_eee = i40e_set_eee, .set_phys_id = i40e_set_phys_id, .get_sset_count = i40e_get_sset_count, .get_ethtool_stats = i40e_get_ethtool_stats,
Signature · 1 line
2.19.2
Bowers
PATCH 4/11 i40e: add functions stubs to support EEE
Quoted 10 lines
-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On Behalf Of Alice Michael
Sent: Friday, March 29, 2019 3:09 PM
To: Michael, Alice <[email protected]>; intel-wired-
lan at lists.osuosl.org
Cc: Loktionov, Aleksandr <[email protected]>
Subject: [Intel-wired-lan] [next PATCH S4 04/11] i40e: add functions stubs to support EEE
Quoted 8 lines
From: Aleksandr Loktionov <[email protected]>
This patch adds functions stubs to support EEE on/off.
Signed-off-by Aleksandr Loktionov <[email protected]>--- drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
PATCH 5/11 i40e: fix wrapping around netif_set_real_num_tx_queues
In reply to Alice MichaelFrom: Jacob Keller <[email protected]>
After total number of queues are updated under heavy traffic with ethtool -L command, the driver may receive few skbuffs with queue_mapping value greater than new total number of queues causing kernel panic.
This fix flushes all skbs after netif_set_real_num_tx_queues call while reconfiguring total tx queues. This helps in avoiding skbs with invalid queue_mapping.
--- drivers/net/ethernet/intel/i40e/i40e_main.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/ethernet/intel/i40e/i40e_main.c +2 -0
@@ -8223,6 +8223,8 @@ int i40e_vsi_open(struct i40e_vsi *vsi)if (err) goto err_set_queues; +qdisc_reset_all_tx (vsi->netdev); + err =netif_set_real_num_rx_queues (vsi->netdev, vsi->num_queue_pairs);if (err)
Signature · 1 line
2.19.2
Bowers
PATCH 5/11 i40e: fix wrapping around netif_set_real_num_tx_queues
Quoted 15 lines
-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On Behalf Of Alice Michael
Sent: Friday, March 29, 2019 3:09 PM
To: Michael, Alice <[email protected]>; intel-wired-
lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next PATCH S4 05/11] i40e: fix wrapping aroundnetif_set_real_num_tx_queuesFrom: Jacob Keller <[email protected]>
After total number of queues are updated under heavy traffic with ethtool -L command, the driver may receive few skbuffs with
queue_mappingvalue greater than new total number of queues causing kernel panic.
Quoted 8 lines
This fix flushes all skbs after
netif_set_real_num_tx_queuescall while reconfiguring total tx queues. This helps in avoiding skbs with invalidqueue_mapping.Signed-off-by Jacob Keller <[email protected]>--- drivers/net/ethernet/intel/i40e/i40e_main.c | 2 ++ 1 file changed, 2 insertions(+)
PATCH 6/11 i40e: Fix the typo in adding 40GE KR4 mode
In reply to Alice MichaelFrom: Grzegorz Siwik <[email protected]>
This patch fixes the typo in I40E_CAP_PHY_TYPE mode link code. It was fixed by changing 40000baseLR4_Full to 40000baseKR4_Full
--- drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_ethtool.c +2 -2
@@ -549,9 +549,9 @@ static void i40e_phy_type_to_ethtool(struct i40e_pf *pf, }if (phy_types &I40E_CAP_PHY_TYPE_40GBASE_KR4 ) {ethtool_link_ksettings_add_link_mode (ks, supported, - 40000baseLR4_Full); + 40000baseKR4_Full);ethtool_link_ksettings_add_link_mode (ks, advertising, - 40000baseLR4_Full); + 40000baseKR4_Full); }if (phy_types &I40E_CAP_PHY_TYPE_20GBASE_KR2 ) { ethtool_link_ksettings_add_link_mode(ks, supported,
Signature · 1 line
2.19.2
Bowers
PATCH 6/11 i40e: Fix the typo in adding 40GE KR4 mode
Quoted 12 lines
-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On Behalf Of Alice Michael
Sent: Friday, March 29, 2019 3:09 PM
To: Michael, Alice <[email protected]>; intel-wired-
lan at lists.osuosl.org
Cc: Siwik, Grzegorz <[email protected]>
Subject: [Intel-wired-lan] [next PATCH S4 06/11] i40e: Fix the typo in adding 40GE KR4 modeFrom: Grzegorz Siwik <[email protected]>
Quoted 7 lines
This patch fixes the typo in
I40E_CAP_PHY_TYPEmode link code. It was fixed by changing 40000baseLR4_Full to 40000baseKR4_FullSigned-off-by Grzegorz Siwik <[email protected]>--- drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
PATCH 7/11 i40e: add num_vectors checker in iwarp handler
In reply to Alice MichaelFrom: Sergey Nemov <[email protected]>
Field num_vectors from struct virtchnl_iwarp_qvlist_info should not be larger than num_msix_vectors_vf in the hw struct. The iwarp uses the same set of vectors as the LAN VF driver.
--- drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +10 -0
@@ -442,6 +442,16 @@ static int i40e_config_iwarp_qvlist(struct i40e_vf *vf,u32 next_q_idx, next_q_type;u32 msix_vf, size; + msix_vf = pf->hw.func_caps.num_msix_vectors_vf; + +if (qvlist_info->num_vectors > msix_vf) { +dev_warn (&pf->pdev->dev, +"Incorrect number of iwarp vectors %u. Maximum %u allowed.\n" , + qvlist_info->num_vectors, + msix_vf); + goto err; + } + size =sizeof (struct virtchnl_iwarp_qvlist_info ) + (sizeof (struct virtchnl_iwarp_qv_info ) * (qvlist_info->num_vectors -1 ));
Signature · 1 line
2.19.2
Bowers
PATCH 7/11 i40e: add num_vectors checker in iwarp handler
Quoted 11 lines
-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On Behalf Of Alice Michael
Sent: Friday, March 29, 2019 3:09 PM
To: Michael, Alice <[email protected]>; intel-wired- lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next PATCH S4 07/11] i40e: addnum_vectorschecker in iwarp handlerFrom: Sergey Nemov <[email protected]>
Quoted 8 lines
Field
num_vectorsfrom structvirtchnl_iwarp_qvlist_infoshould not be larger thannum_msix_vectors_vfin the hw struct. The iwarp uses the same set of vectors as the LAN VF driver.Signed-off-by Sergey Nemov <[email protected]>--- drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
PATCH 8/11 i40e: Wrong truncation from u16 to u8
In reply to Alice MichaelFrom: Grzegorz Siwik <[email protected]>
In this patch fixed wrong truncation method from u16 to u8 during validation.
It was changed by changing u8 to u32 parameter in method declaration and arguments were changed to u32.
--- drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +1 -1
@@ -196,7 +196,7 @@ static inline bool i40e_vc_isvalid_queue_id(struct i40e_vf *vf, u16 vsi_id,* * check for the valid vector id **/ -static inline bool i40e_vc_isvalid_vector_id (struct i40e_vf *vf,u8 vector_id) +static inline bool i40e_vc_isvalid_vector_id (struct i40e_vf *vf,u32 vector_id) {struct i40e_pf *pf = vf->pf;
Signature · 1 line
2.19.2
Bowers
PATCH 8/11 i40e: Wrong truncation from u16 to u8
Quoted 14 lines
-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On Behalf Of Alice Michael
Sent: Friday, March 29, 2019 3:09 PM
To: Michael, Alice <[email protected]>; intel-wired-
lan at lists.osuosl.org
Cc: Siwik, Grzegorz <[email protected]>
Subject: [Intel-wired-lan] [next PATCH S4 08/11] i40e: Wrong truncation from u16 to u8From: Grzegorz Siwik <[email protected]>
In this patch fixed wrong truncation method from u16 to u8 during validation.
Quoted 7 lines
It was changed by changing u8 to u32 parameter in method declaration and arguments were changed to u32.
Signed-off-by Grzegorz Siwik <[email protected]>--- drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
PATCH 9/11 i40e: Add support for X710 B/P & SFP+ cards
In reply to Alice MichaelFrom: Aleksandr Loktionov <[email protected]>
New device ids are created to support X710 backplane and SFP+ cards.
This patch adds in i40e driver support for 2.5GbaseT and 5GbaseT speed. It's implemented by checking I40E_CAP_PHY_TYPE_2_5GBASE_T, I40E_CAP_PHY_TYPE_5GBASE_T bits from f/w and setting corresponding bits in ethtool link ksettings supported and advertising masks.
--- .../net/ethernet/intel/i40e/i40e_adminq_cmd.h | 12 +++++- drivers/net/ethernet/intel/i40e/i40e_common.c | 5 +++ drivers/net/ethernet/intel/i40e/i40e_devids.h | 3 ++ .../net/ethernet/intel/i40e/i40e_ethtool.c | 42 ++++++++++++++++++- drivers/net/ethernet/intel/i40e/i40e_main.c | 8 ++++ drivers/net/ethernet/intel/i40e/i40e_type.h | 6 +++ 6 files changed, 74 insertions(+), 2 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h +11 -1
@@ -1888,6 +1888,8 @@ enum i40e_aq_phy_type {I40E_PHY_TYPE_25GBASE_LR =0x22 ,I40E_PHY_TYPE_25GBASE_AOC =0x23 ,I40E_PHY_TYPE_25GBASE_ACC =0x24 , +I40E_PHY_TYPE_2_5GBASE_T =0x30 , +I40E_PHY_TYPE_5GBASE_T =0x31 ,I40E_PHY_TYPE_MAX ,I40E_PHY_TYPE_NOT_SUPPORTED_HIGH_TEMP =0xFD , I40E_PHY_TYPE_EMPTY = 0xFE,
@@ -1929,19 +1931,25 @@ enum i40e_aq_phy_type { BIT_ULL(I40E_PHY_TYPE_25GBASE_SR) | \ BIT_ULL(I40E_PHY_TYPE_25GBASE_LR) | \ BIT_ULL(I40E_PHY_TYPE_25GBASE_AOC) | \ - BIT_ULL(I40E_PHY_TYPE_25GBASE_ACC)) + BIT_ULL(I40E_PHY_TYPE_25GBASE_ACC) | \ + BIT_ULL(I40E_PHY_TYPE_2_5GBASE_T) | \ + BIT_ULL(I40E_PHY_TYPE_5GBASE_T)) +#define I40E_LINK_SPEED_2_5GB_SHIFT 0x0#define I40E_LINK_SPEED_100MB_SHIFT 0x1#define I40E_LINK_SPEED_1000MB_SHIFT 0x2#define I40E_LINK_SPEED_10GB_SHIFT 0x3#define I40E_LINK_SPEED_40GB_SHIFT 0x4#define I40E_LINK_SPEED_20GB_SHIFT 0x5#define I40E_LINK_SPEED_25GB_SHIFT 0x6 +#define I40E_LINK_SPEED_5GB_SHIFT 0x7enum i40e_aq_link_speed {I40E_LINK_SPEED_UNKNOWN =0 ,I40E_LINK_SPEED_100MB =BIT (I40E_LINK_SPEED_100MB_SHIFT ),I40E_LINK_SPEED_1GB =BIT (I40E_LINK_SPEED_1000MB_SHIFT ), +I40E_LINK_SPEED_2_5GB = (1 <<I40E_LINK_SPEED_2_5GB_SHIFT ), +I40E_LINK_SPEED_5GB = (1 <<I40E_LINK_SPEED_5GB_SHIFT ),I40E_LINK_SPEED_10GB =BIT (I40E_LINK_SPEED_10GB_SHIFT ),I40E_LINK_SPEED_40GB =BIT (I40E_LINK_SPEED_40GB_SHIFT ),I40E_LINK_SPEED_20GB =BIT (I40E_LINK_SPEED_20GB_SHIFT ),
@@ -1987,6 +1995,8 @@ struct i40e_aq_get_phy_abilities_resp {#define I40E_AQ_PHY_TYPE_EXT_25G_LR 0x08#define I40E_AQ_PHY_TYPE_EXT_25G_AOC 0x10#define I40E_AQ_PHY_TYPE_EXT_25G_ACC 0x20 +#define I40E_AQ_PHY_TYPE_EXT_2_5GBASE_T 0x40 +#define I40E_AQ_PHY_TYPE_EXT_5GBASE_T 0x80u8 fec_cfg_curr_mod_ext_info;#define I40E_AQ_ENABLE_FEC_KR 0x01#define I40E_AQ_ENABLE_FEC_RS 0x02
drivers/net/ethernet/intel/i40e/i40e_common.c +5 -0
@@ -28,6 +28,8 @@ static i40e_status i40e_set_mac_type(struct i40e_hw *hw)case I40E_DEV_ID_QSFP_C :case I40E_DEV_ID_10G_BASE_T :case I40E_DEV_ID_10G_BASE_T4 : +case I40E_DEV_ID_10G_B : +case I40E_DEV_ID_10G_SFP :case I40E_DEV_ID_20G_KR2 :case I40E_DEV_ID_20G_KR2_A :case I40E_DEV_ID_25G_B :
@@ -1151,6 +1153,8 @@ static enum i40e_media_type i40e_get_media_type(struct i40e_hw *hw)break ;case I40E_PHY_TYPE_100BASE_TX :case I40E_PHY_TYPE_1000BASE_T : +case I40E_PHY_TYPE_2_5GBASE_T : +case I40E_PHY_TYPE_5GBASE_T :case I40E_PHY_TYPE_10GBASE_T : media =I40E_MEDIA_TYPE_BASET ;break ;
@@ -4900,6 +4904,7 @@ i40e_status i40e_read_phy_register(struct i40e_hw *hw,break ;case I40E_DEV_ID_10G_BASE_T :case I40E_DEV_ID_10G_BASE_T4 : +case I40E_DEV_ID_10G_BASE_T_BC :case I40E_DEV_ID_10G_BASE_T_X722 :case I40E_DEV_ID_25G_B :case I40E_DEV_ID_25G_SFP28 :
drivers/net/ethernet/intel/i40e/i40e_devids.h +3 -0
@@ -20,6 +20,9 @@#define I40E_DEV_ID_10G_BASE_T4 0x1589#define I40E_DEV_ID_25G_B 0x158A#define I40E_DEV_ID_25G_SFP28 0x158B +#define I40E_DEV_ID_10G_BASE_T_BC 0x15FF +#define I40E_DEV_ID_10G_B 0x104F +#define I40E_DEV_ID_10G_SFP 0x104E#define I40E_DEV_ID_KX_X722 0x37CE#define I40E_DEV_ID_QSFP_X722 0x37CF#define I40E_DEV_ID_SFP_X722 0x37D0
drivers/net/ethernet/intel/i40e/i40e_ethtool.c +41 -1
89 lines not on this page · raw message
drivers/net/ethernet/intel/i40e/i40e_main.c +8 -0
@@ -69,6 +69,8 @@ static const struct pci_device_id i40e_pci_tbl[] = { {PCI_VDEVICE(INTEL, I40E_DEV_ID_QSFP_C), 0}, {PCI_VDEVICE(INTEL, I40E_DEV_ID_10G_BASE_T), 0}, {PCI_VDEVICE(INTEL, I40E_DEV_ID_10G_BASE_T4), 0}, + {PCI_VDEVICE(INTEL, I40E_DEV_ID_10G_SFP), 0}, + {PCI_VDEVICE(INTEL, I40E_DEV_ID_10G_B), 0}, {PCI_VDEVICE(INTEL, I40E_DEV_ID_KX_X722), 0}, {PCI_VDEVICE(INTEL, I40E_DEV_ID_QSFP_X722), 0}, {PCI_VDEVICE(INTEL, I40E_DEV_ID_SFP_X722), 0},
@@ -6516,6 +6518,12 @@ void i40e_print_link_message(struct i40e_vsi *vsi, bool isup)case I40E_LINK_SPEED_10GB : speed ="10 G" ;break ; +case I40E_LINK_SPEED_5GB : + speed ="5 G" ; +break ; +case I40E_LINK_SPEED_2_5GB : + speed ="2.5 G" ; +break ;case I40E_LINK_SPEED_1GB : speed ="1000 M" ;break ;
drivers/net/ethernet/intel/i40e/i40e_type.h +6 -0
@@ -252,6 +252,12 @@ struct i40e_phy_info { I40E_PHY_TYPE_OFFSET)#define I40E_CAP_PHY_TYPE_25GBASE_ACC BIT_ULL(I40E_PHY_TYPE_25GBASE_ACC + \ I40E_PHY_TYPE_OFFSET) +/* Offset for 2.5G/5G PHY Types value to bit number conversion */ +#define I40E_PHY_TYPE_OFFSET2 (-10) +#define I40E_CAP_PHY_TYPE_2_5GBASE_T BIT_ULL(I40E_PHY_TYPE_2_5GBASE_T + \ + I40E_PHY_TYPE_OFFSET2) +#define I40E_CAP_PHY_TYPE_5GBASE_T BIT_ULL(I40E_PHY_TYPE_5GBASE_T + \ + I40E_PHY_TYPE_OFFSET2)#define I40E_HW_CAP_MAX_GPIO 30/* Capabilities of a PF or a VF or the whole device */ struct i40e_hw_capabilities {
Signature · 1 line
2.19.2
Bowers
PATCH 9/11 i40e: Add support for X710 B/P & SFP+ cards
Quoted 21 lines
-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On Behalf Of Alice Michael
Sent: Friday, March 29, 2019 3:09 PM
To: Michael, Alice <[email protected]>; intel-wired-
lan at lists.osuosl.org
Cc: Loktionov, Aleksandr <[email protected]>
Subject: [Intel-wired-lan] [next PATCH S4 09/11] i40e: Add support for X710 B/P & SFP+ cardsFrom: Aleksandr Loktionov <[email protected]>
New device ids are created to support X710 backplane and SFP+ cards.
This patch adds in i40e driver support for 2.5GbaseT and 5GbaseT speed. It's implemented by checking
I40E_CAP_PHY_TYPE_2_5GBASE_T,I40E_CAP_PHY_TYPE_5GBASE_Tbits from f/w and setting corresponding bits in ethtool link ksettings supported and advertising masks.Signed-off-by Aleksandr Loktionov <[email protected]>Signed-off-by Alice Michael <[email protected]>
Quoted 8 lines
--- .../net/ethernet/intel/i40e/i40e_adminq_cmd.h | 12 +++++- drivers/net/ethernet/intel/i40e/i40e_common.c | 5 +++ drivers/net/ethernet/intel/i40e/i40e_devids.h | 3 ++ .../net/ethernet/intel/i40e/i40e_ethtool.c | 42 ++++++++++++++++++- drivers/net/ethernet/intel/i40e/i40e_main.c | 8 ++++ drivers/net/ethernet/intel/i40e/i40e_type.h | 6 +++ 6 files changed, 74 insertions(+), 2 deletions(-)
PATCH 10/11 i40e: missing input validation on VF message handling by the PF
In reply to Alice MichaelFrom: Martyna Szapar <[email protected]>
Patch is adding missing input validation on VF message handling by the PF to the functions with opcodes:
VIRTCHNL_OP_CONFIG_VSI_QUEUES = 6 VIRTCHNL_OP_CONFIG_IRQ_MAP = 7, VIRTCHNL_OP_DISABLE_QUEUES = 9, VIRTCHNL_OP_CONFIG_PROMISCUOUS_MODE = 14,
--- .../ethernet/intel/i40e/i40e_virtchnl_pf.c | 58 ++++++++++++++----- .../ethernet/intel/i40e/i40e_virtchnl_pf.h | 2 + 2 files changed, 46 insertions(+), 14 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +44 -14
@@ -2014,6 +2014,16 @@ static int i40e_vc_config_promiscuous_mode_msg(struct i40e_vf *vf, u8 *msg) goto err_out; } +if (info->flags >I40E_MAX_VF_PROMISC_FLAGS ) { + aq_ret =I40E_ERR_PARAM ; + goto err_out; + } + +if (!i40e_vc_isvalid_vsi_id (vf, info->vsi_id)) { + aq_ret =I40E_ERR_PARAM ; + goto err_out; + } +/* Multicast promiscuous handling*/ if (info->flags &FLAG_VF_MULTICAST_PROMISC ) allmulti = true;
@@ -2068,17 +2078,16 @@ static int i40e_vc_config_queues_msg(struct i40e_vf *vf, u8 *msg)struct virtchnl_queue_pair_info *qpi;struct i40e_pf *pf = vf->pf;u16 vsi_id, vsi_queue_id =0 ; +u16 num_qps_all =0 ;i40e_status aq_ret =0 ;int i, j =0 , idx =0 ; - vsi_id = qci->vsi_id; -if (!test_bit (I40E_VF_STATE_ACTIVE , &vf->vf_states)) { aq_ret =I40E_ERR_PARAM ; goto error_param; } -if (!i40e_vc_isvalid_vsi_id (vf, vsi_id)) { +if (!i40e_vc_isvalid_vsi_id (vf, qci->vsi_id)) { aq_ret =I40E_ERR_PARAM ; goto error_param; }
@@ -2088,10 +2097,27 @@ static int i40e_vc_config_queues_msg(struct i40e_vf *vf, u8 *msg) goto error_param; } +if (vf->adq_enabled) { +for (i =0 ; i <I40E_MAX_VF_VSI ; i++) + num_qps_all += vf->ch[i].num_qps; +if (num_qps_all != qci->num_queue_pairs) { + aq_ret =I40E_ERR_PARAM ; + goto error_param; + } + } + + vsi_id = qci->vsi_id; +for (i =0 ; i < qci->num_queue_pairs; i++) { qpi = &qci->qpair[i];if (!vf->adq_enabled) { +if (!i40e_vc_isvalid_queue_id (vf, vsi_id, + qpi->txq.queue_id)) { + aq_ret =I40E_ERR_PARAM ; + goto error_param; + } + vsi_queue_id = qpi->txq.queue_id; if (qpi->txq.vsi_id != qci->vsi_id ||
@@ -2102,10 +2128,8 @@ static int i40e_vc_config_queues_msg(struct i40e_vf *vf, u8 *msg) } } -if (!i40e_vc_isvalid_queue_id (vf, vsi_id, vsi_queue_id)) { - aq_ret =I40E_ERR_PARAM ; - goto error_param; - } +if (vf->adq_enabled) + vsi_id = vf->ch[idx].vsi_id; if (i40e_config_vsi_rx_queue(vf, vsi_id, vsi_queue_id, &qpi->rxq) ||
@@ -2129,7 +2153,6 @@ static int i40e_vc_config_queues_msg(struct i40e_vf *vf, u8 *msg) j++; vsi_queue_id++; } - vsi_id = vf->ch[idx].vsi_id; } }/* set vsi num_queue_pairs in use to num configured by VF */
@@ -2188,7 +2211,7 @@ static int i40e_vc_config_irq_map_msg(struct i40e_vf *vf, u8 *msg)struct virtchnl_irq_map_info *irqmap_info = (struct virtchnl_irq_map_info *)msg;struct virtchnl_vector_map *map; -u16 vsi_id, vector_id; +u16 vsi_id;i40e_status aq_ret =0 ;int i;
@@ -2197,16 +2220,21 @@ static int i40e_vc_config_irq_map_msg(struct i40e_vf *vf, u8 *msg) goto error_param; } +if (irqmap_info->num_vectors > + vf->pf->hw.func_caps.num_msix_vectors_vf) { + aq_ret =I40E_ERR_PARAM ; + goto error_param; + } +for (i =0 ; i < irqmap_info->num_vectors; i++) { map = &irqmap_info->vecmap[i]; - vector_id = map->vector_id; - vsi_id = map->vsi_id;/* validate msg params */ -if (!i40e_vc_isvalid_vector_id (vf, vector_id) || - !i40e_vc_isvalid_vsi_id (vf, vsi_id)) { +if (!i40e_vc_isvalid_vector_id (vf, map->vector_id) || + !i40e_vc_isvalid_vsi_id (vf, map->vsi_id)) { aq_ret =I40E_ERR_PARAM ; goto error_param; } + vsi_id = map->vsi_id;if (i40e_validate_queue_map (vf, vsi_id, map->rxq_map)) { aq_ret =I40E_ERR_PARAM ;
@@ -2354,7 +2382,9 @@ static int i40e_vc_disable_queues_msg(struct i40e_vf *vf, u8 *msg) goto error_param; } -if ((0 == vqs->rx_queues) && (0 == vqs->tx_queues)) { +if ((vqs->rx_queues ==0 && vqs->tx_queues ==0 ) || + vqs->rx_queues >I40E_MAX_VF_QUEUES || + vqs->tx_queues >I40E_MAX_VF_QUEUES ) { aq_ret =I40E_ERR_PARAM ; goto error_param; }
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h +2 -0
@@ -17,6 +17,8 @@#define I40E_VLAN_MASK 0xFFF#define I40E_PRIORITY_MASK 0xE000 +#define I40E_MAX_VF_PROMISC_FLAGS 3 +/* Various queue ctrls */ enum i40e_queue_ctrl {I40E_QUEUE_CTRL_UNKNOWN =0 ,
Signature · 1 line
2.19.2
Bowers
PATCH 10/11 i40e: missing input validation on VF message handling by the PF
Quoted 19 lines
-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On Behalf Of Alice Michael
Sent: Friday, March 29, 2019 3:09 PM
To: Michael, Alice <[email protected]>; intel-wired-
lan at lists.osuosl.org
Cc: Szapar, Martyna <[email protected]>
Subject: [Intel-wired-lan] [next PATCH S4 10/11] i40e: missing input validation on VF message handling by the PFFrom: Martyna Szapar <[email protected]>
Patch is adding missing input validation on VF message handling by the PF to the functions with opcodes:
VIRTCHNL_OP_CONFIG_VSI_QUEUES= 6VIRTCHNL_OP_CONFIG_IRQ_MAP= 7,VIRTCHNL_OP_DISABLE_QUEUES= 9,VIRTCHNL_OP_CONFIG_PROMISCUOUS_MODE= 14,
Quoted 5 lines
Signed-off-by Martyna Szapar <[email protected]>--- .../ethernet/intel/i40e/i40e_virtchnl_pf.c | 58 ++++++++++++++----- .../ethernet/intel/i40e/i40e_virtchnl_pf.h | 2 + 2 files changed, 46 insertions(+), 14 deletions(-)
PATCH 11/11 i40e: Revert ShadowRAM checksum calculation change
In reply to Alice MichaelFrom: Maciej Paczkowski <[email protected]>
The reason of this revert is unexpected issue found in NVM Update tool during NVM image downgrade. The implementation is no longer needed since the QV tools are already aware of new FW double ShadowRAM dump mechanism.
This patch reverts ShadowRAM checksum calculation change introduced in commit 9d12f0c4e436 ("i40e: Revert ShadowRAM checksum calculation change")
--- drivers/net/ethernet/intel/i40e/i40e_nvm.c | 28 +++------------------- 1 file changed, 3 insertions(+), 25 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_nvm.c +3 -25
@@ -574,36 +574,14 @@ static i40e_status i40e_calc_nvm_checksum(struct i40e_hw *hw,i40e_status i40e_update_nvm_checksum (struct i40e_hw *hw) {i40e_status ret_code; -u16 checksum, checksum_sr; +u16 checksum;__le16 le_sum; ret_code =i40e_calc_nvm_checksum (hw, &checksum); -if (ret_code) -return ret_code; - le_sum =cpu_to_le16 (checksum); - ret_code =i40e_write_nvm_aq (hw,0x00 ,I40E_SR_SW_CHECKSUM_WORD , -1 , &le_sum, true); -if (ret_code) -return ret_code; - -/* Due to changes in FW the SW is required to perform double SR-dump -* in some cases. SR-dump is the process when internal shadow RAM is -* dumped into flash bank. It is triggered by setting "last_command" -* argument in i40e_write_nvm_aq function call. -* Since FW 1.8 we need to calculate SR checksum again and update it -* in flash if it is not equal to previously computed checksum. -* This situation would occur only in FW >= 1.8 -*/ - ret_code =i40e_calc_nvm_checksum (hw, &checksum_sr); -if (ret_code) -return ret_code; -if (checksum_sr != checksum) { - le_sum =cpu_to_le16 (checksum_sr); - ret_code =i40e_write_nvm_aq (hw,0x00 , -I40E_SR_SW_CHECKSUM_WORD , +if (!ret_code) + ret_code =i40e_write_nvm_aq (hw,0x00 ,I40E_SR_SW_CHECKSUM_WORD ,1 , &le_sum, true); - }return ret_code; }
Signature · 1 line
2.19.2
Bowers
PATCH 11/11 i40e: Revert ShadowRAM checksum calculation change
Quoted 17 lines
-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On Behalf Of Alice Michael
Sent: Friday, March 29, 2019 3:09 PM
To: Michael, Alice <[email protected]>; intel-wired- lan at lists.osuosl.org
Cc: Paczkowski, Maciej <[email protected]>
Subject: [Intel-wired-lan] [next PATCH S4 11/11] i40e: Revert ShadowRAM checksum calculation changeFrom: Maciej Paczkowski <[email protected]>
The reason of this revert is unexpected issue found in NVM Update tool during NVM image downgrade. The implementation is no longer needed since the QV tools are already aware of new FW double ShadowRAM dump mechanism.
Quoted 8 lines
This patch reverts ShadowRAM checksum calculation change introduced in commit
9d12f0c4e436("i40e: Revert ShadowRAM checksum calculation change")Signed-off-by Maciej Paczkowski <[email protected]>--- drivers/net/ethernet/intel/i40e/i40e_nvm.c | 28 +++------------------- 1 file changed, 3 insertions(+), 25 deletions(-)
Bowers
PATCH 1/11 i40e: VF's promiscuous attribute is not kept
In reply to Alice MichaelQuoted 18 lines
-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On Behalf Of Alice Michael
Sent: Friday, March 29, 2019 3:09 PM
To: Michael, Alice <[email protected]>; intel-wired- lan at lists.osuosl.org
Cc: Siwik, Grzegorz <[email protected]>
Subject: [Intel-wired-lan] [next PATCH S4 01/11] i40e: VF's promiscuous attribute is not keptFrom: Grzegorz Siwik <[email protected]>
This patch fixes a bug where the promiscuous mode was not being kept when the VF switched to a new VLAN.
Now we are config two times a promiscuous mode when we switch VLAN. Without this change when we change VF VLAN we still receive all the packets from previous VLAN and only unicast from new VLAN.
Quoted 4 lines
Signed-off-by Grzegorz Siwik <[email protected]>--- .../ethernet/intel/i40e/i40e_virtchnl_pf.c | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+)