Commit Graph

16 Commits

Author SHA1 Message Date
Jakub Kicinski e7fd1a5a37 staging: qlge: use eth_hw_addr_set()
Commit 406f42fa0d ("net-next: When a bond have a massive amount
of VLANs...") introduced a rbtree for faster Ethernet address look
up. To maintain netdev->dev_addr in this tree we need to make all
the writes to it got through appropriate helpers.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Link: https://lore.kernel.org/r/20211019171243.1412240-5-kuba@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-20 19:33:58 +02:00
Coiby Xu 02988c36aa staging: qlge: remove mpi_core_to_log which sends coredump to the kernel ring buffer
devlink health could be used to get coredump. No need to send so much
data to the kernel ring buffer.

Signed-off-by: Coiby Xu <coiby.xu@gmail.com>
Link: https://lore.kernel.org/r/20210123104613.38359-7-coiby.xu@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-01-29 16:54:20 +01:00
Coiby Xu f8c047be54 staging: qlge: use qlge_* prefix to avoid namespace clashes with other qlogic drivers
To avoid namespace clashes with other qlogic drivers and also for the
sake of naming consistency, use the "qlge_" prefix as suggested in
drivers/staging/qlge/TODO,
 - For existing ql_ prefix,
   sed -i "s/ql_/qlge_/g" *.{c,h}
 - for structs not having a prefix
   1. get a list of structs
      grep "struct.*{" qlge.
   2. add qlge_ for each struct, e.g.,
      sed -i "s/ib_ae_iocb_rsp/qlge_ib_ae_iocb_rsp/g" *.{c,h}

Link: https://lore.kernel.org/patchwork/patch/1318503/#1516131
Suggested-by: Benjamin Poirier <benjamin.poirier@gmail.com>
Signed-off-by: Coiby Xu <coiby.xu@gmail.com>
Link: https://lore.kernel.org/r/20210123104613.38359-2-coiby.xu@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-01-29 16:54:20 +01:00
Elena Afanasova 87e6059da1 staging/qlge: fix typo
Reported by checkpatch.pl.

Signed-off-by: Elena Afanasova <eafanasova@gmail.com>
Link: https://lore.kernel.org/r/20201020150559.35667-1-eafanasova@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-10-26 06:53:10 +01:00
Sebastian Fuentes 608a911bcd staging: qlge: qlge_mpi: Fix several CHECKs involving braces
CHECK: Blank lines aren't necessary before a close brace '}'
FILE: drivers/staging/qlge/qlge_mpi.c:121:

CHECK: Unbalanced braces around else statement
FILE: drivers/staging/qlge/qlge_mpi.c:243:

CHECK: braces {} should be used on all arms of this statement
FILE: drivers/staging/qlge/qlge_mpi.c:350:

CHECK: Unbalanced braces around else statement
FILE: drivers/staging/qlge/qlge_mpi.c:352:

CHECK: Blank lines aren't necessary before a close brace '}'
FILE: drivers/staging/qlge/qlge_mpi.c:360:

