From: "Martinez, Ricardo" <ricardo.martinez@linux.intel.com>
To: Sergey Ryazanov <ryazanov.s.a@gmail.com>
Cc: netdev@vger.kernel.org, linux-wireless@vger.kernel.org,
Jakub Kicinski <kuba@kernel.org>,
David Miller <davem@davemloft.net>,
Johannes Berg <johannes@sipsolutions.net>,
Loic Poulain <loic.poulain@linaro.org>,
M Chetan Kumar <m.chetan.kumar@intel.com>,
chandrashekar.devegowda@intel.com,
Intel Corporation <linuxwwan@intel.com>,
chiranjeevi.rapolu@linux.intel.com, haijun.liu@mediatek.com,
amir.hanania@intel.com,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
dinesh.sharma@intel.com, eliot.lee@intel.com,
mika.westerberg@linux.intel.com, moises.veleta@intel.com,
pierre-louis.bossart@intel.com,
muralidharan.sethuraman@intel.com,
Soumya.Prakash.Mishra@intel.com, sreehari.kancharla@intel.com,
suresh.nagaraj@intel.com
Subject: Re: [PATCH v2 09/14] net: wwan: t7xx: Add WWAN network interface
Date: Tue, 30 Nov 2021 22:06:01 -0800 [thread overview]
Message-ID: <5755abe9-7b3c-0361-4eea-e0c125811eae@linux.intel.com> (raw)
In-Reply-To: <CAHNKnsTAj8OHzoyK3SHhA_yXJrqc38bYmY6pYZf9fwUemcK7iQ@mail.gmail.com>
On 11/6/2021 11:08 AM, Sergey Ryazanov wrote:
> On Mon, Nov 1, 2021 at 6:57 AM Ricardo Martinez
> <ricardo.martinez@linux.intel.com> wrote:
>> Creates the Cross Core Modem Network Interface (CCMNI) which implements
>> the wwan_ops for registration with the WWAN framework, CCMNI also
>> implements the net_device_ops functions used by the network device.
>> Network device operations include open, close, start transmission, TX
>> timeout, change MTU, and select queue.
>>
[skipped]
>> +static enum txq_type get_txq_type(struct sk_buff *skb)
>> +{
>> + u32 total_len, payload_len, l4_off;
>> + bool tcp_syn_fin_rst, is_tcp;
>> + struct ipv6hdr *ip6h;
>> + struct tcphdr *tcph;
>> + struct iphdr *ip4h;
>> + u32 packet_type;
>> + __be16 frag_off;
>> +
>> + packet_type = skb->data[0] & SBD_PACKET_TYPE_MASK;
>> + if (packet_type == IPV6_VERSION) {
>> + ip6h = (struct ipv6hdr *)skb->data;
>> + total_len = sizeof(struct ipv6hdr) + ntohs(ip6h->payload_len);
>> + l4_off = ipv6_skip_exthdr(skb, sizeof(struct ipv6hdr), &ip6h->nexthdr, &frag_off);
>> + tcph = (struct tcphdr *)(skb->data + l4_off);
>> + is_tcp = ip6h->nexthdr == IPPROTO_TCP;
>> + payload_len = total_len - l4_off - (tcph->doff << 2);
>> + } else if (packet_type == IPV4_VERSION) {
>> + ip4h = (struct iphdr *)skb->data;
>> + tcph = (struct tcphdr *)(skb->data + (ip4h->ihl << 2));
>> + is_tcp = ip4h->protocol == IPPROTO_TCP;
>> + payload_len = ntohs(ip4h->tot_len) - (ip4h->ihl << 2) - (tcph->doff << 2);
>> + } else {
>> + return TXQ_NORMAL;
>> + }
>> +
>> + tcp_syn_fin_rst = tcph->syn || tcph->fin || tcph->rst;
>> + if (is_tcp && !payload_len && !tcp_syn_fin_rst)
>> + return TXQ_FAST;
>> +
>> + return TXQ_NORMAL;
>> +}
> I am wondering how much modem performance has improved with this
> optimization compared to the performance loss on each packet due to
> the cache miss? Do you have any measurement results?
No performance gains observed in the latest tests, this is going to be
removed for the
next iteration.
>> +static u16 ccmni_select_queue(struct net_device *dev, struct sk_buff *skb,
>> + struct net_device *sb_dev)
>> +{
>> + struct ccmni_instance *ccmni;
>> +
>> + ccmni = netdev_priv(dev);
>> +
>> + if (ccmni->ctlb->capability & NIC_CAP_DATA_ACK_DVD)
>> + return get_txq_type(skb);
>> +
>> + return TXQ_NORMAL;
>> +}
>> +
>> +static int ccmni_open(struct net_device *dev)
>> +{
>> + struct ccmni_instance *ccmni;
>> +
>> + ccmni = wwan_netdev_drvpriv(dev);
>
[skipped]
>> + skb_set_mac_header(skb, -ETH_HLEN);
>> + skb_reset_network_header(skb);
>> + skb->dev = dev;
>> + if (pkt_type == IPV6_VERSION)
>> + skb->protocol = htons(ETH_P_IPV6);
>> + else
>> + skb->protocol = htons(ETH_P_IP);
>> +
>> + skb_len = skb->len;
>> +
>> + netif_rx_any_context(skb);
> Did you consider using NAPI for the packet Rx path? This should
> improve Rx performance.
Yes, NAPI implementation is in the plan.
>> + dev->stats.rx_packets++;
>> + dev->stats.rx_bytes += skb_len;
>> +}
> [skipped]
>
>> diff --git a/drivers/net/wwan/t7xx/t7xx_netdev.h b/drivers/net/wwan/t7xx/t7xx_netdev.h
>> ...
>> +#define CCMNI_TX_QUEUE 1000
> Is this a really carefully selected queue depth limit, or just an
> arbitrary value? If the last one, then feel free to use the
> DEFAULT_TX_QUEUE_LEN macro.
Changing this to DEFAULT_TX_QUEUE_LEN for the next iteration
>> ..
>> +#define IPV4_VERSION 0x40
>> +#define IPV6_VERSION 0x60
> Just curious why the _VERSION suffix? Why not, for example, PKT_TYPE_ prefix?
Nothing special about _VERSION, but it does look a bit weird, will use
PKT_TYPE_ as suggested
> --
> Sergey
Ricardo
next prev parent reply other threads:[~2021-12-01 6:06 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-01 3:56 [PATCH v2 00/14] net: wwan: t7xx: PCIe driver for MediaTek M.2 modem Ricardo Martinez
2021-11-01 3:56 ` [PATCH v2 01/14] net: wwan: Add default MTU size Ricardo Martinez
2021-11-06 18:01 ` Sergey Ryazanov
2021-11-01 3:56 ` [PATCH v2 02/14] net: wwan: t7xx: Add control DMA interface Ricardo Martinez
2021-11-01 14:03 ` Andy Shevchenko
2021-11-19 6:36 ` Martinez, Ricardo
2021-11-19 8:28 ` Andy Shevchenko
2021-11-06 18:01 ` Sergey Ryazanov
2021-11-01 3:56 ` [PATCH v2 03/14] net: wwan: t7xx: Add core components Ricardo Martinez
2021-11-02 15:46 ` Andy Shevchenko
2021-11-06 18:05 ` Sergey Ryazanov
2021-12-02 22:42 ` Martinez, Ricardo
2021-11-01 3:56 ` [PATCH v2 04/14] net: wwan: t7xx: Add port proxy infrastructure Ricardo Martinez
2021-11-03 15:38 ` Andy Shevchenko
2021-11-19 6:41 ` Martinez, Ricardo
2021-11-06 18:06 ` Sergey Ryazanov
2021-12-01 6:04 ` Martinez, Ricardo
2021-11-01 3:56 ` [PATCH v2 05/14] net: wwan: t7xx: Add control port Ricardo Martinez
2021-11-06 18:07 ` Sergey Ryazanov
2021-11-01 3:56 ` [PATCH v2 06/14] net: wwan: t7xx: Add AT and MBIM WWAN ports Ricardo Martinez
2021-11-09 12:06 ` Sergey Ryazanov
2021-12-01 6:14 ` Martinez, Ricardo
2021-12-01 20:45 ` Sergey Ryazanov
2021-12-07 2:41 ` Martinez, Ricardo
2022-01-12 4:29 ` Martinez, Ricardo
2021-11-01 3:56 ` [PATCH v2 07/14] net: wwan: t7xx: Data path HW layer Ricardo Martinez
2021-11-01 3:56 ` [PATCH v2 08/14] net: wwan: t7xx: Add data path interface Ricardo Martinez
2021-11-06 18:08 ` Sergey Ryazanov
2021-11-01 3:56 ` [PATCH v2 09/14] net: wwan: t7xx: Add WWAN network interface Ricardo Martinez
2021-11-06 18:08 ` Sergey Ryazanov
2021-12-01 6:06 ` Martinez, Ricardo [this message]
2021-12-01 21:09 ` Sergey Ryazanov
2021-12-02 20:44 ` Martinez, Ricardo
2021-11-01 3:56 ` [PATCH v2 10/14] net: wwan: t7xx: Introduce power management support Ricardo Martinez
2021-11-01 3:56 ` [PATCH v2 11/14] net: wwan: t7xx: Runtime PM Ricardo Martinez
2021-11-01 3:56 ` [PATCH v2 12/14] net: wwan: t7xx: Device deep sleep lock/unlock Ricardo Martinez
2021-11-01 3:56 ` [PATCH v2 13/14] net: wwan: t7xx: Add debug and test ports Ricardo Martinez
2021-11-06 18:10 ` Sergey Ryazanov
2021-11-01 3:56 ` [PATCH v2 14/14] net: wwan: t7xx: Add maintainers and documentation Ricardo Martinez
2021-11-01 13:09 ` [PATCH v2 00/14] net: wwan: t7xx: PCIe driver for MediaTek M.2 modem Denis Kirjanov
2021-11-06 18:10 ` Sergey Ryazanov
2021-11-09 5:26 ` Martinez, Ricardo
2021-11-09 11:35 ` Sergey Ryazanov
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=5755abe9-7b3c-0361-4eea-e0c125811eae@linux.intel.com \
--to=ricardo.martinez@linux.intel.com \
--cc=Soumya.Prakash.Mishra@intel.com \
--cc=amir.hanania@intel.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=chandrashekar.devegowda@intel.com \
--cc=chiranjeevi.rapolu@linux.intel.com \
--cc=davem@davemloft.net \
--cc=dinesh.sharma@intel.com \
--cc=eliot.lee@intel.com \
--cc=haijun.liu@mediatek.com \
--cc=johannes@sipsolutions.net \
--cc=kuba@kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=linuxwwan@intel.com \
--cc=loic.poulain@linaro.org \
--cc=m.chetan.kumar@intel.com \
--cc=mika.westerberg@linux.intel.com \
--cc=moises.veleta@intel.com \
--cc=muralidharan.sethuraman@intel.com \
--cc=netdev@vger.kernel.org \
--cc=pierre-louis.bossart@intel.com \
--cc=ryazanov.s.a@gmail.com \
--cc=sreehari.kancharla@intel.com \
--cc=suresh.nagaraj@intel.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).