Re: [PATCH net-next v3] atl1c: add 4 RX/TX queue support for Mikrotik 10/25G NIC

From: Gatis Peisenieks
Date: Thu May 27 2021 - 09:49:38 EST



On 2021-05-27 04:16, Jakub Kicinski wrote:
+/**
+ * atl1c_clean_rx - NAPI Rx polling callback
+ * @napi: napi info
+ * @budget: limit of packets to clean
+ */
+static int atl1c_clean_rx(struct napi_struct *napi, int budget)
{
+ struct atl1c_rrd_ring *rrd_ring =
+ container_of(napi, struct atl1c_rrd_ring, napi);
+ struct atl1c_adapter *adapter = rrd_ring->adapter;
+ int work_done = 0;
+ unsigned long flags;
u16 rfd_num, rfd_index;
- u16 count = 0;
u16 length;
struct pci_dev *pdev = adapter->pdev;
struct net_device *netdev = adapter->netdev;
- struct atl1c_rfd_ring *rfd_ring = &adapter->rfd_ring;
- struct atl1c_rrd_ring *rrd_ring = &adapter->rrd_ring;
+ struct atl1c_rfd_ring *rfd_ring = &adapter->rfd_ring[rrd_ring->num];
struct sk_buff *skb;
struct atl1c_recv_ret_status *rrs;
struct atl1c_buffer *buffer_info;

+ /* Keep link state information with original netdev */
+ if (!netif_carrier_ok(adapter->netdev))
+ goto quit_polling;

Interesting, I see you only move this code, but why does this driver
stop reading packets when link goes down? Surely there may be packets
already on the ring which Linux should process?

Jakub, I do not know what possible HW quirks this check might be
covering up, so I left it there. If you feel it is safe to remove
I can do a separate patch for that. I think it is fine for the
HW I work with, but that is far from everything this driver supports.

Thank you for reviewing this!