CHECK: Blank lines aren't necessary after an open brace '{'
FILE: drivers/staging/qlge/qlge_mpi.c:408:

CHECK: braces {} should be used on all arms of this statement
FILE: drivers/staging/qlge/qlge_mpi.c:997:

CHECK: Unbalanced braces around else statement
FILE: drivers/staging/qlge/qlge_mpi.c:1001:

Signed-off-by: Sebastian Fuentes <sefu1789@gmail.com>
Link: https://lore.kernel.org/r/20200831014859.GA29362@ubuntu
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-09-01 19:48:11 +02:00
Gustavo A. R. Silva 02a25c9bbb staging: qlge: Use fallthrough pseudo-keyword
Replace the existing /* fall through */ comments and its variants with
the new pseudo-keyword macro fallthrough[1].

[1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through

Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Link: https://lore.kernel.org/r/20200727184042.GA29074@embeddedor
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-28 10:18:52 +02:00
Suraj Upadhyay 45170f100a staging: qlge: qlge_mpi: Simplify while statements.
Simplify while loops into more readable and simple for loops.

Signed-off-by: Suraj Upadhyay <usuraj35@gmail.com>
Link: https://lore.kernel.org/r/6eb96e8c074bbdee3838b6421d25b50f1faffb3d.1594642213.git.usuraj35@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-13 15:37:47 +02:00
Suraj Upadhyay ff98ca159b staging: qlge: Remove pci-dma-compat wrapper APIs.
The legacy API wrappers in include/linux/pci-dma-compat.h
should go away as it creates unnecessary midlayering
for include/linux/dma-mapping.h APIs, instead use dma-mapping.h
APIs directly.

The patch has been generated with the coccinelle script below
and compile-tested.

@@@@
- PCI_DMA_BIDIRECTIONAL
+ DMA_BIDIRECTIONAL

@@@@
- PCI_DMA_TODEVICE
+ DMA_TO_DEVICE

@@@@
- PCI_DMA_FROMDEVICE
+ DMA_FROM_DEVICE

@@@@
- PCI_DMA_NONE
+ DMA_NONE

@@ expression E1, E2, E3; @@
- pci_alloc_consistent(E1, E2, E3)
+ dma_alloc_coherent(&E1->dev, E2, E3, GFP_ATOMIC)

@@ expression E1, E2, E3; @@
- pci_zalloc_consistent(E1, E2, E3)
+ dma_alloc_coherent(&E1->dev, E2, E3, GFP_ATOMIC)

@@ expression E1, E2, E3, E4; @@
- pci_free_consistent(E1, E2, E3, E4)
+ dma_free_coherent(&E1->dev, E2, E3, E4)

@@ expression E1, E2, E3, E4; @@
- pci_map_single(E1, E2, E3, E4)
+ dma_map_single(&E1->dev, E2, E3, (enum dma_data_direction)E4)

@@ expression E1, E2, E3, E4; @@
- pci_unmap_single(E1, E2, E3, E4)
+ dma_unmap_single(&E1->dev, E2, E3, (enum dma_data_direction)E4)

@@ expression E1, E2, E3, E4, E5; @@
- pci_map_page(E1, E2, E3, E4, E5)
+ dma_map_page(&E1->dev, E2, E3, E4, (enum dma_data_direction)E5)

@@ expression E1, E2, E3, E4; @@
- pci_unmap_page(E1, E2, E3, E4)
+ dma_unmap_page(&E1->dev, E2, E3, (enum dma_data_direction)E4)

@@ expression E1, E2, E3, E4; @@
- pci_map_sg(E1, E2, E3, E4)
+ dma_map_sg(&E1->dev, E2, E3, (enum dma_data_direction)E4)

@@ expression E1, E2, E3, E4; @@
- pci_unmap_sg(E1, E2, E3, E4)
+ dma_unmap_sg(&E1->dev, E2, E3, (enum dma_data_direction)E4)

@@ expression E1, E2, E3, E4; @@
- pci_dma_sync_single_for_cpu(E1, E2, E3, E4)
+ dma_sync_single_for_cpu(&E1->dev, E2, E3, (enum dma_data_direction)E4)

@@ expression E1, E2, E3, E4; @@
- pci_dma_sync_single_for_device(E1, E2, E3, E4)
+ dma_sync_single_for_device(&E1->dev, E2, E3, (enum dma_data_direction)E4)

@@ expression E1, E2, E3, E4; @@
- pci_dma_sync_sg_for_cpu(E1, E2, E3, E4)
+ dma_sync_sg_for_cpu(&E1->dev, E2, E3, (enum dma_data_direction)E4)

@@ expression E1, E2, E3, E4; @@
- pci_dma_sync_sg_for_device(E1, E2, E3, E4)
+ dma_sync_sg_for_device(&E1->dev, E2, E3, (enum dma_data_direction)E4)

@@ expression E1, E2; @@
- pci_dma_mapping_error(E1, E2)
+ dma_mapping_error(&E1->dev, E2)

@@ expression E1, E2; @@
- pci_set_consistent_dma_mask(E1, E2)
+ dma_set_coherent_mask(&E1->dev, E2)

@@ expression E1, E2; @@
- pci_set_dma_mask(E1, E2)
+ dma_set_mask(&E1->dev, E2)

Signed-off-by: Suraj Upadhyay <usuraj35@gmail.com>
Link: https://lore.kernel.org/r/20200711124633.GA16459@blackclown
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-13 15:36:31 +02:00
Coiby Xu e42f623c3a staging: qlge: fix else after return or break
Remove unnecessary elses after return or break.

Signed-off-by: Coiby Xu <coiby.xu@gmail.com>
Link: https://lore.kernel.org/r/20200625215755.70329-3-coiby.xu@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-06-27 13:20:48 +02:00
Coiby Xu 1113c90c48 staging: qlge: fix trailing */ in block comment
Remove trailing "*/" in block comments.

Signed-off-by: Coiby Xu <coiby.xu@gmail.com>
Link: https://lore.kernel.org/r/20200625215755.70329-2-coiby.xu@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-06-27 13:20:48 +02:00
Payal Kshirsagar d66186b179 staging: qlge: qlge_mpi.c: remove an unneeded variable
Remove unneeded temporary local variable, cleanup suggested by coccinelle.

Signed-off-by: Payal Kshirsagar <payalskshirsagar1234@gmail.com>
Reviewed-by: Stefano Brivio <sbrivio@redhat.com>
Link: https://lore.kernel.org/r/20200312190624.24167-3-payalskshirsagar1234@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-03-17 14:00:45 +01:00
Carlos Henrique Lima Melara 7d50888090 staging: qlge: Fix WARNING: Missing a blank line after declarations
Fixed WARNING: Missing a blank line after declarations in qlge_mpi.c to
the following lines:

WARNING: Missing a blank line after declarations
FILE: drivers/staging/qlge/qlge_mpi.c:94:

WARNING: Missing a blank line after declarations
FILE: drivers/staging/qlge/qlge_mpi.c:240:

WARNING: Missing a blank line after declarations
FILE: drivers/staging/qlge/qlge_mpi.c:258:

WARNING: Missing a blank line after declarations
FILE: drivers/staging/qlge/qlge_mpi.c:356:

WARNING: Missing a blank line after declarations
FILE: drivers/staging/qlge/qlge_mpi.c:915:

WARNING: Missing a blank line after declarations
FILE: drivers/staging/qlge/qlge_mpi.c:1099:

Signed-off-by: Carlos Henrique Lima Melara <charlesmelara@outlook.com>
Link: https://lore.kernel.org/r/CP2PR80MB434086A44A1ED5BB662B9D70A8FC0@CP2PR80MB4340.lamprd80.prod.outlook.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-03-11 08:08:49 +01:00
Scott Schafer 1b998958b3 staging: qlge: Fix CHECK: Alignment should match open parenthesis
Fix CHECK: Alignment should match open parenthesis in qlge_dbg.c,
qlge_ethtool.c, qlge_main.c, and qlge_mpi.c. Also made changes to
the following lines:

WARNING: quoted string split across lines
FILE: drivers/staging/qlge/qlge_main.c:81

WARNING: quoted string split across lines
FILE: drivers/staging/qlge/qlge_main.c:87

WARNING: quoted string split across lines
FILE: drivers/staging/qlge/qlge_main.c:3528

WARNING: quoted string split across lines
FILE: drivers/staging/qlge/qlge_main.c:3536

CHECK: spaces preferred around that '*' (ctx:VxV)
drivers/staging/qlge/qlge_main.c:4102

I made these changes due to touching these lines in the original fix

Signed-off-by: Scott Schafer <schaferjscott@gmail.com>
Link: https://lore.kernel.org/r/27ec7ee0a3ba8c1ad946077aacfcc6e40b98c106.1576086080.git.schaferjscott@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-12-17 13:34:57 +01:00
Scott Schafer 25dde2435a staging: qlge: Fix CHECK extra blank lines in many files
Fix CHECK: Please don't use multiple blank lines in qlge.h, qlge_dbg.c,
qlge_ethtool.c, qlge_main.c, and qlge_mpi.c

Signed-off-by: Scott Schafer <schaferjscott@gmail.com>
Link: https://lore.kernel.org/r/9387760ae35bdeb606dc03ca9dd167f5214cd3a8.1576086080.git.schaferjscott@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-12-17 13:34:57 +01:00
Benjamin Poirier e759b5cf70 staging: qlge: Remove irq_cnt
qlge uses an irq enable/disable refcounting scheme that is:
* poorly implemented
	Uses a spin_lock to protect accesses to the irq_cnt atomic
	variable.
* buggy
	Breaks when there is not a 1:1 sequence of irq - napi_poll, such as
	when using SO_BUSY_POLL.
* unnecessary
	The purpose or irq_cnt is to reduce irq control writes when
	multiple work items result from one irq: the irq is re-enabled
	after all work is done.
	Analysis of the irq handler shows that there is only one case where
	there might be two workers scheduled at once, and those have
	separate irq masking bits.

Therefore, remove irq_cnt.

Additionally, we get a performance improvement:
perf stat -e cycles -a -r5 super_netperf 100 -H 192.168.33.1 -t TCP_RR

Before:
628560
628056
622103
622744
627202
[...]
   268,803,947,669      cycles                 ( +-  0.09% )

After:
636300
634106
634984
638555
634188
[...]
   259,237,291,449      cycles                 ( +-  0.19% )

Signed-off-by: Benjamin Poirier <bpoirier@suse.com>
Link: https://lore.kernel.org/r/20190927101210.23856-3-bpoirier@suse.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-10-04 17:17:44 +02:00
Benjamin Poirier 955315b0dc qlge: Move drivers/net/ethernet/qlogic/qlge/ to drivers/staging/qlge/
The hardware has been declared EOL by the vendor more than 5 years ago.
What's more relevant to the Linux kernel is that the quality of this driver
is not on par with many other mainline drivers.

Cc: Manish Chopra <manishc@marvell.com>
Message-id: <20190617074858.32467-1-bpoirier@suse.com>
Signed-off-by: Benjamin Poirier <bpoirier@suse.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-07-23 11:29:40 -07:00