1. 24 9月, 2020 1 次提交
    • S
      octeontx2-af: Introduce tracepoints for mailbox · 49142d12
      Subbaraya Sundeep 提交于
      Added tracepoints in mailbox code so that
      the mailbox operations like message allocation,
      sending message and message interrupts are traced.
      Also the mailbox errors occurred like timeout
      or wrong responses are traced.
      These will help in debugging mailbox issues.
      
      Here's an example output showing one of the mailbox
      messages sent by PF to AF and AF responding to it:
      
      ~# mount -t tracefs none /sys/kernel/tracing/
      ~# echo 1 > /sys/kernel/tracing/events/rvu/enable
      ~# ifconfig eth0 up
      ~# cat /sys/kernel/tracing/trace
      
      ~# cat /sys/kernel/tracing/trace
       tracer: nop
      
      		      _-----=> irqs-off
      		     / _----=> need-resched
      		    | / _---=> hardirq/softirq
      		    || / _--=> preempt-depth
      		    ||| /     delay
         TASK-PID   CPU#  ||||    TIMESTAMP  FUNCTION
            | |       |   ||||       |         |
      ifconfig-2382  [002] ....   756.161892: otx2_msg_alloc: [0002:02:00.0] msg:(0x400) size:40
      
      ifconfig-2382  [002] ...1   756.161895: otx2_msg_send: [0002:02:00.0] sent 1 msg(s) of size:48
      
       <idle>-0     [000] d.h1   756.161902: otx2_msg_interrupt: [0002:01:00.0] mbox interrupt PF(s) to AF (0x2)
      
      kworker/u49:0-1165  [000] ....   756.162049: otx2_msg_process: [0002:01:00.0] msg:(0x400) error:0
      
      kworker/u49:0-1165  [000] ...1   756.162051: otx2_msg_send: [0002:01:00.0] sent 1 msg(s) of size:32
      
      kworker/u49:0-1165  [000] d.h.   756.162056: otx2_msg_interrupt: [0002:02:00.0] mbox interrupt AF to PF (0x1)
      Signed-off-by: NSubbaraya Sundeep <sbhatta@marvell.com>
      Signed-off-by: NSunil Goutham <sgoutham@marvell.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      49142d12
  2. 25 8月, 2020 1 次提交
  3. 24 3月, 2020 1 次提交
  4. 03 3月, 2020 4 次提交
    • S
      octeontx2-af: Modify rvu_reg_poll() to check reg atleast twice · dc819c1b
      Sunil Goutham 提交于
      Currently on the first check if the operation is still not
      finished, the poll goes to sleep for 2-5 usecs. But if for
      some reason (due to other priority stuff like interrupts etc) by
      the time the poll wakes up the 10ms time is expired then we don't
      check if operation is finished or not and return failure.
      
      This patch modifies poll logic to check HW operation after sleep so
      that the status is checked atleast twice.
      Signed-off-by: NSunil Goutham <sgoutham@marvell.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      dc819c1b
    • S
      octeontx2-af: Enable PCI master · 549c35ec
      Sunil Goutham 提交于
      Bus mastering is enabled by firmware, but when this driver
      is unbinded bus mastering gets disabled by the PCI subsystem
      which results interrupts not working when driver is reloaded.
      Hence set bus mastering everytime in probe().
      
      Also
      - Converted pci_set_dma_mask() and pci_set_consistent_dma_mask()
        to dma_set_mask_and_coherent().
      - Cleared transaction pending bit which gets set during
        driver unbind due to clearing of bus mastering (ME bit).
      Signed-off-by: NSunil Goutham <sgoutham@marvell.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      549c35ec
    • S
      octeontx2-af: Set discovery ID for RVUM block · 8315f9b2
      Sunil Goutham 提交于
      Currently there is no way for AF dependent drivers in
      any domain to check if the AF driver is loaded. This
      patch sets an ID for RVUM block which will automatically
      reflects in PF/VFs discovery register which they can
      check and defer their probe until AF is up.
      Signed-off-by: NSunil Goutham <sgoutham@marvell.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8315f9b2
    • L
      octeontx2-af: Optimize data retrieval from firmware · 4f4eebf2
      Linu Cherian 提交于
      For retrieving info like interface MAC addresses, packet
      parser key extraction config etc currently a command
      is sent to firmware and firmware which periodically polls
      for commands, processes these and returns the info.
      
      This is resulting in interface initialization taking lot
      of time. To optimize this a memory region is shared between
      firmware and this driver, firmware while booting puts
      static info like these into that region for driver to
      read directly without using commands.
      
      With this
      - Logic for retrieving packet parser extraction config
        via commands is removed and repalced with using the
        shared 'fwdata' structure.
      - Now RVU MSIX vector address is also retrieved from this fwdata struct
        instead of from CSR. Otherwise when kexec/kdump crash kernel loads
        CSR will have a IOVA setup by primary kernel which impacts
        RVU PF/VF's interrupts.
      - Also added a mbox handler for PF/VF interfaces to retrieve their MAC
        addresses from AF.
      Signed-off-by: NLinu Cherian <lcherian@marvell.com>
      Signed-off-by: NChristina Jacob <cjacob@marvell.com>
      Signed-off-by: NRakesh Babu <rsaladi2@marvell.com>
      Signed-off-by: NSunil Goutham <sgoutham@marvell.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4f4eebf2
  5. 15 11月, 2019 7 次提交
  6. 04 12月, 2018 1 次提交
    • V
      octeontx2-af: Enable mkex profile · 23705adb
      Vamsi Attunuru 提交于
      The following set of NPC registers allow the driver to configure NPC
      to generate different key value schemes to compare against packet
      payload in MCAM search.
      
      NPC_AF_INTF(0..1)_KEX_CFG
      NPC_AF_KEX_LDATA(0..1)_FLAGS_CFG
      NPC_AF_INTF(0..1)_LID(0..7)_LT(0..15)_LD(0..1)_CFG
      NPC_AF_INTF(0..1)_LDATA(0..1)_FLAGS(0..15)_CFG
      
      Currently, the AF driver populates these registers to
      configure the default values to address the most common
      use cases such as key generation for channel number + DMAC.
      
      The secure firmware stores different configuration
      value of these registers to enable different NPC use case
      along with the name for the lookup.
      
      Patch loads profile binary from secure firmware over
      the exiting CGX mailbox interface and apply the profile.
      
      AF driver shall fall back to the default configuration
      in case of any errors.
      
      The AF consumer driver can know the selected profile
      on response to NPC_GET_KEX_CFG mailbox by introducing
      mkex_pfl_name in the struct npc_get_kex_cfg_rsp.
      Signed-off-by: NVamsi Attunuru <vamsi.attunuru@marvell.com>
      Signed-off-by: NJerin Jacob <jerinj@marvell.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      23705adb
  7. 24 11月, 2018 1 次提交
  8. 20 11月, 2018 9 次提交
  9. 23 10月, 2018 3 次提交
    • S
      octeontx2-af: Config NPC KPU engines with parser profile · 23923ea4
      Sunil Goutham 提交于
      This patch configures all 16 KPUs and iKPU (pkinds) with
      the KPU parser profile defined in npc_profile.h. Each KPU
      engine has a 128 entry CAM, only CAM entries which are listed
      in the profile are enabled and rest are left disabled.
      
      Also
      - Memory is allocated for pkind's bitmap and PFFUNC, interface
        channel mapping.
      - Added all CSR offsets of NPC HW block.
      Signed-off-by: NSunil Goutham <sgoutham@marvell.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      23923ea4
    • S
      octeontx2-af: NIX Tx scheduler queues alloc/free · a3e7121c
      Sunil Goutham 提交于
      Added support for a PF/VF to allocate or free NIX transmit
      scheduler queues via mbox. For setting up pkt transmission
      priorities between queues, the scheduler queues have to be
      contiguous w.r.t their HW indices. So both contiguous and
      non-contiguous allocations are supported.
      
      Upon receiving NIX_TXSCH_FREE mbox msg all scheduler queues
      allocated to sending PFFUNC (PF/VF) will be freed. Selective
      free is not supported.
      Signed-off-by: NSunil Goutham <sgoutham@marvell.com>
      Signed-off-by: NNithin Dabilpuram <ndabilpuram@marvell.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a3e7121c
    • Y
      octeontx2-af: Remove set but not used variables 'devnum, is_pf' · eec6f752
      YueHaibing 提交于
      Fixes gcc '-Wunused-but-set-variable' warning:
      
      drivers/net/ethernet/marvell/octeontx2/af/rvu.c: In function 'rvu_detach_rsrcs':
      drivers/net/ethernet/marvell/octeontx2/af/rvu.c:855:6: warning:
       variable 'devnum' set but not used [-Wunused-but-set-variable]
      
      drivers/net/ethernet/marvell/octeontx2/af/rvu.c:853:7: warning:
       variable 'is_pf' set but not used [-Wunused-but-set-variable]
      
      drivers/net/ethernet/marvell/octeontx2/af/rvu.c: In function 'rvu_mbox_handler_ATTACH_RESOURCES':
      drivers/net/ethernet/marvell/octeontx2/af/rvu.c:1054:7: warning:
       variable 'is_pf' set but not used [-Wunused-but-set-variable]
      
      drivers/net/ethernet/marvell/octeontx2/af/rvu.c:1053:6: warning:
       variable 'devnum' set but not used [-Wunused-but-set-variable]
      
      It never used since introduction in commit
      746ea742 ("octeontx2-af: Add RVU block LF provisioning support")
      Signed-off-by: NYueHaibing <yuehaibing@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      eec6f752
  10. 18 10月, 2018 5 次提交
  11. 11 10月, 2018 7 次提交