Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Jonathan Cooper <jonathan.s.cooper@amd.com>
Co-developed-by: Martin Habets <habetsm.xilinx@gmail.com>
Signed-off-by: Martin Habets <habetsm.xilinx@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Jonathan Cooper and committed by
David S. Miller
8cb03f4e b3fd0a86

+78 -73
+2 -2
drivers/net/ethernet/sfc/ef10.c
··· 3874 3874 unsigned int table, unsigned int entry, 3875 3875 struct udp_tunnel_info *ti) 3876 3876 { 3877 - struct efx_nic *efx = netdev_priv(dev); 3877 + struct efx_nic *efx = efx_netdev_priv(dev); 3878 3878 struct efx_ef10_nic_data *nic_data; 3879 3879 int efx_tunnel_type, rc; 3880 3880 ··· 3934 3934 unsigned int table, unsigned int entry, 3935 3935 struct udp_tunnel_info *ti) 3936 3936 { 3937 - struct efx_nic *efx = netdev_priv(dev); 3937 + struct efx_nic *efx = efx_netdev_priv(dev); 3938 3938 struct efx_ef10_nic_data *nic_data; 3939 3939 int rc; 3940 3940
+1 -1
drivers/net/ethernet/sfc/ef100.c
··· 464 464 net_dev = alloc_etherdev_mq(sizeof(*efx), EFX_MAX_CORE_TX_QUEUES); 465 465 if (!net_dev) 466 466 return -ENOMEM; 467 - efx = netdev_priv(net_dev); 467 + efx = efx_netdev_priv(net_dev); 468 468 efx->type = (const struct efx_nic_type *)entry->driver_data; 469 469 470 470 pci_set_drvdata(pci_dev, efx);
+1 -1
drivers/net/ethernet/sfc/ef100_ethtool.c
··· 26 26 struct kernel_ethtool_ringparam *kernel_ring, 27 27 struct netlink_ext_ack *extack) 28 28 { 29 - struct efx_nic *efx = netdev_priv(net_dev); 29 + struct efx_nic *efx = efx_netdev_priv(net_dev); 30 30 31 31 ring->rx_max_pending = EFX_EF100_MAX_DMAQ_SIZE; 32 32 ring->tx_max_pending = EFX_EF100_MAX_DMAQ_SIZE;
+4 -4
drivers/net/ethernet/sfc/ef100_netdev.c
··· 79 79 */ 80 80 static int ef100_net_stop(struct net_device *net_dev) 81 81 { 82 - struct efx_nic *efx = netdev_priv(net_dev); 82 + struct efx_nic *efx = efx_netdev_priv(net_dev); 83 83 84 84 netif_dbg(efx, ifdown, efx->net_dev, "closing on CPU %d\n", 85 85 raw_smp_processor_id()); ··· 104 104 /* Context: process, rtnl_lock() held. */ 105 105 static int ef100_net_open(struct net_device *net_dev) 106 106 { 107 - struct efx_nic *efx = netdev_priv(net_dev); 107 + struct efx_nic *efx = efx_netdev_priv(net_dev); 108 108 unsigned int allocated_vis; 109 109 int rc; 110 110 ··· 193 193 static netdev_tx_t ef100_hard_start_xmit(struct sk_buff *skb, 194 194 struct net_device *net_dev) 195 195 { 196 - struct efx_nic *efx = netdev_priv(net_dev); 196 + struct efx_nic *efx = efx_netdev_priv(net_dev); 197 197 struct efx_tx_queue *tx_queue; 198 198 struct efx_channel *channel; 199 199 int rc; ··· 243 243 struct efx_nic *efx = container_of(this, struct efx_nic, netdev_notifier); 244 244 struct net_device *net_dev = netdev_notifier_info_to_dev(ptr); 245 245 246 - if (netdev_priv(net_dev) == efx && event == NETDEV_CHANGENAME) 246 + if (efx_netdev_priv(net_dev) == efx && event == NETDEV_CHANGENAME) 247 247 ef100_update_name(efx); 248 248 249 249 return NOTIFY_DONE;
+10 -10
drivers/net/ethernet/sfc/efx.c
··· 492 492 */ 493 493 static int efx_ioctl(struct net_device *net_dev, struct ifreq *ifr, int cmd) 494 494 { 495 - struct efx_nic *efx = netdev_priv(net_dev); 495 + struct efx_nic *efx = efx_netdev_priv(net_dev); 496 496 struct mii_ioctl_data *data = if_mii(ifr); 497 497 498 498 if (cmd == SIOCSHWTSTAMP) ··· 517 517 /* Context: process, rtnl_lock() held. */ 518 518 int efx_net_open(struct net_device *net_dev) 519 519 { 520 - struct efx_nic *efx = netdev_priv(net_dev); 520 + struct efx_nic *efx = efx_netdev_priv(net_dev); 521 521 int rc; 522 522 523 523 netif_dbg(efx, ifup, efx->net_dev, "opening device on CPU %d\n", ··· 551 551 */ 552 552 int efx_net_stop(struct net_device *net_dev) 553 553 { 554 - struct efx_nic *efx = netdev_priv(net_dev); 554 + struct efx_nic *efx = efx_netdev_priv(net_dev); 555 555 556 556 netif_dbg(efx, ifdown, efx->net_dev, "closing on CPU %d\n", 557 557 raw_smp_processor_id()); ··· 564 564 565 565 static int efx_vlan_rx_add_vid(struct net_device *net_dev, __be16 proto, u16 vid) 566 566 { 567 - struct efx_nic *efx = netdev_priv(net_dev); 567 + struct efx_nic *efx = efx_netdev_priv(net_dev); 568 568 569 569 if (efx->type->vlan_rx_add_vid) 570 570 return efx->type->vlan_rx_add_vid(efx, proto, vid); ··· 574 574 575 575 static int efx_vlan_rx_kill_vid(struct net_device *net_dev, __be16 proto, u16 vid) 576 576 { 577 - struct efx_nic *efx = netdev_priv(net_dev); 577 + struct efx_nic *efx = efx_netdev_priv(net_dev); 578 578 579 579 if (efx->type->vlan_rx_kill_vid) 580 580 return efx->type->vlan_rx_kill_vid(efx, proto, vid); ··· 643 643 /* Context: process, rtnl_lock() held. */ 644 644 static int efx_xdp(struct net_device *dev, struct netdev_bpf *xdp) 645 645 { 646 - struct efx_nic *efx = netdev_priv(dev); 646 + struct efx_nic *efx = efx_netdev_priv(dev); 647 647 648 648 switch (xdp->command) { 649 649 case XDP_SETUP_PROG: ··· 656 656 static int efx_xdp_xmit(struct net_device *dev, int n, struct xdp_frame **xdpfs, 657 657 u32 flags) 658 658 { 659 - struct efx_nic *efx = netdev_priv(dev); 659 + struct efx_nic *efx = efx_netdev_priv(dev); 660 660 661 661 if (!netif_running(dev)) 662 662 return -EINVAL; ··· 678 678 679 679 if ((net_dev->netdev_ops == &efx_netdev_ops) && 680 680 event == NETDEV_CHANGENAME) 681 - efx_update_name(netdev_priv(net_dev)); 681 + efx_update_name(efx_netdev_priv(net_dev)); 682 682 683 683 return NOTIFY_DONE; 684 684 } ··· 774 774 if (!efx->net_dev) 775 775 return; 776 776 777 - if (WARN_ON(netdev_priv(efx->net_dev) != efx)) 777 + if (WARN_ON(efx_netdev_priv(efx->net_dev) != efx)) 778 778 return; 779 779 780 780 if (efx_dev_registered(efx)) { ··· 1051 1051 EFX_MAX_RX_QUEUES); 1052 1052 if (!net_dev) 1053 1053 return -ENOMEM; 1054 - efx = netdev_priv(net_dev); 1054 + efx = efx_netdev_priv(net_dev); 1055 1055 efx->type = (const struct efx_nic_type *) entry->driver_data; 1056 1056 efx->fixed_features |= NETIF_F_HIGHDMA; 1057 1057
+9 -9
drivers/net/ethernet/sfc/efx_common.c
··· 167 167 168 168 int efx_set_mac_address(struct net_device *net_dev, void *data) 169 169 { 170 - struct efx_nic *efx = netdev_priv(net_dev); 170 + struct efx_nic *efx = efx_netdev_priv(net_dev); 171 171 struct sockaddr *addr = data; 172 172 u8 *new_addr = addr->sa_data; 173 173 u8 old_addr[6]; ··· 202 202 /* Context: netif_addr_lock held, BHs disabled. */ 203 203 void efx_set_rx_mode(struct net_device *net_dev) 204 204 { 205 - struct efx_nic *efx = netdev_priv(net_dev); 205 + struct efx_nic *efx = efx_netdev_priv(net_dev); 206 206 207 207 if (efx->port_enabled) 208 208 queue_work(efx->workqueue, &efx->mac_work); ··· 211 211 212 212 int efx_set_features(struct net_device *net_dev, netdev_features_t data) 213 213 { 214 - struct efx_nic *efx = netdev_priv(net_dev); 214 + struct efx_nic *efx = efx_netdev_priv(net_dev); 215 215 int rc; 216 216 217 217 /* If disabling RX n-tuple filtering, clear existing filters */ ··· 285 285 /* Context: process, rtnl_lock() held. */ 286 286 int efx_change_mtu(struct net_device *net_dev, int new_mtu) 287 287 { 288 - struct efx_nic *efx = netdev_priv(net_dev); 288 + struct efx_nic *efx = efx_netdev_priv(net_dev); 289 289 int rc; 290 290 291 291 rc = efx_check_disabled(efx); ··· 600 600 /* Context: process, dev_base_lock or RTNL held, non-blocking. */ 601 601 void efx_net_stats(struct net_device *net_dev, struct rtnl_link_stats64 *stats) 602 602 { 603 - struct efx_nic *efx = netdev_priv(net_dev); 603 + struct efx_nic *efx = efx_netdev_priv(net_dev); 604 604 605 605 spin_lock_bh(&efx->stats_lock); 606 606 efx_nic_update_stats_atomic(efx, NULL, stats); ··· 723 723 /* Context: netif_tx_lock held, BHs disabled. */ 724 724 void efx_watchdog(struct net_device *net_dev, unsigned int txqueue) 725 725 { 726 - struct efx_nic *efx = netdev_priv(net_dev); 726 + struct efx_nic *efx = efx_netdev_priv(net_dev); 727 727 728 728 netif_err(efx, tx_err, efx->net_dev, 729 729 "TX stuck with port_enabled=%d: resetting channels\n", ··· 1356 1356 netdev_features_t efx_features_check(struct sk_buff *skb, struct net_device *dev, 1357 1357 netdev_features_t features) 1358 1358 { 1359 - struct efx_nic *efx = netdev_priv(dev); 1359 + struct efx_nic *efx = efx_netdev_priv(dev); 1360 1360 1361 1361 if (skb->encapsulation) { 1362 1362 if (features & NETIF_F_GSO_MASK) ··· 1377 1377 int efx_get_phys_port_id(struct net_device *net_dev, 1378 1378 struct netdev_phys_item_id *ppid) 1379 1379 { 1380 - struct efx_nic *efx = netdev_priv(net_dev); 1380 + struct efx_nic *efx = efx_netdev_priv(net_dev); 1381 1381 1382 1382 if (efx->type->get_phys_port_id) 1383 1383 return efx->type->get_phys_port_id(efx, ppid); ··· 1387 1387 1388 1388 int efx_get_phys_port_name(struct net_device *net_dev, char *name, size_t len) 1389 1389 { 1390 - struct efx_nic *efx = netdev_priv(net_dev); 1390 + struct efx_nic *efx = efx_netdev_priv(net_dev); 1391 1391 1392 1392 if (snprintf(name, len, "p%u", efx->port_num) >= len) 1393 1393 return -EINVAL;
+11 -11
drivers/net/ethernet/sfc/ethtool.c
··· 33 33 static int efx_ethtool_phys_id(struct net_device *net_dev, 34 34 enum ethtool_phys_id_state state) 35 35 { 36 - struct efx_nic *efx = netdev_priv(net_dev); 36 + struct efx_nic *efx = efx_netdev_priv(net_dev); 37 37 enum efx_led_mode mode = EFX_LED_DEFAULT; 38 38 39 39 switch (state) { ··· 55 55 56 56 static int efx_ethtool_get_regs_len(struct net_device *net_dev) 57 57 { 58 - return efx_nic_get_regs_len(netdev_priv(net_dev)); 58 + return efx_nic_get_regs_len(efx_netdev_priv(net_dev)); 59 59 } 60 60 61 61 static void efx_ethtool_get_regs(struct net_device *net_dev, 62 62 struct ethtool_regs *regs, void *buf) 63 63 { 64 - struct efx_nic *efx = netdev_priv(net_dev); 64 + struct efx_nic *efx = efx_netdev_priv(net_dev); 65 65 66 66 regs->version = efx->type->revision; 67 67 efx_nic_get_regs(efx, buf); ··· 101 101 struct kernel_ethtool_coalesce *kernel_coal, 102 102 struct netlink_ext_ack *extack) 103 103 { 104 - struct efx_nic *efx = netdev_priv(net_dev); 104 + struct efx_nic *efx = efx_netdev_priv(net_dev); 105 105 unsigned int tx_usecs, rx_usecs; 106 106 bool rx_adaptive; 107 107 ··· 121 121 struct kernel_ethtool_coalesce *kernel_coal, 122 122 struct netlink_ext_ack *extack) 123 123 { 124 - struct efx_nic *efx = netdev_priv(net_dev); 124 + struct efx_nic *efx = efx_netdev_priv(net_dev); 125 125 struct efx_channel *channel; 126 126 unsigned int tx_usecs, rx_usecs; 127 127 bool adaptive, rx_may_override_tx; ··· 163 163 struct kernel_ethtool_ringparam *kernel_ring, 164 164 struct netlink_ext_ack *extack) 165 165 { 166 - struct efx_nic *efx = netdev_priv(net_dev); 166 + struct efx_nic *efx = efx_netdev_priv(net_dev); 167 167 168 168 ring->rx_max_pending = EFX_MAX_DMAQ_SIZE; 169 169 ring->tx_max_pending = EFX_TXQ_MAX_ENT(efx); ··· 177 177 struct kernel_ethtool_ringparam *kernel_ring, 178 178 struct netlink_ext_ack *extack) 179 179 { 180 - struct efx_nic *efx = netdev_priv(net_dev); 180 + struct efx_nic *efx = efx_netdev_priv(net_dev); 181 181 u32 txq_entries; 182 182 183 183 if (ring->rx_mini_pending || ring->rx_jumbo_pending || ··· 204 204 static void efx_ethtool_get_wol(struct net_device *net_dev, 205 205 struct ethtool_wolinfo *wol) 206 206 { 207 - struct efx_nic *efx = netdev_priv(net_dev); 207 + struct efx_nic *efx = efx_netdev_priv(net_dev); 208 208 return efx->type->get_wol(efx, wol); 209 209 } 210 210 ··· 212 212 static int efx_ethtool_set_wol(struct net_device *net_dev, 213 213 struct ethtool_wolinfo *wol) 214 214 { 215 - struct efx_nic *efx = netdev_priv(net_dev); 215 + struct efx_nic *efx = efx_netdev_priv(net_dev); 216 216 return efx->type->set_wol(efx, wol->wolopts); 217 217 } 218 218 219 219 static void efx_ethtool_get_fec_stats(struct net_device *net_dev, 220 220 struct ethtool_fec_stats *fec_stats) 221 221 { 222 - struct efx_nic *efx = netdev_priv(net_dev); 222 + struct efx_nic *efx = efx_netdev_priv(net_dev); 223 223 224 224 if (efx->type->get_fec_stats) 225 225 efx->type->get_fec_stats(efx, fec_stats); ··· 228 228 static int efx_ethtool_get_ts_info(struct net_device *net_dev, 229 229 struct ethtool_ts_info *ts_info) 230 230 { 231 - struct efx_nic *efx = netdev_priv(net_dev); 231 + struct efx_nic *efx = efx_netdev_priv(net_dev); 232 232 233 233 /* Software capabilities */ 234 234 ts_info->so_timestamping = (SOF_TIMESTAMPING_RX_SOFTWARE |
+24 -24
drivers/net/ethernet/sfc/ethtool_common.c
··· 103 103 void efx_ethtool_get_drvinfo(struct net_device *net_dev, 104 104 struct ethtool_drvinfo *info) 105 105 { 106 - struct efx_nic *efx = netdev_priv(net_dev); 106 + struct efx_nic *efx = efx_netdev_priv(net_dev); 107 107 108 108 strlcpy(info->driver, KBUILD_MODNAME, sizeof(info->driver)); 109 109 efx_mcdi_print_fwver(efx, info->fw_version, ··· 113 113 114 114 u32 efx_ethtool_get_msglevel(struct net_device *net_dev) 115 115 { 116 - struct efx_nic *efx = netdev_priv(net_dev); 116 + struct efx_nic *efx = efx_netdev_priv(net_dev); 117 117 118 118 return efx->msg_enable; 119 119 } 120 120 121 121 void efx_ethtool_set_msglevel(struct net_device *net_dev, u32 msg_enable) 122 122 { 123 - struct efx_nic *efx = netdev_priv(net_dev); 123 + struct efx_nic *efx = efx_netdev_priv(net_dev); 124 124 125 125 efx->msg_enable = msg_enable; 126 126 } ··· 128 128 void efx_ethtool_self_test(struct net_device *net_dev, 129 129 struct ethtool_test *test, u64 *data) 130 130 { 131 - struct efx_nic *efx = netdev_priv(net_dev); 131 + struct efx_nic *efx = efx_netdev_priv(net_dev); 132 132 struct efx_self_tests *efx_tests; 133 133 bool already_up; 134 134 int rc = -ENOMEM; ··· 176 176 void efx_ethtool_get_pauseparam(struct net_device *net_dev, 177 177 struct ethtool_pauseparam *pause) 178 178 { 179 - struct efx_nic *efx = netdev_priv(net_dev); 179 + struct efx_nic *efx = efx_netdev_priv(net_dev); 180 180 181 181 pause->rx_pause = !!(efx->wanted_fc & EFX_FC_RX); 182 182 pause->tx_pause = !!(efx->wanted_fc & EFX_FC_TX); ··· 186 186 int efx_ethtool_set_pauseparam(struct net_device *net_dev, 187 187 struct ethtool_pauseparam *pause) 188 188 { 189 - struct efx_nic *efx = netdev_priv(net_dev); 189 + struct efx_nic *efx = efx_netdev_priv(net_dev); 190 190 u8 wanted_fc, old_fc; 191 191 u32 old_adv; 192 192 int rc = 0; ··· 441 441 442 442 int efx_ethtool_get_sset_count(struct net_device *net_dev, int string_set) 443 443 { 444 - struct efx_nic *efx = netdev_priv(net_dev); 444 + struct efx_nic *efx = efx_netdev_priv(net_dev); 445 445 446 446 switch (string_set) { 447 447 case ETH_SS_STATS: ··· 459 459 void efx_ethtool_get_strings(struct net_device *net_dev, 460 460 u32 string_set, u8 *strings) 461 461 { 462 - struct efx_nic *efx = netdev_priv(net_dev); 462 + struct efx_nic *efx = efx_netdev_priv(net_dev); 463 463 int i; 464 464 465 465 switch (string_set) { ··· 487 487 struct ethtool_stats *stats, 488 488 u64 *data) 489 489 { 490 - struct efx_nic *efx = netdev_priv(net_dev); 490 + struct efx_nic *efx = efx_netdev_priv(net_dev); 491 491 const struct efx_sw_stat_desc *stat; 492 492 struct efx_channel *channel; 493 493 struct efx_tx_queue *tx_queue; ··· 561 561 int efx_ethtool_get_link_ksettings(struct net_device *net_dev, 562 562 struct ethtool_link_ksettings *cmd) 563 563 { 564 - struct efx_nic *efx = netdev_priv(net_dev); 564 + struct efx_nic *efx = efx_netdev_priv(net_dev); 565 565 struct efx_link_state *link_state = &efx->link_state; 566 566 567 567 mutex_lock(&efx->mac_lock); ··· 584 584 int efx_ethtool_set_link_ksettings(struct net_device *net_dev, 585 585 const struct ethtool_link_ksettings *cmd) 586 586 { 587 - struct efx_nic *efx = netdev_priv(net_dev); 587 + struct efx_nic *efx = efx_netdev_priv(net_dev); 588 588 int rc; 589 589 590 590 /* GMAC does not support 1000Mbps HD */ ··· 604 604 int efx_ethtool_get_fecparam(struct net_device *net_dev, 605 605 struct ethtool_fecparam *fecparam) 606 606 { 607 - struct efx_nic *efx = netdev_priv(net_dev); 607 + struct efx_nic *efx = efx_netdev_priv(net_dev); 608 608 int rc; 609 609 610 610 mutex_lock(&efx->mac_lock); ··· 617 617 int efx_ethtool_set_fecparam(struct net_device *net_dev, 618 618 struct ethtool_fecparam *fecparam) 619 619 { 620 - struct efx_nic *efx = netdev_priv(net_dev); 620 + struct efx_nic *efx = efx_netdev_priv(net_dev); 621 621 int rc; 622 622 623 623 mutex_lock(&efx->mac_lock); ··· 809 809 int efx_ethtool_get_rxnfc(struct net_device *net_dev, 810 810 struct ethtool_rxnfc *info, u32 *rule_locs) 811 811 { 812 - struct efx_nic *efx = netdev_priv(net_dev); 812 + struct efx_nic *efx = efx_netdev_priv(net_dev); 813 813 u32 rss_context = 0; 814 814 s32 rc = 0; 815 815 ··· 1127 1127 int efx_ethtool_set_rxnfc(struct net_device *net_dev, 1128 1128 struct ethtool_rxnfc *info) 1129 1129 { 1130 - struct efx_nic *efx = netdev_priv(net_dev); 1130 + struct efx_nic *efx = efx_netdev_priv(net_dev); 1131 1131 1132 1132 if (efx_filter_get_rx_id_limit(efx) == 0) 1133 1133 return -EOPNOTSUPP; ··· 1148 1148 1149 1149 u32 efx_ethtool_get_rxfh_indir_size(struct net_device *net_dev) 1150 1150 { 1151 - struct efx_nic *efx = netdev_priv(net_dev); 1151 + struct efx_nic *efx = efx_netdev_priv(net_dev); 1152 1152 1153 1153 if (efx->n_rx_channels == 1) 1154 1154 return 0; ··· 1157 1157 1158 1158 u32 efx_ethtool_get_rxfh_key_size(struct net_device *net_dev) 1159 1159 { 1160 - struct efx_nic *efx = netdev_priv(net_dev); 1160 + struct efx_nic *efx = efx_netdev_priv(net_dev); 1161 1161 1162 1162 return efx->type->rx_hash_key_size; 1163 1163 } ··· 1165 1165 int efx_ethtool_get_rxfh(struct net_device *net_dev, u32 *indir, u8 *key, 1166 1166 u8 *hfunc) 1167 1167 { 1168 - struct efx_nic *efx = netdev_priv(net_dev); 1168 + struct efx_nic *efx = efx_netdev_priv(net_dev); 1169 1169 int rc; 1170 1170 1171 1171 rc = efx->type->rx_pull_rss_config(efx); ··· 1186 1186 int efx_ethtool_set_rxfh(struct net_device *net_dev, const u32 *indir, 1187 1187 const u8 *key, const u8 hfunc) 1188 1188 { 1189 - struct efx_nic *efx = netdev_priv(net_dev); 1189 + struct efx_nic *efx = efx_netdev_priv(net_dev); 1190 1190 1191 1191 /* Hash function is Toeplitz, cannot be changed */ 1192 1192 if (hfunc != ETH_RSS_HASH_NO_CHANGE && hfunc != ETH_RSS_HASH_TOP) ··· 1205 1205 int efx_ethtool_get_rxfh_context(struct net_device *net_dev, u32 *indir, 1206 1206 u8 *key, u8 *hfunc, u32 rss_context) 1207 1207 { 1208 - struct efx_nic *efx = netdev_priv(net_dev); 1208 + struct efx_nic *efx = efx_netdev_priv(net_dev); 1209 1209 struct efx_rss_context *ctx; 1210 1210 int rc = 0; 1211 1211 ··· 1238 1238 const u8 hfunc, u32 *rss_context, 1239 1239 bool delete) 1240 1240 { 1241 - struct efx_nic *efx = netdev_priv(net_dev); 1241 + struct efx_nic *efx = efx_netdev_priv(net_dev); 1242 1242 struct efx_rss_context *ctx; 1243 1243 bool allocated = false; 1244 1244 int rc; ··· 1300 1300 1301 1301 int efx_ethtool_reset(struct net_device *net_dev, u32 *flags) 1302 1302 { 1303 - struct efx_nic *efx = netdev_priv(net_dev); 1303 + struct efx_nic *efx = efx_netdev_priv(net_dev); 1304 1304 int rc; 1305 1305 1306 1306 rc = efx->type->map_reset_flags(flags); ··· 1314 1314 struct ethtool_eeprom *ee, 1315 1315 u8 *data) 1316 1316 { 1317 - struct efx_nic *efx = netdev_priv(net_dev); 1317 + struct efx_nic *efx = efx_netdev_priv(net_dev); 1318 1318 int ret; 1319 1319 1320 1320 mutex_lock(&efx->mac_lock); ··· 1327 1327 int efx_ethtool_get_module_info(struct net_device *net_dev, 1328 1328 struct ethtool_modinfo *modinfo) 1329 1329 { 1330 - struct efx_nic *efx = netdev_priv(net_dev); 1330 + struct efx_nic *efx = efx_netdev_priv(net_dev); 1331 1331 int ret; 1332 1332 1333 1333 mutex_lock(&efx->mac_lock);
+2 -2
drivers/net/ethernet/sfc/mcdi_port.c
··· 20 20 static int efx_mcdi_mdio_read(struct net_device *net_dev, 21 21 int prtad, int devad, u16 addr) 22 22 { 23 - struct efx_nic *efx = netdev_priv(net_dev); 23 + struct efx_nic *efx = efx_netdev_priv(net_dev); 24 24 MCDI_DECLARE_BUF(inbuf, MC_CMD_MDIO_READ_IN_LEN); 25 25 MCDI_DECLARE_BUF(outbuf, MC_CMD_MDIO_READ_OUT_LEN); 26 26 size_t outlen; ··· 46 46 static int efx_mcdi_mdio_write(struct net_device *net_dev, 47 47 int prtad, int devad, u16 addr, u16 value) 48 48 { 49 - struct efx_nic *efx = netdev_priv(net_dev); 49 + struct efx_nic *efx = efx_netdev_priv(net_dev); 50 50 MCDI_DECLARE_BUF(inbuf, MC_CMD_MDIO_WRITE_IN_LEN); 51 51 MCDI_DECLARE_BUF(outbuf, MC_CMD_MDIO_WRITE_OUT_LEN); 52 52 size_t outlen;
+5
drivers/net/ethernet/sfc/net_driver.h
··· 1166 1166 atomic_t n_rx_noskb_drops; 1167 1167 }; 1168 1168 1169 + static inline struct efx_nic *efx_netdev_priv(struct net_device *dev) 1170 + { 1171 + return netdev_priv(dev); 1172 + } 1173 + 1169 1174 static inline int efx_dev_registered(struct efx_nic *efx) 1170 1175 { 1171 1176 return efx->net_dev->reg_state == NETREG_REGISTERED;
+2 -2
drivers/net/ethernet/sfc/rx_common.c
··· 857 857 { 858 858 struct efx_async_filter_insertion *req = container_of(data, struct efx_async_filter_insertion, 859 859 work); 860 - struct efx_nic *efx = netdev_priv(req->net_dev); 860 + struct efx_nic *efx = efx_netdev_priv(req->net_dev); 861 861 struct efx_channel *channel = efx_get_channel(efx, req->rxq_index); 862 862 int slot_idx = req - efx->rps_slot; 863 863 struct efx_arfs_rule *rule; ··· 942 942 int efx_filter_rfs(struct net_device *net_dev, const struct sk_buff *skb, 943 943 u16 rxq_index, u32 flow_id) 944 944 { 945 - struct efx_nic *efx = netdev_priv(net_dev); 945 + struct efx_nic *efx = efx_netdev_priv(net_dev); 946 946 struct efx_async_filter_insertion *req; 947 947 struct efx_arfs_rule *rule; 948 948 struct flow_keys fk;
+5 -5
drivers/net/ethernet/sfc/sriov.c
··· 10 10 11 11 int efx_sriov_set_vf_mac(struct net_device *net_dev, int vf_i, u8 *mac) 12 12 { 13 - struct efx_nic *efx = netdev_priv(net_dev); 13 + struct efx_nic *efx = efx_netdev_priv(net_dev); 14 14 15 15 if (efx->type->sriov_set_vf_mac) 16 16 return efx->type->sriov_set_vf_mac(efx, vf_i, mac); ··· 21 21 int efx_sriov_set_vf_vlan(struct net_device *net_dev, int vf_i, u16 vlan, 22 22 u8 qos, __be16 vlan_proto) 23 23 { 24 - struct efx_nic *efx = netdev_priv(net_dev); 24 + struct efx_nic *efx = efx_netdev_priv(net_dev); 25 25 26 26 if (efx->type->sriov_set_vf_vlan) { 27 27 if ((vlan & ~VLAN_VID_MASK) || ··· 40 40 int efx_sriov_set_vf_spoofchk(struct net_device *net_dev, int vf_i, 41 41 bool spoofchk) 42 42 { 43 - struct efx_nic *efx = netdev_priv(net_dev); 43 + struct efx_nic *efx = efx_netdev_priv(net_dev); 44 44 45 45 if (efx->type->sriov_set_vf_spoofchk) 46 46 return efx->type->sriov_set_vf_spoofchk(efx, vf_i, spoofchk); ··· 51 51 int efx_sriov_get_vf_config(struct net_device *net_dev, int vf_i, 52 52 struct ifla_vf_info *ivi) 53 53 { 54 - struct efx_nic *efx = netdev_priv(net_dev); 54 + struct efx_nic *efx = efx_netdev_priv(net_dev); 55 55 56 56 if (efx->type->sriov_get_vf_config) 57 57 return efx->type->sriov_get_vf_config(efx, vf_i, ivi); ··· 62 62 int efx_sriov_set_vf_link_state(struct net_device *net_dev, int vf_i, 63 63 int link_state) 64 64 { 65 - struct efx_nic *efx = netdev_priv(net_dev); 65 + struct efx_nic *efx = efx_netdev_priv(net_dev); 66 66 67 67 if (efx->type->sriov_set_vf_link_state) 68 68 return efx->type->sriov_set_vf_link_state(efx, vf_i,
+2 -2
drivers/net/ethernet/sfc/tx.c
··· 512 512 netdev_tx_t efx_hard_start_xmit(struct sk_buff *skb, 513 513 struct net_device *net_dev) 514 514 { 515 - struct efx_nic *efx = netdev_priv(net_dev); 515 + struct efx_nic *efx = efx_netdev_priv(net_dev); 516 516 struct efx_tx_queue *tx_queue; 517 517 unsigned index, type; 518 518 ··· 609 609 int efx_setup_tc(struct net_device *net_dev, enum tc_setup_type type, 610 610 void *type_data) 611 611 { 612 - struct efx_nic *efx = netdev_priv(net_dev); 612 + struct efx_nic *efx = efx_netdev_priv(net_dev); 613 613 struct tc_mqprio_qopt *mqprio = type_data; 614 614 unsigned tc, num_tc; 615 615