From 59b44ea8aa56cec1c6b29019bf00b1f9474a9c51 Mon Sep 17 00:00:00 2001 From: Yevhen Orlov Date: Sat, 1 Oct 2022 12:34:13 +0300 Subject: [PATCH] net: marvell: prestera: Add length macros for prestera_ip_addr Add macros to determine IP address length (internal driver types). This will be used in next patches for nexthops logic. Co-developed-by: Taras Chornyi Signed-off-by: Taras Chornyi Co-developed-by: Oleksandr Mazur Signed-off-by: Oleksandr Mazur Signed-off-by: Yevhen Orlov Signed-off-by: Jakub Kicinski --- drivers/net/ethernet/marvell/prestera/prestera_router_hw.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/ethernet/marvell/prestera/prestera_router_hw.h b/drivers/net/ethernet/marvell/prestera/prestera_router_hw.h index 43bad23f38ec..9ca97919c863 100644 --- a/drivers/net/ethernet/marvell/prestera/prestera_router_hw.h +++ b/drivers/net/ethernet/marvell/prestera/prestera_router_hw.h @@ -31,6 +31,8 @@ struct prestera_ip_addr { PRESTERA_IPV4 = 0, PRESTERA_IPV6 } v; +#define PRESTERA_IP_ADDR_PLEN(V) ((V) == PRESTERA_IPV4 ? 32 : \ + /* (V) == PRESTERA_IPV6 ? */ 128 /* : 0 */) }; struct prestera_nh_neigh_key {