From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Alfredo Cardigliano <cardigliano@ntop.org>
Cc: dev@dpdk.org, Konstantin Ananyev <konstantin.ananyev@intel.com>
Subject: Re: [dpdk-dev] [PATCH v2 16/17] net/ionic: add TX checksum support
Date: Mon, 2 Dec 2019 16:15:07 +0000 [thread overview]
Message-ID: <447ed643-ae2c-bf8e-bb5c-6d229ab610fa@intel.com> (raw)
In-Reply-To: <20191015082235.28639-17-cardigliano@ntop.org>
On 10/15/2019 9:22 AM, Alfredo Cardigliano wrote:
> Add support for TX checksumming.
>
> Signed-off-by: Alfredo Cardigliano <cardigliano@ntop.org>
> Reviewed-by: Shannon Nelson <snelson@pensando.io>
<...>
> +static void
> +ionic_tx_tcp_pseudo_csum(struct rte_mbuf *txm)
> +{
> + struct ether_hdr *eth_hdr = rte_pktmbuf_mtod(txm, struct ether_hdr *);
> + char *l3_hdr = ((char *)eth_hdr) + txm->l2_len;
> + struct rte_tcp_hdr *tcp_hdr = (struct rte_tcp_hdr *)
> + (l3_hdr + txm->l3_len);
> +
> + if (txm->ol_flags & PKT_TX_IP_CKSUM) {
> + struct rte_ipv4_hdr *ipv4_hdr = (struct rte_ipv4_hdr *)l3_hdr;
> + ipv4_hdr->hdr_checksum = 0;
> + tcp_hdr->cksum = 0;
> + tcp_hdr->cksum = rte_ipv4_udptcp_cksum(ipv4_hdr, tcp_hdr);
> + } else {
> + struct rte_ipv6_hdr *ipv6_hdr = (struct rte_ipv6_hdr *)l3_hdr;
> + tcp_hdr->cksum = 0;
> + tcp_hdr->cksum = rte_ipv6_udptcp_cksum(ipv6_hdr, tcp_hdr);
> + }
> +}
> +
> +static void
> +ionic_tx_tcp_inner_pseudo_csum(struct rte_mbuf *txm)
> +{
> + struct ether_hdr *eth_hdr = rte_pktmbuf_mtod(txm, struct ether_hdr *);
> + char *l3_hdr = ((char *)eth_hdr) + txm->outer_l2_len +
> + txm->outer_l3_len + txm->l2_len;
> + struct rte_tcp_hdr *tcp_hdr = (struct rte_tcp_hdr *)
> + (l3_hdr + txm->l3_len);
> +
> + if (txm->ol_flags & PKT_TX_IPV4) {
> + struct rte_ipv4_hdr *ipv4_hdr = (struct rte_ipv4_hdr *)l3_hdr;
> + ipv4_hdr->hdr_checksum = 0;
> + tcp_hdr->cksum = 0;
> + tcp_hdr->cksum = rte_ipv4_udptcp_cksum(ipv4_hdr, tcp_hdr);
> + } else {
> + struct rte_ipv6_hdr *ipv6_hdr = (struct rte_ipv6_hdr *)l3_hdr;
> + tcp_hdr->cksum = 0;
> + tcp_hdr->cksum = rte_ipv6_udptcp_cksum(ipv6_hdr, tcp_hdr);
> + }
> +}
I think the intestion of 'tx_pkt_prepare' dev_ops is for above operations, if
you want to seperate these from regular Tx path, you can call them from
'tx_pkt_prepare', but if you need them always can keep as it is I think.
next prev parent reply other threads:[~2019-12-02 16:15 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-15 8:22 [dpdk-dev] [PATCH v2 00/17] Introduces net/ionic PMD Alfredo Cardigliano
2019-10-15 8:22 ` [dpdk-dev] [PATCH v2 01/17] net/ionic: add skeleton Alfredo Cardigliano
2019-12-02 16:06 ` Ferruh Yigit
2019-10-15 8:22 ` [dpdk-dev] [PATCH v2 02/17] net/ionic: add hardware structures definitions Alfredo Cardigliano
2019-12-02 16:07 ` Ferruh Yigit
2019-12-02 16:33 ` Stephen Hemminger
2019-12-04 16:26 ` Alfredo Cardigliano
2019-10-15 8:22 ` [dpdk-dev] [PATCH v2 03/17] net/ionic: add log Alfredo Cardigliano
2019-12-02 16:07 ` Ferruh Yigit
2019-10-15 8:22 ` [dpdk-dev] [PATCH v2 04/17] net/ionic: register and initialize the adapter Alfredo Cardigliano
2019-12-02 16:09 ` Ferruh Yigit
2019-12-08 19:25 ` Alfredo Cardigliano
2019-12-09 9:12 ` Ferruh Yigit
2019-12-02 16:35 ` Stephen Hemminger
2019-10-15 8:22 ` [dpdk-dev] [PATCH v2 05/17] net/ionic: add port management commands Alfredo Cardigliano
2019-10-15 8:22 ` [dpdk-dev] [PATCH v2 06/17] net/ionic: add basic lif support Alfredo Cardigliano
2019-10-15 8:22 ` [dpdk-dev] [PATCH v2 07/17] net/ionic: add doorbells Alfredo Cardigliano
2019-10-15 8:22 ` [dpdk-dev] [PATCH v2 08/17] net/ionic: add adminq support Alfredo Cardigliano
2019-12-02 16:15 ` Ferruh Yigit
2019-10-15 8:22 ` [dpdk-dev] [PATCH v2 09/17] net/ionic: add notifyq support Alfredo Cardigliano
2019-10-15 8:22 ` [dpdk-dev] [PATCH v2 10/17] net/ionic: add basic port operations Alfredo Cardigliano
2019-12-02 16:11 ` Ferruh Yigit
2019-10-15 8:22 ` [dpdk-dev] [PATCH v2 11/17] net/ionic: add RX filters support Alfredo Cardigliano
2019-10-15 8:22 ` [dpdk-dev] [PATCH v2 12/17] net/ionic: add Flow Control support Alfredo Cardigliano
2019-10-15 8:22 ` [dpdk-dev] [PATCH v2 13/17] net/ionic: add RX and TX handling Alfredo Cardigliano
2019-12-02 16:13 ` Ferruh Yigit
2019-10-15 8:22 ` [dpdk-dev] [PATCH v2 14/17] net/ionic: add RSS support Alfredo Cardigliano
2019-10-15 8:22 ` [dpdk-dev] [PATCH v2 15/17] net/ionic: add stats Alfredo Cardigliano
2019-12-02 16:14 ` Ferruh Yigit
2019-10-15 8:22 ` [dpdk-dev] [PATCH v2 16/17] net/ionic: add TX checksum support Alfredo Cardigliano
2019-12-02 16:15 ` Ferruh Yigit [this message]
2019-10-15 8:22 ` [dpdk-dev] [PATCH v2 17/17] net/ionic: read fw version Alfredo Cardigliano
2019-10-15 13:09 ` [dpdk-dev] [PATCH v2 00/17] Introduces net/ionic PMD Ferruh Yigit
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=447ed643-ae2c-bf8e-bb5c-6d229ab610fa@intel.com \
--to=ferruh.yigit@intel.com \
--cc=cardigliano@ntop.org \
--cc=dev@dpdk.org \
--cc=konstantin.ananyev@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).