~jsalisbury/ubuntu/+source/linux-gke/+git/jammy-idpf:master-next

Last commit made on 2024-02-20
Get this branch:
git clone -b master-next https://git.launchpad.net/~jsalisbury/ubuntu/+source/linux-gke/+git/jammy-idpf
Only Joseph Salisbury can upload to this branch. If you are Joseph Salisbury please log in for upload directions.

Branch merges

Branch information

Recent commits

ef30ca4... by Joseph Salisbury

UBUNTU: [Config] gcp: Adding support for IDPF driver

BugLink: https://bugs.launchpad.net/bugs/2039720

Signed-off-by: Joseph Salisbury <email address hidden>

6ccab97... by "Ahmed S. Darwish" <email address hidden>

u64_stats: Introduce u64_stats_set()

BugLink: https://bugs.launchpad.net/bugs/2039720

Allow to directly set a u64_stats_t value which is used to provide an init
function which sets it directly to zero intead of memset() the value.

Add u64_stats_set() to the u64_stats API.

[bigeasy: commit message. ]

Signed-off-by: Ahmed S. Darwish <email address hidden>
Signed-off-by: Sebastian Andrzej Siewior <email address hidden>
Signed-off-by: David S. Miller <email address hidden>
(cherry picked from commit f2efdb17928924c9c935c136dea764a081032006)
Signed-off-by: John Cabaj <email address hidden>
Acked-by: Tim Gardner <email address hidden>
Acked-by: Joseph Salisbury <email address hidden>
Signed-off-by: John Cabaj <email address hidden>
(cherry picked from commit b4c0df75ac2cb25b32a7c07b58240211cde85367
jammy:linux-gcp)
Signed-off-by: Joseph Salisbury <email address hidden>

50b103b... by Pavan Kumar Linga <email address hidden>

virtchnl: add virtchnl version 2 ops

BugLink: https://bugs.launchpad.net/bugs/2039720

Virtchnl version 1 is an interface used by the current generation of
foundational NICs to negotiate the capabilities and configure the
HW resources such as queues, vectors, RSS LUT, etc between the PF
and VF drivers. It is not extensible to enable new features supported
in the next generation of NICs/IPUs and to negotiate descriptor types,
packet types and register offsets.

To overcome the limitations of the existing interface, introduce
the virtchnl version 2 and add the necessary opcodes, structures,
definitions, and descriptor formats. The driver also learns the
data queue and other register offsets to use instead of hardcoding
them. The advantage of this approach is that it gives the flexibility
to modify the register offsets if needed, restrict the use of
certain descriptor types and negotiate the supported packet types.

Co-developed-by: Alan Brady <email address hidden>
Signed-off-by: Alan Brady <email address hidden>
Co-developed-by: Joshua Hay <email address hidden>
Signed-off-by: Joshua Hay <email address hidden>
Co-developed-by: Madhu Chittim <email address hidden>
Signed-off-by: Madhu Chittim <email address hidden>
Co-developed-by: Phani Burra <email address hidden>
Signed-off-by: Phani Burra <email address hidden>
Co-developed-by: Sridhar Samudrala <email address hidden>
Signed-off-by: Sridhar Samudrala <email address hidden>
Reviewed-by: Sridhar Samudrala <email address hidden>
Reviewed-by: Willem de Bruijn <email address hidden>
Acked-by: Jakub Kicinski <email address hidden>
Signed-off-by: Pavan Kumar Linga <email address hidden>
Signed-off-by: Tony Nguyen <email address hidden>
(cherry picked from commit 0d7502a9b4a7b7e99dea1dc90c2de6c31d015e26)
Signed-off-by: John Cabaj <email address hidden>
Acked-by: Tim Gardner <email address hidden>
Acked-by: Joseph Salisbury <email address hidden>
Signed-off-by: John Cabaj <email address hidden>
(cherry picked from commit faaf5b38fd8da0fb0616a58cb277ddfc8e71847d
jammy:linux-gcp)
Signed-off-by: Joseph Salisbury <email address hidden>

