Commit b30cfd24 authored by Iyappan Subramanian's avatar Iyappan Subramanian Committed by David S. Miller

drivers: net: xgene: fix IPv4 forward crash

This patch fixes the crash observed during IPv4 forward test by
setting the drop field in the dbptr.
Signed-off-by: default avatarIyappan Subramanian <isubramanian@apm.com>
Tested-by: default avatarToan Le <toanle@apm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 72eec92a
...@@ -43,6 +43,7 @@ static void xgene_cle_idt_to_hw(u32 dstqid, u32 fpsel, ...@@ -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, static void xgene_cle_dbptr_to_hw(struct xgene_enet_pdata *pdata,
struct xgene_cle_dbptr *dbptr, u32 *buf) struct xgene_cle_dbptr *dbptr, u32 *buf)
{ {
buf[0] = SET_VAL(CLE_DROP, dbptr->drop);
buf[4] = SET_VAL(CLE_FPSEL, dbptr->fpsel) | buf[4] = SET_VAL(CLE_FPSEL, dbptr->fpsel) |
SET_VAL(CLE_DSTQIDL, dbptr->dstqid); SET_VAL(CLE_DSTQIDL, dbptr->dstqid);
...@@ -412,7 +413,7 @@ static int xgene_enet_cle_init(struct xgene_enet_pdata *pdata) ...@@ -412,7 +413,7 @@ static int xgene_enet_cle_init(struct xgene_enet_pdata *pdata)
.branch = { .branch = {
{ {
/* IPV4 */ /* IPV4 */
.valid = 0, .valid = 1,
.next_packet_pointer = 22, .next_packet_pointer = 22,
.jump_bw = JMP_FW, .jump_bw = JMP_FW,
.jump_rel = JMP_ABS, .jump_rel = JMP_ABS,
...@@ -420,7 +421,7 @@ static int xgene_enet_cle_init(struct xgene_enet_pdata *pdata) ...@@ -420,7 +421,7 @@ static int xgene_enet_cle_init(struct xgene_enet_pdata *pdata)
.next_node = PKT_PROT_NODE, .next_node = PKT_PROT_NODE,
.next_branch = 0, .next_branch = 0,
.data = 0x8, .data = 0x8,
.mask = 0xffff .mask = 0x0
}, },
{ {
.valid = 0, .valid = 0,
...@@ -456,7 +457,7 @@ static int xgene_enet_cle_init(struct xgene_enet_pdata *pdata) ...@@ -456,7 +457,7 @@ static int xgene_enet_cle_init(struct xgene_enet_pdata *pdata)
.next_node = RSS_IPV4_TCP_NODE, .next_node = RSS_IPV4_TCP_NODE,
.next_branch = 0, .next_branch = 0,
.data = 0x0600, .data = 0x0600,
.mask = 0xffff .mask = 0x00ff
}, },
{ {
/* UDP */ /* UDP */
...@@ -468,7 +469,7 @@ static int xgene_enet_cle_init(struct xgene_enet_pdata *pdata) ...@@ -468,7 +469,7 @@ static int xgene_enet_cle_init(struct xgene_enet_pdata *pdata)
.next_node = RSS_IPV4_UDP_NODE, .next_node = RSS_IPV4_UDP_NODE,
.next_branch = 0, .next_branch = 0,
.data = 0x1100, .data = 0x1100,
.mask = 0xffff .mask = 0x00ff
}, },
{ {
.valid = 0, .valid = 0,
...@@ -642,7 +643,7 @@ static int xgene_enet_cle_init(struct xgene_enet_pdata *pdata) ...@@ -642,7 +643,7 @@ static int xgene_enet_cle_init(struct xgene_enet_pdata *pdata)
{ {
/* TCP DST Port */ /* TCP DST Port */
.valid = 0, .valid = 0,
.next_packet_pointer = 256, .next_packet_pointer = 258,
.jump_bw = JMP_FW, .jump_bw = JMP_FW,
.jump_rel = JMP_ABS, .jump_rel = JMP_ABS,
.operation = EQT, .operation = EQT,
......
...@@ -83,6 +83,8 @@ ...@@ -83,6 +83,8 @@
#define CLE_TYPE_POS 0 #define CLE_TYPE_POS 0
#define CLE_TYPE_LEN 2 #define CLE_TYPE_LEN 2
#define CLE_DROP_POS 28
#define CLE_DROP_LEN 1
#define CLE_DSTQIDL_POS 25 #define CLE_DSTQIDL_POS 25
#define CLE_DSTQIDL_LEN 7 #define CLE_DSTQIDL_LEN 7
#define CLE_DSTQIDH_POS 0 #define CLE_DSTQIDH_POS 0
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment