Add layer to support Jailhouse hypervisor
[AGL/meta-agl-devel.git] / meta-agl-jailhouse / recipes-kernel / linux / linux / 0031-ivshmem-net-Switch-to-netdev_xmit_more-helper.patch
1 From 6c86f9ef9fa5029b8f87867f47fe51d6cc1960a5 Mon Sep 17 00:00:00 2001
2 From: Jan Kiszka <jan.kiszka@siemens.com>
3 Date: Sun, 2 Jun 2019 11:58:20 +0200
4 Subject: [PATCH 31/32] ivshmem-net: Switch to netdev_xmit_more helper
5
6 The skb field has been removed by 4f296edeb9d4.
7
8 Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
9 ---
10  drivers/net/ivshmem-net.c | 10 ++++++----
11  1 file changed, 6 insertions(+), 4 deletions(-)
12
13 diff --git a/drivers/net/ivshmem-net.c b/drivers/net/ivshmem-net.c
14 index aba77c232c48..9946cef63c1f 100644
15 --- a/drivers/net/ivshmem-net.c
16 +++ b/drivers/net/ivshmem-net.c
17 @@ -294,7 +294,8 @@ static u32 ivshm_net_tx_advance(struct ivshm_net_queue *q, u32 *pos, u32 len)
18         return p;
19  }
20  
21 -static int ivshm_net_tx_frame(struct net_device *ndev, struct sk_buff *skb)
22 +static int ivshm_net_tx_frame(struct net_device *ndev, struct sk_buff *skb,
23 +                             bool xmit_more)
24  {
25         struct ivshm_net *in = netdev_priv(ndev);
26         struct ivshm_net_queue *tx = &in->tx;
27 @@ -327,7 +328,7 @@ static int ivshm_net_tx_frame(struct net_device *ndev, struct sk_buff *skb)
28         vr->avail->ring[avail] = desc_idx;
29         tx->num_added++;
30  
31 -       if (!skb->xmit_more) {
32 +       if (!xmit_more) {
33                 virt_store_release(&vr->avail->idx, tx->last_avail_idx);
34                 ivshm_net_notify_tx(in, tx->num_added);
35                 tx->num_added = 0;
36 @@ -509,17 +510,18 @@ static int ivshm_net_poll(struct napi_struct *napi, int budget)
37  static netdev_tx_t ivshm_net_xmit(struct sk_buff *skb, struct net_device *ndev)
38  {
39         struct ivshm_net *in = netdev_priv(ndev);
40 +       bool xmit_more = netdev_xmit_more();
41  
42         ivshm_net_tx_clean(ndev);
43  
44         if (!ivshm_net_tx_ok(in, ndev->mtu)) {
45                 ivshm_net_enable_tx_irq(in);
46                 netif_stop_queue(ndev);
47 -               skb->xmit_more = 0;
48 +               xmit_more = false;
49                 in->stats.tx_pause++;
50         }
51  
52 -       ivshm_net_tx_frame(ndev, skb);
53 +       ivshm_net_tx_frame(ndev, skb, xmit_more);
54  
55         in->stats.tx_packets++;
56         ndev->stats.tx_packets++;
57 -- 
58 2.11.0
59