Shrink the size of struct ag71xx_buf to 8 bytes, which improves cache
footprint
Signed-off-by: Felix Fietkau <nbd@nbd.name>
};
union {
dma_addr_t dma_addr;
};
union {
dma_addr_t dma_addr;
- unsigned long timestamp;
struct napi_struct napi;
u32 msg_enable;
struct napi_struct napi;
u32 msg_enable;
+ unsigned long timestamp;
+
/*
* From this point onwards we're not looking at per-packet fields.
*/
/*
* From this point onwards we're not looking at per-packet fields.
*/
i = (ring->curr + n - 1) & ring_mask;
ring->buf[i].len = skb->len;
ring->buf[i].skb = skb;
i = (ring->curr + n - 1) & ring_mask;
ring->buf[i].len = skb->len;
ring->buf[i].skb = skb;
- ring->buf[i].timestamp = jiffies;
+ ag->timestamp = jiffies;
netdev_sent_queue(dev, skb->len);
netdev_sent_queue(dev, skb->len);
-static bool ag71xx_check_dma_stuck(struct ag71xx *ag, unsigned long timestamp)
+static bool ag71xx_check_dma_stuck(struct ag71xx *ag)
{
u32 rx_sm, tx_sm, rx_fd;
{
u32 rx_sm, tx_sm, rx_fd;
- if (likely(time_before(jiffies, timestamp + HZ/10)))
+ if (likely(time_before(jiffies, ag->timestamp + HZ/10)))
return false;
if (!netif_carrier_ok(ag->dev))
return false;
if (!netif_carrier_ok(ag->dev))
if (!flush && !ag71xx_desc_empty(desc)) {
if (pdata->is_ar724x &&
if (!flush && !ag71xx_desc_empty(desc)) {
if (pdata->is_ar724x &&
- ag71xx_check_dma_stuck(ag, ring->buf[i].timestamp)) {
+ ag71xx_check_dma_stuck(ag)) {
schedule_delayed_work(&ag->restart_work, HZ / 2);
dma_stuck = true;
}
schedule_delayed_work(&ag->restart_work, HZ / 2);
dma_stuck = true;
}