Skip to content

Commit a746606

Browse files
Jeroen de Borstvijay-suman
authored andcommitted
gve: Handle alternate miss completions
The virtual NIC has 2 ways of indicating a miss-path completion. This handles the alternate. Signed-off-by: Jeroen de Borst <[email protected]> Reviewed-by: Jesse Brandeburg <[email protected]> Signed-off-by: David S. Miller <[email protected]> (cherry picked from commit a5affbd) Orabug: 37356729 Signed-off-by: Yifei Liu <[email protected]> Reviewed-by: Saeed Mirzamohammadi <[email protected]> Signed-off-by: Saeed Mirzamohammadi <[email protected]> Signed-off-by: Vijayendra Suman <[email protected]>
1 parent bede0a9 commit a746606

File tree

3 files changed

+21
-8
lines changed

3 files changed

+21
-8
lines changed

drivers/net/ethernet/google/gve/gve_adminq.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ enum gve_driver_capbility {
154154
gve_driver_capability_gqi_rda = 1,
155155
gve_driver_capability_dqo_qpl = 2, /* reserved for future use */
156156
gve_driver_capability_dqo_rda = 3,
157+
gve_driver_capability_alt_miss_compl = 4,
157158
};
158159

159160
#define GVE_CAP1(a) BIT((int)a)
@@ -164,7 +165,8 @@ enum gve_driver_capbility {
164165
#define GVE_DRIVER_CAPABILITY_FLAGS1 \
165166
(GVE_CAP1(gve_driver_capability_gqi_qpl) | \
166167
GVE_CAP1(gve_driver_capability_gqi_rda) | \
167-
GVE_CAP1(gve_driver_capability_dqo_rda))
168+
GVE_CAP1(gve_driver_capability_dqo_rda) | \
169+
GVE_CAP1(gve_driver_capability_alt_miss_compl))
168170

169171
#define GVE_DRIVER_CAPABILITY_FLAGS2 0x0
170172
#define GVE_DRIVER_CAPABILITY_FLAGS3 0x0

drivers/net/ethernet/google/gve/gve_desc_dqo.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,11 @@ static_assert(sizeof(struct gve_tx_compl_desc) == 8);
176176
#define GVE_COMPL_TYPE_DQO_MISS 0x1 /* Miss path completion */
177177
#define GVE_COMPL_TYPE_DQO_REINJECTION 0x3 /* Re-injection completion */
178178

179+
/* The most significant bit in the completion tag can change the completion
180+
* type from packet completion to miss path completion.
181+
*/
182+
#define GVE_ALT_MISS_COMPL_BIT BIT(15)
183+
179184
/* Descriptor to post buffers to HW on buffer queue. */
180185
struct gve_rx_desc_dqo {
181186
__le16 buf_id; /* ID returned in Rx completion descriptor */

drivers/net/ethernet/google/gve/gve_tx_dqo.c

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -976,12 +976,18 @@ int gve_clean_tx_done_dqo(struct gve_priv *priv, struct gve_tx_ring *tx,
976976
atomic_set_release(&tx->dqo_compl.hw_tx_head, tx_head);
977977
} else if (type == GVE_COMPL_TYPE_DQO_PKT) {
978978
u16 compl_tag = le16_to_cpu(compl_desc->completion_tag);
979-
980-
gve_handle_packet_completion(priv, tx, !!napi,
981-
compl_tag,
982-
&pkt_compl_bytes,
983-
&pkt_compl_pkts,
984-
/*is_reinjection=*/false);
979+
if (compl_tag & GVE_ALT_MISS_COMPL_BIT) {
980+
compl_tag &= ~GVE_ALT_MISS_COMPL_BIT;
981+
gve_handle_miss_completion(priv, tx, compl_tag,
982+
&miss_compl_bytes,
983+
&miss_compl_pkts);
984+
} else {
985+
gve_handle_packet_completion(priv, tx, !!napi,
986+
compl_tag,
987+
&pkt_compl_bytes,
988+
&pkt_compl_pkts,
989+
false);
990+
}
985991
} else if (type == GVE_COMPL_TYPE_DQO_MISS) {
986992
u16 compl_tag = le16_to_cpu(compl_desc->completion_tag);
987993

@@ -995,7 +1001,7 @@ int gve_clean_tx_done_dqo(struct gve_priv *priv, struct gve_tx_ring *tx,
9951001
compl_tag,
9961002
&reinject_compl_bytes,
9971003
&reinject_compl_pkts,
998-
/*is_reinjection=*/true);
1004+
true);
9991005
}
10001006

10011007
tx->dqo_compl.head =

0 commit comments

Comments
 (0)