1. 11 2月, 2017 20 次提交
    • R
      net: dsa: remove unnecessary phy*.h includes · 4d56a29f
      Russell King 提交于
      Including phy.h and phy_fixed.h into net/dsa.h causes phy*.h to be an
      unnecessary dependency for quite a large amount of the kernel.  There's
      very little which actually requires definitions from phy.h in net/dsa.h
      - the include itself only wants the declaration of a couple of
      structures and IFNAMSIZ.
      
      Add linux/if.h for IFNAMSIZ, declarations for the structures, phy.h to
      mv88e6xxx.h as it needs it for phy_interface_t, and remove both phy.h
      and phy_fixed.h from net/dsa.h.
      
      This patch reduces from around 800 files rebuilt to around 40 - even
      with ccache, the time difference is noticable.
      Tested-by: NVivien Didelot <vivien.didelot@savoirfairelinux.com>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4d56a29f
    • R
      net: ath5k: fix build errors when linux/phy*.h is removed from net/dsa.h · 7ecb6227
      Russell King 提交于
      Fix these errors reported by the 0-day builder by replacing the
      linux/export.h include with linux/module.h.
      
      In file included from include/linux/platform_device.h:14:0,
                       from drivers/net/wireless/ath/ath5k/ahb.c:20:
      include/linux/device.h:1463:1: warning: data definition has no type or storage class
       module_init(__driver##_init); \
       ^
      include/linux/platform_device.h:228:2: note: in expansion of macro 'module_driver'
        module_driver(__platform_driver, platform_driver_register, \
        ^~~~~~~~~~~~~
      drivers/net/wireless/ath/ath5k/ahb.c:233:1: note: in expansion of macro 'module_platform_driver'
       module_platform_driver(ath_ahb_driver);
       ^~~~~~~~~~~~~~~~~~~~~~
      include/linux/device.h:1463:1: error: type defaults to 'int' in declaration of 'module_init' [-Werror=implicit-int]
       module_init(__driver##_init); \
       ^
      include/linux/platform_device.h:228:2: note: in expansion of macro 'module_driver'
        module_driver(__platform_driver, platform_driver_register, \
        ^~~~~~~~~~~~~
      drivers/net/wireless/ath/ath5k/ahb.c:233:1: note: in expansion of macro 'module_platform_driver'
       module_platform_driver(ath_ahb_driver);
       ^~~~~~~~~~~~~~~~~~~~~~
      drivers/net/wireless/ath/ath5k/ahb.c:233:1: warning: parameter names (without types) in function declaration
      In file included from include/linux/platform_device.h:14:0,
                       from drivers/net/wireless/ath/ath5k/ahb.c:20:
      include/linux/device.h:1468:1: warning: data definition has no type or storage class
       module_exit(__driver##_exit);
       ^
      include/linux/platform_device.h:228:2: note: in expansion of macro 'module_driver'
        module_driver(__platform_driver, platform_driver_register, \
        ^~~~~~~~~~~~~
      drivers/net/wireless/ath/ath5k/ahb.c:233:1: note: in expansion of macro 'module_platform_driver'
       module_platform_driver(ath_ahb_driver);
       ^~~~~~~~~~~~~~~~~~~~~~
      include/linux/device.h:1468:1: error: type defaults to 'int' in declaration of 'module_exit' [-Werror=implicit-int]
       module_exit(__driver##_exit);
       ^
      include/linux/platform_device.h:228:2: note: in expansion of macro 'module_driver'
        module_driver(__platform_driver, platform_driver_register, \
        ^~~~~~~~~~~~~
      drivers/net/wireless/ath/ath5k/ahb.c:233:1: note: in expansion of macro 'module_platform_driver'
       module_platform_driver(ath_ahb_driver);
       ^~~~~~~~~~~~~~~~~~~~~~
      drivers/net/wireless/ath/ath5k/ahb.c:233:1: warning: parameter names (without types) in function declaration
      In file included from include/linux/platform_device.h:14:0,
                       from drivers/net/wireless/ath/ath5k/ahb.c:20:
      drivers/net/wireless/ath/ath5k/ahb.c:233:24: warning: 'ath_ahb_driver_exit' defined but not used [-Wunused-function]
       module_platform_driver(ath_ahb_driver);
                              ^
      include/linux/device.h:1464:20: note: in definition of macro 'module_driver'
       static void __exit __driver##_exit(void) \
                          ^~~~~~~~
      drivers/net/wireless/ath/ath5k/ahb.c:233:1: note: in expansion of macro 'module_platform_driver'
       module_platform_driver(ath_ahb_driver);
       ^~~~~~~~~~~~~~~~~~~~~~
      drivers/net/wireless/ath/ath5k/ahb.c:233:24: warning: 'ath_ahb_driver_init' defined but not used [-Wunused-function]
       module_platform_driver(ath_ahb_driver);
                              ^
      include/linux/device.h:1459:19: note: in definition of macro 'module_driver'
       static int __init __driver##_init(void) \
                         ^~~~~~~~
      drivers/net/wireless/ath/ath5k/ahb.c:233:1: note: in expansion of macro 'module_platform_driver'
       module_platform_driver(ath_ahb_driver);
       ^~~~~~~~~~~~~~~~~~~~~~
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      Acked-by: NKalle Valo <kvalo@codeaurora.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7ecb6227
    • R
      net: liquidio: fix build errors when linux/phy*.h is removed from net/dsa.h · e3bfc6e7
      Russell King 提交于
      drivers/net/ethernet/cavium/liquidio/lio_vf_main.c:30: error: expected declaration specifiers or '...' before string constant
      drivers/net/ethernet/cavium/liquidio/lio_vf_main.c:30: warning: data definition has no type or storage class
      drivers/net/ethernet/cavium/liquidio/lio_vf_main.c:30: error: type defaults to 'int' in declaration of 'MODULE_AUTHOR'
      drivers/net/ethernet/cavium/liquidio/lio_vf_main.c:30: error: function declaration isn't a prototype
      drivers/net/ethernet/cavium/liquidio/lio_vf_main.c:31: error: expected declaration specifiers or '...' before string constant
      drivers/net/ethernet/cavium/liquidio/lio_vf_main.c:31: warning: data definition has no type or storage class
      drivers/net/ethernet/cavium/liquidio/lio_vf_main.c:31: error: type defaults to 'int' in declaration of 'MODULE_DESCRIPTION'
      drivers/net/ethernet/cavium/liquidio/lio_vf_main.c:31: error: function declaration isn't a prototype
      drivers/net/ethernet/cavium/liquidio/lio_vf_main.c:32: error: expected declaration specifiers or '...' before string constant
      drivers/net/ethernet/cavium/liquidio/lio_vf_main.c:32: warning: data definition has no type or storage class
      drivers/net/ethernet/cavium/liquidio/lio_vf_main.c:32: error: type defaults to 'int' in declaration of 'MODULE_LICENSE'
      drivers/net/ethernet/cavium/liquidio/lio_vf_main.c:32: error: function declaration isn't a prototype
      drivers/net/ethernet/cavium/liquidio/lio_vf_main.c:33: error: expected declaration specifiers or '...' before string constant
      drivers/net/ethernet/cavium/liquidio/lio_vf_main.c:33: warning: data definition has no type or storage class
      drivers/net/ethernet/cavium/liquidio/lio_vf_main.c:33: error: type defaults to 'int' in declaration of 'MODULE_VERSION'
      drivers/net/ethernet/cavium/liquidio/lio_vf_main.c:33: error: function declaration isn't a prototype
      drivers/net/ethernet/cavium/liquidio/lio_vf_main.c:36: error: expected ')' before 'int'
      drivers/net/ethernet/cavium/liquidio/lio_vf_main.c:37: error: expected ')' before string constant
      drivers/net/ethernet/cavium/liquidio/lio_vf_main.c:325: warning: data definition has no type or storage class
      drivers/net/ethernet/cavium/liquidio/lio_vf_main.c:325: error: type defaults to 'int' in declaration of 'MODULE_DEVICE_TABLE'
      drivers/net/ethernet/cavium/liquidio/lio_vf_main.c:325: warning: parameter names (without types) in function declaration
      drivers/net/ethernet/cavium/liquidio/lio_vf_main.c:3250: warning: data definition has no type or storage class
      drivers/net/ethernet/cavium/liquidio/lio_vf_main.c:3250: error: type defaults to 'int' in declaration of 'module_init'
      drivers/net/ethernet/cavium/liquidio/lio_vf_main.c:3250: warning: parameter names (without types) in function declaration
      drivers/net/ethernet/cavium/liquidio/lio_vf_main.c:3251: warning: data definition has no type or storage class
      drivers/net/ethernet/cavium/liquidio/lio_vf_main.c:3251: error: type defaults to 'int' in declaration of 'module_exit'
      drivers/net/ethernet/cavium/liquidio/lio_vf_main.c:3251: warning: parameter names (without types) in function declaration
      drivers/net/ethernet/cavium/liquidio/lio_main.c:36: error: expected declaration specifiers or '...' before string constant
      drivers/net/ethernet/cavium/liquidio/lio_main.c:36: warning: data definition has no type or storage class
      drivers/net/ethernet/cavium/liquidio/lio_main.c:36: error: type defaults to 'int' in declaration of 'MODULE_AUTHOR'
      drivers/net/ethernet/cavium/liquidio/lio_main.c:36: error: function declaration isn't a prototype
      drivers/net/ethernet/cavium/liquidio/lio_main.c:37: error: expected declaration specifiers or '...' before string constant
      drivers/net/ethernet/cavium/liquidio/lio_main.c:37: warning: data definition has no type or storage class
      drivers/net/ethernet/cavium/liquidio/lio_main.c:37: error: type defaults to 'int' in declaration of 'MODULE_DESCRIPTION'
      drivers/net/ethernet/cavium/liquidio/lio_main.c:37: error: function declaration isn't a prototype
      drivers/net/ethernet/cavium/liquidio/lio_main.c:38: error: expected declaration specifiers or '...' before string constant
      drivers/net/ethernet/cavium/liquidio/lio_main.c:38: warning: data definition has no type or storage class
      drivers/net/ethernet/cavium/liquidio/lio_main.c:38: error: type defaults to 'int' in declaration of 'MODULE_LICENSE'
      drivers/net/ethernet/cavium/liquidio/lio_main.c:38: error: function declaration isn't a prototype
      drivers/net/ethernet/cavium/liquidio/lio_main.c:39: error: expected declaration specifiers or '...' before string constant
      drivers/net/ethernet/cavium/liquidio/lio_main.c:39: warning: data definition has no type or storage class
      drivers/net/ethernet/cavium/liquidio/lio_main.c:39: error: type defaults to 'int' in declaration of 'MODULE_VERSION'
      drivers/net/ethernet/cavium/liquidio/lio_main.c:39: error: function declaration isn't a prototype
      drivers/net/ethernet/cavium/liquidio/lio_main.c:40: error: expected declaration specifiers or '...' before string constant
      drivers/net/ethernet/cavium/liquidio/lio_main.c:40: warning: data definition has no type or storage class
      drivers/net/ethernet/cavium/liquidio/lio_main.c:40: error: type defaults to 'int' in declaration of 'MODULE_FIRMWARE'
      drivers/net/ethernet/cavium/liquidio/lio_main.c:40: error: function declaration isn't a prototype
      drivers/net/ethernet/cavium/liquidio/lio_main.c:41: error: expected declaration specifiers or '...' before string constant
      drivers/net/ethernet/cavium/liquidio/lio_main.c:41: warning: data definition has no type or storage class
      drivers/net/ethernet/cavium/liquidio/lio_main.c:41: error: type defaults to 'int' in declaration of 'MODULE_FIRMWARE'
      drivers/net/ethernet/cavium/liquidio/lio_main.c:41: error: function declaration isn't a prototype
      drivers/net/ethernet/cavium/liquidio/lio_main.c:42: error: expected declaration specifiers or '...' before string constant
      drivers/net/ethernet/cavium/liquidio/lio_main.c:42: warning: data definition has no type or storage class
      drivers/net/ethernet/cavium/liquidio/lio_main.c:42: error: type defaults to 'int' in declaration of 'MODULE_FIRMWARE'
      drivers/net/ethernet/cavium/liquidio/lio_main.c:42: error: function declaration isn't a prototype
      drivers/net/ethernet/cavium/liquidio/lio_main.c:43: error: expected declaration specifiers or '...' before string constant
      drivers/net/ethernet/cavium/liquidio/lio_main.c:43: warning: data definition has no type or storage class
      drivers/net/ethernet/cavium/liquidio/lio_main.c:43: error: type defaults to 'int' in declaration of 'MODULE_FIRMWARE'
      drivers/net/ethernet/cavium/liquidio/lio_main.c:43: error: function declaration isn't a prototype
      drivers/net/ethernet/cavium/liquidio/lio_main.c:46: error: expected ')' before 'int'
      drivers/net/ethernet/cavium/liquidio/lio_main.c:48: error: expected ')' before string constant
      drivers/net/ethernet/cavium/liquidio/lio_main.c:53: error: expected ')' before 'int'
      drivers/net/ethernet/cavium/liquidio/lio_main.c:54: error: expected ')' before string constant
      drivers/net/ethernet/cavium/liquidio/lio_main.c:57: error: expected ')' before 'sizeof'
      drivers/net/ethernet/cavium/liquidio/lio_main.c:58: error: expected ')' before string constant
      drivers/net/ethernet/cavium/liquidio/lio_main.c:498: warning: data definitionhas no type or storage class
      drivers/net/ethernet/cavium/liquidio/lio_main.c:498: error: type defaults to 'int' in declaration of 'MODULE_DEVICE_TABLE'
      drivers/net/ethernet/cavium/liquidio/lio_main.c:498: warning: parameter names (without types) in function declaration
      drivers/net/ethernet/cavium/liquidio/lio_main.c: In function 'octeon_recv_vf_drv_notice':
      drivers/net/ethernet/cavium/liquidio/lio_main.c:4393: error: implicit declaration of function 'try_module_get'
      drivers/net/ethernet/cavium/liquidio/lio_main.c:4400: error: implicit declaration of function 'module_put'
      drivers/net/ethernet/cavium/liquidio/lio_main.c: At top level:
      drivers/net/ethernet/cavium/liquidio/lio_main.c:4670: warning: data definition has no type or storage class
      drivers/net/ethernet/cavium/liquidio/lio_main.c:4670: error: type defaults to 'int' in declaration of 'module_init'
      drivers/net/ethernet/cavium/liquidio/lio_main.c:4670: warning: parameter names (without types) in function declaration
      drivers/net/ethernet/cavium/liquidio/lio_main.c:4671: warning: data definition has no type or storage class
      drivers/net/ethernet/cavium/liquidio/lio_main.c:4671: error: type defaults to 'int' in declaration of 'module_exit'
      drivers/net/ethernet/cavium/liquidio/lio_main.c:4671: warning: parameter names (without types) in function declaration
      
      Add linux/module.h to both these files.
      
      drivers/net/ethernet/cavium/liquidio/octeon_console.c:40:31: error: expected ')' before 'int'
      drivers/net/ethernet/cavium/liquidio/octeon_console.c:42:4: error: expected ')' before string constant
      
      Add linux/moduleparam.h to this file.
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      Acked-by: NFelix Manlunas <felix.manlunas@cavium.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e3bfc6e7
    • R
      iscsi: fix build errors when linux/phy*.h is removed from net/dsa.h · da5df620
      Russell King 提交于
      drivers/target/iscsi/iscsi_target_login.c:1135:7: error: implicit declaration of function 'try_module_get' [-Werror=implicit-function-declaration]
      
      Add linux/module.h to iscsi_target_login.c.
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      Reviewed-by: NBart Van Assche <bart.vanassche@sandisk.com>
      Acked-by: NNicholas Bellinger <nab@linux-iscsi.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      da5df620
    • R
      net: mvneta: fix build errors when linux/phy*.h is removed from net/dsa.h · 9303ab2b
      Russell King 提交于
      drivers/net/ethernet/marvell/mvneta.c:2694:26: error: storage size of 'status' isn't known
      drivers/net/ethernet/marvell/mvneta.c:2695:26: error: storage size of 'changed' isn't known
      drivers/net/ethernet/marvell/mvneta.c:2695:9: error: variable 'changed' has initializer but incomplete type
      drivers/net/ethernet/marvell/mvneta.c:2709:2: error: implicit declaration of function 'fixed_phy_update_state' [-Werror=implicit-function-declaration]
      
      Add linux/phy_fixed.h to mvneta.c
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      Acked-by: NThomas Petazzoni <thomas.petazzoni@free-electrons.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9303ab2b
    • R
      net: fman: fix build errors when linux/phy*.h is removed from net/dsa.h · f225e4e6
      Russell King 提交于
      drivers/net/ethernet/freescale/fman/fman_memac.c:519:21: error: dereferencing pointer to incomplete type 'struct fixed_phy_status'
      
      Add linux/phy_fixed.h to fman_memac.c
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f225e4e6
    • R
      net: bgmac: fix build errors when linux/phy*.h is removed from net/dsa.h · 13bf7760
      Russell King 提交于
      drivers/net/ethernet/broadcom/bgmac.c:1015:17: error: dereferencing pointer to incomplete type 'struct mii_bus'
      drivers/net/ethernet/broadcom/bgmac.c:1185:2: error: implicit declaration of function 'phy_start' [-Werror=implicit-function-declaration]
      drivers/net/ethernet/broadcom/bgmac.c:1198:2: error: implicit declaration of function 'phy_stop' [-Werror=implicit-function-declaration]
      drivers/net/ethernet/broadcom/bgmac.c:1239:9: error: implicit declaration of function 'phy_mii_ioctl' [-Werror=implicit-function-declaration]
      drivers/net/ethernet/broadcom/bgmac.c:1389:28: error: 'phy_ethtool_get_link_ksettings' undeclared here (not in a function)
      drivers/net/ethernet/broadcom/bgmac.c:1390:28: error: 'phy_ethtool_set_link_ksettings' undeclared here (not in a function)
      drivers/net/ethernet/broadcom/bgmac.c:1403:13: error: dereferencing pointer to incomplete type 'struct phy_device'
      drivers/net/ethernet/broadcom/bgmac.c:1417:3: error: implicit declaration of function 'phy_print_status' [-Werror=implicit-function-declaration]
      drivers/net/ethernet/broadcom/bgmac.c:1424:26: error: storage size of 'fphy_status' isn't known
      drivers/net/ethernet/broadcom/bgmac.c:1424:9: error: variable 'fphy_status' has initializer but incomplete type
      drivers/net/ethernet/broadcom/bgmac.c:1425:11: warning: excess elements in struct initializer
      drivers/net/ethernet/broadcom/bgmac.c:1425:3: error: unknown field 'link' specified in initializer
      drivers/net/ethernet/broadcom/bgmac.c:1426:12: note: in expansion of macro 'SPEED_1000'
      drivers/net/ethernet/broadcom/bgmac.c:1426:3: error: unknown field 'speed' specified in initializer
      drivers/net/ethernet/broadcom/bgmac.c:1427:13: note: in expansion of macro 'DUPLEX_FULL'
      drivers/net/ethernet/broadcom/bgmac.c:1427:3: error: unknown field 'duplex' specified in initializer
      drivers/net/ethernet/broadcom/bgmac.c:1432:12: error: implicit declaration of function 'fixed_phy_register' [-Werror=implicit-function-declaration]
      drivers/net/ethernet/broadcom/bgmac.c:1432:31: error: 'PHY_POLL' undeclared (first use in this function)
      drivers/net/ethernet/broadcom/bgmac.c:1438:8: error: implicit declaration of function 'phy_connect_direct' [-Werror=implicit-function-declaration]
      drivers/net/ethernet/broadcom/bgmac.c:1439:6: error: 'PHY_INTERFACE_MODE_MII' undeclared (first use in this function)
      drivers/net/ethernet/broadcom/bgmac.c:1521:2: error: implicit declaration of function 'phy_disconnect' [-Werror=implicit-function-declaration]
      drivers/net/ethernet/broadcom/bgmac.c:1541:15: error: expected declaration specifiers or '...' before string constant
      
      Add linux/phy.h to bgmac.c
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      Acked-by: NRafał Miłecki <rafal@milecki.pl>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      13bf7760
    • R
      net: lan78xx: fix build errors when linux/phy*.h is removed from net/dsa.h · 8c56ea41
      Russell King 提交于
      drivers/net/usb/lan78xx.c:394:33: sparse: expected ; at end of declaration
      drivers/net/usb/lan78xx.c:394:33: sparse: Expected } at end of struct-union-enum-specifier
      drivers/net/usb/lan78xx.c:394:33: sparse: got interface
      drivers/net/usb/lan78xx.c:403:1: sparse: Expected ; at the end of type declaration
      drivers/net/usb/lan78xx.c:403:1: sparse: got }
      
      Add linux/phy.h to lan78xx.c
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8c56ea41
    • R
      net: macb: fix build errors when linux/phy*.h is removed from net/dsa.h · fc182b85
      Russell King 提交于
      drivers/net/ethernet/cadence/macb.h:862:33: sparse: expected ; at end of declaration
      drivers/net/ethernet/cadence/macb.h:862:33: sparse: Expected } at end of struct-union-enum-specifier
      drivers/net/ethernet/cadence/macb.h:862:33: sparse: got phy_interface
      drivers/net/ethernet/cadence/macb.h:877:1: sparse: Expected ; at the end of type declaration
      drivers/net/ethernet/cadence/macb.h:877:1: sparse: got }
      In file included from drivers/net/ethernet/cadence/macb_pci.c:29:0:
      drivers/net/ethernet/cadence/macb.h:862:2: error: unknown type name 'phy_interface_t'
           phy_interface_t  phy_interface;
           ^~~~~~~~~~~~~~~
      
      Add linux/phy.h to macb.h
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      Acked-by: NNicolas Ferre <nicolas.ferre@atmel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      fc182b85
    • J
      spectrum: flower: Treat ETH_P_ALL as a special case and translate for HW · dc371700
      Jiri Pirko 提交于
      HW does not understand ETH_P_ALL. So treat this special case differently
      and translate to 0/0 key/mask. That will allow HW to match all ethertypes.
      
      Fixes: 7aa0f5aa ("mlxsw: spectrum: Implement TC flower offload")
      Signed-off-by: NJiri Pirko <jiri@mellanox.com>
      Reviewed-by: NIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      dc371700
    • N
      mlxsw: spectrum: Update mc_disabled flag by switchdev attr · 90e0f0c1
      Nogah Frankel 提交于
      Add a function to update mc_disabled from switchdev attr
      SWITCHDEV_ATTR_ID_BRIDGE_MC_DISABLED
      Signed-off-by: NNogah Frankel <nogahf@mellanox.com>
      Signed-off-by: NYotam Gigi <yotamg@mellanox.com>
      Signed-off-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      90e0f0c1
    • N
      mlxsw: spectrum: Extend port_orig_get for bridge devices · 1e5d9432
      Nogah Frankel 提交于
      The function mlxsw_sp_port_orig_get returns the vport from the physical
      port if needed, based on the original device.
      This patch addresses the case where the original device is a bridge.
      If it is vlan unaware bridge, it returns the matching vport. If it is vlan
      aware bridge, there is no matching vport, and it returns the original port.
      Signed-off-by: NNogah Frankel <nogahf@mellanox.com>
      Signed-off-by: NYotam Gigi <yotamg@mellanox.com>
      Signed-off-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1e5d9432
    • N
      mlxsw: spectrum: Add an option to flood mc by mc_router_port · 8ecd4591
      Nogah Frankel 提交于
      The decision whether to flood a multicast packet to a port dependent
      on three flags: mc_disabled, mc_router_port, mc_flood.
      
      If mc_disabled is on, the port will be flooded according to mc_flood,
      otherwise, according to mc_router_port. To accomplish that, add those
      flags into the mlxsw_sp_port struct and update the mc flood table
      accordingly.
      
      Update mc_router_port by switchdev attribute
      SWITCHDEV_ATTR_ID_PORT_MC_ROUTER_PORT.
      Signed-off-by: NNogah Frankel <nogahf@mellanox.com>
      Signed-off-by: NYotam Gigi <yotamg@mellanox.com>
      Signed-off-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8ecd4591
    • N
      mlxsw: spectrum: Separate bc and mc floods · 71c365bd
      Nogah Frankel 提交于
      Break the bm (broadcast-multicast) into two tables, one for broadcast
      (and link local multicast that behaves like bc) and one for unknown
      multicasts.
      Add a bool into mlxsw_sp_port named mc_flood that reflect the value this
      port should have in the mc flood table (currently, always 1);
      Signed-off-by: NNogah Frankel <nogahf@mellanox.com>
      Signed-off-by: NYotam Gigi <yotamg@mellanox.com>
      Signed-off-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      71c365bd
    • N
      mlxsw: spectrum: Change max vfid · 63fe813c
      Nogah Frankel 提交于
      A user that wants many bridges will use 1.Q bridge which are scalable.
      One can have as many 1.Q bridges as vfids.
      This patch sets their number to 1k, which is a reasonably large number.
      This change is done here because the next patches will add a new flood
      table, and without it, it will increase the overall size of the flood
      tables dramatically.
      Signed-off-by: NNogah Frankel <nogahf@mellanox.com>
      Signed-off-by: NYotam Gigi <yotamg@mellanox.com>
      Signed-off-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      63fe813c
    • N
      mlxsw: spectrum: Make port flood update more generic · 69be01f3
      Nogah Frankel 提交于
      Currently, there is a per port flood update function only for the UC
      table. Make the function  more generic by changing the table type to be
      an input.
      Signed-off-by: NNogah Frankel <nogahf@mellanox.com>
      Signed-off-by: NYotam Gigi <yotamg@mellanox.com>
      Signed-off-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      69be01f3
    • N
      mlxsw: spectrum: Break flood set func to be per table · eaa7df3c
      Nogah Frankel 提交于
      Currently, the flood set function can't operate on only one table, but
      sets both uc_flood and mb_flood together.
      This patch creates a function that sets the flood state per table.
      Signed-off-by: NNogah Frankel <nogahf@mellanox.com>
      Signed-off-by: NYotam Gigi <yotamg@mellanox.com>
      Signed-off-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      eaa7df3c
    • I
      mlxsw: spectrum_router: Add support for route replace · 599cf8f9
      Ido Schimmel 提交于
      Upon the reception of an ENTRY_REPLACE notification, resolve the FIB
      node corresponding to the prefix and length and insert the new route
      before the first matching entry.
      
      Since the notification also signals the deletion of the replaced route,
      delete it from the driver's cache.
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      599cf8f9
    • I
      mlxsw: spectrum_router: Add support for route append · 4283bce5
      Ido Schimmel 提交于
      When a new route is appended, it's placed after existing routes sharing
      the same parameters (prefix, length, table ID, TOS and priority).
      
      While the device supports only one route with the same prefix and length
      in a single table, it's important to correctly place the appended route
      in the driver's cache, as when a route is deleted the next one is
      programmed into the device.
      
      Following the reception of an ENTRY_APPEND notification, resolve the
      FIB node corresponding to the prefix and length and correctly place the
      new entry in its entry list.
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4283bce5
    • I
      mlxsw: spectrum_router: Correctly handle identical routes · 9aecce1c
      Ido Schimmel 提交于
      In the device, routes are indexed in a routing table based on the prefix
      and its length. This is in contrast to the kernel's FIB where several
      FIB aliases can exist with these parameters being identical. In such
      cases, the routes will be sorted by table ID (LOCAL first, then MAIN),
      TOS and finally priority (metric).
      
      During lookup, these routes will be evaluated in order. In case the
      packet's TOS field is non-zero and a FIB alias with a matching TOS is
      found, then it's selected. Otherwise, the lookup defaults to the route
      with TOS 0 (if it exists). However, if the requested scope is narrower
      than the one found, then the lookup continues.
      
      To best reflect the kernel's datapath we should take the above into
      account. Given a prefix and its length, the reflected route will always
      be the first one in the FIB alias list. However, if the route has a
      non-zero TOS then its action will be converted to trap instead of
      forward, since we currently don't support TOS-based routing. If this
      turns out to be a real issue, we can add support for that using
      policy-based switching.
      
      The route's scope can be effectively ignored as any packet being routed
      by the device would've been looked-up using the widest scope (UNIVERSE).
      
      To achieve that we need to do two changes. Firstly, we need to create
      another struct (FIB node) that will hold the list of FIB entries sharing
      the same prefix and length. This struct will be hashed using these two
      parameters.
      
      Secondly, we need to change the route reflection to match the above
      logic, so that the first FIB entry in the list will be programmed into
      the device while the rest will remain in the driver's cache in case of
      subsequent changes.
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9aecce1c
  2. 10 2月, 2017 20 次提交