7862edc... by Joshua Hay <email address hidden>

idpf: add SRIOV support and other ndo_ops

BugLink: https://bugs.launchpad.net/bugs/2039720

Add support for SRIOV: send the requested number of VFs
to the device Control Plane, via the virtchnl message
and then enable the VFs using 'pci_enable_sriov'.

Add other ndo ops supported by the driver such as features_check,
set_rx_mode, validate_addr, set_mac_address, change_mtu, get_stats64,
set_features, and tx_timeout. Initialize the statistics task which
requests the queue related statistics to the CP. Add loopback
and promiscuous mode support and the respective virtchnl messages.

Finally, add documentation and build support for the driver.

Signed-off-by: Joshua Hay <email address hidden>
Co-developed-by: Alan Brady <email address hidden>
Signed-off-by: Alan Brady <email address hidden>
Co-developed-by: Madhu Chittim <email address hidden>
Signed-off-by: Madhu Chittim <email address hidden>
Co-developed-by: Phani Burra <email address hidden>
Signed-off-by: Phani Burra <email address hidden>
Reviewed-by: Sridhar Samudrala <email address hidden>
Reviewed-by: Willem de Bruijn <email address hidden>
Co-developed-by: Pavan Kumar Linga <email address hidden>
Signed-off-by: Pavan Kumar Linga <email address hidden>
Signed-off-by: Tony Nguyen <email address hidden>
(cherry picked from commit a251eee62133774cf35ff829041377e721ef9c8c)
Signed-off-by: John Cabaj <email address hidden>
Acked-by: Tim Gardner <email address hidden>
Acked-by: Joseph Salisbury <email address hidden>
Signed-off-by: John Cabaj <email address hidden>
(cherry picked from commit 5fccd521e1d6f723652b14029011d27edb6bb999
jammy:linux-gcp)
Signed-off-by: Joseph Salisbury <email address hidden>

09c5695... by Alan Brady <email address hidden>

idpf: add ethtool callbacks

BugLink: https://bugs.launchpad.net/bugs/2039720

Initialize all the ethtool ops that are supported by the driver and
add the necessary support for the ethtool callbacks. Also add
asynchronous link notification virtchnl support where the device
Control Plane sends the link status and link speed as an
asynchronous event message. Driver report the link speed on
ethtool .idpf_get_link_ksettings query.

Introduce soft reset function which is used by some of the ethtool
callbacks such as .set_channels, .set_ringparam etc. to change the
existing queue configuration. It deletes the existing queues by sending
delete queues virtchnl message to the CP and calls the 'vport_stop' flow
which disables the queues, vport etc. New set of queues are requested to
the CP and reconfigure the queue context by calling the 'vport_open'
flow. Soft reset flow also adjusts the number of vectors associated to a
vport if .set_channels is called.

Signed-off-by: Alan Brady <email address hidden>
Co-developed-by: Alice Michael <email address hidden>
Signed-off-by: Alice Michael <email address hidden>
Co-developed-by: Joshua Hay <email address hidden>
Signed-off-by: Joshua Hay <email address hidden>
Co-developed-by: Phani Burra <email address hidden>
Signed-off-by: Phani Burra <email address hidden>
Reviewed-by: Sridhar Samudrala <email address hidden>
Reviewed-by: Willem de Bruijn <email address hidden>
Co-developed-by: Pavan Kumar Linga <email address hidden>
Signed-off-by: Pavan Kumar Linga <email address hidden>
Signed-off-by: Tony Nguyen <email address hidden>
(backported from commit 02cbfba1add5bd9088c7d14c6b93b77a6ea8f3bb)
[john-cabaj: page pool was introduced in the 6.6 kernel in a9ca9f9,
and is used to gather stats and other formatting for IDPF ethtool,
which is not required. set_ringparam() was extended in 7462494 across
many network drivers. Changes not explicitly required for IDPF
functionality.]
Signed-off-by: John Cabaj <email address hidden>
Acked-by: Tim Gardner <email address hidden>
Acked-by: Joseph Salisbury <email address hidden>
Signed-off-by: John Cabaj <email address hidden>
(cherry picked from commit 0001af6c3a66aa1f16b2d2dc79ff76b0090ab483
jammy:linux-gcp)
Signed-off-by: Joseph Salisbury <email address hidden>

