Arnd Bergmann [Thu, 16 Jun 2016 11:38:22 +0000 (13:38 +0200)]
net: qlcnic: don't set unused function argument
We get a warning for qlcnic_83xx_get_mac_address when building with
"make W=1":
drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c: In function 'qlcnic_83xx_get_mac_address':
drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c:2156:8: error: parameter 'function' set but not used [-Werror=unused-but-set-parameter]
Clearly this is harmless, but there is also no point for setting
the variable, so we can simply remove the assignment.
Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Rajesh Borundia <rajesh.borundia@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Orabug: 25605962
(cherry picked from commit 287debd6aac5b9f60113d45931a53da0cd4adc94) Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
Variable length is not used after the deleted line.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: David S. Miller <davem@davemloft.net>
Orabug: 25605959
(cherry picked from commit 4fb482f73703d69ce23f9ddfa1c55acdb3cf49a6) Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
Gavin Shan [Mon, 23 May 2016 01:58:28 +0000 (11:58 +1000)]
net/qlge: Avoids recursive EEH error
One timer, whose handler keeps reading on MMIO register for EEH
core to detect error in time, is started when the PCI device driver
is loaded. MMIO register can't be accessed during PE reset in EEH
recovery. Otherwise, the unexpected recursive error is triggered.
The timer isn't closed that time if the interface isn't brought
up. So the unexpected recursive error is seen during EEH recovery
when the interface is down.
This avoids the unexpected recursive EEH error by closing the timer
in qlge_io_error_detected() before EEH PE reset unconditionally. The
timer is started unconditionally after EEH PE reset in qlge_io_resume().
Also, the timer should be closed unconditionally when the device is
removed from the system permanently in qlge_io_error_detected().
Reported-by: Shriya R. Kulkarni <shriyakul@in.ibm.com> Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Orabug: 25605959
(cherry picked from commit 3275c0c6c522ab04afa14f80efdac6213c3883d6) Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
qlge: Replace create_singlethread_workqueue with alloc_ordered_workqueue
Replace deprecated create_singlethread_workqueue with
alloc_ordered_workqueue.
Work items include getting tx/rx frame sizes, resetting MPI processor,
setting asic recovery bit so ordering seems necessary as only one work
item should be in queue/executing at any given time, hence the use of
alloc_ordered_workqueue.
WQ_MEM_RECLAIM flag has been set since ethernet devices seem to sit in
memory reclaim path, so to guarantee forward progress regardless of
memory pressure.
Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com> Acked-by: Tejun Heo <tj@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Orabug: 25605959
(cherry picked from commit ac18dd9e842294377dbaf1e8d169493567a81fa1) Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
Manish Chopra [Fri, 25 Mar 2016 11:14:09 +0000 (07:14 -0400)]
qlge: Update version to 1.00.00.35
Just updating version as many fixes got
accumulated over 1.00.00.34
Signed-off-by: Manish Chopra <manish.chopra@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Orabug: 25605959
(cherry picked from commit d31fecd1af991e39cbe27a59f290cdcefb7ba6ae) Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
Manish Chopra [Tue, 15 Mar 2016 11:13:45 +0000 (07:13 -0400)]
qlge: Fix receive packets drop.
When running small packets [length < 256 bytes] traffic, packets were
being dropped due to invalid data in those packets which were
delivered by the driver upto the stack. Using pci_dma_sync_single_for_cpu
ensures copying latest and updated data into skb from the receive buffer.
Signed-off-by: Sony Chacko <sony.chacko@qlogic.com> Signed-off-by: Manish Chopra <manish.chopra@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Orabug: 25605959
(cherry picked from commit 2c9a266afefe137bff06bbe0fc48b4d3b3cb348c) Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
Dan Carpenter [Tue, 15 Dec 2015 10:52:36 +0000 (13:52 +0300)]
qlge: fix a timeout loop in ql_change_rx_buffers()
The problem here is that after the loop we test for "if (!i) " but
because "i--" is a post-op we exit with i set to -1. I have fixed this
by changing it to a pre-op instead. I had to change the starting value
from 3 to 4 so that we still iterate 3 times.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Orabug: 25605959
(cherry picked from commit 351434c6ba92e1fe7799a0c33c1412584a0fb3de) Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
Joe Perches [Wed, 20 May 2015 04:44:52 +0000 (21:44 -0700)]
qlge: Move jiffies_to_usecs immediately before loop
30 usecs (or really, 1 jiffy) can go by pretty fast.
Move the set of the timeout immediately before the loop.
Remove the unnecessary max(1ul, usecs_to_jiffies(30)) as
usecs_to_jiffies with a non-zero constant is guaranteed
to be non-zero.
Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Orabug: 25605959
(cherry picked from commit 3f6e785fe113febd037af6351fc375eb428ff65b) Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
Dan Carpenter [Thu, 5 May 2016 13:20:20 +0000 (16:20 +0300)]
netxen: netxen_rom_fast_read() doesn't return -1
The error handling is broken here. netxen_rom_fast_read() returns zero
on success and -EIO on error. It never returns -1.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Orabug: 25605954
(cherry picked from commit 8c1f454625743d60763a23c58fa65681d3c98b6f) Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
Dan Carpenter [Thu, 5 May 2016 13:19:44 +0000 (16:19 +0300)]
netxen: reversed condition in netxen_nic_set_link_parameters()
My static checker complains that we are using "autoneg" without
initializing it. The problem is the ->phy_read() condition is reversed
so we only set this on error instead of success.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Orabug: 25605954
(cherry picked from commit 1c755ffa4fa3e2d4112cadd30142344789ad2fd2) Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
Dan Carpenter [Thu, 5 May 2016 13:18:46 +0000 (16:18 +0300)]
netxen: fix error handling in netxen_get_flash_block()
My static checker complained that "v" can be used unintialized if
netxen_rom_fast_read() returns -EIO. That function never actually
returns -1.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Orabug: 25605954
(cherry picked from commit 545fea54916af5e88f02346d85301ba0ecc143f3) Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Orabug: 25605954
(cherry picked from commit 016c0bbae1d17d4509b74227dca618e01263e61a) Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
Don Brace [Sat, 25 Feb 2017 00:08:04 +0000 (16:08 -0800)]
hpsa: update identify physical device structure
Align more closely with controller.
Reviewed-by: Scott Teel <scott.teel@microsemi.com> Signed-off-by: Don Brace <don.brace@microsemi.com>
Orabug: 25605941 Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
Don Brace [Sat, 25 Feb 2017 00:08:04 +0000 (16:08 -0800)]
hpsa: add in a new check for volume status
- Add in a new case for volume offline. Resolves internal
testing bug for multilun array management.
- was not returning correct value for failed TURs.
Signed-off-by: Don Brace <don.brace@microsemi.com>
Orabug: 25605941 Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
Don Brace [Sat, 25 Feb 2017 00:08:03 +0000 (16:08 -0800)]
hpsa: send ioaccel requests with 0 length trasfer down raid path
Block I/O requests with 0 length transfers which go down the ioaccel path.
This causes lockup issues down in the basecode. These issues have been
fixed, but there are customers who are experiencing the issues.
Signed-off-by: Don Brace <don.brace@microsemi.com>
Orabug: 25605941 Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
Don Brace [Sat, 25 Feb 2017 00:03:04 +0000 (16:03 -0800)]
hpsa: bump driver version
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com> Reviewed-by: Scott Teel <scott.teel@microsemi.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Don Brace <don.brace@microsemi.com>
Orabug: 25605941 Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
Don Brace [Mon, 30 Jan 2017 22:05:17 +0000 (16:05 -0600)]
scsi: hpsa: remove coalescing settings for ioaccel2
- Setting coalescing has a significant negative impact on low
queue-depth performance.
- Does not help high queue-depth performance.
Signed-off-by: Don Brace <don.brace@microsemi.com> Reviewed-by: Scott Benesh <scott.benesh@microsemi.com> Reviewed-by: Scott Teel <scott.teel@microsemi.com> Reviewed-by: Kevin Barnett <kevin.barnett@microsemi.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Orabug: 25605941
(cherry picked from commit 96b6ce4e8b66b009396799843d6191fefcc36c33) Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
Kees Cook [Sat, 17 Dec 2016 01:04:49 +0000 (17:04 -0800)]
scsi: hpsa: use designated initializers
Prepare to mark sensitive kernel structures for randomization by making
sure they're using designated initializers. These were identified during
allyesconfig builds of x86, arm, and arm64, with most initializer fixes
extracted from grsecurity.
Signed-off-by: Kees Cook <keescook@chromium.org> Acked-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Orabug: 25605941
(cherry picked from commit 93380123fbb5357d3ea6935efc9226df3c59099d) Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
This patch cleanup warning reported by checkpatch.pl WARNING: Possible
unnecessary 'out of memory' message With no available memory, a warn on
message already gets printed by page alloc apis and modified goto use if
memory unallocated.
Signed-off-by: Amit Kushwaha <kushwaha.a@samsung.com> Acked-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Orabug: 25605941
(cherry picked from commit 7e8a9486786d5ede1d2405fab140c6a0d8b2c1fe) Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
Hannes Reinecke [Fri, 2 Dec 2016 10:36:13 +0000 (11:36 +0100)]
scsi: hpsa: fallback to use legacy REPORT PHYS command
Older SmartArray controllers (eg SmartArray 64xx) do not support the
extended REPORT PHYS command, so fallback to use the legacy version
here.
Signed-off-by: Hannes Reinecke <hare@suse.com> Acked-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Orabug: 25605941
(cherry picked from commit 2a80d5458a027f6d514987c09f0b51f45c3a5be4) Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
There's one more candidate, unique_id_show, but that uses %02X, and I'm
not sure it would be ok to start using lowercase there, so I've left it
alone for now.
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk> Acked-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Orabug: 25605941
(cherry picked from commit 609a70df07af1ff857257fb2e93c3ef281e30710) Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
Hannes Reinecke [Fri, 18 Nov 2016 07:32:49 +0000 (08:32 +0100)]
scsi: hpsa: add 'ctlr_num' sysfs attribute
Add a sysfs attribute 'ctlr_num' holding the current HPSA controller
number. This is required to construct compability 'cciss' links.
[mkp: fixed typo]
Signed-off-by: Hannes Reinecke <hare@suse.com> Acked-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Orabug: 25605941
(cherry picked from commit 16961204a0ebcb87b89ed3be14b0a484c754d7e4) Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
Hannes Reinecke [Fri, 18 Nov 2016 07:32:47 +0000 (08:32 +0100)]
scsi: hpsa: use correct DID_NO_CONNECT hostbyte
NOT_READY is a sense key, not a legit scsi hostbyte value. Use
DID_NO_CONNECT instead.
Signed-off-by: Hannes Reinecke <hare@suse.com> Acked-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Orabug: 25605941
(cherry picked from commit 1ccde7004ff66cdcbe4c8005f3bb44dda6ab0b99) Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
Hannes Reinecke [Thu, 17 Nov 2016 11:15:56 +0000 (12:15 +0100)]
scsi: hpsa: use bus '3' for legacy HBA devices
Older controllers use SCSI target id '0' for the first internal disk. As
the controllers are now placed on the same bus as the internal disks
this leads to a clash with the SCSI target id of controller. This patch
checks the SCSI revision, and moves older controller to bus '3' to be
compatible with older releases and avoid this problem.
[mkp: fixed uninitialized variable]
Fixes: 09371d623c9 ("hpsa: Change SAS transport devices to bus 0.") Cc: <stable@vger.kernel.org> # v4.5+ Signed-off-by: Hannes Reinecke <hare@suse.com> Acked-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Orabug: 25605941
(cherry picked from commit 7630b3a599e2c6d1c042945d32ff2debc855ad29) Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
Don Brace [Tue, 15 Nov 2016 20:45:32 +0000 (14:45 -0600)]
scsi: hpsa: correct logical resets
- driver was not calling done in some cases which causes the volume to
be offlined.
- avoid doing rescan during a reset.
Reviewed-by: Scott Teel <scott.teel@microsemi.com> Reviewed-by: Kevin Barnett <kevin.barnett@microsemi.com> Signed-off-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Orabug: 25605941
(cherry picked from commit bfd7546cd19abf0f8a08c1339a917fe326fcfc71) Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
Javier Martinez Canillas [Thu, 13 Oct 2016 16:10:08 +0000 (13:10 -0300)]
scsi: hpsa: Remove unneeded void pointer cast
It's not necessary to cast the result of kmalloc, since void pointers
are promoted to any other type. This also fixes following coccinelle
warning:
casting value returned by memory allocation function to (BIG_IOCTL_Command_struct *) is useless.
Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Acked-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Orabug: 25605941
(cherry picked from commit 19be606be1df35479333bd04e2cdaddc9d77e38c) Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
Don Brace [Tue, 20 Sep 2016 20:42:30 +0000 (15:42 -0500)]
scsi: hpsa: correct call to hpsa_do_reset
calling fill_cmd() using a MACRO definition not handled in switch
statement causes BUG() to be called.
Signed-off-by: Don Brace <don.brace@microsemi.com> Reviewed-by: Scott Teel <scott.teel@microsemi.com> Reviewed-by: Kevin Barnett <kevin.barnett@microsemi.com> Reviewed-by: Tomas Henzl <thenzl@redhat.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Orabug: 25605941
(cherry picked from commit b32ece0ff70c30e59f16e9a8ffd05acc27298ba3) Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
Missing 5 bits of byte 1 in the LBA issued by SML.
Reported-by: Mahesh Rajashekhara <mahesh.rajashekhara@microsemi.com> Reviewed-by: Scott Teel <scott.teel@microsemi.com> Reviewed-by: Kevin Barnett <kevin.barnett@microsemi.com> Signed-off-by: Mahesh Rajashekhara <mahesh.rajashekhara@microsemi.com> Signed-off-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Orabug: 25605941
(cherry picked from commit abbada7175999fbd6500b8144e985b779588962f) Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
Don Brace [Fri, 9 Sep 2016 21:30:42 +0000 (16:30 -0500)]
scsi: hpsa: Check for null devices in ioaccel submission patch
Reviewed-by: Scott Benesh <scott.benest@microsemi.com> Reviewed-by: Scott Teel <scott.teel@microsemi.com> Reviewed-by: Kevin Barnett <kevin.barnett@microsemi.com> Signed-off-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Orabug: 25605941
(cherry picked from commit 45e596cd6ead1c4ada74b03067595d7f4502fa6a) Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
Scott Teel [Fri, 9 Sep 2016 21:30:36 +0000 (16:30 -0500)]
scsi: hpsa: Prevent sending bmic commands to externals
Reviewed-by: Scott Benesh <scott.benest@microsemi.com> Reviewed-by: Scott Teel <scott.teel@microsemi.com> Reviewed-by: Kevin Barnett <kevin.barnett@microsemi.com> Signed-off-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Orabug: 25605941
(cherry picked from commit 4b6e5597f4c9ae545a1bd18e830d9f6b4465cadd) Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
Scott Teel [Fri, 9 Sep 2016 21:30:29 +0000 (16:30 -0500)]
scsi: hpsa: Check for vpd support before sending
Before using vendor-specific VPD pages for getting raid_level and
device_id, check for page support. If page isn't supported, don't try
to use it. Also, pay attention to return status on hpsa_get_device_id.
[mkp: fix boolean return warnings reported by kbuild test robot]
Reviewed-by: Scott Benesh <scott.benest@microsemi.com> Reviewed-by: Scott Teel <scott.teel@microsemi.com> Reviewed-by: Kevin Barnett <kevin.barnett@microsemi.com> Signed-off-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Orabug: 25605941
(cherry picked from commit 8383278d28b9bc598225f163b6644b8b09f2733d) Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
Don Brace [Fri, 9 Sep 2016 21:30:23 +0000 (16:30 -0500)]
scsi: hpsa: Check for null device pointers
A device can be deleted causing NULL pointer issues.
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com> Reviewed-by: Scott Teel <scott.teel@microsemi.com> Reviewed-by: Kevin Barnett <kevin.barnett@microsemi.com> Signed-off-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Orabug: 25605941
(cherry picked from commit d49c2077c03d70a59e3063c7d33f00172491ae31) Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
Don Brace [Fri, 9 Sep 2016 21:30:17 +0000 (16:30 -0500)]
scsi: hpsa: Determine device external status earlier
Currently we are checking for external status before we are determining
if a device is an external device.
Reviewed-by: Scott Benesh <scott.benest@microsemi.com> Reviewed-by: Scott Teel <scott.teel@microsemi.com> Reviewed-by: Kevin Barnett <kevin.barnett@microsemi.com> Signed-off-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Orabug: 25605941
(cherry picked from commit 86cf7130a58bd2cdd09da72cdadae0dcd5f5db19) Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
Don Brace [Fri, 1 Jul 2016 18:37:38 +0000 (13:37 -0500)]
hpsa: change hpsa_passthru_ioctl timeout
Was not alloting for FW Flash times.
Reviewed-by: Scott Teel <scott.teel@microsemi.com> Reviewed-by: Kevin Barnett <kevin.barnett@microsemi.com> Signed-off-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Orabug: 25605941
(cherry picked from commit 3fb134cb4c170debf2b786d689fe263186feea4b) Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
Don Brace [Fri, 1 Jul 2016 18:37:31 +0000 (13:37 -0500)]
hpsa: correct skipping masked peripherals
The SA controller spins down RAID drive spares.
A REGNEWD event causes an inquiry to be sent to all physical
drives. This causes the SA controller to spin up the spare.
The controller suspends all I/O to a logical volume until
the spare is spun up. The spin-up can take over 50 seconds.
This can result in one or both of the following:
- SML sends down aborts and resets to the logical volume
and can cause the logical volume to be off-lined.
- a negative impact on the logical volume's I/O performance
each time a REGNEWD is triggered.
Reviewed-by: Scott Teel <scott.teel@microsemi.com> Reviewed-by: Kevin Barnett <kevin.barnett@microsemi.com> Signed-off-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Orabug: 25605941
(cherry picked from commit 64ce60cab24603ac0fcd59c9fbc3be78f4c4d229) Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
Dan Carpenter [Thu, 14 Apr 2016 09:37:44 +0000 (12:37 +0300)]
hpsa: set the enclosure identifier to zero
This has only called from show_sas_rphy_enclosure_identifier(). The
caller expects that we set an identifier, otherwise it uses an
uninitialized variable.
[mkp: fixed typo]
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Orabug: 25605941
(cherry picked from commit aa105695732daa6604cb017ceb59a05ef34956bd) Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 7a655c6324a8968ea2f027bf3660c87c42ac3de4) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Driver sets the skb l4/l3 hash based on NIC_CFG_RSS_HASH_TYPE_*,
which is bit mask. This is wrong. Hw actually provides us enum.
Use CQ_ENET_RQ_DESC_RSS_TYPE_* to set l3 and l4 hash type.
Fixes: bf751ba802fe ("driver/net: enic: record q_number and rss_hash for skb") Signed-off-by: Govindarajulu Varadarajan <_govind@gmx.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 17197236d62c44da127be461c63ac5cc2cce1e53) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Conflicts:
drivers/net/ethernet/cisco/enic/enic.h
When MTU is changed from 9000 to 1500 while there is burst of inbound 9000
bytes packets, adaptor sometimes delivers 9000 bytes packets to 1500 bytes
buffers. This causes memory corruption and sometimes crash.
This is because of a race condition in adaptor between "RQ disable"
clearing descriptor mini-cache and mini-cache valid bit being set by
completion of descriptor fetch. This can result in stale RQ desc being
cached and used when packets arrive. In this case, the stale descriptor
have old MTU value.
Solution is to write RQ->disable twice. The first write will stop any
further desc fetches, allowing the second disable to clear the mini-cache
valid bit without danger of a race.
Also, the check for rq->running becoming 0 after writing rq->enable to 0
is not done properly. When incoming packets are flooding the interface,
rq->running will pulse high for each dropped packet. Since the driver was
waiting for 10us between each poll, it is possible to see rq->running = 1
1000 times in a row, even though it is not actually stuck running.
This results in false failure of vnic_rq_disable(). Fix is to try more
than 1000 time without delay between polls to ensure we do not miss when
running goes low.
In old adaptors rq->enable needs to be re-written to 0 when posted_index
is reset in vnic_rq_clean() in order to keep rq->prefetch_index in sync.
Signed-off-by: Govindarajulu Varadarajan <_govind@gmx.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 9fe1c98ac90023842ae7cd921badfa1029e45bd1) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 8d546f58ec441d1377457b2134fb27ba2455d9f8) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Driver sets vlan_feature to netdev->features as hardware supports all of
them on vlan interface.
Signed-off-by: Govindarajulu Varadarajan <_govind@gmx.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit e7600449bef0650ee7818be6de26955e81579d13) Signed-off-by: Brian Maly <brian.maly@oracle.com>
o Use the more common ##__VA_ARGS__ extension
o Add missing newlines to formats
o Realign arguments
Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit e327f4e193b6a176f4dc3b19faf6371a8917588d) Signed-off-by: Brian Maly <brian.maly@oracle.com>
The affinity hint is used by the user space daemon, irqbalancer, to
indicate a preferred CPU mask for irqs. This patch sets the irq affinity
hint to local numa core first, when exausted we try non-local numa cores.
Also set tx xps cpus mask bassed on affinity hint.
v2: remove the global affinity policy.
Signed-off-by: Govindarajulu Varadarajan <_govind@gmx.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 322cf7e3a4e89236ae386cb5668ae0d787d21136) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Signed-off-by: Netanel Belgazal <netanel@annapurnalabs.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 3e5d6897176d38b54124da56183810abbd68c8bc) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Move the host info config to be the first admin command that is executed.
This change require the driver to remove the 'feature check'
from host info configuration flow.
The check is removed since the supported features bitmask field
is retrieved only after calling ENA_ADMIN_DEVICE_ATTRIBUTES admin command.
If set host info is not supported an error will be returned by the device.
Signed-off-by: Netanel Belgazal <netanel@annapurnalabs.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit dd8427a78ffccbacf166a2d5d5eae55b586e1afe) Signed-off-by: Brian Maly <brian.maly@oracle.com>
The timeouts were too agressive and sometimes cause false alarms.
Signed-off-by: Netanel Belgazal <netanel@annapurnalabs.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 7102a18ac3f323805e3cd8f3dc64907644608c1e) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Signed-off-by: Netanel Belgazal <netanel@annapurnalabs.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 5add6e4a222f2eb437992af6b39c8a9c9a28604a) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Completion descriptors are accessed from the driver and from the device.
To avoid reading the old value, use READ_ONCE macro.
Signed-off-by: Netanel Belgazal <netanel@annapurnalabs.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit a8496eb81342393e4c8280a5ec27e1872a3fb9fd) Signed-off-by: Brian Maly <brian.maly@oracle.com>
If the ena driver detects that the device is not behave as expected,
it tries to reset the device.
The reset flow calls ena_down, which will frees all the resources
the driver allocates and then it will reset the device.
This flow can cause memory corruption if the device is still writes
to the driver's memory space.
To overcome this potential race, move the reset before the device
resources are freed.
Signed-off-by: Netanel Belgazal <netanel@annapurnalabs.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 3f6159dbfc24c5e61fb5deb9b69e0abb934609bb) Signed-off-by: Brian Maly <brian.maly@oracle.com>
ndo_get_stat64() can be called from atomic context, but the current
implementation sends an admin command to retrieve the statistics from
the device. This admin command can sleep.
This patch re-factors the implementation of ena_get_stats64() to use
the {rx,tx}bytes/count from the driver's inner counters, and to obtain
the rx drop counter from the asynchronous keep alive (heart bit)
event.
Signed-off-by: Netanel Belgazal <netanel@annapurnalabs.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit d81db24056132fe8b83e2fba337e9ea76675e68d) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Conflicts:
drivers/net/ethernet/amazon/ena/ena_netdev.c
If for some reason the device stops responding, and the device reset
failes to recover the device, the mmio register read data structure
will not be reinitialized.
On driver removal, the driver will also try to reset the device, but
this time the mmio data structure will be NULL.
To solve this issue, perform the device reset in the remove function
only if the device is runnig.
Signed-off-by: Netanel Belgazal <netanel@annapurnalabs.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 22b331c9e0a345126708af60f7d00d38b53db70b) Signed-off-by: Brian Maly <brian.maly@oracle.com>
ENA default hash configures IPv4_frag hash twice instead of
configure non-IP packets.
The bug caused IPv4 fragmented packets to be calculated based on
L2 source and destination address instead of L3 source and destination.
IPv4 packets can reach to the wrong Rx queue.
Signed-off-by: Netanel Belgazal <netanel@annapurnalabs.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 422e21e7619bb8751aa1cd32a9b671b1baaf3d18) Signed-off-by: Brian Maly <brian.maly@oracle.com>
ena_flow_data_to_flow_hash and ena_flow_hash_to_flow_type
treat the ena_flow_hash_to_flow_type enum as power of two values.
Change the values of ena_admin_flow_hash_fields to be power of two values.
This bug effect the ethtool set/get rxnfc.
ethtool will report wrong values hash fields for get and will
configure wrong hash fields in set.
Signed-off-by: Netanel Belgazal <netanel@annapurnalabs.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 6e2de20ddc4b606a9b6b170a6bb21ee4dc4ad93a) Signed-off-by: Brian Maly <brian.maly@oracle.com>
The ENA driver tries to open a queue per vCPU.
To determine how many vCPUs the instance have it uses num_possible_cpus()
while it should have use num_online_cpus() instead.
Signed-off-by: Netanel Belgazal <netanel@annapurnalabs.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 6a1ce2fb67161f249b372a87d1d9899d8b087c8e) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Remove NETIF_F_NTUPLE from netdev->features.
The ENA device driver does not support ntuple filtering.
Signed-off-by: Netanel Belgazal <netanel@annapurnalabs.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit fdeea0ad87fd05e5fcb5e7b6643eabc34f29405a) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Use setup_timer() instead of init_timer(), being the preferred/standard
way to set a timer up.
Also, quoting the mod_timer() function comment:
-> mod_timer() is a more efficient way to update the expire field of an
active timer (if the timer is inactive it will be activated).
Use setup_timer and mod_timer to setup and arm a timer, to make the code
cleaner and easier to read.
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit f850b4a77d71a9cac513dadff91891a78c12ba05) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Driver changes the link properties via communication with
the management firmware, and re-reads the resulting link status
when it receives an indication that the link has changed.
However, there are certain scenarios where such indications
might be missing, and so driver also re-reads the current link
results without attention in several places. Specifically, it
does so during load and when resetting the link.
This creates a race where driver might reflect incorrect
link status - e.g., when explicit reading of the link status is
switched by attention with the changed configuration.
Correct this flow by a lock syncronizing the handling of the
link indications [both explicit requests and attention].
Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 65ed2ffd640578166e4ec149573bcf1d10f81b81) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Conflicts:
drivers/net/ethernet/qlogic/qed/qed_sriov.h
Flows accessing registers require the flow to hold a PTT entry.
To protect 'major' load/unload flows a main_ptt is pre-allocated
to guarantee such flows wouldn't be blocked by PTT being
unavailable.
Status block initialization currently uses the main_ptt which
is incorrect, as this flow might run concurrently to others
[E.g., loading qedr while toggling qede]. That would have dire
effects as it means registers' access to device breaks and further
read/writes might access incorrect addresses.
Instead, when initializing status blocks acquire/release a PTT
as part of the flow.
Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 85750d74fba5a7c31309c038c5f9f019edc6ea31) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Driver currently utilizes the same loop variable in two
nested loops.
Signed-off-by: Sudarsana Reddy Kalluru <Sudarsana.Kalluru@cavium.com> Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit afe981d664aeeebc8d1bcbd7d2070b5432edaecb) Signed-off-by: Brian Maly <brian.maly@oracle.com>
VF learns of the current link state via its bulletin board,
which might reflect either the physical link state or some
user-configured logical state.
Whenever the physical link changes or whnever such a configuration
is explicitly made by user the PF driver would update the bulletin
that the VF reads. But if neither has happened - i.e., PF still
hasn't got a physical link up and no additional configuration was
done the VF wouldn't have a valid link information available.
Simply reflect the physical link state whenever the VF is
initialized. The user could then affect it however he wants.
Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 33b2fbd0a8d3c556b802d8753ac5bb3e8f90e988) Signed-off-by: Brian Maly <brian.maly@oracle.com>
qed needs to be informed of the removal of the qede interface
prior to its actual removal, as qede has some registered callbacks
that might get called async to the removal flow.
Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 885185dfc49bde35b45046bb6b7384eca68e404f) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Conflicts:
drivers/net/ethernet/qlogic/qede/qede_main.c
Need to make sure the slowpath workqueue and the qede lock
are ready for the registration of the netdevice, as once
registered there's no guarantee those wouldn't be used.
Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 0e0b80a9a7181cbdbb965a6b4750574932106e31) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Reserving doorbell BAR space according to the currently active CPUs
may result in a bug if disabled CPUs are later enabled but no
doorbell space was reserved for them.
Signed-off-by: Ram Amrani <Ram.Amrani@cavium.com> Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit c2dedf8773e873474535bd4a158609b9eda5403d) Signed-off-by: Brian Maly <brian.maly@oracle.com>
If QP is in reset state then there are no resources to free so avoid
freeing any.
Signed-off-by: Ram Amrani <Ram.Amrani@cavium.com> Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 300c0d7c232da572cb640f3bc803554f74e08f69) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Currently the state is read only after the buffers are relesed.
Signed-off-by: Ram Amrani <Ram.Amrani@cavium.com> Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit c5212b943d4b52a7d9e0d9f747e7ad59c50d31f1) Signed-off-by: Brian Maly <brian.maly@oracle.com>
The CQ resource pool is protected by a spin lock. When a CQ creation
fails it now deallocates under that lock as well.
Signed-off-by: Ram Amrani <Ram.Amrani@cavium.com> Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 670dde55c6f182b8a159f0484be92b89d82107e1) Signed-off-by: Brian Maly <brian.maly@oracle.com>
This adds the backbone required for the various HW initalizations
which are necessary for the FCoE driver (qedf) for QLogic FastLinQ
4xxxx line of adapters - FW notification, resource initializations, etc.
Signed-off-by: Arun Easi <arun.easi@cavium.com> Signed-off-by: Yuval Mintz <yuval.mintz@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 1e128c81290a419ab9ec8b09fe989f1c6c15a0f4) Signed-off-by: Brian Maly <brian.maly@oracle.com>
The patch adds the required qed interfaces for configuring/reading
the PTP clock on the adapter.
Signed-off-by: Sudarsana Reddy Kalluru <Sudarsana.Kalluru@cavium.com> Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit c78c70fa30e23dc6cdb394f6c13880919499fba5) Signed-off-by: Brian Maly <brian.maly@oracle.com>
struct qed_ll2_info is rather large, so putting it on the stack
can cause an overflow, as this warning tries to tell us:
drivers/net/ethernet/qlogic/qed/qed_ll2.c: In function 'qed_ll2_start':
drivers/net/ethernet/qlogic/qed/qed_ll2.c:2159:1: error: the frame size of 1056 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]
qed_ll2_start_ooo() already uses a dynamic allocation for the structure
to work around that problem, and we could do the same in qed_ll2_start()
as well as qed_roce_ll2_start(), but since the structure is only
used to pass a couple of initialization values here, it seems nicer
to replace it with a different structure.
Lacking any idea for better naming, I'm adding 'struct qed_ll2_conn',
which now contains all the initialization data, and this now simply
gets copied into struct qed_ll2_info rather than assigning all members
one by one.
Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Yuval Mintz <Yuval.Mintz@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 0629a330cf55454962168dd3ee46fad53a39323e) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Use eth_zero_addr to assign zero address to the given address array
instead of memset when the second argument in memset is address
of zero. Also, it makes the code clearer
Signed-off-by: Shyam Saini <mayhs11saini@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 0ee28e31553a6f2ed13223e565ae5a4d7a376942) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Conflicts:
drivers/net/ethernet/qlogic/qed/qed_sriov.c
Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit ce742922acdc4219509bf5b57e0a073990abfa28) Signed-off-by: Brian Maly <brian.maly@oracle.com>
If qedr isn't part of the kernel then don't allocate RDMA resources
for it in qed.
Signed-off-by: Ram Amrani <Ram.Amrani@cavium.com> Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 1fe582ecade714e90e71c67c32edb7b5b809d651) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Currently multicast traffic wouldn't be routed internally to
listener; Instead it would only be sent to network via the
physical carrier.
Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 8806787609dea02c333b187f94c1556798ac8897) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Today qede requests contexts that would suffice for 64 'whole'
combined queues [192 meant for 64 rx, tx and xdp tx queues],
but registers netdev and limits the number of queues based on
information received by qed. In turn, qed doesn't take context
into account when informing qede how many queues it can support.
This would lead to a configuration problem in case user tries
configuring >64 combined queues to interface [or >96 in case
xdp isn't enabled]. Since we don't have a mangement firware
that actually provides so many interrupt lines to a single
device we're currently safe but that's about to change soon.
The new maximum is hence changed:
- For RoCE devices, the limit would remain 64.
- For non-RoCE devices, the limit might be higher [depending
on the actual configuration of the device].
qed would start enforcing that limit in both scenarios.
Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit e1d32acbcbd35af5264acc70ff03bf8da9e447a8) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Conflicts:
drivers/net/ethernet/qlogic/qede/qede_main.c
Since the submission of the qedr driver, there's inconsistency
in the licensing of the various qed/qede files - some are GPLv2
and some are dual-license.
Since qedr requires dual-license and it's dependent on both,
we're updating the licensing of all qed/qede source files.
Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit e8f1cb507d01205e03f69809af4347ed8ec9db5b) Signed-off-by: Brian Maly <brian.maly@oracle.com>
The newly added file causes a harmless warning, with "make W=1":
drivers/net/ethernet/qlogic/qed/qed_iscsi.c: In function 'qed_get_iscsi_ops':
drivers/net/ethernet/qlogic/qed/qed_iscsi.c:1268:29: warning: old-style function definition [-Wold-style-definition]
This makes it a proper prototype.
Fixes: fc831825f99e ("qed: Add support for hardware offloaded iSCSI.") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 7729bad4fd95e48bcafcb2222c63a8a5cdc42f61) Signed-off-by: Brian Maly <brian.maly@oracle.com>
The recent introduction of qedr driver support in qede causes a GPF when probing the driver in a server without a RoCE enabled QLogic NIC. This fix avoids using an uninitialized pointer in such a case. Caught by the kernel test robot.
Signed-off-by: Ram Amrani <Ram.Amrani@cavium.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
(cherry picked from commit 22b1ae6169e3cb9e33ba549a0c07a0cc469143d7) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Since offset is zero, it's not necessary to use set function. Reset
function is straightforward, and will remove the unnecessary add
operation in set function.
Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com> Acked-by: Yuval Mintz <Yuval.Mintz@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 90caf3c9d46dd9a24adc7dae6e1909348b3c37c4) Signed-off-by: Brian Maly <brian.maly@oracle.com>
This patch adds out of order packet handling for hardware offloaded
iSCSI. Out of order packet handling requires driver buffer allocation
and assistance.
Signed-off-by: Arun Easi <arun.easi@cavium.com> Signed-off-by: Yuval Mintz <yuval.mintz@cavium.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 1d6cff4fca4366d0529dbce170e0f33cfe213790) Signed-off-by: Brian Maly <brian.maly@oracle.com>
This adds the backbone required for the various HW initalizations
which are necessary for the iSCSI driver (qedi) for QLogic FastLinQ
4xxxx line of adapters - FW notification, resource initializations, etc.
Signed-off-by: Arun Easi <arun.easi@cavium.com> Signed-off-by: Yuval Mintz <yuval.mintz@cavium.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit fc831825f99eb3a2f1bf3fe7307b392513b642a5) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Conflicts:
drivers/net/ethernet/qlogic/Kconfig
Improve the cacheline usage of both queues by reordering -
This reduces the cachelines required for egress datapath processing
from 3 to 2 and those required by ingress datapath processing by 2.
It also changes a couple of datapath related functions that currently
require either the fastpath or the qede_dev, changing them to be based
on the tx/rx queue instead.
Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 9eb22357d568aee18f7ce4d0797d96fe7fcd2f71) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Conflicts:
drivers/net/ethernet/qlogic/qede/qede_main.c
Receive-hashing is a fixed feature, so there's no need to check
during the ingress datapath whether it's set or not.
Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 8a4725306522c875fca4bff4bd14a46e97690f48) Signed-off-by: Brian Maly <brian.maly@oracle.com>
The driver needs to maintain several FW/HW-indices for each one of
its queues. Currently, that mapping is done by the QED where it uses
an rx/tx array of so-called hw-cids, populating them whenever a new
queue is opened and clearing them upon destruction of said queues.
This maintenance is far from ideal - there's no real reason why
QED needs to maintain such a data-structure. It becomes even worse
when considering the fact that the PF's queues and its child VFs' queues
are all mapped into the same data-structure.
As a by-product, the set of parameters an interface needs to supply for
queue APIs is non-trivial, and some of the variables in the API
structures have different meaning depending on their exact place
in the configuration flow.
This patch re-organizes the way L2 queues are configured and maintained.
In short:
- Required parameters for queue init are now well-defined.
- Qed would allocate a queue-cid based on parameters.
Upon initialization success, it would return a handle to caller.
- Queue-handle would be maintained by entity requesting queue-init,
not necessarily qed.
- All further queue-APIs [update, destroy] would use the opaque
handle as reference for the queue instead of various indices.
The possible owners of such handles:
- PF queues [qede] - complete handles based on provided configuration.
- VF queues [qede] - fw-context-less handles, containing only relative
information; Only the PF-side would need the absolute indices
for configuration, so they're omitted here.
- VF queues [qed, PF-side] - complete handles based on VF initialization.
Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 3da7a37ae6886cfba9ef35428eb976fc2ef561fa) Signed-off-by: Brian Maly <brian.maly@oracle.com>
As qede utilizes an internal-reload sequence as result of various
configuration changes, the netif state wouldn't always accurately describe
the status of the configuration.
To compensate, we're storing an internal state of the device, which should
only be accessed under the qede_lock.
This patch fixes and improves several state/lock interactions:
- The internal state should only be checked while locked.
- While holding lock, it's preferable to check state rather than
the netdevice's state.
- The reload sequence is not 'atomic' - unload and subsequent load
are not in the same critical section.
This also add the 'locked' variant for the reload, which would later be
used by XDP - useful in the case where the correct sequence is 'lock,
check state and re-configure if good', instead of allowing the reload
itself to make the decision regarding the configurability of the device.
Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 567b3c127a79277bac31a9609734b355d30e7905) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Conflicts:
drivers/net/ethernet/qlogic/qede/qede_ethtool.c
drivers/net/ethernet/qlogic/qede/qede_main.c
Driver's NAPI poll is using a long sequence for processing ingress
packets, and it's going to get even longer once we do XDP.
Break down the main loop into a series of sub-functions to allow
better readability of the function.
While we're at it, correct the accounting of the NAPI budget -
currently we're counting only packets passed to the stack against
the budget, even in case those are actually aggregations.
After refactoring every CQE processed would be counted against the budget.
Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit f4fad34c0e45b3e30d2b5312d545e2d416778c7b) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Conflicts:
drivers/net/ethernet/qlogic/qede/qede_main.c
Refactor logic for gathering statistics into a per-queue function.
This improves readability of the driver statistics' flows.
In addition, this would be required by the XDP forwarding queues
[as we'll need the Txq statistics gathering methods for those as well].
Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 4dbcd6400244a073f579665a957c6c56c99cc3b6) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Driver currently doesn't support multi-CoS, but it contains logic
where multiple transmission queues could be theoretically manipulated.
No point in maintaining the infrastructure at the moment.
Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 80439a1704e811697ee01fd09dd95dd10790bc93) Signed-off-by: Brian Maly <brian.maly@oracle.com>
The chain structure and functions are widely used by the qed* modules,
both for configuration and datapath.
E.g., qede's Tx has one such chain and its Rx has two.
Currently, the strucutre's fields which are required for datapath
related functions [produce/consume] are intertwined with fields which
are required only for configuration purposes [init/destroy/etc.].
This patch re-arranges the chain structure so that all the fields which
are required for datapath usage could reside in a single cacheline instead
of the two which are required today.
Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 6d937acfb3f166f6e10abd978fafafa120d6f0d7) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Driver needs to maintain a structure per-each concurrent possible
open aggregation, but the structure storing that metadata is far from
being optimized - biggest waste in it is that there are 2 buffer metadata,
one for a replacement buffer when the aggregation begins and the other for
holding the first aggregation's buffer after it begins [as firmware might
still update it]. Those 2 can safely be united into a single metadata
structure.
struct qede_agg_info changes the following:
/* size: 120, cachelines: 2, members: 9 */
/* sum members: 114, holes: 1, sum holes: 4 */
/* padding: 2 */
/* paddings: 2, sum paddings: 8 */
/* last cacheline: 56 bytes */
-->
/* size: 48, cachelines: 1, members: 9 */
/* paddings: 1, sum paddings: 4 */
/* last cacheline: 48 bytes */
Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 01e23015a97c46ea376aacde549510b336bd5987) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Previous fix has broken RoCE support as the rdma_pf_params are now
being set into the parameters only after the params are alrady assigned
into the hw-function.
Fixes: 0189efb8f4f8 ("qed*: Fix Kconfig dependencies with INFINIBAND_QEDR") Signed-off-by: Ram Amrani <Ram.Amrani@cavium.com> Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 5c5f26090840951b4102d9a1e6db9aac41101e5a) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Currently RoCE v2 won't operate with RDMA CM due to missing setting of
the roce-flavour in the ll2 configuration.
This patch properly sets the flavour, and deletes incorrect HSI
that doesn't [yet] exist.
Fixes: abd49676c707 ("qed: Add RoCE ll2 & GSI support") Signed-off-by: Ram Amrani <Ram.Amrani@cavium.com> Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 8d1d8fcb21cfc4a65731760c3100920f929e8f3d) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Driver uses a union for copying data to & from management firmware
when interacting with it.
Problem is that the function always copies sizeof(union) while commit 2edbff8dcb5d ("qed: Learn resources from management firmware") is casting
a union elements which is of smaller size [24-byte instead of 88-bytes].
Also, the union contains some inappropriate elements which increase its
size [should have been 32-bytes]. While this shouldn't corrupt other
PF messages to the MFW [as management firmware enforces permissions so
that each PF is allowed to write only to its own mailbox] we fix this
here as well.
Fixes: 2edbff8dcb5d ("qed: Learn resources from management firmware") Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit bb48024284327768debd03a197d7c4179ec6ca05) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Driver allocates replacement buffers before-hand to make
sure whenever an aggregation begins there would be a replacement
for the Rx buffers, as we can't release the buffer until
aggregation is terminated and driver logic assumes the Rx rings
are always full.
For every other Rx page that's being allocated [I.e., regular]
the page is being completely mapped while for the replacement
buffers only the first portion of the page is being mapped.
This means that:
a. Once replacement buffer replenishes the regular Rx ring,
assuming there's more than a single packet on page we'd post unmapped
memory toward HW [assuming mapping is actually done in granularity
smaller than page].
b. Unmaps are being done for the entire page, which is incorrect.
Fixes: 55482edc25f06 ("qede: Add slowpath/fastpath support and enable hardware GRO") Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 9512925a2cc2b1cd0206bb93bad200a69716f998) Signed-off-by: Brian Maly <brian.maly@oracle.com>
When relaxing the limitation on the number of unicast MAC filters
an interface can configure, qed started passing the MAC quota to
qede. However, the value is initialized only for PFs, causing VFs
to always try and configure themselves as promiscuous
[as they believe they lack the resources to configure the rx-mode].
Fixes: 7b7e70f979e3 ("qed*: Allow unicast filtering") Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit b0fca3122f6220e9a5bd975cdc5c4a87f575b740) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Driver is now setting the ndev's priv_flags instead of adding to it,
causing pktgen failure to utilize various features due to the loss
of the IFF_TX_SKB_SHARING indication.
Fixes: 7b7e70f979e3 ("qed*: Allow unicast filtering") Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 0183eb1c7504b290221f79bc3c345736f8ad657b) Signed-off-by: Brian Maly <brian.maly@oracle.com>