Page MenuHomeFreeBSD

D32640.diff
No OneTemporary

D32640.diff

diff --git a/sys/dev/mlx4/mlx4_en/en.h b/sys/dev/mlx4/mlx4_en/en.h
--- a/sys/dev/mlx4/mlx4_en/en.h
+++ b/sys/dev/mlx4/mlx4_en/en.h
@@ -39,13 +39,20 @@
#include <linux/list.h>
#include <linux/mutex.h>
#include <linux/kobject.h>
-#include <linux/netdevice.h>
#include <linux/if_vlan.h>
#include <linux/if_ether.h>
#ifdef CONFIG_MLX4_EN_DCB
#include <linux/dcbnl.h>
#endif
+#include <sys/socket.h>
+#include <sys/taskqueue.h>
+
+#include <net/if_types.h>
+#include <net/if.h>
+#include <net/if_var.h>
+#include <net/if_dl.h>
+
#include <dev/mlx4/device.h>
#include <dev/mlx4/qp.h>
#include <dev/mlx4/cq.h>
@@ -655,7 +662,7 @@
};
static inline void *
-netdev_priv(const struct ifnet *dev)
+mlx4_netdev_priv(const struct ifnet *dev)
{
return (dev->if_softc);
}
@@ -710,7 +717,7 @@
spin_lock_bh(&cq->poll_lock);
if ((cq->state & MLX4_CQ_LOCKED)) {
struct ifnet *dev = cq->dev;
- struct mlx4_en_priv *priv = netdev_priv(dev);
+ struct mlx4_en_priv *priv = mlx4_netdev_priv(dev);
struct mlx4_en_rx_ring *rx_ring = priv->rx_ring[cq->ring];
cq->state |= MLX4_EN_CQ_STATE_POLL_YIELD;
diff --git a/sys/dev/mlx4/mlx4_en/mlx4_en_main.c b/sys/dev/mlx4/mlx4_en/mlx4_en_main.c
--- a/sys/dev/mlx4/mlx4_en/mlx4_en_main.c
+++ b/sys/dev/mlx4/mlx4_en/mlx4_en_main.c
@@ -119,7 +119,7 @@
case MLX4_DEV_EVENT_PORT_DOWN:
if (!mdev->pndev[port])
return;
- priv = netdev_priv(mdev->pndev[port]);
+ priv = mlx4_netdev_priv(mdev->pndev[port]);
/* To prevent races, we poll the link state in a separate
task rather than changing it here */
priv->link_state = event;
diff --git a/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c b/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c
--- a/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c
+++ b/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c
@@ -65,7 +65,7 @@
{
struct mlx4_en_cq *cq = container_of(napi, struct mlx4_en_cq, napi);
struct ifnet *dev = cq->dev;
- struct mlx4_en_priv *priv = netdev_priv(dev);
+ struct mlx4_en_priv *priv = mlx4_netdev_priv(dev);
struct mlx4_en_rx_ring *rx_ring = priv->rx_ring[cq->ring];
int done;
@@ -291,7 +291,7 @@
mlx4_en_filter_rfs(struct ifnet *net_dev, const struct sk_buff *skb,
u16 rxq_index, u32 flow_id)
{
- struct mlx4_en_priv *priv = netdev_priv(net_dev);
+ struct mlx4_en_priv *priv = mlx4_netdev_priv(net_dev);
struct mlx4_en_filter *filter;
const struct iphdr *ip;
const __be16 *ports;
@@ -402,7 +402,7 @@
static void mlx4_en_vlan_rx_add_vid(void *arg, struct ifnet *dev, u16 vid)
{
- struct mlx4_en_priv *priv = netdev_priv(dev);
+ struct mlx4_en_priv *priv = mlx4_netdev_priv(dev);
struct mlx4_en_dev *mdev = priv->mdev;
int err;
int idx;
@@ -429,7 +429,7 @@
static void mlx4_en_vlan_rx_kill_vid(void *arg, struct ifnet *dev, u16 vid)
{
- struct mlx4_en_priv *priv = netdev_priv(dev);
+ struct mlx4_en_priv *priv = mlx4_netdev_priv(dev);
struct mlx4_en_dev *mdev = priv->mdev;
int err;
@@ -608,7 +608,7 @@
static void mlx4_en_clear_uclist(struct ifnet *dev)
{
- struct mlx4_en_priv *priv = netdev_priv(dev);
+ struct mlx4_en_priv *priv = mlx4_netdev_priv(dev);
struct mlx4_en_addr_list *tmp, *uc_to_del;
list_for_each_entry_safe(uc_to_del, tmp, &priv->uc_list, list) {
@@ -637,7 +637,7 @@
static void mlx4_en_cache_uclist(struct ifnet *dev)
{
- struct mlx4_en_priv *priv = netdev_priv(dev);
+ struct mlx4_en_priv *priv = mlx4_netdev_priv(dev);
mlx4_en_clear_uclist(dev);
if_foreach_lladdr(dev, mlx4_copy_addr, priv);
@@ -645,7 +645,7 @@
static void mlx4_en_clear_mclist(struct ifnet *dev)
{
- struct mlx4_en_priv *priv = netdev_priv(dev);
+ struct mlx4_en_priv *priv = mlx4_netdev_priv(dev);
struct mlx4_en_addr_list *tmp, *mc_to_del;
list_for_each_entry_safe(mc_to_del, tmp, &priv->mc_list, list) {
@@ -673,7 +673,7 @@
static void mlx4_en_cache_mclist(struct ifnet *dev)
{
- struct mlx4_en_priv *priv = netdev_priv(dev);
+ struct mlx4_en_priv *priv = mlx4_netdev_priv(dev);
mlx4_en_clear_mclist(dev);
if_foreach_llmaddr(dev, mlx4_copy_maddr, priv);
@@ -730,7 +730,7 @@
static void mlx4_en_set_rx_mode(struct ifnet *dev)
{
- struct mlx4_en_priv *priv = netdev_priv(dev);
+ struct mlx4_en_priv *priv = mlx4_netdev_priv(dev);
if (!priv->port_up)
return;
@@ -1260,7 +1260,7 @@
int mlx4_en_start_port(struct ifnet *dev)
{
- struct mlx4_en_priv *priv = netdev_priv(dev);
+ struct mlx4_en_priv *priv = mlx4_netdev_priv(dev);
struct mlx4_en_dev *mdev = priv->mdev;
struct mlx4_en_cq *cq;
struct mlx4_en_tx_ring *tx_ring;
@@ -1453,7 +1453,7 @@
void mlx4_en_stop_port(struct ifnet *dev)
{
- struct mlx4_en_priv *priv = netdev_priv(dev);
+ struct mlx4_en_priv *priv = mlx4_netdev_priv(dev);
struct mlx4_en_dev *mdev = priv->mdev;
struct mlx4_en_addr_list *addr_list, *tmp;
int i;
@@ -1603,7 +1603,7 @@
static void mlx4_en_clear_stats(struct ifnet *dev)
{
- struct mlx4_en_priv *priv = netdev_priv(dev);
+ struct mlx4_en_priv *priv = mlx4_netdev_priv(dev);
struct mlx4_en_dev *mdev = priv->mdev;
int i;
@@ -1762,7 +1762,7 @@
void mlx4_en_destroy_netdev(struct ifnet *dev)
{
- struct mlx4_en_priv *priv = netdev_priv(dev);
+ struct mlx4_en_priv *priv = mlx4_netdev_priv(dev);
struct mlx4_en_dev *mdev = priv->mdev;
en_dbg(DRV, priv, "Destroying netdev on port:%d\n", priv->port);
@@ -1817,7 +1817,7 @@
static int mlx4_en_change_mtu(struct ifnet *dev, int new_mtu)
{
- struct mlx4_en_priv *priv = netdev_priv(dev);
+ struct mlx4_en_priv *priv = mlx4_netdev_priv(dev);
struct mlx4_en_dev *mdev = priv->mdev;
int err = 0;
@@ -2353,7 +2353,7 @@
static int mlx4_en_set_ring_size(struct ifnet *dev,
int rx_size, int tx_size)
{
- struct mlx4_en_priv *priv = netdev_priv(dev);
+ struct mlx4_en_priv *priv = mlx4_netdev_priv(dev);
struct mlx4_en_dev *mdev = priv->mdev;
int port_up = 0;
int err = 0;
@@ -2427,7 +2427,7 @@
static int mlx4_en_get_module_info(struct ifnet *dev,
struct ethtool_modinfo *modinfo)
{
- struct mlx4_en_priv *priv = netdev_priv(dev);
+ struct mlx4_en_priv *priv = mlx4_netdev_priv(dev);
struct mlx4_en_dev *mdev = priv->mdev;
int ret;
u8 data[4];
@@ -2475,7 +2475,7 @@
struct ethtool_eeprom *ee,
u8 *data)
{
- struct mlx4_en_priv *priv = netdev_priv(dev);
+ struct mlx4_en_priv *priv = mlx4_netdev_priv(dev);
struct mlx4_en_dev *mdev = priv->mdev;
int offset = ee->offset;
int i = 0, ret;
diff --git a/sys/dev/mlx4/mlx4_en/mlx4_en_port.c b/sys/dev/mlx4/mlx4_en/mlx4_en_port.c
--- a/sys/dev/mlx4/mlx4_en/mlx4_en_port.c
+++ b/sys/dev/mlx4/mlx4_en/mlx4_en_port.c
@@ -74,7 +74,7 @@
int mlx4_en_QUERY_PORT(struct mlx4_en_dev *mdev, u8 port)
{
struct mlx4_en_query_port_context *qport_context;
- struct mlx4_en_priv *priv = netdev_priv(mdev->pndev[port]);
+ struct mlx4_en_priv *priv = mlx4_netdev_priv(mdev->pndev[port]);
struct mlx4_en_port_state *state = &priv->port_state;
struct mlx4_cmd_mailbox *mailbox;
int err;
@@ -151,7 +151,7 @@
static void mlx4_en_fold_software_stats(struct ifnet *dev)
{
- struct mlx4_en_priv *priv = netdev_priv(dev);
+ struct mlx4_en_priv *priv = mlx4_netdev_priv(dev);
struct mlx4_en_dev *mdev = priv->mdev;
u64 packets, bytes;
int i;
@@ -188,7 +188,7 @@
struct mlx4_en_stat_out_mbox *mlx4_en_stats;
struct mlx4_en_stat_out_flow_control_mbox *flowstats;
struct ifnet *dev = mdev->pndev[port];
- struct mlx4_en_priv *priv = netdev_priv(dev);
+ struct mlx4_en_priv *priv = mlx4_netdev_priv(dev);
struct mlx4_en_vport_stats *vport_stats = &priv->vport_stats;
struct mlx4_cmd_mailbox *mailbox;
u64 in_mod = reset << 8 | port;
@@ -436,7 +436,7 @@
int mlx4_en_get_vport_stats(struct mlx4_en_dev *mdev, u8 port)
{
- struct mlx4_en_priv *priv = netdev_priv(mdev->pndev[port]);
+ struct mlx4_en_priv *priv = mlx4_netdev_priv(mdev->pndev[port]);
struct mlx4_counter tmp_vport_stats;
struct mlx4_en_vf_stats *vf_stats = &priv->vf_stats;
int err, i, counter_index;
diff --git a/sys/dev/mlx4/mlx4_en/mlx4_en_rx.c b/sys/dev/mlx4/mlx4_en/mlx4_en_rx.c
--- a/sys/dev/mlx4/mlx4_en/mlx4_en_rx.c
+++ b/sys/dev/mlx4/mlx4_en/mlx4_en_rx.c
@@ -340,7 +340,7 @@
void mlx4_en_calc_rx_buf(struct ifnet *dev)
{
- struct mlx4_en_priv *priv = netdev_priv(dev);
+ struct mlx4_en_priv *priv = mlx4_netdev_priv(dev);
int eff_mtu = dev->if_mtu + ETH_HLEN + VLAN_HLEN + ETH_FCS_LEN +
MLX4_NET_IP_ALIGN;
@@ -737,7 +737,7 @@
#define CQE_FACTOR_INDEX(index, factor) (((index) << (factor)) + (factor))
int mlx4_en_process_rx_cq(struct ifnet *dev, struct mlx4_en_cq *cq, int budget)
{
- struct mlx4_en_priv *priv = netdev_priv(dev);
+ struct mlx4_en_priv *priv = mlx4_netdev_priv(dev);
struct mlx4_cqe *cqe;
struct mlx4_en_rx_ring *ring = priv->rx_ring[cq->ring];
struct mlx4_en_rx_mbuf *mb_list;
@@ -880,7 +880,7 @@
void mlx4_en_rx_irq(struct mlx4_cq *mcq)
{
struct mlx4_en_cq *cq = container_of(mcq, struct mlx4_en_cq, mcq);
- struct mlx4_en_priv *priv = netdev_priv(cq->dev);
+ struct mlx4_en_priv *priv = mlx4_netdev_priv(cq->dev);
int done;
// Shoot one within the irq context
diff --git a/sys/dev/mlx4/mlx4_en/mlx4_en_tx.c b/sys/dev/mlx4/mlx4_en/mlx4_en_tx.c
--- a/sys/dev/mlx4/mlx4_en/mlx4_en_tx.c
+++ b/sys/dev/mlx4/mlx4_en/mlx4_en_tx.c
@@ -310,7 +310,7 @@
int mlx4_en_free_tx_buf(struct ifnet *dev, struct mlx4_en_tx_ring *ring)
{
- struct mlx4_en_priv *priv = netdev_priv(dev);
+ struct mlx4_en_priv *priv = mlx4_netdev_priv(dev);
int cnt = 0;
/* Skip last polled descriptor */
@@ -347,7 +347,7 @@
static int mlx4_en_process_tx_cq(struct ifnet *dev,
struct mlx4_en_cq *cq)
{
- struct mlx4_en_priv *priv = netdev_priv(dev);
+ struct mlx4_en_priv *priv = mlx4_netdev_priv(dev);
struct mlx4_cq *mcq = &cq->mcq;
struct mlx4_en_tx_ring *ring = priv->tx_ring[cq->ring];
struct mlx4_cqe *cqe;
@@ -423,7 +423,7 @@
void mlx4_en_tx_irq(struct mlx4_cq *mcq)
{
struct mlx4_en_cq *cq = container_of(mcq, struct mlx4_en_cq, mcq);
- struct mlx4_en_priv *priv = netdev_priv(cq->dev);
+ struct mlx4_en_priv *priv = mlx4_netdev_priv(cq->dev);
struct mlx4_en_tx_ring *ring = priv->tx_ring[cq->ring];
if (priv->port_up == 0 || !spin_trylock(&ring->comp_lock))
@@ -436,7 +436,7 @@
void mlx4_en_poll_tx_cq(unsigned long data)
{
struct mlx4_en_cq *cq = (struct mlx4_en_cq *) data;
- struct mlx4_en_priv *priv = netdev_priv(cq->dev);
+ struct mlx4_en_priv *priv = mlx4_netdev_priv(cq->dev);
struct mlx4_en_tx_ring *ring = priv->tx_ring[cq->ring];
u32 inflight;
@@ -606,7 +606,7 @@
u16 mlx4_en_select_queue(struct ifnet *dev, struct mbuf *mb)
{
- struct mlx4_en_priv *priv = netdev_priv(dev);
+ struct mlx4_en_priv *priv = mlx4_netdev_priv(dev);
u32 rings_p_up = priv->num_tx_rings_p_up;
u32 up = 0;
u32 queue_index;
@@ -929,7 +929,7 @@
static int
mlx4_en_transmit_locked(struct ifnet *ifp, int tx_ind, struct mbuf *mb)
{
- struct mlx4_en_priv *priv = netdev_priv(ifp);
+ struct mlx4_en_priv *priv = mlx4_netdev_priv(ifp);
struct mlx4_en_tx_ring *ring = priv->tx_ring[tx_ind];
int err = 0;
@@ -954,7 +954,7 @@
int
mlx4_en_transmit(struct ifnet *dev, struct mbuf *m)
{
- struct mlx4_en_priv *priv = netdev_priv(dev);
+ struct mlx4_en_priv *priv = mlx4_netdev_priv(dev);
struct mlx4_en_tx_ring *ring;
int i, err = 0;
@@ -994,7 +994,7 @@
void
mlx4_en_qflush(struct ifnet *dev)
{
- struct mlx4_en_priv *priv = netdev_priv(dev);
+ struct mlx4_en_priv *priv = mlx4_netdev_priv(dev);
if (priv->port_up == 0)
return;
diff --git a/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.c b/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.c
--- a/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.c
+++ b/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.c
@@ -148,7 +148,7 @@
if (upper) {
struct ifnet *active;
- active = bond_option_active_slave_get_rcu(netdev_priv(upper));
+ active = bond_option_active_slave_get_rcu(mlx4_netdev_priv(upper));
if (active)
dev = active;
}

File Metadata

Mime Type
text/plain
Expires
Wed, Nov 20, 7:23 AM (21 h, 47 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14732939
Default Alt Text
D32640.diff (11 KB)

Event Timeline