Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <jeroendb@google.com>
Reviewed-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Jeroen de Borst and committed by
David S. Miller
a5affbd8 c2a0c3ed

+21 -8
+3 -1
drivers/net/ethernet/google/gve/gve_adminq.h
··· 154 154 gve_driver_capability_gqi_rda = 1, 155 155 gve_driver_capability_dqo_qpl = 2, /* reserved for future use */ 156 156 gve_driver_capability_dqo_rda = 3, 157 + gve_driver_capability_alt_miss_compl = 4, 157 158 }; 158 159 159 160 #define GVE_CAP1(a) BIT((int)a) ··· 165 164 #define GVE_DRIVER_CAPABILITY_FLAGS1 \ 166 165 (GVE_CAP1(gve_driver_capability_gqi_qpl) | \ 167 166 GVE_CAP1(gve_driver_capability_gqi_rda) | \ 168 - GVE_CAP1(gve_driver_capability_dqo_rda)) 167 + GVE_CAP1(gve_driver_capability_dqo_rda) | \ 168 + GVE_CAP1(gve_driver_capability_alt_miss_compl)) 169 169 170 170 #define GVE_DRIVER_CAPABILITY_FLAGS2 0x0 171 171 #define GVE_DRIVER_CAPABILITY_FLAGS3 0x0
+5
drivers/net/ethernet/google/gve/gve_desc_dqo.h
··· 176 176 #define GVE_COMPL_TYPE_DQO_MISS 0x1 /* Miss path completion */ 177 177 #define GVE_COMPL_TYPE_DQO_REINJECTION 0x3 /* Re-injection completion */ 178 178 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 + 179 184 /* Descriptor to post buffers to HW on buffer queue. */ 180 185 struct gve_rx_desc_dqo { 181 186 __le16 buf_id; /* ID returned in Rx completion descriptor */
+13 -7
drivers/net/ethernet/google/gve/gve_tx_dqo.c
··· 953 953 atomic_set_release(&tx->dqo_compl.hw_tx_head, tx_head); 954 954 } else if (type == GVE_COMPL_TYPE_DQO_PKT) { 955 955 u16 compl_tag = le16_to_cpu(compl_desc->completion_tag); 956 - 957 - gve_handle_packet_completion(priv, tx, !!napi, 958 - compl_tag, 959 - &pkt_compl_bytes, 960 - &pkt_compl_pkts, 961 - /*is_reinjection=*/false); 956 + if (compl_tag & GVE_ALT_MISS_COMPL_BIT) { 957 + compl_tag &= ~GVE_ALT_MISS_COMPL_BIT; 958 + gve_handle_miss_completion(priv, tx, compl_tag, 959 + &miss_compl_bytes, 960 + &miss_compl_pkts); 961 + } else { 962 + gve_handle_packet_completion(priv, tx, !!napi, 963 + compl_tag, 964 + &pkt_compl_bytes, 965 + &pkt_compl_pkts, 966 + false); 967 + } 962 968 } else if (type == GVE_COMPL_TYPE_DQO_MISS) { 963 969 u16 compl_tag = le16_to_cpu(compl_desc->completion_tag); 964 970 ··· 978 972 compl_tag, 979 973 &reinject_compl_bytes, 980 974 &reinject_compl_pkts, 981 - /*is_reinjection=*/true); 975 + true); 982 976 } 983 977 984 978 tx->dqo_compl.head =