mirror of https://gitee.com/openkylin/linux.git
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 <srinivas.eeda@oracle.com> CC: Joe Jin <joe.jin@oracle.com> CC: Junxiao Bi <junxiao.bi@oracle.com> Signed-off-by: Zhu Yanjun <yanjun.zhu@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
d750dbdc07
commit
b78a6aa387
|
@ -2563,7 +2563,7 @@ static int nv_tx_done(struct net_device *dev, int limit)
|
||||||
|
|
||||||
if (np->desc_ver == DESC_VER_1) {
|
if (np->desc_ver == DESC_VER_1) {
|
||||||
if (flags & NV_TX_LASTPACKET) {
|
if (flags & NV_TX_LASTPACKET) {
|
||||||
if (flags & NV_TX_ERROR) {
|
if (unlikely(flags & NV_TX_ERROR)) {
|
||||||
if ((flags & NV_TX_RETRYERROR)
|
if ((flags & NV_TX_RETRYERROR)
|
||||||
&& !(flags & NV_TX_RETRYCOUNT_MASK))
|
&& !(flags & NV_TX_RETRYCOUNT_MASK))
|
||||||
nv_legacybackoff_reseed(dev);
|
nv_legacybackoff_reseed(dev);
|
||||||
|
@ -2580,7 +2580,7 @@ static int nv_tx_done(struct net_device *dev, int limit)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (flags & NV_TX2_LASTPACKET) {
|
if (flags & NV_TX2_LASTPACKET) {
|
||||||
if (flags & NV_TX2_ERROR) {
|
if (unlikely(flags & NV_TX2_ERROR)) {
|
||||||
if ((flags & NV_TX2_RETRYERROR)
|
if ((flags & NV_TX2_RETRYERROR)
|
||||||
&& !(flags & NV_TX2_RETRYCOUNT_MASK))
|
&& !(flags & NV_TX2_RETRYCOUNT_MASK))
|
||||||
nv_legacybackoff_reseed(dev);
|
nv_legacybackoff_reseed(dev);
|
||||||
|
@ -2626,7 +2626,7 @@ static int nv_tx_done_optimized(struct net_device *dev, int limit)
|
||||||
nv_unmap_txskb(np, np->get_tx_ctx);
|
nv_unmap_txskb(np, np->get_tx_ctx);
|
||||||
|
|
||||||
if (flags & NV_TX2_LASTPACKET) {
|
if (flags & NV_TX2_LASTPACKET) {
|
||||||
if (flags & NV_TX2_ERROR) {
|
if (unlikely(flags & NV_TX2_ERROR)) {
|
||||||
if ((flags & NV_TX2_RETRYERROR)
|
if ((flags & NV_TX2_RETRYERROR)
|
||||||
&& !(flags & NV_TX2_RETRYCOUNT_MASK)) {
|
&& !(flags & NV_TX2_RETRYCOUNT_MASK)) {
|
||||||
if (np->driver_data & DEV_HAS_GEAR_MODE)
|
if (np->driver_data & DEV_HAS_GEAR_MODE)
|
||||||
|
|
Loading…
Reference in New Issue