From: Tony Nguyen <anthony.l.nguyen@intel.com> Date: 2021-11-30 21:21:50
This series contains updates to iavf driver only.
Patryk adds a debug message when MTU is changed.
Grzegorz adds messaging when transitioning in and out of multicast
promiscuous mode.
Jake returns correct error codes for iavf_parse_cls_flower().
Jedrzej adds messaging for when the driver is removed and refactors
struct usage to take less memory. He also adjusts ethtool statistics to
only display information on active queues.
Tony allows for user to specify the RSS hash.
Karen resolves some static analysis warnings, corrects format specifiers,
and rewords a message to come across as informational.
---
v2:
- Dropped patch 1 (for net) and 5
- Change MTU message from info to debug
The following are changes since commit 196073f9c44be0b4758ead11e51bc2875f98df29:
net: ixp4xx_hss: drop kfree for memory allocated with devm_kzalloc
and are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue 40GbE
Grzegorz Szczurek (1):
iavf: Log info when VF is entering and leaving Allmulti mode
Jacob Keller (1):
iavf: return errno code instead of status code
Jedrzej Jagielski (3):
iavf: Add trace while removing device
iavf: Refactor iavf_mac_filter struct memory usage
iavf: Fix displaying queue statistics shown by ethtool
Karen Sornek (3):
iavf: Fix static code analysis warning
iavf: Refactor text of informational message
iavf: Refactor string format to avoid static analysis warnings
Patryk Małek (1):
iavf: Add change MTU message
Tony Nguyen (1):
iavf: Enable setting RSS hash key
drivers/net/ethernet/intel/iavf/iavf.h | 10 ++--
.../net/ethernet/intel/iavf/iavf_ethtool.c | 48 +++++++++++--------
drivers/net/ethernet/intel/iavf/iavf_main.c | 29 ++++++-----
drivers/net/ethernet/intel/iavf/iavf_txrx.c | 2 +-
.../net/ethernet/intel/iavf/iavf_virtchnl.c | 24 ++++++----
5 files changed, 69 insertions(+), 44 deletions(-)
--
2.31.1
From: Tony Nguyen <anthony.l.nguyen@intel.com> Date: 2021-11-30 21:21:44
From: Grzegorz Szczurek <redacted>
Add log when VF is entering and leaving Allmulti mode.
The change of VF state is visible in dmesg now.
Without this commit, entering and leaving Allmulti mode
is not logged in dmesg.
Signed-off-by: Grzegorz Szczurek <redacted>
Tested-by: George Kuruvinakunnel <redacted>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
.../net/ethernet/intel/iavf/iavf_virtchnl.c | 20 +++++++++++++------
1 file changed, 14 insertions(+), 6 deletions(-)
From: Tony Nguyen <anthony.l.nguyen@intel.com> Date: 2021-11-30 21:21:58
From: Jedrzej Jagielski <redacted>
Add kernel trace that device was removed.
Currently there is no such information.
I.e. Host admin removes a PCI device from a VM,
than on VM shall be info about the event.
This patch adds info log to iavf_remove function.
Signed-off-by: Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>
Signed-off-by: Jedrzej Jagielski <redacted>
Tested-by: Konrad Jankowski <redacted>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
drivers/net/ethernet/intel/iavf/iavf_main.c | 1 +
1 file changed, 1 insertion(+)
@@ -4000,6 +4000,7 @@ static void iavf_remove(struct pci_dev *pdev)if(iavf_lock_timeout(&adapter->crit_lock,5000))dev_warn(&adapter->pdev->dev,"failed to acquire crit_lock in %s\n",__FUNCTION__);+dev_info(&adapter->pdev->dev,"Removing device\n");/* Shut down all the garbage mashers on the detention level */iavf_change_state(adapter,__IAVF_REMOVE);adapter->aq_required=0;
From: Tony Nguyen <anthony.l.nguyen@intel.com> Date: 2021-11-30 21:22:08
Driver support for changing the RSS hash key exists, however, checks
have caused it to be reported as unsupported. Remove the check and
allow the hash key to be specified.
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Tested-by: Tony Brelinski <redacted>
---
drivers/net/ethernet/intel/iavf/iavf_ethtool.c | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
@@ -1919,19 +1919,21 @@ static int iavf_set_rxfh(struct net_device *netdev, const u32 *indir,structiavf_adapter*adapter=netdev_priv(netdev);u16i;-/* We do not allow change in unsupported parameters */-if(key||-(hfunc!=ETH_RSS_HASH_NO_CHANGE&&hfunc!=ETH_RSS_HASH_TOP))+/* Only support toeplitz hash function */+if(hfunc!=ETH_RSS_HASH_NO_CHANGE&&hfunc!=ETH_RSS_HASH_TOP)return-EOPNOTSUPP;-if(!indir)++if(!key&&!indir)return0;if(key)memcpy(adapter->rss_key,key,adapter->rss_key_size);-/* Each 32 bits pointed by 'indir' is stored with a lut entry */-for(i=0;i<adapter->rss_lut_size;i++)-adapter->rss_lut[i]=(u8)(indir[i]);+if(indir){+/* Each 32 bits pointed by 'indir' is stored with a lut entry */+for(i=0;i<adapter->rss_lut_size;i++)+adapter->rss_lut[i]=(u8)(indir[i]);+}returniavf_config_rss(adapter);}
@@ -1766,7 +1766,7 @@ int iavf_napi_poll(struct napi_struct *napi, int budget)if(likely(napi_complete_done(napi,work_done)))iavf_update_enable_itr(vsi,q_vector);-returnmin(work_done,budget-1);+returnmin_t(int,work_done,budget-1);}/**
From: Tony Nguyen <anthony.l.nguyen@intel.com> Date: 2021-11-30 21:22:39
From: Jedrzej Jagielski <redacted>
iavf_mac_filter struct contained couple boolean
flags using up more memory than is necessary.
Change the flags to be bitfields in an anonymous struct
so all the flags now fit in one byte.
Signed-off-by: Sylwester Dziedziuch <redacted>
Signed-off-by: Jedrzej Jagielski <redacted>
Tested-by: Konrad Jankowski <redacted>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
drivers/net/ethernet/intel/iavf/iavf.h | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
@@ -137,9 +137,13 @@ struct iavf_q_vector {structiavf_mac_filter{structlist_headlist;u8macaddr[ETH_ALEN];-boolis_new_mac;/* filter is new, wait for PF decision */-boolremove;/* filter needs to be removed */-booladd;/* filter needs to be added */+struct{+u8is_new_mac:1;/* filter is new, wait for PF decision */+u8remove:1;/* filter needs to be removed */+u8add:1;/* filter needs to be added */+u8is_primary:1;/* filter is a default VF MAC */+u8padding:4;+};};structiavf_vlan_filter{
From: Tony Nguyen <anthony.l.nguyen@intel.com> Date: 2021-11-30 21:22:42
From: Karen Sornek <redacted>
Change format to match variable type that is used in string.
Use %u format for unsigned variable and %d format for signed variable
to remove static analysis warnings.
Signed-off-by: Michal Swiatkowski <redacted>
Signed-off-by: Karen Sornek <redacted>
Tested-by: George Kuruvinakunnel <redacted>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
drivers/net/ethernet/intel/iavf/iavf_main.c | 6 +++---
drivers/net/ethernet/intel/iavf/iavf_virtchnl.c | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
From: Tony Nguyen <anthony.l.nguyen@intel.com> Date: 2021-11-30 21:22:47
From: Karen Sornek <redacted>
This message is intended to be informational to indicate a reset is about
to happen, but the use of "warning" in the message text can cause concern
with users. Reword the message to make it less alarming.
Signed-off-by: Bruce Allan <redacted>
Signed-off-by: Karen Sornek <redacted>
Tested-by: George Kuruvinakunnel <redacted>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
drivers/net/ethernet/intel/iavf/iavf_virtchnl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
@@ -1530,7 +1530,7 @@ void iavf_virtchnl_completion(struct iavf_adapter *adapter,iavf_print_link_message(adapter);break;caseVIRTCHNL_EVENT_RESET_IMPENDING:-dev_info(&adapter->pdev->dev,"Reset warning received from the PF\n");+dev_info(&adapter->pdev->dev,"Reset indication received from the PF\n");if(!(adapter->flags&IAVF_FLAG_RESET_PENDING)){adapter->flags|=IAVF_FLAG_RESET_PENDING;dev_info(&adapter->pdev->dev,"Scheduling reset task\n");
From: Tony Nguyen <anthony.l.nguyen@intel.com> Date: 2021-11-30 21:22:51
From: Jedrzej Jagielski <redacted>
Driver provided too many lines as an output to ethtool -S command.
Return actual length of string set of ethtool stats. Instead of predefined
maximal value use the actual value on netdev, iterate over active queues.
Without this patch, ethtool -S report would produce additional
erroneous lines of queues that are not configured.
Signed-off-by: Witold Fijalkowski <redacted>
Signed-off-by: Przemyslaw Patynowski <redacted>
Signed-off-by: Mateusz Palczewski <redacted>
Signed-off-by: Jedrzej Jagielski <redacted>
Tested-by: Konrad Jankowski <redacted>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
.../net/ethernet/intel/iavf/iavf_ethtool.c | 30 ++++++++++++-------
1 file changed, 19 insertions(+), 11 deletions(-)
@@ -331,9 +331,16 @@ static int iavf_get_link_ksettings(struct net_device *netdev,**/staticintiavf_get_sset_count(structnet_device*netdev,intsset){+/* Report the maximum number queues, even if not every queue is+*currentlyconfigured.Sinceallocationofqueuesisinpairs,+*usenetdev->real_num_tx_queues*2.Thereal_num_tx_queuesisset+*atdevicecreationandneverchanges.+*/+if(sset==ETH_SS_STATS)returnIAVF_STATS_LEN+-(IAVF_QUEUE_STATS_LEN*2*IAVF_MAX_REQ_QUEUES);+(IAVF_QUEUE_STATS_LEN*2*+netdev->real_num_tx_queues);elseif(sset==ETH_SS_PRIV_FLAGS)returnIAVF_PRIV_FLAGS_STR_LEN;else
@@ -360,17 +367,18 @@ static void iavf_get_ethtool_stats(struct net_device *netdev,iavf_add_ethtool_stats(&data,adapter,iavf_gstrings_stats);rcu_read_lock();-for(i=0;i<IAVF_MAX_REQ_QUEUES;i++){+/* As num_active_queues describe both tx and rx queues, we can use+*ittoiterateoverrings'stats.+*/+for(i=0;i<adapter->num_active_queues;i++){structiavf_ring*ring;-/* Avoid accessing un-allocated queues */-ring=(i<adapter->num_active_queues?-&adapter->tx_rings[i]:NULL);+/* Tx rings stats */+ring=&adapter->tx_rings[i];iavf_add_queue_stats(&data,ring);-/* Avoid accessing un-allocated queues */-ring=(i<adapter->num_active_queues?-&adapter->rx_rings[i]:NULL);+/* Rx rings stats */+ring=&adapter->rx_rings[i];iavf_add_queue_stats(&data,ring);}rcu_read_unlock();
@@ -407,10 +415,10 @@ static void iavf_get_stat_strings(struct net_device *netdev, u8 *data)iavf_add_stat_strings(&data,iavf_gstrings_stats);-/* Queues are always allocated in pairs, so we just use num_tx_queues-*forbothTxandRxqueues.+/* Queues are always allocated in pairs, so we just use+*real_num_tx_queuesforbothTxandRxqueues.*/-for(i=0;i<netdev->num_tx_queues;i++){+for(i=0;i<netdev->real_num_tx_queues;i++){iavf_add_stat_strings(&data,iavf_gstrings_queue_stats,"tx",i);iavf_add_stat_strings(&data,iavf_gstrings_queue_stats,
From: Tony Nguyen <anthony.l.nguyen@intel.com> Date: 2021-11-30 21:22:57
From: Jacob Keller <jacob.e.keller@intel.com>
The iavf_parse_cls_flower function returns an integer error code, and
not an iavf_status enumeration.
Fix the function to use the standard errno value EINVAL as its return
instead of using IAVF_ERR_CONFIG.
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Konrad Jankowski <redacted>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
drivers/net/ethernet/intel/iavf/iavf_main.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
@@ -2979,7 +2979,7 @@ static int iavf_parse_cls_flower(struct iavf_adapter *adapter,}else{dev_err(&adapter->pdev->dev,"Bad ip dst mask 0x%08x\n",be32_to_cpu(match.mask->dst));-returnIAVF_ERR_CONFIG;+return-EINVAL;}}
@@ -2989,13 +2989,13 @@ static int iavf_parse_cls_flower(struct iavf_adapter *adapter,}else{dev_err(&adapter->pdev->dev,"Bad ip src mask 0x%08x\n",be32_to_cpu(match.mask->dst));-returnIAVF_ERR_CONFIG;+return-EINVAL;}}if(field_flags&IAVF_CLOUD_FIELD_TEN_ID){dev_info(&adapter->pdev->dev,"Tenant id not allowed for ip filter\n");-returnIAVF_ERR_CONFIG;+return-EINVAL;}if(match.key->dst){vf->mask.tcp_spec.dst_ip[0]|=cpu_to_be32(0xffffffff);
@@ -3016,7 +3016,7 @@ static int iavf_parse_cls_flower(struct iavf_adapter *adapter,if(ipv6_addr_any(&match.mask->dst)){dev_err(&adapter->pdev->dev,"Bad ipv6 dst mask 0x%02x\n",IPV6_ADDR_ANY);-returnIAVF_ERR_CONFIG;+return-EINVAL;}/* src and dest IPv6 address should not be LOOPBACK
@@ -3026,7 +3026,7 @@ static int iavf_parse_cls_flower(struct iavf_adapter *adapter,ipv6_addr_loopback(&match.key->src)){dev_err(&adapter->pdev->dev,"ipv6 addr should not be loopback\n");-returnIAVF_ERR_CONFIG;+return-EINVAL;}if(!ipv6_addr_any(&match.mask->dst)||!ipv6_addr_any(&match.mask->src))
@@ -3051,7 +3051,7 @@ static int iavf_parse_cls_flower(struct iavf_adapter *adapter,}else{dev_err(&adapter->pdev->dev,"Bad src port mask %u\n",be16_to_cpu(match.mask->src));-returnIAVF_ERR_CONFIG;+return-EINVAL;}}
@@ -3061,7 +3061,7 @@ static int iavf_parse_cls_flower(struct iavf_adapter *adapter,}else{dev_err(&adapter->pdev->dev,"Bad dst port mask %u\n",be16_to_cpu(match.mask->dst));-returnIAVF_ERR_CONFIG;+return-EINVAL;}}if(match.key->dst){
From: Tony Nguyen <anthony.l.nguyen@intel.com> Date: 2021-11-30 21:23:01
From: Patryk Małek <redacted>
Add a netdev_dbg log entry in case of a change of MTU so that user is
notified about this change in the same manner as in case of pf driver.
Signed-off-by: Patryk Małek <redacted>
Tested-by: George Kuruvinakunnel <redacted>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
drivers/net/ethernet/intel/iavf/iavf_main.c | 2 ++
1 file changed, 2 insertions(+)
@@ -3428,6 +3428,8 @@ static int iavf_change_mtu(struct net_device *netdev, int new_mtu){structiavf_adapter*adapter=netdev_priv(netdev);+netdev_dbg(netdev,"changing MTU from %d to %d\n",+netdev->mtu,new_mtu);netdev->mtu=new_mtu;if(CLIENT_ENABLED(adapter)){iavf_notify_client_l2_params(&adapter->vsi);
Hello:
This series was applied to netdev/net-next.git (master)
by Tony Nguyen [off-list ref]:
On Tue, 30 Nov 2021 13:19:54 -0800 you wrote:
This series contains updates to iavf driver only.
Patryk adds a debug message when MTU is changed.
Grzegorz adds messaging when transitioning in and out of multicast
promiscuous mode.
[...]