All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] iavf: delete unused iavf_mac_info fields
@ 2023-10-18 11:15 ` Michal Schmidt
  0 siblings, 0 replies; 12+ messages in thread
From: Michal Schmidt @ 2023-10-18 11:15 UTC (permalink / raw)
  To: intel-wired-lan
  Cc: Jacob Keller, Wojciech Drewek, Jesse Brandeburg, Tony Nguyen, netdev

'san_addr' and 'mac_fcoeq' members of struct iavf_mac_info are unused.
'type' is write-only. Delete all three.

The function iavf_set_mac_type that sets 'type' also checks if the PCI
vendor ID is Intel. This is unnecessary. Delete the whole function.

If in the future there's a need for the MAC type (or other PCI
ID-dependent data), I would prefer to use .driver_data in iavf_pci_tbl[]
for this purpose.

Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
---
 drivers/net/ethernet/intel/iavf/iavf_common.c | 32 -------------------
 drivers/net/ethernet/intel/iavf/iavf_main.c   |  5 ---
 .../net/ethernet/intel/iavf/iavf_prototype.h  |  2 --
 drivers/net/ethernet/intel/iavf/iavf_type.h   | 12 -------
 4 files changed, 51 deletions(-)

diff --git a/drivers/net/ethernet/intel/iavf/iavf_common.c b/drivers/net/ethernet/intel/iavf/iavf_common.c
index 1afd761d8052..8091e6feca01 100644
--- a/drivers/net/ethernet/intel/iavf/iavf_common.c
+++ b/drivers/net/ethernet/intel/iavf/iavf_common.c
@@ -6,38 +6,6 @@
 #include "iavf_prototype.h"
 #include <linux/avf/virtchnl.h>
 
-/**
- * iavf_set_mac_type - Sets MAC type
- * @hw: pointer to the HW structure
- *
- * This function sets the mac type of the adapter based on the
- * vendor ID and device ID stored in the hw structure.
- **/
-enum iavf_status iavf_set_mac_type(struct iavf_hw *hw)
-{
-	enum iavf_status status = 0;
-
-	if (hw->vendor_id == PCI_VENDOR_ID_INTEL) {
-		switch (hw->device_id) {
-		case IAVF_DEV_ID_X722_VF:
-			hw->mac.type = IAVF_MAC_X722_VF;
-			break;
-		case IAVF_DEV_ID_VF:
-		case IAVF_DEV_ID_VF_HV:
-		case IAVF_DEV_ID_ADAPTIVE_VF:
-			hw->mac.type = IAVF_MAC_VF;
-			break;
-		default:
-			hw->mac.type = IAVF_MAC_GENERIC;
-			break;
-		}
-	} else {
-		status = IAVF_ERR_DEVICE_NOT_SUPPORTED;
-	}
-
-	return status;
-}
-
 /**
  * iavf_aq_str - convert AQ err code to a string
  * @hw: pointer to the HW structure
diff --git a/drivers/net/ethernet/intel/iavf/iavf_main.c b/drivers/net/ethernet/intel/iavf/iavf_main.c
index 768bec67825a..c862ebcd2e39 100644
--- a/drivers/net/ethernet/intel/iavf/iavf_main.c
+++ b/drivers/net/ethernet/intel/iavf/iavf_main.c
@@ -2363,11 +2363,6 @@ static void iavf_startup(struct iavf_adapter *adapter)
 	/* driver loaded, probe complete */
 	adapter->flags &= ~IAVF_FLAG_PF_COMMS_FAILED;
 	adapter->flags &= ~IAVF_FLAG_RESET_PENDING;
-	status = iavf_set_mac_type(hw);
-	if (status) {
-		dev_err(&pdev->dev, "Failed to set MAC type (%d)\n", status);
-		goto err;
-	}
 
 	ret = iavf_check_reset_complete(hw);
 	if (ret) {
diff --git a/drivers/net/ethernet/intel/iavf/iavf_prototype.h b/drivers/net/ethernet/intel/iavf/iavf_prototype.h
index 940cb4203fbe..4a48e6171405 100644
--- a/drivers/net/ethernet/intel/iavf/iavf_prototype.h
+++ b/drivers/net/ethernet/intel/iavf/iavf_prototype.h
@@ -45,8 +45,6 @@ enum iavf_status iavf_aq_set_rss_lut(struct iavf_hw *hw, u16 seid,
 enum iavf_status iavf_aq_set_rss_key(struct iavf_hw *hw, u16 seid,
 				     struct iavf_aqc_get_set_rss_key_data *key);
 
-enum iavf_status iavf_set_mac_type(struct iavf_hw *hw);
-
 extern struct iavf_rx_ptype_decoded iavf_ptype_lookup[];
 
 static inline struct iavf_rx_ptype_decoded decode_rx_desc_ptype(u8 ptype)
diff --git a/drivers/net/ethernet/intel/iavf/iavf_type.h b/drivers/net/ethernet/intel/iavf/iavf_type.h
index 9f1f523807c4..2b6a207fa441 100644
--- a/drivers/net/ethernet/intel/iavf/iavf_type.h
+++ b/drivers/net/ethernet/intel/iavf/iavf_type.h
@@ -69,15 +69,6 @@ enum iavf_debug_mask {
  * the Firmware and AdminQ are intended to insulate the driver from most of the
  * future changes, but these structures will also do part of the job.
  */
-enum iavf_mac_type {
-	IAVF_MAC_UNKNOWN = 0,
-	IAVF_MAC_XL710,
-	IAVF_MAC_VF,
-	IAVF_MAC_X722,
-	IAVF_MAC_X722_VF,
-	IAVF_MAC_GENERIC,
-};
-
 enum iavf_vsi_type {
 	IAVF_VSI_MAIN	= 0,
 	IAVF_VSI_VMDQ1	= 1,
@@ -110,11 +101,8 @@ struct iavf_hw_capabilities {
 };
 
 struct iavf_mac_info {
-	enum iavf_mac_type type;
 	u8 addr[ETH_ALEN];
 	u8 perm_addr[ETH_ALEN];
-	u8 san_addr[ETH_ALEN];
-	u16 max_fcoeq;
 };
 
 /* PCI bus types */
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [Intel-wired-lan] [PATCH net-next] iavf: delete unused iavf_mac_info fields
@ 2023-10-18 11:15 ` Michal Schmidt
  0 siblings, 0 replies; 12+ messages in thread
From: Michal Schmidt @ 2023-10-18 11:15 UTC (permalink / raw)
  To: intel-wired-lan
  Cc: Jacob Keller, Tony Nguyen, Wojciech Drewek, Jesse Brandeburg, netdev

'san_addr' and 'mac_fcoeq' members of struct iavf_mac_info are unused.
'type' is write-only. Delete all three.

The function iavf_set_mac_type that sets 'type' also checks if the PCI
vendor ID is Intel. This is unnecessary. Delete the whole function.

If in the future there's a need for the MAC type (or other PCI
ID-dependent data), I would prefer to use .driver_data in iavf_pci_tbl[]
for this purpose.

Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
---
 drivers/net/ethernet/intel/iavf/iavf_common.c | 32 -------------------
 drivers/net/ethernet/intel/iavf/iavf_main.c   |  5 ---
 .../net/ethernet/intel/iavf/iavf_prototype.h  |  2 --
 drivers/net/ethernet/intel/iavf/iavf_type.h   | 12 -------
 4 files changed, 51 deletions(-)

diff --git a/drivers/net/ethernet/intel/iavf/iavf_common.c b/drivers/net/ethernet/intel/iavf/iavf_common.c
index 1afd761d8052..8091e6feca01 100644
--- a/drivers/net/ethernet/intel/iavf/iavf_common.c
+++ b/drivers/net/ethernet/intel/iavf/iavf_common.c
@@ -6,38 +6,6 @@
 #include "iavf_prototype.h"
 #include <linux/avf/virtchnl.h>
 
