Skip to content
  1. Aug 23, 2021
    • Christophe JAILLET's avatar
      net: ec_bhf: switch from 'pci_' to 'dma_' API · 05fbeb21
      Christophe JAILLET authored
      
      
      The wrappers in include/linux/pci-dma-compat.h should go away.
      
      The patch has been generated with the coccinelle script below.
      
      It has been hand modified to use 'dma_set_mask_and_coherent()' instead of
      'pci_set_dma_mask()/pci_set_consistent_dma_mask()' when applicable.
      This is less verbose.
      
      A useless "err = -EIO;" assignment has been removed.
      'dma_set_mask_and_coherent()' already return only 0 or -EIO.
      
      It has been compile tested.
      
      @@
      @@
      -    PCI_DMA_BIDIRECTIONAL
      +    DMA_BIDIRECTIONAL
      
      @@
      @@
      -    PCI_DMA_TODEVICE
      +    DMA_TO_DEVICE
      
      @@
      @@
      -    PCI_DMA_FROMDEVICE
      +    DMA_FROM_DEVICE
      
      @@
      @@
      -    PCI_DMA_NONE
      +    DMA_NONE
      
      @@
      expression e1, e2, e3;
      @@
      -    pci_alloc_consistent(e1, e2, e3)
      +    dma_alloc_coherent(&e1->dev, e2, e3, GFP_)
      
      @@
      expression e1, e2, e3;
      @@
      -    pci_zalloc_consistent(e1, e2, e3)
      +    dma_alloc_coherent(&e1->dev, e2, e3, GFP_)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_free_consistent(e1, e2, e3, e4)
      +    dma_free_coherent(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_map_single(e1, e2, e3, e4)
      +    dma_map_single(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_unmap_single(e1, e2, e3, e4)
      +    dma_unmap_single(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4, e5;
      @@
      -    pci_map_page(e1, e2, e3, e4, e5)
      +    dma_map_page(&e1->dev, e2, e3, e4, e5)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_unmap_page(e1, e2, e3, e4)
      +    dma_unmap_page(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_map_sg(e1, e2, e3, e4)
      +    dma_map_sg(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_unmap_sg(e1, e2, e3, e4)
      +    dma_unmap_sg(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_dma_sync_single_for_cpu(e1, e2, e3, e4)
      +    dma_sync_single_for_cpu(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_dma_sync_single_for_device(e1, e2, e3, e4)
      +    dma_sync_single_for_device(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_dma_sync_sg_for_cpu(e1, e2, e3, e4)
      +    dma_sync_sg_for_cpu(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_dma_sync_sg_for_device(e1, e2, e3, e4)
      +    dma_sync_sg_for_device(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2;
      @@
      -    pci_dma_mapping_error(e1, e2)
      +    dma_mapping_error(&e1->dev, e2)
      
      @@
      expression e1, e2;
      @@
      -    pci_set_dma_mask(e1, e2)
      +    dma_set_mask(&e1->dev, e2)
      
      @@
      expression e1, e2;
      @@
      -    pci_set_consistent_dma_mask(e1, e2)
      +    dma_set_coherent_mask(&e1->dev, e2)
      
      Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      05fbeb21
    • Christophe JAILLET's avatar
      net: chelsio: switch from 'pci_' to 'dma_' API · 4489d8f5
      Christophe JAILLET authored
      
      
      The wrappers in include/linux/pci-dma-compat.h should go away.
      
      The patch has been generated with the coccinelle script below.
      
      It has been hand modified to use 'dma_set_mask_and_coherent()' instead of
      'pci_set_dma_mask()/pci_set_consistent_dma_mask()' when applicable.
      This is less verbose.
      
      It has been compile tested.
      
      @@
      @@
      -    PCI_DMA_BIDIRECTIONAL
      +    DMA_BIDIRECTIONAL
      
      @@
      @@
      -    PCI_DMA_TODEVICE
      +    DMA_TO_DEVICE
      
      @@
      @@
      -    PCI_DMA_FROMDEVICE
      +    DMA_FROM_DEVICE
      
      @@
      @@
      -    PCI_DMA_NONE
      +    DMA_NONE
      
      @@
      expression e1, e2, e3;
      @@
      -    pci_alloc_consistent(e1, e2, e3)
      +    dma_alloc_coherent(&e1->dev, e2, e3, GFP_)
      
      @@
      expression e1, e2, e3;
      @@
      -    pci_zalloc_consistent(e1, e2, e3)
      +    dma_alloc_coherent(&e1->dev, e2, e3, GFP_)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_free_consistent(e1, e2, e3, e4)
      +    dma_free_coherent(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_map_single(e1, e2, e3, e4)
      +    dma_map_single(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_unmap_single(e1, e2, e3, e4)
      +    dma_unmap_single(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4, e5;
      @@
      -    pci_map_page(e1, e2, e3, e4, e5)
      +    dma_map_page(&e1->dev, e2, e3, e4, e5)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_unmap_page(e1, e2, e3, e4)
      +    dma_unmap_page(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_map_sg(e1, e2, e3, e4)
      +    dma_map_sg(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_unmap_sg(e1, e2, e3, e4)
      +    dma_unmap_sg(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_dma_sync_single_for_cpu(e1, e2, e3, e4)
      +    dma_sync_single_for_cpu(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_dma_sync_single_for_device(e1, e2, e3, e4)
      +    dma_sync_single_for_device(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_dma_sync_sg_for_cpu(e1, e2, e3, e4)
      +    dma_sync_sg_for_cpu(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_dma_sync_sg_for_device(e1, e2, e3, e4)
      +    dma_sync_sg_for_device(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2;
      @@
      -    pci_dma_mapping_error(e1, e2)
      +    dma_mapping_error(&e1->dev, e2)
      
      @@
      expression e1, e2;
      @@
      -    pci_set_dma_mask(e1, e2)
      +    dma_set_mask(&e1->dev, e2)
      
      @@
      expression e1, e2;
      @@
      -    pci_set_consistent_dma_mask(e1, e2)
      +    dma_set_coherent_mask(&e1->dev, e2)
      
      Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4489d8f5
    • Christophe JAILLET's avatar
      net: broadcom: switch from 'pci_' to 'dma_' API · df70303d
      Christophe JAILLET authored
      
      
      The wrappers in include/linux/pci-dma-compat.h should go away.
      
      The patch has been generated with the coccinelle script below.
      
      It has been compile tested.
      
      @@
      @@
      -    PCI_DMA_BIDIRECTIONAL
      +    DMA_BIDIRECTIONAL
      
      @@
      @@
      -    PCI_DMA_TODEVICE
      +    DMA_TO_DEVICE
      
      @@
      @@
      -    PCI_DMA_FROMDEVICE
      +    DMA_FROM_DEVICE
      
      @@
      @@
      -    PCI_DMA_NONE
      +    DMA_NONE
      
      @@
      expression e1, e2, e3;
      @@
      -    pci_alloc_consistent(e1, e2, e3)
      +    dma_alloc_coherent(&e1->dev, e2, e3, GFP_)
      
      @@
      expression e1, e2, e3;
      @@
      -    pci_zalloc_consistent(e1, e2, e3)
      +    dma_alloc_coherent(&e1->dev, e2, e3, GFP_)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_free_consistent(e1, e2, e3, e4)
      +    dma_free_coherent(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_map_single(e1, e2, e3, e4)
      +    dma_map_single(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_unmap_single(e1, e2, e3, e4)
      +    dma_unmap_single(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4, e5;
      @@
      -    pci_map_page(e1, e2, e3, e4, e5)
      +    dma_map_page(&e1->dev, e2, e3, e4, e5)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_unmap_page(e1, e2, e3, e4)
      +    dma_unmap_page(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_map_sg(e1, e2, e3, e4)
      +    dma_map_sg(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_unmap_sg(e1, e2, e3, e4)
      +    dma_unmap_sg(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_dma_sync_single_for_cpu(e1, e2, e3, e4)
      +    dma_sync_single_for_cpu(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_dma_sync_single_for_device(e1, e2, e3, e4)
      +    dma_sync_single_for_device(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_dma_sync_sg_for_cpu(e1, e2, e3, e4)
      +    dma_sync_sg_for_cpu(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_dma_sync_sg_for_device(e1, e2, e3, e4)
      +    dma_sync_sg_for_device(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2;
      @@
      -    pci_dma_mapping_error(e1, e2)
      +    dma_mapping_error(&e1->dev, e2)
      
      @@
      expression e1, e2;
      @@
      -    pci_set_dma_mask(e1, e2)
      +    dma_set_mask(&e1->dev, e2)
      
      @@
      expression e1, e2;
      @@
      -    pci_set_consistent_dma_mask(e1, e2)
      +    dma_set_coherent_mask(&e1->dev, e2)
      
      Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      df70303d
    • Christophe JAILLET's avatar
      net: atlantic: switch from 'pci_' to 'dma_' API · 3852e54e
      Christophe JAILLET authored
      
      
      The wrappers in include/linux/pci-dma-compat.h should go away.
      
      The patch has been generated with the coccinelle script below.
      
      It has been hand modified to use 'dma_set_mask_and_coherent()' instead of
      'pci_set_dma_mask()/pci_set_consistent_dma_mask()' when applicable.
      This is less verbose.
      
      A useless "!= 0" has also been removed in a test.
      
      It has been compile tested.
      
      @@
      @@
      -    PCI_DMA_BIDIRECTIONAL
      +    DMA_BIDIRECTIONAL
      
      @@
      @@
      -    PCI_DMA_TODEVICE
      +    DMA_TO_DEVICE
      
      @@
      @@
      -    PCI_DMA_FROMDEVICE
      +    DMA_FROM_DEVICE
      
      @@
      @@
      -    PCI_DMA_NONE
      +    DMA_NONE
      
      @@
      expression e1, e2, e3;
      @@
      -    pci_alloc_consistent(e1, e2, e3)
      +    dma_alloc_coherent(&e1->dev, e2, e3, GFP_)
      
      @@
      expression e1, e2, e3;
      @@
      -    pci_zalloc_consistent(e1, e2, e3)
      +    dma_alloc_coherent(&e1->dev, e2, e3, GFP_)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_free_consistent(e1, e2, e3, e4)
      +    dma_free_coherent(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_map_single(e1, e2, e3, e4)
      +    dma_map_single(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_unmap_single(e1, e2, e3, e4)
      +    dma_unmap_single(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4, e5;
      @@
      -    pci_map_page(e1, e2, e3, e4, e5)
      +    dma_map_page(&e1->dev, e2, e3, e4, e5)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_unmap_page(e1, e2, e3, e4)
      +    dma_unmap_page(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_map_sg(e1, e2, e3, e4)
      +    dma_map_sg(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_unmap_sg(e1, e2, e3, e4)
      +    dma_unmap_sg(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_dma_sync_single_for_cpu(e1, e2, e3, e4)
      +    dma_sync_single_for_cpu(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_dma_sync_single_for_device(e1, e2, e3, e4)
      +    dma_sync_single_for_device(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_dma_sync_sg_for_cpu(e1, e2, e3, e4)
      +    dma_sync_sg_for_cpu(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_dma_sync_sg_for_device(e1, e2, e3, e4)
      +    dma_sync_sg_for_device(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2;
      @@
      -    pci_dma_mapping_error(e1, e2)
      +    dma_mapping_error(&e1->dev, e2)
      
      @@
      expression e1, e2;
      @@
      -    pci_set_dma_mask(e1, e2)
      +    dma_set_mask(&e1->dev, e2)
      
      @@
      expression e1, e2;
      @@
      -    pci_set_consistent_dma_mask(e1, e2)
      +    dma_set_coherent_mask(&e1->dev, e2)
      
      Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3852e54e
    • Christophe JAILLET's avatar
      net: wwan: iosm: switch from 'pci_' to 'dma_' API · 44ee7658
      Christophe JAILLET authored
      
      
      The wrappers in include/linux/pci-dma-compat.h should go away.
      
      The patch has been generated with the coccinelle script below and has been
      hand modified to replace GFP_ with a correct flag.
      It has been compile tested.
      
      'ipc_protocol_init()' can use GFP_KERNEL, because this flag is already used
      by a 'kzalloc()' call a few lines above.
      
      'ipc_protocol_msg_prepipe_open()' must use GFP_ATOMIC, because this flag is
      already used by a 'kcalloc()' call a few lines above.
      
      @@ @@
      -    PCI_DMA_BIDIRECTIONAL
      +    DMA_BIDIRECTIONAL
      
      @@ @@
      -    PCI_DMA_TODEVICE
      +    DMA_TO_DEVICE
      
      @@ @@
      -    PCI_DMA_FROMDEVICE
      +    DMA_FROM_DEVICE
      
      @@ @@
      -    PCI_DMA_NONE
      +    DMA_NONE
      
      @@
      expression e1, e2, e3;
      @@
      -    pci_alloc_consistent(e1, e2, e3)
      +    dma_alloc_coherent(&e1->dev, e2, e3, GFP_)
      
      @@
      expression e1, e2, e3;
      @@
      -    pci_zalloc_consistent(e1, e2, e3)
      +    dma_alloc_coherent(&e1->dev, e2, e3, GFP_)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_free_consistent(e1, e2, e3, e4)
      +    dma_free_coherent(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_map_single(e1, e2, e3, e4)
      +    dma_map_single(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_unmap_single(e1, e2, e3, e4)
      +    dma_unmap_single(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4, e5;
      @@
      -    pci_map_page(e1, e2, e3, e4, e5)
      +    dma_map_page(&e1->dev, e2, e3, e4, e5)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_unmap_page(e1, e2, e3, e4)
      +    dma_unmap_page(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_map_sg(e1, e2, e3, e4)
      +    dma_map_sg(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_unmap_sg(e1, e2, e3, e4)
      +    dma_unmap_sg(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_dma_sync_single_for_cpu(e1, e2, e3, e4)
      +    dma_sync_single_for_cpu(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_dma_sync_single_for_device(e1, e2, e3, e4)
      +    dma_sync_single_for_device(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_dma_sync_sg_for_cpu(e1, e2, e3, e4)
      +    dma_sync_sg_for_cpu(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_dma_sync_sg_for_device(e1, e2, e3, e4)
      +    dma_sync_sg_for_device(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2;
      @@
      -    pci_dma_mapping_error(e1, e2)
      +    dma_mapping_error(&e1->dev, e2)
      
      @@
      expression e1, e2;
      @@
      -    pci_set_dma_mask(e1, e2)
      +    dma_set_mask(&e1->dev, e2)
      
      @@
      expression e1, e2;
      @@
      -    pci_set_consistent_dma_mask(e1, e2)
      +    dma_set_coherent_mask(&e1->dev, e2)
      
      Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      44ee7658
    • Benjamin Poirier's avatar
      doc: Document unexpected tcp_l3mdev_accept=1 behavior · b1165777
      Benjamin Poirier authored
      
      
      As suggested by David, document a somewhat unexpected behavior that results
      from net.ipv4.tcp_l3mdev_accept=1. This behavior was encountered while
      debugging FRR, a VRF-aware application, on a system which used
      net.ipv4.tcp_l3mdev_accept=1 and where TCP connections for BGP with MD5
      keys were failing to establish.
      
      Cc: David Ahern <dsahern@gmail.com>
      Signed-off-by: default avatarBenjamin Poirier <bpoirier@nvidia.com>
      Reviewed-by: default avatarDavid Ahern <dsahern@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b1165777
    • Vladimir Oltean's avatar
      net: dsa: track unique bridge numbers across all DSA switch trees · f5e165e7
      Vladimir Oltean authored
      
      
      Right now, cross-tree bridging setups work somewhat by mistake.
      
      In the case of cross-tree bridging with sja1105, all switch instances
      need to agree upon a common VLAN ID for forwarding a packet that belongs
      to a certain bridging domain.
      
      With TX forwarding offload, the VLAN ID is the bridge VLAN for
      VLAN-aware bridging, and the tag_8021q TX forwarding offload VID
      (a VLAN which has non-zero VBID bits) for VLAN-unaware bridging.
      
      The VBID for VLAN-unaware bridging is derived from the dp->bridge_num
      value calculated by DSA independently for each switch tree.
      
      If ports from one tree join one bridge, and ports from another tree join
      another bridge, DSA will assign them the same bridge_num, even though
      the bridges are different. If cross-tree bridging is supported, this
      is an issue.
      
      Modify DSA to calculate the bridge_num globally across all switch trees.
      This has the implication for a driver that the dp->bridge_num value that
      DSA will assign to its ports might not be contiguous, if there are
      boards with multiple DSA drivers instantiated. Additionally, all
      bridge_num values eat up towards each switch's
      ds->num_fwd_offloading_bridges maximum, which is potentially unfortunate,
      and can be seen as a limitation introduced by this patch. However, that
      is the lesser evil for now.
      
      Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f5e165e7
    • David S. Miller's avatar
      Revert "sfc: falcon: Read VPD with pci_vpd_alloc()" · 1a6ef20b
      David S. Miller authored
      This reverts commit 3873a9a4
      
      .
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1a6ef20b
    • David S. Miller's avatar
      a7eeb7a7
    • David S. Miller's avatar
      cd3d5d68
    • David S. Miller's avatar
      Revert "bnx2x: Read VPD with pci_vpd_alloc()" · 4fb2c383
      David S. Miller authored
      This reverts commit bed3db3d
      
      .
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4fb2c383
    • David S. Miller's avatar
      82e34c8a
    • David S. Miller's avatar
      Revert "bnx2: Search VPD with pci_vpd_find_ro_info_keyword()" · 3408259b
      David S. Miller authored
      This reverts commit ddc122aa
      
      .
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3408259b
    • David S. Miller's avatar
      Revert "bnxt: Search VPD with pci_vpd_find_ro_info_keyword()" · 4fd13157
      David S. Miller authored
      This reverts commit 58a9b5d2
      
      .
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4fd13157
    • David S. Miller's avatar
      4a55c34e
    • David S. Miller's avatar
      Revert "bnxt: Read VPD with pci_vpd_alloc()" · 197c316c
      David S. Miller authored
      This reverts commit ebcdc8eb
      
      .
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      197c316c
    • David S. Miller's avatar
      Revert "bnxt: Search VPD with pci_vpd_find_ro_info_keyword()" · 54c0bcc0
      David S. Miller authored
      This reverts commit 58a9b5d2
      
      .
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      54c0bcc0
    • David S. Miller's avatar
      df6deaf6
    • Heiner Kallweit's avatar
      cxgb4: Search VPD with pci_vpd_find_ro_info_keyword() · 8d63ee60
      Heiner Kallweit authored
      
      
      Use pci_vpd_find_ro_info_keyword() to search for keywords in VPD to
      simplify the code.
      
      Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8d63ee60
    • Heiner Kallweit's avatar
      cxgb4: Remove unused vpd_param member ec · 3a93bede
      Heiner Kallweit authored
      
      
      Member ec isn't used, so remove it.
      
      Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3a93bede
    • Heiner Kallweit's avatar
      cxgb4: Validate VPD checksum with pci_vpd_check_csum() · 96ce96f1
      Heiner Kallweit authored
      
      
      Validate the VPD checksum with pci_vpd_check_csum() to simplify the code.
      
      Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      96ce96f1
    • Heiner Kallweit's avatar
      bnxt: Search VPD with pci_vpd_find_ro_info_keyword() · 58a9b5d2
      Heiner Kallweit authored
      
      
      Use pci_vpd_find_ro_info_keyword() to search for keywords in VPD to
      simplify the code.
      
      Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      58a9b5d2
    • Heiner Kallweit's avatar
      bnxt: Read VPD with pci_vpd_alloc() · ebcdc8eb
      Heiner Kallweit authored
      
      
      Use pci_vpd_alloc() to dynamically allocate a properly sized buffer and
      read the full VPD data into it.
      
      This simplifies the code, and we no longer have to make assumptions about
      VPD size.
      
      Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ebcdc8eb
    • Heiner Kallweit's avatar
      bnx2x: Search VPD with pci_vpd_find_ro_info_keyword() · da417885
      Heiner Kallweit authored
      
      
      Use pci_vpd_find_ro_info_keyword() to search for keywords in VPD to
      simplify the code.
      
      str_id_reg and str_id_cap hold the same string and are used in the same
      comparison. This doesn't make sense, use one string str_id instead.
      
      Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      da417885
    • Heiner Kallweit's avatar
      bnx2x: Read VPD with pci_vpd_alloc() · bed3db3d
      Heiner Kallweit authored
      
      
      Use pci_vpd_alloc() to dynamically allocate a properly sized buffer and
      read the full VPD data into it.
      
      This simplifies the code, and we no longer have to make assumptions about
      VPD size.
      
      Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      bed3db3d
    • Heiner Kallweit's avatar
      bnx2: Replace open-coded version with swab32s() · 0df79c86
      Heiner Kallweit authored
      
      
      Use swab32s() instead of open-coding it.
      
      Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0df79c86
    • Heiner Kallweit's avatar
      bnx2: Search VPD with pci_vpd_find_ro_info_keyword() · ddc122aa
      Heiner Kallweit authored
      
      
      Use pci_vpd_find_ro_info_keyword() to search for keywords in VPD to
      simplify the code.
      
      Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ddc122aa
    • Heiner Kallweit's avatar
      sfc: falcon: Search VPD with pci_vpd_find_ro_info_keyword() · 01dbe712
      Heiner Kallweit authored
      This is the same as 37838aa4
      
       "sfc: Search VPD with
      pci_vpd_find_ro_info_keyword()", just for the falcon chip version.
      
      Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      01dbe712
    • Heiner Kallweit's avatar
      sfc: falcon: Read VPD with pci_vpd_alloc() · 3873a9a4
      Heiner Kallweit authored
      This is the same as 5119e20f
      
       "sfc: Read VPD with pci_vpd_alloc()",
      just for the falcon chip version.
      
      Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3873a9a4
    • David S. Miller's avatar
      Merge branch 'mlxsw-refactor-parser' · dddb6c2f
      David S. Miller authored
      
      
      Ido Schimmel says:
      
      ====================
      mlxsw: Refactor parsing configuration
      
      The Spectrum ASIC has a configurable limit on how deep into the packet
      it parses. By default, the limit is 96 bytes.
      
      There are several cases where this parsing depth is not enough and there
      is a need to increase it: Decapsulation of VxLAN packets and
      timestamping of PTP packets.
      
      Currently, parsing depth API is maintained as part of VxLAN module,
      because the MPRS register which configures parsing depth also configures
      UDP destination port number used for VxLAN encapsulation and
      decapsulation.
      
      However, in addition to two above mentioned users of this API, the
      multipath hash code also needs to invoke it in order to correctly hash
      based on inner fields of IPv6-in-IPv6 packets.
      
      Upcoming support for IPv6-in-IPv6 tunneling will add another user, as
      without increasing the parsing depth such packets cannot be properly
      decapsulated.
      
      Therefore, this patchset refactors the parsing configuration API and
      moves it out of the VxLAN module to the main driver code.
      
      Tested using existing selftests.
      
      Patch set overview:
      
      Patch #1 adds the new parsing configuration infrastructure.
      Patch #2 converts existing users to the new infrastructure.
      Patch #3 deletes the old infrastructure.
      Patch #4 calls the new infrastructure from the multipath hash code.
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      dddb6c2f
    • Amit Cohen's avatar
      mlxsw: spectrum_router: Increase parsing depth for multipath hash · 43c1b833
      Amit Cohen authored
      Commit 01848e05 ("mlxsw: spectrum_router: Add support for inner
      layer 3 multipath hash policy") and commit daeabf89
      
       ("mlxsw:
      spectrum_router: Add support for custom multipath hash policy") added
      support for multipath hash policies where the hash is calculated based
      on inner packet fields.
      
      For IPv6-in-IPv6 packets, the default parsing depth (96 bytes) is not
      enough when these policies are used.
      
      Therefore, for such cases, call the new API to increase / decrease the
      parsing depth as necessary. Care is taken to ensure the API is not
      called multiple times.
      
      Signed-off-by: default avatarAmit Cohen <amcohen@nvidia.com>
      Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      43c1b833
    • Amit Cohen's avatar
      mlxsw: Remove old parsing depth infrastructure · c3d2ed93
      Amit Cohen authored
      
      
      The previous patches added new API to handle parsing depth and converted
      the existing code to use it.
      
      Remove the old infrastructure which is not needed anymore.
      
      Signed-off-by: default avatarAmit Cohen <amcohen@nvidia.com>
      Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c3d2ed93
    • Amit Cohen's avatar
      mlxsw: Convert existing consumers to use new API for parsing configuration · 0071e7cd
      Amit Cohen authored
      
      
      Convert VxLAN and PTP modules to increase parsing depth using new API
      that was added in the previous patch.
      
      Separate MPRS register's configuration to VxLAN related configuration
      and parsing depth configuration. Handle each one using the appropriate
      API.
      
      Signed-off-by: default avatarAmit Cohen <amcohen@nvidia.com>
      Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0071e7cd
    • Amit Cohen's avatar
      mlxsw: spectrum: Add infrastructure for parsing configuration · 2d91f080
      Amit Cohen authored
      
      
      Spectrum ASICs have a configurable limit on how deep into the packet
      they parse. By default, the limit is 96 bytes.
      
      There are several cases where this parsing depth is not enough and there
      is a need to increase it. Currently, increasing parsing depth is
      maintained as part of VxLAN module, because the MPRS register which
      configures parsing depth also configures UDP destination port number
      used for VxLAN encapsulation and decapsulation.
      
      Add an API for increasing parsing depth as part of spectrum.c code, so
      that it will be possible to use it from other modules. In addition, add
      an API for setting UDP destination port and protect it using a dedicated
      lock for saving parsing configurations. The lock is needed as not all
      the callers hold RTNL lock.
      
      Maintain a counter for increased parsing depth consumers. For first
      consumer subscription, increase the parsing depth and for last consumer
      unsubscription, set parsing depth to default value.
      
      Signed-off-by: default avatarAmit Cohen <amcohen@nvidia.com>
      Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2d91f080
    • David S. Miller's avatar
      Merge branch 'octeontx2-misc-fixes' · 809159ee
      David S. Miller authored
      
      
      Sunil Goutham says:
      
      ====================
      octeontx2: Miscellaneous fixes
      
      This patch series contains a bunch of miscellaneous fixes
      for various issues like
      - Free unallocated memory during driver unload
      - HW reading transmit descriptor from wrong address
      - VF VLAN strip offload MCAM entry installation failure
      - Pkts not being distributed across queues in RSS context
      - Wrong interface backpressure configuration for NIX1 block on 98xx
      - etc
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      809159ee
    • Geetha sowjanya's avatar
      octeontx2-af: cn10k: Use FLIT0 register instead of FLIT1 · 623da5ca
      Geetha sowjanya authored
      RVU SMMU widget stores the final translated PA at
      RVU_AF_SMMU_TLN_FLIT0<57:18> instead of FLIT1 register. This patch
      fixes the address translation logic to use the correct register.
      
      Fixes: 893ae972
      
       ("octeontx2-af: cn10k: Support configurable LMTST regions")
      Signed-off-by: default avatarGeetha sowjanya <gakula@marvell.com>
      Signed-off-by: default avatarSunil Goutham <sgoutham@marvell.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      623da5ca
    • Sunil Goutham's avatar
      octeontx2-pf: Fix algorithm index in MCAM rules with RSS action · e7938365
      Sunil Goutham authored
      Otherthan setting action as RSS in NPC MCAM entry, RSS flowkey
      algorithm index also needs to be set. Otherwise whatever algorithm
      is defined at flowkey index '0' will be considered by HW and pkt
      flows will be distributed as such.
      
      Fix this by saving the flowkey index sent by admin function while
      initializing RSS and then use it when framing MCAM rules.
      
      Fixes: 81a43620
      
       ("octeontx2-pf: Add RSS multi group support")
      Signed-off-by: default avatarSunil Goutham <sgoutham@marvell.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e7938365
    • Sunil Goutham's avatar
      octeontx2-pf: Don't install VLAN offload rule if netdev is down · 05209e35
      Sunil Goutham authored
      Whenever user changes interface MAC address both default DMAC based
      MCAM rule and VLAN offload (for strip) rules are updated with new
      MAC address. To update or install VLAN offload rule PF driver needs
      interface's receive channel info, which is retrieved from admin
      function at the time of NIXLF initialization.
      
      If user changes MAC address before interface is UP, VLAN offload rule
      installation will fail and throw error as receive channel is not valid.
      To avoid this, skip VLAN offload rule installation if netdev is not UP.
      This rule will anyway be reinslatted as part of open() call.
      
      Fixes: fd9d7859
      
       ("octeontx2-pf: Implement ingress/egress VLAN offload")
      Signed-off-by: default avatarSunil Goutham <sgoutham@marvell.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      05209e35
    • Geetha sowjanya's avatar
      octeontx2-af: Check capability flag while freeing ipolicer memory · 07cccffd
      Geetha sowjanya authored
      Bandwidth profiles (ipolicer structure)is implemented only on CN10K
      platform. But current code try to free the ipolicer memory without
      checking the capibility flag leading to driver crash on OCTEONTX2
      platform. This patch fixes the issue by add capability flag check.
      
      Fixes: e8e095b3
      
       ("octeontx2-af: cn10k: Bandwidth profiles config support")
      Signed-off-by: default avatarGeetha sowjanya <gakula@marvell.com>
      Signed-off-by: default avatarSunil Goutham <sgoutham@marvell.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      07cccffd
    • Geetha sowjanya's avatar
      octeontx2-af: Use DMA_ATTR_FORCE_CONTIGUOUS attribute in DMA alloc · 73d33dbc
      Geetha sowjanya authored
      
      
      CN10K platform requires physically contiguous memory for LMTST
      operations which goes beyond a single page. Not having physically
      contiguous memory will result in HW fetching transmit descriptors from
      a wrong memory location.
      
      Hence use DMA_ATTR_FORCE_CONTIGUOUS attribute while allocating
      LMTST regions.
      
      Signed-off-by: default avatarGeetha sowjanya <gakula@marvell.com>
      Signed-off-by: default avatarSunil Goutham <sgoutham@marvell.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      73d33dbc