Commit 161de2ca authored by xypron.glpk@gmx.de's avatar xypron.glpk@gmx.de Committed by David S. Miller

net: thunderx: avoid exposing kernel stack

Reserved fields should be set to zero to avoid exposing
bits from the kernel stack.
Signed-off-by: default avatarHeinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 79e48650
...@@ -533,6 +533,7 @@ static void nicvf_rcv_queue_config(struct nicvf *nic, struct queue_set *qs, ...@@ -533,6 +533,7 @@ static void nicvf_rcv_queue_config(struct nicvf *nic, struct queue_set *qs,
nicvf_config_vlan_stripping(nic, nic->netdev->features); nicvf_config_vlan_stripping(nic, nic->netdev->features);
/* Enable Receive queue */ /* Enable Receive queue */
memset(&rq_cfg, 0, sizeof(struct rq_cfg));
rq_cfg.ena = 1; rq_cfg.ena = 1;
rq_cfg.tcp_ena = 0; rq_cfg.tcp_ena = 0;
nicvf_queue_reg_write(nic, NIC_QSET_RQ_0_7_CFG, qidx, *(u64 *)&rq_cfg); nicvf_queue_reg_write(nic, NIC_QSET_RQ_0_7_CFG, qidx, *(u64 *)&rq_cfg);
...@@ -565,6 +566,7 @@ void nicvf_cmp_queue_config(struct nicvf *nic, struct queue_set *qs, ...@@ -565,6 +566,7 @@ void nicvf_cmp_queue_config(struct nicvf *nic, struct queue_set *qs,
qidx, (u64)(cq->dmem.phys_base)); qidx, (u64)(cq->dmem.phys_base));
/* Enable Completion queue */ /* Enable Completion queue */
memset(&cq_cfg, 0, sizeof(struct cq_cfg));
cq_cfg.ena = 1; cq_cfg.ena = 1;
cq_cfg.reset = 0; cq_cfg.reset = 0;
cq_cfg.caching = 0; cq_cfg.caching = 0;
...@@ -613,6 +615,7 @@ static void nicvf_snd_queue_config(struct nicvf *nic, struct queue_set *qs, ...@@ -613,6 +615,7 @@ static void nicvf_snd_queue_config(struct nicvf *nic, struct queue_set *qs,
qidx, (u64)(sq->dmem.phys_base)); qidx, (u64)(sq->dmem.phys_base));
/* Enable send queue & set queue size */ /* Enable send queue & set queue size */
memset(&sq_cfg, 0, sizeof(struct sq_cfg));
sq_cfg.ena = 1; sq_cfg.ena = 1;
sq_cfg.reset = 0; sq_cfg.reset = 0;
sq_cfg.ldwb = 0; sq_cfg.ldwb = 0;
...@@ -649,6 +652,7 @@ static void nicvf_rbdr_config(struct nicvf *nic, struct queue_set *qs, ...@@ -649,6 +652,7 @@ static void nicvf_rbdr_config(struct nicvf *nic, struct queue_set *qs,
/* Enable RBDR & set queue size */ /* Enable RBDR & set queue size */
/* Buffer size should be in multiples of 128 bytes */ /* Buffer size should be in multiples of 128 bytes */
memset(&rbdr_cfg, 0, sizeof(struct rbdr_cfg));
rbdr_cfg.ena = 1; rbdr_cfg.ena = 1;
rbdr_cfg.reset = 0; rbdr_cfg.reset = 0;
rbdr_cfg.ldwb = 0; rbdr_cfg.ldwb = 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