-/**
- * iavf_set_mac_type - Sets MAC type
- * @hw: pointer to the HW structure
- *
- * This function sets the mac type of the adapter based on the
- * vendor ID and device ID stored in the hw structure.
- **/
-enum iavf_status iavf_set_mac_type(struct iavf_hw *hw)
-{
-	enum iavf_status status = 0;
-
-	if (hw->vendor_id == PCI_VENDOR_ID_INTEL) {
-		switch (hw->device_id) {
-		case IAVF_DEV_ID_X722_VF:
-			hw->mac.type = IAVF_MAC_X722_VF;
-			break;
-		case IAVF_DEV_ID_VF:
-		case IAVF_DEV_ID_VF_HV:
-		case IAVF_DEV_ID_ADAPTIVE_VF:
-			hw->mac.type = IAVF_MAC_VF;
-			break;
-		default:
-			hw->mac.type = IAVF_MAC_GENERIC;
-			break;
-		}
-	} else {
-		status = IAVF_ERR_DEVICE_NOT_SUPPORTED;
-	}
-
-	return status;
-}
-
 /**
  * iavf_aq_str - convert AQ err code to a string
  * @hw: pointer to the HW structure
diff --git a/drivers/net/ethernet/intel/iavf/iavf_main.c b/drivers/net/ethernet/intel/iavf/iavf_main.c
index 768bec67825a..c862ebcd2e39 100644
--- a/drivers/net/ethernet/intel/iavf/iavf_main.c
+++ b/drivers/net/ethernet/intel/iavf/iavf_main.c
@@ -2363,11 +2363,6 @@ static void iavf_startup(struct iavf_adapter *adapter)
 	/* driver loaded, probe complete */
 	adapter->flags &= ~IAVF_FLAG_PF_COMMS_FAILED;
 	adapter->flags &= ~IAVF_FLAG_RESET_PENDING;
