From patchwork Tue May 16 16:48:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Chandran, Sugesh" X-Patchwork-Id: 763062 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3wS3N86Kx0z9s2s for ; Wed, 17 May 2017 02:50:16 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id E1CFCB43; Tue, 16 May 2017 16:50:12 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 946E5959 for ; Tue, 16 May 2017 16:50:11 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id A2184236 for ; Tue, 16 May 2017 16:50:10 +0000 (UTC) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 May 2017 09:50:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.38,349,1491289200"; d="scan'208";a="87537173" Received: from irsmsx105.ger.corp.intel.com ([163.33.3.28]) by orsmga002.jf.intel.com with ESMTP; 16 May 2017 09:50:08 -0700 Received: from irsmsx102.ger.corp.intel.com ([169.254.2.153]) by irsmsx105.ger.corp.intel.com ([169.254.7.163]) with mapi id 14.03.0319.002; Tue, 16 May 2017 17:48:53 +0100 From: "Chandran, Sugesh" To: Kevin Traynor Thread-Topic: [PATCH v2 1/3] netdev-dpdk: Fix Rx checksum reconfigure. Thread-Index: AQHSy0RvN3vUdJpGZUawpO2V/zliTKH3Kbrg Date: Tue, 16 May 2017 16:48:52 +0000 Message-ID: <2EF2F5C0CC56984AA024D0B180335FCB13F3C263@IRSMSX102.ger.corp.intel.com> References: <1494609740-15104-1-git-send-email-ktraynor@redhat.com> <1494609740-15104-2-git-send-email-ktraynor@redhat.com> In-Reply-To: <1494609740-15104-2-git-send-email-ktraynor@redhat.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiN2Q4ZWE5YzUtZmJhMC00N2Q1LTk5MTgtYjk1MDU3MDQyZWY0IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6Iis3VExld2k0czgxbXRjTVZ6V1RWamlHY280aFd4QXB3QUQ3aGVHZ1U4TDQ9In0= x-ctpclassification: CTP_IC dlp-product: dlpe-windows dlp-version: 10.0.102.7 dlp-reaction: no-action x-originating-ip: [163.33.239.182] MIME-Version: 1.0 X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: "dev@openvswitch.org" Subject: Re: [ovs-dev] [PATCH v2 1/3] netdev-dpdk: Fix Rx checksum reconfigure. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org Hi Kevin, Thank you for sending out this patch series. Have you tested the tunneling decap usecase with checksum offload? I am seeing weird behavior when I testing the tunneling with Rx checksum offload ON and OFF.(Seeing the same behavior on master as well) Here is the summary of issue with the steps, 1) Send tunnel traffic to OVS to do the decap. 2) Set & unset the checksum offload. 3) I don't see any performance difference in both case. Now I went ahead and put some debug message to see what is happening sugeshch@silpixa00389816:~/repo/ovs_master$ These debug messages are not showing at all when I am sending the traffic. (I tried it with rx checksum ON and OFF) Looks like ol_flags are always reporting checksum is good. I am using DPDK 17.02 for the testing. If I remember correctly it was reporting properly at the time of rx checksum offload. Looks like DPDK is reporting checksum valid in all the cases even it is disabled. Any inputs on this? Regards _Sugesh > -----Original Message----- > From: Kevin Traynor [mailto:ktraynor@redhat.com] > Sent: Friday, May 12, 2017 6:22 PM > To: dev@openvswitch.org > Cc: Chandran, Sugesh ; Kevin Traynor > > Subject: [PATCH v2 1/3] netdev-dpdk: Fix Rx checksum reconfigure. > > Rx checksum offload is enabled by default where available, with > reconfiguration through OVSDB options:rx-checksum-offload. > However, setting rx-checksum-offload does not result in a reconfiguration of > the NIC. > > Fix that by checking if the requested port config features (e.g. rx checksum > offload) are currently applied on the NIC and if not, perform a > reconfiguration. > > Fixes: 1a2bb11817a4 ("netdev-dpdk: Enable Rx checksum offloading feature > on DPDK physical ports.") > Cc: Sugesh Chandran > Signed-off-by: Kevin Traynor > --- > lib/netdev-dpdk.c | 14 +++++++++----- > 1 file changed, 9 insertions(+), 5 deletions(-) > > diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c index 609b8da..d1688ce > 100644 > --- a/lib/netdev-dpdk.c > +++ b/lib/netdev-dpdk.c > @@ -374,4 +374,5 @@ struct netdev_dpdk { > int requested_rxq_size; > int requested_txq_size; > + uint32_t requested_hwol; > > /* Number of rx/tx descriptors for physical devices */ @@ -648,5 +649,5 > @@ dpdk_eth_dev_queue_setup(struct netdev_dpdk *dev, int n_rxq, int > n_txq) > conf.rxmode.max_rx_pkt_len = 0; > } > - conf.rxmode.hw_ip_checksum = (dev->hw_ol_features & > + conf.rxmode.hw_ip_checksum = (dev->requested_hwol & > NETDEV_RX_CHECKSUM_OFFLOAD) != 0; > /* A device may report more queues than it makes available (this has @@ > -702,4 +703,5 @@ dpdk_eth_dev_queue_setup(struct netdev_dpdk *dev, > int n_rxq, int n_txq) > dev->up.n_rxq = n_rxq; > dev->up.n_txq = n_txq; > + dev->hw_ol_features = dev->requested_hwol; > > return 0; > @@ -719,5 +721,5 @@ dpdk_eth_checksum_offload_configure(struct > netdev_dpdk *dev) > DEV_RX_OFFLOAD_IPV4_CKSUM; > rte_eth_dev_info_get(dev->port_id, &info); > - rx_csum_ol_flag = (dev->hw_ol_features & > NETDEV_RX_CHECKSUM_OFFLOAD) != 0; > + rx_csum_ol_flag = (dev->requested_hwol & > + NETDEV_RX_CHECKSUM_OFFLOAD) != 0; > > if (rx_csum_ol_flag && > @@ -726,5 +728,5 @@ dpdk_eth_checksum_offload_configure(struct > netdev_dpdk *dev) > VLOG_WARN_ONCE("Rx checksum offload is not supported on device > %d", > dev->port_id); > - dev->hw_ol_features &= ~NETDEV_RX_CHECKSUM_OFFLOAD; > + dev->requested_hwol &= ~NETDEV_RX_CHECKSUM_OFFLOAD; > return; > } > @@ -872,4 +874,5 @@ common_construct(struct netdev *netdev, unsigned > int port_no, > /* Initilize the hardware offload flags to 0 */ > dev->hw_ol_features = 0; > + dev->requested_hwol = 0; > > dev->flags = NETDEV_UP | NETDEV_PROMISC; @@ -1260,5 +1263,5 @@ > netdev_dpdk_set_config(struct netdev *netdev, const struct smap *args, > != 0; > if (temp_flag != rx_chksm_ofld) { > - dev->hw_ol_features ^= NETDEV_RX_CHECKSUM_OFFLOAD; > + dev->requested_hwol ^= NETDEV_RX_CHECKSUM_OFFLOAD; > dpdk_eth_checksum_offload_configure(dev); > } > @@ -3124,5 +3127,6 @@ netdev_dpdk_reconfigure(struct netdev *netdev) > && dev->rxq_size == dev->requested_rxq_size > && dev->txq_size == dev->requested_txq_size > - && dev->socket_id == dev->requested_socket_id) { > + && dev->socket_id == dev->requested_socket_id > + && dev->hw_ol_features == dev->requested_hwol) { > /* Reconfiguration is unnecessary */ > > -- > 1.8.3.1 diff --git a/lib/netdev-native-tnl.c b/lib/netdev-native-tnl.c index 2798324..49ca847 100644 --- a/lib/netdev-native-tnl.c +++ b/lib/netdev-native-tnl.c @@ -86,6 +86,7 @@ netdev_tnl_ip_extract_tnl_md(struct dp_packet *packet, struct flow_tnl *tnl, ovs_be32 ip_src, ip_dst; if (OVS_UNLIKELY(!dp_packet_ip_checksum_valid(packet))) { + VLOG_INFO("Checksum is not validated..."); if (csum(ip, IP_IHL(ip->ip_ihl_ver) * 4)) { VLOG_WARN_RL(&err_rl, "ip packet has invalid checksum"); return NULL; @@ -182,6 +183,7 @@ udp_extract_tnl_md(struct dp_packet *packet, struct flow_tnl *tnl, if (udp->udp_csum) { if (OVS_UNLIKELY(!dp_packet_l4_checksum_valid(packet))) { + VLOG_INFO("Checksum is not validated..."); uint32_t csum; if (netdev_tnl_is_header_ipv6(dp_packet_data(packet))) { csum = packet_csum_pseudoheader6(dp_packet_l3(packet));