Skip to content

Commit

Permalink
drivers: net: xgene: fix IPv4 forward crash
Browse files Browse the repository at this point in the history
This patch fixes the crash observed during IPv4 forward test by
setting the drop field in the dbptr.

Signed-off-by: Iyappan Subramanian <[email protected]>
Tested-by: Toan Le <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
isubrama authored and davem330 committed May 14, 2016
1 parent 72eec92 commit b30cfd2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 6 additions & 5 deletions drivers/net/ethernet/apm/xgene/xgene_enet_cle.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ static void xgene_cle_idt_to_hw(u32 dstqid, u32 fpsel,
static void xgene_cle_dbptr_to_hw(struct xgene_enet_pdata *pdata,
struct xgene_cle_dbptr *dbptr, u32 *buf)
{
buf[0] = SET_VAL(CLE_DROP, dbptr->drop);
buf[4] = SET_VAL(CLE_FPSEL, dbptr->fpsel) |
SET_VAL(CLE_DSTQIDL, dbptr->dstqid);

Expand Down Expand Up @@ -412,15 +413,15 @@ static int xgene_enet_cle_init(struct xgene_enet_pdata *pdata)
.branch = {
{
/* IPV4 */
.valid = 0,
.valid = 1,
.next_packet_pointer = 22,
.jump_bw = JMP_FW,
.jump_rel = JMP_ABS,
.operation = EQT,
.next_node = PKT_PROT_NODE,
.next_branch = 0,
.data = 0x8,
.mask = 0xffff
.mask = 0x0
},
{
.valid = 0,
Expand Down Expand Up @@ -456,7 +457,7 @@ static int xgene_enet_cle_init(struct xgene_enet_pdata *pdata)
.next_node = RSS_IPV4_TCP_NODE,
.next_branch = 0,
.data = 0x0600,
.mask = 0xffff
.mask = 0x00ff
},
{
/* UDP */
Expand All @@ -468,7 +469,7 @@ static int xgene_enet_cle_init(struct xgene_enet_pdata *pdata)
.next_node = RSS_IPV4_UDP_NODE,
.next_branch = 0,
.data = 0x1100,
.mask = 0xffff
.mask = 0x00ff
},
{
.valid = 0,
Expand Down Expand Up @@ -642,7 +643,7 @@ static int xgene_enet_cle_init(struct xgene_enet_pdata *pdata)
{
/* TCP DST Port */
.valid = 0,
.next_packet_pointer = 256,
.next_packet_pointer = 258,
.jump_bw = JMP_FW,
.jump_rel = JMP_ABS,
.operation = EQT,
Expand Down
2 changes: 2 additions & 0 deletions drivers/net/ethernet/apm/xgene/xgene_enet_cle.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@
#define CLE_TYPE_POS 0
#define CLE_TYPE_LEN 2

#define CLE_DROP_POS 28
#define CLE_DROP_LEN 1
#define CLE_DSTQIDL_POS 25
#define CLE_DSTQIDL_LEN 7
#define CLE_DSTQIDH_POS 0
Expand Down

0 comments on commit b30cfd2

Please sign in to comment.