[ovs-dev] [PATCH] dpif-netdev: Remove useless port checking.

Greg Rose gvrose8192 at gmail.com
Fri Jun 23 16:43:45 UTC 2017


On 06/20/2017 12:53 AM, Ilya Maximets wrote:
> Since commit ff073a71f9bb ("dpif-netdev: Use hmap instead of
> list+array for tracking ports."), 'is_valid_port_number()' is
> equal to 'port_no != ODPP_NONE', and the expression below will
> never be true.
>
> Signed-off-by: Ilya Maximets <i.maximets at samsung.com>
> ---
>   lib/dpif-netdev.c | 7 -------
>   1 file changed, 7 deletions(-)
>
> diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
> index f83b632..fca277a 100644
> --- a/lib/dpif-netdev.c
> +++ b/lib/dpif-netdev.c
> @@ -2257,8 +2257,6 @@ static int
>   dpif_netdev_flow_from_nlattrs(const struct nlattr *key, uint32_t key_len,
>                                 struct flow *flow, bool probe)
>   {
> -    odp_port_t in_port;
> -
>       if (odp_flow_key_to_flow(key, key_len, flow)) {
>           if (!probe) {
>               /* This should not happen: it indicates that
> @@ -2280,11 +2278,6 @@ dpif_netdev_flow_from_nlattrs(const struct nlattr *key, uint32_t key_len,
>           return EINVAL;
>       }
>
> -    in_port = flow->in_port.odp_port;
> -    if (!is_valid_port_number(in_port) && in_port != ODPP_NONE) {
> -        return EINVAL;
> -    }
> -
>       if (flow->ct_state & DP_NETDEV_CS_UNSUPPORTED_MASK) {
>           return EINVAL;
>       }
>
LGTM

Acked-by: Greg Rose <gvrose8192 at gmail.com>



More information about the dev mailing list