All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wen Gong <wgong@qti.qualcomm.com>
To: Nicolas Boichat <drinkcat@chromium.org>, Wen Gong <wgong@codeaurora.org>
Cc: "open list:NETWORKING DRIVERS (WIRELESS)" 
	<linux-wireless@vger.kernel.org>,
	"ath10k@lists.infradead.org" <ath10k@lists.infradead.org>
Subject: RE: [PATCH 1/7] ath10k: enable RX bundle receive for sdio
Date: Tue, 27 Aug 2019 08:02:52 +0000	[thread overview]
Message-ID: <2ec213d88ebb4b89812826866b39886d@aptaiexm02f.ap.qualcomm.com> (raw)
In-Reply-To: <CANMq1KBR0nd+XOJWpgWyoJdsFgZByQyjD-0dpttygiN0OfiD5Q@mail.gmail.com>

> -----Original Message-----
> From: ath10k <ath10k-bounces@lists.infradead.org> On Behalf Of Nicolas
> Boichat
> Sent: Tuesday, August 27, 2019 3:41 PM
> To: Wen Gong <wgong@codeaurora.org>
> Cc: open list:NETWORKING DRIVERS (WIRELESS) <linux-
> wireless@vger.kernel.org>; ath10k@lists.infradead.org
> Subject: [EXT] Re: [PATCH 1/7] ath10k: enable RX bundle receive for sdio
> 
> > -static int ath10k_sdio_mbox_rx_fetch(struct ath10k *ar)
> > +static int ath10k_sdio_mbox_rx_fetch_bundle(struct ath10k *ar)
> >  {
> >         struct ath10k_sdio *ar_sdio = ath10k_sdio_priv(ar);
> > +       struct ath10k_sdio_rx_data *pkt;
> >         int ret, i;
> > +       u32 pkt_offset, virt_pkt_len;
> >
> > +       virt_pkt_len = 0;
> >         for (i = 0; i < ar_sdio->n_rx_pkts; i++) {
> > -               ret = ath10k_sdio_mbox_rx_packet(ar,
> > -                                                &ar_sdio->rx_pkts[i]);
> > -               if (ret)
> > +               virt_pkt_len += ar_sdio->rx_pkts[i].alloc_len;
> > +       }
> > +
> > +       if (virt_pkt_len < ATH10K_SDIO_DMA_BUF_SIZE) {
> > +               ret = ath10k_sdio_readsb(ar, ar_sdio->mbox_info.htc_addr,
> > +                                        ar_sdio->vsg_buffer, virt_pkt_len);
> > +               if (ret) {
> > +                       i = 0;
> >                         goto err;
> > +               }
> > +       } else {
> > +               ath10k_err(ar, "size exceeding limit %d\n", virt_pkt_len);
> > +       }
> > +
> > +       pkt_offset = 0;
> > +       for (i = 0; i < ar_sdio->n_rx_pkts; i++) {
> > +               struct sk_buff *skb = ar_sdio->rx_pkts[i].skb;
> > +
> > +               pkt = &ar_sdio->rx_pkts[i];
> > +               memcpy(skb->data, ar_sdio->vsg_buffer + pkt_offset,
> > +                      pkt->alloc_len);
> 
> Why do you copy alloc_len if you only plan to use act_len?
alloc_len is aligned to block size(256),  and act_len maybe not same for each packet in the bundle.
Eg a bundle:
Packet 1 len 240,   alloc_len: 256, 1st time: act_len 240, left padding size is 16,
Packet 1 len 250, alloc_len: 256, 1st time: act_len 240, left padding size is 6,
Packet 1 len 230,   alloc_len: 256, 1st time: act_len 240, left padding size is 26,

The bundled buffer len is 256 * 3 = 768, it has 256 bytes for each packet, the left size is padding which 
Is not needed, but the left padding is not same for each packet, before read all the buffer from sdio bus,
It does not know each packet's act len, it only know the 1st packet's act len.
So it need to copy all the alloc_len's buffer to ensure it will not lose data.

> Actually, just use skb_put_data.
> 
> Also, do you have the same issue as
> https://patchwork.kernel.org/patch/11116215/ w.r.t. act_len being
> incorrect?
> 
> > +               pkt->status = 0;
> > +               skb_put(skb, pkt->act_len);
> > +               pkt_offset += pkt->alloc_len;
> >         }
> >
> >         return 0;
> >
> 
> _______________________________________________
> ath10k mailing list
> ath10k@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/ath10k

WARNING: multiple messages have this Message-ID (diff)
From: Wen Gong <wgong@qti.qualcomm.com>
To: Nicolas Boichat <drinkcat@chromium.org>, Wen Gong <wgong@codeaurora.org>
Cc: "open list:NETWORKING DRIVERS (WIRELESS)"
	<linux-wireless@vger.kernel.org>,
	"ath10k@lists.infradead.org" <ath10k@lists.infradead.org>
Subject: RE: [PATCH 1/7] ath10k: enable RX bundle receive for sdio
Date: Tue, 27 Aug 2019 08:02:52 +0000	[thread overview]
Message-ID: <2ec213d88ebb4b89812826866b39886d@aptaiexm02f.ap.qualcomm.com> (raw)
In-Reply-To: <CANMq1KBR0nd+XOJWpgWyoJdsFgZByQyjD-0dpttygiN0OfiD5Q@mail.gmail.com>

> -----Original Message-----
> From: ath10k <ath10k-bounces@lists.infradead.org> On Behalf Of Nicolas
> Boichat
> Sent: Tuesday, August 27, 2019 3:41 PM
> To: Wen Gong <wgong@codeaurora.org>
> Cc: open list:NETWORKING DRIVERS (WIRELESS) <linux-
> wireless@vger.kernel.org>; ath10k@lists.infradead.org
> Subject: [EXT] Re: [PATCH 1/7] ath10k: enable RX bundle receive for sdio
> 
> > -static int ath10k_sdio_mbox_rx_fetch(struct ath10k *ar)
> > +static int ath10k_sdio_mbox_rx_fetch_bundle(struct ath10k *ar)
> >  {
> >         struct ath10k_sdio *ar_sdio = ath10k_sdio_priv(ar);
> > +       struct ath10k_sdio_rx_data *pkt;
> >         int ret, i;
> > +       u32 pkt_offset, virt_pkt_len;
> >
> > +       virt_pkt_len = 0;
> >         for (i = 0; i < ar_sdio->n_rx_pkts; i++) {
> > -               ret = ath10k_sdio_mbox_rx_packet(ar,
> > -                                                &ar_sdio->rx_pkts[i]);
> > -               if (ret)
> > +               virt_pkt_len += ar_sdio->rx_pkts[i].alloc_len;
> > +       }
> > +
> > +       if (virt_pkt_len < ATH10K_SDIO_DMA_BUF_SIZE) {
> > +               ret = ath10k_sdio_readsb(ar, ar_sdio->mbox_info.htc_addr,
> > +                                        ar_sdio->vsg_buffer, virt_pkt_len);
> > +               if (ret) {
> > +                       i = 0;
> >                         goto err;
> > +               }
> > +       } else {
> > +               ath10k_err(ar, "size exceeding limit %d\n", virt_pkt_len);
> > +       }
> > +
> > +       pkt_offset = 0;
> > +       for (i = 0; i < ar_sdio->n_rx_pkts; i++) {
> > +               struct sk_buff *skb = ar_sdio->rx_pkts[i].skb;
> > +
> > +               pkt = &ar_sdio->rx_pkts[i];
> > +               memcpy(skb->data, ar_sdio->vsg_buffer + pkt_offset,
> > +                      pkt->alloc_len);
> 
> Why do you copy alloc_len if you only plan to use act_len?
alloc_len is aligned to block size(256),  and act_len maybe not same for each packet in the bundle.
Eg a bundle:
Packet 1 len 240,   alloc_len: 256, 1st time: act_len 240, left padding size is 16,
Packet 1 len 250, alloc_len: 256, 1st time: act_len 240, left padding size is 6,
Packet 1 len 230,   alloc_len: 256, 1st time: act_len 240, left padding size is 26,

The bundled buffer len is 256 * 3 = 768, it has 256 bytes for each packet, the left size is padding which 
Is not needed, but the left padding is not same for each packet, before read all the buffer from sdio bus,
It does not know each packet's act len, it only know the 1st packet's act len.
So it need to copy all the alloc_len's buffer to ensure it will not lose data.

> Actually, just use skb_put_data.
> 
> Also, do you have the same issue as
> https://patchwork.kernel.org/patch/11116215/ w.r.t. act_len being
> incorrect?
> 
> > +               pkt->status = 0;
> > +               skb_put(skb, pkt->act_len);
> > +               pkt_offset += pkt->alloc_len;
> >         }
> >
> >         return 0;
> >
> 
> _______________________________________________
> ath10k mailing list
> ath10k@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/ath10k

_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

  reply	other threads:[~2019-08-27  8:10 UTC|newest]

Thread overview: 70+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-20 11:55 [PATCH 0/7] ath10k: improve throughout of tcp/udp TX/RX of sdio Wen Gong
2019-08-20 11:55 ` Wen Gong
2019-08-20 11:55 ` [PATCH 1/7] ath10k: enable RX bundle receive for sdio Wen Gong
2019-08-20 11:55   ` Wen Gong
2019-08-27  7:40   ` Nicolas Boichat
2019-08-27  7:40     ` Nicolas Boichat
2019-08-27  8:02     ` Wen Gong [this message]
2019-08-27  8:02       ` Wen Gong
2019-08-27  8:08       ` Nicolas Boichat
2019-08-27  8:08         ` Nicolas Boichat
2019-08-28  4:25         ` Wen Gong
2019-08-28  4:25           ` Wen Gong
2019-08-20 11:55 ` [PATCH 2/7] ath10k: change max RX bundle size from 8 to 32 " Wen Gong
2019-08-20 11:55   ` Wen Gong
2019-08-20 12:23   ` Toke Høiland-Jørgensen
2019-08-20 12:23     ` Toke Høiland-Jørgensen
2019-08-21  6:01     ` Wen Gong
2019-08-21  6:01       ` Wen Gong
2019-08-21 10:02       ` Toke Høiland-Jørgensen
2019-08-21 10:02         ` Toke Høiland-Jørgensen
2019-08-27  7:42   ` Nicolas Boichat
2019-08-27  7:42     ` Nicolas Boichat
2019-08-28  2:31     ` Wen Gong
2019-08-28  2:31       ` Wen Gong
2019-09-03 16:09   ` Dave Taht
2019-09-03 16:09     ` Dave Taht
2019-09-04  4:43     ` Wen Gong
2019-09-04  4:43       ` Wen Gong
2019-09-04 13:34       ` Dave Taht
2019-09-04 13:34         ` Dave Taht
2019-09-05 10:12         ` Wen Gong
2019-09-05 10:12           ` Wen Gong
2019-08-20 11:55 ` [PATCH 3/7] ath10k: add workqueue for RX path of sdio Wen Gong
2019-08-20 11:55   ` Wen Gong
2019-09-04  2:31   ` Wen Gong
2019-09-04  2:31     ` Wen Gong
2019-08-20 11:55 ` [PATCH 4/7] ath10k: disable TX complete indication of htt for sdio Wen Gong
2019-08-20 11:55   ` Wen Gong
2019-08-20 12:23   ` Toke Høiland-Jørgensen
2019-08-20 12:23     ` Toke Høiland-Jørgensen
2019-08-21  6:20     ` Wen Gong
2019-08-21  6:20       ` Wen Gong
2019-08-21 10:10       ` Toke Høiland-Jørgensen
2019-08-21 10:10         ` Toke Høiland-Jørgensen
2019-08-21 10:20         ` Wen Gong
2019-08-21 10:20           ` Wen Gong
2019-08-22 12:12           ` Toke Høiland-Jørgensen
2019-08-22 12:12             ` Toke Høiland-Jørgensen
2019-08-23  2:46             ` Wen Gong
2019-08-23  2:46               ` Wen Gong
2019-08-23  8:39               ` Toke Høiland-Jørgensen
2019-08-23  8:39                 ` Toke Høiland-Jørgensen
2019-08-27  7:56   ` Nicolas Boichat
2019-08-27  7:56     ` Nicolas Boichat
2019-08-28  4:24     ` Wen Gong
2019-08-28  4:24       ` Wen Gong
2019-09-04  2:33   ` Wen Gong
2019-09-04  2:33     ` Wen Gong
2019-08-20 11:55 ` [PATCH 5/7] ath10k: add htt TX bundle " Wen Gong
2019-08-20 11:55   ` Wen Gong
2019-09-04  2:34   ` Wen Gong
2019-09-04  2:34     ` Wen Gong
2019-08-20 11:55 ` [PATCH 6/7] ath10k: enable alt data of TX path " Wen Gong
2019-08-20 11:55   ` Wen Gong
2019-09-04  2:36   ` Wen Gong
2019-09-04  2:36     ` Wen Gong
2019-08-20 11:55 ` [PATCH 7/7] ath10k: enable napi on RX " Wen Gong
2019-08-20 11:55   ` Wen Gong
2019-09-04  2:37   ` Wen Gong
2019-09-04  2:37     ` Wen Gong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2ec213d88ebb4b89812826866b39886d@aptaiexm02f.ap.qualcomm.com \
    --to=wgong@qti.qualcomm.com \
    --cc=ath10k@lists.infradead.org \
    --cc=drinkcat@chromium.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=wgong@codeaurora.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.