iavf: Add waiting for response from PF in set mac
Subsystems (2)
PATCH v4 1/1 iavf: Add waiting for response from PF in set mac
Make iavf_set_mac synchronous by waiting for a response from a PF. Without this iavf_set_mac is always returning success even though set_mac can be rejected by a PF. This ensures that when set_mac exits netdev MAC is updated. This is needed for sending ARPs with correct MAC after changing VF's MAC. This is also needed by bonding module.
---
v4: Rewrited some code to avoid passing a value as a condition
v3: Resent the patch to apply to next-queue
v2: Changed __IAVF_IN_CRITICAL_TASK to crit_lock
--- drivers/net/ethernet/intel/iavf/iavf.h | 7 +- drivers/net/ethernet/intel/iavf/iavf_main.c | 127 +++++++++++++++--- .../net/ethernet/intel/iavf/iavf_virtchnl.c | 61 ++++++++- 3 files changed, 174 insertions(+), 21 deletions(-)
drivers/net/ethernet/intel/iavf/iavf.h +6 -1
@@ -146,7 +146,8 @@ struct iavf_mac_filter { u8 remove:1; /* filter needs to be removed */ u8 add:1; /* filter needs to be added */ u8 is_primary:1; /* filter is a default VF MAC */ - u8 padding:4; + u8 add_handled:1; /* received response for filter add */ + u8 padding:3; }; };
@@ -248,6 +249,7 @@ struct iavf_adapter {struct work_struct adminq_task;struct delayed_work client_task;wait_queue_head_t down_waitqueue; +wait_queue_head_t vc_waitqueue;struct iavf_q_vector *q_vectors;struct list_head vlan_filter_list;struct list_head mac_filter_list;
@@ -292,6 +294,7 @@ struct iavf_adapter {#define IAVF_FLAG_QUEUES_DISABLED BIT(17)#define IAVF_FLAG_SETUP_NETDEV_FEATURES BIT(18)#define IAVF_FLAG_REINIT_MSIX_NEEDED BIT(20) +#define IAVF_FLAG_INITIAL_MAC_SET BIT(23)/* duplicates for common code */ #define IAVF_FLAG_DCB_ENABLED 0/* flags for admin queue service task */
@@ -559,6 +562,8 @@ void iavf_enable_vlan_stripping_v2(struct iavf_adapter *adapter, u16 tpid);void iavf_disable_vlan_stripping_v2 (struct iavf_adapter *adapter,u16 tpid);void iavf_enable_vlan_insertion_v2 (struct iavf_adapter *adapter,u16 tpid);void iavf_disable_vlan_insertion_v2 (struct iavf_adapter *adapter,u16 tpid); +int iavf_replace_primary_mac (struct iavf_adapter *adapter, +const u8 *new_mac); void iavf_set_vlan_offload_features(struct iavf_adapter *adapter, netdev_features_t prev_features,
drivers/net/ethernet/intel/iavf/iavf_main.c +109 -18
174 lines not on this page · raw message
drivers/net/ethernet/intel/iavf/iavf_virtchnl.c +59 -2
106 lines not on this page · raw message
Signature · 1 line
2.27.0
Jankowski
PATCH v4 1/1 iavf: Add waiting for response from PF in set mac
drivers/net/ethernet/intel/iavf/iavf.h struct iavf_mac_filter {
Quoted 36 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Mateusz Palczewski
Sent: Friday, May 20, 2022 12:07 PM
To: intel-wired-lan at lists.osuosl.org
Cc: Sylwester Dziedziuch <[email protected]>
Subject: [Intel-wired-lan] [PATCH net-next v4] iavf: Add waiting for response from PF in set macMake
iavf_set_macsynchronous by waiting for a response from a PF. Without thisiavf_set_macis always returning success even thoughset_maccan be rejected by a PF.
This ensures that whenset_macexits netdev MAC is updated. This is needed for sending ARPs with correct MAC after changing VF's MAC. This is also needed by bonding module.Signed-off-by Sylwester Dziedziuch <[email protected]>Signed-off-by Mateusz Palczewski <[email protected]>---
v4: Rewrited some code to avoid passing a value as a condition
v3: Resent the patch to apply to next-queue
v2: Changed__IAVF_IN_CRITICAL_TASKtocrit_lock--- drivers/net/ethernet/intel/iavf/iavf.h | 7 +- drivers/net/ethernet/intel/iavf/iavf_main.c | 127 +++++++++++++++--- .../net/ethernet/intel/iavf/iavf_virtchnl.c | 61 ++++++++- 3 files changed, 174 insertions(+), 21 deletions(-)drivers/net/ethernet/intel/iavf/iavf.h +0
-0@@ -146,7 +146,8 @@ struct iavf_mac_filter {