Skip to content

Commit a9124ec

Browse files
Zhu Yanjundavem330
authored andcommitted
forcedeth: remove duplicate structure member in rx
Since both first_rx_ctx and rx_skb are the head of rx ctx, it not necessary to use two structure members to statically indicate the head of rx ctx. So first_rx_ctx is removed. CC: Srinivas Eeda <[email protected]> CC: Joe Jin <[email protected]> CC: Junxiao Bi <[email protected]> Signed-off-by: Zhu Yanjun <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent d766327 commit a9124ec

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

drivers/net/ethernet/nvidia/forcedeth.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -795,7 +795,7 @@ struct fe_priv {
795795
*/
796796
union ring_type get_rx, put_rx, last_rx;
797797
struct nv_skb_map *get_rx_ctx, *put_rx_ctx;
798-
struct nv_skb_map *first_rx_ctx, *last_rx_ctx;
798+
struct nv_skb_map *last_rx_ctx;
799799
struct nv_skb_map *rx_skb;
800800

801801
union ring_type rx_ring;
@@ -1835,7 +1835,7 @@ static int nv_alloc_rx(struct net_device *dev)
18351835
if (unlikely(np->put_rx.orig++ == np->last_rx.orig))
18361836
np->put_rx.orig = np->rx_ring.orig;
18371837
if (unlikely(np->put_rx_ctx++ == np->last_rx_ctx))
1838-
np->put_rx_ctx = np->first_rx_ctx;
1838+
np->put_rx_ctx = np->rx_skb;
18391839
} else {
18401840
packet_dropped:
18411841
u64_stats_update_begin(&np->swstats_rx_syncp);
@@ -1877,7 +1877,7 @@ static int nv_alloc_rx_optimized(struct net_device *dev)
18771877
if (unlikely(np->put_rx.ex++ == np->last_rx.ex))
18781878
np->put_rx.ex = np->rx_ring.ex;
18791879
if (unlikely(np->put_rx_ctx++ == np->last_rx_ctx))
1880-
np->put_rx_ctx = np->first_rx_ctx;
1880+
np->put_rx_ctx = np->rx_skb;
18811881
} else {
18821882
packet_dropped:
18831883
u64_stats_update_begin(&np->swstats_rx_syncp);
@@ -1910,7 +1910,8 @@ static void nv_init_rx(struct net_device *dev)
19101910
np->last_rx.orig = &np->rx_ring.orig[np->rx_ring_size-1];
19111911
else
19121912
np->last_rx.ex = &np->rx_ring.ex[np->rx_ring_size-1];
1913-
np->get_rx_ctx = np->put_rx_ctx = np->first_rx_ctx = np->rx_skb;
1913+
np->get_rx_ctx = np->rx_skb;
1914+
np->put_rx_ctx = np->rx_skb;
19141915
np->last_rx_ctx = &np->rx_skb[np->rx_ring_size-1];
19151916

19161917
for (i = 0; i < np->rx_ring_size; i++) {
@@ -2914,7 +2915,7 @@ static int nv_rx_process(struct net_device *dev, int limit)
29142915
if (unlikely(np->get_rx.orig++ == np->last_rx.orig))
29152916
np->get_rx.orig = np->rx_ring.orig;
29162917
if (unlikely(np->get_rx_ctx++ == np->last_rx_ctx))
2917-
np->get_rx_ctx = np->first_rx_ctx;
2918+
np->get_rx_ctx = np->rx_skb;
29182919

29192920
rx_work++;
29202921
}
@@ -3003,7 +3004,7 @@ static int nv_rx_process_optimized(struct net_device *dev, int limit)
30033004
if (unlikely(np->get_rx.ex++ == np->last_rx.ex))
30043005
np->get_rx.ex = np->rx_ring.ex;
30053006
if (unlikely(np->get_rx_ctx++ == np->last_rx_ctx))
3006-
np->get_rx_ctx = np->first_rx_ctx;
3007+
np->get_rx_ctx = np->rx_skb;
30073008

30083009
rx_work++;
30093010
}

0 commit comments

Comments
 (0)