Skip to content

Commit b78a6aa

Browse files
Zhu Yanjundavem330
authored andcommitted
forcedeth: optimize the xmit with unlikely
In xmit, it is very impossible that TX_ERROR occurs. So using unlikely optimizes the xmit process. 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 d750dbd commit b78a6aa

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/net/ethernet/nvidia/forcedeth.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2563,7 +2563,7 @@ static int nv_tx_done(struct net_device *dev, int limit)
25632563

25642564
if (np->desc_ver == DESC_VER_1) {
25652565
if (flags & NV_TX_LASTPACKET) {
2566-
if (flags & NV_TX_ERROR) {
2566+
if (unlikely(flags & NV_TX_ERROR)) {
25672567
if ((flags & NV_TX_RETRYERROR)
25682568
&& !(flags & NV_TX_RETRYCOUNT_MASK))
25692569
nv_legacybackoff_reseed(dev);
@@ -2580,7 +2580,7 @@ static int nv_tx_done(struct net_device *dev, int limit)
25802580
}
25812581
} else {
25822582
if (flags & NV_TX2_LASTPACKET) {
2583-
if (flags & NV_TX2_ERROR) {
2583+
if (unlikely(flags & NV_TX2_ERROR)) {
25842584
if ((flags & NV_TX2_RETRYERROR)
25852585
&& !(flags & NV_TX2_RETRYCOUNT_MASK))
25862586
nv_legacybackoff_reseed(dev);
@@ -2626,7 +2626,7 @@ static int nv_tx_done_optimized(struct net_device *dev, int limit)
26262626
nv_unmap_txskb(np, np->get_tx_ctx);
26272627

26282628
if (flags & NV_TX2_LASTPACKET) {
2629-
if (flags & NV_TX2_ERROR) {
2629+
if (unlikely(flags & NV_TX2_ERROR)) {
26302630
if ((flags & NV_TX2_RETRYERROR)
26312631
&& !(flags & NV_TX2_RETRYCOUNT_MASK)) {
26322632
if (np->driver_data & DEV_HAS_GEAR_MODE)

0 commit comments

Comments
 (0)