i40e/i40evf updates
Subsystems (2)
cover i40e/i40evf updates
Carolyn Wyborny adds code to refactor tail_bump, adds support for HMC
resource and profile for X722 & adds support for ARP NS in X722.
Jacob Keller adds code to use alloc_workqueue instead of create_singlethread_workqueue.
Mitch Williams adds code to report link speed.
drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h | 61 ++++++++++++++++------ drivers/net/ethernet/intel/i40e/i40e_main.c | 3 +- drivers/net/ethernet/intel/i40e/i40e_txrx.c | 6 +-- .../net/ethernet/intel/i40evf/i40e_adminq_cmd.h | 61 ++++++++++++++++------ drivers/net/ethernet/intel/i40evf/i40e_txrx.c | 6 +-- drivers/net/ethernet/intel/i40evf/i40evf.h | 1 + drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c | 26 +++++++-- drivers/net/ethernet/intel/i40evf/i40evf_main.c | 3 +- .../net/ethernet/intel/i40evf/i40evf_virtchnl.c | 55 +++++++++++++++---- 9 files changed, 166 insertions(+), 56 deletions(-)
Signature · 1 line
2.4.11
PATCH 1/5 i40e: use alloc_workqueue instead of create_singlethread_workqueue
From: Jacob Keller <[email protected]>
Replace calls to create_singlethread_workqueue instead with alloc_workqueue as is style with other Intel drivers. This provides more control over workqueue creation, and allows explicit setting of the desired mode of operation. It also makes it more obvious that driver name constant is passed to a format "%s".
--- drivers/net/ethernet/intel/i40e/i40e_main.c | 3 ++- drivers/net/ethernet/intel/i40evf/i40evf_main.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_main.c +2 -1
@@ -11577,7 +11577,8 @@ static int __init i40e_init_module(void)* it can't be any worse than using the system workqueue which * was already single threaded */ - i40e_wq =create_singlethread_workqueue (i40e_driver_name); + i40e_wq =alloc_workqueue ("%s" ,WQ_UNBOUND |WQ_MEM_RECLAIM ,1 , + i40e_driver_name);if (!i40e_wq) {pr_err ("%s: Failed to create workqueue\n" , i40e_driver_name);return -ENOMEM ;
drivers/net/ethernet/intel/i40evf/i40evf_main.c +2 -1
@@ -2833,7 +2833,8 @@ static int __init i40evf_init_module(void)pr_info ("%s\n" , i40evf_copyright); - i40evf_wq =create_singlethread_workqueue (i40evf_driver_name); + i40evf_wq =alloc_workqueue ("%s" ,WQ_UNBOUND |WQ_MEM_RECLAIM ,1 , + i40evf_driver_name);if (!i40evf_wq) {pr_err ("%s: Failed to create workqueue\n" , i40evf_driver_name);return -ENOMEM ;
Signature · 1 line
2.4.11
PATCH 2/5 i40evf: report link speed
In reply to Bimmy PujariFrom: Mitch Williams <[email protected]>
The PF driver tells us the link speed, so do something with that information. Add link speed to log messages, and report speed through ethtool.
---
Testing Hints : Test reporting of link up/down and various speeds.
drivers/net/ethernet/intel/i40evf/i40evf.h | 1 + drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c | 26 ++++++++-- .../net/ethernet/intel/i40evf/i40evf_virtchnl.c | 55 ++++++++++++++++++---- 3 files changed, 70 insertions(+), 12 deletions(-)
drivers/net/ethernet/intel/i40evf/i40evf.h +1 -0
@@ -251,6 +251,7 @@ struct i40evf_adapter {struct work_struct watchdog_task;bool netdev_registered;bool link_up; +enum i40e_aq_link_speed link_speed;enum i40e_virtchnl_ops current_op;#define CLIENT_ENABLED (_a) ((_a)->vf_res ? \ (_a)->vf_res->vf_offload_flags & \
drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c +23 -3
@@ -74,13 +74,33 @@ static const struct i40evf_stats i40evf_gstrings_stats[] = {static int i40evf_get_settings (struct net_device *netdev,struct ethtool_cmd *ecmd) { -/* In the future the VF will be able to query the PF for -* some information - for now use a dummy value -*/ +struct i40evf_adapter *adapter =netdev_priv (netdev); + ecmd->supported =0 ; ecmd->autoneg =AUTONEG_DISABLE ; ecmd->transceiver =XCVR_DUMMY1 ; ecmd->port =PORT_NONE ; +/* Set speed and duplex */ +switch (adapter->link_speed) { +case I40E_LINK_SPEED_40GB : +ethtool_cmd_speed_set (ecmd,SPEED_40000 ); +break ; +case I40E_LINK_SPEED_20GB : +ethtool_cmd_speed_set (ecmd,SPEED_20000 ); +break ; +case I40E_LINK_SPEED_10GB : +ethtool_cmd_speed_set (ecmd,SPEED_10000 ); +break ; +case I40E_LINK_SPEED_1GB : +ethtool_cmd_speed_set (ecmd,SPEED_1000 ); +break ; +case I40E_LINK_SPEED_100MB : +ethtool_cmd_speed_set (ecmd,SPEED_100 ); +break ; +default : +break ; + } + ecmd->duplex =DUPLEX_FULL ;return 0 ; }
drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c +46 -9
67 lines not on this page · raw message
Signature · 1 line
2.4.11
PATCH 3/5 i40e: Add support for HMC resource and profile for X722
In reply to Bimmy PujariFrom: Carolyn Wyborny <[email protected]>
This patch adds support for HMC resource and profile cmds for X722 firmware.
--- drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h | 23 ++++++++++++++++++++++ .../net/ethernet/intel/i40evf/i40e_adminq_cmd.h | 23 ++++++++++++++++++++++ 2 files changed, 46 insertions(+)
drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h +23 -0
@@ -204,6 +204,11 @@ enum i40e_admin_queue_opc { i40e_aqc_opc_suspend_port_tx =0x041B , i40e_aqc_opc_resume_port_tx =0x041C , i40e_aqc_opc_configure_partition_bw =0x041D , +/* hmc */ + i40e_aqc_opc_query_hmc_resource_profile =0x0500 , + i40e_aqc_opc_set_hmc_resource_profile =0x0501 , + +/* phy commands*/ /* phy commands*/ i40e_aqc_opc_get_phy_abilities = 0x0600,
@@ -1582,6 +1587,24 @@ struct i40e_aqc_configure_partition_bw_data {I40E_CHECK_STRUCT_LEN (0x22 , i40e_aqc_configure_partition_bw_data); +/* Get and set the active HMC resource profile and status. +* (direct 0x0500) and (direct 0x0501) +*/ +struct i40e_aq_get_set_hmc_resource_profile { +u8 pm_profile; +u8 pe_vf_enabled; +u8 reserved[14 ]; +}; + +I40E_CHECK_CMD_LENGTH (i40e_aq_get_set_hmc_resource_profile); + +enum i40e_aq_hmc_profile { +/* I40E_HMC_PROFILE_NO_CHANGE = 0, reserved */ +I40E_HMC_PROFILE_DEFAULT =1 , +I40E_HMC_PROFILE_FAVOR_VF =2 , +I40E_HMC_PROFILE_EQUAL =3 , +}; +/* Get PHY Abilities (indirect 0x0600) uses the generic indirect struct */ /* set in param0 for get phy abilities to report qualified modules */
drivers/net/ethernet/intel/i40evf/i40e_adminq_cmd.h +23 -0
@@ -204,6 +204,11 @@ enum i40e_admin_queue_opc { i40e_aqc_opc_suspend_port_tx =0x041B , i40e_aqc_opc_resume_port_tx =0x041C , i40e_aqc_opc_configure_partition_bw =0x041D , +/* hmc */ + i40e_aqc_opc_query_hmc_resource_profile =0x0500 , + i40e_aqc_opc_set_hmc_resource_profile =0x0501 , + +/* phy commands*/ /* phy commands*/ i40e_aqc_opc_get_phy_abilities = 0x0600,
@@ -1579,6 +1584,24 @@ struct i40e_aqc_configure_partition_bw_data {I40E_CHECK_STRUCT_LEN (0x22 , i40e_aqc_configure_partition_bw_data); +/* Get and set the active HMC resource profile and status. +* (direct 0x0500) and (direct 0x0501) +*/ +struct i40e_aq_get_set_hmc_resource_profile { +u8 pm_profile; +u8 pe_vf_enabled; +u8 reserved[14 ]; +}; + +I40E_CHECK_CMD_LENGTH (i40e_aq_get_set_hmc_resource_profile); + +enum i40e_aq_hmc_profile { +/* I40E_HMC_PROFILE_NO_CHANGE = 0, reserved */ +I40E_HMC_PROFILE_DEFAULT =1 , +I40E_HMC_PROFILE_FAVOR_VF =2 , +I40E_HMC_PROFILE_EQUAL =3 , +}; +/* Get PHY Abilities (indirect 0x0600) uses the generic indirect struct */ /* set in param0 for get phy abilities to report qualified modules */
Signature · 1 line
2.4.11
PATCH 4/5 i40e: Add support for ARP NS in X722
In reply to Bimmy PujariFrom: Carolyn Wyborny <[email protected]>
This patch adds support and interface for supporting ARP NS proxy offload in firmware for X722.
--- drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h | 38 ++++++++++++---------- .../net/ethernet/intel/i40evf/i40e_adminq_cmd.h | 38 ++++++++++++---------- 2 files changed, 42 insertions(+), 34 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h +21 -17
@@ -455,13 +455,15 @@ I40E_CHECK_CMD_LENGTH(i40e_aqc_cppm_configuration);/* Set ARP Proxy command / response (indirect 0x0104) */ struct i40e_aqc_arp_proxy_data {__le16 command_flags; -#define I40E_AQ_ARP_INIT_IPV4 0x0008 -#define I40E_AQ_ARP_UNSUP_CTL 0x0010 -#define I40E_AQ_ARP_ENA 0x0020 -#define I40E_AQ_ARP_ADD_IPV4 0x0040 -#define I40E_AQ_ARP_DEL_IPV4 0x0080 +#define I40E_AQ_ARP_INIT_IPV4 0x0800 +#define I40E_AQ_ARP_UNSUP_CTL 0x1000 +#define I40E_AQ_ARP_ENA 0x2000 +#define I40E_AQ_ARP_ADD_IPV4 0x4000 +#define I40E_AQ_ARP_DEL_IPV4 0x8000__le16 table_id; -__le32 pfpm_proxyfc; +__le32 enabled_offloads; +#define I40E_AQ_ARP_DIRECTED_OFFLOAD_ENABLE 0x00000020 +#define I40E_AQ_ARP_OFFLOAD_ENABLE 0x00000800__le32 ip_addr;u8 mac_addr[6 ];u8 reserved[2 ];
@@ -476,17 +478,19 @@ struct i40e_aqc_ns_proxy_data {__le16 table_idx_ipv6_0;__le16 table_idx_ipv6_1;__le16 control; -#define I40E_AQ_NS_PROXY_ADD_0 0x0100 -#define I40E_AQ_NS_PROXY_DEL_0 0x0200 -#define I40E_AQ_NS_PROXY_ADD_1 0x0400 -#define I40E_AQ_NS_PROXY_DEL_1 0x0800 -#define I40E_AQ_NS_PROXY_ADD_IPV6_0 0x1000 -#define I40E_AQ_NS_PROXY_DEL_IPV6_0 0x2000 -#define I40E_AQ_NS_PROXY_ADD_IPV6_1 0x4000 -#define I40E_AQ_NS_PROXY_DEL_IPV6_1 0x8000 -#define I40E_AQ_NS_PROXY_COMMAND_SEQ 0x0001 -#define I40E_AQ_NS_PROXY_INIT_IPV6_TBL 0x0002 -#define I40E_AQ_NS_PROXY_INIT_MAC_TBL 0x0004 +#define I40E_AQ_NS_PROXY_ADD_0 0x0001 +#define I40E_AQ_NS_PROXY_DEL_0 0x0002 +#define I40E_AQ_NS_PROXY_ADD_1 0x0004 +#define I40E_AQ_NS_PROXY_DEL_1 0x0008 +#define I40E_AQ_NS_PROXY_ADD_IPV6_0 0x0010 +#define I40E_AQ_NS_PROXY_DEL_IPV6_0 0x0020 +#define I40E_AQ_NS_PROXY_ADD_IPV6_1 0x0040 +#define I40E_AQ_NS_PROXY_DEL_IPV6_1 0x0080 +#define I40E_AQ_NS_PROXY_COMMAND_SEQ 0x0100 +#define I40E_AQ_NS_PROXY_INIT_IPV6_TBL 0x0200 +#define I40E_AQ_NS_PROXY_INIT_MAC_TBL 0x0400 +#define I40E_AQ_NS_PROXY_OFFLOAD_ENABLE 0x0800 +#define I40E_AQ_NS_PROXY_DIRECTED_OFFLOAD_ENABLE 0x1000u8 mac_addr_0[6 ];u8 mac_addr_1[6 ];u8 local_mac_addr[6 ];
drivers/net/ethernet/intel/i40evf/i40e_adminq_cmd.h +21 -17
@@ -452,13 +452,15 @@ I40E_CHECK_CMD_LENGTH(i40e_aqc_cppm_configuration);/* Set ARP Proxy command / response (indirect 0x0104) */ struct i40e_aqc_arp_proxy_data {__le16 command_flags; -#define I40E_AQ_ARP_INIT_IPV4 0x0008 -#define I40E_AQ_ARP_UNSUP_CTL 0x0010 -#define I40E_AQ_ARP_ENA 0x0020 -#define I40E_AQ_ARP_ADD_IPV4 0x0040 -#define I40E_AQ_ARP_DEL_IPV4 0x0080 +#define I40E_AQ_ARP_INIT_IPV4 0x0800 +#define I40E_AQ_ARP_UNSUP_CTL 0x1000 +#define I40E_AQ_ARP_ENA 0x2000 +#define I40E_AQ_ARP_ADD_IPV4 0x4000 +#define I40E_AQ_ARP_DEL_IPV4 0x8000__le16 table_id; -__le32 pfpm_proxyfc; +__le32 enabled_offloads; +#define I40E_AQ_ARP_DIRECTED_OFFLOAD_ENABLE 0x00000020 +#define I40E_AQ_ARP_OFFLOAD_ENABLE 0x00000800__le32 ip_addr;u8 mac_addr[6 ];u8 reserved[2 ];
@@ -473,17 +475,19 @@ struct i40e_aqc_ns_proxy_data {__le16 table_idx_ipv6_0;__le16 table_idx_ipv6_1;__le16 control; -#define I40E_AQ_NS_PROXY_ADD_0 0x0100 -#define I40E_AQ_NS_PROXY_DEL_0 0x0200 -#define I40E_AQ_NS_PROXY_ADD_1 0x0400 -#define I40E_AQ_NS_PROXY_DEL_1 0x0800 -#define I40E_AQ_NS_PROXY_ADD_IPV6_0 0x1000 -#define I40E_AQ_NS_PROXY_DEL_IPV6_0 0x2000 -#define I40E_AQ_NS_PROXY_ADD_IPV6_1 0x4000 -#define I40E_AQ_NS_PROXY_DEL_IPV6_1 0x8000 -#define I40E_AQ_NS_PROXY_COMMAND_SEQ 0x0001 -#define I40E_AQ_NS_PROXY_INIT_IPV6_TBL 0x0002 -#define I40E_AQ_NS_PROXY_INIT_MAC_TBL 0x0004 +#define I40E_AQ_NS_PROXY_ADD_0 0x0001 +#define I40E_AQ_NS_PROXY_DEL_0 0x0002 +#define I40E_AQ_NS_PROXY_ADD_1 0x0004 +#define I40E_AQ_NS_PROXY_DEL_1 0x0008 +#define I40E_AQ_NS_PROXY_ADD_IPV6_0 0x0010 +#define I40E_AQ_NS_PROXY_DEL_IPV6_0 0x0020 +#define I40E_AQ_NS_PROXY_ADD_IPV6_1 0x0040 +#define I40E_AQ_NS_PROXY_DEL_IPV6_1 0x0080 +#define I40E_AQ_NS_PROXY_COMMAND_SEQ 0x0100 +#define I40E_AQ_NS_PROXY_INIT_IPV6_TBL 0x0200 +#define I40E_AQ_NS_PROXY_INIT_MAC_TBL 0x0400 +#define I40E_AQ_NS_PROXY_OFFLOAD_ENABLE 0x0800 +#define I40E_AQ_NS_PROXY_DIRECTED_OFFLOAD_ENABLE 0x1000u8 mac_addr_0[6 ];u8 mac_addr_1[6 ];u8 local_mac_addr[6 ];
Signature · 1 line
2.4.11
PATCH 5/5 i40e: refactor tail_bump check
In reply to Bimmy PujariFrom: Carolyn Wyborny <[email protected]>
This patch fixes usage of variable so that its not checked for NULL if there's no possiblity of it being NULL. Without this patch, static analysis tool complain. This patch fixes the problem by changing the wrapping of compat code.
--- drivers/net/ethernet/intel/i40e/i40e_txrx.c | 6 ++---- drivers/net/ethernet/intel/i40evf/i40e_txrx.c | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_txrx.c +2 -4
@@ -2849,10 +2849,9 @@ static inline void i40e_tx_map(struct i40e_ring *tx_ring, struct sk_buff *skb, I40E_TXD_QW1_CMD_SHIFT);/* notify HW of packet */ -if (!tail_bump) +if (!tail_bump) {prefetchw (tx_desc +1 ); - -if (tail_bump) { + }else {/* Force memory writes to complete before letting h/w * know there are new descriptors to fetch. (Only * applicable for weak-ordered memory model archs,
@@ -2861,7 +2860,6 @@ static inline void i40e_tx_map(struct i40e_ring *tx_ring, struct sk_buff *skb,wmb ();writel (i, tx_ring->tail); } -return ; dma_error:
drivers/net/ethernet/intel/i40evf/i40e_txrx.c +2 -4
@@ -2086,10 +2086,9 @@ static inline void i40evf_tx_map(struct i40e_ring *tx_ring, struct sk_buff *skb, I40E_TXD_QW1_CMD_SHIFT);/* notify HW of packet */ -if (!tail_bump) +if (!tail_bump) {prefetchw (tx_desc +1 ); - -if (tail_bump) { + }else {/* Force memory writes to complete before letting h/w * know there are new descriptors to fetch. (Only * applicable for weak-ordered memory model archs,
@@ -2098,7 +2097,6 @@ static inline void i40evf_tx_map(struct i40e_ring *tx_ring, struct sk_buff *skb,wmb ();writel (i, tx_ring->tail); } -return ; dma_error:
Signature · 1 line
2.4.11