Commit 4d03e00a authored by Shannon Nelson's avatar Shannon Nelson Committed by David S. Miller

ionic: Add initial ethtool support

Add in the basic ethtool callbacks for device information
and control.
Signed-off-by: default avatarShannon Nelson <snelson@pensando.io>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8d61aad4
...@@ -4,4 +4,4 @@ ...@@ -4,4 +4,4 @@
obj-$(CONFIG_IONIC) := ionic.o obj-$(CONFIG_IONIC) := ionic.o
ionic-y := ionic_main.o ionic_bus_pci.o ionic_devlink.o ionic_dev.o \ ionic-y := ionic_main.o ionic_bus_pci.o ionic_devlink.o ionic_dev.o \
ionic_debugfs.o ionic_lif.o ionic_rx_filter.o ionic_debugfs.o ionic_lif.o ionic_rx_filter.o ionic_ethtool.o
...@@ -12,8 +12,15 @@ ...@@ -12,8 +12,15 @@
#define IONIC_MIN_MTU ETH_MIN_MTU #define IONIC_MIN_MTU ETH_MIN_MTU
#define IONIC_MAX_MTU 9194 #define IONIC_MAX_MTU 9194
#define IONIC_MAX_TXRX_DESC 16384
#define IONIC_MIN_TXRX_DESC 16
#define IONIC_DEF_TXRX_DESC 4096
#define IONIC_LIFS_MAX 1024 #define IONIC_LIFS_MAX 1024
#define IONIC_DEV_CMD_REG_VERSION 1
#define IONIC_DEV_INFO_REG_COUNT 32
#define IONIC_DEV_CMD_REG_COUNT 32
struct ionic_dev_bar { struct ionic_dev_bar {
void __iomem *vaddr; void __iomem *vaddr;
phys_addr_t bus_addr; phys_addr_t bus_addr;
......
This diff is collapsed.
/* SPDX-License-Identifier: GPL-2.0 */
/* Copyright(c) 2017 - 2019 Pensando Systems, Inc */
#ifndef _IONIC_ETHTOOL_H_
#define _IONIC_ETHTOOL_H_
void ionic_ethtool_set_ops(struct net_device *netdev);
#endif /* _IONIC_ETHTOOL_H_ */
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include "ionic.h" #include "ionic.h"
#include "ionic_bus.h" #include "ionic_bus.h"
#include "ionic_lif.h" #include "ionic_lif.h"
#include "ionic_ethtool.h"
#include "ionic_debugfs.h" #include "ionic_debugfs.h"
static void ionic_lif_rx_mode(struct ionic_lif *lif, unsigned int rx_mode); static void ionic_lif_rx_mode(struct ionic_lif *lif, unsigned int rx_mode);
...@@ -1162,6 +1163,7 @@ static struct ionic_lif *ionic_lif_alloc(struct ionic *ionic, unsigned int index ...@@ -1162,6 +1163,7 @@ static struct ionic_lif *ionic_lif_alloc(struct ionic *ionic, unsigned int index
lif->netdev = netdev; lif->netdev = netdev;
ionic->master_lif = lif; ionic->master_lif = lif;
netdev->netdev_ops = &ionic_netdev_ops; netdev->netdev_ops = &ionic_netdev_ops;
ionic_ethtool_set_ops(netdev);
netdev->watchdog_timeo = 2 * HZ; netdev->watchdog_timeo = 2 * HZ;
netdev->min_mtu = IONIC_MIN_MTU; netdev->min_mtu = IONIC_MIN_MTU;
......
...@@ -109,6 +109,8 @@ struct ionic_lif { ...@@ -109,6 +109,8 @@ struct ionic_lif {
u64 last_eid; u64 last_eid;
unsigned int neqs; unsigned int neqs;
unsigned int nxqs; unsigned int nxqs;
unsigned int ntxq_descs;
unsigned int nrxq_descs;
unsigned int rx_mode; unsigned int rx_mode;
u64 hw_features; u64 hw_features;
bool mc_overflow; bool mc_overflow;
...@@ -125,6 +127,7 @@ struct ionic_lif { ...@@ -125,6 +127,7 @@ struct ionic_lif {
unsigned long *dbid_inuse; unsigned long *dbid_inuse;
unsigned int dbid_count; unsigned int dbid_count;
struct dentry *dentry; struct dentry *dentry;
u32 rx_coalesce_usecs;
u32 flags; u32 flags;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment