Skip to content

net: introduce Qualcomm IPA driver (UPDATED)

Alex Elder linux-arm-kernel linux-arm-msm linux-devicetree lkml netdev 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest17 patches 11 repliesIn review
  2. v117 patches 2 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/17remoteproc: add IPA notification to q6v5 driverdrivers/remoteproc/Kconfig drivers/remoteproc/Makefile drivers/remoteproc/qcom_q6v5_ipa_notify.c +2 more+212 -02 replies
2/17dt-bindings: soc: qcom: add IPA bindingsDocumentation/devicetree/bindings/net/qcom,ipa.yaml+192 -00 replies
3/17soc: qcom: ipa: main codedrivers/net/ipa/ipa.h drivers/net/ipa/ipa_main.c drivers/net/ipa/ipa_reg.c +2 more+1639 -00 replies
4/17soc: qcom: ipa: configuration datadrivers/net/ipa/ipa_data-sc7180.c drivers/net/ipa/ipa_data-sdm845.c drivers/net/ipa/ipa_data.h+916 -00 replies
5/17soc: qcom: ipa: clocking, interrupts, and memorydrivers/net/ipa/ipa_clock.c drivers/net/ipa/ipa_clock.h drivers/net/ipa/ipa_interrupt.c +3 more+1140 -00 replies
6/17soc: qcom: ipa: GSI headersdrivers/net/ipa/gsi.h drivers/net/ipa/gsi_private.h drivers/net/ipa/gsi_reg.h+792 -00 replies
7/17soc: qcom: ipa: the generic software interfacedrivers/net/ipa/gsi.c+2055 -00 replies
8/17soc: qcom: ipa: IPA interface to GSIdrivers/net/ipa/ipa_gsi.c drivers/net/ipa/ipa_gsi.h+114 -00 replies
9/17soc: qcom: ipa: GSI transactionsdrivers/net/ipa/gsi_trans.c drivers/net/ipa/gsi_trans.h+1012 -00 replies
10/17soc: qcom: ipa: IPA endpointsdrivers/net/ipa/ipa_endpoint.c drivers/net/ipa/ipa_endpoint.h+1817 -00 replies
11/17soc: qcom: ipa: filter and routing tablesdrivers/net/ipa/ipa_table.c drivers/net/ipa/ipa_table.h+803 -00 replies
12/17soc: qcom: ipa: immediate commandsdrivers/net/ipa/ipa_cmd.c drivers/net/ipa/ipa_cmd.h+875 -00 replies
13/17soc: qcom: ipa: modem and microcontrollerdrivers/net/ipa/ipa_modem.c drivers/net/ipa/ipa_modem.h drivers/net/ipa/ipa_uc.c +1 more+657 -00 replies
14/17soc: qcom: ipa: AP/modem communicationsdrivers/net/ipa/ipa_qmi.c drivers/net/ipa/ipa_qmi.h drivers/net/ipa/ipa_qmi_msg.c +3 more+1877 -00 replies
15/17soc: qcom: ipa: support build of IPA codedrivers/net/Kconfig drivers/net/Makefile drivers/net/ipa/Kconfig +1 more+34 -02 replies
16/17MAINTAINERS: add entry for the Qualcomm IPA driverMAINTAINERS+6 -00 replies
17/17arm64: dts: sdm845: add IPA informationarch/arm64/boot/dts/qcom/sdm845.dtsi+51 -03 replies

Reviews trailers per patch

1 of 17 patches has a Reviewed-by or Acked-by.

PatchRob Herring
1/17
2/17R-b
3/17
4/17
5/17
6/17
7/17
8/17
9/17
10/17
11/17
12/17
13/17
14/17
15/17
16/17
17/17

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 00/17] net: introduce Qualcomm IPA driver (UPDATED)

This series presents the driver for the Qualcomm IP Accelerator (IPA).

This is version 2 of this updated series. It includes the following small changes since the previous version:
- Now based on net-next instead of v5.6-rc
- Config option now named CONFIG_QCOM_IPA
- Some minor cleanup in the GSI code
- Small change to replenish logic
- No longer depends on remoteproc bug fixes
What follows is the basically same explanation as was posted previously.

-Alex

I have posted earlier versions of this code previously, but it has undergone quite a bit of development since the last time, so rather than calling it "version 3" I'm just treating it as a new series (indicating it's been updated in this message). The fast/data path is the same as before. But the driver now (nearly) supports a second platform, its transaction handling has been generalized and improved, and modem activities are now handled in a more unified way.

This series is available (based on net-next in branch "ipa_updated-v2" in this git repository:
https://git.linaro.org/people/alex.elder/linux.git

The branch depends on other one other small patch that I sent out for review earlier.
https://lore.kernel.org/lkml/[email protected]/

I want to address some of the discussion that arose last time.

First, there was the WWAN discussion. Here's the history:
- This was last posted nine months ago.
- Reviewers at that time favored developing a new WWAN subsystem that would be used for managing devices like this. And the suggestion was to not accept this driver until that could be developed.
- Along the way, Apple acquired much of Intel's modem business. And as a result, the generic framework became less pressing.
- I did participate in the WWAN subsystem design however, and although it went dormant for a while it's been resurrected:
https://lore.kernel.org/netdev/[email protected]/
- Unfortunately the proposed WWAN design was not an easy fit with Qualcomm's integrated modem interfaces. Given that rmnet is a supported link type for in the upstream "iproute2" package (more on this below), I have opted not to integrate with any WWAN subsystem.

So in summary, this driver does not integrate with a generic WWAN framework. And I'd like it to be accepted upstream despite that.

Next, Arnd Bergmann had some concerns about flow control. (Note:
some of my discussions with Arnd about this were offline.) The overall architecture here also involves the "rmnet" driver:
drivers/net/ethernet/qualcomm/rmnet

The rmnet driver presents a network device for use. It connects with another network device presented, by the IPA driver. The rmnet driver wraps (and unwraps) packets transferred to (and from) the IPA driver with QMAP headers.

---------------
| rmnet_data0 | <-- "real" netdev
---------------

          ||       }- QMAP spoken here
   --------------
   | rmnet_ipa0 |     <-- also netdev, transporting QMAP packets
   --------------
          ||

--------------
( IPA hardware )
--------------

Arnd's concern was that the rmnet_data0 network device does not have the benefit of information about the state of the underlying IPA hardware in order to be effective in controlling TX flow. The feared result is over-buffering of TX packets (bufferbloat). I began working on some simple experiments to see whether (or how much) his concern was warranted. But it turned out that completing these experiments was much more work than had been hoped.

The rmnet driver is present in the upstream kernel. There is also support for the rmnet link type in the upstream "ip" user space command in the "iproute2" package. Changing the layering of rmnet over IPA likely involves deprecating the rmnet driver and its support in "iproute2". I would really rather not go down that path.

There is precedent for this sort of layering of network devices (L2TP, VLAN). And any architecture like this would suffer the issues Arnd mentioned; the problem is not limited to rmnet and IPA. I do think this is a problem worth solving, but the prudent thing to do might be to try to solve it more generally.

So to summarize on this issue, this driver does not attempt to change the way the rmnet and IPA drivers work together. And even though I think Arnd's concerns warrant more investigation, I'd like this driver to to be accepted upstream without any change to this architecture.

Finally, a more technical description for the series, and some acknowledgements to some people who contributed to it.

The IPA is a component present in some Qualcomm SoCs that allows network functions such as aggregation, filtering, routing, and NAT to be performed without active involvement of the main application processor (AP).

In this initial patch series these advanced features are not implemented. The IPA driver simply provides a network interface that makes the modem's LTE network available in Linux. This initial series supports only the Qualcomm SDM845 SoC. The Qualcomm SC7180 SoC is partially supported, and support for other platforms will follow.

This code is derived from a driver developed by Qualcomm. A version of the original source can be seen here:
https://source.codeaurora.org/quic/la/kernel/msm-4.9/tree
in the "drivers/platform/msm/ipa" directory. Many were involved in developing this, but the following individuals deserve explicit acknowledgement for their substantial contributions:

Abhishek Choubey
Ady Abraham
Chaitanya Pratapa
David Arinzon
Ghanim Fodi
Gidon Studinski
Ravi Gummadidala
Shihuan Liu
Skylar Chang

-Alex

Alex Elder (17):
remoteproc: add IPA notification to q6v5 driver
dt-bindings: soc: qcom: add IPA bindings
soc: qcom: ipa: main code
soc: qcom: ipa: configuration data
soc: qcom: ipa: clocking, interrupts, and memory
soc: qcom: ipa: GSI headers
soc: qcom: ipa: the generic software interface
soc: qcom: ipa: IPA interface to GSI
soc: qcom: ipa: GSI transactions
soc: qcom: ipa: IPA endpoints
soc: qcom: ipa: filter and routing tables
soc: qcom: ipa: immediate commands
soc: qcom: ipa: modem and microcontroller
soc: qcom: ipa: AP/modem communications
soc: qcom: ipa: support build of IPA code
MAINTAINERS: add entry for the Qualcomm IPA driver
arm64: dts: sdm845: add IPA information

 .../devicetree/bindings/net/qcom,ipa.yaml     |  192 ++
 MAINTAINERS                                   |    6 +
 arch/arm64/boot/dts/qcom/sdm845.dtsi          |   51 +
 drivers/net/Kconfig                           |    2 +
 drivers/net/Makefile                          |    1 +
 drivers/net/ipa/Kconfig                       |   19 +
 drivers/net/ipa/Makefile                      |   12 +
 drivers/net/ipa/gsi.c                         | 2055 +++++++++++++++++
 drivers/net/ipa/gsi.h                         |  257 +++
 drivers/net/ipa/gsi_private.h                 |  118 +
 drivers/net/ipa/gsi_reg.h                     |  417 ++++
 drivers/net/ipa/gsi_trans.c                   |  786 +++++++
 drivers/net/ipa/gsi_trans.h                   |  226 ++
 drivers/net/ipa/ipa.h                         |  148 ++
 drivers/net/ipa/ipa_clock.c                   |  313 +++
 drivers/net/ipa/ipa_clock.h                   |   53 +
 drivers/net/ipa/ipa_cmd.c                     |  680 ++++++
 drivers/net/ipa/ipa_cmd.h                     |  195 ++
 drivers/net/ipa/ipa_data-sc7180.c             |  307 +++
 drivers/net/ipa/ipa_data-sdm845.c             |  329 +++
 drivers/net/ipa/ipa_data.h                    |  280 +++
 drivers/net/ipa/ipa_endpoint.c                | 1707 ++++++++++++++
 drivers/net/ipa/ipa_endpoint.h                |  110 +
 drivers/net/ipa/ipa_gsi.c                     |   54 +
 drivers/net/ipa/ipa_gsi.h                     |   60 +
 drivers/net/ipa/ipa_interrupt.c               |  253 ++
 drivers/net/ipa/ipa_interrupt.h               |  117 +
 drivers/net/ipa/ipa_main.c                    |  954 ++++++++
 drivers/net/ipa/ipa_mem.c                     |  314 +++
 drivers/net/ipa/ipa_mem.h                     |   90 +
 drivers/net/ipa/ipa_modem.c                   |  383 +++
 drivers/net/ipa/ipa_modem.h                   |   31 +
 drivers/net/ipa/ipa_qmi.c                     |  538 +++++
 drivers/net/ipa/ipa_qmi.h                     |   41 +
 drivers/net/ipa/ipa_qmi_msg.c                 |  663 ++++++
 drivers/net/ipa/ipa_qmi_msg.h                 |  252 ++
 drivers/net/ipa/ipa_reg.c                     |   38 +
 drivers/net/ipa/ipa_reg.h                     |  476 ++++
 drivers/net/ipa/ipa_smp2p.c                   |  335 +++
 drivers/net/ipa/ipa_smp2p.h                   |   48 +
 drivers/net/ipa/ipa_table.c                   |  700 ++++++
 drivers/net/ipa/ipa_table.h                   |  103 +
 drivers/net/ipa/ipa_uc.c                      |  211 ++
 drivers/net/ipa/ipa_uc.h                      |   32 +
 drivers/net/ipa/ipa_version.h                 |   23 +
 drivers/remoteproc/Kconfig                    |    6 +
 drivers/remoteproc/Makefile                   |    1 +
 drivers/remoteproc/qcom_q6v5_ipa_notify.c     |   85 +
 drivers/remoteproc/qcom_q6v5_mss.c            |   38 +
 .../linux/remoteproc/qcom_q6v5_ipa_notify.h   |   82 +
 50 files changed, 14192 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/net/qcom,ipa.yaml
 create mode 100644 drivers/net/ipa/Kconfig
 create mode 100644 drivers/net/ipa/Makefile
 create mode 100644 drivers/net/ipa/gsi.c
 create mode 100644 drivers/net/ipa/gsi.h
 create mode 100644 drivers/net/ipa/gsi_private.h
 create mode 100644 drivers/net/ipa/gsi_reg.h
 create mode 100644 drivers/net/ipa/gsi_trans.c
 create mode 100644 drivers/net/ipa/gsi_trans.h
 create mode 100644 drivers/net/ipa/ipa.h
 create mode 100644 drivers/net/ipa/ipa_clock.c
 create mode 100644 drivers/net/ipa/ipa_clock.h
 create mode 100644 drivers/net/ipa/ipa_cmd.c
 create mode 100644 drivers/net/ipa/ipa_cmd.h
 create mode 100644 drivers/net/ipa/ipa_data-sc7180.c
 create mode 100644 drivers/net/ipa/ipa_data-sdm845.c
 create mode 100644 drivers/net/ipa/ipa_data.h
 create mode 100644 drivers/net/ipa/ipa_endpoint.c
 create mode 100644 drivers/net/ipa/ipa_endpoint.h
 create mode 100644 drivers/net/ipa/ipa_gsi.c
 create mode 100644 drivers/net/ipa/ipa_gsi.h
 create mode 100644 drivers/net/ipa/ipa_interrupt.c
 create mode 100644 drivers/net/ipa/ipa_interrupt.h
 create mode 100644 drivers/net/ipa/ipa_main.c
 create mode 100644 drivers/net/ipa/ipa_mem.c
 create mode 100644 drivers/net/ipa/ipa_mem.h
 create mode 100644 drivers/net/ipa/ipa_modem.c
 create mode 100644 drivers/net/ipa/ipa_modem.h
 create mode 100644 drivers/net/ipa/ipa_qmi.c
 create mode 100644 drivers/net/ipa/ipa_qmi.h
 create mode 100644 drivers/net/ipa/ipa_qmi_msg.c
 create mode 100644 drivers/net/ipa/ipa_qmi_msg.h
 create mode 100644 drivers/net/ipa/ipa_reg.c
 create mode 100644 drivers/net/ipa/ipa_reg.h
 create mode 100644 drivers/net/ipa/ipa_smp2p.c
 create mode 100644 drivers/net/ipa/ipa_smp2p.h
 create mode 100644 drivers/net/ipa/ipa_table.c
 create mode 100644 drivers/net/ipa/ipa_table.h
 create mode 100644 drivers/net/ipa/ipa_uc.c
 create mode 100644 drivers/net/ipa/ipa_uc.h
 create mode 100644 drivers/net/ipa/ipa_version.h
 create mode 100644 drivers/remoteproc/qcom_q6v5_ipa_notify.c
 create mode 100644 include/linux/remoteproc/qcom_q6v5_ipa_notify.h
Signature · 1 line
2.20.1