Commit c360f2b5 authored by Zhu Yanjun's avatar Zhu Yanjun Committed by David S. Miller

forcedeth: remove unnecessary structure member

Since both tx_ring and first_tx are the head of tx ring, it not
necessary to use two structure members to statically indicate
the head of tx ring. So first_tx is removed.

CC: Srinivas Eeda <srinivas.eeda@oracle.com>
CC: Joe Jin <joe.jin@oracle.com>
CC: Junxiao Bi <junxiao.bi@oracle.com>
Signed-off-by: default avatarZhu Yanjun <yanjun.zhu@oracle.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 23202e09
...@@ -822,7 +822,7 @@ struct fe_priv { ...@@ -822,7 +822,7 @@ struct fe_priv {
/* /*
* tx specific fields. * tx specific fields.
*/ */
union ring_type get_tx, put_tx, first_tx, last_tx; union ring_type get_tx, put_tx, last_tx;
struct nv_skb_map *get_tx_ctx, *put_tx_ctx; struct nv_skb_map *get_tx_ctx, *put_tx_ctx;
struct nv_skb_map *first_tx_ctx, *last_tx_ctx; struct nv_skb_map *first_tx_ctx, *last_tx_ctx;
struct nv_skb_map *tx_skb; struct nv_skb_map *tx_skb;
...@@ -1932,7 +1932,8 @@ static void nv_init_tx(struct net_device *dev) ...@@ -1932,7 +1932,8 @@ static void nv_init_tx(struct net_device *dev)
struct fe_priv *np = netdev_priv(dev); struct fe_priv *np = netdev_priv(dev);
int i; int i;
np->get_tx = np->put_tx = np->first_tx = np->tx_ring; np->get_tx = np->tx_ring;
np->put_tx = np->tx_ring;
if (!nv_optimized(np)) if (!nv_optimized(np))
np->last_tx.orig = &np->tx_ring.orig[np->tx_ring_size-1]; np->last_tx.orig = &np->tx_ring.orig[np->tx_ring_size-1];
...@@ -2248,7 +2249,7 @@ static netdev_tx_t nv_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -2248,7 +2249,7 @@ static netdev_tx_t nv_start_xmit(struct sk_buff *skb, struct net_device *dev)
offset += bcnt; offset += bcnt;
size -= bcnt; size -= bcnt;
if (unlikely(put_tx++ == np->last_tx.orig)) if (unlikely(put_tx++ == np->last_tx.orig))
put_tx = np->first_tx.orig; put_tx = np->tx_ring.orig;
if (unlikely(np->put_tx_ctx++ == np->last_tx_ctx)) if (unlikely(np->put_tx_ctx++ == np->last_tx_ctx))
np->put_tx_ctx = np->first_tx_ctx; np->put_tx_ctx = np->first_tx_ctx;
} while (size); } while (size);
...@@ -2294,13 +2295,13 @@ static netdev_tx_t nv_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -2294,13 +2295,13 @@ static netdev_tx_t nv_start_xmit(struct sk_buff *skb, struct net_device *dev)
offset += bcnt; offset += bcnt;
frag_size -= bcnt; frag_size -= bcnt;
if (unlikely(put_tx++ == np->last_tx.orig)) if (unlikely(put_tx++ == np->last_tx.orig))
put_tx = np->first_tx.orig; put_tx = np->tx_ring.orig;
if (unlikely(np->put_tx_ctx++ == np->last_tx_ctx)) if (unlikely(np->put_tx_ctx++ == np->last_tx_ctx))
np->put_tx_ctx = np->first_tx_ctx; np->put_tx_ctx = np->first_tx_ctx;
} while (frag_size); } while (frag_size);
} }
if (unlikely(put_tx == np->first_tx.orig)) if (unlikely(put_tx == np->tx_ring.orig))
prev_tx = np->last_tx.orig; prev_tx = np->last_tx.orig;
else else
prev_tx = put_tx - 1; prev_tx = put_tx - 1;
...@@ -2406,7 +2407,7 @@ static netdev_tx_t nv_start_xmit_optimized(struct sk_buff *skb, ...@@ -2406,7 +2407,7 @@ static netdev_tx_t nv_start_xmit_optimized(struct sk_buff *skb,
offset += bcnt; offset += bcnt;
size -= bcnt; size -= bcnt;
if (unlikely(put_tx++ == np->last_tx.ex)) if (unlikely(put_tx++ == np->last_tx.ex))
put_tx = np->first_tx.ex; put_tx = np->tx_ring.ex;
if (unlikely(np->put_tx_ctx++ == np->last_tx_ctx)) if (unlikely(np->put_tx_ctx++ == np->last_tx_ctx))
np->put_tx_ctx = np->first_tx_ctx; np->put_tx_ctx = np->first_tx_ctx;
} while (size); } while (size);
...@@ -2452,13 +2453,13 @@ static netdev_tx_t nv_start_xmit_optimized(struct sk_buff *skb, ...@@ -2452,13 +2453,13 @@ static netdev_tx_t nv_start_xmit_optimized(struct sk_buff *skb,
offset += bcnt; offset += bcnt;
frag_size -= bcnt; frag_size -= bcnt;
if (unlikely(put_tx++ == np->last_tx.ex)) if (unlikely(put_tx++ == np->last_tx.ex))
put_tx = np->first_tx.ex; put_tx = np->tx_ring.ex;
if (unlikely(np->put_tx_ctx++ == np->last_tx_ctx)) if (unlikely(np->put_tx_ctx++ == np->last_tx_ctx))
np->put_tx_ctx = np->first_tx_ctx; np->put_tx_ctx = np->first_tx_ctx;
} while (frag_size); } while (frag_size);
} }
if (unlikely(put_tx == np->first_tx.ex)) if (unlikely(put_tx == np->tx_ring.ex))
prev_tx = np->last_tx.ex; prev_tx = np->last_tx.ex;
else else
prev_tx = put_tx - 1; prev_tx = put_tx - 1;
...@@ -2597,7 +2598,7 @@ static int nv_tx_done(struct net_device *dev, int limit) ...@@ -2597,7 +2598,7 @@ static int nv_tx_done(struct net_device *dev, int limit)
} }
} }
if (unlikely(np->get_tx.orig++ == np->last_tx.orig)) if (unlikely(np->get_tx.orig++ == np->last_tx.orig))
np->get_tx.orig = np->first_tx.orig; np->get_tx.orig = np->tx_ring.orig;
if (unlikely(np->get_tx_ctx++ == np->last_tx_ctx)) if (unlikely(np->get_tx_ctx++ == np->last_tx_ctx))
np->get_tx_ctx = np->first_tx_ctx; np->get_tx_ctx = np->first_tx_ctx;
} }
...@@ -2651,7 +2652,7 @@ static int nv_tx_done_optimized(struct net_device *dev, int limit) ...@@ -2651,7 +2652,7 @@ static int nv_tx_done_optimized(struct net_device *dev, int limit)
} }
if (unlikely(np->get_tx.ex++ == np->last_tx.ex)) if (unlikely(np->get_tx.ex++ == np->last_tx.ex))
np->get_tx.ex = np->first_tx.ex; np->get_tx.ex = np->tx_ring.ex;
if (unlikely(np->get_tx_ctx++ == np->last_tx_ctx)) if (unlikely(np->get_tx_ctx++ == np->last_tx_ctx))
np->get_tx_ctx = np->first_tx_ctx; np->get_tx_ctx = np->first_tx_ctx;
} }
......
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