Branch data Line data Source code
1 : : /* SPDX-License-Identifier: BSD-3-Clause
2 : : * Copyright(c) 2018 Aquantia Corporation
3 : : */
4 : :
5 : : #include <rte_string_fns.h>
6 : : #include <ethdev_pci.h>
7 : : #include <rte_alarm.h>
8 : : #include <rte_thread.h>
9 : :
10 : : #include "atl_ethdev.h"
11 : : #include "atl_common.h"
12 : : #include "atl_hw_regs.h"
13 : : #include "atl_logs.h"
14 : : #include "hw_atl/hw_atl_llh.h"
15 : : #include "hw_atl/hw_atl_b0.h"
16 : : #include "hw_atl/hw_atl_b0_internal.h"
17 : :
18 : : static int eth_atl_dev_init(struct rte_eth_dev *eth_dev);
19 : : static int atl_dev_configure(struct rte_eth_dev *dev);
20 : : static int atl_dev_start(struct rte_eth_dev *dev);
21 : : static int atl_dev_stop(struct rte_eth_dev *dev);
22 : : static int atl_dev_set_link_up(struct rte_eth_dev *dev);
23 : : static int atl_dev_set_link_down(struct rte_eth_dev *dev);
24 : : static int atl_dev_close(struct rte_eth_dev *dev);
25 : : static int atl_dev_reset(struct rte_eth_dev *dev);
26 : : static int atl_dev_promiscuous_enable(struct rte_eth_dev *dev);
27 : : static int atl_dev_promiscuous_disable(struct rte_eth_dev *dev);
28 : : static int atl_dev_allmulticast_enable(struct rte_eth_dev *dev);
29 : : static int atl_dev_allmulticast_disable(struct rte_eth_dev *dev);
30 : : static int atl_dev_link_update(struct rte_eth_dev *dev, int wait);
31 : :
32 : : static int atl_dev_xstats_get_names(struct rte_eth_dev *dev __rte_unused,
33 : : struct rte_eth_xstat_name *xstats_names,
34 : : unsigned int size);
35 : :
36 : : static int atl_dev_stats_get(struct rte_eth_dev *dev,
37 : : struct rte_eth_stats *stats, struct eth_queue_stats *qstats);
38 : :
39 : : static int atl_dev_xstats_get(struct rte_eth_dev *dev,
40 : : struct rte_eth_xstat *stats, unsigned int n);
41 : :
42 : : static int atl_dev_stats_reset(struct rte_eth_dev *dev);
43 : :
44 : : static int atl_fw_version_get(struct rte_eth_dev *dev, char *fw_version,
45 : : size_t fw_size);
46 : :
47 : : static const uint32_t *atl_dev_supported_ptypes_get(struct rte_eth_dev *dev,
48 : : size_t *no_of_elements);
49 : :
50 : : static int atl_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu);
51 : :
52 : : /* VLAN stuff */
53 : : static int atl_vlan_filter_set(struct rte_eth_dev *dev,
54 : : uint16_t vlan_id, int on);
55 : :
56 : : static int atl_vlan_offload_set(struct rte_eth_dev *dev, int mask);
57 : :
58 : : static void atl_vlan_strip_queue_set(struct rte_eth_dev *dev,
59 : : uint16_t queue_id, int on);
60 : :
61 : : static int atl_vlan_tpid_set(struct rte_eth_dev *dev,
62 : : enum rte_vlan_type vlan_type, uint16_t tpid);
63 : :
64 : : /* EEPROM */
65 : : static int atl_dev_get_eeprom_length(struct rte_eth_dev *dev);
66 : : static int atl_dev_get_eeprom(struct rte_eth_dev *dev,
67 : : struct rte_dev_eeprom_info *eeprom);
68 : : static int atl_dev_set_eeprom(struct rte_eth_dev *dev,
69 : : struct rte_dev_eeprom_info *eeprom);
70 : :
71 : : /* Regs */
72 : : static int atl_dev_get_regs(struct rte_eth_dev *dev,
73 : : struct rte_dev_reg_info *regs);
74 : :
75 : : /* Flow control */
76 : : static int atl_flow_ctrl_get(struct rte_eth_dev *dev,
77 : : struct rte_eth_fc_conf *fc_conf);
78 : : static int atl_flow_ctrl_set(struct rte_eth_dev *dev,
79 : : struct rte_eth_fc_conf *fc_conf);
80 : :
81 : : static void atl_dev_link_status_print(struct rte_eth_dev *dev);
82 : :
83 : : /* Interrupts */
84 : : static int atl_dev_rxq_interrupt_setup(struct rte_eth_dev *dev);
85 : : static int atl_dev_lsc_interrupt_setup(struct rte_eth_dev *dev, uint8_t on);
86 : : static int atl_dev_interrupt_get_status(struct rte_eth_dev *dev);
87 : : static int atl_dev_interrupt_action(struct rte_eth_dev *dev,
88 : : struct rte_intr_handle *handle);
89 : : static void atl_dev_interrupt_handler(void *param);
90 : :
91 : :
92 : : static int atl_add_mac_addr(struct rte_eth_dev *dev,
93 : : struct rte_ether_addr *mac_addr,
94 : : uint32_t index, uint32_t pool);
95 : : static void atl_remove_mac_addr(struct rte_eth_dev *dev, uint32_t index);
96 : : static int atl_set_default_mac_addr(struct rte_eth_dev *dev,
97 : : struct rte_ether_addr *mac_addr);
98 : :
99 : : static int atl_dev_set_mc_addr_list(struct rte_eth_dev *dev,
100 : : struct rte_ether_addr *mc_addr_set,
101 : : uint32_t nb_mc_addr);
102 : :
103 : : /* RSS */
104 : : static int atl_reta_update(struct rte_eth_dev *dev,
105 : : struct rte_eth_rss_reta_entry64 *reta_conf,
106 : : uint16_t reta_size);
107 : : static int atl_reta_query(struct rte_eth_dev *dev,
108 : : struct rte_eth_rss_reta_entry64 *reta_conf,
109 : : uint16_t reta_size);
110 : : static int atl_rss_hash_update(struct rte_eth_dev *dev,
111 : : struct rte_eth_rss_conf *rss_conf);
112 : : static int atl_rss_hash_conf_get(struct rte_eth_dev *dev,
113 : : struct rte_eth_rss_conf *rss_conf);
114 : :
115 : :
116 : : static int eth_atl_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
117 : : struct rte_pci_device *pci_dev);
118 : : static int eth_atl_pci_remove(struct rte_pci_device *pci_dev);
119 : :
120 : : static int atl_dev_info_get(struct rte_eth_dev *dev,
121 : : struct rte_eth_dev_info *dev_info);
122 : :
123 : : /*
124 : : * The set of PCI devices this driver supports
125 : : */
126 : : static const struct rte_pci_id pci_id_atl_map[] = {
127 : : { RTE_PCI_DEVICE(PCI_VENDOR_ID_AQUANTIA, AQ_DEVICE_ID_0001) },
128 : : { RTE_PCI_DEVICE(PCI_VENDOR_ID_AQUANTIA, AQ_DEVICE_ID_D100) },
129 : : { RTE_PCI_DEVICE(PCI_VENDOR_ID_AQUANTIA, AQ_DEVICE_ID_D107) },
130 : : { RTE_PCI_DEVICE(PCI_VENDOR_ID_AQUANTIA, AQ_DEVICE_ID_D108) },
131 : : { RTE_PCI_DEVICE(PCI_VENDOR_ID_AQUANTIA, AQ_DEVICE_ID_D109) },
132 : :
133 : : { RTE_PCI_DEVICE(PCI_VENDOR_ID_AQUANTIA, AQ_DEVICE_ID_AQC100) },
134 : : { RTE_PCI_DEVICE(PCI_VENDOR_ID_AQUANTIA, AQ_DEVICE_ID_AQC107) },
135 : : { RTE_PCI_DEVICE(PCI_VENDOR_ID_AQUANTIA, AQ_DEVICE_ID_AQC108) },
136 : : { RTE_PCI_DEVICE(PCI_VENDOR_ID_AQUANTIA, AQ_DEVICE_ID_AQC109) },
137 : : { RTE_PCI_DEVICE(PCI_VENDOR_ID_AQUANTIA, AQ_DEVICE_ID_AQC111) },
138 : : { RTE_PCI_DEVICE(PCI_VENDOR_ID_AQUANTIA, AQ_DEVICE_ID_AQC112) },
139 : :
140 : : { RTE_PCI_DEVICE(PCI_VENDOR_ID_AQUANTIA, AQ_DEVICE_ID_AQC100S) },
141 : : { RTE_PCI_DEVICE(PCI_VENDOR_ID_AQUANTIA, AQ_DEVICE_ID_AQC107S) },
142 : : { RTE_PCI_DEVICE(PCI_VENDOR_ID_AQUANTIA, AQ_DEVICE_ID_AQC108S) },
143 : : { RTE_PCI_DEVICE(PCI_VENDOR_ID_AQUANTIA, AQ_DEVICE_ID_AQC109S) },
144 : : { RTE_PCI_DEVICE(PCI_VENDOR_ID_AQUANTIA, AQ_DEVICE_ID_AQC111S) },
145 : : { RTE_PCI_DEVICE(PCI_VENDOR_ID_AQUANTIA, AQ_DEVICE_ID_AQC112S) },
146 : :
147 : : { RTE_PCI_DEVICE(PCI_VENDOR_ID_AQUANTIA, AQ_DEVICE_ID_AQC111E) },
148 : : { RTE_PCI_DEVICE(PCI_VENDOR_ID_AQUANTIA, AQ_DEVICE_ID_AQC112E) },
149 : : { .vendor_id = 0, /* sentinel */ },
150 : : };
151 : :
152 : : static struct rte_pci_driver rte_atl_pmd = {
153 : : .id_table = pci_id_atl_map,
154 : : .drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC,
155 : : .probe = eth_atl_pci_probe,
156 : : .remove = eth_atl_pci_remove,
157 : : };
158 : :
159 : : #define ATL_RX_OFFLOADS (RTE_ETH_RX_OFFLOAD_VLAN_STRIP \
160 : : | RTE_ETH_RX_OFFLOAD_IPV4_CKSUM \
161 : : | RTE_ETH_RX_OFFLOAD_UDP_CKSUM \
162 : : | RTE_ETH_RX_OFFLOAD_TCP_CKSUM \
163 : : | RTE_ETH_RX_OFFLOAD_MACSEC_STRIP \
164 : : | RTE_ETH_RX_OFFLOAD_VLAN_FILTER)
165 : :
166 : : #define ATL_TX_OFFLOADS (RTE_ETH_TX_OFFLOAD_VLAN_INSERT \
167 : : | RTE_ETH_TX_OFFLOAD_IPV4_CKSUM \
168 : : | RTE_ETH_TX_OFFLOAD_UDP_CKSUM \
169 : : | RTE_ETH_TX_OFFLOAD_TCP_CKSUM \
170 : : | RTE_ETH_TX_OFFLOAD_TCP_TSO \
171 : : | RTE_ETH_TX_OFFLOAD_MACSEC_INSERT \
172 : : | RTE_ETH_TX_OFFLOAD_MULTI_SEGS)
173 : :
174 : : #define SFP_EEPROM_SIZE 0x100
175 : :
176 : : static const struct rte_eth_desc_lim rx_desc_lim = {
177 : : .nb_max = ATL_MAX_RING_DESC,
178 : : .nb_min = ATL_MIN_RING_DESC,
179 : : .nb_align = ATL_RXD_ALIGN,
180 : : };
181 : :
182 : : static const struct rte_eth_desc_lim tx_desc_lim = {
183 : : .nb_max = ATL_MAX_RING_DESC,
184 : : .nb_min = ATL_MIN_RING_DESC,
185 : : .nb_align = ATL_TXD_ALIGN,
186 : : .nb_seg_max = ATL_TX_MAX_SEG,
187 : : .nb_mtu_seg_max = ATL_TX_MAX_SEG,
188 : : };
189 : :
190 : : enum atl_xstats_type {
191 : : XSTATS_TYPE_MSM = 0,
192 : : XSTATS_TYPE_MACSEC,
193 : : };
194 : :
195 : : #define ATL_XSTATS_FIELD(name) { \
196 : : #name, \
197 : : offsetof(struct aq_stats_s, name), \
198 : : XSTATS_TYPE_MSM \
199 : : }
200 : :
201 : : #define ATL_MACSEC_XSTATS_FIELD(name) { \
202 : : #name, \
203 : : offsetof(struct macsec_stats, name), \
204 : : XSTATS_TYPE_MACSEC \
205 : : }
206 : :
207 : : struct atl_xstats_tbl_s {
208 : : const char *name;
209 : : unsigned int offset;
210 : : enum atl_xstats_type type;
211 : : };
212 : :
213 : : static struct atl_xstats_tbl_s atl_xstats_tbl[] = {
214 : : ATL_XSTATS_FIELD(uprc),
215 : : ATL_XSTATS_FIELD(mprc),
216 : : ATL_XSTATS_FIELD(bprc),
217 : : ATL_XSTATS_FIELD(erpt),
218 : : ATL_XSTATS_FIELD(uptc),
219 : : ATL_XSTATS_FIELD(mptc),
220 : : ATL_XSTATS_FIELD(bptc),
221 : : ATL_XSTATS_FIELD(erpr),
222 : : ATL_XSTATS_FIELD(ubrc),
223 : : ATL_XSTATS_FIELD(ubtc),
224 : : ATL_XSTATS_FIELD(mbrc),
225 : : ATL_XSTATS_FIELD(mbtc),
226 : : ATL_XSTATS_FIELD(bbrc),
227 : : ATL_XSTATS_FIELD(bbtc),
228 : : /* Ingress Common Counters */
229 : : ATL_MACSEC_XSTATS_FIELD(in_ctl_pkts),
230 : : ATL_MACSEC_XSTATS_FIELD(in_tagged_miss_pkts),
231 : : ATL_MACSEC_XSTATS_FIELD(in_untagged_miss_pkts),
232 : : ATL_MACSEC_XSTATS_FIELD(in_notag_pkts),
233 : : ATL_MACSEC_XSTATS_FIELD(in_untagged_pkts),
234 : : ATL_MACSEC_XSTATS_FIELD(in_bad_tag_pkts),
235 : : ATL_MACSEC_XSTATS_FIELD(in_no_sci_pkts),
236 : : ATL_MACSEC_XSTATS_FIELD(in_unknown_sci_pkts),
237 : : /* Ingress SA Counters */
238 : : ATL_MACSEC_XSTATS_FIELD(in_untagged_hit_pkts),
239 : : ATL_MACSEC_XSTATS_FIELD(in_not_using_sa),
240 : : ATL_MACSEC_XSTATS_FIELD(in_unused_sa),
241 : : ATL_MACSEC_XSTATS_FIELD(in_not_valid_pkts),
242 : : ATL_MACSEC_XSTATS_FIELD(in_invalid_pkts),
243 : : ATL_MACSEC_XSTATS_FIELD(in_ok_pkts),
244 : : ATL_MACSEC_XSTATS_FIELD(in_unchecked_pkts),
245 : : ATL_MACSEC_XSTATS_FIELD(in_validated_octets),
246 : : ATL_MACSEC_XSTATS_FIELD(in_decrypted_octets),
247 : : /* Egress Common Counters */
248 : : ATL_MACSEC_XSTATS_FIELD(out_ctl_pkts),
249 : : ATL_MACSEC_XSTATS_FIELD(out_unknown_sa_pkts),
250 : : ATL_MACSEC_XSTATS_FIELD(out_untagged_pkts),
251 : : ATL_MACSEC_XSTATS_FIELD(out_too_long),
252 : : /* Egress SC Counters */
253 : : ATL_MACSEC_XSTATS_FIELD(out_sc_protected_pkts),
254 : : ATL_MACSEC_XSTATS_FIELD(out_sc_encrypted_pkts),
255 : : /* Egress SA Counters */
256 : : ATL_MACSEC_XSTATS_FIELD(out_sa_hit_drop_redirect),
257 : : ATL_MACSEC_XSTATS_FIELD(out_sa_protected2_pkts),
258 : : ATL_MACSEC_XSTATS_FIELD(out_sa_protected_pkts),
259 : : ATL_MACSEC_XSTATS_FIELD(out_sa_encrypted_pkts),
260 : : };
261 : :
262 : : static const struct eth_dev_ops atl_eth_dev_ops = {
263 : : .dev_configure = atl_dev_configure,
264 : : .dev_start = atl_dev_start,
265 : : .dev_stop = atl_dev_stop,
266 : : .dev_set_link_up = atl_dev_set_link_up,
267 : : .dev_set_link_down = atl_dev_set_link_down,
268 : : .dev_close = atl_dev_close,
269 : : .dev_reset = atl_dev_reset,
270 : :
271 : : /* PROMISC */
272 : : .promiscuous_enable = atl_dev_promiscuous_enable,
273 : : .promiscuous_disable = atl_dev_promiscuous_disable,
274 : : .allmulticast_enable = atl_dev_allmulticast_enable,
275 : : .allmulticast_disable = atl_dev_allmulticast_disable,
276 : :
277 : : /* Link */
278 : : .link_update = atl_dev_link_update,
279 : :
280 : : .get_reg = atl_dev_get_regs,
281 : :
282 : : /* Stats */
283 : : .stats_get = atl_dev_stats_get,
284 : : .xstats_get = atl_dev_xstats_get,
285 : : .xstats_get_names = atl_dev_xstats_get_names,
286 : : .stats_reset = atl_dev_stats_reset,
287 : : .xstats_reset = atl_dev_stats_reset,
288 : :
289 : : .fw_version_get = atl_fw_version_get,
290 : : .dev_infos_get = atl_dev_info_get,
291 : : .dev_supported_ptypes_get = atl_dev_supported_ptypes_get,
292 : :
293 : : .mtu_set = atl_dev_mtu_set,
294 : :
295 : : /* VLAN */
296 : : .vlan_filter_set = atl_vlan_filter_set,
297 : : .vlan_offload_set = atl_vlan_offload_set,
298 : : .vlan_tpid_set = atl_vlan_tpid_set,
299 : : .vlan_strip_queue_set = atl_vlan_strip_queue_set,
300 : :
301 : : /* Queue Control */
302 : : .rx_queue_start = atl_rx_queue_start,
303 : : .rx_queue_stop = atl_rx_queue_stop,
304 : : .rx_queue_setup = atl_rx_queue_setup,
305 : : .rx_queue_release = atl_rx_queue_release,
306 : :
307 : : .tx_queue_start = atl_tx_queue_start,
308 : : .tx_queue_stop = atl_tx_queue_stop,
309 : : .tx_queue_setup = atl_tx_queue_setup,
310 : : .tx_queue_release = atl_tx_queue_release,
311 : :
312 : : .rx_queue_intr_enable = atl_dev_rx_queue_intr_enable,
313 : : .rx_queue_intr_disable = atl_dev_rx_queue_intr_disable,
314 : :
315 : : /* EEPROM */
316 : : .get_eeprom_length = atl_dev_get_eeprom_length,
317 : : .get_eeprom = atl_dev_get_eeprom,
318 : : .set_eeprom = atl_dev_set_eeprom,
319 : :
320 : : /* Flow Control */
321 : : .flow_ctrl_get = atl_flow_ctrl_get,
322 : : .flow_ctrl_set = atl_flow_ctrl_set,
323 : :
324 : : /* MAC */
325 : : .mac_addr_add = atl_add_mac_addr,
326 : : .mac_addr_remove = atl_remove_mac_addr,
327 : : .mac_addr_set = atl_set_default_mac_addr,
328 : : .set_mc_addr_list = atl_dev_set_mc_addr_list,
329 : : .rxq_info_get = atl_rxq_info_get,
330 : : .txq_info_get = atl_txq_info_get,
331 : :
332 : : .reta_update = atl_reta_update,
333 : : .reta_query = atl_reta_query,
334 : : .rss_hash_update = atl_rss_hash_update,
335 : : .rss_hash_conf_get = atl_rss_hash_conf_get,
336 : : };
337 : :
338 : : static inline int32_t
339 : : atl_reset_hw(struct aq_hw_s *hw)
340 : : {
341 : 0 : return hw_atl_b0_hw_reset(hw);
342 : : }
343 : :
344 : : static inline void
345 : : atl_enable_intr(struct rte_eth_dev *dev)
346 : : {
347 : 0 : struct aq_hw_s *hw = ATL_DEV_PRIVATE_TO_HW(dev->data->dev_private);
348 : :
349 : 0 : hw_atl_itr_irq_msk_setlsw_set(hw, 0xffffffff);
350 : : }
351 : :
352 : : static void
353 : 0 : atl_disable_intr(struct aq_hw_s *hw)
354 : : {
355 : 0 : PMD_INIT_FUNC_TRACE();
356 : 0 : hw_atl_itr_irq_msk_clearlsw_set(hw, 0xffffffff);
357 : 0 : }
358 : :
359 : : static int
360 : 0 : eth_atl_dev_init(struct rte_eth_dev *eth_dev)
361 : : {
362 : 0 : struct atl_adapter *adapter = eth_dev->data->dev_private;
363 : 0 : struct rte_pci_device *pci_dev = RTE_CLASS_TO_BUS_DEVICE(eth_dev, *pci_dev);
364 : 0 : struct rte_intr_handle *intr_handle = pci_dev->intr_handle;
365 : 0 : struct aq_hw_s *hw = ATL_DEV_PRIVATE_TO_HW(eth_dev->data->dev_private);
366 : : int err = 0;
367 : :
368 : 0 : PMD_INIT_FUNC_TRACE();
369 : :
370 : 0 : eth_dev->dev_ops = &atl_eth_dev_ops;
371 : :
372 : 0 : eth_dev->rx_queue_count = atl_rx_queue_count;
373 : 0 : eth_dev->rx_descriptor_status = atl_dev_rx_descriptor_status;
374 : 0 : eth_dev->tx_descriptor_status = atl_dev_tx_descriptor_status;
375 : :
376 : 0 : eth_dev->rx_pkt_burst = &atl_recv_pkts;
377 : 0 : eth_dev->tx_pkt_burst = &atl_xmit_pkts;
378 : 0 : eth_dev->tx_pkt_prepare = &atl_prep_pkts;
379 : :
380 : : /* For secondary processes, the primary process has done all the work */
381 [ # # ]: 0 : if (rte_eal_process_type() != RTE_PROC_PRIMARY)
382 : : return 0;
383 : :
384 : 0 : eth_dev->data->dev_flags |= RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS;
385 : :
386 : : /* Vendor and Device ID need to be set before init of shared code */
387 : 0 : hw->device_id = pci_dev->id.device_id;
388 : 0 : hw->vendor_id = pci_dev->id.vendor_id;
389 : 0 : hw->mmio = (void *)pci_dev->mem_resource[0].addr;
390 : :
391 : : /* Hardware configuration - hardcode */
392 : 0 : adapter->hw_cfg.is_lro = false;
393 : 0 : adapter->hw_cfg.wol = false;
394 : 0 : adapter->hw_cfg.is_rss = false;
395 : 0 : adapter->hw_cfg.num_rss_queues = HW_ATL_B0_RSS_MAX;
396 : :
397 : 0 : adapter->hw_cfg.link_speed_msk = AQ_NIC_RATE_10G |
398 : : AQ_NIC_RATE_5G |
399 : : AQ_NIC_RATE_2G5 |
400 : : AQ_NIC_RATE_1G |
401 : : AQ_NIC_RATE_100M;
402 : :
403 : 0 : adapter->hw_cfg.flow_control = (AQ_NIC_FC_RX | AQ_NIC_FC_TX);
404 : 0 : adapter->hw_cfg.aq_rss.indirection_table_size =
405 : : HW_ATL_B0_RSS_REDIRECTION_MAX;
406 : :
407 : 0 : hw->aq_nic_cfg = &adapter->hw_cfg;
408 : :
409 : 0 : rte_thread_mutex_init_shared(&hw->mbox_mutex);
410 : :
411 : : /* disable interrupt */
412 : 0 : atl_disable_intr(hw);
413 : :
414 : : /* Allocate memory for storing MAC addresses */
415 : 0 : eth_dev->data->mac_addrs = rte_zmalloc("atlantic",
416 : : RTE_ETHER_ADDR_LEN, 0);
417 [ # # ]: 0 : if (eth_dev->data->mac_addrs == NULL) {
418 : 0 : PMD_INIT_LOG(ERR, "MAC Malloc failed");
419 : 0 : return -ENOMEM;
420 : : }
421 : :
422 : 0 : err = hw_atl_utils_initfw(hw, &hw->aq_fw_ops);
423 [ # # ]: 0 : if (err)
424 : : return err;
425 : :
426 : : /* Copy the permanent MAC address */
427 [ # # ]: 0 : if (hw->aq_fw_ops->get_mac_permanent(hw,
428 : 0 : eth_dev->data->mac_addrs->addr_bytes) != 0)
429 : : return -EINVAL;
430 : :
431 : : /* Reset the hw statistics */
432 : 0 : atl_dev_stats_reset(eth_dev);
433 : :
434 : 0 : rte_intr_callback_register(intr_handle,
435 : : atl_dev_interrupt_handler, eth_dev);
436 : :
437 : : /* enable uio/vfio intr/eventfd mapping */
438 : 0 : rte_intr_enable(intr_handle);
439 : :
440 : : /* enable support intr */
441 : : atl_enable_intr(eth_dev);
442 : :
443 : 0 : return err;
444 : : }
445 : :
446 : : static int
447 : 0 : eth_atl_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
448 : : struct rte_pci_device *pci_dev)
449 : : {
450 : 0 : return rte_eth_dev_pci_generic_probe(pci_dev,
451 : : sizeof(struct atl_adapter), eth_atl_dev_init);
452 : : }
453 : :
454 : : static int
455 : 0 : eth_atl_pci_remove(struct rte_pci_device *pci_dev)
456 : : {
457 : 0 : return rte_eth_dev_pci_generic_remove(pci_dev, atl_dev_close);
458 : : }
459 : :
460 : : static int
461 : 0 : atl_dev_configure(struct rte_eth_dev *dev)
462 : : {
463 : : struct atl_interrupt *intr =
464 : 0 : ATL_DEV_PRIVATE_TO_INTR(dev->data->dev_private);
465 : :
466 : 0 : PMD_INIT_FUNC_TRACE();
467 : :
468 : : /* set flag to update link status after init */
469 : 0 : intr->flags |= ATL_FLAG_NEED_LINK_UPDATE;
470 : :
471 : 0 : return 0;
472 : : }
473 : :
474 : : /*
475 : : * Configure device link speed and setup link.
476 : : * It returns 0 on success.
477 : : */
478 : : static int
479 : 0 : atl_dev_start(struct rte_eth_dev *dev)
480 : : {
481 : 0 : struct aq_hw_s *hw = ATL_DEV_PRIVATE_TO_HW(dev->data->dev_private);
482 : 0 : struct rte_pci_device *pci_dev = RTE_CLASS_TO_BUS_DEVICE(dev, *pci_dev);
483 : 0 : struct rte_intr_handle *intr_handle = pci_dev->intr_handle;
484 : : uint32_t intr_vector = 0;
485 : : int status;
486 : : int err;
487 : :
488 : 0 : PMD_INIT_FUNC_TRACE();
489 : :
490 : : /* set adapter started */
491 : 0 : hw->adapter_stopped = 0;
492 : :
493 [ # # ]: 0 : if (dev->data->dev_conf.link_speeds & RTE_ETH_LINK_SPEED_FIXED) {
494 : 0 : PMD_INIT_LOG(ERR,
495 : : "Invalid link_speeds for port %u, fix speed not supported",
496 : : dev->data->port_id);
497 : 0 : return -EINVAL;
498 : : }
499 : :
500 : : /* disable uio/vfio intr/eventfd mapping */
501 : 0 : rte_intr_disable(intr_handle);
502 : :
503 : : /* reinitialize adapter
504 : : * this calls reset and start
505 : : */
506 : : status = atl_reset_hw(hw);
507 [ # # ]: 0 : if (status != 0)
508 : : return -EIO;
509 : :
510 : 0 : err = hw_atl_b0_hw_init(hw, dev->data->mac_addrs->addr_bytes);
511 : :
512 : 0 : hw_atl_b0_hw_start(hw);
513 : : /* check and configure queue intr-vector mapping */
514 [ # # ]: 0 : if ((rte_intr_cap_multiple(intr_handle) ||
515 [ # # ]: 0 : !RTE_ETH_DEV_SRIOV(dev).active) &&
516 [ # # ]: 0 : dev->data->dev_conf.intr_conf.rxq != 0) {
517 : 0 : intr_vector = dev->data->nb_rx_queues;
518 [ # # ]: 0 : if (intr_vector > ATL_MAX_INTR_QUEUE_NUM) {
519 : 0 : PMD_INIT_LOG(ERR, "At most %d intr queues supported",
520 : : ATL_MAX_INTR_QUEUE_NUM);
521 : 0 : return -ENOTSUP;
522 : : }
523 [ # # ]: 0 : if (rte_intr_efd_enable(intr_handle, intr_vector)) {
524 : 0 : PMD_INIT_LOG(ERR, "rte_intr_efd_enable failed");
525 : 0 : return -1;
526 : : }
527 : : }
528 : :
529 [ # # ]: 0 : if (rte_intr_dp_is_en(intr_handle)) {
530 [ # # ]: 0 : if (rte_intr_vec_list_alloc(intr_handle, "intr_vec",
531 : 0 : dev->data->nb_rx_queues)) {
532 : 0 : PMD_INIT_LOG(ERR, "Failed to allocate %d rx_queues"
533 : : " intr_vec", dev->data->nb_rx_queues);
534 : 0 : return -ENOMEM;
535 : : }
536 : : }
537 : :
538 : : /* initialize transmission unit */
539 : 0 : atl_tx_init(dev);
540 : :
541 : : /* This can fail when allocating mbufs for descriptor rings */
542 : 0 : err = atl_rx_init(dev);
543 [ # # ]: 0 : if (err) {
544 : 0 : PMD_INIT_LOG(ERR, "Unable to initialize RX hardware");
545 : 0 : goto error;
546 : : }
547 : :
548 : 0 : PMD_INIT_LOG(DEBUG, "FW version: %u.%u.%u",
549 : : hw->fw_ver_actual >> 24,
550 : : (hw->fw_ver_actual >> 16) & 0xFF,
551 : : hw->fw_ver_actual & 0xFFFF);
552 : 0 : PMD_INIT_LOG(DEBUG, "Driver version: %s", ATL_PMD_DRIVER_VERSION);
553 : :
554 : 0 : err = atl_start_queues(dev);
555 [ # # ]: 0 : if (err < 0) {
556 : 0 : PMD_INIT_LOG(ERR, "Unable to start rxtx queues");
557 : 0 : goto error;
558 : : }
559 : :
560 : 0 : err = atl_dev_set_link_up(dev);
561 : :
562 : 0 : err = hw->aq_fw_ops->update_link_status(hw);
563 : :
564 [ # # ]: 0 : if (err)
565 : 0 : goto error;
566 : :
567 : 0 : dev->data->dev_link.link_status = hw->aq_link_status.mbps != 0;
568 : :
569 [ # # ]: 0 : if (rte_intr_allow_others(intr_handle)) {
570 : : /* check if lsc interrupt is enabled */
571 [ # # ]: 0 : if (dev->data->dev_conf.intr_conf.lsc != 0)
572 : : atl_dev_lsc_interrupt_setup(dev, true);
573 : : else
574 : : atl_dev_lsc_interrupt_setup(dev, false);
575 : : } else {
576 : 0 : rte_intr_callback_unregister(intr_handle,
577 : : atl_dev_interrupt_handler, dev);
578 [ # # ]: 0 : if (dev->data->dev_conf.intr_conf.lsc != 0)
579 : 0 : PMD_INIT_LOG(INFO, "lsc won't enable because of"
580 : : " no intr multiplex");
581 : : }
582 : :
583 : : /* check if rxq interrupt is enabled */
584 [ # # ]: 0 : if (dev->data->dev_conf.intr_conf.rxq != 0 &&
585 : 0 : rte_intr_dp_is_en(intr_handle))
586 : : atl_dev_rxq_interrupt_setup(dev);
587 : :
588 : : /* enable uio/vfio intr/eventfd mapping */
589 : 0 : rte_intr_enable(intr_handle);
590 : :
591 : : /* resume enabled intr since hw reset */
592 : : atl_enable_intr(dev);
593 : :
594 : 0 : return 0;
595 : :
596 : 0 : error:
597 : 0 : atl_stop_queues(dev);
598 : 0 : return -EIO;
599 : : }
600 : :
601 : : /*
602 : : * Stop device: disable rx and tx functions to allow for reconfiguring.
603 : : */
604 : : static int
605 : 0 : atl_dev_stop(struct rte_eth_dev *dev)
606 : : {
607 : : struct rte_eth_link link;
608 : 0 : struct aq_hw_s *hw =
609 : 0 : ATL_DEV_PRIVATE_TO_HW(dev->data->dev_private);
610 : 0 : struct rte_pci_device *pci_dev = RTE_CLASS_TO_BUS_DEVICE(dev, *pci_dev);
611 : 0 : struct rte_intr_handle *intr_handle = pci_dev->intr_handle;
612 : :
613 : 0 : PMD_INIT_FUNC_TRACE();
614 : 0 : dev->data->dev_started = 0;
615 : :
616 : : /* disable interrupts */
617 : 0 : atl_disable_intr(hw);
618 : :
619 : : /* reset the NIC */
620 : : atl_reset_hw(hw);
621 : 0 : hw->adapter_stopped = 1;
622 : :
623 : 0 : atl_stop_queues(dev);
624 : :
625 : : /* Clear stored conf */
626 : 0 : dev->data->scattered_rx = 0;
627 : 0 : dev->data->lro = 0;
628 : :
629 : : /* Clear recorded link status */
630 : : memset(&link, 0, sizeof(link));
631 : 0 : rte_eth_linkstatus_set(dev, &link);
632 : :
633 [ # # ]: 0 : if (!rte_intr_allow_others(intr_handle))
634 : : /* resume to the default handler */
635 : 0 : rte_intr_callback_register(intr_handle,
636 : : atl_dev_interrupt_handler,
637 : : (void *)dev);
638 : :
639 : : /* Clean datapath event and queue/vec mapping */
640 : 0 : rte_intr_efd_disable(intr_handle);
641 : 0 : rte_intr_vec_list_free(intr_handle);
642 : :
643 : 0 : return 0;
644 : : }
645 : :
646 : : /*
647 : : * Set device link up: enable tx.
648 : : */
649 : : static int
650 : 0 : atl_dev_set_link_up(struct rte_eth_dev *dev)
651 : : {
652 : 0 : struct aq_hw_s *hw = ATL_DEV_PRIVATE_TO_HW(dev->data->dev_private);
653 : 0 : uint32_t link_speeds = dev->data->dev_conf.link_speeds;
654 : : uint32_t speed_mask = 0;
655 : :
656 [ # # ]: 0 : if (link_speeds == RTE_ETH_LINK_SPEED_AUTONEG) {
657 : 0 : speed_mask = hw->aq_nic_cfg->link_speed_msk;
658 : : } else {
659 [ # # ]: 0 : if (link_speeds & RTE_ETH_LINK_SPEED_10G)
660 : : speed_mask |= AQ_NIC_RATE_10G;
661 [ # # ]: 0 : if (link_speeds & RTE_ETH_LINK_SPEED_5G)
662 : 0 : speed_mask |= AQ_NIC_RATE_5G;
663 [ # # ]: 0 : if (link_speeds & RTE_ETH_LINK_SPEED_1G)
664 : 0 : speed_mask |= AQ_NIC_RATE_1G;
665 [ # # ]: 0 : if (link_speeds & RTE_ETH_LINK_SPEED_2_5G)
666 : 0 : speed_mask |= AQ_NIC_RATE_2G5;
667 [ # # ]: 0 : if (link_speeds & RTE_ETH_LINK_SPEED_100M)
668 : 0 : speed_mask |= AQ_NIC_RATE_100M;
669 : : }
670 : :
671 : 0 : return hw->aq_fw_ops->set_link_speed(hw, speed_mask);
672 : : }
673 : :
674 : : /*
675 : : * Set device link down: disable tx.
676 : : */
677 : : static int
678 : 0 : atl_dev_set_link_down(struct rte_eth_dev *dev)
679 : : {
680 : 0 : struct aq_hw_s *hw = ATL_DEV_PRIVATE_TO_HW(dev->data->dev_private);
681 : :
682 : 0 : return hw->aq_fw_ops->set_link_speed(hw, 0);
683 : : }
684 : :
685 : : /*
686 : : * Reset and stop device.
687 : : */
688 : : static int
689 : 0 : atl_dev_close(struct rte_eth_dev *dev)
690 : : {
691 : 0 : struct rte_pci_device *pci_dev = RTE_CLASS_TO_BUS_DEVICE(dev, *pci_dev);
692 : 0 : struct rte_intr_handle *intr_handle = pci_dev->intr_handle;
693 : : struct aq_hw_s *hw;
694 : : int ret;
695 : :
696 : 0 : PMD_INIT_FUNC_TRACE();
697 : :
698 [ # # ]: 0 : if (rte_eal_process_type() != RTE_PROC_PRIMARY)
699 : : return 0;
700 : :
701 : 0 : hw = ATL_DEV_PRIVATE_TO_HW(dev->data->dev_private);
702 : :
703 : 0 : ret = atl_dev_stop(dev);
704 : :
705 : 0 : atl_free_queues(dev);
706 : :
707 : : /* disable uio intr before callback unregister */
708 : 0 : rte_intr_disable(intr_handle);
709 : 0 : rte_intr_callback_unregister(intr_handle,
710 : : atl_dev_interrupt_handler, dev);
711 : :
712 : 0 : pthread_mutex_destroy(&hw->mbox_mutex);
713 : :
714 : 0 : return ret;
715 : : }
716 : :
717 : : static int
718 : 0 : atl_dev_reset(struct rte_eth_dev *dev)
719 : : {
720 : : int ret;
721 : :
722 : 0 : ret = atl_dev_close(dev);
723 [ # # ]: 0 : if (ret)
724 : : return ret;
725 : :
726 : 0 : ret = eth_atl_dev_init(dev);
727 : :
728 : 0 : return ret;
729 : : }
730 : :
731 : : static int
732 : 0 : atl_dev_configure_macsec(struct rte_eth_dev *dev)
733 : : {
734 : 0 : struct aq_hw_s *hw = ATL_DEV_PRIVATE_TO_HW(dev->data->dev_private);
735 : : struct aq_hw_cfg_s *cf = ATL_DEV_PRIVATE_TO_CFG(dev->data->dev_private);
736 : : struct aq_macsec_config *aqcfg = &cf->aq_macsec;
737 : : struct macsec_msg_fw_request msg_macsec;
738 : : struct macsec_msg_fw_response response;
739 : :
740 [ # # ]: 0 : if (!aqcfg->common.macsec_enabled ||
741 [ # # ]: 0 : hw->aq_fw_ops->send_macsec_req == NULL)
742 : : return 0;
743 : :
744 : : memset(&msg_macsec, 0, sizeof(msg_macsec));
745 : :
746 : : /* Creating set of sc/sa structures from parameters provided by DPDK */
747 : :
748 : : /* Configure macsec */
749 : : msg_macsec.msg_type = macsec_cfg_msg;
750 : 0 : msg_macsec.cfg.enabled = aqcfg->common.macsec_enabled;
751 : 0 : msg_macsec.cfg.interrupts_enabled = 1;
752 : :
753 : 0 : hw->aq_fw_ops->send_macsec_req(hw, &msg_macsec, &response);
754 : :
755 [ # # ]: 0 : if (response.result)
756 : : return -1;
757 : :
758 : : memset(&msg_macsec, 0, sizeof(msg_macsec));
759 : :
760 : : /* Configure TX SC */
761 : :
762 : 0 : msg_macsec.msg_type = macsec_add_tx_sc_msg;
763 : : msg_macsec.txsc.index = 0; /* TXSC always one (??) */
764 : 0 : msg_macsec.txsc.protect = aqcfg->common.encryption_enabled;
765 : :
766 : : /* MAC addr for TX */
767 [ # # ]: 0 : msg_macsec.txsc.mac_sa[0] = rte_bswap32(aqcfg->txsc.mac[1]);
768 [ # # ]: 0 : msg_macsec.txsc.mac_sa[1] = rte_bswap32(aqcfg->txsc.mac[0]);
769 : 0 : msg_macsec.txsc.sa_mask = 0x3f;
770 : :
771 : : msg_macsec.txsc.da_mask = 0;
772 : 0 : msg_macsec.txsc.tci = 0x0B;
773 : : msg_macsec.txsc.curr_an = 0; /* SA index which currently used */
774 : :
775 : : /*
776 : : * Creating SCI (Secure Channel Identifier).
777 : : * SCI constructed from Source MAC and Port identifier
778 : : */
779 : 0 : uint32_t sci_hi_part = (msg_macsec.txsc.mac_sa[1] << 16) |
780 : 0 : (msg_macsec.txsc.mac_sa[0] >> 16);
781 : 0 : uint32_t sci_low_part = (msg_macsec.txsc.mac_sa[0] << 16);
782 : :
783 : : uint32_t port_identifier = 1;
784 : :
785 : 0 : msg_macsec.txsc.sci[1] = sci_hi_part;
786 : 0 : msg_macsec.txsc.sci[0] = sci_low_part | port_identifier;
787 : :
788 : 0 : hw->aq_fw_ops->send_macsec_req(hw, &msg_macsec, &response);
789 : :
790 [ # # ]: 0 : if (response.result)
791 : : return -1;
792 : :
793 : : memset(&msg_macsec, 0, sizeof(msg_macsec));
794 : :
795 : : /* Configure RX SC */
796 : :
797 : 0 : msg_macsec.msg_type = macsec_add_rx_sc_msg;
798 : 0 : msg_macsec.rxsc.index = aqcfg->rxsc.pi;
799 : 0 : msg_macsec.rxsc.replay_protect =
800 : 0 : aqcfg->common.replay_protection_enabled;
801 : : msg_macsec.rxsc.anti_replay_window = 0;
802 : :
803 : : /* MAC addr for RX */
804 [ # # ]: 0 : msg_macsec.rxsc.mac_da[0] = rte_bswap32(aqcfg->rxsc.mac[1]);
805 [ # # ]: 0 : msg_macsec.rxsc.mac_da[1] = rte_bswap32(aqcfg->rxsc.mac[0]);
806 : : msg_macsec.rxsc.da_mask = 0;//0x3f;
807 : :
808 : : msg_macsec.rxsc.sa_mask = 0;
809 : :
810 : 0 : hw->aq_fw_ops->send_macsec_req(hw, &msg_macsec, &response);
811 : :
812 [ # # ]: 0 : if (response.result)
813 : : return -1;
814 : :
815 : : memset(&msg_macsec, 0, sizeof(msg_macsec));
816 : :
817 : : /* Configure RX SC */
818 : :
819 : 0 : msg_macsec.msg_type = macsec_add_tx_sa_msg;
820 : 0 : msg_macsec.txsa.index = aqcfg->txsa.idx;
821 : 0 : msg_macsec.txsa.next_pn = aqcfg->txsa.pn;
822 : :
823 [ # # ]: 0 : msg_macsec.txsa.key[0] = rte_bswap32(aqcfg->txsa.key[3]);
824 [ # # ]: 0 : msg_macsec.txsa.key[1] = rte_bswap32(aqcfg->txsa.key[2]);
825 [ # # ]: 0 : msg_macsec.txsa.key[2] = rte_bswap32(aqcfg->txsa.key[1]);
826 [ # # ]: 0 : msg_macsec.txsa.key[3] = rte_bswap32(aqcfg->txsa.key[0]);
827 : :
828 : 0 : hw->aq_fw_ops->send_macsec_req(hw, &msg_macsec, &response);
829 : :
830 [ # # ]: 0 : if (response.result)
831 : : return -1;
832 : :
833 : : memset(&msg_macsec, 0, sizeof(msg_macsec));
834 : :
835 : : /* Configure RX SA */
836 : :
837 : 0 : msg_macsec.msg_type = macsec_add_rx_sa_msg;
838 : 0 : msg_macsec.rxsa.index = aqcfg->rxsa.idx;
839 : 0 : msg_macsec.rxsa.next_pn = aqcfg->rxsa.pn;
840 : :
841 [ # # ]: 0 : msg_macsec.rxsa.key[0] = rte_bswap32(aqcfg->rxsa.key[3]);
842 [ # # ]: 0 : msg_macsec.rxsa.key[1] = rte_bswap32(aqcfg->rxsa.key[2]);
843 [ # # ]: 0 : msg_macsec.rxsa.key[2] = rte_bswap32(aqcfg->rxsa.key[1]);
844 [ # # ]: 0 : msg_macsec.rxsa.key[3] = rte_bswap32(aqcfg->rxsa.key[0]);
845 : :
846 : 0 : hw->aq_fw_ops->send_macsec_req(hw, &msg_macsec, &response);
847 : :
848 [ # # ]: 0 : if (response.result)
849 : 0 : return -1;
850 : :
851 : : return 0;
852 : : }
853 : :
854 : 0 : int atl_macsec_enable(struct rte_eth_dev *dev,
855 : : uint8_t encr, uint8_t repl_prot)
856 : : {
857 : : struct aq_hw_cfg_s *cfg =
858 : 0 : ATL_DEV_PRIVATE_TO_CFG(dev->data->dev_private);
859 : :
860 : 0 : cfg->aq_macsec.common.macsec_enabled = 1;
861 : 0 : cfg->aq_macsec.common.encryption_enabled = encr;
862 : 0 : cfg->aq_macsec.common.replay_protection_enabled = repl_prot;
863 : :
864 : 0 : return 0;
865 : : }
866 : :
867 : 0 : int atl_macsec_disable(struct rte_eth_dev *dev)
868 : : {
869 : : struct aq_hw_cfg_s *cfg =
870 : 0 : ATL_DEV_PRIVATE_TO_CFG(dev->data->dev_private);
871 : :
872 : 0 : cfg->aq_macsec.common.macsec_enabled = 0;
873 : :
874 : 0 : return 0;
875 : : }
876 : :
877 : 0 : int atl_macsec_config_txsc(struct rte_eth_dev *dev, uint8_t *mac)
878 : : {
879 : : struct aq_hw_cfg_s *cfg =
880 : 0 : ATL_DEV_PRIVATE_TO_CFG(dev->data->dev_private);
881 : :
882 : 0 : memset(&cfg->aq_macsec.txsc.mac, 0, sizeof(cfg->aq_macsec.txsc.mac));
883 : 0 : memcpy((uint8_t *)&cfg->aq_macsec.txsc.mac + 2, mac,
884 : : RTE_ETHER_ADDR_LEN);
885 : :
886 : 0 : return 0;
887 : : }
888 : :
889 : 0 : int atl_macsec_config_rxsc(struct rte_eth_dev *dev,
890 : : uint8_t *mac, uint16_t pi)
891 : : {
892 : : struct aq_hw_cfg_s *cfg =
893 : 0 : ATL_DEV_PRIVATE_TO_CFG(dev->data->dev_private);
894 : :
895 : 0 : memset(&cfg->aq_macsec.rxsc.mac, 0, sizeof(cfg->aq_macsec.rxsc.mac));
896 : 0 : memcpy((uint8_t *)&cfg->aq_macsec.rxsc.mac + 2, mac,
897 : : RTE_ETHER_ADDR_LEN);
898 : 0 : cfg->aq_macsec.rxsc.pi = pi;
899 : :
900 : 0 : return 0;
901 : : }
902 : :
903 : 0 : int atl_macsec_select_txsa(struct rte_eth_dev *dev,
904 : : uint8_t idx, uint8_t an,
905 : : uint32_t pn, uint8_t *key)
906 : : {
907 : : struct aq_hw_cfg_s *cfg =
908 : 0 : ATL_DEV_PRIVATE_TO_CFG(dev->data->dev_private);
909 : :
910 : 0 : cfg->aq_macsec.txsa.idx = idx;
911 : 0 : cfg->aq_macsec.txsa.pn = pn;
912 : 0 : cfg->aq_macsec.txsa.an = an;
913 : :
914 : 0 : memcpy(&cfg->aq_macsec.txsa.key, key, 16);
915 : 0 : return 0;
916 : : }
917 : :
918 : 0 : int atl_macsec_select_rxsa(struct rte_eth_dev *dev,
919 : : uint8_t idx, uint8_t an,
920 : : uint32_t pn, uint8_t *key)
921 : : {
922 : : struct aq_hw_cfg_s *cfg =
923 : 0 : ATL_DEV_PRIVATE_TO_CFG(dev->data->dev_private);
924 : :
925 : 0 : cfg->aq_macsec.rxsa.idx = idx;
926 : 0 : cfg->aq_macsec.rxsa.pn = pn;
927 : 0 : cfg->aq_macsec.rxsa.an = an;
928 : :
929 : 0 : memcpy(&cfg->aq_macsec.rxsa.key, key, 16);
930 : 0 : return 0;
931 : : }
932 : :
933 : : static int
934 : 0 : atl_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats,
935 : : struct eth_queue_stats *qstats)
936 : : {
937 : 0 : struct atl_adapter *adapter = ATL_DEV_TO_ADAPTER(dev);
938 : 0 : struct aq_hw_s *hw = &adapter->hw;
939 : : struct atl_sw_stats *swstats = &adapter->sw_stats;
940 : : unsigned int i;
941 : :
942 : 0 : hw->aq_fw_ops->update_stats(hw);
943 : :
944 : : /* Fill out the rte_eth_stats statistics structure */
945 : 0 : stats->ipackets = hw->curr_stats.dma_pkt_rc;
946 : 0 : stats->ibytes = hw->curr_stats.dma_oct_rc;
947 : 0 : stats->imissed = hw->curr_stats.dpc;
948 : 0 : stats->ierrors = hw->curr_stats.erpt;
949 : :
950 : 0 : stats->opackets = hw->curr_stats.dma_pkt_tc;
951 : 0 : stats->obytes = hw->curr_stats.dma_oct_tc;
952 : 0 : stats->oerrors = 0;
953 : :
954 : 0 : stats->rx_nombuf = swstats->rx_nombuf;
955 : :
956 [ # # ]: 0 : if (qstats != NULL) {
957 [ # # # # ]: 0 : for (i = 0; i < dev->data->nb_rx_queues && i < AQ_HW_MAX_RX_QUEUES; i++) {
958 : 0 : qstats[i].q_ipackets = swstats->rxq[i].packets;
959 : 0 : qstats[i].q_ibytes = swstats->rxq[i].bytes;
960 : : }
961 [ # # # # ]: 0 : for (i = 0; i < dev->data->nb_tx_queues && i < AQ_HW_MAX_TX_QUEUES; i++) {
962 : 0 : qstats[i].q_opackets = swstats->txq[i].packets;
963 : 0 : qstats[i].q_obytes = swstats->txq[i].bytes;
964 : : }
965 : : }
966 : 0 : return 0;
967 : : }
968 : :
969 : : static int
970 : 0 : atl_dev_stats_reset(struct rte_eth_dev *dev)
971 : : {
972 : 0 : struct atl_adapter *adapter = ATL_DEV_TO_ADAPTER(dev);
973 : 0 : struct aq_hw_s *hw = &adapter->hw;
974 : :
975 : 0 : hw->aq_fw_ops->update_stats(hw);
976 : :
977 : : /* Reset software totals */
978 : 0 : memset(&hw->curr_stats, 0, sizeof(hw->curr_stats));
979 : :
980 : 0 : memset(&adapter->sw_stats, 0, sizeof(adapter->sw_stats));
981 : :
982 : 0 : return 0;
983 : : }
984 : :
985 : : static int
986 : : atl_dev_xstats_get_count(struct rte_eth_dev *dev)
987 : : {
988 : 0 : struct atl_adapter *adapter =
989 : 0 : (struct atl_adapter *)dev->data->dev_private;
990 : :
991 : : struct aq_hw_s *hw = &adapter->hw;
992 : : unsigned int i, count = 0;
993 : :
994 [ # # # # ]: 0 : for (i = 0; i < RTE_DIM(atl_xstats_tbl); i++) {
995 [ # # # # ]: 0 : if (atl_xstats_tbl[i].type == XSTATS_TYPE_MACSEC &&
996 [ # # # # ]: 0 : ((hw->caps_lo & BIT(CAPS_LO_MACSEC)) == 0))
997 : 0 : continue;
998 : :
999 : 0 : count++;
1000 : : }
1001 : :
1002 : 0 : return count;
1003 : : }
1004 : :
1005 : : static int
1006 : 0 : atl_dev_xstats_get_names(struct rte_eth_dev *dev __rte_unused,
1007 : : struct rte_eth_xstat_name *xstats_names,
1008 : : unsigned int size)
1009 : : {
1010 : : unsigned int i;
1011 : : unsigned int count = atl_dev_xstats_get_count(dev);
1012 : :
1013 [ # # ]: 0 : if (xstats_names) {
1014 [ # # ]: 0 : for (i = 0; i < size && i < count; i++) {
1015 : 0 : snprintf(xstats_names[i].name,
1016 : : RTE_ETH_XSTATS_NAME_SIZE, "%s",
1017 : : atl_xstats_tbl[i].name);
1018 : : }
1019 : : }
1020 : :
1021 : 0 : return count;
1022 : : }
1023 : :
1024 : : static int
1025 : 0 : atl_dev_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstat *stats,
1026 : : unsigned int n)
1027 : : {
1028 : 0 : struct atl_adapter *adapter = dev->data->dev_private;
1029 : 0 : struct aq_hw_s *hw = &adapter->hw;
1030 : : struct get_stats req = { 0 };
1031 : 0 : struct macsec_msg_fw_request msg = { 0 };
1032 : 0 : struct macsec_msg_fw_response resp = { 0 };
1033 : : int err = -1;
1034 : : unsigned int i;
1035 : : unsigned int count = atl_dev_xstats_get_count(dev);
1036 : :
1037 [ # # ]: 0 : if (!stats)
1038 : : return count;
1039 : :
1040 [ # # ]: 0 : if (hw->aq_fw_ops->send_macsec_req != NULL) {
1041 : : req.ingress_sa_index = 0xff;
1042 : : req.egress_sc_index = 0xff;
1043 : : req.egress_sa_index = 0xff;
1044 : :
1045 : 0 : msg.msg_type = macsec_get_stats_msg;
1046 : 0 : msg.stats = req;
1047 : :
1048 : 0 : err = hw->aq_fw_ops->send_macsec_req(hw, &msg, &resp);
1049 : : }
1050 : :
1051 [ # # ]: 0 : for (i = 0; i < n && i < count; i++) {
1052 : 0 : stats[i].id = i;
1053 : :
1054 [ # # # ]: 0 : switch (atl_xstats_tbl[i].type) {
1055 : 0 : case XSTATS_TYPE_MSM:
1056 : 0 : stats[i].value = *(u64 *)((uint8_t *)&hw->curr_stats +
1057 : 0 : atl_xstats_tbl[i].offset);
1058 : 0 : break;
1059 : 0 : case XSTATS_TYPE_MACSEC:
1060 [ # # ]: 0 : if (!err) {
1061 : 0 : stats[i].value =
1062 : 0 : *(u64 *)((uint8_t *)&resp.stats +
1063 : 0 : atl_xstats_tbl[i].offset);
1064 : : }
1065 : : break;
1066 : : }
1067 : : }
1068 : :
1069 : 0 : return i;
1070 : : }
1071 : :
1072 : : static int
1073 : 0 : atl_fw_version_get(struct rte_eth_dev *dev, char *fw_version, size_t fw_size)
1074 : : {
1075 : 0 : struct aq_hw_s *hw = ATL_DEV_PRIVATE_TO_HW(dev->data->dev_private);
1076 : 0 : uint32_t fw_ver = 0;
1077 : : int ret = 0;
1078 : :
1079 : 0 : ret = hw_atl_utils_get_fw_version(hw, &fw_ver);
1080 [ # # ]: 0 : if (ret)
1081 : : return -EIO;
1082 : :
1083 : 0 : ret = snprintf(fw_version, fw_size, "%u.%u.%u", fw_ver >> 24,
1084 [ # # ]: 0 : (fw_ver >> 16) & 0xFFU, fw_ver & 0xFFFFU);
1085 [ # # ]: 0 : if (ret < 0)
1086 : : return -EINVAL;
1087 : :
1088 : 0 : ret += 1; /* add string null-terminator */
1089 [ # # ]: 0 : if (fw_size < (size_t)ret)
1090 : 0 : return ret;
1091 : :
1092 : : return 0;
1093 : : }
1094 : :
1095 : : static int
1096 : 0 : atl_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
1097 : : {
1098 : 0 : struct rte_pci_device *pci_dev = RTE_CLASS_TO_BUS_DEVICE(dev, *pci_dev);
1099 : :
1100 : 0 : dev_info->max_rx_queues = AQ_HW_MAX_RX_QUEUES;
1101 : 0 : dev_info->max_tx_queues = AQ_HW_MAX_TX_QUEUES;
1102 : :
1103 : 0 : dev_info->min_rx_bufsize = 1024;
1104 : 0 : dev_info->max_rx_pktlen = HW_ATL_B0_MTU_JUMBO;
1105 : 0 : dev_info->max_mac_addrs = HW_ATL_B0_MAC_MAX;
1106 : 0 : dev_info->max_vfs = pci_dev->max_vfs;
1107 : :
1108 : 0 : dev_info->max_hash_mac_addrs = 0;
1109 : 0 : dev_info->max_vmdq_pools = 0;
1110 : 0 : dev_info->vmdq_queue_num = 0;
1111 : :
1112 : 0 : dev_info->rx_offload_capa = ATL_RX_OFFLOADS;
1113 : :
1114 : 0 : dev_info->tx_offload_capa = ATL_TX_OFFLOADS;
1115 : :
1116 : :
1117 : 0 : dev_info->default_rxconf = (struct rte_eth_rxconf) {
1118 : : .rx_free_thresh = ATL_DEFAULT_RX_FREE_THRESH,
1119 : : };
1120 : :
1121 : 0 : dev_info->default_txconf = (struct rte_eth_txconf) {
1122 : : .tx_free_thresh = ATL_DEFAULT_TX_FREE_THRESH,
1123 : : };
1124 : :
1125 : 0 : dev_info->rx_desc_lim = rx_desc_lim;
1126 : 0 : dev_info->tx_desc_lim = tx_desc_lim;
1127 : :
1128 : 0 : dev_info->hash_key_size = HW_ATL_B0_RSS_HASHKEY_BITS / 8;
1129 : 0 : dev_info->reta_size = HW_ATL_B0_RSS_REDIRECTION_MAX;
1130 : 0 : dev_info->flow_type_rss_offloads = ATL_RSS_OFFLOAD_ALL;
1131 : :
1132 : : dev_info->speed_capa = RTE_ETH_LINK_SPEED_1G | RTE_ETH_LINK_SPEED_10G;
1133 : : dev_info->speed_capa |= RTE_ETH_LINK_SPEED_100M;
1134 : : dev_info->speed_capa |= RTE_ETH_LINK_SPEED_2_5G;
1135 : 0 : dev_info->speed_capa |= RTE_ETH_LINK_SPEED_5G;
1136 : :
1137 : 0 : return 0;
1138 : : }
1139 : :
1140 : : static const uint32_t *
1141 : 0 : atl_dev_supported_ptypes_get(struct rte_eth_dev *dev, size_t *no_of_elements)
1142 : : {
1143 : : static const uint32_t ptypes[] = {
1144 : : RTE_PTYPE_L2_ETHER,
1145 : : RTE_PTYPE_L2_ETHER_ARP,
1146 : : RTE_PTYPE_L2_ETHER_VLAN,
1147 : : RTE_PTYPE_L3_IPV4,
1148 : : RTE_PTYPE_L3_IPV6,
1149 : : RTE_PTYPE_L4_TCP,
1150 : : RTE_PTYPE_L4_UDP,
1151 : : RTE_PTYPE_L4_SCTP,
1152 : : RTE_PTYPE_L4_ICMP,
1153 : : };
1154 : :
1155 [ # # ]: 0 : if (dev->rx_pkt_burst == atl_recv_pkts) {
1156 : 0 : *no_of_elements = RTE_DIM(ptypes);
1157 : 0 : return ptypes;
1158 : : }
1159 : :
1160 : : return NULL;
1161 : : }
1162 : :
1163 : : static void
1164 : 0 : atl_dev_delayed_handler(void *param)
1165 : : {
1166 : : struct rte_eth_dev *dev = (struct rte_eth_dev *)param;
1167 : :
1168 : 0 : atl_dev_configure_macsec(dev);
1169 : 0 : }
1170 : :
1171 : :
1172 : : /* return 0 means link status changed, -1 means not changed */
1173 : : static int
1174 : 0 : atl_dev_link_update(struct rte_eth_dev *dev, int wait __rte_unused)
1175 : : {
1176 : 0 : struct aq_hw_s *hw = ATL_DEV_PRIVATE_TO_HW(dev->data->dev_private);
1177 : : struct rte_eth_link link, old;
1178 : 0 : u32 fc = AQ_NIC_FC_OFF;
1179 : : int err = 0;
1180 : :
1181 : 0 : link.link_status = RTE_ETH_LINK_DOWN;
1182 : 0 : link.link_speed = 0;
1183 : 0 : link.link_duplex = RTE_ETH_LINK_FULL_DUPLEX;
1184 : 0 : link.link_autoneg = hw->is_autoneg ? RTE_ETH_LINK_AUTONEG : RTE_ETH_LINK_FIXED;
1185 : : memset(&old, 0, sizeof(old));
1186 : :
1187 : : /* load old link status */
1188 : 0 : rte_eth_linkstatus_get(dev, &old);
1189 : :
1190 : : /* read current link status */
1191 : 0 : err = hw->aq_fw_ops->update_link_status(hw);
1192 : :
1193 [ # # ]: 0 : if (err)
1194 : : return 0;
1195 : :
1196 [ # # ]: 0 : if (hw->aq_link_status.mbps == 0) {
1197 : : /* write default (down) link status */
1198 : 0 : rte_eth_linkstatus_set(dev, &link);
1199 [ # # ]: 0 : if (link.link_status == old.link_status)
1200 : : return -1;
1201 : 0 : return 0;
1202 : : }
1203 : :
1204 : 0 : link.link_status = RTE_ETH_LINK_UP;
1205 : : link.link_duplex = RTE_ETH_LINK_FULL_DUPLEX;
1206 : 0 : link.link_speed = hw->aq_link_status.mbps;
1207 : :
1208 : 0 : rte_eth_linkstatus_set(dev, &link);
1209 : :
1210 [ # # ]: 0 : if (link.link_status == old.link_status)
1211 : : return -1;
1212 : :
1213 : : /* Driver has to update flow control settings on RX block
1214 : : * on any link event.
1215 : : * We should query FW whether it negotiated FC.
1216 : : */
1217 [ # # ]: 0 : if (hw->aq_fw_ops->get_flow_control) {
1218 : 0 : hw->aq_fw_ops->get_flow_control(hw, &fc);
1219 : 0 : hw_atl_b0_set_fc(hw, fc, 0U);
1220 : : }
1221 : :
1222 [ # # ]: 0 : if (rte_eal_alarm_set(1000 * 1000,
1223 : : atl_dev_delayed_handler, (void *)dev) < 0)
1224 : 0 : PMD_DRV_LOG(ERR, "rte_eal_alarm_set fail");
1225 : :
1226 : : return 0;
1227 : : }
1228 : :
1229 : : static int
1230 : 0 : atl_dev_promiscuous_enable(struct rte_eth_dev *dev)
1231 : : {
1232 : 0 : struct aq_hw_s *hw = ATL_DEV_PRIVATE_TO_HW(dev->data->dev_private);
1233 : :
1234 : 0 : hw_atl_rpfl2promiscuous_mode_en_set(hw, true);
1235 : :
1236 : 0 : return 0;
1237 : : }
1238 : :
1239 : : static int
1240 : 0 : atl_dev_promiscuous_disable(struct rte_eth_dev *dev)
1241 : : {
1242 : 0 : struct aq_hw_s *hw = ATL_DEV_PRIVATE_TO_HW(dev->data->dev_private);
1243 : :
1244 : 0 : hw_atl_rpfl2promiscuous_mode_en_set(hw, false);
1245 : :
1246 : 0 : return 0;
1247 : : }
1248 : :
1249 : : static int
1250 : 0 : atl_dev_allmulticast_enable(struct rte_eth_dev *dev)
1251 : : {
1252 : 0 : struct aq_hw_s *hw = ATL_DEV_PRIVATE_TO_HW(dev->data->dev_private);
1253 : :
1254 : 0 : hw_atl_rpfl2_accept_all_mc_packets_set(hw, true);
1255 : :
1256 : 0 : return 0;
1257 : : }
1258 : :
1259 : : static int
1260 : 0 : atl_dev_allmulticast_disable(struct rte_eth_dev *dev)
1261 : : {
1262 : 0 : struct aq_hw_s *hw = ATL_DEV_PRIVATE_TO_HW(dev->data->dev_private);
1263 : :
1264 [ # # ]: 0 : if (dev->data->promiscuous == 1)
1265 : : return 0; /* must remain in all_multicast mode */
1266 : :
1267 : 0 : hw_atl_rpfl2_accept_all_mc_packets_set(hw, false);
1268 : :
1269 : 0 : return 0;
1270 : : }
1271 : :
1272 : : /**
1273 : : * It clears the interrupt causes and enables the interrupt.
1274 : : * It will be called once only during nic initialized.
1275 : : *
1276 : : * @param dev
1277 : : * Pointer to struct rte_eth_dev.
1278 : : * @param on
1279 : : * Enable or Disable.
1280 : : *
1281 : : * @return
1282 : : * - On success, zero.
1283 : : * - On failure, a negative value.
1284 : : */
1285 : :
1286 : : static int
1287 : : atl_dev_lsc_interrupt_setup(struct rte_eth_dev *dev, uint8_t on __rte_unused)
1288 : : {
1289 : 0 : atl_dev_link_status_print(dev);
1290 : 0 : return 0;
1291 : : }
1292 : :
1293 : : static int
1294 : : atl_dev_rxq_interrupt_setup(struct rte_eth_dev *dev __rte_unused)
1295 : : {
1296 : : return 0;
1297 : : }
1298 : :
1299 : :
1300 : : static int
1301 : 0 : atl_dev_interrupt_get_status(struct rte_eth_dev *dev)
1302 : : {
1303 : : struct atl_interrupt *intr =
1304 : 0 : ATL_DEV_PRIVATE_TO_INTR(dev->data->dev_private);
1305 : 0 : struct aq_hw_s *hw = ATL_DEV_PRIVATE_TO_HW(dev->data->dev_private);
1306 : 0 : u64 cause = 0;
1307 : :
1308 : 0 : hw_atl_b0_hw_irq_read(hw, &cause);
1309 : :
1310 : 0 : atl_disable_intr(hw);
1311 : :
1312 [ # # ]: 0 : if (cause & BIT(ATL_IRQ_CAUSE_LINK))
1313 : 0 : intr->flags |= ATL_FLAG_NEED_LINK_UPDATE;
1314 : :
1315 : 0 : return 0;
1316 : : }
1317 : :
1318 : : /**
1319 : : * It gets and then prints the link status.
1320 : : *
1321 : : * @param dev
1322 : : * Pointer to struct rte_eth_dev.
1323 : : *
1324 : : * @return
1325 : : * - On success, zero.
1326 : : * - On failure, a negative value.
1327 : : */
1328 : : static void
1329 : 0 : atl_dev_link_status_print(struct rte_eth_dev *dev)
1330 : : {
1331 : : struct rte_eth_link link;
1332 : :
1333 : : memset(&link, 0, sizeof(link));
1334 : 0 : rte_eth_linkstatus_get(dev, &link);
1335 [ # # ]: 0 : if (link.link_status) {
1336 [ # # ]: 0 : PMD_DRV_LOG(INFO, "Port %d: Link Up - speed %u Mbps - %s",
1337 : : (int)(dev->data->port_id),
1338 : : (unsigned int)link.link_speed,
1339 : : link.link_duplex == RTE_ETH_LINK_FULL_DUPLEX ?
1340 : : "full-duplex" : "half-duplex");
1341 : : } else {
1342 : 0 : PMD_DRV_LOG(INFO, " Port %d: Link Down",
1343 : : (int)(dev->data->port_id));
1344 : : }
1345 : :
1346 : :
1347 : : #ifdef DEBUG
1348 : : {
1349 : : struct rte_pci_device *pci_dev = RTE_CLASS_TO_BUS_DEVICE(dev, *pci_dev);
1350 : :
1351 : : PMD_DRV_LOG(DEBUG, "PCI Address: " PCI_PRI_FMT,
1352 : : pci_dev->addr.domain,
1353 : : pci_dev->addr.bus,
1354 : : pci_dev->addr.devid,
1355 : : pci_dev->addr.function);
1356 : : }
1357 : : #endif
1358 : :
1359 : 0 : PMD_DRV_LOG(INFO, "Link speed:%d", link.link_speed);
1360 : 0 : }
1361 : :
1362 : : /*
1363 : : * It executes link_update after knowing an interrupt occurred.
1364 : : *
1365 : : * @param dev
1366 : : * Pointer to struct rte_eth_dev.
1367 : : *
1368 : : * @return
1369 : : * - On success, zero.
1370 : : * - On failure, a negative value.
1371 : : */
1372 : : static int
1373 : 0 : atl_dev_interrupt_action(struct rte_eth_dev *dev,
1374 : : struct rte_intr_handle *intr_handle)
1375 : : {
1376 : : struct atl_interrupt *intr =
1377 : 0 : ATL_DEV_PRIVATE_TO_INTR(dev->data->dev_private);
1378 : : struct atl_adapter *adapter = dev->data->dev_private;
1379 : 0 : struct aq_hw_s *hw = &adapter->hw;
1380 : :
1381 [ # # ]: 0 : if (!(intr->flags & ATL_FLAG_NEED_LINK_UPDATE))
1382 : 0 : goto done;
1383 : :
1384 : 0 : intr->flags &= ~ATL_FLAG_NEED_LINK_UPDATE;
1385 : :
1386 : : /* Notify userapp if link status changed */
1387 [ # # ]: 0 : if (!atl_dev_link_update(dev, 0)) {
1388 : 0 : atl_dev_link_status_print(dev);
1389 : 0 : rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL);
1390 : : } else {
1391 [ # # ]: 0 : if (hw->aq_fw_ops->send_macsec_req == NULL)
1392 : 0 : goto done;
1393 : :
1394 : : /* Check macsec Keys expired */
1395 : : struct get_stats req = { 0 };
1396 : 0 : struct macsec_msg_fw_request msg = { 0 };
1397 : 0 : struct macsec_msg_fw_response resp = { 0 };
1398 : :
1399 : : req.ingress_sa_index = 0x0;
1400 : : req.egress_sc_index = 0x0;
1401 : : req.egress_sa_index = 0x0;
1402 : 0 : msg.msg_type = macsec_get_stats_msg;
1403 : : msg.stats = req;
1404 : :
1405 : 0 : int err = hw->aq_fw_ops->send_macsec_req(hw, &msg, &resp);
1406 [ # # ]: 0 : if (err) {
1407 : 0 : PMD_DRV_LOG(ERR, "send_macsec_req fail");
1408 : 0 : goto done;
1409 : : }
1410 [ # # ]: 0 : if (resp.stats.egress_threshold_expired ||
1411 [ # # ]: 0 : resp.stats.ingress_threshold_expired ||
1412 [ # # ]: 0 : resp.stats.egress_expired ||
1413 [ # # ]: 0 : resp.stats.ingress_expired) {
1414 : 0 : PMD_DRV_LOG(INFO, "RTE_ETH_EVENT_MACSEC");
1415 : 0 : rte_eth_dev_callback_process(dev,
1416 : : RTE_ETH_EVENT_MACSEC, NULL);
1417 : : }
1418 : : }
1419 : 0 : done:
1420 : : atl_enable_intr(dev);
1421 : 0 : rte_intr_ack(intr_handle);
1422 : :
1423 : 0 : return 0;
1424 : : }
1425 : :
1426 : : /**
1427 : : * Interrupt handler triggered by NIC for handling
1428 : : * specific interrupt.
1429 : : *
1430 : : * @param handle
1431 : : * Pointer to interrupt handle.
1432 : : * @param param
1433 : : * The address of parameter (struct rte_eth_dev *) registered before.
1434 : : *
1435 : : * @return
1436 : : * void
1437 : : */
1438 : : static void
1439 : 0 : atl_dev_interrupt_handler(void *param)
1440 : : {
1441 : : struct rte_eth_dev *dev = (struct rte_eth_dev *)param;
1442 : :
1443 : 0 : atl_dev_interrupt_get_status(dev);
1444 : 0 : atl_dev_interrupt_action(dev, dev->intr_handle);
1445 : 0 : }
1446 : :
1447 : :
1448 : : static int
1449 : 0 : atl_dev_get_eeprom_length(struct rte_eth_dev *dev __rte_unused)
1450 : : {
1451 : 0 : return SFP_EEPROM_SIZE;
1452 : : }
1453 : :
1454 : 0 : int atl_dev_get_eeprom(struct rte_eth_dev *dev,
1455 : : struct rte_dev_eeprom_info *eeprom)
1456 : : {
1457 : 0 : struct aq_hw_s *hw = ATL_DEV_PRIVATE_TO_HW(dev->data->dev_private);
1458 : : uint32_t dev_addr = SMBUS_DEVICE_ID;
1459 : :
1460 [ # # ]: 0 : if (hw->aq_fw_ops->get_eeprom == NULL)
1461 : : return -ENOTSUP;
1462 : :
1463 [ # # ]: 0 : if (eeprom->length + eeprom->offset > SFP_EEPROM_SIZE ||
1464 [ # # ]: 0 : eeprom->data == NULL)
1465 : : return -EINVAL;
1466 : :
1467 [ # # ]: 0 : if (eeprom->magic > 0x7F)
1468 : : return -EINVAL;
1469 : :
1470 [ # # ]: 0 : if (eeprom->magic)
1471 : : dev_addr = eeprom->magic;
1472 : :
1473 : 0 : return hw->aq_fw_ops->get_eeprom(hw, dev_addr, eeprom->data,
1474 : : eeprom->length, eeprom->offset);
1475 : : }
1476 : :
1477 : 0 : int atl_dev_set_eeprom(struct rte_eth_dev *dev,
1478 : : struct rte_dev_eeprom_info *eeprom)
1479 : : {
1480 : 0 : struct aq_hw_s *hw = ATL_DEV_PRIVATE_TO_HW(dev->data->dev_private);
1481 : : uint32_t dev_addr = SMBUS_DEVICE_ID;
1482 : :
1483 [ # # ]: 0 : if (hw->aq_fw_ops->set_eeprom == NULL)
1484 : : return -ENOTSUP;
1485 : :
1486 [ # # ]: 0 : if (eeprom->length + eeprom->offset > SFP_EEPROM_SIZE ||
1487 [ # # ]: 0 : eeprom->data == NULL)
1488 : : return -EINVAL;
1489 : :
1490 [ # # ]: 0 : if (eeprom->magic > 0x7F)
1491 : : return -EINVAL;
1492 : :
1493 [ # # ]: 0 : if (eeprom->magic)
1494 : : dev_addr = eeprom->magic;
1495 : :
1496 : 0 : return hw->aq_fw_ops->set_eeprom(hw, dev_addr, eeprom->data,
1497 : : eeprom->length, eeprom->offset);
1498 : : }
1499 : :
1500 : : static int
1501 : 0 : atl_dev_get_regs(struct rte_eth_dev *dev, struct rte_dev_reg_info *regs)
1502 : : {
1503 : 0 : struct aq_hw_s *hw = ATL_DEV_PRIVATE_TO_HW(dev->data->dev_private);
1504 : : u32 mif_id;
1505 : : int err;
1506 : :
1507 [ # # ]: 0 : if (regs->data == NULL) {
1508 : 0 : regs->length = hw_atl_utils_hw_get_reg_length();
1509 : 0 : regs->width = sizeof(u32);
1510 : 0 : return 0;
1511 : : }
1512 : :
1513 : : /* Only full register dump is supported */
1514 [ # # # # ]: 0 : if (regs->length && regs->length != hw_atl_utils_hw_get_reg_length())
1515 : : return -ENOTSUP;
1516 : :
1517 : 0 : err = hw_atl_utils_hw_get_regs(hw, regs->data);
1518 : :
1519 : : /* Device version */
1520 : 0 : mif_id = hw_atl_reg_glb_mif_id_get(hw);
1521 : 0 : regs->version = mif_id & 0xFFU;
1522 : :
1523 : 0 : return err;
1524 : : }
1525 : :
1526 : : static int
1527 : 0 : atl_flow_ctrl_get(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf)
1528 : : {
1529 : 0 : struct aq_hw_s *hw = ATL_DEV_PRIVATE_TO_HW(dev->data->dev_private);
1530 : 0 : u32 fc = AQ_NIC_FC_OFF;
1531 : :
1532 [ # # ]: 0 : if (hw->aq_fw_ops->get_flow_control == NULL)
1533 : : return -ENOTSUP;
1534 : :
1535 : 0 : hw->aq_fw_ops->get_flow_control(hw, &fc);
1536 : :
1537 [ # # ]: 0 : if (fc == AQ_NIC_FC_OFF)
1538 : 0 : fc_conf->mode = RTE_ETH_FC_NONE;
1539 [ # # ]: 0 : else if ((fc & AQ_NIC_FC_RX) && (fc & AQ_NIC_FC_TX))
1540 : 0 : fc_conf->mode = RTE_ETH_FC_FULL;
1541 [ # # ]: 0 : else if (fc & AQ_NIC_FC_RX)
1542 : 0 : fc_conf->mode = RTE_ETH_FC_RX_PAUSE;
1543 [ # # ]: 0 : else if (fc & AQ_NIC_FC_TX)
1544 : 0 : fc_conf->mode = RTE_ETH_FC_TX_PAUSE;
1545 : :
1546 : : return 0;
1547 : : }
1548 : :
1549 : : static int
1550 : 0 : atl_flow_ctrl_set(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf)
1551 : : {
1552 : 0 : struct aq_hw_s *hw = ATL_DEV_PRIVATE_TO_HW(dev->data->dev_private);
1553 : 0 : uint32_t old_flow_control = hw->aq_nic_cfg->flow_control;
1554 : :
1555 : :
1556 [ # # ]: 0 : if (hw->aq_fw_ops->set_flow_control == NULL)
1557 : : return -ENOTSUP;
1558 : :
1559 [ # # ]: 0 : if (fc_conf->mode == RTE_ETH_FC_NONE)
1560 : 0 : hw->aq_nic_cfg->flow_control = AQ_NIC_FC_OFF;
1561 [ # # ]: 0 : else if (fc_conf->mode == RTE_ETH_FC_RX_PAUSE)
1562 : 0 : hw->aq_nic_cfg->flow_control = AQ_NIC_FC_RX;
1563 [ # # ]: 0 : else if (fc_conf->mode == RTE_ETH_FC_TX_PAUSE)
1564 : 0 : hw->aq_nic_cfg->flow_control = AQ_NIC_FC_TX;
1565 [ # # ]: 0 : else if (fc_conf->mode == RTE_ETH_FC_FULL)
1566 : 0 : hw->aq_nic_cfg->flow_control = (AQ_NIC_FC_RX | AQ_NIC_FC_TX);
1567 : :
1568 [ # # ]: 0 : if (old_flow_control != hw->aq_nic_cfg->flow_control)
1569 : 0 : return hw->aq_fw_ops->set_flow_control(hw);
1570 : :
1571 : : return 0;
1572 : : }
1573 : :
1574 : : static int
1575 : 0 : atl_update_mac_addr(struct rte_eth_dev *dev, uint32_t index,
1576 : : u8 *mac_addr, bool enable)
1577 : : {
1578 : 0 : struct aq_hw_s *hw = ATL_DEV_PRIVATE_TO_HW(dev->data->dev_private);
1579 : : unsigned int h = 0U;
1580 : : unsigned int l = 0U;
1581 : : int err;
1582 : :
1583 [ # # ]: 0 : if (mac_addr) {
1584 : 0 : h = (mac_addr[0] << 8) | (mac_addr[1]);
1585 : 0 : l = (mac_addr[2] << 24) | (mac_addr[3] << 16) |
1586 : 0 : (mac_addr[4] << 8) | mac_addr[5];
1587 : : }
1588 : :
1589 : 0 : hw_atl_rpfl2_uc_flr_en_set(hw, 0U, index);
1590 : 0 : hw_atl_rpfl2unicast_dest_addresslsw_set(hw, l, index);
1591 : 0 : hw_atl_rpfl2unicast_dest_addressmsw_set(hw, h, index);
1592 : :
1593 [ # # ]: 0 : if (enable)
1594 : 0 : hw_atl_rpfl2_uc_flr_en_set(hw, 1U, index);
1595 : :
1596 : 0 : err = aq_hw_err_from_flags(hw);
1597 : :
1598 : 0 : return err;
1599 : : }
1600 : :
1601 : : static int
1602 [ # # ]: 0 : atl_add_mac_addr(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr,
1603 : : uint32_t index __rte_unused, uint32_t pool __rte_unused)
1604 : : {
1605 [ # # ]: 0 : if (rte_is_zero_ether_addr(mac_addr)) {
1606 : 0 : PMD_DRV_LOG(ERR, "Invalid Ethernet Address");
1607 : 0 : return -EINVAL;
1608 : : }
1609 : :
1610 : 0 : return atl_update_mac_addr(dev, index, (u8 *)mac_addr, true);
1611 : : }
1612 : :
1613 : : static void
1614 : 0 : atl_remove_mac_addr(struct rte_eth_dev *dev, uint32_t index)
1615 : : {
1616 : 0 : atl_update_mac_addr(dev, index, NULL, false);
1617 : 0 : }
1618 : :
1619 : : static int
1620 : 0 : atl_set_default_mac_addr(struct rte_eth_dev *dev, struct rte_ether_addr *addr)
1621 : : {
1622 : : atl_remove_mac_addr(dev, 0);
1623 : 0 : atl_add_mac_addr(dev, addr, 0, 0);
1624 : 0 : return 0;
1625 : : }
1626 : :
1627 : : static int
1628 : 0 : atl_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
1629 : : {
1630 : : struct rte_eth_dev_info dev_info;
1631 : : int ret;
1632 : 0 : uint32_t frame_size = mtu + RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN;
1633 : :
1634 : 0 : ret = atl_dev_info_get(dev, &dev_info);
1635 [ # # ]: 0 : if (ret != 0)
1636 : : return ret;
1637 : :
1638 [ # # # # ]: 0 : if (mtu < RTE_ETHER_MIN_MTU || frame_size > dev_info.max_rx_pktlen)
1639 : 0 : return -EINVAL;
1640 : :
1641 : : return 0;
1642 : : }
1643 : :
1644 : : static int
1645 : 0 : atl_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on)
1646 : : {
1647 : : struct aq_hw_cfg_s *cfg =
1648 : 0 : ATL_DEV_PRIVATE_TO_CFG(dev->data->dev_private);
1649 : 0 : struct aq_hw_s *hw = ATL_DEV_PRIVATE_TO_HW(dev->data->dev_private);
1650 : : int err = 0;
1651 : : int i = 0;
1652 : :
1653 : 0 : PMD_INIT_FUNC_TRACE();
1654 : :
1655 [ # # ]: 0 : for (i = 0; i < HW_ATL_B0_MAX_VLAN_IDS; i++) {
1656 [ # # ]: 0 : if (cfg->vlan_filter[i] == vlan_id) {
1657 [ # # ]: 0 : if (!on) {
1658 : : /* Disable VLAN filter. */
1659 : 0 : hw_atl_rpf_vlan_flr_en_set(hw, 0U, i);
1660 : :
1661 : : /* Clear VLAN filter entry */
1662 : 0 : cfg->vlan_filter[i] = 0;
1663 : : }
1664 : : break;
1665 : : }
1666 : : }
1667 : :
1668 : : /* VLAN_ID was not found. So, nothing to delete. */
1669 [ # # ]: 0 : if (i == HW_ATL_B0_MAX_VLAN_IDS && !on)
1670 : 0 : goto exit;
1671 : :
1672 : : /* VLAN_ID already exist, or already removed above. Nothing to do. */
1673 [ # # ]: 0 : if (i != HW_ATL_B0_MAX_VLAN_IDS)
1674 : 0 : goto exit;
1675 : :
1676 : : /* Try to found free VLAN filter to add new VLAN_ID */
1677 [ # # ]: 0 : for (i = 0; i < HW_ATL_B0_MAX_VLAN_IDS; i++) {
1678 [ # # ]: 0 : if (cfg->vlan_filter[i] == 0)
1679 : : break;
1680 : : }
1681 : :
1682 [ # # ]: 0 : if (i == HW_ATL_B0_MAX_VLAN_IDS) {
1683 : : /* We have no free VLAN filter to add new VLAN_ID*/
1684 : : err = -ENOMEM;
1685 : 0 : goto exit;
1686 : : }
1687 : :
1688 : 0 : cfg->vlan_filter[i] = vlan_id;
1689 : 0 : hw_atl_rpf_vlan_flr_act_set(hw, 1U, i);
1690 : 0 : hw_atl_rpf_vlan_id_flr_set(hw, vlan_id, i);
1691 : 0 : hw_atl_rpf_vlan_flr_en_set(hw, 1U, i);
1692 : :
1693 : 0 : exit:
1694 : : /* Enable VLAN promisc mode if vlan_filter empty */
1695 [ # # ]: 0 : for (i = 0; i < HW_ATL_B0_MAX_VLAN_IDS; i++) {
1696 [ # # ]: 0 : if (cfg->vlan_filter[i] != 0)
1697 : : break;
1698 : : }
1699 : :
1700 : 0 : hw_atl_rpf_vlan_prom_mode_en_set(hw, i == HW_ATL_B0_MAX_VLAN_IDS);
1701 : :
1702 : 0 : return err;
1703 : : }
1704 : :
1705 : : static int
1706 : 0 : atl_enable_vlan_filter(struct rte_eth_dev *dev, int en)
1707 : : {
1708 : 0 : struct aq_hw_s *hw = ATL_DEV_PRIVATE_TO_HW(dev->data->dev_private);
1709 : : struct aq_hw_cfg_s *cfg =
1710 : : ATL_DEV_PRIVATE_TO_CFG(dev->data->dev_private);
1711 : : int i;
1712 : :
1713 : 0 : PMD_INIT_FUNC_TRACE();
1714 : :
1715 [ # # ]: 0 : for (i = 0; i < HW_ATL_B0_MAX_VLAN_IDS; i++) {
1716 [ # # ]: 0 : if (cfg->vlan_filter[i])
1717 : 0 : hw_atl_rpf_vlan_flr_en_set(hw, en, i);
1718 : : }
1719 : 0 : return 0;
1720 : : }
1721 : :
1722 : : static int
1723 : 0 : atl_vlan_offload_set(struct rte_eth_dev *dev, int mask)
1724 : : {
1725 : : struct aq_hw_cfg_s *cfg =
1726 : 0 : ATL_DEV_PRIVATE_TO_CFG(dev->data->dev_private);
1727 : 0 : struct aq_hw_s *hw = ATL_DEV_PRIVATE_TO_HW(dev->data->dev_private);
1728 : : int ret = 0;
1729 : : int i;
1730 : :
1731 : 0 : PMD_INIT_FUNC_TRACE();
1732 : :
1733 : 0 : ret = atl_enable_vlan_filter(dev, mask & RTE_ETH_VLAN_FILTER_MASK);
1734 : :
1735 : 0 : cfg->vlan_strip = !!(mask & RTE_ETH_VLAN_STRIP_MASK);
1736 : :
1737 [ # # ]: 0 : for (i = 0; i < dev->data->nb_rx_queues; i++)
1738 : 0 : hw_atl_rpo_rx_desc_vlan_stripping_set(hw, cfg->vlan_strip, i);
1739 : :
1740 [ # # ]: 0 : if (mask & RTE_ETH_VLAN_EXTEND_MASK)
1741 : : ret = -ENOTSUP;
1742 : :
1743 : 0 : return ret;
1744 : : }
1745 : :
1746 : : static int
1747 : 0 : atl_vlan_tpid_set(struct rte_eth_dev *dev, enum rte_vlan_type vlan_type,
1748 : : uint16_t tpid)
1749 : : {
1750 : 0 : struct aq_hw_s *hw = ATL_DEV_PRIVATE_TO_HW(dev->data->dev_private);
1751 : : int err = 0;
1752 : :
1753 : 0 : PMD_INIT_FUNC_TRACE();
1754 : :
1755 [ # # # ]: 0 : switch (vlan_type) {
1756 : 0 : case RTE_ETH_VLAN_TYPE_INNER:
1757 : 0 : hw_atl_rpf_vlan_inner_etht_set(hw, tpid);
1758 : 0 : break;
1759 : 0 : case RTE_ETH_VLAN_TYPE_OUTER:
1760 : 0 : hw_atl_rpf_vlan_outer_etht_set(hw, tpid);
1761 : 0 : break;
1762 : 0 : default:
1763 : 0 : PMD_DRV_LOG(ERR, "Unsupported VLAN type");
1764 : : err = -ENOTSUP;
1765 : : }
1766 : :
1767 : 0 : return err;
1768 : : }
1769 : :
1770 : : static void
1771 : 0 : atl_vlan_strip_queue_set(struct rte_eth_dev *dev, uint16_t queue_id, int on)
1772 : : {
1773 : 0 : struct aq_hw_s *hw = ATL_DEV_PRIVATE_TO_HW(dev->data->dev_private);
1774 : :
1775 : 0 : PMD_INIT_FUNC_TRACE();
1776 : :
1777 [ # # ]: 0 : if (queue_id > dev->data->nb_rx_queues) {
1778 : 0 : PMD_DRV_LOG(ERR, "Invalid queue id");
1779 : 0 : return;
1780 : : }
1781 : :
1782 : 0 : hw_atl_rpo_rx_desc_vlan_stripping_set(hw, on, queue_id);
1783 : : }
1784 : :
1785 : : static int
1786 : 0 : atl_dev_set_mc_addr_list(struct rte_eth_dev *dev,
1787 : : struct rte_ether_addr *mc_addr_set,
1788 : : uint32_t nb_mc_addr)
1789 : : {
1790 : 0 : struct aq_hw_s *hw = ATL_DEV_PRIVATE_TO_HW(dev->data->dev_private);
1791 : : u32 i;
1792 : :
1793 [ # # ]: 0 : if (nb_mc_addr > AQ_HW_MULTICAST_ADDRESS_MAX - HW_ATL_B0_MAC_MIN)
1794 : : return -EINVAL;
1795 : :
1796 : : /* Update whole uc filters table */
1797 [ # # ]: 0 : for (i = 0; i < AQ_HW_MULTICAST_ADDRESS_MAX - HW_ATL_B0_MAC_MIN; i++) {
1798 : : u8 *mac_addr = NULL;
1799 : : u32 l = 0, h = 0;
1800 : :
1801 [ # # ]: 0 : if (i < nb_mc_addr) {
1802 : 0 : mac_addr = mc_addr_set[i].addr_bytes;
1803 : 0 : l = (mac_addr[2] << 24) | (mac_addr[3] << 16) |
1804 : 0 : (mac_addr[4] << 8) | mac_addr[5];
1805 : 0 : h = (mac_addr[0] << 8) | mac_addr[1];
1806 : : }
1807 : :
1808 : 0 : hw_atl_rpfl2_uc_flr_en_set(hw, 0U, HW_ATL_B0_MAC_MIN + i);
1809 : 0 : hw_atl_rpfl2unicast_dest_addresslsw_set(hw, l,
1810 : : HW_ATL_B0_MAC_MIN + i);
1811 : 0 : hw_atl_rpfl2unicast_dest_addressmsw_set(hw, h,
1812 : : HW_ATL_B0_MAC_MIN + i);
1813 : 0 : hw_atl_rpfl2_uc_flr_en_set(hw, !!mac_addr,
1814 : : HW_ATL_B0_MAC_MIN + i);
1815 : : }
1816 : :
1817 : : return 0;
1818 : : }
1819 : :
1820 : : static int
1821 : 0 : atl_reta_update(struct rte_eth_dev *dev,
1822 : : struct rte_eth_rss_reta_entry64 *reta_conf,
1823 : : uint16_t reta_size)
1824 : : {
1825 : : int i;
1826 : 0 : struct aq_hw_s *hw = ATL_DEV_PRIVATE_TO_HW(dev->data->dev_private);
1827 : : struct aq_hw_cfg_s *cf = ATL_DEV_PRIVATE_TO_CFG(dev->data->dev_private);
1828 : :
1829 [ # # # # ]: 0 : for (i = 0; i < reta_size && i < cf->aq_rss.indirection_table_size; i++)
1830 : 0 : cf->aq_rss.indirection_table[i] = min(reta_conf->reta[i],
1831 : : dev->data->nb_rx_queues - 1);
1832 : :
1833 : 0 : hw_atl_b0_hw_rss_set(hw, &cf->aq_rss);
1834 : 0 : return 0;
1835 : : }
1836 : :
1837 : : static int
1838 : 0 : atl_reta_query(struct rte_eth_dev *dev,
1839 : : struct rte_eth_rss_reta_entry64 *reta_conf,
1840 : : uint16_t reta_size)
1841 : : {
1842 : : int i;
1843 : 0 : struct aq_hw_cfg_s *cf = ATL_DEV_PRIVATE_TO_CFG(dev->data->dev_private);
1844 : :
1845 [ # # # # ]: 0 : for (i = 0; i < reta_size && i < cf->aq_rss.indirection_table_size; i++)
1846 : 0 : reta_conf->reta[i] = cf->aq_rss.indirection_table[i];
1847 : 0 : reta_conf->mask = ~0U;
1848 : 0 : return 0;
1849 : : }
1850 : :
1851 : : static int
1852 : 0 : atl_rss_hash_update(struct rte_eth_dev *dev,
1853 : : struct rte_eth_rss_conf *rss_conf)
1854 : : {
1855 : 0 : struct aq_hw_s *hw = ATL_DEV_PRIVATE_TO_HW(dev->data->dev_private);
1856 : : struct aq_hw_cfg_s *cfg =
1857 : : ATL_DEV_PRIVATE_TO_CFG(dev->data->dev_private);
1858 : : static u8 def_rss_key[40] = {
1859 : : 0x1e, 0xad, 0x71, 0x87, 0x65, 0xfc, 0x26, 0x7d,
1860 : : 0x0d, 0x45, 0x67, 0x74, 0xcd, 0x06, 0x1a, 0x18,
1861 : : 0xb6, 0xc1, 0xf0, 0xc7, 0xbb, 0x18, 0xbe, 0xf8,
1862 : : 0x19, 0x13, 0x4b, 0xa9, 0xd0, 0x3e, 0xfe, 0x70,
1863 : : 0x25, 0x03, 0xab, 0x50, 0x6a, 0x8b, 0x82, 0x0c
1864 : : };
1865 : :
1866 : 0 : cfg->is_rss = !!rss_conf->rss_hf;
1867 [ # # ]: 0 : if (rss_conf->rss_key) {
1868 : 0 : memcpy(cfg->aq_rss.hash_secret_key, rss_conf->rss_key,
1869 : 0 : rss_conf->rss_key_len);
1870 : 0 : cfg->aq_rss.hash_secret_key_size = rss_conf->rss_key_len;
1871 : : } else {
1872 : 0 : memcpy(cfg->aq_rss.hash_secret_key, def_rss_key,
1873 : : sizeof(def_rss_key));
1874 : 0 : cfg->aq_rss.hash_secret_key_size = sizeof(def_rss_key);
1875 : : }
1876 : :
1877 : 0 : hw_atl_b0_hw_rss_set(hw, &cfg->aq_rss);
1878 : 0 : hw_atl_b0_hw_rss_hash_set(hw, &cfg->aq_rss);
1879 : 0 : return 0;
1880 : : }
1881 : :
1882 : : static int
1883 : 0 : atl_rss_hash_conf_get(struct rte_eth_dev *dev,
1884 : : struct rte_eth_rss_conf *rss_conf)
1885 : : {
1886 : : struct aq_hw_cfg_s *cfg =
1887 : 0 : ATL_DEV_PRIVATE_TO_CFG(dev->data->dev_private);
1888 : :
1889 [ # # ]: 0 : rss_conf->rss_hf = cfg->is_rss ? ATL_RSS_OFFLOAD_ALL : 0;
1890 [ # # ]: 0 : if (rss_conf->rss_key) {
1891 : 0 : rss_conf->rss_key_len = cfg->aq_rss.hash_secret_key_size;
1892 : 0 : memcpy(rss_conf->rss_key, cfg->aq_rss.hash_secret_key,
1893 : : rss_conf->rss_key_len);
1894 : : }
1895 : :
1896 : 0 : return 0;
1897 : : }
1898 : :
1899 : : static bool
1900 : : is_device_supported(struct rte_eth_dev *dev, struct rte_pci_driver *drv)
1901 : : {
1902 : 0 : if (strcmp(dev->device->driver->name, drv->driver.name))
1903 : 0 : return false;
1904 : :
1905 : : return true;
1906 : : }
1907 : :
1908 : : bool
1909 [ # # ]: 0 : is_atlantic_supported(struct rte_eth_dev *dev)
1910 : : {
1911 : 0 : return is_device_supported(dev, &rte_atl_pmd);
1912 : : }
1913 : :
1914 : 302 : RTE_PMD_REGISTER_PCI(net_atlantic, rte_atl_pmd);
1915 : : RTE_PMD_REGISTER_PCI_TABLE(net_atlantic, pci_id_atl_map);
1916 : : RTE_PMD_REGISTER_KMOD_DEP(net_atlantic, "* igb_uio | uio_pci_generic");
1917 [ - + ]: 302 : RTE_LOG_REGISTER_SUFFIX(atl_logtype_init, init, NOTICE);
1918 [ - + ]: 302 : RTE_LOG_REGISTER_SUFFIX(atl_logtype_driver, driver, NOTICE);
|