aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/ice/ice_adapter.h
diff options
context:
space:
mode:
authorSergey Temerkhanov <[email protected]>2024-08-21 13:09:56 +0000
committerTony Nguyen <[email protected]>2024-10-01 18:11:38 +0000
commite800654e85b5b27966fc6493201f5f8cf658beb6 (patch)
tree775cfd551dfd6f21203905cdd0cf3819e7686e5e /drivers/net/ethernet/intel/ice/ice_adapter.h
parentice: Initial support for E825C hardware in ice_adapter (diff)
downloadkernel-e800654e85b5b27966fc6493201f5f8cf658beb6.tar.gz
kernel-e800654e85b5b27966fc6493201f5f8cf658beb6.zip
ice: Use ice_adapter for PTP shared data instead of auxdev
Use struct ice_adapter to hold shared PTP data and control PTP related actions instead of auxbus. This allows significant code simplification and faster access to the container fields used in the PTP support code. Move the PTP port list to the ice_adapter container to simplify the code and avoid race conditions which could occur due to the synchronous nature of the initialization/access and certain memory saving can be achieved by moving PTP data into the ice_adapter itself. Signed-off-by: Sergey Temerkhanov <[email protected]> Reviewed-by: Przemek Kitszel <[email protected]> Reviewed-by: Simon Horman <[email protected]> Tested-by: Pucha Himasekhar Reddy <[email protected]> (A Contingent worker at Intel) Signed-off-by: Tony Nguyen <[email protected]>
Diffstat (limited to 'drivers/net/ethernet/intel/ice/ice_adapter.h')
-rw-r--r--drivers/net/ethernet/intel/ice/ice_adapter.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/net/ethernet/intel/ice/ice_adapter.h b/drivers/net/ethernet/intel/ice/ice_adapter.h
index eb7cac01c242..e233225848b3 100644
--- a/drivers/net/ethernet/intel/ice/ice_adapter.h
+++ b/drivers/net/ethernet/intel/ice/ice_adapter.h
@@ -4,6 +4,7 @@
#ifndef _ICE_ADAPTER_H_
#define _ICE_ADAPTER_H_
+#include <linux/types.h>
#include <linux/spinlock_types.h>
#include <linux/refcount_types.h>
@@ -11,11 +12,26 @@ struct pci_dev;
struct ice_pf;
/**
+ * struct ice_port_list - data used to store the list of adapter ports
+ *
+ * This structure contains data used to maintain a list of adapter ports
+ *
+ * @ports: list of ports
+ * @lock: protect access to the ports list
+ */
+struct ice_port_list {
+ struct list_head ports;
+ /* To synchronize the ports list operations */
+ struct mutex lock;
+};
+
+/**
* struct ice_adapter - PCI adapter resources shared across PFs
* @ptp_gltsyn_time_lock: Spinlock protecting access to the GLTSYN_TIME
* register of the PTP clock.
* @refcount: Reference count. struct ice_pf objects hold the references.
* @ctrl_pf: Control PF of the adapter
+ * @ports: Ports list
*/
struct ice_adapter {
refcount_t refcount;
@@ -23,6 +39,7 @@ struct ice_adapter {
spinlock_t ptp_gltsyn_time_lock;
struct ice_pf *ctrl_pf;
+ struct ice_port_list ports;
};
struct ice_adapter *ice_adapter_get(const struct pci_dev *pdev);