Subject: Re: [PATCH net-next v4 2/8] netdevice: add IPv4 fib add/del ops

From: Jamal Hadi Salim <[email-masked]>
Date: Fri, 06 Mar 2015 09:55:07 -0500

On 03/06/15 00:21, [email-masked] wrote:
> From: Scott Feldman <[email-masked]>
>
> Add two new ndo ops for IPv4 fib offload support, add and del.  Add uses
> modifiy semantics if fib entry already offloaded.

The above semantic will not express correctly the intent that the tools
like iproute2 expose and user space expects.
I think you need to pass the netlink flags to do it correctly at
the driver level.
i.e classical table operations per netlink flags (NLM_F_CREATE,
NLM_F_REPLACE, NLM_F_EXCL, NLM_F_APPEND)

1) Create: NLM_F_CREATE
2) Create exclusively i.e reject if already created
(NLM_F_CREATE|NLM_F_EXCL)
3) Create or modify (which is the semantic you are refering to)
NLM_F_CREATE|NLM_F_REPLACE
4) Append - which means "I dont care if it exists, just append it"
NLM_F_CREATE|NLM_F_APPEND

cheers,
jamal