Commit 8cb03f4e authored by Jonathan Cooper's avatar Jonathan Cooper Committed by David S. Miller

sfc: Encapsulate access to netdev_priv()

Once we separate struct efx_nic memory from net_device memory the
existing usage will have to change.
Apart from the new function efx_netdev_priv() accesses have been
changed using:
  sed -i 's/netdev_priv/efx_netdev_priv/'
Signed-off-by: default avatarJonathan Cooper <jonathan.s.cooper@amd.com>
Co-developed-by: default avatarMartin Habets <habetsm.xilinx@gmail.com>
Signed-off-by: default avatarMartin Habets <habetsm.xilinx@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b3fd0a86
...@@ -3874,7 +3874,7 @@ static int efx_ef10_udp_tnl_set_port(struct net_device *dev, ...@@ -3874,7 +3874,7 @@ static int efx_ef10_udp_tnl_set_port(struct net_device *dev,
unsigned int table, unsigned int entry, unsigned int table, unsigned int entry,
struct udp_tunnel_info *ti) struct udp_tunnel_info *ti)
{ {
struct efx_nic *efx = netdev_priv(dev); struct efx_nic *efx = efx_netdev_priv(dev);
struct efx_ef10_nic_data *nic_data; struct efx_ef10_nic_data *nic_data;
int efx_tunnel_type, rc; int efx_tunnel_type, rc;
...@@ -3934,7 +3934,7 @@ static int efx_ef10_udp_tnl_unset_port(struct net_device *dev, ...@@ -3934,7 +3934,7 @@ static int efx_ef10_udp_tnl_unset_port(struct net_device *dev,
unsigned int table, unsigned int entry, unsigned int table, unsigned int entry,
struct udp_tunnel_info *ti) struct udp_tunnel_info *ti)
{ {
struct efx_nic *efx = netdev_priv(dev); struct efx_nic *efx = efx_netdev_priv(dev);
struct efx_ef10_nic_data *nic_data; struct efx_ef10_nic_data *nic_data;
int rc; int rc;
......
...@@ -464,7 +464,7 @@ static int ef100_pci_probe(struct pci_dev *pci_dev, ...@@ -464,7 +464,7 @@ static int ef100_pci_probe(struct pci_dev *pci_dev,
net_dev = alloc_etherdev_mq(sizeof(*efx), EFX_MAX_CORE_TX_QUEUES); net_dev = alloc_etherdev_mq(sizeof(*efx), EFX_MAX_CORE_TX_QUEUES);
if (!net_dev) if (!net_dev)
return -ENOMEM; return -ENOMEM;
efx = netdev_priv(net_dev); efx = efx_netdev_priv(net_dev);
efx->type = (const struct efx_nic_type *)entry->driver_data; efx->type = (const struct efx_nic_type *)entry->driver_data;
pci_set_drvdata(pci_dev, efx); pci_set_drvdata(pci_dev, efx);
......
...@@ -26,7 +26,7 @@ ef100_ethtool_get_ringparam(struct net_device *net_dev, ...@@ -26,7 +26,7 @@ ef100_ethtool_get_ringparam(struct net_device *net_dev,
struct kernel_ethtool_ringparam *kernel_ring, struct kernel_ethtool_ringparam *kernel_ring,
struct netlink_ext_ack *extack) struct netlink_ext_ack *extack)
{ {
struct efx_nic *efx = netdev_priv(net_dev); struct efx_nic *efx = efx_netdev_priv(net_dev);
ring->rx_max_pending = EFX_EF100_MAX_DMAQ_SIZE; ring->rx_max_pending = EFX_EF100_MAX_DMAQ_SIZE;
ring->tx_max_pending = EFX_EF100_MAX_DMAQ_SIZE; ring->tx_max_pending = EFX_EF100_MAX_DMAQ_SIZE;
......
...@@ -79,7 +79,7 @@ static int ef100_remap_bar(struct efx_nic *efx, int max_vis) ...@@ -79,7 +79,7 @@ static int ef100_remap_bar(struct efx_nic *efx, int max_vis)
*/ */
static int ef100_net_stop(struct net_device *net_dev) static int ef100_net_stop(struct net_device *net_dev)
{ {
struct efx_nic *efx = netdev_priv(net_dev); struct efx_nic *efx = efx_netdev_priv(net_dev);
netif_dbg(efx, ifdown, efx->net_dev, "closing on CPU %d\n", netif_dbg(efx, ifdown, efx->net_dev, "closing on CPU %d\n",
raw_smp_processor_id()); raw_smp_processor_id());
...@@ -104,7 +104,7 @@ static int ef100_net_stop(struct net_device *net_dev) ...@@ -104,7 +104,7 @@ static int ef100_net_stop(struct net_device *net_dev)
/* Context: process, rtnl_lock() held. */ /* Context: process, rtnl_lock() held. */
static int ef100_net_open(struct net_device *net_dev) static int ef100_net_open(struct net_device *net_dev)
{ {
struct efx_nic *efx = netdev_priv(net_dev); struct efx_nic *efx = efx_netdev_priv(net_dev);
unsigned int allocated_vis; unsigned int allocated_vis;
int rc; int rc;
...@@ -193,7 +193,7 @@ static int ef100_net_open(struct net_device *net_dev) ...@@ -193,7 +193,7 @@ static int ef100_net_open(struct net_device *net_dev)
static netdev_tx_t ef100_hard_start_xmit(struct sk_buff *skb, static netdev_tx_t ef100_hard_start_xmit(struct sk_buff *skb,
struct net_device *net_dev) struct net_device *net_dev)
{ {
struct efx_nic *efx = netdev_priv(net_dev); struct efx_nic *efx = efx_netdev_priv(net_dev);
struct efx_tx_queue *tx_queue; struct efx_tx_queue *tx_queue;
struct efx_channel *channel; struct efx_channel *channel;
int rc; int rc;
...@@ -243,7 +243,7 @@ int ef100_netdev_event(struct notifier_block *this, ...@@ -243,7 +243,7 @@ int ef100_netdev_event(struct notifier_block *this,
struct efx_nic *efx = container_of(this, struct efx_nic, netdev_notifier); struct efx_nic *efx = container_of(this, struct efx_nic, netdev_notifier);
struct net_device *net_dev = netdev_notifier_info_to_dev(ptr); struct net_device *net_dev = netdev_notifier_info_to_dev(ptr);
if (netdev_priv(net_dev) == efx && event == NETDEV_CHANGENAME) if (efx_netdev_priv(net_dev) == efx && event == NETDEV_CHANGENAME)
ef100_update_name(efx); ef100_update_name(efx);
return NOTIFY_DONE; return NOTIFY_DONE;
......
...@@ -492,7 +492,7 @@ void efx_get_irq_moderation(struct efx_nic *efx, unsigned int *tx_usecs, ...@@ -492,7 +492,7 @@ void efx_get_irq_moderation(struct efx_nic *efx, unsigned int *tx_usecs,
*/ */
static int efx_ioctl(struct net_device *net_dev, struct ifreq *ifr, int cmd) static int efx_ioctl(struct net_device *net_dev, struct ifreq *ifr, int cmd)
{ {
struct efx_nic *efx = netdev_priv(net_dev); struct efx_nic *efx = efx_netdev_priv(net_dev);
struct mii_ioctl_data *data = if_mii(ifr); struct mii_ioctl_data *data = if_mii(ifr);
if (cmd == SIOCSHWTSTAMP) if (cmd == SIOCSHWTSTAMP)
...@@ -517,7 +517,7 @@ static int efx_ioctl(struct net_device *net_dev, struct ifreq *ifr, int cmd) ...@@ -517,7 +517,7 @@ static int efx_ioctl(struct net_device *net_dev, struct ifreq *ifr, int cmd)
/* Context: process, rtnl_lock() held. */ /* Context: process, rtnl_lock() held. */
int efx_net_open(struct net_device *net_dev) int efx_net_open(struct net_device *net_dev)
{ {
struct efx_nic *efx = netdev_priv(net_dev); struct efx_nic *efx = efx_netdev_priv(net_dev);
int rc; int rc;
netif_dbg(efx, ifup, efx->net_dev, "opening device on CPU %d\n", netif_dbg(efx, ifup, efx->net_dev, "opening device on CPU %d\n",
...@@ -551,7 +551,7 @@ int efx_net_open(struct net_device *net_dev) ...@@ -551,7 +551,7 @@ int efx_net_open(struct net_device *net_dev)
*/ */
int efx_net_stop(struct net_device *net_dev) int efx_net_stop(struct net_device *net_dev)
{ {
struct efx_nic *efx = netdev_priv(net_dev); struct efx_nic *efx = efx_netdev_priv(net_dev);
netif_dbg(efx, ifdown, efx->net_dev, "closing on CPU %d\n", netif_dbg(efx, ifdown, efx->net_dev, "closing on CPU %d\n",
raw_smp_processor_id()); raw_smp_processor_id());
...@@ -564,7 +564,7 @@ int efx_net_stop(struct net_device *net_dev) ...@@ -564,7 +564,7 @@ int efx_net_stop(struct net_device *net_dev)
static int efx_vlan_rx_add_vid(struct net_device *net_dev, __be16 proto, u16 vid) static int efx_vlan_rx_add_vid(struct net_device *net_dev, __be16 proto, u16 vid)
{ {
struct efx_nic *efx = netdev_priv(net_dev); struct efx_nic *efx = efx_netdev_priv(net_dev);
if (efx->type->vlan_rx_add_vid) if (efx->type->vlan_rx_add_vid)
return efx->type->vlan_rx_add_vid(efx, proto, vid); return efx->type->vlan_rx_add_vid(efx, proto, vid);
...@@ -574,7 +574,7 @@ static int efx_vlan_rx_add_vid(struct net_device *net_dev, __be16 proto, u16 vid ...@@ -574,7 +574,7 @@ static int efx_vlan_rx_add_vid(struct net_device *net_dev, __be16 proto, u16 vid
static int efx_vlan_rx_kill_vid(struct net_device *net_dev, __be16 proto, u16 vid) static int efx_vlan_rx_kill_vid(struct net_device *net_dev, __be16 proto, u16 vid)
{ {
struct efx_nic *efx = netdev_priv(net_dev); struct efx_nic *efx = efx_netdev_priv(net_dev);
if (efx->type->vlan_rx_kill_vid) if (efx->type->vlan_rx_kill_vid)
return efx->type->vlan_rx_kill_vid(efx, proto, vid); return efx->type->vlan_rx_kill_vid(efx, proto, vid);
...@@ -643,7 +643,7 @@ static int efx_xdp_setup_prog(struct efx_nic *efx, struct bpf_prog *prog) ...@@ -643,7 +643,7 @@ static int efx_xdp_setup_prog(struct efx_nic *efx, struct bpf_prog *prog)
/* Context: process, rtnl_lock() held. */ /* Context: process, rtnl_lock() held. */
static int efx_xdp(struct net_device *dev, struct netdev_bpf *xdp) static int efx_xdp(struct net_device *dev, struct netdev_bpf *xdp)
{ {
struct efx_nic *efx = netdev_priv(dev); struct efx_nic *efx = efx_netdev_priv(dev);
switch (xdp->command) { switch (xdp->command) {
case XDP_SETUP_PROG: case XDP_SETUP_PROG:
...@@ -656,7 +656,7 @@ static int efx_xdp(struct net_device *dev, struct netdev_bpf *xdp) ...@@ -656,7 +656,7 @@ static int efx_xdp(struct net_device *dev, struct netdev_bpf *xdp)
static int efx_xdp_xmit(struct net_device *dev, int n, struct xdp_frame **xdpfs, static int efx_xdp_xmit(struct net_device *dev, int n, struct xdp_frame **xdpfs,
u32 flags) u32 flags)
{ {
struct efx_nic *efx = netdev_priv(dev); struct efx_nic *efx = efx_netdev_priv(dev);
if (!netif_running(dev)) if (!netif_running(dev))
return -EINVAL; return -EINVAL;
...@@ -678,7 +678,7 @@ static int efx_netdev_event(struct notifier_block *this, ...@@ -678,7 +678,7 @@ static int efx_netdev_event(struct notifier_block *this,
if ((net_dev->netdev_ops == &efx_netdev_ops) && if ((net_dev->netdev_ops == &efx_netdev_ops) &&
event == NETDEV_CHANGENAME) event == NETDEV_CHANGENAME)
efx_update_name(netdev_priv(net_dev)); efx_update_name(efx_netdev_priv(net_dev));
return NOTIFY_DONE; return NOTIFY_DONE;
} }
...@@ -774,7 +774,7 @@ static void efx_unregister_netdev(struct efx_nic *efx) ...@@ -774,7 +774,7 @@ static void efx_unregister_netdev(struct efx_nic *efx)
if (!efx->net_dev) if (!efx->net_dev)
return; return;
if (WARN_ON(netdev_priv(efx->net_dev) != efx)) if (WARN_ON(efx_netdev_priv(efx->net_dev) != efx))
return; return;
if (efx_dev_registered(efx)) { if (efx_dev_registered(efx)) {
...@@ -1051,7 +1051,7 @@ static int efx_pci_probe(struct pci_dev *pci_dev, ...@@ -1051,7 +1051,7 @@ static int efx_pci_probe(struct pci_dev *pci_dev,
EFX_MAX_RX_QUEUES); EFX_MAX_RX_QUEUES);
if (!net_dev) if (!net_dev)
return -ENOMEM; return -ENOMEM;
efx = netdev_priv(net_dev); efx = efx_netdev_priv(net_dev);
efx->type = (const struct efx_nic_type *) entry->driver_data; efx->type = (const struct efx_nic_type *) entry->driver_data;
efx->fixed_features |= NETIF_F_HIGHDMA; efx->fixed_features |= NETIF_F_HIGHDMA;
......
...@@ -167,7 +167,7 @@ static void efx_mac_work(struct work_struct *data) ...@@ -167,7 +167,7 @@ static void efx_mac_work(struct work_struct *data)
int efx_set_mac_address(struct net_device *net_dev, void *data) int efx_set_mac_address(struct net_device *net_dev, void *data)
{ {
struct efx_nic *efx = netdev_priv(net_dev); struct efx_nic *efx = efx_netdev_priv(net_dev);
struct sockaddr *addr = data; struct sockaddr *addr = data;
u8 *new_addr = addr->sa_data; u8 *new_addr = addr->sa_data;
u8 old_addr[6]; u8 old_addr[6];
...@@ -202,7 +202,7 @@ int efx_set_mac_address(struct net_device *net_dev, void *data) ...@@ -202,7 +202,7 @@ int efx_set_mac_address(struct net_device *net_dev, void *data)
/* Context: netif_addr_lock held, BHs disabled. */ /* Context: netif_addr_lock held, BHs disabled. */
void efx_set_rx_mode(struct net_device *net_dev) void efx_set_rx_mode(struct net_device *net_dev)
{ {
struct efx_nic *efx = netdev_priv(net_dev); struct efx_nic *efx = efx_netdev_priv(net_dev);
if (efx->port_enabled) if (efx->port_enabled)
queue_work(efx->workqueue, &efx->mac_work); queue_work(efx->workqueue, &efx->mac_work);
...@@ -211,7 +211,7 @@ void efx_set_rx_mode(struct net_device *net_dev) ...@@ -211,7 +211,7 @@ void efx_set_rx_mode(struct net_device *net_dev)
int efx_set_features(struct net_device *net_dev, netdev_features_t data) int efx_set_features(struct net_device *net_dev, netdev_features_t data)
{ {
struct efx_nic *efx = netdev_priv(net_dev); struct efx_nic *efx = efx_netdev_priv(net_dev);
int rc; int rc;
/* If disabling RX n-tuple filtering, clear existing filters */ /* If disabling RX n-tuple filtering, clear existing filters */
...@@ -285,7 +285,7 @@ unsigned int efx_xdp_max_mtu(struct efx_nic *efx) ...@@ -285,7 +285,7 @@ unsigned int efx_xdp_max_mtu(struct efx_nic *efx)
/* Context: process, rtnl_lock() held. */ /* Context: process, rtnl_lock() held. */
int efx_change_mtu(struct net_device *net_dev, int new_mtu) int efx_change_mtu(struct net_device *net_dev, int new_mtu)
{ {
struct efx_nic *efx = netdev_priv(net_dev); struct efx_nic *efx = efx_netdev_priv(net_dev);
int rc; int rc;
rc = efx_check_disabled(efx); rc = efx_check_disabled(efx);
...@@ -600,7 +600,7 @@ void efx_stop_all(struct efx_nic *efx) ...@@ -600,7 +600,7 @@ void efx_stop_all(struct efx_nic *efx)
/* Context: process, dev_base_lock or RTNL held, non-blocking. */ /* Context: process, dev_base_lock or RTNL held, non-blocking. */
void efx_net_stats(struct net_device *net_dev, struct rtnl_link_stats64 *stats) void efx_net_stats(struct net_device *net_dev, struct rtnl_link_stats64 *stats)
{ {
struct efx_nic *efx = netdev_priv(net_dev); struct efx_nic *efx = efx_netdev_priv(net_dev);
spin_lock_bh(&efx->stats_lock); spin_lock_bh(&efx->stats_lock);
efx_nic_update_stats_atomic(efx, NULL, stats); efx_nic_update_stats_atomic(efx, NULL, stats);
...@@ -723,7 +723,7 @@ void efx_reset_down(struct efx_nic *efx, enum reset_type method) ...@@ -723,7 +723,7 @@ void efx_reset_down(struct efx_nic *efx, enum reset_type method)
/* Context: netif_tx_lock held, BHs disabled. */ /* Context: netif_tx_lock held, BHs disabled. */
void efx_watchdog(struct net_device *net_dev, unsigned int txqueue) void efx_watchdog(struct net_device *net_dev, unsigned int txqueue)
{ {
struct efx_nic *efx = netdev_priv(net_dev); struct efx_nic *efx = efx_netdev_priv(net_dev);
netif_err(efx, tx_err, efx->net_dev, netif_err(efx, tx_err, efx->net_dev,
"TX stuck with port_enabled=%d: resetting channels\n", "TX stuck with port_enabled=%d: resetting channels\n",
...@@ -1356,7 +1356,7 @@ static bool efx_can_encap_offloads(struct efx_nic *efx, struct sk_buff *skb) ...@@ -1356,7 +1356,7 @@ static bool efx_can_encap_offloads(struct efx_nic *efx, struct sk_buff *skb)
netdev_features_t efx_features_check(struct sk_buff *skb, struct net_device *dev, netdev_features_t efx_features_check(struct sk_buff *skb, struct net_device *dev,
netdev_features_t features) netdev_features_t features)
{ {
struct efx_nic *efx = netdev_priv(dev); struct efx_nic *efx = efx_netdev_priv(dev);
if (skb->encapsulation) { if (skb->encapsulation) {
if (features & NETIF_F_GSO_MASK) if (features & NETIF_F_GSO_MASK)
...@@ -1377,7 +1377,7 @@ netdev_features_t efx_features_check(struct sk_buff *skb, struct net_device *dev ...@@ -1377,7 +1377,7 @@ netdev_features_t efx_features_check(struct sk_buff *skb, struct net_device *dev
int efx_get_phys_port_id(struct net_device *net_dev, int efx_get_phys_port_id(struct net_device *net_dev,
struct netdev_phys_item_id *ppid) struct netdev_phys_item_id *ppid)
{ {
struct efx_nic *efx = netdev_priv(net_dev); struct efx_nic *efx = efx_netdev_priv(net_dev);
if (efx->type->get_phys_port_id) if (efx->type->get_phys_port_id)
return efx->type->get_phys_port_id(efx, ppid); return efx->type->get_phys_port_id(efx, ppid);
...@@ -1387,7 +1387,7 @@ int efx_get_phys_port_id(struct net_device *net_dev, ...@@ -1387,7 +1387,7 @@ int efx_get_phys_port_id(struct net_device *net_dev,
int efx_get_phys_port_name(struct net_device *net_dev, char *name, size_t len) int efx_get_phys_port_name(struct net_device *net_dev, char *name, size_t len)
{ {
struct efx_nic *efx = netdev_priv(net_dev); struct efx_nic *efx = efx_netdev_priv(net_dev);
if (snprintf(name, len, "p%u", efx->port_num) >= len) if (snprintf(name, len, "p%u", efx->port_num) >= len)
return -EINVAL; return -EINVAL;
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
static int efx_ethtool_phys_id(struct net_device *net_dev, static int efx_ethtool_phys_id(struct net_device *net_dev,
enum ethtool_phys_id_state state) enum ethtool_phys_id_state state)
{ {
struct efx_nic *efx = netdev_priv(net_dev); struct efx_nic *efx = efx_netdev_priv(net_dev);
enum efx_led_mode mode = EFX_LED_DEFAULT; enum efx_led_mode mode = EFX_LED_DEFAULT;
switch (state) { switch (state) {
...@@ -55,13 +55,13 @@ static int efx_ethtool_phys_id(struct net_device *net_dev, ...@@ -55,13 +55,13 @@ static int efx_ethtool_phys_id(struct net_device *net_dev,
static int efx_ethtool_get_regs_len(struct net_device *net_dev) static int efx_ethtool_get_regs_len(struct net_device *net_dev)
{ {
return efx_nic_get_regs_len(netdev_priv(net_dev)); return efx_nic_get_regs_len(efx_netdev_priv(net_dev));
} }
static void efx_ethtool_get_regs(struct net_device *net_dev, static void efx_ethtool_get_regs(struct net_device *net_dev,
struct ethtool_regs *regs, void *buf) struct ethtool_regs *regs, void *buf)
{ {
struct efx_nic *efx = netdev_priv(net_dev); struct efx_nic *efx = efx_netdev_priv(net_dev);
regs->version = efx->type->revision; regs->version = efx->type->revision;
efx_nic_get_regs(efx, buf); efx_nic_get_regs(efx, buf);
...@@ -101,7 +101,7 @@ static int efx_ethtool_get_coalesce(struct net_device *net_dev, ...@@ -101,7 +101,7 @@ static int efx_ethtool_get_coalesce(struct net_device *net_dev,
struct kernel_ethtool_coalesce *kernel_coal, struct kernel_ethtool_coalesce *kernel_coal,
struct netlink_ext_ack *extack) struct netlink_ext_ack *extack)
{ {
struct efx_nic *efx = netdev_priv(net_dev); struct efx_nic *efx = efx_netdev_priv(net_dev);
unsigned int tx_usecs, rx_usecs; unsigned int tx_usecs, rx_usecs;
bool rx_adaptive; bool rx_adaptive;
...@@ -121,7 +121,7 @@ static int efx_ethtool_set_coalesce(struct net_device *net_dev, ...@@ -121,7 +121,7 @@ static int efx_ethtool_set_coalesce(struct net_device *net_dev,
struct kernel_ethtool_coalesce *kernel_coal, struct kernel_ethtool_coalesce *kernel_coal,
struct netlink_ext_ack *extack) struct netlink_ext_ack *extack)
{ {
struct efx_nic *efx = netdev_priv(net_dev); struct efx_nic *efx = efx_netdev_priv(net_dev);
struct efx_channel *channel; struct efx_channel *channel;
unsigned int tx_usecs, rx_usecs; unsigned int tx_usecs, rx_usecs;
bool adaptive, rx_may_override_tx; bool adaptive, rx_may_override_tx;
...@@ -163,7 +163,7 @@ efx_ethtool_get_ringparam(struct net_device *net_dev, ...@@ -163,7 +163,7 @@ efx_ethtool_get_ringparam(struct net_device *net_dev,
struct kernel_ethtool_ringparam *kernel_ring, struct kernel_ethtool_ringparam *kernel_ring,
struct netlink_ext_ack *extack) struct netlink_ext_ack *extack)
{ {
struct efx_nic *efx = netdev_priv(net_dev); struct efx_nic *efx = efx_netdev_priv(net_dev);
ring->rx_max_pending = EFX_MAX_DMAQ_SIZE; ring->rx_max_pending = EFX_MAX_DMAQ_SIZE;
ring->tx_max_pending = EFX_TXQ_MAX_ENT(efx); ring->tx_max_pending = EFX_TXQ_MAX_ENT(efx);
...@@ -177,7 +177,7 @@ efx_ethtool_set_ringparam(struct net_device *net_dev, ...@@ -177,7 +177,7 @@ efx_ethtool_set_ringparam(struct net_device *net_dev,
struct kernel_ethtool_ringparam *kernel_ring, struct kernel_ethtool_ringparam *kernel_ring,
struct netlink_ext_ack *extack) struct netlink_ext_ack *extack)
{ {
struct efx_nic *efx = netdev_priv(net_dev); struct efx_nic *efx = efx_netdev_priv(net_dev);
u32 txq_entries; u32 txq_entries;
if (ring->rx_mini_pending || ring->rx_jumbo_pending || if (ring->rx_mini_pending || ring->rx_jumbo_pending ||
...@@ -204,7 +204,7 @@ efx_ethtool_set_ringparam(struct net_device *net_dev, ...@@ -204,7 +204,7 @@ efx_ethtool_set_ringparam(struct net_device *net_dev,
static void efx_ethtool_get_wol(struct net_device *net_dev, static void efx_ethtool_get_wol(struct net_device *net_dev,
struct ethtool_wolinfo *wol) struct ethtool_wolinfo *wol)
{ {
struct efx_nic *efx = netdev_priv(net_dev); struct efx_nic *efx = efx_netdev_priv(net_dev);
return efx->type->get_wol(efx, wol); return efx->type->get_wol(efx, wol);
} }
...@@ -212,14 +212,14 @@ static void efx_ethtool_get_wol(struct net_device *net_dev, ...@@ -212,14 +212,14 @@ static void efx_ethtool_get_wol(struct net_device *net_dev,
static int efx_ethtool_set_wol(struct net_device *net_dev, static int efx_ethtool_set_wol(struct net_device *net_dev,
struct ethtool_wolinfo *wol) struct ethtool_wolinfo *wol)
{ {
struct efx_nic *efx = netdev_priv(net_dev); struct efx_nic *efx = efx_netdev_priv(net_dev);
return efx->type->set_wol(efx, wol->wolopts); return efx->type->set_wol(efx, wol->wolopts);
} }
static void efx_ethtool_get_fec_stats(struct net_device *net_dev, static void efx_ethtool_get_fec_stats(struct net_device *net_dev,
struct ethtool_fec_stats *fec_stats) struct ethtool_fec_stats *fec_stats)
{ {
struct efx_nic *efx = netdev_priv(net_dev); struct efx_nic *efx = efx_netdev_priv(net_dev);
if (efx->type->get_fec_stats) if (efx->type->get_fec_stats)
efx->type->get_fec_stats(efx, fec_stats); efx->type->get_fec_stats(efx, fec_stats);
...@@ -228,7 +228,7 @@ static void efx_ethtool_get_fec_stats(struct net_device *net_dev, ...@@ -228,7 +228,7 @@ static void efx_ethtool_get_fec_stats(struct net_device *net_dev,
static int efx_ethtool_get_ts_info(struct net_device *net_dev, static int efx_ethtool_get_ts_info(struct net_device *net_dev,
struct ethtool_ts_info *ts_info) struct ethtool_ts_info *ts_info)
{ {
struct efx_nic *efx = netdev_priv(net_dev); struct efx_nic *efx = efx_netdev_priv(net_dev);
/* Software capabilities */ /* Software capabilities */
ts_info->so_timestamping = (SOF_TIMESTAMPING_RX_SOFTWARE | ts_info->so_timestamping = (SOF_TIMESTAMPING_RX_SOFTWARE |
......
...@@ -103,7 +103,7 @@ static const struct efx_sw_stat_desc efx_sw_stat_desc[] = { ...@@ -103,7 +103,7 @@ static const struct efx_sw_stat_desc efx_sw_stat_desc[] = {
void efx_ethtool_get_drvinfo(struct net_device *net_dev, void efx_ethtool_get_drvinfo(struct net_device *net_dev,
struct ethtool_drvinfo *info) struct ethtool_drvinfo *info)
{ {
struct efx_nic *efx = netdev_priv(net_dev); struct efx_nic *efx = efx_netdev_priv(net_dev);
strlcpy(info->driver, KBUILD_MODNAME, sizeof(info->driver)); strlcpy(info->driver, KBUILD_MODNAME, sizeof(info->driver));
efx_mcdi_print_fwver(efx, info->fw_version, efx_mcdi_print_fwver(efx, info->fw_version,
...@@ -113,14 +113,14 @@ void efx_ethtool_get_drvinfo(struct net_device *net_dev, ...@@ -113,14 +113,14 @@ void efx_ethtool_get_drvinfo(struct net_device *net_dev,
u32 efx_ethtool_get_msglevel(struct net_device *net_dev) u32 efx_ethtool_get_msglevel(struct net_device *net_dev)
{ {
struct efx_nic *efx = netdev_priv(net_dev); struct efx_nic *efx = efx_netdev_priv(net_dev);
return efx->msg_enable; return efx->msg_enable;
} }
void efx_ethtool_set_msglevel(struct net_device *net_dev, u32 msg_enable) void efx_ethtool_set_msglevel(struct net_device *net_dev, u32 msg_enable)
{ {
struct efx_nic *efx = netdev_priv(net_dev); struct efx_nic *efx = efx_netdev_priv(net_dev);
efx->msg_enable = msg_enable; efx->msg_enable = msg_enable;
} }
...@@ -128,7 +128,7 @@ void efx_ethtool_set_msglevel(struct net_device *net_dev, u32 msg_enable) ...@@ -128,7 +128,7 @@ void efx_ethtool_set_msglevel(struct net_device *net_dev, u32 msg_enable)
void efx_ethtool_self_test(struct net_device *net_dev, void efx_ethtool_self_test(struct net_device *net_dev,
struct ethtool_test *test, u64 *data) struct ethtool_test *test, u64 *data)
{ {
struct efx_nic *efx = netdev_priv(net_dev); struct efx_nic *efx = efx_netdev_priv(net_dev);
struct efx_self_tests *efx_tests; struct efx_self_tests *efx_tests;
bool already_up; bool already_up;
int rc = -ENOMEM; int rc = -ENOMEM;
...@@ -176,7 +176,7 @@ void efx_ethtool_self_test(struct net_device *net_dev, ...@@ -176,7 +176,7 @@ void efx_ethtool_self_test(struct net_device *net_dev,
void efx_ethtool_get_pauseparam(struct net_device *net_dev, void efx_ethtool_get_pauseparam(struct net_device *net_dev,
struct ethtool_pauseparam *pause) struct ethtool_pauseparam *pause)
{ {
struct efx_nic *efx = netdev_priv(net_dev); struct efx_nic *efx = efx_netdev_priv(net_dev);
pause->rx_pause = !!(efx->wanted_fc & EFX_FC_RX); pause->rx_pause = !!(efx->wanted_fc & EFX_FC_RX);
pause->tx_pause = !!(efx->wanted_fc & EFX_FC_TX); pause->tx_pause = !!(efx->wanted_fc & EFX_FC_TX);
...@@ -186,7 +186,7 @@ void efx_ethtool_get_pauseparam(struct net_device *net_dev, ...@@ -186,7 +186,7 @@ void efx_ethtool_get_pauseparam(struct net_device *net_dev,
int efx_ethtool_set_pauseparam(struct net_device *net_dev, int efx_ethtool_set_pauseparam(struct net_device *net_dev,
struct ethtool_pauseparam *pause) struct ethtool_pauseparam *pause)
{ {
struct efx_nic *efx = netdev_priv(net_dev); struct efx_nic *efx = efx_netdev_priv(net_dev);
u8 wanted_fc, old_fc; u8 wanted_fc, old_fc;
u32 old_adv; u32 old_adv;
int rc = 0; int rc = 0;
...@@ -441,7 +441,7 @@ static size_t efx_describe_per_queue_stats(struct efx_nic *efx, u8 *strings) ...@@ -441,7 +441,7 @@ static size_t efx_describe_per_queue_stats(struct efx_nic *efx, u8 *strings)
int efx_ethtool_get_sset_count(struct net_device *net_dev, int string_set) int efx_ethtool_get_sset_count(struct net_device *net_dev, int string_set)
{ {
struct efx_nic *efx = netdev_priv(net_dev); struct efx_nic *efx = efx_netdev_priv(net_dev);
switch (string_set) { switch (string_set) {
case ETH_SS_STATS: case ETH_SS_STATS:
...@@ -459,7 +459,7 @@ int efx_ethtool_get_sset_count(struct net_device *net_dev, int string_set) ...@@ -459,7 +459,7 @@ int efx_ethtool_get_sset_count(struct net_device *net_dev, int string_set)
void efx_ethtool_get_strings(struct net_device *net_dev, void efx_ethtool_get_strings(struct net_device *net_dev,
u32 string_set, u8 *strings) u32 string_set, u8 *strings)
{ {
struct efx_nic *efx = netdev_priv(net_dev); struct efx_nic *efx = efx_netdev_priv(net_dev);
int i; int i;
switch (string_set) { switch (string_set) {
...@@ -487,7 +487,7 @@ void efx_ethtool_get_stats(struct net_device *net_dev, ...@@ -487,7 +487,7 @@ void efx_ethtool_get_stats(struct net_device *net_dev,
struct ethtool_stats *stats, struct ethtool_stats *stats,
u64 *data) u64 *data)
{ {
struct efx_nic *efx = netdev_priv(net_dev); struct efx_nic *efx = efx_netdev_priv(net_dev);
const struct efx_sw_stat_desc *stat; const struct efx_sw_stat_desc *stat;
struct efx_channel *channel; struct efx_channel *channel;
struct efx_tx_queue *tx_queue; struct efx_tx_queue *tx_queue;
...@@ -561,7 +561,7 @@ void efx_ethtool_get_stats(struct net_device *net_dev, ...@@ -561,7 +561,7 @@ void efx_ethtool_get_stats(struct net_device *net_dev,
int efx_ethtool_get_link_ksettings(struct net_device *net_dev, int efx_ethtool_get_link_ksettings(struct net_device *net_dev,
struct ethtool_link_ksettings *cmd) struct ethtool_link_ksettings *cmd)
{ {
struct efx_nic *efx = netdev_priv(net_dev); struct efx_nic *efx = efx_netdev_priv(net_dev);
struct efx_link_state *link_state = &efx->link_state; struct efx_link_state *link_state = &efx->link_state;
mutex_lock(&efx->mac_lock); mutex_lock(&efx->mac_lock);
...@@ -584,7 +584,7 @@ int efx_ethtool_get_link_ksettings(struct net_device *net_dev, ...@@ -584,7 +584,7 @@ int efx_ethtool_get_link_ksettings(struct net_device *net_dev,
int efx_ethtool_set_link_ksettings(struct net_device *net_dev, int efx_ethtool_set_link_ksettings(struct net_device *net_dev,
const struct ethtool_link_ksettings *cmd) const struct ethtool_link_ksettings *cmd)
{ {
struct efx_nic *efx = netdev_priv(net_dev); struct efx_nic *efx = efx_netdev_priv(net_dev);
int rc; int rc;
/* GMAC does not support 1000Mbps HD */ /* GMAC does not support 1000Mbps HD */
...@@ -604,7 +604,7 @@ int efx_ethtool_set_link_ksettings(struct net_device *net_dev, ...@@ -604,7 +604,7 @@ int efx_ethtool_set_link_ksettings(struct net_device *net_dev,
int efx_ethtool_get_fecparam(struct net_device *net_dev, int efx_ethtool_get_fecparam(struct net_device *net_dev,
struct ethtool_fecparam *fecparam) struct ethtool_fecparam *fecparam)
{ {
struct efx_nic *efx = netdev_priv(net_dev); struct efx_nic *efx = efx_netdev_priv(net_dev);
int rc; int rc;
mutex_lock(&efx->mac_lock); mutex_lock(&efx->mac_lock);
...@@ -617,7 +617,7 @@ int efx_ethtool_get_fecparam(struct net_device *net_dev, ...@@ -617,7 +617,7 @@ int efx_ethtool_get_fecparam(struct net_device *net_dev,
int efx_ethtool_set_fecparam(struct net_device *net_dev, int efx_ethtool_set_fecparam(struct net_device *net_dev,
struct ethtool_fecparam *fecparam) struct ethtool_fecparam *fecparam)
{ {
struct efx_nic *efx = netdev_priv(net_dev); struct efx_nic *efx = efx_netdev_priv(net_dev);
int rc; int rc;
mutex_lock(&efx->mac_lock); mutex_lock(&efx->mac_lock);
...@@ -809,7 +809,7 @@ static int efx_ethtool_get_class_rule(struct efx_nic *efx, ...@@ -809,7 +809,7 @@ static int efx_ethtool_get_class_rule(struct efx_nic *efx,
int efx_ethtool_get_rxnfc(struct net_device *net_dev, int efx_ethtool_get_rxnfc(struct net_device *net_dev,
struct ethtool_rxnfc *info, u32 *rule_locs) struct ethtool_rxnfc *info, u32 *rule_locs)
{ {
struct efx_nic *efx = netdev_priv(net_dev); struct efx_nic *efx = efx_netdev_priv(net_dev);
u32 rss_context = 0; u32 rss_context = 0;
s32 rc = 0; s32 rc = 0;
...@@ -1127,7 +1127,7 @@ static int efx_ethtool_set_class_rule(struct efx_nic *efx, ...@@ -1127,7 +1127,7 @@ static int efx_ethtool_set_class_rule(struct efx_nic *efx,
int efx_ethtool_set_rxnfc(struct net_device *net_dev, int efx_ethtool_set_rxnfc(struct net_device *net_dev,
struct ethtool_rxnfc *info) struct ethtool_rxnfc *info)
{ {
struct efx_nic *efx = netdev_priv(net_dev); struct efx_nic *efx = efx_netdev_priv(net_dev);
if (efx_filter_get_rx_id_limit(efx) == 0) if (efx_filter_get_rx_id_limit(efx) == 0)
return -EOPNOTSUPP; return -EOPNOTSUPP;
...@@ -1148,7 +1148,7 @@ int efx_ethtool_set_rxnfc(struct net_device *net_dev, ...@@ -1148,7 +1148,7 @@ int efx_ethtool_set_rxnfc(struct net_device *net_dev,
u32 efx_ethtool_get_rxfh_indir_size(struct net_device *net_dev) u32 efx_ethtool_get_rxfh_indir_size(struct net_device *net_dev)
{ {
struct efx_nic *efx = netdev_priv(net_dev); struct efx_nic *efx = efx_netdev_priv(net_dev);
if (efx->n_rx_channels == 1) if (efx->n_rx_channels == 1)
return 0; return 0;
...@@ -1157,7 +1157,7 @@ u32 efx_ethtool_get_rxfh_indir_size(struct net_device *net_dev) ...@@ -1157,7 +1157,7 @@ u32 efx_ethtool_get_rxfh_indir_size(struct net_device *net_dev)
u32 efx_ethtool_get_rxfh_key_size(struct net_device *net_dev) u32 efx_ethtool_get_rxfh_key_size(struct net_device *net_dev)
{ {
struct efx_nic *efx = netdev_priv(net_dev); struct efx_nic *efx = efx_netdev_priv(net_dev);
return efx->type->rx_hash_key_size; return efx->type->rx_hash_key_size;
} }
...@@ -1165,7 +1165,7 @@ u32 efx_ethtool_get_rxfh_key_size(struct net_device *net_dev) ...@@ -1165,7 +1165,7 @@ u32 efx_ethtool_get_rxfh_key_size(struct net_device *net_dev)
int efx_ethtool_get_rxfh(struct net_device *net_dev, u32 *indir, u8 *key, int efx_ethtool_get_rxfh(struct net_device *net_dev, u32 *indir, u8 *key,
u8 *hfunc) u8 *hfunc)
{ {
struct efx_nic *efx = netdev_priv(net_dev); struct efx_nic *efx = efx_netdev_priv(net_dev);
int rc; int rc;
rc = efx->type->rx_pull_rss_config(efx); rc = efx->type->rx_pull_rss_config(efx);
...@@ -1186,7 +1186,7 @@ int efx_ethtool_get_rxfh(struct net_device *net_dev, u32 *indir, u8 *key, ...@@ -1186,7 +1186,7 @@ int efx_ethtool_get_rxfh(struct net_device *net_dev, u32 *indir, u8 *key,
int efx_ethtool_set_rxfh(struct net_device *net_dev, const u32 *indir, int efx_ethtool_set_rxfh(struct net_device *net_dev, const u32 *indir,
const u8 *key, const u8 hfunc) const u8 *key, const u8 hfunc)
{ {
struct efx_nic *efx = netdev_priv(net_dev); struct efx_nic *efx = efx_netdev_priv(net_dev);
/* Hash function is Toeplitz, cannot be changed */ /* Hash function is Toeplitz, cannot be changed */
if (hfunc != ETH_RSS_HASH_NO_CHANGE && hfunc != ETH_RSS_HASH_TOP) if (hfunc != ETH_RSS_HASH_NO_CHANGE && hfunc != ETH_RSS_HASH_TOP)
...@@ -1205,7 +1205,7 @@ int efx_ethtool_set_rxfh(struct net_device *net_dev, const u32 *indir, ...@@ -1205,7 +1205,7 @@ int efx_ethtool_set_rxfh(struct net_device *net_dev, const u32 *indir,
int efx_ethtool_get_rxfh_context(struct net_device *net_dev, u32 *indir, int efx_ethtool_get_rxfh_context(struct net_device *net_dev, u32 *indir,
u8 *key, u8 *hfunc, u32 rss_context) u8 *key, u8 *hfunc, u32 rss_context)
{ {
struct efx_nic *efx = netdev_priv(net_dev); struct efx_nic *efx = efx_netdev_priv(net_dev);
struct efx_rss_context *ctx; struct efx_rss_context *ctx;
int rc = 0; int rc = 0;
...@@ -1238,7 +1238,7 @@ int efx_ethtool_set_rxfh_context(struct net_device *net_dev, ...@@ -1238,7 +1238,7 @@ int efx_ethtool_set_rxfh_context(struct net_device *net_dev,
const u8 hfunc, u32 *rss_context, const u8 hfunc, u32 *rss_context,
bool delete) bool delete)
{ {
struct efx_nic *efx = netdev_priv(net_dev); struct efx_nic *efx = efx_netdev_priv(net_dev);
struct efx_rss_context *ctx; struct efx_rss_context *ctx;
bool allocated = false; bool allocated = false;
int rc; int rc;
...@@ -1300,7 +1300,7 @@ int efx_ethtool_set_rxfh_context(struct net_device *net_dev, ...@@ -1300,7 +1300,7 @@ int efx_ethtool_set_rxfh_context(struct net_device *net_dev,
int efx_ethtool_reset(struct net_device *net_dev, u32 *flags) int efx_ethtool_reset(struct net_device *net_dev, u32 *flags)
{ {
struct efx_nic *efx = netdev_priv(net_dev); struct efx_nic *efx = efx_netdev_priv(net_dev);
int rc; int rc;
rc = efx->type->map_reset_flags(flags); rc = efx->type->map_reset_flags(flags);
...@@ -1314,7 +1314,7 @@ int efx_ethtool_get_module_eeprom(struct net_device *net_dev, ...@@ -1314,7 +1314,7 @@ int efx_ethtool_get_module_eeprom(struct net_device *net_dev,
struct ethtool_eeprom *ee, struct ethtool_eeprom *ee,
u8 *data) u8 *data)
{ {
struct efx_nic *efx = netdev_priv(net_dev); struct efx_nic *efx = efx_netdev_priv(net_dev);
int ret; int ret;
mutex_lock(&efx->mac_lock); mutex_lock(&efx->mac_lock);
...@@ -1327,7 +1327,7 @@ int efx_ethtool_get_module_eeprom(struct net_device *net_dev, ...@@ -1327,7 +1327,7 @@ int efx_ethtool_get_module_eeprom(struct net_device *net_dev,
int efx_ethtool_get_module_info(struct net_device *net_dev, int efx_ethtool_get_module_info(struct net_device *net_dev,
struct ethtool_modinfo *modinfo) struct ethtool_modinfo *modinfo)
{ {
struct efx_nic *efx = netdev_priv(net_dev); struct efx_nic *efx = efx_netdev_priv(net_dev);
int ret; int ret;
mutex_lock(&efx->mac_lock); mutex_lock(&efx->mac_lock);
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
static int efx_mcdi_mdio_read(struct net_device *net_dev, static int efx_mcdi_mdio_read(struct net_device *net_dev,
int prtad, int devad, u16 addr) int prtad, int devad, u16 addr)
{ {
struct efx_nic *efx = netdev_priv(net_dev); struct efx_nic *efx = efx_netdev_priv(net_dev);
MCDI_DECLARE_BUF(inbuf, MC_CMD_MDIO_READ_IN_LEN); MCDI_DECLARE_BUF(inbuf, MC_CMD_MDIO_READ_IN_LEN);
MCDI_DECLARE_BUF(outbuf, MC_CMD_MDIO_READ_OUT_LEN); MCDI_DECLARE_BUF(outbuf, MC_CMD_MDIO_READ_OUT_LEN);
size_t outlen; size_t outlen;
...@@ -46,7 +46,7 @@ static int efx_mcdi_mdio_read(struct net_device *net_dev, ...@@ -46,7 +46,7 @@ static int efx_mcdi_mdio_read(struct net_device *net_dev,
static int efx_mcdi_mdio_write(struct net_device *net_dev, static int efx_mcdi_mdio_write(struct net_device *net_dev,
int prtad, int devad, u16 addr, u16 value) int prtad, int devad, u16 addr, u16 value)
{ {
struct efx_nic *efx = netdev_priv(net_dev); struct efx_nic *efx = efx_netdev_priv(net_dev);
MCDI_DECLARE_BUF(inbuf, MC_CMD_MDIO_WRITE_IN_LEN); MCDI_DECLARE_BUF(inbuf, MC_CMD_MDIO_WRITE_IN_LEN);
MCDI_DECLARE_BUF(outbuf, MC_CMD_MDIO_WRITE_OUT_LEN); MCDI_DECLARE_BUF(outbuf, MC_CMD_MDIO_WRITE_OUT_LEN);
size_t outlen; size_t outlen;
......
...@@ -1166,6 +1166,11 @@ struct efx_nic { ...@@ -1166,6 +1166,11 @@ struct efx_nic {
atomic_t n_rx_noskb_drops; atomic_t n_rx_noskb_drops;
}; };
static inline struct efx_nic *efx_netdev_priv(struct net_device *dev)
{
return netdev_priv(dev);
}
static inline int efx_dev_registered(struct efx_nic *efx) static inline int efx_dev_registered(struct efx_nic *efx)
{ {
return efx->net_dev->reg_state == NETREG_REGISTERED; return efx->net_dev->reg_state == NETREG_REGISTERED;
......
...@@ -857,7 +857,7 @@ static void efx_filter_rfs_work(struct work_struct *data) ...@@ -857,7 +857,7 @@ static void efx_filter_rfs_work(struct work_struct *data)
{ {
struct efx_async_filter_insertion *req = container_of(data, struct efx_async_filter_insertion, struct efx_async_filter_insertion *req = container_of(data, struct efx_async_filter_insertion,
work); work);
struct efx_nic *efx = netdev_priv(req->net_dev); struct efx_nic *efx = efx_netdev_priv(req->net_dev);
struct efx_channel *channel = efx_get_channel(efx, req->rxq_index); struct efx_channel *channel = efx_get_channel(efx, req->rxq_index);
int slot_idx = req - efx->rps_slot; int slot_idx = req - efx->rps_slot;
struct efx_arfs_rule *rule; struct efx_arfs_rule *rule;
...@@ -942,7 +942,7 @@ static void efx_filter_rfs_work(struct work_struct *data) ...@@ -942,7 +942,7 @@ static void efx_filter_rfs_work(struct work_struct *data)
int efx_filter_rfs(struct net_device *net_dev, const struct sk_buff *skb, int efx_filter_rfs(struct net_device *net_dev, const struct sk_buff *skb,
u16 rxq_index, u32 flow_id) u16 rxq_index, u32 flow_id)
{ {
struct efx_nic *efx = netdev_priv(net_dev); struct efx_nic *efx = efx_netdev_priv(net_dev);
struct efx_async_filter_insertion *req; struct efx_async_filter_insertion *req;
struct efx_arfs_rule *rule; struct efx_arfs_rule *rule;
struct flow_keys fk; struct flow_keys fk;
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
int efx_sriov_set_vf_mac(struct net_device *net_dev, int vf_i, u8 *mac) int efx_sriov_set_vf_mac(struct net_device *net_dev, int vf_i, u8 *mac)
{ {
struct efx_nic *efx = netdev_priv(net_dev); struct efx_nic *efx = efx_netdev_priv(net_dev);
if (efx->type->sriov_set_vf_mac) if (efx->type->sriov_set_vf_mac)
return efx->type->sriov_set_vf_mac(efx, vf_i, mac); return efx->type->sriov_set_vf_mac(efx, vf_i, mac);
...@@ -21,7 +21,7 @@ int efx_sriov_set_vf_mac(struct net_device *net_dev, int vf_i, u8 *mac) ...@@ -21,7 +21,7 @@ int efx_sriov_set_vf_mac(struct net_device *net_dev, int vf_i, u8 *mac)
int efx_sriov_set_vf_vlan(struct net_device *net_dev, int vf_i, u16 vlan, int efx_sriov_set_vf_vlan(struct net_device *net_dev, int vf_i, u16 vlan,
u8 qos, __be16 vlan_proto) u8 qos, __be16 vlan_proto)
{ {
struct efx_nic *efx = netdev_priv(net_dev); struct efx_nic *efx = efx_netdev_priv(net_dev);
if (efx->type->sriov_set_vf_vlan) { if (efx->type->sriov_set_vf_vlan) {
if ((vlan & ~VLAN_VID_MASK) || if ((vlan & ~VLAN_VID_MASK) ||
...@@ -40,7 +40,7 @@ int efx_sriov_set_vf_vlan(struct net_device *net_dev, int vf_i, u16 vlan, ...@@ -40,7 +40,7 @@ int efx_sriov_set_vf_vlan(struct net_device *net_dev, int vf_i, u16 vlan,
int efx_sriov_set_vf_spoofchk(struct net_device *net_dev, int vf_i, int efx_sriov_set_vf_spoofchk(struct net_device *net_dev, int vf_i,
bool spoofchk) bool spoofchk)
{ {
struct efx_nic *efx = netdev_priv(net_dev); struct efx_nic *efx = efx_netdev_priv(net_dev);
if (efx->type->sriov_set_vf_spoofchk) if (efx->type->sriov_set_vf_spoofchk)
return efx->type->sriov_set_vf_spoofchk(efx, vf_i, spoofchk); return efx->type->sriov_set_vf_spoofchk(efx, vf_i, spoofchk);
...@@ -51,7 +51,7 @@ int efx_sriov_set_vf_spoofchk(struct net_device *net_dev, int vf_i, ...@@ -51,7 +51,7 @@ int efx_sriov_set_vf_spoofchk(struct net_device *net_dev, int vf_i,
int efx_sriov_get_vf_config(struct net_device *net_dev, int vf_i, int efx_sriov_get_vf_config(struct net_device *net_dev, int vf_i,
struct ifla_vf_info *ivi) struct ifla_vf_info *ivi)
{ {
struct efx_nic *efx = netdev_priv(net_dev); struct efx_nic *efx = efx_netdev_priv(net_dev);
if (efx->type->sriov_get_vf_config) if (efx->type->sriov_get_vf_config)
return efx->type->sriov_get_vf_config(efx, vf_i, ivi); return efx->type->sriov_get_vf_config(efx, vf_i, ivi);
...@@ -62,7 +62,7 @@ int efx_sriov_get_vf_config(struct net_device *net_dev, int vf_i, ...@@ -62,7 +62,7 @@ int efx_sriov_get_vf_config(struct net_device *net_dev, int vf_i,
int efx_sriov_set_vf_link_state(struct net_device *net_dev, int vf_i, int efx_sriov_set_vf_link_state(struct net_device *net_dev, int vf_i,
int link_state) int link_state)
{ {
struct efx_nic *efx = netdev_priv(net_dev); struct efx_nic *efx = efx_netdev_priv(net_dev);
if (efx->type->sriov_set_vf_link_state) if (efx->type->sriov_set_vf_link_state)
return efx->type->sriov_set_vf_link_state(efx, vf_i, return efx->type->sriov_set_vf_link_state(efx, vf_i,
......
...@@ -512,7 +512,7 @@ int efx_xdp_tx_buffers(struct efx_nic *efx, int n, struct xdp_frame **xdpfs, ...@@ -512,7 +512,7 @@ int efx_xdp_tx_buffers(struct efx_nic *efx, int n, struct xdp_frame **xdpfs,
netdev_tx_t efx_hard_start_xmit(struct sk_buff *skb, netdev_tx_t efx_hard_start_xmit(struct sk_buff *skb,
struct net_device *net_dev) struct net_device *net_dev)
{ {
struct efx_nic *efx = netdev_priv(net_dev); struct efx_nic *efx = efx_netdev_priv(net_dev);
struct efx_tx_queue *tx_queue; struct efx_tx_queue *tx_queue;
unsigned index, type; unsigned index, type;
...@@ -609,7 +609,7 @@ void efx_init_tx_queue_core_txq(struct efx_tx_queue *tx_queue) ...@@ -609,7 +609,7 @@ void efx_init_tx_queue_core_txq(struct efx_tx_queue *tx_queue)
int efx_setup_tc(struct net_device *net_dev, enum tc_setup_type type, int efx_setup_tc(struct net_device *net_dev, enum tc_setup_type type,
void *type_data) void *type_data)
{ {
struct efx_nic *efx = netdev_priv(net_dev); struct efx_nic *efx = efx_netdev_priv(net_dev);
struct tc_mqprio_qopt *mqprio = type_data; struct tc_mqprio_qopt *mqprio = type_data;
unsigned tc, num_tc; unsigned tc, num_tc;
......
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