aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/pensando (follow)
AgeCommit message (Collapse)AuthorFilesLines
2021-07-27ionic: increment num-vfs before configureShannon Nelson1-1/+1
Add the new VF to our internal count before we start configuring it. Signed-off-by: Shannon Nelson <snelson@pensando.io> Signed-off-by: David S. Miller <davem@davemloft.net>
2021-07-27ionic: use fewer inits on the buf_info structShannon Nelson1-16/+11
Based on Alex's review notes on [1], we don't need to write to the buf_info elements as often, and can tighten up how they are used. Also, use prefetchw() to warm up the page struct for a later get_page(). [1] https://lore.kernel.org/netdev/CAKgT0UfyjoAN7LTnq0NMZfXRv4v7iTCPyAb9pVr3qWMhop_BVw@mail.gmail.com/ Signed-off-by: Shannon Nelson <snelson@pensando.io> Signed-off-by: David S. Miller <davem@davemloft.net>
2021-07-27ionic: init reconfig err to 0Shannon Nelson1-3/+10
Initialize err to 0 instead of ENOMEM, and specifically set err to ENOMEM in the devm_kcalloc() failure cases. Also, add an error message to the end of reconfig. Signed-off-by: Shannon Nelson <snelson@pensando.io> Signed-off-by: David S. Miller <davem@davemloft.net>
2021-07-27ionic: print firmware version on identifyShannon Nelson1-0/+2
Print the version of the DSC firmware seen when we do a fresh ident check. Because the FW can be updated by the external orchestration system, this helps us track that FW has been updated on the DSC. Signed-off-by: Shannon Nelson <snelson@pensando.io> Signed-off-by: David S. Miller <davem@davemloft.net>
2021-07-27ionic: monitor fw status generationShannon Nelson3-3/+31
The top 4 bits of the fw_status in dev_info_regs is reserved for the status generation. This generation number is an arbitrary value defined when firmware starts up. If the FW is killed/crashed/stopped and then restarted, it will create a different generation number. With this mechanism, the host driver can detect that the FW has crashed and restarted, and the driver can then take steps to re-initialize its connection. Signed-off-by: Shannon Nelson <snelson@pensando.io> Signed-off-by: David S. Miller <davem@davemloft.net>
2021-07-27ionic: minimize resources when under kdumpShannon Nelson1-2/+19
When running in a small kdump kernel, we can play nice and minimize our resource use to help make sure that kdump is successful in its mission. Signed-off-by: Shannon Nelson <snelson@pensando.io> Signed-off-by: David S. Miller <davem@davemloft.net>
2021-07-27dev_ioctl: split out ndo_eth_ioctlArnd Bergmann1-2/+2
Most users of ndo_do_ioctl are ethernet drivers that implement the MII commands SIOCGMIIPHY/SIOCGMIIREG/SIOCSMIIREG, or hardware timestamping with SIOCSHWTSTAMP/SIOCGHWTSTAMP. Separate these from the few drivers that use ndo_do_ioctl to implement SIOCBOND, SIOCBR and SIOCWANDEV commands. This is a purely cosmetic change intended to help readers find their way through the implementation. Cc: Doug Ledford <dledford@redhat.com> Cc: Jason Gunthorpe <jgg@ziepe.ca> Cc: Jay Vosburgh <j.vosburgh@gmail.com> Cc: Veaceslav Falico <vfalico@gmail.com> Cc: Andy Gospodarek <andy@greyhouse.net> Cc: Andrew Lunn <andrew@lunn.ch> Cc: Vivien Didelot <vivien.didelot@gmail.com> Cc: Florian Fainelli <f.fainelli@gmail.com> Cc: Vladimir Oltean <olteanv@gmail.com> Cc: Leon Romanovsky <leon@kernel.org> Cc: linux-rdma@vger.kernel.org Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Jason Gunthorpe <jgg@nvidia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2021-07-23ionic: count csum_none when offload enabledShannon Nelson1-6/+5
Be sure to count the csum_none cases when csum offload is enabled. Fixes: 0f3154e6bcb3 ("ionic: Add Tx and Rx handling") Signed-off-by: Shannon Nelson <snelson@pensando.io> Signed-off-by: David S. Miller <davem@davemloft.net>
2021-07-23ionic: fix up dim accounting for tx and rxShannon Nelson1-7/+21
We need to count the correct Tx and/or Rx packets for dynamic interrupt moderation, depending on which we're processing on the queue interrupt. Fixes: 04a834592bf5 ("ionic: dynamic interrupt moderation") Signed-off-by: Shannon Nelson <snelson@pensando.io> Signed-off-by: David S. Miller <davem@davemloft.net>
2021-07-23ionic: remove intr coalesce update from napiShannon Nelson2-5/+13
Move the interrupt coalesce value update out of the napi thread and into the dim_work thread and set it only when it has actually changed. Fixes: 04a834592bf5 ("ionic: dynamic interrupt moderation") Signed-off-by: Shannon Nelson <snelson@pensando.io> Signed-off-by: David S. Miller <davem@davemloft.net>
2021-07-23ionic: catch no ptp support earlierShannon Nelson2-8/+9
If PTP configuration is attempted on ports that don't support it, such as VF ports, the driver will return an error status -95, or EOPNOSUPP and print an error message enp98s0: hwstamp set failed: -95 Because some daemons can retry every few seconds, this can end up filling the dmesg log and pushing out other more useful messages. We can catch this issue earlier in our handling and return the error without a log message. Fixes: 829600ce5e4e ("ionic: add ts_config replay") Signed-off-by: Shannon Nelson <snelson@pensando.io> Signed-off-by: David S. Miller <davem@davemloft.net>
2021-07-23ionic: make all rx_mode work threadsafeShannon Nelson2-102/+85
Move the bulk of the code from ionic_set_rx_mode(), which can be called from atomic context, into ionic_lif_rx_mode() which is a safe context. A call from the stack will get pushed off into a work thread, but it is also possible to simultaneously have a call driven by a queue reconfig request from an ethtool command or fw recovery event. We add a mutex around the rx_mode work to be sure they don't collide. Fixes: 81dbc24147f9 ("ionic: change set_rx_mode from_ndo to can_sleep") Signed-off-by: Shannon Nelson <snelson@pensando.io> Signed-off-by: David S. Miller <davem@davemloft.net>
2021-07-21ionic: cleanly release devlink instanceLeon Romanovsky1-7/+7
The failure to register devlink will leave the system with dangled devlink resource, which is not cleaned if devlink_port_register() fails. In order to remove access to ".registered" field of struct devlink_port, require both devlink_register and devlink_port_register to success and check it through device pointer. Fixes: fbfb8031533c ("ionic: Add hardware init and device commands") Reviewed-by: Moshe Shemesh <moshe@nvidia.com> Signed-off-by: Leon Romanovsky <leonro@nvidia.com> Acked-by: Shannon Nelson <snelson@pensando.io> Signed-off-by: David S. Miller <davem@davemloft.net>
2021-07-21ionic: drop useless check of PCI driver data validityLeon Romanovsky1-3/+0
The driver core will call to .remove callback only if .probe succeeded and it will ensure that driver data has pointer to struct ionic. There is no need to check it again. Fixes: fbfb8031533c ("ionic: Add hardware init and device commands") Signed-off-by: Leon Romanovsky <leonro@nvidia.com> Acked-by: Shannon Nelson <snelson@pensando.io> Signed-off-by: David S. Miller <davem@davemloft.net>
2021-05-11ionic: fix ptp support config breakageShannon Nelson1-0/+1
When IONIC=y and PTP_1588_CLOCK=m were set in the .config file the driver link failed with undefined references. We add the dependancy depends on PTP_1588_CLOCK || !PTP_1588_CLOCK to clear this up. If PTP_1588_CLOCK=m, the depends limits IONIC to =m (or disabled). If PTP_1588_CLOCK is disabled, IONIC can be any of y/m/n. Fixes: 61db421da31b ("ionic: link in the new hw timestamp code") Reported-by: kernel test robot <lkp@intel.com> Cc: Jakub Kicinski <kuba@kernel.org> Cc: Randy Dunlap <rdunlap@infradead.org> Cc: Allen Hubbe <allenbh@pensando.io> Signed-off-by: Shannon Nelson <snelson@pensando.io> Acked-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2021-04-13ionic: return -EFAULT if copy_to_user() failsDan Carpenter1-1/+3
The copy_to_user() function returns the number of bytes that it wasn't able to copy. We want to return -EFAULT to the user. Fixes: fee6efce565d ("ionic: add hw timestamp support files") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Shannon Nelson <snelson@pensando.io> Signed-off-by: David S. Miller <davem@davemloft.net>
2021-04-13ionic: git_ts_info bit shiftersShannon Nelson1-13/+13
All the uses of HWTSTAMP_FILTER_* values need to be bit shifters, not straight values. v2: fixed subject and added Cc Dan and SoB Allen Fixes: f8ba81da73fc ("ionic: add ethtool support for PTP") Cc: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Shannon Nelson <snelson@pensando.io> Signed-off-by: Allen Hubbe <allenbh@pensando.io> Signed-off-by: David S. Miller <davem@davemloft.net>
2021-04-08ionic: extend ts_config set lockingShannon Nelson1-6/+10
Make sure the configuration is locked before operating on it for the replay. Signed-off-by: Shannon Nelson <snelson@pensando.io> Signed-off-by: David S. Miller <davem@davemloft.net>
2021-04-08ionic: add ts_config replayShannon Nelson3-32/+60
Split the call into ionic_lif_hwstamp_set() to have two separate interfaces, one from the ioctl() for changing the configuration and one for replaying the current configuration after a FW RESET. Signed-off-by: Shannon Nelson <snelson@pensando.io> Signed-off-by: David S. Miller <davem@davemloft.net>
2021-04-08ionic: ignore EBUSY on queue startShannon Nelson1-1/+1
When starting the queues in the link-check, don't go into the BROKEN state if the return was EBUSY. Signed-off-by: Shannon Nelson <snelson@pensando.io> Signed-off-by: David S. Miller <davem@davemloft.net>
2021-04-08ionic: re-start ptp after queues upShannon Nelson1-3/+3
When returning after a firmware reset, re-start the PTP after we've restarted the general queues. Signed-off-by: Shannon Nelson <snelson@pensando.io> Signed-off-by: David S. Miller <davem@davemloft.net>
2021-04-08ionic: add SKBTX_IN_PROGRESSShannon Nelson1-0/+1
Set the SKBTX_IN_PROGRESS when offloading the Tx timestamp. Signed-off-by: Shannon Nelson <snelson@pensando.io> Signed-off-by: David S. Miller <davem@davemloft.net>
2021-04-08ionic: check for valid tx_mode on SKBTX_HW_TSTAMP xmitShannon Nelson1-1/+1
Make sure the device is in a Tx offload mode before calling the hwstamp offload xmit. Signed-off-by: Shannon Nelson <snelson@pensando.io> Signed-off-by: David S. Miller <davem@davemloft.net>
2021-04-08ionic: remove unnecessary compat ifdefShannon Nelson1-2/+0
We don't need to look for HAVE_HWSTAMP_TX_ONESTEP_P2P in the upstream kernel. Signed-off-by: Shannon Nelson <snelson@pensando.io> Signed-off-by: David S. Miller <davem@davemloft.net>
2021-04-08ionic: fix up a couple of code style nitsShannon Nelson1-6/+4
Clean up variable declarations. Signed-off-by: Shannon Nelson <snelson@pensando.io> Signed-off-by: David S. Miller <davem@davemloft.net>
2021-04-02ionic: advertise support for hardware timestampsShannon Nelson1-0/+25
Let the network stack know we've got support for timestamping the packets. Signed-off-by: Allen Hubbe <allenbh@pensando.io> Signed-off-by: Shannon Nelson <snelson@pensando.io> Signed-off-by: David S. Miller <davem@davemloft.net>
2021-04-02ionic: ethtool ptp statsShannon Nelson1-4/+34
Add the new hwstamp stats to our ethtool stats output. Signed-off-by: Allen Hubbe <allenbh@pensando.io> Signed-off-by: Shannon Nelson <snelson@pensando.io> Signed-off-by: David S. Miller <davem@davemloft.net>
2021-04-02ionic: add ethtool support for PTPShannon Nelson1-0/+93
Add the get_ts_info() callback for ethtool support of timestamping information. Signed-off-by: Allen Hubbe <allenbh@pensando.io> Signed-off-by: Shannon Nelson <snelson@pensando.io> Signed-off-by: David S. Miller <davem@davemloft.net>
2021-04-02ionic: add and enable tx and rx timestamp handlingShannon Nelson4-25/+157
The Tx and Rx timestamped packets are handled through separate queues. Here we set them up, service them, and tear them down along with the normal Tx and Rx queues. Signed-off-by: Allen Hubbe <allenbh@pensando.io> Signed-off-by: Shannon Nelson <snelson@pensando.io> Signed-off-by: David S. Miller <davem@davemloft.net>
2021-04-02ionic: set up hw timestamp queuesShannon Nelson1-5/+261
We do hardware timestamping through a separate Tx queue, and optionally through a separate Rx queue. These queues are allocated, freed, and tracked separately from the basic queue arrays. Signed-off-by: Allen Hubbe <allenbh@pensando.io> Signed-off-by: Shannon Nelson <snelson@pensando.io> Signed-off-by: David S. Miller <davem@davemloft.net>
2021-04-02ionic: add rx filtering for hw timestamp steeringShannon Nelson2-0/+22
Add handling of the new Rx packet classification filter type. This simple bit of classification allows for steering packets to a separate Rx queue for processing. Signed-off-by: Allen Hubbe <allenbh@pensando.io> Signed-off-by: Shannon Nelson <snelson@pensando.io> Signed-off-by: David S. Miller <davem@davemloft.net>
2021-04-02ionic: link in the new hw timestamp codeShannon Nelson7-0/+107
These are changes to compile and link the new code, but no new feature support is available or advertised yet. Signed-off-by: Allen Hubbe <allenbh@pensando.io> Signed-off-by: Shannon Nelson <snelson@pensando.io> Signed-off-by: David S. Miller <davem@davemloft.net>
2021-04-02ionic: add hw timestamp support filesShannon Nelson1-0/+589
This adds the file of code for supporting Tx and Rx hardware timestamps and the raw clock interface, but does not yet link it in for compiling or use. Signed-off-by: Allen Hubbe <allenbh@pensando.io> Signed-off-by: Shannon Nelson <snelson@pensando.io> Signed-off-by: David S. Miller <davem@davemloft.net>
2021-04-02ionic: split adminq post and wait callsShannon Nelson2-4/+13
Split the wait part out of adminq_post_wait() into a separate function so that a caller can have finer grain control over the sequencing of operations and locking. Signed-off-by: Allen Hubbe <allenbh@pensando.io> Signed-off-by: Shannon Nelson <snelson@pensando.io> Signed-off-by: David S. Miller <davem@davemloft.net>
2021-04-02ionic: add hw timestamp structs to interfaceShannon Nelson2-6/+170
The interface for hardware timestamping includes a new FW request, device identity fields, Tx and Rx queue feature bits, a new Rx filter type, the beginnings of Rx packet classifications, and hardware timestamp registers. If the IONIC_ETH_HW_TIMESTAMP bit is shown in the ionic_lif_config features bit string, then we have support for the hw clock registers. If the IONIC_RXQ_F_HWSTAMP and IONIC_TXQ_F_HWSTAMP features are shown in the ionic_q_identity features, then the queues can support HW timestamps on packets. Signed-off-by: Allen Hubbe <allenbh@pensando.io> Signed-off-by: Shannon Nelson <snelson@pensando.io> Signed-off-by: David S. Miller <davem@davemloft.net>
2021-04-02ionic: add handling of larger descriptorsShannon Nelson4-29/+73
In preparating for hardware timestamping, we need to support large Tx and Rx completion descriptors. Here we add the new queue feature ids and handling for the completion descriptor sizes. We only are adding support for the Rx 2x sized completion descriptors in the general Rx queues for now as we will be using it for PTP Rx support, and we don't have an immediate use for the large descriptors in the general Tx queues yet; it will be used in a special Tx queues added in one of the next few patches. Signed-off-by: Allen Hubbe <allenbh@pensando.io> Signed-off-by: Shannon Nelson <snelson@pensando.io> Signed-off-by: David S. Miller <davem@davemloft.net>
2021-04-02ionic: add new queue features to interfaceShannon Nelson3-6/+25
Add queue feature extensions to prepare for features that can be queue specific, in addition to the general queue features already defined. While we're here, change the existing feature ids from #defines to enum. Signed-off-by: Allen Hubbe <allenbh@pensando.io> Signed-off-by: Shannon Nelson <snelson@pensando.io> Signed-off-by: David S. Miller <davem@davemloft.net>
2021-03-30ionic: pull per-q stats work out of queue loopsShannon Nelson1-94/+125
Abstract out the per-queue data collection work into separate functions from the per-queue loops in the stats reporting, similar to what Alex did for the data label strings in commit acebe5b6107c ("ionic: Update driver to use ethtool_sprintf") Signed-off-by: Shannon Nelson <snelson@pensando.io> Signed-off-by: David S. Miller <davem@davemloft.net>
2021-03-30ionic: avoid races in ionic_heartbeat_checkShannon Nelson2-37/+63
Rework the heartbeat checks to be sure that we're getting an atomic operation. Through testing we found occasions where a separate thread could clash with this check and cause erroneous heartbeat check results. Signed-off-by: Allen Hubbe <allenbh@pensando.io> Signed-off-by: Shannon Nelson <snelson@pensando.io> Signed-off-by: David S. Miller <davem@davemloft.net>
2021-03-30ionic: fix sizeof usageShannon Nelson1-4/+4
Use the actual pointer that we care about as the subject of the sizeof, rather than a struct name. Signed-off-by: Shannon Nelson <snelson@pensando.io> Signed-off-by: David S. Miller <davem@davemloft.net>
2021-03-30ionic: count dma errorsShannon Nelson1-2/+7
Increment our dma-error counter in a couple of spots that were missed before. Signed-off-by: Shannon Nelson <snelson@pensando.io> Signed-off-by: David S. Miller <davem@davemloft.net>
2021-03-25Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/netDavid S. Miller1-5/+7
Signed-off-by: David S. Miller <davem@davemloft.net>
2021-03-18ionic: protect adminq from early destroyShannon Nelson2-8/+28
Don't destroy the adminq while there is an outstanding request. Signed-off-by: Shannon Nelson <snelson@pensando.io> Signed-off-by: David S. Miller <davem@davemloft.net>
2021-03-18ionic: stop watchdog when in broken stateShannon Nelson2-2/+24
Up to now we've been ignoring any error return from the queue starting in the link status check, so we fix that here. If the driver had to reset and couldn't get things running properly again, for example after a Tx Timeout and the FW is not responding to commands, don't let the link watchdog try to restart the queues. At this point the user can try to DOWN and UP the device to clear the errors. Signed-off-by: Shannon Nelson <snelson@pensando.io> Signed-off-by: David S. Miller <davem@davemloft.net>
2021-03-18ionic: block actions during fw resetShannon Nelson3-4/+15
Block some actions while the FW is in a reset activity and the queues are not configured. Signed-off-by: Shannon Nelson <snelson@pensando.io> Signed-off-by: David S. Miller <davem@davemloft.net>
2021-03-18ionic: update ethtool support bits for BASETShannon Nelson2-0/+10
Add support in get_link_ksettings for a couple of new BASET connections. Signed-off-by: Shannon Nelson <snelson@pensando.io> Signed-off-by: David S. Miller <davem@davemloft.net>
2021-03-18ionic: fix unchecked referenceShannon Nelson1-1/+1
We can get to the counter without going through the pointer that the robot complained about. Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Shannon Nelson <snelson@pensando.io> Signed-off-by: David S. Miller <davem@davemloft.net>
2021-03-18ionic: simplify the intr_index use in txq_initShannon Nelson1-4/+2
The qcq->intr.index was set when the queue was allocated, there is no need to reach around to find it. Signed-off-by: Shannon Nelson <snelson@pensando.io> Signed-off-by: David S. Miller <davem@davemloft.net>
2021-03-18ionic: code cleanup detailsShannon Nelson3-32/+25
Catch a couple of missing macro name uses, fix a couple of misspellings, etc. Signed-off-by: Shannon Nelson <snelson@pensando.io> Signed-off-by: David S. Miller <davem@davemloft.net>
2021-03-17ionic: Update driver to use ethtool_sprintfAlexander Duyck1-85/+60
Update the ionic driver to make use of ethtool_sprintf. In addition add separate functions for Tx/Rx stats strings in order to reduce the total amount of indenting needed in the driver code. Acked-by: Shannon Nelson <snelson@pensando.io> Signed-off-by: Alexander Duyck <alexanderduyck@fb.com> Signed-off-by: David S. Miller <davem@davemloft.net>