]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
tsnep: Record RX queue
authorGerhard Engleder <gerhard@engleder-embedded.com>
Wed, 17 Aug 2022 19:30:17 +0000 (21:30 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 22 Aug 2022 12:56:37 +0000 (13:56 +0100)
Other drivers record RX queue so it should make sense to do that also.

Signed-off-by: Gerhard Engleder <gerhard@engleder-embedded.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/engleder/tsnep.h
drivers/net/ethernet/engleder/tsnep_main.c

index 23bbece6b7dee232ff006c501b7cc90e748c7826..147fe03ca979b9d32e6cb314e6fc9e5fd1e14bdf 100644 (file)
@@ -87,6 +87,7 @@ struct tsnep_rx_entry {
 struct tsnep_rx {
        struct tsnep_adapter *adapter;
        void __iomem *addr;
+       int queue_index;
 
        void *page[TSNEP_RING_PAGE_COUNT];
        dma_addr_t page_dma[TSNEP_RING_PAGE_COUNT];
index 415ae6a4b32c0d0cd981b7b04c78a59a3a6e7303..19db8b1dddc46e48d49719af747084712582d17f 100644 (file)
@@ -749,6 +749,7 @@ static int tsnep_rx_poll(struct tsnep_rx *rx, struct napi_struct *napi,
                                hwtstamps->netdev_data = rx_inline;
                        }
                        skb_pull(skb, TSNEP_RX_INLINE_METADATA_SIZE);
+                       skb_record_rx_queue(skb, rx->queue_index);
                        skb->protocol = eth_type_trans(skb,
                                                       rx->adapter->netdev);
 
@@ -783,7 +784,7 @@ static int tsnep_rx_poll(struct tsnep_rx *rx, struct napi_struct *napi,
 }
 
 static int tsnep_rx_open(struct tsnep_adapter *adapter, void __iomem *addr,
-                        struct tsnep_rx *rx)
+                        int queue_index, struct tsnep_rx *rx)
 {
        dma_addr_t dma;
        int i;
@@ -792,6 +793,7 @@ static int tsnep_rx_open(struct tsnep_adapter *adapter, void __iomem *addr,
        memset(rx, 0, sizeof(*rx));
        rx->adapter = adapter;
        rx->addr = addr;
+       rx->queue_index = queue_index;
 
        retval = tsnep_rx_ring_init(rx);
        if (retval)
@@ -878,6 +880,7 @@ static int tsnep_netdev_open(struct net_device *netdev)
                if (adapter->queue[i].rx) {
                        addr = adapter->addr + TSNEP_QUEUE(rx_queue_index);
                        retval = tsnep_rx_open(adapter, addr,
+                                              rx_queue_index,
                                               adapter->queue[i].rx);
                        if (retval)
                                goto failed;