002390e... by Joshua Hay <email address hidden>

idpf: add singleq start_xmit and napi poll

BugLink: https://bugs.launchpad.net/bugs/2039720

Add the start_xmit, TX and RX napi poll support for the single queue
model. Unlike split queue model, single queue uses same queue to post
buffer descriptors and completed descriptors.

Signed-off-by: Joshua Hay <email address hidden>
Co-developed-by: Alan Brady <email address hidden>
Signed-off-by: Alan Brady <email address hidden>
Co-developed-by: Madhu Chittim <email address hidden>
Signed-off-by: Madhu Chittim <email address hidden>
Co-developed-by: Phani Burra <email address hidden>
Signed-off-by: Phani Burra <email address hidden>
Reviewed-by: Sridhar Samudrala <email address hidden>
Reviewed-by: Willem de Bruijn <email address hidden>
Co-developed-by: Pavan Kumar Linga <email address hidden>
Signed-off-by: Pavan Kumar Linga <email address hidden>
Signed-off-by: Tony Nguyen <email address hidden>
(backported from commit a5ab9ee0df0be82aefb099d29b707d2b106e1c87)
[john-cabaj: upstream added netdev_queues.h macros in c91c46d of
6.4 kernel, which wrap various functions from netdevice.h.
Bringing netdev_queues.h changes would require changes to other
drivers, so opting to maintain same functionality without use of
netdev_queues.h]
Signed-off-by: John Cabaj <email address hidden>
Acked-by: Tim Gardner <email address hidden>
Acked-by: Joseph Salisbury <email address hidden>
Signed-off-by: John Cabaj <email address hidden>
(cherry picked from commit 489727b5f0fa9c7d6dc8d41ee4cf375948512989
jammy:linux-gcp)
Signed-off-by: Joseph Salisbury <email address hidden>

f21f35b... by Alan Brady <email address hidden>

idpf: add RX splitq napi poll support

BugLink: https://bugs.launchpad.net/bugs/2039720

Add support to handle interrupts for the RX completion queue and
RX buffer queue. When the interrupt fires on RX completion queue,
process the RX descriptors that are received. Allocate and prepare
the SKB with the RX packet info, for both data and header buffer.

IDPF uses software maintained refill queues to manage buffers between
RX queue producer and the buffer queue consumer. They are required in
order to maintain a lockless buffer management system and are strictly
software only constructs. Instead of updating the RX buffer queue tail
with available buffers right after the clean routine, it posts the
buffer ids to the refill queues, only to post them to the HW later.

If the generic receive offload (GRO) is enabled in the capabilities
and turned on by default or via ethtool, then HW performs the
packet coalescing if certain criteria are met by the incoming
packets and updates the RX descriptor. Similar to GRO, if generic
checksum is enabled, HW computes the checksum and updates the
respective fields in the descriptor. Add support to update the
SKB fields with the GRO and the generic checksum received.

Signed-off-by: Alan Brady <email address hidden>
Co-developed-by: Joshua Hay <email address hidden>
Signed-off-by: Joshua Hay <email address hidden>
Co-developed-by: Madhu Chittim <email address hidden>
Signed-off-by: Madhu Chittim <email address hidden>
Co-developed-by: Phani Burra <email address hidden>
Signed-off-by: Phani Burra <email address hidden>
Reviewed-by: Sridhar Samudrala <email address hidden>
Reviewed-by: Willem de Bruijn <email address hidden>
Acked-by: Jakub Kicinski <email address hidden>
Co-developed-by: Pavan Kumar Linga <email address hidden>
Signed-off-by: Pavan Kumar Linga <email address hidden>
Signed-off-by: Tony Nguyen <email address hidden>
(backported from commit 3a8845af66edb340ba9210bb8a0da040c7d6e590)
[john-cabaj: explicitly including net/ip6_checksum.h for IDPF driver]
Signed-off-by: John Cabaj <email address hidden>
Acked-by: Tim Gardner <email address hidden>
Acked-by: Joseph Salisbury <email address hidden>
Signed-off-by: John Cabaj <email address hidden>
(cherry picked from commit 1bd0c96cc215c594225e1354849249cf17c94c4c
jammy:linux-gcp)
Signed-off-by: Joseph Salisbury <email address hidden>

