* [PATCH net-next 00/10][pull request] 1GbE Intel Wired LAN Driver Updates 2022-01-27
@ 2022-01-27 21:52 Tony Nguyen
2022-01-27 21:52 ` [PATCH net-next 01/10] ixgb: Remove useless DMA-32 fallback configuration Tony Nguyen
` (10 more replies)
0 siblings, 11 replies; 12+ messages in thread
From: Tony Nguyen @ 2022-01-27 21:52 UTC (permalink / raw)
To: davem, kuba; +Cc: Tony Nguyen, netdev
Christophe Jaillet removes useless DMA-32 fallback calls from applicable
Intel drivers and simplifies code as a result of the removal.
The following are changes since commit e2cf07654efb0fd7bbcb475c6f74be7b5755a8fd:
ptp: replace snprintf with sysfs_emit
and are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue 1GbE
Christophe JAILLET (10):
ixgb: Remove useless DMA-32 fallback configuration
ixgbe: Remove useless DMA-32 fallback configuration
ixgbevf: Remove useless DMA-32 fallback configuration
i40e: Remove useless DMA-32 fallback configuration
e1000e: Remove useless DMA-32 fallback configuration
iavf: Remove useless DMA-32 fallback configuration
ice: Remove useless DMA-32 fallback configuration
igc: Remove useless DMA-32 fallback configuration
igb: Remove useless DMA-32 fallback configuration
igbvf: Remove useless DMA-32 fallback configuration
drivers/net/ethernet/intel/e1000e/netdev.c | 22 ++++++-------------
drivers/net/ethernet/intel/i40e/i40e_main.c | 9 +++-----
drivers/net/ethernet/intel/iavf/iavf_main.c | 9 +++-----
drivers/net/ethernet/intel/ice/ice_main.c | 2 --
drivers/net/ethernet/intel/igb/igb_main.c | 19 +++++-----------
drivers/net/ethernet/intel/igbvf/netdev.c | 22 +++++--------------
drivers/net/ethernet/intel/igc/igc_main.c | 19 +++++-----------
drivers/net/ethernet/intel/ixgb/ixgb_main.c | 19 +++++-----------
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 20 ++++++-----------
.../net/ethernet/intel/ixgbevf/ixgbevf_main.c | 20 +++++------------
10 files changed, 49 insertions(+), 112 deletions(-)
--
2.31.1
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH net-next 01/10] ixgb: Remove useless DMA-32 fallback configuration
2022-01-27 21:52 [PATCH net-next 00/10][pull request] 1GbE Intel Wired LAN Driver Updates 2022-01-27 Tony Nguyen
@ 2022-01-27 21:52 ` Tony Nguyen
2022-01-27 21:52 ` [PATCH net-next 02/10] ixgbe: " Tony Nguyen
` (9 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Tony Nguyen @ 2022-01-27 21:52 UTC (permalink / raw)
To: davem, kuba
Cc: Christophe JAILLET, netdev, anthony.l.nguyen, Christoph Hellwig,
Alexander Lobakin
From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
As stated in [1], dma_set_mask() with a 64-bit mask never fails if
dev->dma_mask is non-NULL.
So, if it fails, the 32 bits case will also fail for the same reason.
So, if dma_set_mask_and_coherent() succeeds, 'pci_using_dac' is known to be
1.
Simplify code and remove some dead code accordingly.
[1]: https://lkml.org/lkml/2021/6/7/398
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Alexander Lobakin <alexandr.lobakin@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
drivers/net/ethernet/intel/ixgb/ixgb_main.c | 19 +++++--------------
1 file changed, 5 insertions(+), 14 deletions(-)
diff --git a/drivers/net/ethernet/intel/ixgb/ixgb_main.c b/drivers/net/ethernet/intel/ixgb/ixgb_main.c
index 99d481904ce6..affdefcca7e3 100644
--- a/drivers/net/ethernet/intel/ixgb/ixgb_main.c
+++ b/drivers/net/ethernet/intel/ixgb/ixgb_main.c
@@ -361,7 +361,6 @@ ixgb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
struct net_device *netdev = NULL;
struct ixgb_adapter *adapter;
static int cards_found = 0;
- int pci_using_dac;
u8 addr[ETH_ALEN];
int i;
int err;
@@ -370,16 +369,10 @@ ixgb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
if (err)
return err;
- pci_using_dac = 0;
err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
- if (!err) {
- pci_using_dac = 1;
- } else {
- err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
- if (err) {
- pr_err("No usable DMA configuration, aborting\n");
- goto err_dma_mask;
- }
+ if (err) {
+ pr_err("No usable DMA configuration, aborting\n");
+ goto err_dma_mask;
}
err = pci_request_regions(pdev, ixgb_driver_name);
@@ -444,10 +437,8 @@ ixgb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
NETIF_F_HW_VLAN_CTAG_FILTER;
netdev->hw_features |= NETIF_F_RXCSUM;
- if (pci_using_dac) {
- netdev->features |= NETIF_F_HIGHDMA;
- netdev->vlan_features |= NETIF_F_HIGHDMA;
- }
+ netdev->features |= NETIF_F_HIGHDMA;
+ netdev->vlan_features |= NETIF_F_HIGHDMA;
/* MTU range: 68 - 16114 */
netdev->min_mtu = ETH_MIN_MTU;
--
2.31.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH net-next 02/10] ixgbe: Remove useless DMA-32 fallback configuration
2022-01-27 21:52 [PATCH net-next 00/10][pull request] 1GbE Intel Wired LAN Driver Updates 2022-01-27 Tony Nguyen
2022-01-27 21:52 ` [PATCH net-next 01/10] ixgb: Remove useless DMA-32 fallback configuration Tony Nguyen
@ 2022-01-27 21:52 ` Tony Nguyen
2022-01-27 21:52 ` [PATCH net-next 03/10] ixgbevf: " Tony Nguyen
` (8 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Tony Nguyen @ 2022-01-27 21:52 UTC (permalink / raw)
To: davem, kuba
Cc: Christophe JAILLET, netdev, anthony.l.nguyen, Christoph Hellwig,
Alexander Lobakin, Gurucharan G
From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
As stated in [1], dma_set_mask() with a 64-bit mask never fails if
dev->dma_mask is non-NULL.
So, if it fails, the 32 bits case will also fail for the same reason.
So, if dma_set_mask_and_coherent() succeeds, 'pci_using_dac' is known to be
1.
Simplify code and remove some dead code accordingly.
[1]: https://lkml.org/lkml/2021/6/7/398
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Alexander Lobakin <alexandr.lobakin@intel.com>
Tested-by: Gurucharan G <gurucharanx.g@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 20 +++++++------------
1 file changed, 7 insertions(+), 13 deletions(-)
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 89b467006291..2c8a4a06f56a 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -10632,9 +10632,9 @@ static int ixgbe_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
struct ixgbe_adapter *adapter = NULL;
struct ixgbe_hw *hw;
const struct ixgbe_info *ii = ixgbe_info_tbl[ent->driver_data];
- int i, err, pci_using_dac, expected_gts;
unsigned int indices = MAX_TX_QUEUES;
u8 part_str[IXGBE_PBANUM_LENGTH];
+ int i, err, expected_gts;
bool disable_dev = false;
#ifdef IXGBE_FCOE
u16 device_caps;
@@ -10654,16 +10654,11 @@ static int ixgbe_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
if (err)
return err;
- if (!dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64))) {
- pci_using_dac = 1;
- } else {
- err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
- if (err) {
- dev_err(&pdev->dev,
- "No usable DMA configuration, aborting\n");
- goto err_dma;
- }
- pci_using_dac = 0;
+ err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
+ if (err) {
+ dev_err(&pdev->dev,
+ "No usable DMA configuration, aborting\n");
+ goto err_dma;
}
err = pci_request_mem_regions(pdev, ixgbe_driver_name);
@@ -10861,8 +10856,7 @@ static int ixgbe_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
netdev->hw_features |= NETIF_F_NTUPLE |
NETIF_F_HW_TC;
- if (pci_using_dac)
- netdev->features |= NETIF_F_HIGHDMA;
+ netdev->features |= NETIF_F_HIGHDMA;
netdev->vlan_features |= netdev->features | NETIF_F_TSO_MANGLEID;
netdev->hw_enc_features |= netdev->vlan_features;
--
2.31.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH net-next 03/10] ixgbevf: Remove useless DMA-32 fallback configuration
2022-01-27 21:52 [PATCH net-next 00/10][pull request] 1GbE Intel Wired LAN Driver Updates 2022-01-27 Tony Nguyen
2022-01-27 21:52 ` [PATCH net-next 01/10] ixgb: Remove useless DMA-32 fallback configuration Tony Nguyen
2022-01-27 21:52 ` [PATCH net-next 02/10] ixgbe: " Tony Nguyen
@ 2022-01-27 21:52 ` Tony Nguyen
2022-01-27 21:52 ` [PATCH net-next 04/10] i40e: " Tony Nguyen
` (7 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Tony Nguyen @ 2022-01-27 21:52 UTC (permalink / raw)
To: davem, kuba
Cc: Christophe JAILLET, netdev, anthony.l.nguyen, Christoph Hellwig,
Alexander Lobakin, Gurucharan G
From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
As stated in [1], dma_set_mask() with a 64-bit mask never fails if
dev->dma_mask is non-NULL.
So, if it fails, the 32 bits case will also fail for the same reason.
So, if dma_set_mask_and_coherent() succeeds, 'pci_using_dac' is known to be
1.
Simplify code and remove some dead code accordingly.
[1]: https://lkml.org/lkml/2021/6/7/398
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Alexander Lobakin <alexandr.lobakin@intel.com>
Tested-by: Gurucharan G <gurucharanx.g@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
.../net/ethernet/intel/ixgbevf/ixgbevf_main.c | 20 ++++++-------------
1 file changed, 6 insertions(+), 14 deletions(-)
diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
index 0015fcf1df2b..7c33be9074e9 100644
--- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
+++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
@@ -4511,22 +4511,17 @@ static int ixgbevf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
struct ixgbevf_adapter *adapter = NULL;
struct ixgbe_hw *hw = NULL;
const struct ixgbevf_info *ii = ixgbevf_info_tbl[ent->driver_data];
- int err, pci_using_dac;
bool disable_dev = false;
+ int err;
err = pci_enable_device(pdev);
if (err)
return err;
- if (!dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64))) {
- pci_using_dac = 1;
- } else {
- err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
- if (err) {
- dev_err(&pdev->dev, "No usable DMA configuration, aborting\n");
- goto err_dma;
- }
- pci_using_dac = 0;
+ err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
+ if (err) {
+ dev_err(&pdev->dev, "No usable DMA configuration, aborting\n");
+ goto err_dma;
}
err = pci_request_regions(pdev, ixgbevf_driver_name);
@@ -4606,10 +4601,7 @@ static int ixgbevf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
netdev->hw_features |= NETIF_F_GSO_PARTIAL |
IXGBEVF_GSO_PARTIAL_FEATURES;
- netdev->features = netdev->hw_features;
-
- if (pci_using_dac)
- netdev->features |= NETIF_F_HIGHDMA;
+ netdev->features = netdev->hw_features | NETIF_F_HIGHDMA;
netdev->vlan_features |= netdev->features | NETIF_F_TSO_MANGLEID;
netdev->mpls_features |= NETIF_F_SG |
--
2.31.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH net-next 04/10] i40e: Remove useless DMA-32 fallback configuration
2022-01-27 21:52 [PATCH net-next 00/10][pull request] 1GbE Intel Wired LAN Driver Updates 2022-01-27 Tony Nguyen
` (2 preceding siblings ...)
2022-01-27 21:52 ` [PATCH net-next 03/10] ixgbevf: " Tony Nguyen
@ 2022-01-27 21:52 ` Tony Nguyen
2022-01-27 21:52 ` [PATCH net-next 05/10] e1000e: " Tony Nguyen
` (6 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Tony Nguyen @ 2022-01-27 21:52 UTC (permalink / raw)
To: davem, kuba
Cc: Christophe JAILLET, netdev, anthony.l.nguyen, sassmann,
Christoph Hellwig, Alexander Lobakin, Gurucharan G
From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
As stated in [1], dma_set_mask() with a 64-bit mask never fails if
dev->dma_mask is non-NULL.
So, if it fails, the 32 bits case will also fail for the same reason.
Simplify code and remove some dead code accordingly.
[1]: https://lkml.org/lkml/2021/6/7/398
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Alexander Lobakin <alexandr.lobakin@intel.com>
Tested-by: Gurucharan G <gurucharanx.g@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
drivers/net/ethernet/intel/i40e/i40e_main.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index f70c478dafdb..c8834765c864 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -15322,12 +15322,9 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
/* set up for high or low dma */
err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
if (err) {
- err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
- if (err) {
- dev_err(&pdev->dev,
- "DMA configuration failed: 0x%x\n", err);
- goto err_dma;
- }
+ dev_err(&pdev->dev,
+ "DMA configuration failed: 0x%x\n", err);
+ goto err_dma;
}
/* set up pci connections */
--
2.31.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH net-next 05/10] e1000e: Remove useless DMA-32 fallback configuration
2022-01-27 21:52 [PATCH net-next 00/10][pull request] 1GbE Intel Wired LAN Driver Updates 2022-01-27 Tony Nguyen
` (3 preceding siblings ...)
2022-01-27 21:52 ` [PATCH net-next 04/10] i40e: " Tony Nguyen
@ 2022-01-27 21:52 ` Tony Nguyen
2022-01-27 21:52 ` [PATCH net-next 06/10] iavf: " Tony Nguyen
` (5 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Tony Nguyen @ 2022-01-27 21:52 UTC (permalink / raw)
To: davem, kuba
Cc: Christophe JAILLET, netdev, anthony.l.nguyen, Christoph Hellwig,
Alexander Lobakin
From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
As stated in [1], dma_set_mask() with a 64-bit mask never fails if
dev->dma_mask is non-NULL.
So, if it fails, the 32 bits case will also fail for the same reason.
So, if dma_set_mask_and_coherent() succeeds, 'pci_using_dac' is known to be
1.
Simplify code and remove some dead code accordingly.
[1]: https://lkml.org/lkml/2021/6/7/398
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Alexander Lobakin <alexandr.lobakin@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
drivers/net/ethernet/intel/e1000e/netdev.c | 22 +++++++---------------
1 file changed, 7 insertions(+), 15 deletions(-)
diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
index 635a95927e93..4f6ee5c44f75 100644
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
@@ -7385,9 +7385,9 @@ static int e1000_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
resource_size_t flash_start, flash_len;
static int cards_found;
u16 aspm_disable_flag = 0;
- int bars, i, err, pci_using_dac;
u16 eeprom_data = 0;
u16 eeprom_apme_mask = E1000_EEPROM_APME;
+ int bars, i, err;
s32 ret_val = 0;
if (ei->flags2 & FLAG2_DISABLE_ASPM_L0S)
@@ -7401,17 +7401,11 @@ static int e1000_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
if (err)
return err;
- pci_using_dac = 0;
err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
- if (!err) {
- pci_using_dac = 1;
- } else {
- err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
- if (err) {
- dev_err(&pdev->dev,
- "No usable DMA configuration, aborting\n");
- goto err_dma;
- }
+ if (err) {
+ dev_err(&pdev->dev,
+ "No usable DMA configuration, aborting\n");
+ goto err_dma;
}
bars = pci_select_bars(pdev, IORESOURCE_MEM);
@@ -7547,10 +7541,8 @@ static int e1000_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
netdev->priv_flags |= IFF_UNICAST_FLT;
- if (pci_using_dac) {
- netdev->features |= NETIF_F_HIGHDMA;
- netdev->vlan_features |= NETIF_F_HIGHDMA;
- }
+ netdev->features |= NETIF_F_HIGHDMA;
+ netdev->vlan_features |= NETIF_F_HIGHDMA;
/* MTU range: 68 - max_hw_frame_size */
netdev->min_mtu = ETH_MIN_MTU;
--
2.31.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH net-next 06/10] iavf: Remove useless DMA-32 fallback configuration
2022-01-27 21:52 [PATCH net-next 00/10][pull request] 1GbE Intel Wired LAN Driver Updates 2022-01-27 Tony Nguyen
` (4 preceding siblings ...)
2022-01-27 21:52 ` [PATCH net-next 05/10] e1000e: " Tony Nguyen
@ 2022-01-27 21:52 ` Tony Nguyen
2022-01-27 21:52 ` [PATCH net-next 07/10] ice: " Tony Nguyen
` (4 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Tony Nguyen @ 2022-01-27 21:52 UTC (permalink / raw)
To: davem, kuba
Cc: Christophe JAILLET, netdev, anthony.l.nguyen, sassmann,
Christoph Hellwig, Alexander Lobakin, Konrad Jankowski
From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
As stated in [1], dma_set_mask() with a 64-bit mask never fails if
dev->dma_mask is non-NULL.
So, if it fails, the 32 bits case will also fail for the same reason.
Simplify code and remove some dead code accordingly.
[1]: https://lkml.org/lkml/2021/6/7/398
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Alexander Lobakin <alexandr.lobakin@intel.com>
Tested-by: Konrad Jankowski <konrad0.jankowski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
drivers/net/ethernet/intel/iavf/iavf_main.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/intel/iavf/iavf_main.c b/drivers/net/ethernet/intel/iavf/iavf_main.c
index 8125b9120615..b0bd95c85480 100644
--- a/drivers/net/ethernet/intel/iavf/iavf_main.c
+++ b/drivers/net/ethernet/intel/iavf/iavf_main.c
@@ -4368,12 +4368,9 @@ static int iavf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
if (err) {
- err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
- if (err) {
- dev_err(&pdev->dev,
- "DMA configuration failed: 0x%x\n", err);
- goto err_dma;
- }
+ dev_err(&pdev->dev,
+ "DMA configuration failed: 0x%x\n", err);
+ goto err_dma;
}
err = pci_request_regions(pdev, iavf_driver_name);
--
2.31.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH net-next 07/10] ice: Remove useless DMA-32 fallback configuration
2022-01-27 21:52 [PATCH net-next 00/10][pull request] 1GbE Intel Wired LAN Driver Updates 2022-01-27 Tony Nguyen
` (5 preceding siblings ...)
2022-01-27 21:52 ` [PATCH net-next 06/10] iavf: " Tony Nguyen
@ 2022-01-27 21:52 ` Tony Nguyen
2022-01-27 21:52 ` [PATCH net-next 08/10] igc: " Tony Nguyen
` (3 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Tony Nguyen @ 2022-01-27 21:52 UTC (permalink / raw)
To: davem, kuba
Cc: Christophe JAILLET, netdev, anthony.l.nguyen, Christoph Hellwig,
Alexander Lobakin, Gurucharan G
From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
As stated in [1], dma_set_mask() with a 64-bit mask never fails if
dev->dma_mask is non-NULL.
So, if it fails, the 32 bits case will also fail for the same reason.
Simplify code and remove some dead code accordingly.
[1]: https://lkml.org/lkml/2021/6/7/398
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Alexander Lobakin <alexandr.lobakin@intel.com>
Tested-by: Gurucharan G <gurucharanx.g@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
drivers/net/ethernet/intel/ice/ice_main.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c
index 30814435f779..f46af3b34074 100644
--- a/drivers/net/ethernet/intel/ice/ice_main.c
+++ b/drivers/net/ethernet/intel/ice/ice_main.c
@@ -4459,8 +4459,6 @@ ice_probe(struct pci_dev *pdev, const struct pci_device_id __always_unused *ent)
/* set up for high or low DMA */
err = dma_set_mask_and_coherent(dev, DMA_BIT_MASK(64));
- if (err)
- err = dma_set_mask_and_coherent(dev, DMA_BIT_MASK(32));
if (err) {
dev_err(dev, "DMA configuration failed: 0x%x\n", err);
return err;
--
2.31.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH net-next 08/10] igc: Remove useless DMA-32 fallback configuration
2022-01-27 21:52 [PATCH net-next 00/10][pull request] 1GbE Intel Wired LAN Driver Updates 2022-01-27 Tony Nguyen
` (6 preceding siblings ...)
2022-01-27 21:52 ` [PATCH net-next 07/10] ice: " Tony Nguyen
@ 2022-01-27 21:52 ` Tony Nguyen
2022-01-27 21:52 ` [PATCH net-next 09/10] igb: " Tony Nguyen
` (2 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Tony Nguyen @ 2022-01-27 21:52 UTC (permalink / raw)
To: davem, kuba; +Cc: Christophe JAILLET, netdev, anthony.l.nguyen
From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
As stated in [1], dma_set_mask() with a 64-bit mask never fails if
dev->dma_mask is non-NULL.
So, if it fails, the 32 bits case will also fail for the same reason.
So, if dma_set_mask_and_coherent() succeeds, 'pci_using_dac' is known to be
1.
Simplify code and remove some dead code accordingly.
[1]: https://lkml.org/lkml/2021/6/7/398
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
drivers/net/ethernet/intel/igc/igc_main.c | 19 ++++++-------------
1 file changed, 6 insertions(+), 13 deletions(-)
diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c
index 2f17f36e94fd..6b51baadee3d 100644
--- a/drivers/net/ethernet/intel/igc/igc_main.c
+++ b/drivers/net/ethernet/intel/igc/igc_main.c
@@ -6251,23 +6251,17 @@ static int igc_probe(struct pci_dev *pdev,
struct net_device *netdev;
struct igc_hw *hw;
const struct igc_info *ei = igc_info_tbl[ent->driver_data];
- int err, pci_using_dac;
+ int err;
err = pci_enable_device_mem(pdev);
if (err)
return err;
- pci_using_dac = 0;
err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
- if (!err) {
- pci_using_dac = 1;
- } else {
- err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
- if (err) {
- dev_err(&pdev->dev,
- "No usable DMA configuration, aborting\n");
- goto err_dma;
- }
+ if (err) {
+ dev_err(&pdev->dev,
+ "No usable DMA configuration, aborting\n");
+ goto err_dma;
}
err = pci_request_mem_regions(pdev, igc_driver_name);
@@ -6367,8 +6361,7 @@ static int igc_probe(struct pci_dev *pdev,
netdev->hw_features |= NETIF_F_HW_VLAN_CTAG_RX;
netdev->hw_features |= netdev->features;
- if (pci_using_dac)
- netdev->features |= NETIF_F_HIGHDMA;
+ netdev->features |= NETIF_F_HIGHDMA;
netdev->vlan_features |= netdev->features | NETIF_F_TSO_MANGLEID;
netdev->mpls_features |= NETIF_F_HW_CSUM;
--
2.31.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH net-next 09/10] igb: Remove useless DMA-32 fallback configuration
2022-01-27 21:52 [PATCH net-next 00/10][pull request] 1GbE Intel Wired LAN Driver Updates 2022-01-27 Tony Nguyen
` (7 preceding siblings ...)
2022-01-27 21:52 ` [PATCH net-next 08/10] igc: " Tony Nguyen
@ 2022-01-27 21:52 ` Tony Nguyen
2022-01-27 21:52 ` [PATCH net-next 10/10] igbvf: " Tony Nguyen
2022-01-28 3:10 ` [PATCH net-next 00/10][pull request] 1GbE Intel Wired LAN Driver Updates 2022-01-27 patchwork-bot+netdevbpf
10 siblings, 0 replies; 12+ messages in thread
From: Tony Nguyen @ 2022-01-27 21:52 UTC (permalink / raw)
To: davem, kuba; +Cc: Christophe JAILLET, netdev, anthony.l.nguyen, Gurucharan G
From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
As stated in [1], dma_set_mask() with a 64-bit mask never fails if
dev->dma_mask is non-NULL.
So, if it fails, the 32 bits case will also fail for the same reason.
So, if dma_set_mask_and_coherent() succeeds, 'pci_using_dac' is known to be
1.
Simplify code and remove some dead code accordingly.
[1]: https://lkml.org/lkml/2021/6/7/398
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Tested-by: Gurucharan G <gurucharanx.g@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
drivers/net/ethernet/intel/igb/igb_main.c | 19 ++++++-------------
1 file changed, 6 insertions(+), 13 deletions(-)
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index 38ba92022cd4..bfa321e4003f 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -3164,8 +3164,8 @@ static int igb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
s32 ret_val;
static int global_quad_port_a; /* global quad port a indication */
const struct e1000_info *ei = igb_info_tbl[ent->driver_data];
- int err, pci_using_dac;
u8 part_str[E1000_PBANUM_LENGTH];
+ int err;
/* Catch broken hardware that put the wrong VF device ID in
* the PCIe SR-IOV capability.
@@ -3180,17 +3180,11 @@ static int igb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
if (err)
return err;
- pci_using_dac = 0;
err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
- if (!err) {
- pci_using_dac = 1;
- } else {
- err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
- if (err) {
- dev_err(&pdev->dev,
- "No usable DMA configuration, aborting\n");
- goto err_dma;
- }
+ if (err) {
+ dev_err(&pdev->dev,
+ "No usable DMA configuration, aborting\n");
+ goto err_dma;
}
err = pci_request_mem_regions(pdev, igb_driver_name);
@@ -3306,8 +3300,7 @@ static int igb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
if (hw->mac.type >= e1000_i350)
netdev->hw_features |= NETIF_F_NTUPLE;
- if (pci_using_dac)
- netdev->features |= NETIF_F_HIGHDMA;
+ netdev->features |= NETIF_F_HIGHDMA;
netdev->vlan_features |= netdev->features | NETIF_F_TSO_MANGLEID;
netdev->mpls_features |= NETIF_F_HW_CSUM;
--
2.31.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH net-next 10/10] igbvf: Remove useless DMA-32 fallback configuration
2022-01-27 21:52 [PATCH net-next 00/10][pull request] 1GbE Intel Wired LAN Driver Updates 2022-01-27 Tony Nguyen
` (8 preceding siblings ...)
2022-01-27 21:52 ` [PATCH net-next 09/10] igb: " Tony Nguyen
@ 2022-01-27 21:52 ` Tony Nguyen
2022-01-28 3:10 ` [PATCH net-next 00/10][pull request] 1GbE Intel Wired LAN Driver Updates 2022-01-27 patchwork-bot+netdevbpf
10 siblings, 0 replies; 12+ messages in thread
From: Tony Nguyen @ 2022-01-27 21:52 UTC (permalink / raw)
To: davem, kuba
Cc: Christophe JAILLET, netdev, anthony.l.nguyen, Konrad Jankowski
From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
As stated in [1], dma_set_mask() with a 64-bit mask never fails if
dev->dma_mask is non-NULL.
So, if it fails, the 32 bits case will also fail for the same reason.
So, if dma_set_mask_and_coherent() succeeds, 'pci_using_dac' is known to be
1.
Simplify code and remove some dead code accordingly.
[1]: https://lkml.org/lkml/2021/6/7/398
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Tested-by: Konrad Jankowski <konrad0.jankowski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
drivers/net/ethernet/intel/igbvf/netdev.c | 22 ++++++----------------
1 file changed, 6 insertions(+), 16 deletions(-)
diff --git a/drivers/net/ethernet/intel/igbvf/netdev.c b/drivers/net/ethernet/intel/igbvf/netdev.c
index b78407289741..43ced78c3a2e 100644
--- a/drivers/net/ethernet/intel/igbvf/netdev.c
+++ b/drivers/net/ethernet/intel/igbvf/netdev.c
@@ -2684,25 +2684,18 @@ static int igbvf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
struct igbvf_adapter *adapter;
struct e1000_hw *hw;
const struct igbvf_info *ei = igbvf_info_tbl[ent->driver_data];
-
static int cards_found;
- int err, pci_using_dac;
+ int err;
err = pci_enable_device_mem(pdev);
if (err)
return err;
- pci_using_dac = 0;
err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
- if (!err) {
- pci_using_dac = 1;
- } else {
- err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
- if (err) {
- dev_err(&pdev->dev,
- "No usable DMA configuration, aborting\n");
- goto err_dma;
- }
+ if (err) {
+ dev_err(&pdev->dev,
+ "No usable DMA configuration, aborting\n");
+ goto err_dma;
}
err = pci_request_regions(pdev, igbvf_driver_name);
@@ -2783,10 +2776,7 @@ static int igbvf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
netdev->hw_features |= NETIF_F_GSO_PARTIAL |
IGBVF_GSO_PARTIAL_FEATURES;
- netdev->features = netdev->hw_features;
-
- if (pci_using_dac)
- netdev->features |= NETIF_F_HIGHDMA;
+ netdev->features = netdev->hw_features | NETIF_F_HIGHDMA;
netdev->vlan_features |= netdev->features | NETIF_F_TSO_MANGLEID;
netdev->mpls_features |= NETIF_F_HW_CSUM;
--
2.31.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH net-next 00/10][pull request] 1GbE Intel Wired LAN Driver Updates 2022-01-27
2022-01-27 21:52 [PATCH net-next 00/10][pull request] 1GbE Intel Wired LAN Driver Updates 2022-01-27 Tony Nguyen
` (9 preceding siblings ...)
2022-01-27 21:52 ` [PATCH net-next 10/10] igbvf: " Tony Nguyen
@ 2022-01-28 3:10 ` patchwork-bot+netdevbpf
10 siblings, 0 replies; 12+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-01-28 3:10 UTC (permalink / raw)
To: Tony Nguyen; +Cc: davem, kuba, netdev
Hello:
This series was applied to netdev/net-next.git (master)
by Tony Nguyen <anthony.l.nguyen@intel.com>:
On Thu, 27 Jan 2022 13:52:14 -0800 you wrote:
> Christophe Jaillet removes useless DMA-32 fallback calls from applicable
> Intel drivers and simplifies code as a result of the removal.
>
> The following are changes since commit e2cf07654efb0fd7bbcb475c6f74be7b5755a8fd:
> ptp: replace snprintf with sysfs_emit
> and are available in the git repository at:
> git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue 1GbE
>
> [...]
Here is the summary with links:
- [net-next,01/10] ixgb: Remove useless DMA-32 fallback configuration
https://git.kernel.org/netdev/net-next/c/64953720a2ba
- [net-next,02/10] ixgbe: Remove useless DMA-32 fallback configuration
https://git.kernel.org/netdev/net-next/c/4d361c6fd8d4
- [net-next,03/10] ixgbevf: Remove useless DMA-32 fallback configuration
https://git.kernel.org/netdev/net-next/c/90b83d013924
- [net-next,04/10] i40e: Remove useless DMA-32 fallback configuration
https://git.kernel.org/netdev/net-next/c/10ebc5464e40
- [net-next,05/10] e1000e: Remove useless DMA-32 fallback configuration
https://git.kernel.org/netdev/net-next/c/a34a42d87a08
- [net-next,06/10] iavf: Remove useless DMA-32 fallback configuration
https://git.kernel.org/netdev/net-next/c/9498d4affd61
- [net-next,07/10] ice: Remove useless DMA-32 fallback configuration
https://git.kernel.org/netdev/net-next/c/9c3e54a63263
- [net-next,08/10] igc: Remove useless DMA-32 fallback configuration
https://git.kernel.org/netdev/net-next/c/fea89930f2a1
- [net-next,09/10] igb: Remove useless DMA-32 fallback configuration
https://git.kernel.org/netdev/net-next/c/f80f4dc3b2c0
- [net-next,10/10] igbvf: Remove useless DMA-32 fallback configuration
https://git.kernel.org/netdev/net-next/c/ac9178926649
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
end of thread, other threads:[~2022-01-28 3:10 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-27 21:52 [PATCH net-next 00/10][pull request] 1GbE Intel Wired LAN Driver Updates 2022-01-27 Tony Nguyen
2022-01-27 21:52 ` [PATCH net-next 01/10] ixgb: Remove useless DMA-32 fallback configuration Tony Nguyen
2022-01-27 21:52 ` [PATCH net-next 02/10] ixgbe: " Tony Nguyen
2022-01-27 21:52 ` [PATCH net-next 03/10] ixgbevf: " Tony Nguyen
2022-01-27 21:52 ` [PATCH net-next 04/10] i40e: " Tony Nguyen
2022-01-27 21:52 ` [PATCH net-next 05/10] e1000e: " Tony Nguyen
2022-01-27 21:52 ` [PATCH net-next 06/10] iavf: " Tony Nguyen
2022-01-27 21:52 ` [PATCH net-next 07/10] ice: " Tony Nguyen
2022-01-27 21:52 ` [PATCH net-next 08/10] igc: " Tony Nguyen
2022-01-27 21:52 ` [PATCH net-next 09/10] igb: " Tony Nguyen
2022-01-27 21:52 ` [PATCH net-next 10/10] igbvf: " Tony Nguyen
2022-01-28 3:10 ` [PATCH net-next 00/10][pull request] 1GbE Intel Wired LAN Driver Updates 2022-01-27 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.