1. 01 Jul, 2020 30 commits
    • Alex Elder's avatar
      net: ipa: standarize more GSI error messages · 8463488a
      Alex Elder authored
      Make minor updates to error messages reported in "gsi.c":
        - Use local variables to reduce multi-line function calls
        - Don't use parentheses in messages
        - Do some slight rewording in a few cases
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8463488a
    • Alex Elder's avatar
      net: ipa: always report GSI state errors · a442b3c7
      Alex Elder authored
      We check the state of an event ring or channel both before and after
      any GSI command issued that will change that state.  In most--but
      not all--cases, if the state is something different than expected we
      report an error message.
      
      Add error messages where missing, so that all unexpected states
      provide information about what went wrong.  Drop the parentheses
      around the state value shown in all cases.
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a442b3c7
    • David S. Miller's avatar
      Merge branch 'net-ipa-simple-refactorizations' · 6f6746d7
      David S. Miller authored
      Alex Elder says:
      
      ====================
      net: ipa: simple refactorizations
      
      This series makes three small changes to some endpoint configuration
      code.  The first uses a constant to represent the frequency of an
      internal clock used for timers in the IPA.  The second modifies a
      limit used so it matches Qualcomm's internal code.  And the third
      reworks a few lines of code, eliminating a multi-line function call.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6f6746d7
    • Alex Elder's avatar
      net: ipa: reuse a local variable in ipa_endpoint_init_aggr() · 9e88cb5f
      Alex Elder authored
      Reuse the "limit" local variable in ipa_endpoint_init_aggr() when
      setting the aggregation size limit.  Simple cleanup.
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9e88cb5f
    • Alex Elder's avatar
      net: ipa: reduce aggregation time limit · 1d86652b
      Alex Elder authored
      Halve the time limit used when aggregation is enabled on an RX
      endpoint, to half a millisecond.
      
      Use DIV_ROUND_CLOSEST() to compute the value that represents the
      time period, to get better accuracy in the event the time limit is
      not an even multiple of the granularity.
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1d86652b
    • Alex Elder's avatar
      net: ipa: rework ipa_aggr_granularity_val() · 317a5740
      Alex Elder authored
      The timer used for aggregation makes use of an internal 32 KHz clock.
      The granularity of the timer is programmed by a field whose value is
      computed by ipa_aggr_granularity_val().  Redefine the way that value
      is computed by using a new TIMER_FREQUENCY constant representing the
      underlying clock frequency.
      
      Add two BUILD_BUG_ON() calls to ensure the value used is valid.
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      317a5740
    • David S. Miller's avatar
      Merge branch 'add-XDP-support-to-xen-netfront' · 8c964397
      David S. Miller authored
      Denis Kirjanov says:
      
      ====================
      xen networking: add XDP support to xen-netfront
      
      The first patch adds a new extra type to enable proper synchronization
      between an RX request/response pair.
      The second patch implements BFP interface for xen-netfront.
      The third patch enables extra space for XDP processing.
      
      v14:
      - fixed compilation warnings
      
      v13:
      - fixed compilation due to previous rename
      
      v12:
      - xen-netback: rename netfront_xdp_headroom to xdp_headroom
      
      v11:
      - add the new headroom constant to netif.h
      - xenbus_scanf check
      - lock a bulk of puckets in xennet_xdp_xmit()
      
      v10:
      - add a new xen_netif_extra_info type to enable proper synchronization
       between an RX request/response pair.
      - order local variable declarations
      
      v9:
      - assign an xdp program before switching to Reconfiguring
      - minor cleanups
      - address checkpatch issues
      
      v8:
      - add PAGE_POOL config dependency
      - keep the state of XDP processing in netfront_xdp_enabled
      - fixed allocator type in xdp_rxq_info_reg_mem_model()
      - minor cleanups in xen-netback
      
      v7:
      - use page_pool_dev_alloc_pages() on page allocation
      - remove the leftover break statement from netback_changed
      
      v6:
      - added the missing SOB line
      - fixed subject
      
      v5:
      - split netfront/netback changes
      - added a sync point between backend/frontend on switching to XDP
      - added pagepool API
      
      v4:
      - added verbose patch descriprion
      - don't expose the XDP headroom offset to the domU guest
      - add a modparam to netback to toggle XDP offset
      - don't process jumbo frames for now
      
      v3:
      - added XDP_TX support (tested with xdping echoserver)
      - added XDP_REDIRECT support (tested with modified xdp_redirect_kern)
      - moved xdp negotiation to xen-netback
      
      v2:
      - avoid data copying while passing to XDP
      - tell xen-netback that we need the headroom space
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8c964397
    • Denis Kirjanov's avatar
      xen networking: add XDP offset adjustment to xen-netback · 1c9535c7
      Denis Kirjanov authored
      the patch basically adds the offset adjustment and netfront
      state reading to make XDP work on netfront side.
      Reviewed-by: default avatarPaul Durrant <paul@xen.org>
      Signed-off-by: default avatarDenis Kirjanov <kda@linux-powerpc.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1c9535c7
    • Denis Kirjanov's avatar
      xen networking: add basic XDP support for xen-netfront · 6c5aa6fc
      Denis Kirjanov authored
      The patch adds a basic XDP processing to xen-netfront driver.
      
      We ran an XDP program for an RX response received from netback
      driver. Also we request xen-netback to adjust data offset for
      bpf_xdp_adjust_head() header space for custom headers.
      
      synchronization between frontend and backend parts is done
      by using xenbus state switching:
      Reconfiguring -> Reconfigured- > Connected
      
      UDP packets drop rate using xdp program is around 310 kpps
      using ./pktgen_sample04_many_flows.sh and 160 kpps without the patch.
      Signed-off-by: default avatarDenis Kirjanov <kda@linux-powerpc.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6c5aa6fc
    • Denis Kirjanov's avatar
      xen: netif.h: add a new extra type for XDP · 2cef30d7
      Denis Kirjanov authored
      The patch adds a new extra type to be able to diffirentiate
      between RX responses on xen-netfront side with the adjusted offset
      required for XDP processing.
      
      The offset value from a guest is passed via xenstore.
      Signed-off-by: default avatarDenis Kirjanov <kda@linux-powerpc.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2cef30d7
    • David S. Miller's avatar
      Merge branch 'net-ethernet-use-generic-power-management' · 6d79dc67
      David S. Miller authored
      Vaibhav Gupta says:
      
      ====================
      net: ethernet: use generic power management
      
      Linux Kernel Mentee: Remove Legacy Power Management.
      
      The purpose of this patch series is to remove legacy power management callbacks
      from net ethernet drivers.
      
      The callbacks performing suspend() and resume() operations are still calling
      pci_save_state(), pci_set_power_state(), etc. and handling the power management
      themselves, which is not recommended.
      
      The conversion requires the removal of the those function calls and change the
      callback definition accordingly and make use of dev_pm_ops structure.
      
      All patches are compile-tested only.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6d79dc67
    • Vaibhav Gupta's avatar
      natsemi: use generic power management · 40c1b1ee
      Vaibhav Gupta authored
      With legacy PM, drivers themselves were responsible for managing the
      device's power states and takes care of register states.
      
      After upgrading to the generic structure, PCI core will take care of
      required tasks and drivers should do only device-specific operations.
      
      Thus, there is no need to call the PCI helper functions like
      pci_enable_device, which is not recommended. Hence, removed.
      
      Compile-tested only.
      Signed-off-by: default avatarVaibhav Gupta <vaibhavgupta40@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      40c1b1ee
    • Vaibhav Gupta's avatar
      vxge: use generic power management · 4c2ad126
      Vaibhav Gupta authored
      With legacy PM, drivers themselves were responsible for managing the
      device's power states and takes care of register states.
      
      After upgrading to the generic structure, PCI core will take care of
      required tasks and drivers should do only device-specific operations.
      
      Use "struct dev_pm_ops" variable to bind the callbacks.
      
      Compile-tested only.
      Signed-off-by: default avatarVaibhav Gupta <vaibhavgupta40@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4c2ad126
    • Vaibhav Gupta's avatar
      ksz884x: use generic power management · 64120615
      Vaibhav Gupta authored
      With legacy PM, drivers themselves were responsible for managing the
      device's power states and takes care of register states.
      
      After upgrading to the generic structure, PCI core will take care of
      required tasks and drivers should do only device-specific operations.
      
      Thus, there is no need to call the PCI helper functions like
      pci_enable_wake(), pci_save/restore_sate() and
      pci_set_power_state().
      
      Compile-tested only.
      Signed-off-by: default avatarVaibhav Gupta <vaibhavgupta40@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      64120615
    • Vaibhav Gupta's avatar
      mlx4: use generic power management · 0e3e206a
      Vaibhav Gupta authored
      With legacy PM, drivers themselves were responsible for managing the
      device's power states and takes care of register states.
      
      After upgrading to the generic structure, PCI core will take care of
      required tasks and drivers should do only device-specific operations.
      
      Use "struct dev_pm_ops" variable to bind the callbacks.
      
      Compile-tested only.
      Signed-off-by: default avatarVaibhav Gupta <vaibhavgupta40@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0e3e206a
    • Vaibhav Gupta's avatar
      benet: use generic power management · e9a7f8c5
      Vaibhav Gupta authored
      With legacy PM, drivers themselves were responsible for managing the
      device's power states and takes care of register states.
      
      After upgrading to the generic structure, PCI core will take care of
      required tasks and drivers should do only device-specific operations.
      
      Thus, there is no need to call the PCI helper functions like
      pci_enable/disable_device(), pci_save/restore_sate() and
      pci_set_power_state().
      
      Compile-tested only.
      Signed-off-by: default avatarVaibhav Gupta <vaibhavgupta40@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e9a7f8c5
    • Vaibhav Gupta's avatar
      sundance: use generic power management · 78cad4ce
      Vaibhav Gupta authored
      With legacy PM, drivers themselves were responsible for managing the
      device's power states and takes care of register states.
      
      After upgrading to the generic structure, PCI core will take care of
      required tasks and drivers should do only device-specific operations.
      
      Thus, there is no need to call the PCI helper functions like
      pci_enable/disable_device(), pci_save/restore_sate() and
      pci_set_power_state().
      
      Compile-tested only.
      Signed-off-by: default avatarVaibhav Gupta <vaibhavgupta40@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      78cad4ce
    • Vaibhav Gupta's avatar
      liquidio: use generic power management · 1c2e4839
      Vaibhav Gupta authored
      Drivers should not use legacy power management as they have to manage power
      states and related operations, for the device, themselves. This driver was
      handling them with the help of PCI helper functions.
      
      With generic PM, all essentials will be handled by the PCI core. Driver
      needs to do only device-specific operations.
      
      The driver defined empty-body .suspend() and .resume() callbacks earlier.
      They can now be define NULL and bind with "struct dev_pm_ops" variable.
      
      Compile-tested only.
      Signed-off-by: default avatarVaibhav Gupta <vaibhavgupta40@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1c2e4839
    • Vaibhav Gupta's avatar
      ena_netdev: use generic power management · 817a89ae
      Vaibhav Gupta authored
      With legacy PM, drivers themselves were responsible for managing the
      device's power states and takes care of register states.
      
      After upgrading to the generic structure, PCI core will take care of
      required tasks and drivers should do only device-specific operations.
      
      Compile-tested only.
      Signed-off-by: default avatarVaibhav Gupta <vaibhavgupta40@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      817a89ae
    • Vaibhav Gupta's avatar
      starfire: use generic power management · a7c48c72
      Vaibhav Gupta authored
      With legacy PM, drivers themselves were responsible for managing the
      device's power states and takes care of register states.
      
      After upgrading to the generic structure, PCI core will take care of
      required tasks and drivers should do only device-specific operations.
      
      Thus, there is no need to call the PCI helper functions like
      pci_save/restore_sate() and pci_set_power_state().
      
      Compile-tested only.
      Signed-off-by: default avatarVaibhav Gupta <vaibhavgupta40@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a7c48c72
    • Vaibhav Gupta's avatar
      ne2k-pci: use generic power management · 33b7a252
      Vaibhav Gupta authored
      With legacy PM, drivers themselves were responsible for managing the
      device's power states and takes care of register states.
      
      After upgrading to the generic structure, PCI core will take care of
      required tasks and drivers should do only device-specific operations.
      
      Thus, there is no need to call the PCI helper functions like
      pci_enable/disable_device(), pci_save/restore_sate() and
      pci_set_power_state().
      
      Compile-tested only.
      Signed-off-by: default avatarVaibhav Gupta <vaibhavgupta40@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      33b7a252
    • Vaibhav Gupta's avatar
      typhoon: use generic power management · 7b46681c
      Vaibhav Gupta authored
      With legacy PM, drivers themselves were responsible for managing the
      device's power states and takes care of register states. And they use PCI
      helper functions to do it.
      
      After upgrading to the generic structure, PCI core will take care of
      required tasks and drivers should do only device-specific operations.
      
      In this driver:
      typhoon_resume() calls typhoon_wakeup() which then calls PCI helper
      functions pci_set_power_state() and pci_restore_state(). The only other
      function, using typhoon_wakeup() is typhoon_open().
      
      Thus remove the pci_*() calls from tyhpoon_wakeup() and place them in
      typhoon_open(), maintaining the order, to retain the normal behavior of
      the function
      
      Now, typhoon_suspend() calls typhoon_sleep() which then calls PCI helper
      functions pci_enable_wake(), pci_disable_device() and
      pci_set_power_state(). Other functions:
       - typhoon_open()
       - typhoon_close()
       - typhoon_init_one()
      are also invoking typhoon_sleep(). Thus, in this case, cannot simply
      move PCI helper functions call.
      
      Hence, define a new function typhoon_sleep_early() which will do all the
      operations, which typhoon_sleep() was doing before calling PCI helper
      functions. Now typhoon_sleep() will call typhoon_sleep_early() to do
      those tasks, hence, the behavior for _open(), _close and _init_one() remain
      unchanged. And typhon_suspend() only requires typhoon_sleep_early().
      
      Compile-tested only.
      Signed-off-by: default avatarVaibhav Gupta <vaibhavgupta40@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7b46681c
    • Hulk Robot's avatar
      qed: Make symbol 'qed_hw_err_type_descr' static · 4f195d28
      Hulk Robot authored
      Fix sparse build warning:
      
      drivers/net/ethernet/qlogic/qed/qed_main.c:2480:6: warning:
       symbol 'qed_hw_err_type_descr' was not declared. Should it be static?
      Signed-off-by: default avatarHulk Robot <hulkci@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4f195d28
    • Colin Ian King's avatar
      net/packet: remove redundant initialization of variable err · 2a6d6c31
      Colin Ian King authored
      The variable err is being initialized with a value that is never read
      and it is being updated later with a new value.  The initialization is
      redundant and can be removed.
      
      Addresses-Coverity: ("Unused value")
      Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2a6d6c31
    • David S. Miller's avatar
      Merge branch 'cxgb4-add-mirror-action-support-for-TC-MATCHALL' · 2b04a661
      David S. Miller authored
      Rahul Lakkireddy says:
      
      ====================
      cxgb4: add mirror action support for TC-MATCHALL
      
      This series of patches add support to mirror all ingress traffic
      for TC-MATCHALL ingress offload.
      
      Patch 1 adds support to dynamically create a mirror Virtual Interface
      (VI) that accepts all mirror ingress traffic when mirror action is
      set in TC-MATCHALL offload.
      
      Patch 2 adds support to allocate mirror Rxqs and setup RSS for the
      mirror VI.
      
      Patch 3 adds support to replicate all the main VI configuration to
      mirror VI. This includes replicating MTU, promiscuous mode,
      all-multicast mode, and enabled netdev Rx feature offloads.
      
      v3:
      - Replace mirror VI refcount_t with normal u32 variable in all patches.
      - Add back calling cxgb4_port_mirror_start() in cxgb_open(), which
        was there in v1, but got missed in v2 during refactoring, in patch
        3.
      
      v2:
      - Add mutex to protect all mirror VI data, instead of just
        mirror Rxqs, in patch 1 and 2.
      - Remove the un-needed mirror Rxq mutex in patch 2.
      - Simplify the replication code by refactoring t4_set_rxmode()
        to handle mirror VI, instead of duplicating the t4_set_rxmode()
        calls in multiple places in patch 3.
      ====================
      Reviewed-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2b04a661
    • Rahul Lakkireddy's avatar
      cxgb4: add main VI to mirror VI config replication · 696c278f
      Rahul Lakkireddy authored
      When mirror VI is enabled, replicate various VI config params
      enabled on main VI to mirror VI. These include replicating MTU,
      promiscuous mode, all-multicast mode, and enabled netdev Rx
      feature offloads.
      
      v3:
      - Replace mirror VI refcount_t with normal u32 variable.
      - Add back calling cxgb4_port_mirror_start() in cxgb_open(), which
        was there in v1, but got missed in v2 during refactoring.
      
      v2:
      - Simplify the replication code by refactoring t4_set_rxmode()
        to handle mirror VI, instead of duplicating the t4_set_rxmode()
        calls in multiple places.
      Signed-off-by: default avatarRahul Lakkireddy <rahul.lakkireddy@chelsio.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      696c278f
    • Rahul Lakkireddy's avatar
      cxgb4: add support for mirror Rxqs · 2b465ed0
      Rahul Lakkireddy authored
      When mirror VI is enabled, allocate the mirror Rxqs and setup the
      mirror VI RSS table. The mirror Rxqs are allocated/freed when
      the mirror VI is created/destroyed or when underlying port is
      brought up/down, respectively.
      
      v3:
      - Replace mirror VI refcount_t with normal u32 variable.
      
      v2:
      - Use mutex to protect all mirror VI data, instead of just
        mirror Rxqs.
      - Remove the un-needed mirror Rxq mutex.
      Signed-off-by: default avatarRahul Lakkireddy <rahul.lakkireddy@chelsio.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2b465ed0
    • Rahul Lakkireddy's avatar
      cxgb4: add mirror action to TC-MATCHALL offload · fd2261d8
      Rahul Lakkireddy authored
      Add mirror Virtual Interface (VI) support to receive all ingress
      mirror traffic from the underlying device. The mirror VI is
      created dynamically, if the TC-MATCHALL rule has a corresponding
      mirror action. Also request MSI-X vectors needed for the mirror VI
      Rxqs. If no vectors are available, then disable mirror VI support.
      
      v3:
      - Replace mirror VI refcount_t with normal u32 variable.
      
      v2:
      - Add mutex to protect all mirror VI data, instead of just
        mirror Rxqs.
      Signed-off-by: default avatarRahul Lakkireddy <rahul.lakkireddy@chelsio.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fd2261d8
    • Nathan Chancellor's avatar
      pcnet32: Mark PM functions as __maybe_unused · 75603a31
      Nathan Chancellor authored
      In certain configurations without power management support, the
      following warnings happen:
      
      ../drivers/net/ethernet/amd/pcnet32.c:2928:12: warning:
      'pcnet32_pm_resume' defined but not used [-Wunused-function]
       2928 | static int pcnet32_pm_resume(struct device *device_d)
            |            ^~~~~~~~~~~~~~~~~
      ../drivers/net/ethernet/amd/pcnet32.c:2916:12: warning:
      'pcnet32_pm_suspend' defined but not used [-Wunused-function]
       2916 | static int pcnet32_pm_suspend(struct device *device_d)
            |            ^~~~~~~~~~~~~~~~~~
      
      Mark these functions as __maybe_unused to make it clear to the compiler
      that this is going to happen based on the configuration, which is the
      standard for these types of functions.
      
      Fixes: a86688fb ("pcnet32: Convert to generic power management")
      Signed-off-by: default avatarNathan Chancellor <natechancellor@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      75603a31
    • Nathan Chancellor's avatar
      amd8111e: Mark PM functions as __maybe_unused · 0adcd298
      Nathan Chancellor authored
      In certain configurations without power management support, the
      following warnings happen:
      
      ../drivers/net/ethernet/amd/amd8111e.c:1623:12: warning:
      'amd8111e_resume' defined but not used [-Wunused-function]
       1623 | static int amd8111e_resume(struct device *dev_d)
            |            ^~~~~~~~~~~~~~~
      ../drivers/net/ethernet/amd/amd8111e.c:1584:12: warning:
      'amd8111e_suspend' defined but not used [-Wunused-function]
       1584 | static int amd8111e_suspend(struct device *dev_d)
            |            ^~~~~~~~~~~~~~~~
      
      Mark these functions as __maybe_unused to make it clear to the compiler
      that this is going to happen based on the configuration, which is the
      standard for these types of functions.
      
      Fixes: 2caf751f ("amd8111e: Convert to generic power management")
      Signed-off-by: default avatarNathan Chancellor <natechancellor@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0adcd298
  2. 30 Jun, 2020 10 commits