iavf: Add waiting for response from PF in set mac
Subsystems (2)
PATCH v2 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.
---
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 | 123 +++++++++++++++--- .../net/ethernet/intel/iavf/iavf_virtchnl.c | 63 ++++++++- 3 files changed, 172 insertions(+), 21 deletions(-)
drivers/net/ethernet/intel/iavf/iavf.h +6 -1
@@ -143,7 +143,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; }; };
@@ -240,6 +241,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;
@@ -283,6 +285,7 @@ struct iavf_adapter {#define IAVF_FLAG_LEGACY_RX BIT(15)#define IAVF_FLAG_REINIT_ITR_NEEDED BIT(16)#define IAVF_FLAG_QUEUES_DISABLED BIT(17) +#define IAVF_FLAG_INITIAL_MAC_SET BIT(23)/* duplicates for common code */ #define IAVF_FLAG_DCB_ENABLED 0/* flags for admin queue service task */
@@ -550,6 +553,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 +105 -18
170 lines not on this page · raw message
drivers/net/ethernet/intel/iavf/iavf_virtchnl.c +61 -2
114 lines not on this page · raw message
Signature · 1 line
2.27.0
Jankowski
PATCH v2 1/1 iavf: Add waiting for response from PF in set mac
drivers/net/ethernet/intel/iavf/iavf.h
Quoted 34 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Mateusz Palczewski
Sent: Wednesday, January 26, 2022 1:25 PM
To: intel-wired-lan at lists.osuosl.org
Cc: Palczewski, Mateusz <[email protected]>; Sylwester Dziedziuch <[email protected]>
Subject: [Intel-wired-lan] [PATCH net-next v2] 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]>---
v2: Changed__IAVF_IN_CRITICAL_TASKtocrit_lock--- drivers/net/ethernet/intel/iavf/iavf.h | 7 +- drivers/net/ethernet/intel/iavf/iavf_main.c | 123 +++++++++++++++--- .../net/ethernet/intel/iavf/iavf_virtchnl.c | 63 ++++++++- 3 files changed, 172 insertions(+), 21 deletions(-)drivers/net/ethernet/intel/iavf/iavf.h +0
-0