lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <82c7f448-4390-70d4-4c55-9a5e6b0bda55@redhat.com>
Date:   Fri, 30 Jun 2017 16:03:54 +0200
From:   Ivan Vecera <ivecera@...hat.com>
To:     Simon Horman <simon.horman@...ronome.com>,
        David Miller <davem@...emloft.net>,
        Jakub Kicinski <jakub.kicinski@...ronome.com>
Cc:     netdev@...r.kernel.org, oss-drivers@...ronome.com,
        Or Gerlitz <gerlitz.or@...il.com>,
        Pieter Jansen van Vuuren 
        <pieter.jansenvanvuuren@...ronome.com>
Subject: Re: [PATCH net-next v3 1/9] net: switchdev: add SET_SWITCHDEV_OPS
 helper

On 29.6.2017 22:08, Simon Horman wrote:
> Add a helper to allow switchdev ops to be set if NET_SWITCHDEV is configured
> and do nothing otherwise. This allows for slightly cleaner code which
> uses switchdev but does not select NET_SWITCHDEV.
> 
> Signed-off-by: Simon Horman <simon.horman@...ronome.com>
> ---
>  include/net/switchdev.h | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/include/net/switchdev.h b/include/net/switchdev.h
> index c784a6ac6ef1..8ae9e3b6392e 100644
> --- a/include/net/switchdev.h
> +++ b/include/net/switchdev.h
> @@ -217,6 +217,8 @@ void switchdev_port_fwd_mark_set(struct net_device *dev,
>  
>  bool switchdev_port_same_parent_id(struct net_device *a,
>  				   struct net_device *b);
> +
> +#define SWITCHDEV_SET_OPS(netdev, ops) ((netdev)->switchdev_ops = (ops))
>  #else
>  
>  static inline void switchdev_deferred_process(void)
> @@ -322,6 +324,8 @@ static inline bool switchdev_port_same_parent_id(struct net_device *a,
>  	return false;
>  }
>  
> +#define SWITCHDEV_SET_OPS(netdev, ops) do {} while (0)
> +
>  #endif
>  
>  #endif /* _LINUX_SWITCHDEV_H_ */
> 

Acked-by: Ivan Vecera <ivecera@...hat.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