f9c2c92... by Joshua Hay <email address hidden>

idpf: add TX splitq napi poll support

BugLink: https://bugs.launchpad.net/bugs/2039720

Add support to handle the interrupts for the TX completion queue and
process the various completion types.

In the flow scheduling mode, the driver processes primarily buffer
completions as well as descriptor completions occasionally. This mode
supports out of order TX completions. To do so, HW generates one buffer
completion per packet. Each of those completions contains the unique tag
provided during the TX encoding which is used to locate the packet either
on the TX buffer ring or in a hash table. The hash table is used to track
TX buffer information so the descriptor(s) for a given packet can be
reused while the driver is still waiting on the buffer completion(s).

Packets end up in the hash table in one of 2 ways: 1) a packet was
stashed during descriptor completion cleaning, or 2) because an out of
order buffer completion was processed. A descriptor completion arrives
only every so often and is primarily used to guarantee the TX descriptor
ring can be reused without having to wait on the individual buffer
completions. E.g. a descriptor completion for N+16 guarantees HW read all
of the descriptors for packets N through N+15, therefore all of the
buffers for packets N through N+15 are stashed into the hash table and the
descriptors can be reused for more TX packets. Similarly, a packet can be
stashed in the hash table because an out an order buffer completion was
processed. E.g. processing a buffer completion for packet N+3 implies that
HW read all of the descriptors for packets N through N+3 and they can be
reused. However, the HW did not do the DMA yet. The buffers for packets N
through N+2 cannot be freed, so they are stashed in the hash table.
In either case, the buffer completions will eventually be processed for
all of the stashed packets, and all of the buffers will be cleaned from
the hash table.

In queue based scheduling mode, the driver processes primarily descriptor
completions and cleans the TX ring the conventional way.

Finally, the driver triggers a TX queue drain after sending the disable
queues virtchnl message. When the HW completes the queue draining, it
sends the driver a queue marker packet completion. The driver determines
when all TX queues have been drained and proceeds with the disable flow.

With this, the driver can send TX packets and clean up the resources
properly.

Signed-off-by: Joshua Hay <email address hidden>
Co-developed-by: Alan Brady <email address hidden>
Signed-off-by: Alan Brady <email address hidden>
Co-developed-by: Madhu Chittim <email address hidden>
Signed-off-by: Madhu Chittim <email address hidden>
Co-developed-by: Phani Burra <email address hidden>
Signed-off-by: Phani Burra <email address hidden>
Reviewed-by: Sridhar Samudrala <email address hidden>
Reviewed-by: Willem de Bruijn <email address hidden>
Co-developed-by: Pavan Kumar Linga <email address hidden>
Signed-off-by: Pavan Kumar Linga <email address hidden>
Signed-off-by: Tony Nguyen <email address hidden>
(backported from commit c2d548cad1508d334517bcbd7cd5c915cc831fc0)
[john-cabaj: upstream added netdev_queues.h macros in c91c46d of
6.4 kernel, which wrap various functions from netdevice.h.
Bringing netdev_queues.h changes would require changes to other
drivers, so opting to maintain same functionality without use of
netdev_queues.h]
Signed-off-by: John Cabaj <email address hidden>
Acked-by: Tim Gardner <email address hidden>
Acked-by: Joseph Salisbury <email address hidden>
Signed-off-by: John Cabaj <email address hidden>
(cherry picked from commit ed53c3bcf9219b6811a7344f7b1f59875f4017ca
jammy:linux-gcp)
Signed-off-by: Joseph Salisbury <email address hidden>

