rte_lpm6: fix incorrect size of tbl8 group

Message ID f95173f8077f000d11b6881d9ebf6c88@therouter.net (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series rte_lpm6: fix incorrect size of tbl8 group |

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/Intel-compilation fail apply issues

Commit Message

Alex Kiselev April 8, 2020, 1:07 p.m. UTC
  rte_lpm6: fix incorrect size of tbl8 group
Fixes: e480688dce6d ("lpm6: add incremental update on delete")

Signed-off-by: Alex Kiselev <alex@therouter.net>
---
  lib/librte_lpm/rte_lpm6.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)

  			 *   save the reference to the owner table
--
2.16.1
  

Comments

Bruce Richardson April 8, 2020, 1:11 p.m. UTC | #1
On Wed, Apr 08, 2020 at 03:07:30PM +0200, Alex Kiselev wrote:
> rte_lpm6: fix incorrect size of tbl8 group
> Fixes: e480688dce6d ("lpm6: add incremental update on delete")
> 
> Signed-off-by: Alex Kiselev <alex@therouter.net>
> ---
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
  
Kevin Traynor April 8, 2020, 1:38 p.m. UTC | #2
On 08/04/2020 14:07, Alex Kiselev wrote:
> rte_lpm6: fix incorrect size of tbl8 group
> Fixes: e480688dce6d ("lpm6: add incremental update on delete")

Cc: stable@dpdk.org

Thanks for Cc'ing stable. It is better to add the tag directly in the
commit message as we automate checking for the tag in dpdk master commit
messages to indicate it is requested for backport. Probably maintainer
can add on commit..

> 
> Signed-off-by: Alex Kiselev <alex@therouter.net>
> ---
>   lib/librte_lpm/rte_lpm6.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/librte_lpm/rte_lpm6.c b/lib/librte_lpm/rte_lpm6.c
> index 1047efa8a..f5979fb15 100644
> --- a/lib/librte_lpm/rte_lpm6.c
> +++ b/lib/librte_lpm/rte_lpm6.c
> @@ -726,7 +726,8 @@ add_step(struct rte_lpm6 *lpm, struct 
> rte_lpm6_tbl_entry *tbl,
>   			tbl8_group_start = tbl8_gindex *
>   					RTE_LPM6_TBL8_GROUP_NUM_ENTRIES;
>   			memset(&lpm->tbl8[tbl8_group_start], 0,
> -					  RTE_LPM6_TBL8_GROUP_NUM_ENTRIES);
> +					RTE_LPM6_TBL8_GROUP_NUM_ENTRIES *
> +					sizeof(struct rte_lpm6_tbl_entry));
> 
>   			/* init the new table's header:
>   			 *   save the reference to the owner table
> --
> 2.16.1
>
  
Thomas Monjalon April 24, 2020, 5:09 p.m. UTC | #3
08/04/2020 15:11, Bruce Richardson:
> On Wed, Apr 08, 2020 at 03:07:30PM +0200, Alex Kiselev wrote:
> > rte_lpm6: fix incorrect size of tbl8 group
> > Fixes: e480688dce6d ("lpm6: add incremental update on delete")
> > 
> > Signed-off-by: Alex Kiselev <alex@therouter.net>
> > ---
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>

Applied, thanks
  

Patch

diff --git a/lib/librte_lpm/rte_lpm6.c b/lib/librte_lpm/rte_lpm6.c
index 1047efa8a..f5979fb15 100644
--- a/lib/librte_lpm/rte_lpm6.c
+++ b/lib/librte_lpm/rte_lpm6.c
@@ -726,7 +726,8 @@  add_step(struct rte_lpm6 *lpm, struct 
rte_lpm6_tbl_entry *tbl,
  			tbl8_group_start = tbl8_gindex *
  					RTE_LPM6_TBL8_GROUP_NUM_ENTRIES;
  			memset(&lpm->tbl8[tbl8_group_start], 0,
-					  RTE_LPM6_TBL8_GROUP_NUM_ENTRIES);
+					RTE_LPM6_TBL8_GROUP_NUM_ENTRIES *
+					sizeof(struct rte_lpm6_tbl_entry));

  			/* init the new table's header: