[PATCH v2] lib: Update ce-mask to uint64_t
David Ahern
dsa at cumulusnetworks.com
Mon Jan 25 16:10:28 PST 2016
Hi Thomas:
Any comment on v2?
On 12/18/15 10:50 AM, David Ahern wrote:
> lib/route/link.c already defines 32 attributes which fills the current
> uint32_t used for ce_mask. To accommodate more attributes the mask needs
> to be expanded. This patch updates the definition to uint64_t.
>
> The nl_object_diff API is maintained for ABI with existing users. A new
> nl_object_diff64 API is added for the expanded attribute list. The MSB
> of the 32-bit API is used to indicate if higher order attributes had a
> mismatch. (Suggested by Thomas).
>
> Signed-off-by: David Ahern <dsa at cumulusnetworks.com>
> ---
> v2
> - Thomas' comments
> - kept existing nl_object_diff as 32-bit api with high bit indicating
> attribute mismatch in higher order bits
> - added nl_object_diff64 for 64-bit mask
>
> include/netlink-private/netlink.h | 2 +-
> include/netlink-private/object-api.h | 10 ++++++----
> include/netlink-private/route/tc-api.h | 4 ++--
> include/netlink/object.h | 2 ++
> lib/fib_lookup/lookup.c | 4 ++--
> lib/fib_lookup/request.c | 6 +++---
> lib/genl/family.c | 6 +++---
> lib/idiag/idiag_meminfo_obj.c | 4 ++--
> lib/idiag/idiag_msg_obj.c | 6 +++---
> lib/idiag/idiag_vegasinfo_obj.c | 4 ++--
> lib/netfilter/ct_obj.c | 6 +++---
> lib/netfilter/exp_obj.c | 6 +++---
> lib/netfilter/log_obj.c | 6 +++---
> lib/netfilter/queue_obj.c | 6 +++---
> lib/object.c | 29 +++++++++++++++++++++++++++--
> lib/route/addr.c | 6 +++---
> lib/route/link.c | 9 +++++----
> lib/route/neigh.c | 6 +++---
> lib/route/neightbl.c | 6 +++---
> lib/route/route_obj.c | 7 ++++---
> lib/route/rule.c | 6 +++---
> lib/route/tc.c | 6 +++---
> lib/xfrm/ae.c | 6 ++++--
> lib/xfrm/sa.c | 5 +++--
> lib/xfrm/sp.c | 5 +++--
> 25 files changed, 99 insertions(+), 64 deletions(-)
>
> diff --git a/include/netlink-private/netlink.h b/include/netlink-private/netlink.h
> index 6d40ea53c578..befd3014afcb 100644
> --- a/include/netlink-private/netlink.h
> +++ b/include/netlink-private/netlink.h
> @@ -71,7 +71,7 @@
> #define NSEC_PER_SEC 1000000000L
>
> struct trans_tbl {
> - int i;
> + uint64_t i;
> const char *a;
> };
>
> diff --git a/include/netlink-private/object-api.h b/include/netlink-private/object-api.h
> index f4fd71e576ec..517e6720f50c 100644
> --- a/include/netlink-private/object-api.h
> +++ b/include/netlink-private/object-api.h
> @@ -126,6 +126,8 @@ extern "C" {
> * #define MY_ATTR_FOO (1<<0)
> * #define MY_ATTR_BAR (1<<1)
> *
> + * // Bit 31 for attributes is reserved for 32-bit API.
> + *
> * // When assigning an optional attribute to the object, make sure
> * // to mark its availability.
> * my_obj->foo = 123123;
> @@ -189,7 +191,7 @@ extern "C" {
> struct nl_list_head ce_list; \
> int ce_msgtype; \
> int ce_flags; \
> - uint32_t ce_mask;
> + uint64_t ce_mask;
>
> struct nl_object
> {
> @@ -258,7 +260,7 @@ struct nl_object
> * @endcode
> */
> #define ATTR_DIFF(LIST, ATTR, A, B, EXPR) \
> -({ int diff = 0; \
> +({ uint64_t diff = 0; \
> if (((LIST) & (ATTR)) && ATTR_MISMATCH(A, B, ATTR, EXPR)) \
> diff = ATTR; \
> diff; })
> @@ -333,8 +335,8 @@ struct nl_object_ops
> * The function must return a bitmask with the relevant bit
> * set for each attribute that mismatches.
> */
> - int (*oo_compare)(struct nl_object *, struct nl_object *,
> - uint32_t, int);
> + uint64_t (*oo_compare)(struct nl_object *, struct nl_object *,
> + uint64_t, int);
>
>
> /**
> diff --git a/include/netlink-private/route/tc-api.h b/include/netlink-private/route/tc-api.h
> index fbfa2abd8fa2..7158ce5c117b 100644
> --- a/include/netlink-private/route/tc-api.h
> +++ b/include/netlink-private/route/tc-api.h
> @@ -110,9 +110,9 @@ extern void rtnl_tc_dump_details(struct nl_object *,
> struct nl_dump_params *);
> extern void rtnl_tc_dump_stats(struct nl_object *,
> struct nl_dump_params *);
> -extern int rtnl_tc_compare(struct nl_object *,
> +extern uint64_t rtnl_tc_compare(struct nl_object *,
> struct nl_object *,
> - uint32_t, int);
> + uint64_t, int);
>
> void * rtnl_tc_data_peek(struct rtnl_tc *tc);
> extern void * rtnl_tc_data(struct rtnl_tc *);
> diff --git a/include/netlink/object.h b/include/netlink/object.h
> index a95feda7b4db..b0c32c988b1f 100644
> --- a/include/netlink/object.h
> +++ b/include/netlink/object.h
> @@ -43,6 +43,8 @@ extern int nl_object_identical(struct nl_object *,
> struct nl_object *);
> extern uint32_t nl_object_diff(struct nl_object *,
> struct nl_object *);
> +extern uint64_t nl_object_diff64(struct nl_object *,
> + struct nl_object *);
> extern int nl_object_match_filter(struct nl_object *,
> struct nl_object *);
> extern char * nl_object_attrs2str(struct nl_object *,
> diff --git a/lib/fib_lookup/lookup.c b/lib/fib_lookup/lookup.c
> index 9b24635240d2..43b6126f376b 100644
> --- a/lib/fib_lookup/lookup.c
> +++ b/lib/fib_lookup/lookup.c
> @@ -141,8 +141,8 @@ static void result_dump_details(struct nl_object *obj, struct nl_dump_params *p)
> result_dump_line(obj, p);
> }
>
> -static int result_compare(struct nl_object *_a, struct nl_object *_b,
> - uint32_t attrs, int flags)
> +static uint64_t result_compare(struct nl_object *_a, struct nl_object *_b,
> + uint64_t attrs, int flags)
> {
> return 0;
> }
> diff --git a/lib/fib_lookup/request.c b/lib/fib_lookup/request.c
> index 1b021b64dba8..5bd49d6fd320 100644
> --- a/lib/fib_lookup/request.c
> +++ b/lib/fib_lookup/request.c
> @@ -53,12 +53,12 @@ static int request_clone(struct nl_object *_dst, struct nl_object *_src)
> return 0;
> }
>
> -static int request_compare(struct nl_object *_a, struct nl_object *_b,
> - uint32_t attrs, int flags)
> +static uint64_t request_compare(struct nl_object *_a, struct nl_object *_b,
> + uint64_t attrs, int flags)
> {
> struct flnl_request *a = (struct flnl_request *) _a;
> struct flnl_request *b = (struct flnl_request *) _b;
> - int diff = 0;
> + uint64_t diff = 0;
>
> #define REQ_DIFF(ATTR, EXPR) ATTR_DIFF(attrs, REQUEST_ATTR_##ATTR, a, b, EXPR)
>
> diff --git a/lib/genl/family.c b/lib/genl/family.c
> index 9155c8fda9a2..45c3d45e1b3e 100644
> --- a/lib/genl/family.c
> +++ b/lib/genl/family.c
> @@ -147,12 +147,12 @@ static void family_dump_stats(struct nl_object *obj, struct nl_dump_params *p)
> family_dump_details(obj, p);
> }
>
> -static int family_compare(struct nl_object *_a, struct nl_object *_b,
> - uint32_t attrs, int flags)
> +static uint64_t family_compare(struct nl_object *_a, struct nl_object *_b,
> + uint64_t attrs, int flags)
> {
> struct genl_family *a = (struct genl_family *) _a;
> struct genl_family *b = (struct genl_family *) _b;
> - int diff = 0;
> + uint64_t diff = 0;
>
> #define FAM_DIFF(ATTR, EXPR) ATTR_DIFF(attrs, FAMILY_ATTR_##ATTR, a, b, EXPR)
>
> diff --git a/lib/idiag/idiag_meminfo_obj.c b/lib/idiag/idiag_meminfo_obj.c
> index f07800fdb3c4..1c327bb37832 100644
> --- a/lib/idiag/idiag_meminfo_obj.c
> +++ b/lib/idiag/idiag_meminfo_obj.c
> @@ -81,8 +81,8 @@ void idiagnl_meminfo_set_tmem(struct idiagnl_meminfo *minfo, uint32_t tmem)
> /** @} */
>
> /** @cond SKIP */
> -static int idiagnl_meminfo_compare(struct nl_object *_a, struct nl_object *_b,
> - uint32_t attrs, int flags)
> +static uint64_t idiagnl_meminfo_compare(struct nl_object *_a, struct nl_object *_b,
> + uint64_t attrs, int flags)
> {
> struct idiagnl_meminfo *a = (struct idiagnl_meminfo *) _a;
> struct idiagnl_meminfo *b = (struct idiagnl_meminfo *) _b;
> diff --git a/lib/idiag/idiag_msg_obj.c b/lib/idiag/idiag_msg_obj.c
> index d7cf7222049e..beaa9cc49f27 100644
> --- a/lib/idiag/idiag_msg_obj.c
> +++ b/lib/idiag/idiag_msg_obj.c
> @@ -853,12 +853,12 @@ static char *_idiagnl_attrs2str(int attrs, char *buf, size_t len)
> ARRAY_SIZE(idiagnl_attrs));
> }
>
> -static int idiagnl_compare(struct nl_object *_a, struct nl_object *_b,
> - uint32_t attrs, int flags)
> +static uint64_t idiagnl_compare(struct nl_object *_a, struct nl_object *_b,
> + uint64_t attrs, int flags)
> {
> struct idiagnl_msg *a = (struct idiagnl_msg *) _a;
> struct idiagnl_msg *b = (struct idiagnl_msg *) _b;
> - int diff = 0;
> + uint64_t diff = 0;
>
> #define _DIFF(ATTR, EXPR) ATTR_DIFF(attrs, IDIAGNL_ATTR_##ATTR, a, b, EXPR)
> diff |= _DIFF(FAMILY, a->idiag_family != b->idiag_family);
> diff --git a/lib/idiag/idiag_vegasinfo_obj.c b/lib/idiag/idiag_vegasinfo_obj.c
> index eddd8af0e850..f02eea077b41 100644
> --- a/lib/idiag/idiag_vegasinfo_obj.c
> +++ b/lib/idiag/idiag_vegasinfo_obj.c
> @@ -84,8 +84,8 @@ void idiagnl_vegasinfo_set_minrtt(struct idiagnl_vegasinfo *vinfo, uint32_t
> /** @} */
>
> /** @cond SKIP */
> -static int idiagnl_vegasinfo_compare(struct nl_object *_a, struct nl_object *_b,
> - uint32_t attrs, int flags)
> +static uint64_t idiagnl_vegasinfo_compare(struct nl_object *_a, struct nl_object *_b,
> + uint64_t attrs, int flags)
> {
> struct idiagnl_vegasinfo *a = (struct idiagnl_vegasinfo *) _a;
> struct idiagnl_vegasinfo *b = (struct idiagnl_vegasinfo *) _b;
> diff --git a/lib/netfilter/ct_obj.c b/lib/netfilter/ct_obj.c
> index c8af87023c05..1079ec0a4b07 100644
> --- a/lib/netfilter/ct_obj.c
> +++ b/lib/netfilter/ct_obj.c
> @@ -297,12 +297,12 @@ static void ct_dump_stats(struct nl_object *a, struct nl_dump_params *p)
> }
> }
>
> -static int ct_compare(struct nl_object *_a, struct nl_object *_b,
> - uint32_t attrs, int flags)
> +static uint64_t ct_compare(struct nl_object *_a, struct nl_object *_b,
> + uint64_t attrs, int flags)
> {
> struct nfnl_ct *a = (struct nfnl_ct *) _a;
> struct nfnl_ct *b = (struct nfnl_ct *) _b;
> - int diff = 0;
> + uint64_t diff = 0;
>
> #define CT_DIFF(ATTR, EXPR) ATTR_DIFF(attrs, CT_ATTR_##ATTR, a, b, EXPR)
> #define CT_DIFF_VAL(ATTR, FIELD) CT_DIFF(ATTR, a->FIELD != b->FIELD)
> diff --git a/lib/netfilter/exp_obj.c b/lib/netfilter/exp_obj.c
> index 591cf45076ad..aef43b73acfa 100644
> --- a/lib/netfilter/exp_obj.c
> +++ b/lib/netfilter/exp_obj.c
> @@ -301,12 +301,12 @@ static int exp_cmp_l4proto_icmp (union nfnl_exp_protodata *a, union nfnl_exp_pro
> return d;
> }
>
> -static int exp_compare(struct nl_object *_a, struct nl_object *_b,
> - uint32_t attrs, int flags)
> +static uint64_t exp_compare(struct nl_object *_a, struct nl_object *_b,
> + uint64_t attrs, int flags)
> {
> struct nfnl_exp *a = (struct nfnl_exp *) _a;
> struct nfnl_exp *b = (struct nfnl_exp *) _b;
> - int diff = 0;
> + uint64_t diff = 0;
>
> #define EXP_DIFF(ATTR, EXPR) ATTR_DIFF(attrs, EXP_ATTR_##ATTR, a, b, EXPR)
> #define EXP_DIFF_VAL(ATTR, FIELD) EXP_DIFF(ATTR, a->FIELD != b->FIELD)
> diff --git a/lib/netfilter/log_obj.c b/lib/netfilter/log_obj.c
> index 3fdb3472a305..65985d86ee96 100644
> --- a/lib/netfilter/log_obj.c
> +++ b/lib/netfilter/log_obj.c
> @@ -229,12 +229,12 @@ unsigned int nfnl_log_str2flags(const char *name)
> return __str2flags(name, log_flags, ARRAY_SIZE(log_flags));
> }
>
> -static int nfnl_log_compare(struct nl_object *_a, struct nl_object *_b,
> - uint32_t attrs, int flags)
> +static uint64_t nfnl_log_compare(struct nl_object *_a, struct nl_object *_b,
> + uint64_t attrs, int flags)
> {
> struct nfnl_log *a = (struct nfnl_log *) _a;
> struct nfnl_log *b = (struct nfnl_log *) _b;
> - int diff = 0;
> + uint64_t diff = 0;
>
> #define NFNL_LOG_DIFF(ATTR, EXPR) \
> ATTR_DIFF(attrs, LOG_ATTR_##ATTR, a, b, EXPR)
> diff --git a/lib/netfilter/queue_obj.c b/lib/netfilter/queue_obj.c
> index 36ed3c53f15c..040bbed4f14b 100644
> --- a/lib/netfilter/queue_obj.c
> +++ b/lib/netfilter/queue_obj.c
> @@ -161,12 +161,12 @@ uint32_t nfnl_queue_get_copy_range(const struct nfnl_queue *queue)
> return queue->queue_copy_range;
> }
>
> -static int nfnl_queue_compare(struct nl_object *_a, struct nl_object *_b,
> - uint32_t attrs, int flags)
> +static uint64_t nfnl_queue_compare(struct nl_object *_a, struct nl_object *_b,
> + uint64_t attrs, int flags)
> {
> struct nfnl_queue *a = (struct nfnl_queue *) _a;
> struct nfnl_queue *b = (struct nfnl_queue *) _b;
> - int diff = 0;
> + uint64_t diff = 0;
>
> #define NFNL_QUEUE_DIFF(ATTR, EXPR) \
> ATTR_DIFF(attrs, QUEUE_ATTR_##ATTR, a, b, EXPR)
> diff --git a/lib/object.c b/lib/object.c
> index cad24e0a9e4d..a88ac00357a6 100644
> --- a/lib/object.c
> +++ b/lib/object.c
> @@ -358,17 +358,42 @@ int nl_object_identical(struct nl_object *a, struct nl_object *b)
> *
> * @return Bitmask describing differences or 0 if they are completely identical.
> */
> -uint32_t nl_object_diff(struct nl_object *a, struct nl_object *b)
> +uint64_t nl_object_diff64(struct nl_object *a, struct nl_object *b)
> {
> struct nl_object_ops *ops = obj_ops(a);
>
> if (ops != obj_ops(b) || ops->oo_compare == NULL)
> - return UINT32_MAX;
> + return UINT64_MAX;
>
> return ops->oo_compare(a, b, ~0, 0);
> }
>
> /**
> + * Compute 32-bit bitmask representing difference in attribute values
> + * @arg a an object
> + * @arg b another object of same type
> + *
> + * The bitmask returned is specific to an object type, each bit set represents
> + * an attribute which mismatches in either of the two objects. Unavailability
> + * of an attribute in one object and presence in the other is regarded a
> + * mismatch as well.
> + *
> + * @return Bitmask describing differences or 0 if they are completely identical.
> + * 32nd bit indicates if higher bits from the 64-bit compare were
> + * different.
> + */
> +uint32_t nl_object_diff(struct nl_object *a, struct nl_object *b)
> +{
> + uint64_t diff;
> +
> + diff = nl_object_diff64(a, b);
> +
> + return (diff & ~((uint64_t) 0xFFFFFFFF))
> + ? (uint32_t) diff | (1 << 31)
> + : (uint32_t) diff;
> +}
> +
> +/**
> * Match a filter against an object
> * @arg obj object to check
> * @arg filter object of same type acting as filter
> diff --git a/lib/route/addr.c b/lib/route/addr.c
> index 3bde2bf8b2ec..33df1c86cbf4 100644
> --- a/lib/route/addr.c
> +++ b/lib/route/addr.c
> @@ -429,12 +429,12 @@ static void addr_dump_stats(struct nl_object *obj, struct nl_dump_params *p)
> addr_dump_details(obj, p);
> }
>
> -static int addr_compare(struct nl_object *_a, struct nl_object *_b,
> - uint32_t attrs, int flags)
> +static uint64_t addr_compare(struct nl_object *_a, struct nl_object *_b,
> + uint64_t attrs, int flags)
> {
> struct rtnl_addr *a = (struct rtnl_addr *) _a;
> struct rtnl_addr *b = (struct rtnl_addr *) _b;
> - int diff = 0;
> + uint64_t diff = 0;
>
> #define ADDR_DIFF(ATTR, EXPR) ATTR_DIFF(attrs, ADDR_ATTR_##ATTR, a, b, EXPR)
>
> diff --git a/lib/route/link.c b/lib/route/link.c
> index d763d973650e..1fa26721bc76 100644
> --- a/lib/route/link.c
> +++ b/lib/route/link.c
> @@ -61,7 +61,8 @@
> #define LINK_ATTR_PHYS_PORT_ID (1 << 28)
> #define LINK_ATTR_NS_FD (1 << 29)
> #define LINK_ATTR_NS_PID (1 << 30)
> -#define LINK_ATTR_LINK_NETNSID (1 << 31)
> +/* 31 used by 32-bit api */
> +#define LINK_ATTR_LINK_NETNSID ((uint64_t) 1 << 32)
>
> static struct nl_cache_ops rtnl_link_ops;
> static struct nl_object_ops link_obj_ops;
> @@ -955,12 +956,12 @@ static void link_keygen(struct nl_object *obj, uint32_t *hashkey,
> return;
> }
>
> -static int link_compare(struct nl_object *_a, struct nl_object *_b,
> - uint32_t attrs, int flags)
> +static uint64_t link_compare(struct nl_object *_a, struct nl_object *_b,
> + uint64_t attrs, int flags)
> {
> struct rtnl_link *a = (struct rtnl_link *) _a;
> struct rtnl_link *b = (struct rtnl_link *) _b;
> - int diff = 0;
> + uint64_t diff = 0;
>
> #define LINK_DIFF(ATTR, EXPR) ATTR_DIFF(attrs, LINK_ATTR_##ATTR, a, b, EXPR)
>
> diff --git a/lib/route/neigh.c b/lib/route/neigh.c
> index 436d766a6a11..9fdcaca981d5 100644
> --- a/lib/route/neigh.c
> +++ b/lib/route/neigh.c
> @@ -260,12 +260,12 @@ static void neigh_keygen(struct nl_object *obj, uint32_t *hashkey,
> return;
> }
>
> -static int neigh_compare(struct nl_object *_a, struct nl_object *_b,
> - uint32_t attrs, int flags)
> +static uint64_t neigh_compare(struct nl_object *_a, struct nl_object *_b,
> + uint64_t attrs, int flags)
> {
> struct rtnl_neigh *a = (struct rtnl_neigh *) _a;
> struct rtnl_neigh *b = (struct rtnl_neigh *) _b;
> - int diff = 0;
> + uint64_t diff = 0;
>
> #define NEIGH_DIFF(ATTR, EXPR) ATTR_DIFF(attrs, NEIGH_ATTR_##ATTR, a, b, EXPR)
>
> diff --git a/lib/route/neightbl.c b/lib/route/neightbl.c
> index f9c9c27759e0..7fd106b93625 100644
> --- a/lib/route/neightbl.c
> +++ b/lib/route/neightbl.c
> @@ -54,12 +54,12 @@ static struct nl_cache_ops rtnl_neightbl_ops;
> static struct nl_object_ops neightbl_obj_ops;
> /** @endcond */
>
> -static int neightbl_compare(struct nl_object *_a, struct nl_object *_b,
> - uint32_t attrs, int flags)
> +static uint64_t neightbl_compare(struct nl_object *_a, struct nl_object *_b,
> + uint64_t attrs, int flags)
> {
> struct rtnl_neightbl *a = (struct rtnl_neightbl *) _a;
> struct rtnl_neightbl *b = (struct rtnl_neightbl *) _b;
> - int diff = 0;
> + uint64_t diff = 0;
>
> #define NT_DIFF(ATTR, EXPR) ATTR_DIFF(attrs, NEIGHTBL_ATTR_##ATTR, a, b, EXPR)
>
> diff --git a/lib/route/route_obj.c b/lib/route/route_obj.c
> index 4063c6f672e8..0f52e00db86e 100644
> --- a/lib/route/route_obj.c
> +++ b/lib/route/route_obj.c
> @@ -343,13 +343,14 @@ static void route_keygen(struct nl_object *obj, uint32_t *hashkey,
> return;
> }
>
> -static int route_compare(struct nl_object *_a, struct nl_object *_b,
> - uint32_t attrs, int flags)
> +static uint64_t route_compare(struct nl_object *_a, struct nl_object *_b,
> + uint64_t attrs, int flags)
> {
> struct rtnl_route *a = (struct rtnl_route *) _a;
> struct rtnl_route *b = (struct rtnl_route *) _b;
> struct rtnl_nexthop *nh_a, *nh_b;
> - int i, diff = 0, found;
> + int i, found;
> + uint64_t diff = 0;
>
> #define ROUTE_DIFF(ATTR, EXPR) ATTR_DIFF(attrs, ROUTE_ATTR_##ATTR, a, b, EXPR)
>
> diff --git a/lib/route/rule.c b/lib/route/rule.c
> index 357cb1bf60bd..883df812cc3f 100644
> --- a/lib/route/rule.c
> +++ b/lib/route/rule.c
> @@ -245,12 +245,12 @@ static void rule_dump_stats(struct nl_object *obj, struct nl_dump_params *p)
>
> #define RULE_ATTR_FLAGS 0x0008
>
> -static int rule_compare(struct nl_object *_a, struct nl_object *_b,
> - uint32_t attrs, int flags)
> +static uint64_t rule_compare(struct nl_object *_a, struct nl_object *_b,
> + uint64_t attrs, int flags)
> {
> struct rtnl_rule *a = (struct rtnl_rule *) _a;
> struct rtnl_rule *b = (struct rtnl_rule *) _b;
> - int diff = 0;
> + uint64_t diff = 0;
>
> #define RULE_DIFF(ATTR, EXPR) ATTR_DIFF(attrs, RULE_ATTR_##ATTR, a, b, EXPR)
>
> diff --git a/lib/route/tc.c b/lib/route/tc.c
> index 35daf15ae57d..384e85705b1d 100644
> --- a/lib/route/tc.c
> +++ b/lib/route/tc.c
> @@ -932,12 +932,12 @@ void rtnl_tc_dump_stats(struct nl_object *obj, struct nl_dump_params *p)
> tc->tc_stats[RTNL_TC_RATE_PPS]);
> }
>
> -int rtnl_tc_compare(struct nl_object *aobj, struct nl_object *bobj,
> - uint32_t attrs, int flags)
> +uint64_t rtnl_tc_compare(struct nl_object *aobj, struct nl_object *bobj,
> + uint64_t attrs, int flags)
> {
> struct rtnl_tc *a = TC_CAST(aobj);
> struct rtnl_tc *b = TC_CAST(bobj);
> - int diff = 0;
> + uint64_t diff = 0;
>
> #define TC_DIFF(ATTR, EXPR) ATTR_DIFF(attrs, TCA_ATTR_##ATTR, a, b, EXPR)
>
> diff --git a/lib/xfrm/ae.c b/lib/xfrm/ae.c
> index 4fe964725b52..bfe481f76eae 100644
> --- a/lib/xfrm/ae.c
> +++ b/lib/xfrm/ae.c
> @@ -181,11 +181,13 @@ static int xfrm_ae_clone(struct nl_object *_dst, struct nl_object *_src)
> return 0;
> }
>
> -static int xfrm_ae_compare(struct nl_object *_a, struct nl_object *_b, uint32_t attrs, int flags)
> +static uint64_t xfrm_ae_compare(struct nl_object *_a, struct nl_object *_b,
> + uint64_t attrs, int flags)
> {
> struct xfrmnl_ae* a = (struct xfrmnl_ae *) _a;
> struct xfrmnl_ae* b = (struct xfrmnl_ae *) _b;
> - int diff = 0, found = 0;
> + uint64_t diff = 0;
> + int found = 0;
>
> #define XFRM_AE_DIFF(ATTR, EXPR) ATTR_DIFF(attrs, XFRM_AE_ATTR_##ATTR, a, b, EXPR)
> diff |= XFRM_AE_DIFF(DADDR, nl_addr_cmp(a->sa_id.daddr, b->sa_id.daddr));
> diff --git a/lib/xfrm/sa.c b/lib/xfrm/sa.c
> index 34d24cf843eb..31c22ba44ef2 100644
> --- a/lib/xfrm/sa.c
> +++ b/lib/xfrm/sa.c
> @@ -205,11 +205,12 @@ static int xfrm_sa_clone(struct nl_object *_dst, struct nl_object *_src)
> return 0;
> }
>
> -static int xfrm_sa_compare(struct nl_object *_a, struct nl_object *_b, uint32_t attrs, int flags)
> +static uint64_t xfrm_sa_compare(struct nl_object *_a, struct nl_object *_b,
> + uint64_t attrs, int flags)
> {
> struct xfrmnl_sa* a = (struct xfrmnl_sa *) _a;
> struct xfrmnl_sa* b = (struct xfrmnl_sa *) _b;
> - int diff = 0;
> + uint64_t diff = 0;
> int found = 0;
>
> #define XFRM_SA_DIFF(ATTR, EXPR) ATTR_DIFF(attrs, XFRM_SA_ATTR_##ATTR, a, b, EXPR)
> diff --git a/lib/xfrm/sp.c b/lib/xfrm/sp.c
> index 943269a6638f..cc2fcb1c60a1 100644
> --- a/lib/xfrm/sp.c
> +++ b/lib/xfrm/sp.c
> @@ -138,12 +138,13 @@ static int xfrm_sp_clone(struct nl_object *_dst, struct nl_object *_src)
> return 0;
> }
>
> -static int xfrm_sp_compare(struct nl_object *_a, struct nl_object *_b, uint32_t attrs, int flags)
> +static uint64_t xfrm_sp_compare(struct nl_object *_a, struct nl_object *_b,
> + uint64_t attrs, int flags)
> {
> struct xfrmnl_sp* a = (struct xfrmnl_sp *) _a;
> struct xfrmnl_sp* b = (struct xfrmnl_sp *) _b;
> struct xfrmnl_user_tmpl *tmpl_a, *tmpl_b;
> - int diff = 0;
> + uint64_t diff = 0;
>
> #define XFRM_SP_DIFF(ATTR, EXPR) ATTR_DIFF(attrs, XFRM_SP_ATTR_##ATTR, a, b, EXPR)
> diff |= XFRM_SP_DIFF(SEL, xfrmnl_sel_cmp(a->sel, b->sel));
>
More information about the libnl
mailing list