Skip to content

Commit

Permalink
applied 0042-net-next-mediatek-honour-special-tag-bit-inside-RX-D.patch
Browse files Browse the repository at this point in the history
  • Loading branch information
frank-w committed Feb 14, 2018
1 parent c76803f commit 44360bb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
14 changes: 10 additions & 4 deletions drivers/net/ethernet/mediatek/mtk_eth_soc.c
Expand Up @@ -1003,10 +1003,16 @@ static int mtk_poll_rx(struct napi_struct *napi, int budget,
if (!(trxd.rxd2 & RX_DMA_DONE))
break;

/* find out which mac the packet come from. values start at 1 */
mac = (trxd.rxd4 >> RX_DMA_FPORT_SHIFT) &
RX_DMA_FPORT_MASK;
mac--;
/* find out which mac the packet comes from. If the special tag is
* we can assume that the traffic is coming from the builtin mt7530
* and the DSA driver has loaded. FPORT will be the physical switch
* port in this case rather than the FE forward port id. */
if (!(trxd.rxd4 & RX_DMA_SP_TAG)) {
/* values start at 1 */
mac = (trxd.rxd4 >> RX_DMA_FPORT_SHIFT) &
RX_DMA_FPORT_MASK;
mac--;
}

if (unlikely(mac < 0 || mac >= MTK_MAC_COUNT ||
!eth->netdev[mac]))
Expand Down
1 change: 1 addition & 0 deletions drivers/net/ethernet/mediatek/mtk_eth_soc.h
Expand Up @@ -287,6 +287,7 @@

/* QDMA descriptor rxd4 */
#define RX_DMA_L4_VALID BIT(24)
#define RX_DMA_SP_TAG BIT(22)
#define RX_DMA_FPORT_SHIFT 19
#define RX_DMA_FPORT_MASK 0x7

Expand Down

0 comments on commit 44360bb

Please sign in to comment.