-	status = iavf_set_mac_type(hw);
-	if (status) {
-		dev_err(&pdev->dev, "Failed to set MAC type (%d)\n", status);
-		goto err;
-	}
 
 	ret = iavf_check_reset_complete(hw);
 	if (ret) {
diff --git a/drivers/net/ethernet/intel/iavf/iavf_prototype.h b/drivers/net/ethernet/intel/iavf/iavf_prototype.h
index 940cb4203fbe..4a48e6171405 100644
--- a/drivers/net/ethernet/intel/iavf/iavf_prototype.h
+++ b/drivers/net/ethernet/intel/iavf/iavf_prototype.h
@@ -45,8 +45,6 @@ enum iavf_status iavf_aq_set_rss_lut(struct iavf_hw *hw, u16 seid,
 enum iavf_status iavf_aq_set_rss_key(struct iavf_hw *hw, u16 seid,
 				     struct iavf_aqc_get_set_rss_key_data *key);
 
-enum iavf_status iavf_set_mac_type(struct iavf_hw *hw);
-
 extern struct iavf_rx_ptype_decoded iavf_ptype_lookup[];
 
 static inline struct iavf_rx_ptype_decoded decode_rx_desc_ptype(u8 ptype)
diff --git a/drivers/net/ethernet/intel/iavf/iavf_type.h b/drivers/net/ethernet/intel/iavf/iavf_type.h
index 9f1f523807c4..2b6a207fa441 100644
--- a/drivers/net/ethernet/intel/iavf/iavf_type.h
+++ b/drivers/net/ethernet/intel/iavf/iavf_type.h
@@ -69,15 +69,6 @@ enum iavf_debug_mask {
  * the Firmware and AdminQ are intended to insulate the driver from most of the
  * future changes, but these structures will also do part of the job.
  */
-enum iavf_mac_type {
-	IAVF_MAC_UNKNOWN = 0,
-	IAVF_MAC_XL710,
-	IAVF_MAC_VF,
-	IAVF_MAC_X722,
-	IAVF_MAC_X722_VF,
-	IAVF_MAC_GENERIC,
-};
-
 enum iavf_vsi_type {
 	IAVF_VSI_MAIN	= 0,
 	IAVF_VSI_VMDQ1	= 1,
@@ -110,11 +101,8 @@ struct iavf_hw_capabilities {
 };
 
 struct iavf_mac_info {
-	enum iavf_mac_type type;
 	u8 addr[ETH_ALEN];
 	u8 perm_addr[ETH_ALEN];
-	u8 san_addr[ETH_ALEN];
-	u16 max_fcoeq;
 };
 
 /* PCI bus types */
-- 
2.41.0

_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* RE: [PATCH net-next] iavf: delete unused iavf_mac_info fields
  2023-10-18 11:15 ` [Intel-wired-lan] " Michal Schmidt
@ 2023-10-18 11:25   ` Drewek, Wojciech
  -1 siblings, 0 replies; 12+ messages in thread
From: Drewek, Wojciech @ 2023-10-18 11:25 UTC (permalink / raw)
  To: mschmidt, intel-wired-lan
  Cc: Keller, Jacob E, Brandeburg, Jesse, Nguyen, Anthony L, netdev



> -----Original Message-----
> From: Michal Schmidt <mschmidt@redhat.com>
> Sent: Wednesday, October 18, 2023 1:15 PM
> To: intel-wired-lan@lists.osuosl.org
> Cc: Keller, Jacob E <jacob.e.keller@intel.com>; Drewek, Wojciech
> <wojciech.drewek@intel.com>; Brandeburg, Jesse
> <jesse.brandeburg@intel.com>; Nguyen, Anthony L
> <anthony.l.nguyen@intel.com>; netdev@vger.kernel.org
> Subject: [PATCH net-next] iavf: delete unused iavf_mac_info fields
> 
> 'san_addr' and 'mac_fcoeq' members of struct iavf_mac_info are unused.
> 'type' is write-only. Delete all three.
> 
> The function iavf_set_mac_type that sets 'type' also checks if the PCI
> vendor ID is Intel. This is unnecessary. Delete the whole function.
> 
> If in the future there's a need for the MAC type (or other PCI
> ID-dependent data), I would prefer to use .driver_data in iavf_pci_tbl[]
> for this purpose.
> 
> Signed-off-by: Michal Schmidt <mschmidt@redhat.com>

Reviewed-by: Wojciech Drewek <wojciech.drewek@intel.com>

Nice cleanup, I've seen similar unused fields in i40e as well.
Any plans for i40e cleanup?

> ---
>  drivers/net/ethernet/intel/iavf/iavf_common.c | 32 -------------------
>  drivers/net/ethernet/intel/iavf/iavf_main.c   |  5 ---
>  .../net/ethernet/intel/iavf/iavf_prototype.h  |  2 --
>  drivers/net/ethernet/intel/iavf/iavf_type.h   | 12 -------
>  4 files changed, 51 deletions(-)
> 
> diff --git a/drivers/net/ethernet/intel/iavf/iavf_common.c
> b/drivers/net/ethernet/intel/iavf/iavf_common.c
> index 1afd761d8052..8091e6feca01 100644
> --- a/drivers/net/ethernet/intel/iavf/iavf_common.c
> +++ b/drivers/net/ethernet/intel/iavf/iavf_common.c
> @@ -6,38 +6,6 @@
>  #include "iavf_prototype.h"
>  #include <linux/avf/virtchnl.h>
> 
> -/**
> - * iavf_set_mac_type - Sets MAC type
> - * @hw: pointer to the HW structure
> - *
> - * This function sets the mac type of the adapter based on the
> - * vendor ID and device ID stored in the hw structure.
> - **/
> -enum iavf_status iavf_set_mac_type(struct iavf_hw *hw)
> -{
> -	enum iavf_status status = 0;
> -
> -	if (hw->vendor_id == PCI_VENDOR_ID_INTEL) {
> -		switch (hw->device_id) {
> -		case IAVF_DEV_ID_X722_VF:
> -			hw->mac.type = IAVF_MAC_X722_VF;
> -			break;
> -		case IAVF_DEV_ID_VF:
> -		case IAVF_DEV_ID_VF_HV:
> -		case IAVF_DEV_ID_ADAPTIVE_VF:
> -			hw->mac.type = IAVF_MAC_VF;
> -			break;
> -		default:
> -			hw->mac.type = IAVF_MAC_GENERIC;
> -			break;
> -		}
> -	} else {
> -		status = IAVF_ERR_DEVICE_NOT_SUPPORTED;
> -	}
> -
> -	return status;
> -}
> -
>  /**
>   * iavf_aq_str - convert AQ err code to a string
>   * @hw: pointer to the HW structure
> diff --git a/drivers/net/ethernet/intel/iavf/iavf_main.c
> b/drivers/net/ethernet/intel/iavf/iavf_main.c
> index 768bec67825a..c862ebcd2e39 100644
> --- a/drivers/net/ethernet/intel/iavf/iavf_main.c
> +++ b/drivers/net/ethernet/intel/iavf/iavf_main.c
> @@ -2363,11 +2363,6 @@ static void iavf_startup(struct iavf_adapter
> *adapter)
>  	/* driver loaded, probe complete */
>  	adapter->flags &= ~IAVF_FLAG_PF_COMMS_FAILED;
>  	adapter->flags &= ~IAVF_FLAG_RESET_PENDING;
> -	status = iavf_set_mac_type(hw);
> -	if (status) {
> -		dev_err(&pdev->dev, "Failed to set MAC type (%d)\n",
> status);
> -		goto err;
> -	}
> 
>  	ret = iavf_check_reset_complete(hw);
>  	if (ret) {
> diff --git a/drivers/net/ethernet/intel/iavf/iavf_prototype.h
> b/drivers/net/ethernet/intel/iavf/iavf_prototype.h
> index 940cb4203fbe..4a48e6171405 100644
> --- a/drivers/net/ethernet/intel/iavf/iavf_prototype.h
> +++ b/drivers/net/ethernet/intel/iavf/iavf_prototype.h
> @@ -45,8 +45,6 @@ enum iavf_status iavf_aq_set_rss_lut(struct iavf_hw
> *hw, u16 seid,
>  enum iavf_status iavf_aq_set_rss_key(struct iavf_hw *hw, u16 seid,
>  				     struct iavf_aqc_get_set_rss_key_data *key);
> 
> -enum iavf_status iavf_set_mac_type(struct iavf_hw *hw);
> -
>  extern struct iavf_rx_ptype_decoded iavf_ptype_lookup[];
> 
>  static inline struct iavf_rx_ptype_decoded decode_rx_desc_ptype(u8 ptype)
> diff --git a/drivers/net/ethernet/intel/iavf/iavf_type.h
> b/drivers/net/ethernet/intel/iavf/iavf_type.h
> index 9f1f523807c4..2b6a207fa441 100644
> --- a/drivers/net/ethernet/intel/iavf/iavf_type.h
> +++ b/drivers/net/ethernet/intel/iavf/iavf_type.h
> @@ -69,15 +69,6 @@ enum iavf_debug_mask {
>   * the Firmware and AdminQ are intended to insulate the driver from most of
> the
>   * future changes, but these structures will also do part of the job.
>   */
> -enum iavf_mac_type {
> -	IAVF_MAC_UNKNOWN = 0,
> -	IAVF_MAC_XL710,
> -	IAVF_MAC_VF,
> -	IAVF_MAC_X722,
> -	IAVF_MAC_X722_VF,
> -	IAVF_MAC_GENERIC,
> -};
> -
>  enum iavf_vsi_type {
>  	IAVF_VSI_MAIN	= 0,
>  	IAVF_VSI_VMDQ1	= 1,
> @@ -110,11 +101,8 @@ struct iavf_hw_capabilities {
>  };
> 
>  struct iavf_mac_info {
> -	enum iavf_mac_type type;
>  	u8 addr[ETH_ALEN];
>  	u8 perm_addr[ETH_ALEN];
> -	u8 san_addr[ETH_ALEN];
> -	u16 max_fcoeq;
>  };
> 
>  /* PCI bus types */
> --
> 2.41.0


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Intel-wired-lan] [PATCH net-next] iavf: delete unused iavf_mac_info fields
@ 2023-10-18 11:25   ` Drewek, Wojciech
  0 siblings, 0 replies; 12+ messages in thread
From: Drewek, Wojciech @ 2023-10-18 11:25 UTC (permalink / raw)
  To: mschmidt, intel-wired-lan
  Cc: Keller, Jacob E, netdev, Nguyen, Anthony L, Brandeburg, Jesse



> -----Original Message-----
> From: Michal Schmidt <mschmidt@redhat.com>
> Sent: Wednesday, October 18, 2023 1:15 PM
> To: intel-wired-lan@lists.osuosl.org
> Cc: Keller, Jacob E <jacob.e.keller@intel.com>; Drewek, Wojciech
> <wojciech.drewek@intel.com>; Brandeburg, Jesse
> <jesse.brandeburg@intel.com>; Nguyen, Anthony L
> <anthony.l.nguyen@intel.com>; netdev@vger.kernel.org
> Subject: [PATCH net-next] iavf: delete unused iavf_mac_info fields
> 
> 'san_addr' and 'mac_fcoeq' members of struct iavf_mac_info are unused.
> 'type' is write-only. Delete all three.
> 
> The function iavf_set_mac_type that sets 'type' also checks if the PCI
> vendor ID is Intel. This is unnecessary. Delete the whole function.
> 
> If in the future there's a need for the MAC type (or other PCI
> ID-dependent data), I would prefer to use .driver_data in iavf_pci_tbl[]
> for this purpose.
> 
> Signed-off-by: Michal Schmidt <mschmidt@redhat.com>

Reviewed-by: Wojciech Drewek <wojciech.drewek@intel.com>

Nice cleanup, I've seen similar unused fields in i40e as well.
Any plans for i40e cleanup?

> ---
>  drivers/net/ethernet/intel/iavf/iavf_common.c | 32 -------------------
>  drivers/net/ethernet/intel/iavf/iavf_main.c   |  5 ---
>  .../net/ethernet/intel/iavf/iavf_prototype.h  |  2 --
>  drivers/net/ethernet/intel/iavf/iavf_type.h   | 12 -------
>  4 files changed, 51 deletions(-)
> 
> diff --git a/drivers/net/ethernet/intel/iavf/iavf_common.c
> b/drivers/net/ethernet/intel/iavf/iavf_common.c
> index 1afd761d8052..8091e6feca01 100644
> --- a/drivers/net/ethernet/intel/iavf/iavf_common.c
> +++ b/drivers/net/ethernet/intel/iavf/iavf_common.c
> @@ -6,38 +6,6 @@
>  #include "iavf_prototype.h"
>  #include <linux/avf/virtchnl.h>
> 
> -/**
> - * iavf_set_mac_type - Sets MAC type
> - * @hw: pointer to the HW structure
> - *
> - * This function sets the mac type of the adapter based on the
> - * vendor ID and device ID stored in the hw structure.
> - **/
> -enum iavf_status iavf_set_mac_type(struct iavf_hw *hw)
> -{
> -	enum iavf_status status = 0;
> -
> -	if (hw->vendor_id == PCI_VENDOR_ID_INTEL) {
> -		switch (hw->device_id) {
> -		case IAVF_DEV_ID_X722_VF:
> -			hw->mac.type = IAVF_MAC_X722_VF;
> -			break;
> -		case IAVF_DEV_ID_VF:
> -		case IAVF_DEV_ID_VF_HV:
> -		case IAVF_DEV_ID_ADAPTIVE_VF:
> -			hw->mac.type = IAVF_MAC_VF;
> -			break;
> -		default:
> -			hw->mac.type = IAVF_MAC_GENERIC;
> -			break;
> -		}
> -	} else {
> -		status = IAVF_ERR_DEVICE_NOT_SUPPORTED;
> -	}
> -
> -	return status;
> -}
> -
>  /**
>   * iavf_aq_str - convert AQ err code to a string
>   * @hw: pointer to the HW structure
> diff --git a/drivers/net/ethernet/intel/iavf/iavf_main.c
> b/drivers/net/ethernet/intel/iavf/iavf_main.c
> index 768bec67825a..c862ebcd2e39 100644
> --- a/drivers/net/ethernet/intel/iavf/iavf_main.c
> +++ b/drivers/net/ethernet/intel/iavf/iavf_main.c
> @@ -2363,11 +2363,6 @@ static void iavf_startup(struct iavf_adapter
> *adapter)
>  	/* driver loaded, probe complete */
>  	adapter->flags &= ~IAVF_FLAG_PF_COMMS_FAILED;
>  	adapter->flags &= ~IAVF_FLAG_RESET_PENDING;
> -	status = iavf_set_mac_type(hw);
> -	if (status) {
> -		dev_err(&pdev->dev, "Failed to set MAC type (%d)\n",
> status);
> -		goto err;
> -	}
> 
>  	ret = iavf_check_reset_complete(hw);
>  	if (ret) {
> diff --git a/drivers/net/ethernet/intel/iavf/iavf_prototype.h
> b/drivers/net/ethernet/intel/iavf/iavf_prototype.h
> index 940cb4203fbe..4a48e6171405 100644
> --- a/drivers/net/ethernet/intel/iavf/iavf_prototype.h
> +++ b/drivers/net/ethernet/intel/iavf/iavf_prototype.h
> @@ -45,8 +45,6 @@ enum iavf_status iavf_aq_set_rss_lut(struct iavf_hw
> *hw, u16 seid,
>  enum iavf_status iavf_aq_set_rss_key(struct iavf_hw *hw, u16 seid,
>  				     struct iavf_aqc_get_set_rss_key_data *key);
> 
> -enum iavf_status iavf_set_mac_type(struct iavf_hw *hw);
> -
>  extern struct iavf_rx_ptype_decoded iavf_ptype_lookup[];
> 
>  static inline struct iavf_rx_ptype_decoded decode_rx_desc_ptype(u8 ptype)
> diff --git a/drivers/net/ethernet/intel/iavf/iavf_type.h
> b/drivers/net/ethernet/intel/iavf/iavf_type.h
> index 9f1f523807c4..2b6a207fa441 100644
> --- a/drivers/net/ethernet/intel/iavf/iavf_type.h
> +++ b/drivers/net/ethernet/intel/iavf/iavf_type.h
> @@ -69,15 +69,6 @@ enum iavf_debug_mask {
>   * the Firmware and AdminQ are intended to insulate the driver from most of
> the
>   * future changes, but these structures will also do part of the job.
>   */
> -enum iavf_mac_type {
> -	IAVF_MAC_UNKNOWN = 0,
> -	IAVF_MAC_XL710,
> -	IAVF_MAC_VF,
> -	IAVF_MAC_X722,
> -	IAVF_MAC_X722_VF,
> -	IAVF_MAC_GENERIC,
> -};
> -
>  enum iavf_vsi_type {
>  	IAVF_VSI_MAIN	= 0,
>  	IAVF_VSI_VMDQ1	= 1,
> @@ -110,11 +101,8 @@ struct iavf_hw_capabilities {
>  };
> 
>  struct iavf_mac_info {
> -	enum iavf_mac_type type;
>  	u8 addr[ETH_ALEN];
>  	u8 perm_addr[ETH_ALEN];
> -	u8 san_addr[ETH_ALEN];
> -	u16 max_fcoeq;
>  };
> 
>  /* PCI bus types */
> --
> 2.41.0

_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH net-next] iavf: delete unused iavf_mac_info fields
  2023-10-18 11:25   ` [Intel-wired-lan] " Drewek, Wojciech
@ 2023-10-18 15:11     ` Michal Schmidt
  -1 siblings, 0 replies; 12+ messages in thread
From: Michal Schmidt @ 2023-10-18 15:11 UTC (permalink / raw)
  To: Drewek, Wojciech, Ivan Vecera
  Cc: intel-wired-lan, Keller, Jacob E, Brandeburg, Jesse, Nguyen,
	Anthony L, netdev

On Wed, Oct 18, 2023 at 1:26 PM Drewek, Wojciech
<wojciech.drewek@intel.com> wrote:
> > -----Original Message-----
> > From: Michal Schmidt <mschmidt@redhat.com>
> > Sent: Wednesday, October 18, 2023 1:15 PM
> > To: intel-wired-lan@lists.osuosl.org
> > Cc: Keller, Jacob E <jacob.e.keller@intel.com>; Drewek, Wojciech
> > <wojciech.drewek@intel.com>; Brandeburg, Jesse
> > <jesse.brandeburg@intel.com>; Nguyen, Anthony L
> > <anthony.l.nguyen@intel.com>; netdev@vger.kernel.org
> > Subject: [PATCH net-next] iavf: delete unused iavf_mac_info fields
> >
> > 'san_addr' and 'mac_fcoeq' members of struct iavf_mac_info are unused.
> > 'type' is write-only. Delete all three.
> >
> > The function iavf_set_mac_type that sets 'type' also checks if the PCI
> > vendor ID is Intel. This is unnecessary. Delete the whole function.
> >
> > If in the future there's a need for the MAC type (or other PCI
> > ID-dependent data), I would prefer to use .driver_data in iavf_pci_tbl[]
> > for this purpose.
> >
> > Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
>
> Reviewed-by: Wojciech Drewek <wojciech.drewek@intel.com>
>
> Nice cleanup, I've seen similar unused fields in i40e as well.
> Any plans for i40e cleanup?

No, I am not planning to look into i40e cleanups in the near future.
Ivan might want to do that though. [Adding him to the thread]
Michal

> > ---
> >  drivers/net/ethernet/intel/iavf/iavf_common.c | 32 -------------------
> >  drivers/net/ethernet/intel/iavf/iavf_main.c   |  5 ---
> >  .../net/ethernet/intel/iavf/iavf_prototype.h  |  2 --
> >  drivers/net/ethernet/intel/iavf/iavf_type.h   | 12 -------
> >  4 files changed, 51 deletions(-)
> >
> > diff --git a/drivers/net/ethernet/intel/iavf/iavf_common.c
> > b/drivers/net/ethernet/intel/iavf/iavf_common.c
> > index 1afd761d8052..8091e6feca01 100644
> > --- a/drivers/net/ethernet/intel/iavf/iavf_common.c
> > +++ b/drivers/net/ethernet/intel/iavf/iavf_common.c
> > @@ -6,38 +6,6 @@
> >  #include "iavf_prototype.h"
> >  #include <linux/avf/virtchnl.h>
> >
> > -/**
> > - * iavf_set_mac_type - Sets MAC type
> > - * @hw: pointer to the HW structure
> > - *
> > - * This function sets the mac type of the adapter based on the
> > - * vendor ID and device ID stored in the hw structure.
> > - **/
> > -enum iavf_status iavf_set_mac_type(struct iavf_hw *hw)
> > -{
> > -     enum iavf_status status = 0;
> > -
> > -     if (hw->vendor_id == PCI_VENDOR_ID_INTEL) {
> > -             switch (hw->device_id) {
> > -             case IAVF_DEV_ID_X722_VF:
> > -                     hw->mac.type = IAVF_MAC_X722_VF;
> > -                     break;
> > -             case IAVF_DEV_ID_VF:
> > -             case IAVF_DEV_ID_VF_HV:
> > -             case IAVF_DEV_ID_ADAPTIVE_VF:
> > -                     hw->mac.type = IAVF_MAC_VF;
> > -                     break;
> > -             default:
> > -                     hw->mac.type = IAVF_MAC_GENERIC;
> > -                     break;
> > -             }
> > -     } else {
> > -             status = IAVF_ERR_DEVICE_NOT_SUPPORTED;
> > -     }
> > -
> > -     return status;
> > -}
> > -
> >  /**
> >   * iavf_aq_str - convert AQ err code to a string
> >   * @hw: pointer to the HW structure
> > diff --git a/drivers/net/ethernet/intel/iavf/iavf_main.c
> > b/drivers/net/ethernet/intel/iavf/iavf_main.c
> > index 768bec67825a..c862ebcd2e39 100644
> > --- a/drivers/net/ethernet/intel/iavf/iavf_main.c
> > +++ b/drivers/net/ethernet/intel/iavf/iavf_main.c
> > @@ -2363,11 +2363,6 @@ static void iavf_startup(struct iavf_adapter
> > *adapter)
> >       /* driver loaded, probe complete */
> >       adapter->flags &= ~IAVF_FLAG_PF_COMMS_FAILED;
> >       adapter->flags &= ~IAVF_FLAG_RESET_PENDING;
> > -     status = iavf_set_mac_type(hw);
> > -     if (status) {
> > -             dev_err(&pdev->dev, "Failed to set MAC type (%d)\n",
> > status);
> > -             goto err;
> > -     }
> >
> >       ret = iavf_check_reset_complete(hw);
> >       if (ret) {
> > diff --git a/drivers/net/ethernet/intel/iavf/iavf_prototype.h
> > b/drivers/net/ethernet/intel/iavf/iavf_prototype.h
> > index 940cb4203fbe..4a48e6171405 100644
> > --- a/drivers/net/ethernet/intel/iavf/iavf_prototype.h
> > +++ b/drivers/net/ethernet/intel/iavf/iavf_prototype.h
> > @@ -45,8 +45,6 @@ enum iavf_status iavf_aq_set_rss_lut(struct iavf_hw
> > *hw, u16 seid,
> >  enum iavf_status iavf_aq_set_rss_key(struct iavf_hw *hw, u16 seid,
> >                                    struct iavf_aqc_get_set_rss_key_data *key);
> >
> > -enum iavf_status iavf_set_mac_type(struct iavf_hw *hw);
> > -
> >  extern struct iavf_rx_ptype_decoded iavf_ptype_lookup[];
> >
> >  static inline struct iavf_rx_ptype_decoded decode_rx_desc_ptype(u8 ptype)
> > diff --git a/drivers/net/ethernet/intel/iavf/iavf_type.h
> > b/drivers/net/ethernet/intel/iavf/iavf_type.h
> > index 9f1f523807c4..2b6a207fa441 100644
> > --- a/drivers/net/ethernet/intel/iavf/iavf_type.h
> > +++ b/drivers/net/ethernet/intel/iavf/iavf_type.h
> > @@ -69,15 +69,6 @@ enum iavf_debug_mask {
> >   * the Firmware and AdminQ are intended to insulate the driver from most of
> > the
> >   * future changes, but these structures will also do part of the job.
> >   */
> > -enum iavf_mac_type {
> > -     IAVF_MAC_UNKNOWN = 0,
> > -     IAVF_MAC_XL710,
> > -     IAVF_MAC_VF,
> > -     IAVF_MAC_X722,
> > -     IAVF_MAC_X722_VF,
> > -     IAVF_MAC_GENERIC,
> > -};
> > -
> >  enum iavf_vsi_type {
> >       IAVF_VSI_MAIN   = 0,
> >       IAVF_VSI_VMDQ1  = 1,
> > @@ -110,11 +101,8 @@ struct iavf_hw_capabilities {
> >  };
> >
> >  struct iavf_mac_info {
> > -     enum iavf_mac_type type;
> >       u8 addr[ETH_ALEN];
> >       u8 perm_addr[ETH_ALEN];
> > -     u8 san_addr[ETH_ALEN];
> > -     u16 max_fcoeq;
> >  };
> >
> >  /* PCI bus types */
> > --
> > 2.41.0
>


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Intel-wired-lan] [PATCH net-next] iavf: delete unused iavf_mac_info fields
@ 2023-10-18 15:11     ` Michal Schmidt
  0 siblings, 0 replies; 12+ messages in thread
From: Michal Schmidt @ 2023-10-18 15:11 UTC (permalink / raw)
  To: Drewek, Wojciech, Ivan Vecera
  Cc: Keller, Jacob E, Nguyen, Anthony L, intel-wired-lan, Brandeburg,
	Jesse, netdev

On Wed, Oct 18, 2023 at 1:26 PM Drewek, Wojciech
<wojciech.drewek@intel.com> wrote:
> > -----Original Message-----
> > From: Michal Schmidt <mschmidt@redhat.com>
> > Sent: Wednesday, October 18, 2023 1:15 PM
> > To: intel-wired-lan@lists.osuosl.org
> > Cc: Keller, Jacob E <jacob.e.keller@intel.com>; Drewek, Wojciech
> > <wojciech.drewek@intel.com>; Brandeburg, Jesse
> > <jesse.brandeburg@intel.com>; Nguyen, Anthony L
> > <anthony.l.nguyen@intel.com>; netdev@vger.kernel.org
> > Subject: [PATCH net-next] iavf: delete unused iavf_mac_info fields
> >
> > 'san_addr' and 'mac_fcoeq' members of struct iavf_mac_info are unused.
> > 'type' is write-only. Delete all three.
> >
> > The function iavf_set_mac_type that sets 'type' also checks if the PCI
> > vendor ID is Intel. This is unnecessary. Delete the whole function.
> >
> > If in the future there's a need for the MAC type (or other PCI
> > ID-dependent data), I would prefer to use .driver_data in iavf_pci_tbl[]
> > for this purpose.
> >
> > Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
>
> Reviewed-by: Wojciech Drewek <wojciech.drewek@intel.com>
>
> Nice cleanup, I've seen similar unused fields in i40e as well.
> Any plans for i40e cleanup?

No, I am not planning to look into i40e cleanups in the near future.
Ivan might want to do that though. [Adding him to the thread]
Michal

> > ---
> >  drivers/net/ethernet/intel/iavf/iavf_common.c | 32 -------------------
> >  drivers/net/ethernet/intel/iavf/iavf_main.c   |  5 ---
> >  .../net/ethernet/intel/iavf/iavf_prototype.h  |  2 --
> >  drivers/net/ethernet/intel/iavf/iavf_type.h   | 12 -------
> >  4 files changed, 51 deletions(-)
> >
> > diff --git a/drivers/net/ethernet/intel/iavf/iavf_common.c
> > b/drivers/net/ethernet/intel/iavf/iavf_common.c
> > index 1afd761d8052..8091e6feca01 100644
> > --- a/drivers/net/ethernet/intel/iavf/iavf_common.c
> > +++ b/drivers/net/ethernet/intel/iavf/iavf_common.c
> > @@ -6,38 +6,6 @@
> >  #include "iavf_prototype.h"
> >  #include <linux/avf/virtchnl.h>
> >
> > -/**
> > - * iavf_set_mac_type - Sets MAC type
> > - * @hw: pointer to the HW structure
> > - *
> > - * This function sets the mac type of the adapter based on the
> > - * vendor ID and device ID stored in the hw structure.
> > - **/
> > -enum iavf_status iavf_set_mac_type(struct iavf_hw *hw)
> > -{
> > -     enum iavf_status status = 0;
> > -
> > -     if (hw->vendor_id == PCI_VENDOR_ID_INTEL) {
> > -             switch (hw->device_id) {
> > -             case IAVF_DEV_ID_X722_VF:
> > -                     hw->mac.type = IAVF_MAC_X722_VF;
> > -                     break;
> > -             case IAVF_DEV_ID_VF:
> > -             case IAVF_DEV_ID_VF_HV:
> > -             case IAVF_DEV_ID_ADAPTIVE_VF:
> > -                     hw->mac.type = IAVF_MAC_VF;
> > -                     break;
> > -             default:
> > -                     hw->mac.type = IAVF_MAC_GENERIC;
> > -                     break;
> > -             }
> > -     } else {
> > -             status = IAVF_ERR_DEVICE_NOT_SUPPORTED;
> > -     }
> > -
> > -     return status;
> > -}
> > -
> >  /**
> >   * iavf_aq_str - convert AQ err code to a string
> >   * @hw: pointer to the HW structure
> > diff --git a/drivers/net/ethernet/intel/iavf/iavf_main.c
> > b/drivers/net/ethernet/intel/iavf/iavf_main.c
> > index 768bec67825a..c862ebcd2e39 100644
> > --- a/drivers/net/ethernet/intel/iavf/iavf_main.c
> > +++ b/drivers/net/ethernet/intel/iavf/iavf_main.c
> > @@ -2363,11 +2363,6 @@ static void iavf_startup(struct iavf_adapter
> > *adapter)
> >       /* driver loaded, probe complete */
> >       adapter->flags &= ~IAVF_FLAG_PF_COMMS_FAILED;
> >       adapter->flags &= ~IAVF_FLAG_RESET_PENDING;
> > -     status = iavf_set_mac_type(hw);
> > -     if (status) {
> > -             dev_err(&pdev->dev, "Failed to set MAC type (%d)\n",
> > status);
> > -             goto err;
> > -     }
> >
> >       ret = iavf_check_reset_complete(hw);
> >       if (ret) {
> > diff --git a/drivers/net/ethernet/intel/iavf/iavf_prototype.h
> > b/drivers/net/ethernet/intel/iavf/iavf_prototype.h
> > index 940cb4203fbe..4a48e6171405 100644
> > --- a/drivers/net/ethernet/intel/iavf/iavf_prototype.h
> > +++ b/drivers/net/ethernet/intel/iavf/iavf_prototype.h
> > @@ -45,8 +45,6 @@ enum iavf_status iavf_aq_set_rss_lut(struct iavf_hw
> > *hw, u16 seid,
> >  enum iavf_status iavf_aq_set_rss_key(struct iavf_hw *hw, u16 seid,
> >                                    struct iavf_aqc_get_set_rss_key_data *key);
> >
> > -enum iavf_status iavf_set_mac_type(struct iavf_hw *hw);
> > -
> >  extern struct iavf_rx_ptype_decoded iavf_ptype_lookup[];
> >
> >  static inline struct iavf_rx_ptype_decoded decode_rx_desc_ptype(u8 ptype)
> > diff --git a/drivers/net/ethernet/intel/iavf/iavf_type.h
> > b/drivers/net/ethernet/intel/iavf/iavf_type.h
> > index 9f1f523807c4..2b6a207fa441 100644
> > --- a/drivers/net/ethernet/intel/iavf/iavf_type.h
> > +++ b/drivers/net/ethernet/intel/iavf/iavf_type.h
> > @@ -69,15 +69,6 @@ enum iavf_debug_mask {
> >   * the Firmware and AdminQ are intended to insulate the driver from most of
> > the
> >   * future changes, but these structures will also do part of the job.
> >   */
> > -enum iavf_mac_type {
> > -     IAVF_MAC_UNKNOWN = 0,
> > -     IAVF_MAC_XL710,
> > -     IAVF_MAC_VF,
> > -     IAVF_MAC_X722,
> > -     IAVF_MAC_X722_VF,
> > -     IAVF_MAC_GENERIC,
> > -};
> > -
> >  enum iavf_vsi_type {
> >       IAVF_VSI_MAIN   = 0,
> >       IAVF_VSI_VMDQ1  = 1,
> > @@ -110,11 +101,8 @@ struct iavf_hw_capabilities {
> >  };
> >
> >  struct iavf_mac_info {
> > -     enum iavf_mac_type type;
> >       u8 addr[ETH_ALEN];
> >       u8 perm_addr[ETH_ALEN];
> > -     u8 san_addr[ETH_ALEN];
> > -     u16 max_fcoeq;
> >  };
> >
> >  /* PCI bus types */
> > --
> > 2.41.0
>

_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH net-next] iavf: delete unused iavf_mac_info fields
  2023-10-18 11:15 ` [Intel-wired-lan] " Michal Schmidt
@ 2023-10-18 21:30   ` Jacob Keller
  -1 siblings, 0 replies; 12+ messages in thread
From: Jacob Keller @ 2023-10-18 21:30 UTC (permalink / raw)
  To: Michal Schmidt, intel-wired-lan
  Cc: Wojciech Drewek, Jesse Brandeburg, Tony Nguyen, netdev



On 10/18/2023 4:15 AM, Michal Schmidt wrote:
> 'san_addr' and 'mac_fcoeq' members of struct iavf_mac_info are unused.
> 'type' is write-only. Delete all three.
> 
> The function iavf_set_mac_type that sets 'type' also checks if the PCI
> vendor ID is Intel. This is unnecessary. Delete the whole function.
> 
> If in the future there's a need for the MAC type (or other PCI
> ID-dependent data), I would prefer to use .driver_data in iavf_pci_tbl[]
> for this purpose.
> 

I suspect a handful of information across the Intel drivers could belong
in .driver_data instead of the current method we've used.

Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>

Thanks,
Jake

> Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
> ---
>  drivers/net/ethernet/intel/iavf/iavf_common.c | 32 -------------------
>  drivers/net/ethernet/intel/iavf/iavf_main.c   |  5 ---
>  .../net/ethernet/intel/iavf/iavf_prototype.h  |  2 --
>  drivers/net/ethernet/intel/iavf/iavf_type.h   | 12 -------
>  4 files changed, 51 deletions(-)
> 
> diff --git a/drivers/net/ethernet/intel/iavf/iavf_common.c b/drivers/net/ethernet/intel/iavf/iavf_common.c
> index 1afd761d8052..8091e6feca01 100644
> --- a/drivers/net/ethernet/intel/iavf/iavf_common.c
> +++ b/drivers/net/ethernet/intel/iavf/iavf_common.c
> @@ -6,38 +6,6 @@
>  #include "iavf_prototype.h"
>  #include <linux/avf/virtchnl.h>
>  
> -/**
> - * iavf_set_mac_type - Sets MAC type
> - * @hw: pointer to the HW structure
> - *
> - * This function sets the mac type of the adapter based on the
> - * vendor ID and device ID stored in the hw structure.
> - **/
> -enum iavf_status iavf_set_mac_type(struct iavf_hw *hw)
> -{
> -	enum iavf_status status = 0;
> -
> -	if (hw->vendor_id == PCI_VENDOR_ID_INTEL) {
> -		switch (hw->device_id) {
> -		case IAVF_DEV_ID_X722_VF:
> -			hw->mac.type = IAVF_MAC_X722_VF;
> -			break;
> -		case IAVF_DEV_ID_VF:
> -		case IAVF_DEV_ID_VF_HV:
> -		case IAVF_DEV_ID_ADAPTIVE_VF:
> -			hw->mac.type = IAVF_MAC_VF;
> -			break;
> -		default:
> -			hw->mac.type = IAVF_MAC_GENERIC;
> -			break;
> -		}
> -	} else {
> -		status = IAVF_ERR_DEVICE_NOT_SUPPORTED;
> -	}
> -
> -	return status;
> -}
> -
>  /**
>   * iavf_aq_str - convert AQ err code to a string
>   * @hw: pointer to the HW structure
> diff --git a/drivers/net/ethernet/intel/iavf/iavf_main.c b/drivers/net/ethernet/intel/iavf/iavf_main.c
> index 768bec67825a..c862ebcd2e39 100644
> --- a/drivers/net/ethernet/intel/iavf/iavf_main.c
> +++ b/drivers/net/ethernet/intel/iavf/iavf_main.c
> @@ -2363,11 +2363,6 @@ static void iavf_startup(struct iavf_adapter *adapter)
>  	/* driver loaded, probe complete */
>  	adapter->flags &= ~IAVF_FLAG_PF_COMMS_FAILED;
>  	adapter->flags &= ~IAVF_FLAG_RESET_PENDING;
> -	status = iavf_set_mac_type(hw);
> -	if (status) {
> -		dev_err(&pdev->dev, "Failed to set MAC type (%d)\n", status);
> -		goto err;
> -	}
>  
>  	ret = iavf_check_reset_complete(hw);
>  	if (ret) {
> diff --git a/drivers/net/ethernet/intel/iavf/iavf_prototype.h b/drivers/net/ethernet/intel/iavf/iavf_prototype.h
> index 940cb4203fbe..4a48e6171405 100644
> --- a/drivers/net/ethernet/intel/iavf/iavf_prototype.h
> +++ b/drivers/net/ethernet/intel/iavf/iavf_prototype.h
> @@ -45,8 +45,6 @@ enum iavf_status iavf_aq_set_rss_lut(struct iavf_hw *hw, u16 seid,
>  enum iavf_status iavf_aq_set_rss_key(struct iavf_hw *hw, u16 seid,
>  				     struct iavf_aqc_get_set_rss_key_data *key);
>  
> -enum iavf_status iavf_set_mac_type(struct iavf_hw *hw);
> -
>  extern struct iavf_rx_ptype_decoded iavf_ptype_lookup[];
>  
>  static inline struct iavf_rx_ptype_decoded decode_rx_desc_ptype(u8 ptype)
> diff --git a/drivers/net/ethernet/intel/iavf/iavf_type.h b/drivers/net/ethernet/intel/iavf/iavf_type.h
> index 9f1f523807c4..2b6a207fa441 100644
> --- a/drivers/net/ethernet/intel/iavf/iavf_type.h
> +++ b/drivers/net/ethernet/intel/iavf/iavf_type.h
> @@ -69,15 +69,6 @@ enum iavf_debug_mask {
>   * the Firmware and AdminQ are intended to insulate the driver from most of the
>   * future changes, but these structures will also do part of the job.
>   */
> -enum iavf_mac_type {
> -	IAVF_MAC_UNKNOWN = 0,
> -	IAVF_MAC_XL710,
> -	IAVF_MAC_VF,
> -	IAVF_MAC_X722,
> -	IAVF_MAC_X722_VF,
> -	IAVF_MAC_GENERIC,
> -};
> -
>  enum iavf_vsi_type {
>  	IAVF_VSI_MAIN	= 0,
>  	IAVF_VSI_VMDQ1	= 1,
> @@ -110,11 +101,8 @@ struct iavf_hw_capabilities {
>  };
>  
>  struct iavf_mac_info {
> -	enum iavf_mac_type type;
>  	u8 addr[ETH_ALEN];
>  	u8 perm_addr[ETH_ALEN];
> -	u8 san_addr[ETH_ALEN];
> -	u16 max_fcoeq;
>  };
>  
>  /* PCI bus types */

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Intel-wired-lan] [PATCH net-next] iavf: delete unused iavf_mac_info fields
@ 2023-10-18 21:30   ` Jacob Keller
  0 siblings, 0 replies; 12+ messages in thread
From: Jacob Keller @ 2023-10-18 21:30 UTC (permalink / raw)
  To: Michal Schmidt, intel-wired-lan
  Cc: Tony Nguyen, Wojciech Drewek, Jesse Brandeburg, netdev



On 10/18/2023 4:15 AM, Michal Schmidt wrote:
> 'san_addr' and 'mac_fcoeq' members of struct iavf_mac_info are unused.
> 'type' is write-only. Delete all three.
> 
> The function iavf_set_mac_type that sets 'type' also checks if the PCI
> vendor ID is Intel. This is unnecessary. Delete the whole function.
> 
> If in the future there's a need for the MAC type (or other PCI
> ID-dependent data), I would prefer to use .driver_data in iavf_pci_tbl[]
> for this purpose.
> 

I suspect a handful of information across the Intel drivers could belong
in .driver_data instead of the current method we've used.

Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>

Thanks,
Jake

> Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
> ---
>  drivers/net/ethernet/intel/iavf/iavf_common.c | 32 -------------------
>  drivers/net/ethernet/intel/iavf/iavf_main.c   |  5 ---
>  .../net/ethernet/intel/iavf/iavf_prototype.h  |  2 --
>  drivers/net/ethernet/intel/iavf/iavf_type.h   | 12 -------
>  4 files changed, 51 deletions(-)
> 
> diff --git a/drivers/net/ethernet/intel/iavf/iavf_common.c b/drivers/net/ethernet/intel/iavf/iavf_common.c
> index 1afd761d8052..8091e6feca01 100644
> --- a/drivers/net/ethernet/intel/iavf/iavf_common.c
> +++ b/drivers/net/ethernet/intel/iavf/iavf_common.c
> @@ -6,38 +6,6 @@
>  #include "iavf_prototype.h"
>  #include <linux/avf/virtchnl.h>
>  
> -/**
> - * iavf_set_mac_type - Sets MAC type
> - * @hw: pointer to the HW structure
> - *
> - * This function sets the mac type of the adapter based on the
> - * vendor ID and device ID stored in the hw structure.
> - **/
> -enum iavf_status iavf_set_mac_type(struct iavf_hw *hw)
> -{
> -	enum iavf_status status = 0;
> -
> -	if (hw->vendor_id == PCI_VENDOR_ID_INTEL) {
> -		switch (hw->device_id) {
> -		case IAVF_DEV_ID_X722_VF:
> -			hw->mac.type = IAVF_MAC_X722_VF;
> -			break;
> -		case IAVF_DEV_ID_VF:
> -		case IAVF_DEV_ID_VF_HV:
> -		case IAVF_DEV_ID_ADAPTIVE_VF:
> -			hw->mac.type = IAVF_MAC_VF;
> -			break;
> -		default:
> -			hw->mac.type = IAVF_MAC_GENERIC;
> -			break;
> -		}
> -	} else {
> -		status = IAVF_ERR_DEVICE_NOT_SUPPORTED;
> -	}
> -
> -	return status;
> -}
> -
>  /**
>   * iavf_aq_str - convert AQ err code to a string
>   * @hw: pointer to the HW structure
> diff --git a/drivers/net/ethernet/intel/iavf/iavf_main.c b/drivers/net/ethernet/intel/iavf/iavf_main.c
> index 768bec67825a..c862ebcd2e39 100644
> --- a/drivers/net/ethernet/intel/iavf/iavf_main.c
> +++ b/drivers/net/ethernet/intel/iavf/iavf_main.c
> @@ -2363,11 +2363,6 @@ static void iavf_startup(struct iavf_adapter *adapter)
>  	/* driver loaded, probe complete */
>  	adapter->flags &= ~IAVF_FLAG_PF_COMMS_FAILED;
>  	adapter->flags &= ~IAVF_FLAG_RESET_PENDING;
> -	status = iavf_set_mac_type(hw);
> -	if (status) {
> -		dev_err(&pdev->dev, "Failed to set MAC type (%d)\n", status);
> -		goto err;
> -	}
>  
>  	ret = iavf_check_reset_complete(hw);
>  	if (ret) {
> diff --git a/drivers/net/ethernet/intel/iavf/iavf_prototype.h b/drivers/net/ethernet/intel/iavf/iavf_prototype.h
> index 940cb4203fbe..4a48e6171405 100644
> --- a/drivers/net/ethernet/intel/iavf/iavf_prototype.h
> +++ b/drivers/net/ethernet/intel/iavf/iavf_prototype.h
> @@ -45,8 +45,6 @@ enum iavf_status iavf_aq_set_rss_lut(struct iavf_hw *hw, u16 seid,
>  enum iavf_status iavf_aq_set_rss_key(struct iavf_hw *hw, u16 seid,
>  				     struct iavf_aqc_get_set_rss_key_data *key);
>  
> -enum iavf_status iavf_set_mac_type(struct iavf_hw *hw);
> -
>  extern struct iavf_rx_ptype_decoded iavf_ptype_lookup[];
>  
>  static inline struct iavf_rx_ptype_decoded decode_rx_desc_ptype(u8 ptype)
> diff --git a/drivers/net/ethernet/intel/iavf/iavf_type.h b/drivers/net/ethernet/intel/iavf/iavf_type.h
> index 9f1f523807c4..2b6a207fa441 100644
> --- a/drivers/net/ethernet/intel/iavf/iavf_type.h
> +++ b/drivers/net/ethernet/intel/iavf/iavf_type.h
> @@ -69,15 +69,6 @@ enum iavf_debug_mask {
>   * the Firmware and AdminQ are intended to insulate the driver from most of the
>   * future changes, but these structures will also do part of the job.
>   */
> -enum iavf_mac_type {
> -	IAVF_MAC_UNKNOWN = 0,
> -	IAVF_MAC_XL710,
> -	IAVF_MAC_VF,
> -	IAVF_MAC_X722,
> -	IAVF_MAC_X722_VF,
> -	IAVF_MAC_GENERIC,
> -};
> -
>  enum iavf_vsi_type {
>  	IAVF_VSI_MAIN	= 0,
>  	IAVF_VSI_VMDQ1	= 1,
> @@ -110,11 +101,8 @@ struct iavf_hw_capabilities {
>  };
>  
>  struct iavf_mac_info {
> -	enum iavf_mac_type type;
>  	u8 addr[ETH_ALEN];
>  	u8 perm_addr[ETH_ALEN];
> -	u8 san_addr[ETH_ALEN];
> -	u16 max_fcoeq;
>  };
>  
>  /* PCI bus types */
_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH net-next] iavf: delete unused iavf_mac_info fields
  2023-10-18 11:15 ` [Intel-wired-lan] " Michal Schmidt
@ 2023-10-19 11:50   ` patchwork-bot+netdevbpf
  -1 siblings, 0 replies; 12+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-10-19 11:50 UTC (permalink / raw)
  To: Michal Schmidt
  Cc: intel-wired-lan, jacob.e.keller, wojciech.drewek,
	jesse.brandeburg, anthony.l.nguyen, netdev

Hello:

This patch was applied to netdev/net-next.git (main)
by Paolo Abeni <pabeni@redhat.com>:

On Wed, 18 Oct 2023 13:15:27 +0200 you wrote:
> 'san_addr' and 'mac_fcoeq' members of struct iavf_mac_info are unused.
> 'type' is write-only. Delete all three.
> 
> The function iavf_set_mac_type that sets 'type' also checks if the PCI
> vendor ID is Intel. This is unnecessary. Delete the whole function.
> 
> If in the future there's a need for the MAC type (or other PCI
> ID-dependent data), I would prefer to use .driver_data in iavf_pci_tbl[]
> for this purpose.
> 
> [...]

Here is the summary with links:
  - [net-next] iavf: delete unused iavf_mac_info fields
    https://git.kernel.org/netdev/net-next/c/a0e6323dbae6

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Intel-wired-lan] [PATCH net-next] iavf: delete unused iavf_mac_info fields
@ 2023-10-19 11:50   ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 12+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-10-19 11:50 UTC (permalink / raw)
  To: Michal Schmidt
  Cc: wojciech.drewek, netdev, jesse.brandeburg, anthony.l.nguyen,
	jacob.e.keller, intel-wired-lan

Hello:

This patch was applied to netdev/net-next.git (main)
by Paolo Abeni <pabeni@redhat.com>:

On Wed, 18 Oct 2023 13:15:27 +0200 you wrote:
> 'san_addr' and 'mac_fcoeq' members of struct iavf_mac_info are unused.
> 'type' is write-only. Delete all three.
> 
> The function iavf_set_mac_type that sets 'type' also checks if the PCI
> vendor ID is Intel. This is unnecessary. Delete the whole function.
> 
> If in the future there's a need for the MAC type (or other PCI
> ID-dependent data), I would prefer to use .driver_data in iavf_pci_tbl[]
> for this purpose.
> 
> [...]

Here is the summary with links:
  - [net-next] iavf: delete unused iavf_mac_info fields
    https://git.kernel.org/netdev/net-next/c/a0e6323dbae6

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html


_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Intel-wired-lan] [PATCH net-next] iavf: delete unused iavf_mac_info fields
  2023-10-18 15:11     ` [Intel-wired-lan] " Michal Schmidt
@ 2023-10-19 16:34       ` Ivan Vecera
  -1 siblings, 0 replies; 12+ messages in thread
From: Ivan Vecera @ 2023-10-19 16:34 UTC (permalink / raw)
  To: Michal Schmidt, Drewek, Wojciech
  Cc: Keller, Jacob E, Nguyen, Anthony L, intel-wired-lan, Brandeburg,
	Jesse, netdev



On 18. 10. 23 17:11, Michal Schmidt wrote:
> On Wed, Oct 18, 2023 at 1:26 PM Drewek, Wojciech
> <wojciech.drewek@intel.com>  wrote:
>>> -----Original Message-----
>>> From: Michal Schmidt<mschmidt@redhat.com>
>>> Sent: Wednesday, October 18, 2023 1:15 PM
>>> To:intel-wired-lan@lists.osuosl.org
>>> Cc: Keller, Jacob E<jacob.e.keller@intel.com>; Drewek, Wojciech
>>> <wojciech.drewek@intel.com>; Brandeburg, Jesse
>>> <jesse.brandeburg@intel.com>; Nguyen, Anthony L
>>> <anthony.l.nguyen@intel.com>;netdev@vger.kernel.org
>>> Subject: [PATCH net-next] iavf: delete unused iavf_mac_info fields
>>>
>>> 'san_addr' and 'mac_fcoeq' members of struct iavf_mac_info are unused.
>>> 'type' is write-only. Delete all three.
>>>
>>> The function iavf_set_mac_type that sets 'type' also checks if the PCI
>>> vendor ID is Intel. This is unnecessary. Delete the whole function.
>>>
>>> If in the future there's a need for the MAC type (or other PCI
>>> ID-dependent data), I would prefer to use .driver_data in iavf_pci_tbl[]
>>> for this purpose.
>>>
>>> Signed-off-by: Michal Schmidt<mschmidt@redhat.com>
>> Reviewed-by: Wojciech Drewek<wojciech.drewek@intel.com>
>>
>> Nice cleanup, I've seen similar unused fields in i40e as well.
>> Any plans for i40e cleanup?
> No, I am not planning to look into i40e cleanups in the near future.
> Ivan might want to do that though. [Adding him to the thread]
> Michal

OK, I will do it...

Thanks,
Ivan

_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH net-next] iavf: delete unused iavf_mac_info fields
@ 2023-10-19 16:34       ` Ivan Vecera
  0 siblings, 0 replies; 12+ messages in thread
From: Ivan Vecera @ 2023-10-19 16:34 UTC (permalink / raw)
  To: Michal Schmidt, Drewek, Wojciech
  Cc: intel-wired-lan, Keller, Jacob E, Brandeburg, Jesse, Nguyen,
	Anthony L, netdev



On 18. 10. 23 17:11, Michal Schmidt wrote:
> On Wed, Oct 18, 2023 at 1:26 PM Drewek, Wojciech
> <wojciech.drewek@intel.com>  wrote:
>>> -----Original Message-----
>>> From: Michal Schmidt<mschmidt@redhat.com>
>>> Sent: Wednesday, October 18, 2023 1:15 PM
>>> To:intel-wired-lan@lists.osuosl.org
>>> Cc: Keller, Jacob E<jacob.e.keller@intel.com>; Drewek, Wojciech
>>> <wojciech.drewek@intel.com>; Brandeburg, Jesse
>>> <jesse.brandeburg@intel.com>; Nguyen, Anthony L
>>> <anthony.l.nguyen@intel.com>;netdev@vger.kernel.org
>>> Subject: [PATCH net-next] iavf: delete unused iavf_mac_info fields
>>>
>>> 'san_addr' and 'mac_fcoeq' members of struct iavf_mac_info are unused.
>>> 'type' is write-only. Delete all three.
>>>
>>> The function iavf_set_mac_type that sets 'type' also checks if the PCI
>>> vendor ID is Intel. This is unnecessary. Delete the whole function.
>>>
>>> If in the future there's a need for the MAC type (or other PCI
>>> ID-dependent data), I would prefer to use .driver_data in iavf_pci_tbl[]
>>> for this purpose.
>>>
>>> Signed-off-by: Michal Schmidt<mschmidt@redhat.com>
>> Reviewed-by: Wojciech Drewek<wojciech.drewek@intel.com>
>>
>> Nice cleanup, I've seen similar unused fields in i40e as well.
>> Any plans for i40e cleanup?
> No, I am not planning to look into i40e cleanups in the near future.
> Ivan might want to do that though. [Adding him to the thread]
> Michal

OK, I will do it...

Thanks,
Ivan


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2023-10-19 16:34 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-18 11:15 [PATCH net-next] iavf: delete unused iavf_mac_info fields Michal Schmidt
2023-10-18 11:15 ` [Intel-wired-lan] " Michal Schmidt
2023-10-18 11:25 ` Drewek, Wojciech
2023-10-18 11:25   ` [Intel-wired-lan] " Drewek, Wojciech
2023-10-18 15:11   ` Michal Schmidt
2023-10-18 15:11     ` [Intel-wired-lan] " Michal Schmidt
2023-10-19 16:34     ` Ivan Vecera
2023-10-19 16:34       ` Ivan Vecera
2023-10-18 21:30 ` Jacob Keller
2023-10-18 21:30   ` [Intel-wired-lan] " Jacob Keller
2023-10-19 11:50 ` patchwork-bot+netdevbpf
2023-10-19 11:50   ` [Intel-wired-lan] " patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.