4216c1d... by Joshua Hay <email address hidden>

idpf: add splitq start_xmit

BugLink: https://bugs.launchpad.net/bugs/2039720

Add start_xmit support for split queue model. To start with, add the
necessary checks to linearize the skb if it uses more number of
buffers than the hardware supported limit. Stop the transmit queue
if there are no enough descriptors available for the skb to use or
if there we're going to potentially overrun the completion queue.
Finally prepare the descriptor with all the required
information and update the tail.

Signed-off-by: Joshua Hay <email address hidden>
Co-developed-by: Alan Brady <email address hidden>
Signed-off-by: Alan Brady <email address hidden>
Co-developed-by: Madhu Chittim <email address hidden>
Signed-off-by: Madhu Chittim <email address hidden>
Co-developed-by: Phani Burra <email address hidden>
Signed-off-by: Phani Burra <email address hidden>
Reviewed-by: Sridhar Samudrala <email address hidden>
Reviewed-by: Willem de Bruijn <email address hidden>
Co-developed-by: Pavan Kumar Linga <email address hidden>
Signed-off-by: Pavan Kumar Linga <email address hidden>
Signed-off-by: Tony Nguyen <email address hidden>
(backported from commit 6818c4d5b3c2e9dd5d7316792f88d371d07d0ebf)
[john-cabaj: upstream added netdev_queues.h macros in c91c46d of
6.4 kernel, which wrap various functions from netdevice.h.
Bringing netdev_queues.h changes would require changes to other
drivers, so opting to maintain same functionality without use of
netdev_queues.h]
Signed-off-by: John Cabaj <email address hidden>
Acked-by: Tim Gardner <email address hidden>
Acked-by: Joseph Salisbury <email address hidden>
Signed-off-by: John Cabaj <email address hidden>
(cherry picked from commit 6d83d684e2f71ec2f755910d98653d260b1de51f
jammy:linux-gcp)
Signed-off-by: Joseph Salisbury <email address hidden>

142e43b... by Pavan Kumar Linga <email address hidden>

idpf: initialize interrupts and enable vport

BugLink: https://bugs.launchpad.net/bugs/2039720

To further continue 'vport open', initialize all the resources
required for the interrupts. To start with, initialize the
queue vector indices with the ones received from the device
Control Plane. Now that all the TX and RX queues are initialized,
map the RX descriptor and buffer queues as well as TX completion
queues to the allocated vectors. Initialize and enable the napi
handler for the napi polling. Finally, request the IRQs for the
interrupt vectors from the stack and setup the interrupt handler.

Once the interrupt init is done, send 'map queue vector', 'enable
queues' and 'enable vport' virtchnl messages to the CP to complete
the 'vport open' flow.

Co-developed-by: Alan Brady <email address hidden>
Signed-off-by: Alan Brady <email address hidden>
Co-developed-by: Joshua Hay <email address hidden>
Signed-off-by: Joshua Hay <email address hidden>
Co-developed-by: Madhu Chittim <email address hidden>
Signed-off-by: Madhu Chittim <email address hidden>
Co-developed-by: Phani Burra <email address hidden>
Signed-off-by: Phani Burra <email address hidden>
Reviewed-by: Sridhar Samudrala <email address hidden>
Reviewed-by: Willem de Bruijn <email address hidden>
Signed-off-by: Pavan Kumar Linga <email address hidden>
Signed-off-by: Tony Nguyen <email address hidden>
(backported from commit d4d5587182664b0c4ab6d3556ce881cb975507c2)
[john-cabaj: netif_napi_add() signature updated in b48b89f
upstream, maintaining compatibility with existing function]
Signed-off-by: John Cabaj <email address hidden>
Acked-by: Tim Gardner <email address hidden>
Acked-by: Joseph Salisbury <email address hidden>
Signed-off-by: John Cabaj <email address hidden>
(cherry picked from commit a21d1273c23c18fc7f9241fbe23b0f0d217056f5
jammy:linux-gcp)
Signed-off-by: Joseph Salisbury <email address hidden>