2008-04-27 18:55:59 +07:00
|
|
|
/****************************************************************************
|
2013-08-30 05:32:48 +07:00
|
|
|
* Driver for Solarflare network controllers and boards
|
2008-04-27 18:55:59 +07:00
|
|
|
* Copyright 2005-2006 Fen Systems Ltd.
|
2013-08-30 05:32:48 +07:00
|
|
|
* Copyright 2006-2013 Solarflare Communications Inc.
|
2008-04-27 18:55:59 +07:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU General Public License version 2 as published
|
|
|
|
* by the Free Software Foundation, incorporated herein by reference.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <linux/netdevice.h>
|
|
|
|
#include <linux/ethtool.h>
|
|
|
|
#include <linux/rtnetlink.h>
|
2010-12-08 02:11:26 +07:00
|
|
|
#include <linux/in.h>
|
2008-04-27 18:55:59 +07:00
|
|
|
#include "net_driver.h"
|
2008-12-13 12:50:46 +07:00
|
|
|
#include "workarounds.h"
|
2008-05-07 19:36:19 +07:00
|
|
|
#include "selftest.h"
|
2008-04-27 18:55:59 +07:00
|
|
|
#include "efx.h"
|
2010-09-20 15:43:42 +07:00
|
|
|
#include "filter.h"
|
2009-11-29 22:12:08 +07:00
|
|
|
#include "nic.h"
|
2008-04-27 18:55:59 +07:00
|
|
|
|
2012-12-15 04:52:56 +07:00
|
|
|
struct efx_sw_stat_desc {
|
2008-04-27 18:55:59 +07:00
|
|
|
const char *name;
|
|
|
|
enum {
|
|
|
|
EFX_ETHTOOL_STAT_SOURCE_nic,
|
2011-02-19 02:14:13 +07:00
|
|
|
EFX_ETHTOOL_STAT_SOURCE_channel,
|
|
|
|
EFX_ETHTOOL_STAT_SOURCE_tx_queue
|
2008-04-27 18:55:59 +07:00
|
|
|
} source;
|
|
|
|
unsigned offset;
|
|
|
|
u64(*get_stat) (void *field); /* Reader function */
|
|
|
|
};
|
|
|
|
|
2012-12-15 04:52:56 +07:00
|
|
|
/* Initialiser for a struct efx_sw_stat_desc with type-checking */
|
2008-04-27 18:55:59 +07:00
|
|
|
#define EFX_ETHTOOL_STAT(stat_name, source_name, field, field_type, \
|
|
|
|
get_stat_function) { \
|
|
|
|
.name = #stat_name, \
|
|
|
|
.source = EFX_ETHTOOL_STAT_SOURCE_##source_name, \
|
|
|
|
.offset = ((((field_type *) 0) == \
|
|
|
|
&((struct efx_##source_name *)0)->field) ? \
|
|
|
|
offsetof(struct efx_##source_name, field) : \
|
|
|
|
offsetof(struct efx_##source_name, field)), \
|
|
|
|
.get_stat = get_stat_function, \
|
|
|
|
}
|
|
|
|
|
|
|
|
static u64 efx_get_uint_stat(void *field)
|
|
|
|
{
|
|
|
|
return *(unsigned int *)field;
|
|
|
|
}
|
|
|
|
|
|
|
|
static u64 efx_get_atomic_stat(void *field)
|
|
|
|
{
|
|
|
|
return atomic_read((atomic_t *) field);
|
|
|
|
}
|
|
|
|
|
|
|
|
#define EFX_ETHTOOL_ATOMIC_NIC_ERROR_STAT(field) \
|
|
|
|
EFX_ETHTOOL_STAT(field, nic, field, \
|
|
|
|
atomic_t, efx_get_atomic_stat)
|
|
|
|
|
|
|
|
#define EFX_ETHTOOL_UINT_CHANNEL_STAT(field) \
|
|
|
|
EFX_ETHTOOL_STAT(field, channel, n_##field, \
|
|
|
|
unsigned int, efx_get_uint_stat)
|
|
|
|
|
2011-02-19 02:14:13 +07:00
|
|
|
#define EFX_ETHTOOL_UINT_TXQ_STAT(field) \
|
|
|
|
EFX_ETHTOOL_STAT(tx_##field, tx_queue, field, \
|
|
|
|
unsigned int, efx_get_uint_stat)
|
|
|
|
|
2012-12-15 04:52:56 +07:00
|
|
|
static const struct efx_sw_stat_desc efx_sw_stat_desc[] = {
|
2013-04-27 07:55:21 +07:00
|
|
|
EFX_ETHTOOL_UINT_TXQ_STAT(merge_events),
|
2011-02-19 02:14:13 +07:00
|
|
|
EFX_ETHTOOL_UINT_TXQ_STAT(tso_bursts),
|
|
|
|
EFX_ETHTOOL_UINT_TXQ_STAT(tso_long_headers),
|
|
|
|
EFX_ETHTOOL_UINT_TXQ_STAT(tso_packets),
|
2016-11-17 17:52:36 +07:00
|
|
|
EFX_ETHTOOL_UINT_TXQ_STAT(tso_fallbacks),
|
2011-02-19 02:14:13 +07:00
|
|
|
EFX_ETHTOOL_UINT_TXQ_STAT(pushes),
|
2013-09-03 00:24:29 +07:00
|
|
|
EFX_ETHTOOL_UINT_TXQ_STAT(pio_packets),
|
2016-11-17 17:51:54 +07:00
|
|
|
EFX_ETHTOOL_UINT_TXQ_STAT(cb_packets),
|
2008-04-27 18:55:59 +07:00
|
|
|
EFX_ETHTOOL_ATOMIC_NIC_ERROR_STAT(rx_reset),
|
|
|
|
EFX_ETHTOOL_UINT_CHANNEL_STAT(rx_tobe_disc),
|
|
|
|
EFX_ETHTOOL_UINT_CHANNEL_STAT(rx_ip_hdr_chksum_err),
|
|
|
|
EFX_ETHTOOL_UINT_CHANNEL_STAT(rx_tcp_udp_chksum_err),
|
2009-11-28 12:36:29 +07:00
|
|
|
EFX_ETHTOOL_UINT_CHANNEL_STAT(rx_mcast_mismatch),
|
2008-04-27 18:55:59 +07:00
|
|
|
EFX_ETHTOOL_UINT_CHANNEL_STAT(rx_frm_trunc),
|
2013-08-30 01:19:29 +07:00
|
|
|
EFX_ETHTOOL_UINT_CHANNEL_STAT(rx_merge_events),
|
|
|
|
EFX_ETHTOOL_UINT_CHANNEL_STAT(rx_merge_packets),
|
2008-04-27 18:55:59 +07:00
|
|
|
};
|
|
|
|
|
2012-12-15 04:52:56 +07:00
|
|
|
#define EFX_ETHTOOL_SW_STAT_COUNT ARRAY_SIZE(efx_sw_stat_desc)
|
2008-04-27 18:55:59 +07:00
|
|
|
|
2008-09-01 18:47:16 +07:00
|
|
|
#define EFX_ETHTOOL_EEPROM_MAGIC 0xEFAB
|
|
|
|
|
2008-04-27 18:55:59 +07:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
|
|
|
* Ethtool operations
|
|
|
|
*
|
|
|
|
**************************************************************************
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* Identify device by flashing LEDs */
|
2011-04-02 06:43:46 +07:00
|
|
|
static int efx_ethtool_phys_id(struct net_device *net_dev,
|
|
|
|
enum ethtool_phys_id_state state)
|
2008-04-27 18:55:59 +07:00
|
|
|
{
|
2008-09-01 18:43:14 +07:00
|
|
|
struct efx_nic *efx = netdev_priv(net_dev);
|
2011-04-13 20:09:10 +07:00
|
|
|
enum efx_led_mode mode = EFX_LED_DEFAULT;
|
2008-04-27 18:55:59 +07:00
|
|
|
|
2011-04-02 06:43:46 +07:00
|
|
|
switch (state) {
|
|
|
|
case ETHTOOL_ID_ON:
|
|
|
|
mode = EFX_LED_ON;
|
|
|
|
break;
|
|
|
|
case ETHTOOL_ID_OFF:
|
|
|
|
mode = EFX_LED_OFF;
|
|
|
|
break;
|
|
|
|
case ETHTOOL_ID_INACTIVE:
|
|
|
|
mode = EFX_LED_DEFAULT;
|
|
|
|
break;
|
2011-04-13 20:09:10 +07:00
|
|
|
case ETHTOOL_ID_ACTIVE:
|
|
|
|
return 1; /* cycle on/off once per second */
|
2011-04-02 06:43:46 +07:00
|
|
|
}
|
2009-11-23 23:03:45 +07:00
|
|
|
|
2011-04-02 06:43:46 +07:00
|
|
|
efx->type->set_id_led(efx, mode);
|
2008-04-27 18:55:59 +07:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* This must be called with rtnl_lock held. */
|
2016-12-15 06:12:53 +07:00
|
|
|
static int
|
|
|
|
efx_ethtool_get_link_ksettings(struct net_device *net_dev,
|
|
|
|
struct ethtool_link_ksettings *cmd)
|
2008-04-27 18:55:59 +07:00
|
|
|
{
|
2008-09-01 18:43:14 +07:00
|
|
|
struct efx_nic *efx = netdev_priv(net_dev);
|
2009-11-29 10:42:41 +07:00
|
|
|
struct efx_link_state *link_state = &efx->link_state;
|
2016-12-15 06:12:53 +07:00
|
|
|
u32 supported;
|
2008-04-27 18:55:59 +07:00
|
|
|
|
|
|
|
mutex_lock(&efx->mac_lock);
|
2016-12-15 06:12:53 +07:00
|
|
|
efx->phy_op->get_link_ksettings(efx, cmd);
|
2008-04-27 18:55:59 +07:00
|
|
|
mutex_unlock(&efx->mac_lock);
|
|
|
|
|
2009-11-29 10:42:41 +07:00
|
|
|
/* Both MACs support pause frames (bidirectional and respond-only) */
|
2016-12-15 06:12:53 +07:00
|
|
|
ethtool_convert_link_mode_to_legacy_u32(&supported,
|
|
|
|
cmd->link_modes.supported);
|
|
|
|
|
|
|
|
supported |= SUPPORTED_Pause | SUPPORTED_Asym_Pause;
|
|
|
|
|
|
|
|
ethtool_convert_legacy_u32_to_link_mode(cmd->link_modes.supported,
|
|
|
|
supported);
|
2009-11-29 10:42:41 +07:00
|
|
|
|
|
|
|
if (LOOPBACK_INTERNAL(efx)) {
|
2016-12-15 06:12:53 +07:00
|
|
|
cmd->base.speed = link_state->speed;
|
|
|
|
cmd->base.duplex = link_state->fd ? DUPLEX_FULL : DUPLEX_HALF;
|
2009-11-29 10:42:41 +07:00
|
|
|
}
|
2008-12-13 12:50:08 +07:00
|
|
|
|
|
|
|
return 0;
|
2008-04-27 18:55:59 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
/* This must be called with rtnl_lock held. */
|
2016-12-15 06:12:53 +07:00
|
|
|
static int
|
|
|
|
efx_ethtool_set_link_ksettings(struct net_device *net_dev,
|
|
|
|
const struct ethtool_link_ksettings *cmd)
|
2008-04-27 18:55:59 +07:00
|
|
|
{
|
2008-09-01 18:43:14 +07:00
|
|
|
struct efx_nic *efx = netdev_priv(net_dev);
|
2008-04-27 18:55:59 +07:00
|
|
|
int rc;
|
|
|
|
|
2010-02-03 16:31:57 +07:00
|
|
|
/* GMAC does not support 1000Mbps HD */
|
2016-12-15 06:12:53 +07:00
|
|
|
if ((cmd->base.speed == SPEED_1000) &&
|
|
|
|
(cmd->base.duplex != DUPLEX_FULL)) {
|
2010-06-23 18:30:07 +07:00
|
|
|
netif_dbg(efx, drv, efx->net_dev,
|
|
|
|
"rejecting unsupported 1000Mbps HD setting\n");
|
2008-12-13 12:50:08 +07:00
|
|
|
return -EINVAL;
|
|
|
|
}
|
|
|
|
|
2008-04-27 18:55:59 +07:00
|
|
|
mutex_lock(&efx->mac_lock);
|
2016-12-15 06:12:53 +07:00
|
|
|
rc = efx->phy_op->set_link_ksettings(efx, cmd);
|
2008-04-27 18:55:59 +07:00
|
|
|
mutex_unlock(&efx->mac_lock);
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void efx_ethtool_get_drvinfo(struct net_device *net_dev,
|
|
|
|
struct ethtool_drvinfo *info)
|
|
|
|
{
|
2008-09-01 18:43:14 +07:00
|
|
|
struct efx_nic *efx = netdev_priv(net_dev);
|
2008-04-27 18:55:59 +07:00
|
|
|
|
2010-06-23 18:30:26 +07:00
|
|
|
strlcpy(info->driver, KBUILD_MODNAME, sizeof(info->driver));
|
2008-04-27 18:55:59 +07:00
|
|
|
strlcpy(info->version, EFX_DRIVER_VERSION, sizeof(info->version));
|
sfc: separate out SFC4000 ("Falcon") support into new sfc-falcon driver
Rationale: The differences between Falcon and Siena are in many ways larger
than those between Siena and EF10 (despite Siena being nominally "Falcon-
architecture"); for instance, Falcon has no MCPU, so there is no MCDI.
Removing Falcon support from the sfc driver should simplify the latter,
and avoid the possibility of Falcon support being broken by changes to sfc
(which are rarely if ever tested on Falcon, it being end-of-lifed hardware).
The sfc-falcon driver created in this changeset is essentially a copy of the
sfc driver, but with Siena- and EF10-specific code, including MCDI, removed
and with the "efx_" identifier prefix changed to "ef4_" (for "EFX 4000-
series") to avoid collisions when both drivers are built-in.
This changeset removes Falcon from the sfc driver's PCI ID table; then in
sfc I've removed obvious Falcon-related code: I removed the Falcon NIC
functions, Falcon PHY code, and EFX_REV_FALCON_*, then fixed up everything
that referenced them.
Also, increment minor version of both drivers (to 4.1).
For now, CONFIG_SFC selects CONFIG_SFC_FALCON, so that updating old configs
doesn't cause Falcon support to disappear; but that should be undone at
some point in the future.
Signed-off-by: Edward Cree <ecree@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-11-29 01:55:34 +07:00
|
|
|
efx_mcdi_print_fwver(efx, info->fw_version,
|
|
|
|
sizeof(info->fw_version));
|
2008-04-27 18:55:59 +07:00
|
|
|
strlcpy(info->bus_info, pci_name(efx->pci_dev), sizeof(info->bus_info));
|
|
|
|
}
|
|
|
|
|
2010-06-21 10:06:53 +07:00
|
|
|
static int efx_ethtool_get_regs_len(struct net_device *net_dev)
|
|
|
|
{
|
|
|
|
return efx_nic_get_regs_len(netdev_priv(net_dev));
|
|
|
|
}
|
|
|
|
|
|
|
|
static void efx_ethtool_get_regs(struct net_device *net_dev,
|
|
|
|
struct ethtool_regs *regs, void *buf)
|
|
|
|
{
|
|
|
|
struct efx_nic *efx = netdev_priv(net_dev);
|
|
|
|
|
|
|
|
regs->version = efx->type->revision;
|
|
|
|
efx_nic_get_regs(efx, buf);
|
|
|
|
}
|
|
|
|
|
2010-06-23 18:30:07 +07:00
|
|
|
static u32 efx_ethtool_get_msglevel(struct net_device *net_dev)
|
|
|
|
{
|
|
|
|
struct efx_nic *efx = netdev_priv(net_dev);
|
|
|
|
return efx->msg_enable;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void efx_ethtool_set_msglevel(struct net_device *net_dev, u32 msg_enable)
|
|
|
|
{
|
|
|
|
struct efx_nic *efx = netdev_priv(net_dev);
|
|
|
|
efx->msg_enable = msg_enable;
|
|
|
|
}
|
|
|
|
|
2008-05-07 19:36:19 +07:00
|
|
|
/**
|
|
|
|
* efx_fill_test - fill in an individual self-test entry
|
|
|
|
* @test_index: Index of the test
|
|
|
|
* @strings: Ethtool strings, or %NULL
|
|
|
|
* @data: Ethtool test results, or %NULL
|
|
|
|
* @test: Pointer to test result (used only if data != %NULL)
|
2008-12-13 12:41:55 +07:00
|
|
|
* @unit_format: Unit name format (e.g. "chan\%d")
|
|
|
|
* @unit_id: Unit id (e.g. 0 for "chan0")
|
2008-05-07 19:36:19 +07:00
|
|
|
* @test_format: Test name format (e.g. "loopback.\%s.tx.sent")
|
2008-12-13 12:41:55 +07:00
|
|
|
* @test_id: Test id (e.g. "PHYXS" for "loopback.PHYXS.tx_sent")
|
2008-05-07 19:36:19 +07:00
|
|
|
*
|
|
|
|
* Fill in an individual self-test entry.
|
|
|
|
*/
|
2012-12-15 05:18:55 +07:00
|
|
|
static void efx_fill_test(unsigned int test_index, u8 *strings, u64 *data,
|
2008-05-07 19:36:19 +07:00
|
|
|
int *test, const char *unit_format, int unit_id,
|
|
|
|
const char *test_format, const char *test_id)
|
|
|
|
{
|
2012-12-15 05:18:55 +07:00
|
|
|
char unit_str[ETH_GSTRING_LEN], test_str[ETH_GSTRING_LEN];
|
2008-05-07 19:36:19 +07:00
|
|
|
|
|
|
|
/* Fill data value, if applicable */
|
|
|
|
if (data)
|
|
|
|
data[test_index] = *test;
|
|
|
|
|
|
|
|
/* Fill string, if applicable */
|
|
|
|
if (strings) {
|
2008-12-13 13:05:48 +07:00
|
|
|
if (strchr(unit_format, '%'))
|
2012-12-15 05:18:55 +07:00
|
|
|
snprintf(unit_str, sizeof(unit_str),
|
2008-12-13 13:05:48 +07:00
|
|
|
unit_format, unit_id);
|
|
|
|
else
|
2012-12-15 05:18:55 +07:00
|
|
|
strcpy(unit_str, unit_format);
|
|
|
|
snprintf(test_str, sizeof(test_str), test_format, test_id);
|
|
|
|
snprintf(strings + test_index * ETH_GSTRING_LEN,
|
|
|
|
ETH_GSTRING_LEN,
|
|
|
|
"%-6s %-24s", unit_str, test_str);
|
2008-05-07 19:36:19 +07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-12-13 12:41:55 +07:00
|
|
|
#define EFX_CHANNEL_NAME(_channel) "chan%d", _channel->channel
|
2008-05-07 19:36:19 +07:00
|
|
|
#define EFX_TX_QUEUE_NAME(_tx_queue) "txq%d", _tx_queue->queue
|
|
|
|
#define EFX_RX_QUEUE_NAME(_rx_queue) "rxq%d", _rx_queue->queue
|
|
|
|
#define EFX_LOOPBACK_NAME(_mode, _counter) \
|
2009-11-23 23:08:17 +07:00
|
|
|
"loopback.%s." _counter, STRING_TABLE_LOOKUP(_mode, efx_loopback_mode)
|
2008-05-07 19:36:19 +07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* efx_fill_loopback_test - fill in a block of loopback self-test entries
|
|
|
|
* @efx: Efx NIC
|
|
|
|
* @lb_tests: Efx loopback self-test results structure
|
|
|
|
* @mode: Loopback test mode
|
|
|
|
* @test_index: Starting index of the test
|
|
|
|
* @strings: Ethtool strings, or %NULL
|
|
|
|
* @data: Ethtool test results, or %NULL
|
2014-02-13 02:00:16 +07:00
|
|
|
*
|
|
|
|
* Fill in a block of loopback self-test entries. Return new test
|
|
|
|
* index.
|
2008-05-07 19:36:19 +07:00
|
|
|
*/
|
|
|
|
static int efx_fill_loopback_test(struct efx_nic *efx,
|
|
|
|
struct efx_loopback_self_tests *lb_tests,
|
|
|
|
enum efx_loopback_mode mode,
|
|
|
|
unsigned int test_index,
|
2012-12-15 05:18:55 +07:00
|
|
|
u8 *strings, u64 *data)
|
2008-05-07 19:36:19 +07:00
|
|
|
{
|
2012-09-13 08:22:52 +07:00
|
|
|
struct efx_channel *channel =
|
|
|
|
efx_get_channel(efx, efx->tx_channel_offset);
|
2008-05-07 19:36:19 +07:00
|
|
|
struct efx_tx_queue *tx_queue;
|
|
|
|
|
2010-09-10 13:41:47 +07:00
|
|
|
efx_for_each_channel_tx_queue(tx_queue, channel) {
|
2008-05-07 19:36:19 +07:00
|
|
|
efx_fill_test(test_index++, strings, data,
|
|
|
|
&lb_tests->tx_sent[tx_queue->queue],
|
|
|
|
EFX_TX_QUEUE_NAME(tx_queue),
|
|
|
|
EFX_LOOPBACK_NAME(mode, "tx_sent"));
|
|
|
|
efx_fill_test(test_index++, strings, data,
|
|
|
|
&lb_tests->tx_done[tx_queue->queue],
|
|
|
|
EFX_TX_QUEUE_NAME(tx_queue),
|
|
|
|
EFX_LOOPBACK_NAME(mode, "tx_done"));
|
|
|
|
}
|
|
|
|
efx_fill_test(test_index++, strings, data,
|
|
|
|
&lb_tests->rx_good,
|
2008-12-13 13:05:48 +07:00
|
|
|
"rx", 0,
|
2008-05-07 19:36:19 +07:00
|
|
|
EFX_LOOPBACK_NAME(mode, "rx_good"));
|
|
|
|
efx_fill_test(test_index++, strings, data,
|
|
|
|
&lb_tests->rx_bad,
|
2008-12-13 13:05:48 +07:00
|
|
|
"rx", 0,
|
2008-05-07 19:36:19 +07:00
|
|
|
EFX_LOOPBACK_NAME(mode, "rx_bad"));
|
|
|
|
|
|
|
|
return test_index;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* efx_ethtool_fill_self_tests - get self-test details
|
|
|
|
* @efx: Efx NIC
|
|
|
|
* @tests: Efx self-test results structure, or %NULL
|
|
|
|
* @strings: Ethtool strings, or %NULL
|
|
|
|
* @data: Ethtool test results, or %NULL
|
2014-02-13 02:00:16 +07:00
|
|
|
*
|
|
|
|
* Get self-test number of strings, strings, and/or test results.
|
|
|
|
* Return number of strings (== number of test results).
|
|
|
|
*
|
|
|
|
* The reason for merging these three functions is to make sure that
|
|
|
|
* they can never be inconsistent.
|
2008-05-07 19:36:19 +07:00
|
|
|
*/
|
|
|
|
static int efx_ethtool_fill_self_tests(struct efx_nic *efx,
|
|
|
|
struct efx_self_tests *tests,
|
2012-12-15 05:18:55 +07:00
|
|
|
u8 *strings, u64 *data)
|
2008-05-07 19:36:19 +07:00
|
|
|
{
|
|
|
|
struct efx_channel *channel;
|
2008-12-27 04:47:25 +07:00
|
|
|
unsigned int n = 0, i;
|
2008-05-07 19:36:19 +07:00
|
|
|
enum efx_loopback_mode mode;
|
|
|
|
|
2010-02-03 16:30:50 +07:00
|
|
|
efx_fill_test(n++, strings, data, &tests->phy_alive,
|
|
|
|
"phy", 0, "alive", NULL);
|
2008-09-01 18:49:02 +07:00
|
|
|
efx_fill_test(n++, strings, data, &tests->nvram,
|
|
|
|
"core", 0, "nvram", NULL);
|
2008-05-07 19:36:19 +07:00
|
|
|
efx_fill_test(n++, strings, data, &tests->interrupt,
|
|
|
|
"core", 0, "interrupt", NULL);
|
|
|
|
|
|
|
|
/* Event queues */
|
|
|
|
efx_for_each_channel(channel, efx) {
|
|
|
|
efx_fill_test(n++, strings, data,
|
|
|
|
&tests->eventq_dma[channel->channel],
|
|
|
|
EFX_CHANNEL_NAME(channel),
|
|
|
|
"eventq.dma", NULL);
|
|
|
|
efx_fill_test(n++, strings, data,
|
|
|
|
&tests->eventq_int[channel->channel],
|
|
|
|
EFX_CHANNEL_NAME(channel),
|
|
|
|
"eventq.int", NULL);
|
|
|
|
}
|
|
|
|
|
2013-09-16 20:18:51 +07:00
|
|
|
efx_fill_test(n++, strings, data, &tests->memory,
|
|
|
|
"core", 0, "memory", NULL);
|
2008-09-01 18:49:02 +07:00
|
|
|
efx_fill_test(n++, strings, data, &tests->registers,
|
|
|
|
"core", 0, "registers", NULL);
|
2008-12-27 04:47:25 +07:00
|
|
|
|
2009-11-29 22:08:55 +07:00
|
|
|
if (efx->phy_op->run_tests != NULL) {
|
2016-12-02 22:51:33 +07:00
|
|
|
EFX_WARN_ON_PARANOID(efx->phy_op->test_name == NULL);
|
2009-11-29 22:08:55 +07:00
|
|
|
|
|
|
|
for (i = 0; true; ++i) {
|
|
|
|
const char *name;
|
|
|
|
|
2016-12-02 22:51:33 +07:00
|
|
|
EFX_WARN_ON_PARANOID(i >= EFX_MAX_PHY_TESTS);
|
2009-11-29 22:08:55 +07:00
|
|
|
name = efx->phy_op->test_name(efx, i);
|
|
|
|
if (name == NULL)
|
|
|
|
break;
|
|
|
|
|
2010-02-03 16:30:50 +07:00
|
|
|
efx_fill_test(n++, strings, data, &tests->phy_ext[i],
|
2009-11-29 22:08:55 +07:00
|
|
|
"phy", 0, name, NULL);
|
|
|
|
}
|
|
|
|
}
|
2008-05-07 19:36:19 +07:00
|
|
|
|
|
|
|
/* Loopback tests */
|
2008-09-01 18:49:02 +07:00
|
|
|
for (mode = LOOPBACK_NONE; mode <= LOOPBACK_TEST_MAX; mode++) {
|
2008-05-07 19:36:19 +07:00
|
|
|
if (!(efx->loopback_modes & (1 << mode)))
|
|
|
|
continue;
|
|
|
|
n = efx_fill_loopback_test(efx,
|
|
|
|
&tests->loopback[mode], mode, n,
|
|
|
|
strings, data);
|
|
|
|
}
|
|
|
|
|
|
|
|
return n;
|
|
|
|
}
|
|
|
|
|
2014-07-17 18:10:43 +07:00
|
|
|
static size_t efx_describe_per_queue_stats(struct efx_nic *efx, u8 *strings)
|
|
|
|
{
|
|
|
|
size_t n_stats = 0;
|
|
|
|
struct efx_channel *channel;
|
|
|
|
|
|
|
|
efx_for_each_channel(channel, efx) {
|
|
|
|
if (efx_channel_has_tx_queues(channel)) {
|
|
|
|
n_stats++;
|
|
|
|
if (strings != NULL) {
|
|
|
|
snprintf(strings, ETH_GSTRING_LEN,
|
|
|
|
"tx-%u.tx_packets",
|
|
|
|
channel->tx_queue[0].queue /
|
|
|
|
EFX_TXQ_TYPES);
|
|
|
|
|
|
|
|
strings += ETH_GSTRING_LEN;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
efx_for_each_channel(channel, efx) {
|
|
|
|
if (efx_channel_has_rx_queue(channel)) {
|
|
|
|
n_stats++;
|
|
|
|
if (strings != NULL) {
|
|
|
|
snprintf(strings, ETH_GSTRING_LEN,
|
|
|
|
"rx-%d.rx_packets", channel->channel);
|
|
|
|
strings += ETH_GSTRING_LEN;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return n_stats;
|
|
|
|
}
|
|
|
|
|
2008-09-01 18:48:12 +07:00
|
|
|
static int efx_ethtool_get_sset_count(struct net_device *net_dev,
|
|
|
|
int string_set)
|
2008-04-27 18:55:59 +07:00
|
|
|
{
|
2012-12-15 04:52:56 +07:00
|
|
|
struct efx_nic *efx = netdev_priv(net_dev);
|
|
|
|
|
2008-09-01 18:48:12 +07:00
|
|
|
switch (string_set) {
|
|
|
|
case ETH_SS_STATS:
|
2012-12-15 04:52:56 +07:00
|
|
|
return efx->type->describe_stats(efx, NULL) +
|
2014-07-17 18:10:43 +07:00
|
|
|
EFX_ETHTOOL_SW_STAT_COUNT +
|
|
|
|
efx_describe_per_queue_stats(efx, NULL) +
|
|
|
|
efx_ptp_describe_stats(efx, NULL);
|
2008-09-01 18:48:12 +07:00
|
|
|
case ETH_SS_TEST:
|
2012-12-15 04:52:56 +07:00
|
|
|
return efx_ethtool_fill_self_tests(efx, NULL, NULL, NULL);
|
2008-09-01 18:48:12 +07:00
|
|
|
default:
|
|
|
|
return -EINVAL;
|
|
|
|
}
|
2008-05-07 19:36:19 +07:00
|
|
|
}
|
|
|
|
|
2008-04-27 18:55:59 +07:00
|
|
|
static void efx_ethtool_get_strings(struct net_device *net_dev,
|
|
|
|
u32 string_set, u8 *strings)
|
|
|
|
{
|
2008-09-01 18:43:14 +07:00
|
|
|
struct efx_nic *efx = netdev_priv(net_dev);
|
2008-04-27 18:55:59 +07:00
|
|
|
int i;
|
|
|
|
|
2008-05-07 19:36:19 +07:00
|
|
|
switch (string_set) {
|
|
|
|
case ETH_SS_STATS:
|
2012-12-15 04:52:56 +07:00
|
|
|
strings += (efx->type->describe_stats(efx, strings) *
|
|
|
|
ETH_GSTRING_LEN);
|
|
|
|
for (i = 0; i < EFX_ETHTOOL_SW_STAT_COUNT; i++)
|
2012-12-15 05:18:55 +07:00
|
|
|
strlcpy(strings + i * ETH_GSTRING_LEN,
|
2012-12-15 04:52:56 +07:00
|
|
|
efx_sw_stat_desc[i].name, ETH_GSTRING_LEN);
|
2013-12-11 09:36:08 +07:00
|
|
|
strings += EFX_ETHTOOL_SW_STAT_COUNT * ETH_GSTRING_LEN;
|
2014-07-17 18:10:43 +07:00
|
|
|
strings += (efx_describe_per_queue_stats(efx, strings) *
|
|
|
|
ETH_GSTRING_LEN);
|
2013-12-11 09:36:08 +07:00
|
|
|
efx_ptp_describe_stats(efx, strings);
|
2008-05-07 19:36:19 +07:00
|
|
|
break;
|
|
|
|
case ETH_SS_TEST:
|
2012-12-15 05:18:55 +07:00
|
|
|
efx_ethtool_fill_self_tests(efx, NULL, strings, NULL);
|
2008-05-07 19:36:19 +07:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
/* No other string sets */
|
|
|
|
break;
|
|
|
|
}
|
2008-04-27 18:55:59 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void efx_ethtool_get_stats(struct net_device *net_dev,
|
|
|
|
struct ethtool_stats *stats,
|
|
|
|
u64 *data)
|
|
|
|
{
|
2008-09-01 18:43:14 +07:00
|
|
|
struct efx_nic *efx = netdev_priv(net_dev);
|
2012-12-15 04:52:56 +07:00
|
|
|
const struct efx_sw_stat_desc *stat;
|
2008-04-27 18:55:59 +07:00
|
|
|
struct efx_channel *channel;
|
2011-02-19 02:14:13 +07:00
|
|
|
struct efx_tx_queue *tx_queue;
|
2014-07-17 18:10:43 +07:00
|
|
|
struct efx_rx_queue *rx_queue;
|
2008-04-27 18:55:59 +07:00
|
|
|
int i;
|
|
|
|
|
2011-09-03 05:23:00 +07:00
|
|
|
spin_lock_bh(&efx->stats_lock);
|
|
|
|
|
2012-12-15 04:52:56 +07:00
|
|
|
/* Get NIC statistics */
|
|
|
|
data += efx->type->update_stats(efx, data, NULL);
|
2008-04-27 18:55:59 +07:00
|
|
|
|
2012-12-15 04:52:56 +07:00
|
|
|
/* Get software statistics */
|
|
|
|
for (i = 0; i < EFX_ETHTOOL_SW_STAT_COUNT; i++) {
|
|
|
|
stat = &efx_sw_stat_desc[i];
|
2008-04-27 18:55:59 +07:00
|
|
|
switch (stat->source) {
|
|
|
|
case EFX_ETHTOOL_STAT_SOURCE_nic:
|
|
|
|
data[i] = stat->get_stat((void *)efx + stat->offset);
|
|
|
|
break;
|
|
|
|
case EFX_ETHTOOL_STAT_SOURCE_channel:
|
|
|
|
data[i] = 0;
|
|
|
|
efx_for_each_channel(channel, efx)
|
|
|
|
data[i] += stat->get_stat((void *)channel +
|
|
|
|
stat->offset);
|
|
|
|
break;
|
2011-02-19 02:14:13 +07:00
|
|
|
case EFX_ETHTOOL_STAT_SOURCE_tx_queue:
|
|
|
|
data[i] = 0;
|
|
|
|
efx_for_each_channel(channel, efx) {
|
|
|
|
efx_for_each_channel_tx_queue(tx_queue, channel)
|
|
|
|
data[i] +=
|
|
|
|
stat->get_stat((void *)tx_queue
|
|
|
|
+ stat->offset);
|
|
|
|
}
|
|
|
|
break;
|
2008-04-27 18:55:59 +07:00
|
|
|
}
|
|
|
|
}
|
2013-12-11 09:36:08 +07:00
|
|
|
data += EFX_ETHTOOL_SW_STAT_COUNT;
|
2011-09-03 05:23:00 +07:00
|
|
|
|
|
|
|
spin_unlock_bh(&efx->stats_lock);
|
2013-12-11 09:36:08 +07:00
|
|
|
|
2014-07-17 18:10:43 +07:00
|
|
|
efx_for_each_channel(channel, efx) {
|
|
|
|
if (efx_channel_has_tx_queues(channel)) {
|
|
|
|
*data = 0;
|
|
|
|
efx_for_each_channel_tx_queue(tx_queue, channel) {
|
|
|
|
*data += tx_queue->tx_packets;
|
|
|
|
}
|
|
|
|
data++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
efx_for_each_channel(channel, efx) {
|
|
|
|
if (efx_channel_has_rx_queue(channel)) {
|
|
|
|
*data = 0;
|
|
|
|
efx_for_each_channel_rx_queue(rx_queue, channel) {
|
|
|
|
*data += rx_queue->rx_packets;
|
|
|
|
}
|
|
|
|
data++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-12-11 09:36:08 +07:00
|
|
|
efx_ptp_update_stats(efx, data);
|
2008-04-27 18:55:59 +07:00
|
|
|
}
|
|
|
|
|
2008-05-07 19:36:19 +07:00
|
|
|
static void efx_ethtool_self_test(struct net_device *net_dev,
|
|
|
|
struct ethtool_test *test, u64 *data)
|
|
|
|
{
|
2008-09-01 18:43:14 +07:00
|
|
|
struct efx_nic *efx = netdev_priv(net_dev);
|
2011-02-16 10:48:38 +07:00
|
|
|
struct efx_self_tests *efx_tests;
|
2014-02-13 02:00:16 +07:00
|
|
|
bool already_up;
|
2011-02-16 10:48:38 +07:00
|
|
|
int rc = -ENOMEM;
|
|
|
|
|
|
|
|
efx_tests = kzalloc(sizeof(*efx_tests), GFP_KERNEL);
|
|
|
|
if (!efx_tests)
|
|
|
|
goto fail;
|
|
|
|
|
2012-07-28 01:31:16 +07:00
|
|
|
if (efx->state != STATE_READY) {
|
2014-02-13 02:00:28 +07:00
|
|
|
rc = -EBUSY;
|
2014-02-13 02:00:16 +07:00
|
|
|
goto out;
|
2008-05-07 19:36:19 +07:00
|
|
|
}
|
|
|
|
|
2010-12-08 01:29:52 +07:00
|
|
|
netif_info(efx, drv, efx->net_dev, "starting %sline testing\n",
|
|
|
|
(test->flags & ETH_TEST_FL_OFFLINE) ? "off" : "on");
|
|
|
|
|
2008-05-07 19:36:19 +07:00
|
|
|
/* We need rx buffers and interrupts. */
|
|
|
|
already_up = (efx->net_dev->flags & IFF_UP);
|
|
|
|
if (!already_up) {
|
|
|
|
rc = dev_open(efx->net_dev);
|
|
|
|
if (rc) {
|
2010-06-23 18:30:07 +07:00
|
|
|
netif_err(efx, drv, efx->net_dev,
|
|
|
|
"failed opening device.\n");
|
2014-02-13 02:00:16 +07:00
|
|
|
goto out;
|
2008-05-07 19:36:19 +07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-02-16 10:48:38 +07:00
|
|
|
rc = efx_selftest(efx, efx_tests, test->flags);
|
2008-05-07 19:36:19 +07:00
|
|
|
|
|
|
|
if (!already_up)
|
|
|
|
dev_close(efx->net_dev);
|
|
|
|
|
2010-12-08 01:29:52 +07:00
|
|
|
netif_info(efx, drv, efx->net_dev, "%s %sline self-tests\n",
|
|
|
|
rc == 0 ? "passed" : "failed",
|
|
|
|
(test->flags & ETH_TEST_FL_OFFLINE) ? "off" : "on");
|
2008-05-07 19:36:19 +07:00
|
|
|
|
2014-02-13 02:00:16 +07:00
|
|
|
out:
|
2011-02-16 10:48:38 +07:00
|
|
|
efx_ethtool_fill_self_tests(efx, efx_tests, NULL, data);
|
|
|
|
kfree(efx_tests);
|
|
|
|
fail:
|
2008-05-07 19:36:19 +07:00
|
|
|
if (rc)
|
|
|
|
test->flags |= ETH_TEST_FL_FAILED;
|
|
|
|
}
|
|
|
|
|
2008-04-27 18:55:59 +07:00
|
|
|
/* Restart autonegotiation */
|
|
|
|
static int efx_ethtool_nway_reset(struct net_device *net_dev)
|
|
|
|
{
|
2008-09-01 18:43:14 +07:00
|
|
|
struct efx_nic *efx = netdev_priv(net_dev);
|
2008-04-27 18:55:59 +07:00
|
|
|
|
2009-04-29 15:05:08 +07:00
|
|
|
return mdio45_nway_restart(&efx->mdio);
|
2008-04-27 18:55:59 +07:00
|
|
|
}
|
|
|
|
|
2011-09-05 14:42:25 +07:00
|
|
|
/*
|
|
|
|
* Each channel has a single IRQ and moderation timer, started by any
|
|
|
|
* completion (or other event). Unless the module parameter
|
|
|
|
* separate_tx_channels is set, IRQs and moderation are therefore
|
|
|
|
* shared between RX and TX completions. In this case, when RX IRQ
|
|
|
|
* moderation is explicitly changed then TX IRQ moderation is
|
|
|
|
* automatically changed too, but otherwise we fail if the two values
|
|
|
|
* are requested to be different.
|
|
|
|
*
|
2011-09-05 14:43:49 +07:00
|
|
|
* The hardware does not support a limit on the number of completions
|
|
|
|
* before an IRQ, so we do not use the max_frames fields. We should
|
|
|
|
* report and require that max_frames == (usecs != 0), but this would
|
|
|
|
* invalidate existing user documentation.
|
|
|
|
*
|
|
|
|
* The hardware does not have distinct settings for interrupt
|
|
|
|
* moderation while the previous IRQ is being handled, so we should
|
|
|
|
* not use the 'irq' fields. However, an earlier developer
|
|
|
|
* misunderstood the meaning of the 'irq' fields and the driver did
|
|
|
|
* not support the standard fields. To avoid invalidating existing
|
|
|
|
* user documentation, we report and accept changes through either the
|
|
|
|
* standard or 'irq' fields. If both are changed at the same time, we
|
|
|
|
* prefer the standard field.
|
|
|
|
*
|
2011-09-05 14:42:25 +07:00
|
|
|
* We implement adaptive IRQ moderation, but use a different algorithm
|
|
|
|
* from that assumed in the definition of struct ethtool_coalesce.
|
|
|
|
* Therefore we do not use any of the adaptive moderation parameters
|
|
|
|
* in it.
|
|
|
|
*/
|
|
|
|
|
2008-04-27 18:55:59 +07:00
|
|
|
static int efx_ethtool_get_coalesce(struct net_device *net_dev,
|
|
|
|
struct ethtool_coalesce *coalesce)
|
|
|
|
{
|
2008-09-01 18:43:14 +07:00
|
|
|
struct efx_nic *efx = netdev_priv(net_dev);
|
2011-09-05 14:42:25 +07:00
|
|
|
unsigned int tx_usecs, rx_usecs;
|
|
|
|
bool rx_adaptive;
|
2008-04-27 18:55:59 +07:00
|
|
|
|
2011-09-05 14:42:25 +07:00
|
|
|
efx_get_irq_moderation(efx, &tx_usecs, &rx_usecs, &rx_adaptive);
|
2008-04-27 18:55:59 +07:00
|
|
|
|
2011-09-05 14:43:49 +07:00
|
|
|
coalesce->tx_coalesce_usecs = tx_usecs;
|
2011-09-05 14:42:25 +07:00
|
|
|
coalesce->tx_coalesce_usecs_irq = tx_usecs;
|
2011-09-05 14:43:49 +07:00
|
|
|
coalesce->rx_coalesce_usecs = rx_usecs;
|
2011-09-05 14:42:25 +07:00
|
|
|
coalesce->rx_coalesce_usecs_irq = rx_usecs;
|
|
|
|
coalesce->use_adaptive_rx_coalesce = rx_adaptive;
|
2009-10-23 15:32:13 +07:00
|
|
|
|
2008-04-27 18:55:59 +07:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int efx_ethtool_set_coalesce(struct net_device *net_dev,
|
|
|
|
struct ethtool_coalesce *coalesce)
|
|
|
|
{
|
2008-09-01 18:43:14 +07:00
|
|
|
struct efx_nic *efx = netdev_priv(net_dev);
|
2008-04-27 18:55:59 +07:00
|
|
|
struct efx_channel *channel;
|
2011-09-05 14:41:44 +07:00
|
|
|
unsigned int tx_usecs, rx_usecs;
|
2011-09-05 14:43:04 +07:00
|
|
|
bool adaptive, rx_may_override_tx;
|
|
|
|
int rc;
|
2008-04-27 18:55:59 +07:00
|
|
|
|
2009-03-20 20:30:37 +07:00
|
|
|
if (coalesce->use_adaptive_tx_coalesce)
|
2011-09-05 14:41:27 +07:00
|
|
|
return -EINVAL;
|
2008-04-27 18:55:59 +07:00
|
|
|
|
2011-09-05 14:42:25 +07:00
|
|
|
efx_get_irq_moderation(efx, &tx_usecs, &rx_usecs, &adaptive);
|
|
|
|
|
2011-09-05 14:43:49 +07:00
|
|
|
if (coalesce->rx_coalesce_usecs != rx_usecs)
|
|
|
|
rx_usecs = coalesce->rx_coalesce_usecs;
|
|
|
|
else
|
|
|
|
rx_usecs = coalesce->rx_coalesce_usecs_irq;
|
|
|
|
|
2009-03-20 20:30:37 +07:00
|
|
|
adaptive = coalesce->use_adaptive_rx_coalesce;
|
2008-04-27 18:55:59 +07:00
|
|
|
|
2011-09-05 14:42:25 +07:00
|
|
|
/* If channels are shared, TX IRQ moderation can be quietly
|
|
|
|
* overridden unless it is changed from its old value.
|
|
|
|
*/
|
2011-09-05 14:43:49 +07:00
|
|
|
rx_may_override_tx = (coalesce->tx_coalesce_usecs == tx_usecs &&
|
|
|
|
coalesce->tx_coalesce_usecs_irq == tx_usecs);
|
|
|
|
if (coalesce->tx_coalesce_usecs != tx_usecs)
|
|
|
|
tx_usecs = coalesce->tx_coalesce_usecs;
|
|
|
|
else
|
|
|
|
tx_usecs = coalesce->tx_coalesce_usecs_irq;
|
2008-04-27 18:55:59 +07:00
|
|
|
|
2011-09-05 14:43:04 +07:00
|
|
|
rc = efx_init_irq_moderation(efx, tx_usecs, rx_usecs, adaptive,
|
|
|
|
rx_may_override_tx);
|
|
|
|
if (rc != 0)
|
|
|
|
return rc;
|
|
|
|
|
2008-04-27 18:55:59 +07:00
|
|
|
efx_for_each_channel(channel, efx)
|
2009-11-29 10:42:31 +07:00
|
|
|
efx->type->push_irq_moderation(channel);
|
2008-04-27 18:55:59 +07:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2010-09-10 13:42:33 +07:00
|
|
|
static void efx_ethtool_get_ringparam(struct net_device *net_dev,
|
|
|
|
struct ethtool_ringparam *ring)
|
|
|
|
{
|
|
|
|
struct efx_nic *efx = netdev_priv(net_dev);
|
|
|
|
|
|
|
|
ring->rx_max_pending = EFX_MAX_DMAQ_SIZE;
|
2014-01-23 21:35:48 +07:00
|
|
|
ring->tx_max_pending = EFX_TXQ_MAX_ENT(efx);
|
2010-09-10 13:42:33 +07:00
|
|
|
ring->rx_pending = efx->rxq_entries;
|
|
|
|
ring->tx_pending = efx->txq_entries;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int efx_ethtool_set_ringparam(struct net_device *net_dev,
|
|
|
|
struct ethtool_ringparam *ring)
|
|
|
|
{
|
|
|
|
struct efx_nic *efx = netdev_priv(net_dev);
|
2012-07-30 22:57:44 +07:00
|
|
|
u32 txq_entries;
|
2010-09-10 13:42:33 +07:00
|
|
|
|
|
|
|
if (ring->rx_mini_pending || ring->rx_jumbo_pending ||
|
|
|
|
ring->rx_pending > EFX_MAX_DMAQ_SIZE ||
|
2014-01-23 21:35:48 +07:00
|
|
|
ring->tx_pending > EFX_TXQ_MAX_ENT(efx))
|
2010-09-10 13:42:33 +07:00
|
|
|
return -EINVAL;
|
|
|
|
|
2012-07-30 22:57:44 +07:00
|
|
|
if (ring->rx_pending < EFX_RXQ_MIN_ENT) {
|
2010-09-10 13:42:33 +07:00
|
|
|
netif_err(efx, drv, efx->net_dev,
|
2012-07-30 22:57:44 +07:00
|
|
|
"RX queues cannot be smaller than %u\n",
|
|
|
|
EFX_RXQ_MIN_ENT);
|
2010-09-10 13:42:33 +07:00
|
|
|
return -EINVAL;
|
|
|
|
}
|
|
|
|
|
2012-07-30 22:57:44 +07:00
|
|
|
txq_entries = max(ring->tx_pending, EFX_TXQ_MIN_ENT(efx));
|
|
|
|
if (txq_entries != ring->tx_pending)
|
|
|
|
netif_warn(efx, drv, efx->net_dev,
|
|
|
|
"increasing TX queue size to minimum of %u\n",
|
|
|
|
txq_entries);
|
|
|
|
|
|
|
|
return efx_realloc_channels(efx, ring->rx_pending, txq_entries);
|
2010-09-10 13:42:33 +07:00
|
|
|
}
|
|
|
|
|
2008-04-27 18:55:59 +07:00
|
|
|
static int efx_ethtool_set_pauseparam(struct net_device *net_dev,
|
|
|
|
struct ethtool_pauseparam *pause)
|
|
|
|
{
|
2008-09-01 18:43:14 +07:00
|
|
|
struct efx_nic *efx = netdev_priv(net_dev);
|
2011-05-18 04:53:22 +07:00
|
|
|
u8 wanted_fc, old_fc;
|
2009-11-29 10:42:41 +07:00
|
|
|
u32 old_adv;
|
|
|
|
int rc = 0;
|
|
|
|
|
|
|
|
mutex_lock(&efx->mac_lock);
|
2008-04-27 18:55:59 +07:00
|
|
|
|
2008-12-13 12:50:46 +07:00
|
|
|
wanted_fc = ((pause->rx_pause ? EFX_FC_RX : 0) |
|
|
|
|
(pause->tx_pause ? EFX_FC_TX : 0) |
|
|
|
|
(pause->autoneg ? EFX_FC_AUTO : 0));
|
|
|
|
|
|
|
|
if ((wanted_fc & EFX_FC_TX) && !(wanted_fc & EFX_FC_RX)) {
|
2010-06-23 18:30:07 +07:00
|
|
|
netif_dbg(efx, drv, efx->net_dev,
|
|
|
|
"Flow control unsupported: tx ON rx OFF\n");
|
2009-11-29 10:42:41 +07:00
|
|
|
rc = -EINVAL;
|
|
|
|
goto out;
|
2008-12-13 12:50:46 +07:00
|
|
|
}
|
|
|
|
|
2009-11-29 10:42:41 +07:00
|
|
|
if ((wanted_fc & EFX_FC_AUTO) && !efx->link_advertising) {
|
2010-06-23 18:30:07 +07:00
|
|
|
netif_dbg(efx, drv, efx->net_dev,
|
|
|
|
"Autonegotiation is disabled\n");
|
2009-11-29 10:42:41 +07:00
|
|
|
rc = -EINVAL;
|
|
|
|
goto out;
|
2008-12-13 12:50:46 +07:00
|
|
|
}
|
|
|
|
|
2012-09-13 07:11:25 +07:00
|
|
|
/* Hook for Falcon bug 11482 workaround */
|
|
|
|
if (efx->type->prepare_enable_fc_tx &&
|
|
|
|
(wanted_fc & EFX_FC_TX) && !(efx->wanted_fc & EFX_FC_TX))
|
|
|
|
efx->type->prepare_enable_fc_tx(efx);
|
2008-12-13 12:50:46 +07:00
|
|
|
|
2009-11-29 10:42:41 +07:00
|
|
|
old_adv = efx->link_advertising;
|
|
|
|
old_fc = efx->wanted_fc;
|
|
|
|
efx_link_set_wanted_fc(efx, wanted_fc);
|
|
|
|
if (efx->link_advertising != old_adv ||
|
|
|
|
(efx->wanted_fc ^ old_fc) & EFX_FC_AUTO) {
|
|
|
|
rc = efx->phy_op->reconfigure(efx);
|
|
|
|
if (rc) {
|
2010-06-23 18:30:07 +07:00
|
|
|
netif_err(efx, drv, efx->net_dev,
|
|
|
|
"Unable to advertise requested flow "
|
|
|
|
"control setting\n");
|
2009-11-29 10:42:41 +07:00
|
|
|
goto out;
|
|
|
|
}
|
|
|
|
}
|
2008-12-13 12:50:46 +07:00
|
|
|
|
2009-11-29 10:42:41 +07:00
|
|
|
/* Reconfigure the MAC. The PHY *may* generate a link state change event
|
|
|
|
* if the user just changed the advertised capabilities, but there's no
|
|
|
|
* harm doing this twice */
|
2015-05-20 17:10:03 +07:00
|
|
|
efx_mac_reconfigure(efx);
|
2008-12-13 12:50:46 +07:00
|
|
|
|
2009-11-29 10:42:41 +07:00
|
|
|
out:
|
2008-12-13 12:50:46 +07:00
|
|
|
mutex_unlock(&efx->mac_lock);
|
2008-04-27 18:55:59 +07:00
|
|
|
|
2009-11-29 10:42:41 +07:00
|
|
|
return rc;
|
2008-04-27 18:55:59 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void efx_ethtool_get_pauseparam(struct net_device *net_dev,
|
|
|
|
struct ethtool_pauseparam *pause)
|
|
|
|
{
|
2008-09-01 18:43:14 +07:00
|
|
|
struct efx_nic *efx = netdev_priv(net_dev);
|
2008-04-27 18:55:59 +07:00
|
|
|
|
2008-12-13 12:50:46 +07:00
|
|
|
pause->rx_pause = !!(efx->wanted_fc & EFX_FC_RX);
|
|
|
|
pause->tx_pause = !!(efx->wanted_fc & EFX_FC_TX);
|
|
|
|
pause->autoneg = !!(efx->wanted_fc & EFX_FC_AUTO);
|
2008-04-27 18:55:59 +07:00
|
|
|
}
|
|
|
|
|
2009-11-29 10:43:07 +07:00
|
|
|
static void efx_ethtool_get_wol(struct net_device *net_dev,
|
|
|
|
struct ethtool_wolinfo *wol)
|
|
|
|
{
|
|
|
|
struct efx_nic *efx = netdev_priv(net_dev);
|
|
|
|
return efx->type->get_wol(efx, wol);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static int efx_ethtool_set_wol(struct net_device *net_dev,
|
|
|
|
struct ethtool_wolinfo *wol)
|
|
|
|
{
|
|
|
|
struct efx_nic *efx = netdev_priv(net_dev);
|
|
|
|
return efx->type->set_wol(efx, wol->wolopts);
|
|
|
|
}
|
|
|
|
|
2010-10-18 12:27:31 +07:00
|
|
|
static int efx_ethtool_reset(struct net_device *net_dev, u32 *flags)
|
2009-11-29 10:43:15 +07:00
|
|
|
{
|
|
|
|
struct efx_nic *efx = netdev_priv(net_dev);
|
2011-06-25 02:50:07 +07:00
|
|
|
int rc;
|
2009-11-29 10:43:15 +07:00
|
|
|
|
2011-06-25 02:50:07 +07:00
|
|
|
rc = efx->type->map_reset_flags(flags);
|
|
|
|
if (rc < 0)
|
|
|
|
return rc;
|
2009-11-29 10:43:15 +07:00
|
|
|
|
2011-06-25 02:50:07 +07:00
|
|
|
return efx_reset(efx, rc);
|
2009-11-29 10:43:15 +07:00
|
|
|
}
|
|
|
|
|
2012-10-27 06:33:28 +07:00
|
|
|
/* MAC address mask including only I/G bit */
|
2014-03-08 01:27:41 +07:00
|
|
|
static const u8 mac_addr_ig_mask[ETH_ALEN] __aligned(2) = {0x01, 0, 0, 0, 0, 0};
|
2012-02-03 05:41:49 +07:00
|
|
|
|
2012-09-06 08:11:04 +07:00
|
|
|
#define IP4_ADDR_FULL_MASK ((__force __be32)~0)
|
2016-02-05 18:16:50 +07:00
|
|
|
#define IP_PROTO_FULL_MASK 0xFF
|
2012-09-06 08:11:04 +07:00
|
|
|
#define PORT_FULL_MASK ((__force __be16)~0)
|
2012-10-27 06:33:28 +07:00
|
|
|
#define ETHER_TYPE_FULL_MASK ((__force __be16)~0)
|
2012-09-06 08:11:04 +07:00
|
|
|
|
2016-02-05 18:16:50 +07:00
|
|
|
static inline void ip6_fill_mask(__be32 *mask)
|
|
|
|
{
|
|
|
|
mask[0] = mask[1] = mask[2] = mask[3] = ~(__be32)0;
|
|
|
|
}
|
|
|
|
|
2012-01-03 19:05:47 +07:00
|
|
|
static int efx_ethtool_get_class_rule(struct efx_nic *efx,
|
|
|
|
struct ethtool_rx_flow_spec *rule)
|
|
|
|
{
|
|
|
|
struct ethtool_tcpip4_spec *ip_entry = &rule->h_u.tcp_ip4_spec;
|
|
|
|
struct ethtool_tcpip4_spec *ip_mask = &rule->m_u.tcp_ip4_spec;
|
2016-02-05 18:16:50 +07:00
|
|
|
struct ethtool_usrip4_spec *uip_entry = &rule->h_u.usr_ip4_spec;
|
|
|
|
struct ethtool_usrip4_spec *uip_mask = &rule->m_u.usr_ip4_spec;
|
|
|
|
struct ethtool_tcpip6_spec *ip6_entry = &rule->h_u.tcp_ip6_spec;
|
|
|
|
struct ethtool_tcpip6_spec *ip6_mask = &rule->m_u.tcp_ip6_spec;
|
|
|
|
struct ethtool_usrip6_spec *uip6_entry = &rule->h_u.usr_ip6_spec;
|
|
|
|
struct ethtool_usrip6_spec *uip6_mask = &rule->m_u.usr_ip6_spec;
|
2012-02-03 05:41:49 +07:00
|
|
|
struct ethhdr *mac_entry = &rule->h_u.ether_spec;
|
|
|
|
struct ethhdr *mac_mask = &rule->m_u.ether_spec;
|
2012-01-03 19:05:47 +07:00
|
|
|
struct efx_filter_spec spec;
|
|
|
|
int rc;
|
|
|
|
|
|
|
|
rc = efx_filter_get_filter_safe(efx, EFX_FILTER_PRI_MANUAL,
|
|
|
|
rule->location, &spec);
|
|
|
|
if (rc)
|
|
|
|
return rc;
|
|
|
|
|
2012-10-30 08:01:52 +07:00
|
|
|
if (spec.dmaq_id == EFX_FILTER_RX_DMAQ_ID_DROP)
|
2012-01-03 19:05:47 +07:00
|
|
|
rule->ring_cookie = RX_CLS_FLOW_DISC;
|
|
|
|
else
|
|
|
|
rule->ring_cookie = spec.dmaq_id;
|
|
|
|
|
2012-10-27 06:33:28 +07:00
|
|
|
if ((spec.match_flags & EFX_FILTER_MATCH_ETHER_TYPE) &&
|
|
|
|
spec.ether_type == htons(ETH_P_IP) &&
|
|
|
|
(spec.match_flags & EFX_FILTER_MATCH_IP_PROTO) &&
|
|
|
|
(spec.ip_proto == IPPROTO_TCP || spec.ip_proto == IPPROTO_UDP) &&
|
|
|
|
!(spec.match_flags &
|
|
|
|
~(EFX_FILTER_MATCH_ETHER_TYPE | EFX_FILTER_MATCH_OUTER_VID |
|
|
|
|
EFX_FILTER_MATCH_LOC_HOST | EFX_FILTER_MATCH_REM_HOST |
|
|
|
|
EFX_FILTER_MATCH_IP_PROTO |
|
|
|
|
EFX_FILTER_MATCH_LOC_PORT | EFX_FILTER_MATCH_REM_PORT))) {
|
|
|
|
rule->flow_type = ((spec.ip_proto == IPPROTO_TCP) ?
|
|
|
|
TCP_V4_FLOW : UDP_V4_FLOW);
|
|
|
|
if (spec.match_flags & EFX_FILTER_MATCH_LOC_HOST) {
|
|
|
|
ip_entry->ip4dst = spec.loc_host[0];
|
|
|
|
ip_mask->ip4dst = IP4_ADDR_FULL_MASK;
|
|
|
|
}
|
|
|
|
if (spec.match_flags & EFX_FILTER_MATCH_REM_HOST) {
|
|
|
|
ip_entry->ip4src = spec.rem_host[0];
|
|
|
|
ip_mask->ip4src = IP4_ADDR_FULL_MASK;
|
|
|
|
}
|
|
|
|
if (spec.match_flags & EFX_FILTER_MATCH_LOC_PORT) {
|
|
|
|
ip_entry->pdst = spec.loc_port;
|
|
|
|
ip_mask->pdst = PORT_FULL_MASK;
|
|
|
|
}
|
|
|
|
if (spec.match_flags & EFX_FILTER_MATCH_REM_PORT) {
|
|
|
|
ip_entry->psrc = spec.rem_port;
|
|
|
|
ip_mask->psrc = PORT_FULL_MASK;
|
|
|
|
}
|
2016-02-05 18:16:50 +07:00
|
|
|
} else if ((spec.match_flags & EFX_FILTER_MATCH_ETHER_TYPE) &&
|
|
|
|
spec.ether_type == htons(ETH_P_IPV6) &&
|
|
|
|
(spec.match_flags & EFX_FILTER_MATCH_IP_PROTO) &&
|
|
|
|
(spec.ip_proto == IPPROTO_TCP || spec.ip_proto == IPPROTO_UDP) &&
|
|
|
|
!(spec.match_flags &
|
|
|
|
~(EFX_FILTER_MATCH_ETHER_TYPE | EFX_FILTER_MATCH_OUTER_VID |
|
|
|
|
EFX_FILTER_MATCH_LOC_HOST | EFX_FILTER_MATCH_REM_HOST |
|
|
|
|
EFX_FILTER_MATCH_IP_PROTO |
|
|
|
|
EFX_FILTER_MATCH_LOC_PORT | EFX_FILTER_MATCH_REM_PORT))) {
|
|
|
|
rule->flow_type = ((spec.ip_proto == IPPROTO_TCP) ?
|
|
|
|
TCP_V6_FLOW : UDP_V6_FLOW);
|
|
|
|
if (spec.match_flags & EFX_FILTER_MATCH_LOC_HOST) {
|
|
|
|
memcpy(ip6_entry->ip6dst, spec.loc_host,
|
|
|
|
sizeof(ip6_entry->ip6dst));
|
|
|
|
ip6_fill_mask(ip6_mask->ip6dst);
|
|
|
|
}
|
|
|
|
if (spec.match_flags & EFX_FILTER_MATCH_REM_HOST) {
|
|
|
|
memcpy(ip6_entry->ip6src, spec.rem_host,
|
|
|
|
sizeof(ip6_entry->ip6src));
|
|
|
|
ip6_fill_mask(ip6_mask->ip6src);
|
|
|
|
}
|
|
|
|
if (spec.match_flags & EFX_FILTER_MATCH_LOC_PORT) {
|
|
|
|
ip6_entry->pdst = spec.loc_port;
|
|
|
|
ip6_mask->pdst = PORT_FULL_MASK;
|
|
|
|
}
|
|
|
|
if (spec.match_flags & EFX_FILTER_MATCH_REM_PORT) {
|
|
|
|
ip6_entry->psrc = spec.rem_port;
|
|
|
|
ip6_mask->psrc = PORT_FULL_MASK;
|
|
|
|
}
|
2012-10-27 06:33:28 +07:00
|
|
|
} else if (!(spec.match_flags &
|
|
|
|
~(EFX_FILTER_MATCH_LOC_MAC | EFX_FILTER_MATCH_LOC_MAC_IG |
|
|
|
|
EFX_FILTER_MATCH_REM_MAC | EFX_FILTER_MATCH_ETHER_TYPE |
|
|
|
|
EFX_FILTER_MATCH_OUTER_VID))) {
|
2012-01-03 19:05:47 +07:00
|
|
|
rule->flow_type = ETHER_FLOW;
|
2012-10-27 06:33:28 +07:00
|
|
|
if (spec.match_flags &
|
|
|
|
(EFX_FILTER_MATCH_LOC_MAC | EFX_FILTER_MATCH_LOC_MAC_IG)) {
|
2014-03-08 01:27:41 +07:00
|
|
|
ether_addr_copy(mac_entry->h_dest, spec.loc_mac);
|
2012-10-27 06:33:28 +07:00
|
|
|
if (spec.match_flags & EFX_FILTER_MATCH_LOC_MAC)
|
2014-03-08 01:27:41 +07:00
|
|
|
eth_broadcast_addr(mac_mask->h_dest);
|
2012-10-27 06:33:28 +07:00
|
|
|
else
|
2014-03-08 01:27:41 +07:00
|
|
|
ether_addr_copy(mac_mask->h_dest,
|
|
|
|
mac_addr_ig_mask);
|
2012-01-03 19:05:47 +07:00
|
|
|
}
|
2012-10-27 06:33:28 +07:00
|
|
|
if (spec.match_flags & EFX_FILTER_MATCH_REM_MAC) {
|
2014-03-08 01:27:41 +07:00
|
|
|
ether_addr_copy(mac_entry->h_source, spec.rem_mac);
|
|
|
|
eth_broadcast_addr(mac_mask->h_source);
|
2012-10-27 06:33:28 +07:00
|
|
|
}
|
|
|
|
if (spec.match_flags & EFX_FILTER_MATCH_ETHER_TYPE) {
|
|
|
|
mac_entry->h_proto = spec.ether_type;
|
|
|
|
mac_mask->h_proto = ETHER_TYPE_FULL_MASK;
|
|
|
|
}
|
2016-02-05 18:16:50 +07:00
|
|
|
} else if (spec.match_flags & EFX_FILTER_MATCH_ETHER_TYPE &&
|
|
|
|
spec.ether_type == htons(ETH_P_IP) &&
|
|
|
|
!(spec.match_flags &
|
|
|
|
~(EFX_FILTER_MATCH_ETHER_TYPE | EFX_FILTER_MATCH_OUTER_VID |
|
|
|
|
EFX_FILTER_MATCH_LOC_HOST | EFX_FILTER_MATCH_REM_HOST |
|
|
|
|
EFX_FILTER_MATCH_IP_PROTO))) {
|
|
|
|
rule->flow_type = IPV4_USER_FLOW;
|
|
|
|
uip_entry->ip_ver = ETH_RX_NFC_IP4;
|
|
|
|
if (spec.match_flags & EFX_FILTER_MATCH_IP_PROTO) {
|
|
|
|
uip_mask->proto = IP_PROTO_FULL_MASK;
|
|
|
|
uip_entry->proto = spec.ip_proto;
|
|
|
|
}
|
|
|
|
if (spec.match_flags & EFX_FILTER_MATCH_LOC_HOST) {
|
|
|
|
uip_entry->ip4dst = spec.loc_host[0];
|
|
|
|
uip_mask->ip4dst = IP4_ADDR_FULL_MASK;
|
|
|
|
}
|
|
|
|
if (spec.match_flags & EFX_FILTER_MATCH_REM_HOST) {
|
|
|
|
uip_entry->ip4src = spec.rem_host[0];
|
|
|
|
uip_mask->ip4src = IP4_ADDR_FULL_MASK;
|
|
|
|
}
|
|
|
|
} else if (spec.match_flags & EFX_FILTER_MATCH_ETHER_TYPE &&
|
|
|
|
spec.ether_type == htons(ETH_P_IPV6) &&
|
|
|
|
!(spec.match_flags &
|
|
|
|
~(EFX_FILTER_MATCH_ETHER_TYPE | EFX_FILTER_MATCH_OUTER_VID |
|
|
|
|
EFX_FILTER_MATCH_LOC_HOST | EFX_FILTER_MATCH_REM_HOST |
|
|
|
|
EFX_FILTER_MATCH_IP_PROTO))) {
|
|
|
|
rule->flow_type = IPV6_USER_FLOW;
|
|
|
|
if (spec.match_flags & EFX_FILTER_MATCH_IP_PROTO) {
|
|
|
|
uip6_mask->l4_proto = IP_PROTO_FULL_MASK;
|
|
|
|
uip6_entry->l4_proto = spec.ip_proto;
|
|
|
|
}
|
|
|
|
if (spec.match_flags & EFX_FILTER_MATCH_LOC_HOST) {
|
|
|
|
memcpy(uip6_entry->ip6dst, spec.loc_host,
|
|
|
|
sizeof(uip6_entry->ip6dst));
|
|
|
|
ip6_fill_mask(uip6_mask->ip6dst);
|
|
|
|
}
|
|
|
|
if (spec.match_flags & EFX_FILTER_MATCH_REM_HOST) {
|
|
|
|
memcpy(uip6_entry->ip6src, spec.rem_host,
|
|
|
|
sizeof(uip6_entry->ip6src));
|
|
|
|
ip6_fill_mask(uip6_mask->ip6src);
|
|
|
|
}
|
2012-10-27 06:33:28 +07:00
|
|
|
} else {
|
|
|
|
/* The above should handle all filters that we insert */
|
|
|
|
WARN_ON(1);
|
|
|
|
return -EINVAL;
|
2012-01-03 19:05:47 +07:00
|
|
|
}
|
|
|
|
|
2012-10-27 06:33:28 +07:00
|
|
|
if (spec.match_flags & EFX_FILTER_MATCH_OUTER_VID) {
|
|
|
|
rule->flow_type |= FLOW_EXT;
|
|
|
|
rule->h_ext.vlan_tci = spec.outer_vid;
|
|
|
|
rule->m_ext.vlan_tci = htons(0xfff);
|
2012-01-03 19:05:47 +07:00
|
|
|
}
|
2012-10-27 06:33:28 +07:00
|
|
|
|
2012-01-03 19:05:47 +07:00
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
|
2010-06-30 12:06:28 +07:00
|
|
|
static int
|
|
|
|
efx_ethtool_get_rxnfc(struct net_device *net_dev,
|
2012-01-03 19:05:47 +07:00
|
|
|
struct ethtool_rxnfc *info, u32 *rule_locs)
|
2010-06-30 12:06:28 +07:00
|
|
|
{
|
|
|
|
struct efx_nic *efx = netdev_priv(net_dev);
|
|
|
|
|
|
|
|
switch (info->cmd) {
|
|
|
|
case ETHTOOL_GRXRINGS:
|
|
|
|
info->data = efx->n_rx_channels;
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
case ETHTOOL_GRXFH: {
|
|
|
|
info->data = 0;
|
2017-01-04 22:10:56 +07:00
|
|
|
if (!efx->rss_active) /* No RSS */
|
|
|
|
return 0;
|
2010-06-30 12:06:28 +07:00
|
|
|
switch (info->flow_type) {
|
2016-11-04 05:12:58 +07:00
|
|
|
case UDP_V4_FLOW:
|
|
|
|
if (efx->rx_hash_udp_4tuple)
|
|
|
|
/* fall through */
|
2010-06-30 12:06:28 +07:00
|
|
|
case TCP_V4_FLOW:
|
2016-11-04 05:12:58 +07:00
|
|
|
info->data |= RXH_L4_B_0_1 | RXH_L4_B_2_3;
|
2010-06-30 12:06:28 +07:00
|
|
|
/* fall through */
|
|
|
|
case SCTP_V4_FLOW:
|
|
|
|
case AH_ESP_V4_FLOW:
|
|
|
|
case IPV4_FLOW:
|
|
|
|
info->data |= RXH_IP_SRC | RXH_IP_DST;
|
|
|
|
break;
|
2016-11-04 05:12:58 +07:00
|
|
|
case UDP_V6_FLOW:
|
|
|
|
if (efx->rx_hash_udp_4tuple)
|
|
|
|
/* fall through */
|
2010-06-30 12:06:28 +07:00
|
|
|
case TCP_V6_FLOW:
|
2016-11-04 05:12:58 +07:00
|
|
|
info->data |= RXH_L4_B_0_1 | RXH_L4_B_2_3;
|
2010-06-30 12:06:28 +07:00
|
|
|
/* fall through */
|
|
|
|
case SCTP_V6_FLOW:
|
|
|
|
case AH_ESP_V6_FLOW:
|
|
|
|
case IPV6_FLOW:
|
|
|
|
info->data |= RXH_IP_SRC | RXH_IP_DST;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2012-01-03 19:05:47 +07:00
|
|
|
case ETHTOOL_GRXCLSRLCNT:
|
|
|
|
info->data = efx_filter_get_rx_id_limit(efx);
|
|
|
|
if (info->data == 0)
|
|
|
|
return -EOPNOTSUPP;
|
|
|
|
info->data |= RX_CLS_LOC_SPECIAL;
|
|
|
|
info->rule_cnt =
|
|
|
|
efx_filter_count_rx_used(efx, EFX_FILTER_PRI_MANUAL);
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
case ETHTOOL_GRXCLSRULE:
|
|
|
|
if (efx_filter_get_rx_id_limit(efx) == 0)
|
|
|
|
return -EOPNOTSUPP;
|
|
|
|
return efx_ethtool_get_class_rule(efx, &info->fs);
|
|
|
|
|
|
|
|
case ETHTOOL_GRXCLSRLALL: {
|
|
|
|
s32 rc;
|
|
|
|
info->data = efx_filter_get_rx_id_limit(efx);
|
|
|
|
if (info->data == 0)
|
|
|
|
return -EOPNOTSUPP;
|
|
|
|
rc = efx_filter_get_rx_ids(efx, EFX_FILTER_PRI_MANUAL,
|
|
|
|
rule_locs, info->rule_cnt);
|
|
|
|
if (rc < 0)
|
|
|
|
return rc;
|
|
|
|
info->rule_cnt = rc;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2010-06-30 12:06:28 +07:00
|
|
|
default:
|
|
|
|
return -EOPNOTSUPP;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-02-05 18:16:50 +07:00
|
|
|
static inline bool ip6_mask_is_full(__be32 mask[4])
|
|
|
|
{
|
|
|
|
return !~(mask[0] & mask[1] & mask[2] & mask[3]);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline bool ip6_mask_is_empty(__be32 mask[4])
|
|
|
|
{
|
|
|
|
return !(mask[0] | mask[1] | mask[2] | mask[3]);
|
|
|
|
}
|
|
|
|
|
2012-01-03 19:05:47 +07:00
|
|
|
static int efx_ethtool_set_class_rule(struct efx_nic *efx,
|
|
|
|
struct ethtool_rx_flow_spec *rule)
|
2010-09-20 15:43:42 +07:00
|
|
|
{
|
2012-01-03 19:05:47 +07:00
|
|
|
struct ethtool_tcpip4_spec *ip_entry = &rule->h_u.tcp_ip4_spec;
|
|
|
|
struct ethtool_tcpip4_spec *ip_mask = &rule->m_u.tcp_ip4_spec;
|
2016-02-05 18:16:50 +07:00
|
|
|
struct ethtool_usrip4_spec *uip_entry = &rule->h_u.usr_ip4_spec;
|
|
|
|
struct ethtool_usrip4_spec *uip_mask = &rule->m_u.usr_ip4_spec;
|
|
|
|
struct ethtool_tcpip6_spec *ip6_entry = &rule->h_u.tcp_ip6_spec;
|
|
|
|
struct ethtool_tcpip6_spec *ip6_mask = &rule->m_u.tcp_ip6_spec;
|
|
|
|
struct ethtool_usrip6_spec *uip6_entry = &rule->h_u.usr_ip6_spec;
|
|
|
|
struct ethtool_usrip6_spec *uip6_mask = &rule->m_u.usr_ip6_spec;
|
2012-01-03 19:05:47 +07:00
|
|
|
struct ethhdr *mac_entry = &rule->h_u.ether_spec;
|
|
|
|
struct ethhdr *mac_mask = &rule->m_u.ether_spec;
|
|
|
|
struct efx_filter_spec spec;
|
2010-12-08 02:11:26 +07:00
|
|
|
int rc;
|
2010-09-20 15:43:42 +07:00
|
|
|
|
2012-01-03 19:05:47 +07:00
|
|
|
/* Check that user wants us to choose the location */
|
2012-09-05 00:57:25 +07:00
|
|
|
if (rule->location != RX_CLS_LOC_ANY)
|
2010-09-20 15:43:42 +07:00
|
|
|
return -EINVAL;
|
|
|
|
|
2012-01-03 19:05:47 +07:00
|
|
|
/* Range-check ring_cookie */
|
|
|
|
if (rule->ring_cookie >= efx->n_rx_channels &&
|
|
|
|
rule->ring_cookie != RX_CLS_FLOW_DISC)
|
2010-09-20 15:43:42 +07:00
|
|
|
return -EINVAL;
|
|
|
|
|
2012-01-03 19:05:47 +07:00
|
|
|
/* Check for unsupported extensions */
|
|
|
|
if ((rule->flow_type & FLOW_EXT) &&
|
2012-09-06 08:11:04 +07:00
|
|
|
(rule->m_ext.vlan_etype || rule->m_ext.data[0] ||
|
2012-01-03 19:05:47 +07:00
|
|
|
rule->m_ext.data[1]))
|
|
|
|
return -EINVAL;
|
|
|
|
|
2013-01-30 06:33:15 +07:00
|
|
|
efx_filter_init_rx(&spec, EFX_FILTER_PRI_MANUAL,
|
|
|
|
efx->rx_scatter ? EFX_FILTER_FLAG_RX_SCATTER : 0,
|
2012-01-03 19:05:47 +07:00
|
|
|
(rule->ring_cookie == RX_CLS_FLOW_DISC) ?
|
2012-10-30 08:01:52 +07:00
|
|
|
EFX_FILTER_RX_DMAQ_ID_DROP : rule->ring_cookie);
|
2010-12-08 02:11:26 +07:00
|
|
|
|
2012-10-27 06:33:28 +07:00
|
|
|
switch (rule->flow_type & ~FLOW_EXT) {
|
2010-09-20 15:43:42 +07:00
|
|
|
case TCP_V4_FLOW:
|
2012-10-27 06:33:28 +07:00
|
|
|
case UDP_V4_FLOW:
|
|
|
|
spec.match_flags = (EFX_FILTER_MATCH_ETHER_TYPE |
|
|
|
|
EFX_FILTER_MATCH_IP_PROTO);
|
|
|
|
spec.ether_type = htons(ETH_P_IP);
|
|
|
|
spec.ip_proto = ((rule->flow_type & ~FLOW_EXT) == TCP_V4_FLOW ?
|
|
|
|
IPPROTO_TCP : IPPROTO_UDP);
|
|
|
|
if (ip_mask->ip4dst) {
|
|
|
|
if (ip_mask->ip4dst != IP4_ADDR_FULL_MASK)
|
|
|
|
return -EINVAL;
|
|
|
|
spec.match_flags |= EFX_FILTER_MATCH_LOC_HOST;
|
|
|
|
spec.loc_host[0] = ip_entry->ip4dst;
|
|
|
|
}
|
|
|
|
if (ip_mask->ip4src) {
|
|
|
|
if (ip_mask->ip4src != IP4_ADDR_FULL_MASK)
|
|
|
|
return -EINVAL;
|
|
|
|
spec.match_flags |= EFX_FILTER_MATCH_REM_HOST;
|
|
|
|
spec.rem_host[0] = ip_entry->ip4src;
|
|
|
|
}
|
|
|
|
if (ip_mask->pdst) {
|
|
|
|
if (ip_mask->pdst != PORT_FULL_MASK)
|
|
|
|
return -EINVAL;
|
|
|
|
spec.match_flags |= EFX_FILTER_MATCH_LOC_PORT;
|
|
|
|
spec.loc_port = ip_entry->pdst;
|
|
|
|
}
|
|
|
|
if (ip_mask->psrc) {
|
|
|
|
if (ip_mask->psrc != PORT_FULL_MASK)
|
|
|
|
return -EINVAL;
|
|
|
|
spec.match_flags |= EFX_FILTER_MATCH_REM_PORT;
|
|
|
|
spec.rem_port = ip_entry->psrc;
|
|
|
|
}
|
|
|
|
if (ip_mask->tos)
|
2010-09-20 15:43:42 +07:00
|
|
|
return -EINVAL;
|
|
|
|
break;
|
2012-02-03 05:41:49 +07:00
|
|
|
|
2016-02-05 18:16:50 +07:00
|
|
|
case TCP_V6_FLOW:
|
|
|
|
case UDP_V6_FLOW:
|
|
|
|
spec.match_flags = (EFX_FILTER_MATCH_ETHER_TYPE |
|
|
|
|
EFX_FILTER_MATCH_IP_PROTO);
|
|
|
|
spec.ether_type = htons(ETH_P_IPV6);
|
|
|
|
spec.ip_proto = ((rule->flow_type & ~FLOW_EXT) == TCP_V6_FLOW ?
|
|
|
|
IPPROTO_TCP : IPPROTO_UDP);
|
|
|
|
if (!ip6_mask_is_empty(ip6_mask->ip6dst)) {
|
|
|
|
if (!ip6_mask_is_full(ip6_mask->ip6dst))
|
|
|
|
return -EINVAL;
|
|
|
|
spec.match_flags |= EFX_FILTER_MATCH_LOC_HOST;
|
|
|
|
memcpy(spec.loc_host, ip6_entry->ip6dst, sizeof(spec.loc_host));
|
|
|
|
}
|
|
|
|
if (!ip6_mask_is_empty(ip6_mask->ip6src)) {
|
|
|
|
if (!ip6_mask_is_full(ip6_mask->ip6src))
|
|
|
|
return -EINVAL;
|
|
|
|
spec.match_flags |= EFX_FILTER_MATCH_REM_HOST;
|
|
|
|
memcpy(spec.rem_host, ip6_entry->ip6src, sizeof(spec.rem_host));
|
|
|
|
}
|
|
|
|
if (ip6_mask->pdst) {
|
|
|
|
if (ip6_mask->pdst != PORT_FULL_MASK)
|
|
|
|
return -EINVAL;
|
|
|
|
spec.match_flags |= EFX_FILTER_MATCH_LOC_PORT;
|
|
|
|
spec.loc_port = ip6_entry->pdst;
|
|
|
|
}
|
|
|
|
if (ip6_mask->psrc) {
|
|
|
|
if (ip6_mask->psrc != PORT_FULL_MASK)
|
|
|
|
return -EINVAL;
|
|
|
|
spec.match_flags |= EFX_FILTER_MATCH_REM_PORT;
|
|
|
|
spec.rem_port = ip6_entry->psrc;
|
|
|
|
}
|
|
|
|
if (ip6_mask->tclass)
|
|
|
|
return -EINVAL;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case IPV4_USER_FLOW:
|
|
|
|
if (uip_mask->l4_4_bytes || uip_mask->tos || uip_mask->ip_ver ||
|
|
|
|
uip_entry->ip_ver != ETH_RX_NFC_IP4)
|
|
|
|
return -EINVAL;
|
|
|
|
spec.match_flags = EFX_FILTER_MATCH_ETHER_TYPE;
|
|
|
|
spec.ether_type = htons(ETH_P_IP);
|
|
|
|
if (uip_mask->ip4dst) {
|
|
|
|
if (uip_mask->ip4dst != IP4_ADDR_FULL_MASK)
|
|
|
|
return -EINVAL;
|
|
|
|
spec.match_flags |= EFX_FILTER_MATCH_LOC_HOST;
|
|
|
|
spec.loc_host[0] = uip_entry->ip4dst;
|
|
|
|
}
|
|
|
|
if (uip_mask->ip4src) {
|
|
|
|
if (uip_mask->ip4src != IP4_ADDR_FULL_MASK)
|
|
|
|
return -EINVAL;
|
|
|
|
spec.match_flags |= EFX_FILTER_MATCH_REM_HOST;
|
|
|
|
spec.rem_host[0] = uip_entry->ip4src;
|
|
|
|
}
|
|
|
|
if (uip_mask->proto) {
|
|
|
|
if (uip_mask->proto != IP_PROTO_FULL_MASK)
|
|
|
|
return -EINVAL;
|
|
|
|
spec.match_flags |= EFX_FILTER_MATCH_IP_PROTO;
|
|
|
|
spec.ip_proto = uip_entry->proto;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case IPV6_USER_FLOW:
|
|
|
|
if (uip6_mask->l4_4_bytes || uip6_mask->tclass)
|
|
|
|
return -EINVAL;
|
|
|
|
spec.match_flags = EFX_FILTER_MATCH_ETHER_TYPE;
|
|
|
|
spec.ether_type = htons(ETH_P_IPV6);
|
|
|
|
if (!ip6_mask_is_empty(uip6_mask->ip6dst)) {
|
|
|
|
if (!ip6_mask_is_full(uip6_mask->ip6dst))
|
|
|
|
return -EINVAL;
|
|
|
|
spec.match_flags |= EFX_FILTER_MATCH_LOC_HOST;
|
|
|
|
memcpy(spec.loc_host, uip6_entry->ip6dst, sizeof(spec.loc_host));
|
|
|
|
}
|
|
|
|
if (!ip6_mask_is_empty(uip6_mask->ip6src)) {
|
|
|
|
if (!ip6_mask_is_full(uip6_mask->ip6src))
|
|
|
|
return -EINVAL;
|
|
|
|
spec.match_flags |= EFX_FILTER_MATCH_REM_HOST;
|
|
|
|
memcpy(spec.rem_host, uip6_entry->ip6src, sizeof(spec.rem_host));
|
|
|
|
}
|
|
|
|
if (uip6_mask->l4_proto) {
|
|
|
|
if (uip6_mask->l4_proto != IP_PROTO_FULL_MASK)
|
|
|
|
return -EINVAL;
|
|
|
|
spec.match_flags |= EFX_FILTER_MATCH_IP_PROTO;
|
|
|
|
spec.ip_proto = uip6_entry->l4_proto;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2012-10-27 06:33:28 +07:00
|
|
|
case ETHER_FLOW:
|
|
|
|
if (!is_zero_ether_addr(mac_mask->h_dest)) {
|
|
|
|
if (ether_addr_equal(mac_mask->h_dest,
|
|
|
|
mac_addr_ig_mask))
|
|
|
|
spec.match_flags |= EFX_FILTER_MATCH_LOC_MAC_IG;
|
|
|
|
else if (is_broadcast_ether_addr(mac_mask->h_dest))
|
|
|
|
spec.match_flags |= EFX_FILTER_MATCH_LOC_MAC;
|
2012-02-03 05:41:49 +07:00
|
|
|
else
|
2012-10-27 06:33:28 +07:00
|
|
|
return -EINVAL;
|
2014-03-08 01:27:41 +07:00
|
|
|
ether_addr_copy(spec.loc_mac, mac_entry->h_dest);
|
2012-02-03 05:41:49 +07:00
|
|
|
}
|
2012-10-27 06:33:28 +07:00
|
|
|
if (!is_zero_ether_addr(mac_mask->h_source)) {
|
|
|
|
if (!is_broadcast_ether_addr(mac_mask->h_source))
|
|
|
|
return -EINVAL;
|
|
|
|
spec.match_flags |= EFX_FILTER_MATCH_REM_MAC;
|
2014-03-08 01:27:41 +07:00
|
|
|
ether_addr_copy(spec.rem_mac, mac_entry->h_source);
|
2012-10-27 06:33:28 +07:00
|
|
|
}
|
|
|
|
if (mac_mask->h_proto) {
|
|
|
|
if (mac_mask->h_proto != ETHER_TYPE_FULL_MASK)
|
|
|
|
return -EINVAL;
|
|
|
|
spec.match_flags |= EFX_FILTER_MATCH_ETHER_TYPE;
|
|
|
|
spec.ether_type = mac_entry->h_proto;
|
2012-02-03 05:41:49 +07:00
|
|
|
}
|
2010-09-20 15:43:42 +07:00
|
|
|
break;
|
2010-12-08 02:11:26 +07:00
|
|
|
|
2010-09-20 15:43:42 +07:00
|
|
|
default:
|
|
|
|
return -EINVAL;
|
|
|
|
}
|
|
|
|
|
2012-10-27 06:33:28 +07:00
|
|
|
if ((rule->flow_type & FLOW_EXT) && rule->m_ext.vlan_tci) {
|
|
|
|
if (rule->m_ext.vlan_tci != htons(0xfff))
|
|
|
|
return -EINVAL;
|
|
|
|
spec.match_flags |= EFX_FILTER_MATCH_OUTER_VID;
|
|
|
|
spec.outer_vid = rule->h_ext.vlan_tci;
|
|
|
|
}
|
|
|
|
|
2012-01-03 19:05:47 +07:00
|
|
|
rc = efx_filter_insert_filter(efx, &spec, true);
|
|
|
|
if (rc < 0)
|
|
|
|
return rc;
|
2011-05-14 08:35:25 +07:00
|
|
|
|
2012-01-03 19:05:47 +07:00
|
|
|
rule->location = rc;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int efx_ethtool_set_rxnfc(struct net_device *net_dev,
|
|
|
|
struct ethtool_rxnfc *info)
|
|
|
|
{
|
|
|
|
struct efx_nic *efx = netdev_priv(net_dev);
|
|
|
|
|
|
|
|
if (efx_filter_get_rx_id_limit(efx) == 0)
|
|
|
|
return -EOPNOTSUPP;
|
|
|
|
|
|
|
|
switch (info->cmd) {
|
|
|
|
case ETHTOOL_SRXCLSRLINS:
|
|
|
|
return efx_ethtool_set_class_rule(efx, &info->fs);
|
|
|
|
|
|
|
|
case ETHTOOL_SRXCLSRLDEL:
|
|
|
|
return efx_filter_remove_id_safe(efx, EFX_FILTER_PRI_MANUAL,
|
|
|
|
info->fs.location);
|
|
|
|
|
|
|
|
default:
|
|
|
|
return -EOPNOTSUPP;
|
|
|
|
}
|
2010-09-20 15:43:42 +07:00
|
|
|
}
|
|
|
|
|
2011-12-15 20:55:01 +07:00
|
|
|
static u32 efx_ethtool_get_rxfh_indir_size(struct net_device *net_dev)
|
2010-06-30 12:06:28 +07:00
|
|
|
{
|
|
|
|
struct efx_nic *efx = netdev_priv(net_dev);
|
|
|
|
|
sfc: separate out SFC4000 ("Falcon") support into new sfc-falcon driver
Rationale: The differences between Falcon and Siena are in many ways larger
than those between Siena and EF10 (despite Siena being nominally "Falcon-
architecture"); for instance, Falcon has no MCPU, so there is no MCDI.
Removing Falcon support from the sfc driver should simplify the latter,
and avoid the possibility of Falcon support being broken by changes to sfc
(which are rarely if ever tested on Falcon, it being end-of-lifed hardware).
The sfc-falcon driver created in this changeset is essentially a copy of the
sfc driver, but with Siena- and EF10-specific code, including MCDI, removed
and with the "efx_" identifier prefix changed to "ef4_" (for "EFX 4000-
series") to avoid collisions when both drivers are built-in.
This changeset removes Falcon from the sfc driver's PCI ID table; then in
sfc I've removed obvious Falcon-related code: I removed the Falcon NIC
functions, Falcon PHY code, and EFX_REV_FALCON_*, then fixed up everything
that referenced them.
Also, increment minor version of both drivers (to 4.1).
For now, CONFIG_SFC selects CONFIG_SFC_FALCON, so that updating old configs
doesn't cause Falcon support to disappear; but that should be undone at
some point in the future.
Signed-off-by: Edward Cree <ecree@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-11-29 01:55:34 +07:00
|
|
|
return (efx->n_rx_channels == 1) ? 0 : ARRAY_SIZE(efx->rx_indir_table);
|
2011-12-15 20:55:01 +07:00
|
|
|
}
|
|
|
|
|
2017-01-17 19:01:53 +07:00
|
|
|
static u32 efx_ethtool_get_rxfh_key_size(struct net_device *net_dev)
|
|
|
|
{
|
|
|
|
struct efx_nic *efx = netdev_priv(net_dev);
|
|
|
|
|
|
|
|
return efx->type->rx_hash_key_size;
|
|
|
|
}
|
|
|
|
|
2014-12-02 23:12:10 +07:00
|
|
|
static int efx_ethtool_get_rxfh(struct net_device *net_dev, u32 *indir, u8 *key,
|
|
|
|
u8 *hfunc)
|
2011-12-15 20:55:01 +07:00
|
|
|
{
|
|
|
|
struct efx_nic *efx = netdev_priv(net_dev);
|
2010-06-30 12:06:28 +07:00
|
|
|
|
2014-12-02 23:12:10 +07:00
|
|
|
if (hfunc)
|
|
|
|
*hfunc = ETH_RSS_HASH_TOP;
|
|
|
|
if (indir)
|
|
|
|
memcpy(indir, efx->rx_indir_table, sizeof(efx->rx_indir_table));
|
2017-01-17 19:01:53 +07:00
|
|
|
if (key)
|
|
|
|
memcpy(key, efx->rx_hash_key, efx->type->rx_hash_key_size);
|
2010-06-30 12:06:28 +07:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2014-12-02 23:12:10 +07:00
|
|
|
static int efx_ethtool_set_rxfh(struct net_device *net_dev, const u32 *indir,
|
|
|
|
const u8 *key, const u8 hfunc)
|
2010-06-30 12:06:28 +07:00
|
|
|
{
|
|
|
|
struct efx_nic *efx = netdev_priv(net_dev);
|
|
|
|
|
2017-01-17 19:01:53 +07:00
|
|
|
/* Hash function is Toeplitz, cannot be changed */
|
|
|
|
if (hfunc != ETH_RSS_HASH_NO_CHANGE && hfunc != ETH_RSS_HASH_TOP)
|
2014-12-02 23:12:10 +07:00
|
|
|
return -EOPNOTSUPP;
|
2017-01-17 19:01:53 +07:00
|
|
|
if (!indir && !key)
|
2014-12-02 23:12:10 +07:00
|
|
|
return 0;
|
2015-05-06 06:59:38 +07:00
|
|
|
|
2017-01-17 19:01:53 +07:00
|
|
|
if (!key)
|
|
|
|
key = efx->rx_hash_key;
|
|
|
|
if (!indir)
|
|
|
|
indir = efx->rx_indir_table;
|
|
|
|
|
|
|
|
return efx->type->rx_push_rss_config(efx, true, indir, key);
|
2010-06-30 12:06:28 +07:00
|
|
|
}
|
|
|
|
|
2013-07-03 13:07:40 +07:00
|
|
|
static int efx_ethtool_get_ts_info(struct net_device *net_dev,
|
|
|
|
struct ethtool_ts_info *ts_info)
|
2013-04-08 23:34:58 +07:00
|
|
|
{
|
|
|
|
struct efx_nic *efx = netdev_priv(net_dev);
|
|
|
|
|
|
|
|
/* Software capabilities */
|
|
|
|
ts_info->so_timestamping = (SOF_TIMESTAMPING_RX_SOFTWARE |
|
|
|
|
SOF_TIMESTAMPING_SOFTWARE);
|
|
|
|
ts_info->phc_index = -1;
|
|
|
|
|
|
|
|
efx_ptp_get_ts_info(efx, ts_info);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2012-05-02 00:50:43 +07:00
|
|
|
static int efx_ethtool_get_module_eeprom(struct net_device *net_dev,
|
|
|
|
struct ethtool_eeprom *ee,
|
|
|
|
u8 *data)
|
|
|
|
{
|
|
|
|
struct efx_nic *efx = netdev_priv(net_dev);
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
if (!efx->phy_op || !efx->phy_op->get_module_eeprom)
|
|
|
|
return -EOPNOTSUPP;
|
|
|
|
|
|
|
|
mutex_lock(&efx->mac_lock);
|
|
|
|
ret = efx->phy_op->get_module_eeprom(efx, ee, data);
|
|
|
|
mutex_unlock(&efx->mac_lock);
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int efx_ethtool_get_module_info(struct net_device *net_dev,
|
|
|
|
struct ethtool_modinfo *modinfo)
|
|
|
|
{
|
|
|
|
struct efx_nic *efx = netdev_priv(net_dev);
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
if (!efx->phy_op || !efx->phy_op->get_module_info)
|
|
|
|
return -EOPNOTSUPP;
|
|
|
|
|
|
|
|
mutex_lock(&efx->mac_lock);
|
|
|
|
ret = efx->phy_op->get_module_info(efx, modinfo);
|
|
|
|
mutex_unlock(&efx->mac_lock);
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2009-09-02 15:03:33 +07:00
|
|
|
const struct ethtool_ops efx_ethtool_ops = {
|
2008-04-27 18:55:59 +07:00
|
|
|
.get_drvinfo = efx_ethtool_get_drvinfo,
|
2010-06-21 10:06:53 +07:00
|
|
|
.get_regs_len = efx_ethtool_get_regs_len,
|
|
|
|
.get_regs = efx_ethtool_get_regs,
|
2010-06-23 18:30:07 +07:00
|
|
|
.get_msglevel = efx_ethtool_get_msglevel,
|
|
|
|
.set_msglevel = efx_ethtool_set_msglevel,
|
2008-04-27 18:55:59 +07:00
|
|
|
.nway_reset = efx_ethtool_nway_reset,
|
2010-12-09 19:10:25 +07:00
|
|
|
.get_link = ethtool_op_get_link,
|
2008-04-27 18:55:59 +07:00
|
|
|
.get_coalesce = efx_ethtool_get_coalesce,
|
|
|
|
.set_coalesce = efx_ethtool_set_coalesce,
|
2010-09-10 13:42:33 +07:00
|
|
|
.get_ringparam = efx_ethtool_get_ringparam,
|
|
|
|
.set_ringparam = efx_ethtool_set_ringparam,
|
2008-04-27 18:55:59 +07:00
|
|
|
.get_pauseparam = efx_ethtool_get_pauseparam,
|
|
|
|
.set_pauseparam = efx_ethtool_set_pauseparam,
|
2008-09-01 18:48:12 +07:00
|
|
|
.get_sset_count = efx_ethtool_get_sset_count,
|
2008-05-07 19:36:19 +07:00
|
|
|
.self_test = efx_ethtool_self_test,
|
2008-04-27 18:55:59 +07:00
|
|
|
.get_strings = efx_ethtool_get_strings,
|
2011-04-02 06:43:46 +07:00
|
|
|
.set_phys_id = efx_ethtool_phys_id,
|
2008-04-27 18:55:59 +07:00
|
|
|
.get_ethtool_stats = efx_ethtool_get_stats,
|
2009-11-29 10:43:07 +07:00
|
|
|
.get_wol = efx_ethtool_get_wol,
|
|
|
|
.set_wol = efx_ethtool_set_wol,
|
2009-11-29 10:43:15 +07:00
|
|
|
.reset = efx_ethtool_reset,
|
2010-06-30 12:06:28 +07:00
|
|
|
.get_rxnfc = efx_ethtool_get_rxnfc,
|
2012-01-03 19:05:47 +07:00
|
|
|
.set_rxnfc = efx_ethtool_set_rxnfc,
|
2011-12-15 20:55:01 +07:00
|
|
|
.get_rxfh_indir_size = efx_ethtool_get_rxfh_indir_size,
|
2017-01-17 19:01:53 +07:00
|
|
|
.get_rxfh_key_size = efx_ethtool_get_rxfh_key_size,
|
2014-05-15 07:25:27 +07:00
|
|
|
.get_rxfh = efx_ethtool_get_rxfh,
|
|
|
|
.set_rxfh = efx_ethtool_set_rxfh,
|
2013-04-08 23:34:58 +07:00
|
|
|
.get_ts_info = efx_ethtool_get_ts_info,
|
2012-05-02 00:50:43 +07:00
|
|
|
.get_module_info = efx_ethtool_get_module_info,
|
|
|
|
.get_module_eeprom = efx_ethtool_get_module_eeprom,
|
2016-12-15 06:12:53 +07:00
|
|
|
.get_link_ksettings = efx_ethtool_get_link_ksettings,
|
|
|
|
.set_link_ksettings = efx_ethtool_set_link_ksettings,
|
2008-04-27 18:55:59 +07:00
|
|
|
};
|