From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id AAFD9A04DD for ; Wed, 28 Oct 2020 11:49:02 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A42C82C2A; Wed, 28 Oct 2020 11:49:01 +0100 (CET) Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) by dpdk.org (Postfix) with ESMTP id E580BCA10 for ; Wed, 28 Oct 2020 11:48:58 +0100 (CET) Received: by mail-wm1-f48.google.com with SMTP id c16so4301653wmd.2 for ; Wed, 28 Oct 2020 03:48:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=oOHkjEIXYyS8dqF8JWIw7V5gvVY9CjZ62yfIQHPbANA=; b=fKC3GQYSCMMe3RmKCbn2q/qFjeb2xZEBzUhUrK2fMYpLrxQlhQr2GCnngGFmBbns5T IC+iSjtrnY6Zd29eFFTmlYJIpuDrOnvXyfUwFtNxUwnhvFzn9fKnRhRFdBq89Rx3nos+ clZaWkk2/e8I0uXkE6Qn80UdkgbIiGQA0H/qwyr3AFZONNTE0mDspy8xUuGpiA9e6BTt TEMmTkfpXYg3ZQNm21jrRn7fzX38h1y/2rAmItg5tHMEvC92R/zqL97zYsLANTVhxbv7 CQSPVkoRajrnACO383PdQoH8KPokiu/NlSY5YT3h+a8PPNtU+NifSuEl100H0VCs8Pxo 5t2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=oOHkjEIXYyS8dqF8JWIw7V5gvVY9CjZ62yfIQHPbANA=; b=hsBSvrPZmW9oL5f4hnJS1ffaI04OXaufeW4I7QLz8Sho3R4qVR9q006NYCCzyYrswv PcZbwgKVze5mZOeZjHZDdcjHBIh4bkPvijDspOvolV4YAGdJokTOFmDDYcJ6yU5LMBNS pZxawYu4bqTDwNMUg6JU5zfGqcll4Gyko/oZuePjPQUS7H4qyslovD2n8VtW3gXgQ7Es sfSMwyEuXjdkVklsXsPDaJ/T1dmB4ToNNevPVIc/sIFFYLUpvsc0Nhj+5K+VFgeAdvHQ mKTCsbno2k2CNFeDWIf9RSa994J71GiHOtXiGIy5NEVqesfhuCMmxU+aW2sEl6rB4i9c Irtg== X-Gm-Message-State: AOAM530u4hJonV2oPe++PPSKovyHZTrjQSAAUieV8zVvRik7g/xepN/h u+UVL0HMJ4cQNVUJyTqJgV0= X-Google-Smtp-Source: ABdhPJwjewEEc9uBU2VkN0ZECTDkRtS+bNwoW5B+JJ27HV0GMifWI8YIP245J6ipGn5t1UR8RFfVVQ== X-Received: by 2002:a7b:c11a:: with SMTP id w26mr2125265wmi.78.1603882137706; Wed, 28 Oct 2020 03:48:57 -0700 (PDT) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id q10sm6234909wrp.83.2020.10.28.03.48.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Oct 2020 03:48:57 -0700 (PDT) From: luca.boccassi@gmail.com To: Hyong Youb Kim Cc: John Daley , dpdk stable Date: Wed, 28 Oct 2020 10:43:34 +0000 Message-Id: <20201028104606.3504127-55-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201028104606.3504127-1-luca.boccassi@gmail.com> References: <20201028104606.3504127-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/enic: generate VXLAN src port if it is zero in template' has been queued to stable release 19.11.6 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to stable release 19.11.6 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 10/30/20. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Thanks. Luca Boccassi --- >From af788d5aaf465b40e4112d19200ccb8eb283bd68 Mon Sep 17 00:00:00 2001 From: Hyong Youb Kim Date: Wed, 9 Sep 2020 07:00:05 -0700 Subject: [PATCH] net/enic: generate VXLAN src port if it is zero in template [ upstream commit d52054e70f8982d7d72edec14b5875c2a0ed23da ] When VXLAN source port in the template is zero, the adapter is expected to generate a value based on the inner packet flow, when it performs encapsulation. Flow Manager in the VIC adapter currently lacks such ability. So, generate a random port when creating a flow if the port is zero, to avoid transmitting packets with source port 0. Fixes: ea7768b5bba8 ("net/enic: add flow implementation based on Flow Manager API") Signed-off-by: Hyong Youb Kim Reviewed-by: John Daley --- drivers/net/enic/enic_fm_flow.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/drivers/net/enic/enic_fm_flow.c b/drivers/net/enic/enic_fm_flow.c index 5b456f20d4..ab008c7356 100644 --- a/drivers/net/enic/enic_fm_flow.c +++ b/drivers/net/enic/enic_fm_flow.c @@ -929,6 +929,17 @@ enic_fm_copy_vxlan_decap(struct enic_flowman *fm, return enic_fm_append_action_op(fm, &fm_op, error); } +/* Generate a reasonable source port number */ +static uint16_t +gen_src_port(void) +{ + /* Min/max below are the default values in OVS-DPDK and Linux */ + uint16_t p = rte_rand(); + p = RTE_MAX(p, 32768); + p = RTE_MIN(p, 61000); + return rte_cpu_to_be_16(p); +} + /* VXLAN encap is done via flowman compound action */ static int enic_fm_copy_vxlan_encap(struct enic_flowman *fm, @@ -937,6 +948,7 @@ enic_fm_copy_vxlan_encap(struct enic_flowman *fm, { struct fm_action_op fm_op; struct rte_ether_hdr *eth; + struct rte_udp_hdr *udp; uint16_t *ethertype; void *template; uint8_t off; @@ -1035,8 +1047,17 @@ enic_fm_copy_vxlan_encap(struct enic_flowman *fm, off + offsetof(struct rte_udp_hdr, dgram_len); fm_op.encap.len2_delta = sizeof(struct rte_udp_hdr) + sizeof(struct rte_vxlan_hdr); + udp = (struct rte_udp_hdr *)template; append_template(&template, &off, item->spec, sizeof(struct rte_udp_hdr)); + /* + * Firmware does not hash/fill source port yet. Generate a + * random port, as there is *usually* one rte_flow for the + * given inner packet stream (i.e. a single stream has one + * random port). + */ + if (udp->src_port == 0) + udp->src_port = gen_src_port(); item++; flow_item_skip_void(&item); -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-10-28 10:35:13.493182983 +0000 +++ 0055-net-enic-generate-VXLAN-src-port-if-it-is-zero-in-te.patch 2020-10-28 10:35:11.520830259 +0000 @@ -1,8 +1,10 @@ -From d52054e70f8982d7d72edec14b5875c2a0ed23da Mon Sep 17 00:00:00 2001 +From af788d5aaf465b40e4112d19200ccb8eb283bd68 Mon Sep 17 00:00:00 2001 From: Hyong Youb Kim Date: Wed, 9 Sep 2020 07:00:05 -0700 Subject: [PATCH] net/enic: generate VXLAN src port if it is zero in template +[ upstream commit d52054e70f8982d7d72edec14b5875c2a0ed23da ] + When VXLAN source port in the template is zero, the adapter is expected to generate a value based on the inner packet flow, when it performs encapsulation. Flow Manager in the VIC adapter currently @@ -10,7 +12,6 @@ the port is zero, to avoid transmitting packets with source port 0. Fixes: ea7768b5bba8 ("net/enic: add flow implementation based on Flow Manager API") -Cc: stable@dpdk.org Signed-off-by: Hyong Youb Kim Reviewed-by: John Daley @@ -19,10 +20,10 @@ 1 file changed, 21 insertions(+) diff --git a/drivers/net/enic/enic_fm_flow.c b/drivers/net/enic/enic_fm_flow.c -index 94e39a94bf..8e5eb4d743 100644 +index 5b456f20d4..ab008c7356 100644 --- a/drivers/net/enic/enic_fm_flow.c +++ b/drivers/net/enic/enic_fm_flow.c -@@ -978,6 +978,17 @@ enic_fm_copy_vxlan_decap(struct enic_flowman *fm, +@@ -929,6 +929,17 @@ enic_fm_copy_vxlan_decap(struct enic_flowman *fm, return enic_fm_append_action_op(fm, &fm_op, error); } @@ -40,7 +41,7 @@ /* VXLAN encap is done via flowman compound action */ static int enic_fm_copy_vxlan_encap(struct enic_flowman *fm, -@@ -986,6 +997,7 @@ enic_fm_copy_vxlan_encap(struct enic_flowman *fm, +@@ -937,6 +948,7 @@ enic_fm_copy_vxlan_encap(struct enic_flowman *fm, { struct fm_action_op fm_op; struct rte_ether_hdr *eth; @@ -48,7 +49,7 @@ uint16_t *ethertype; void *template; uint8_t off; -@@ -1084,8 +1096,17 @@ enic_fm_copy_vxlan_encap(struct enic_flowman *fm, +@@ -1035,8 +1047,17 @@ enic_fm_copy_vxlan_encap(struct enic_flowman *fm, off + offsetof(struct rte_udp_hdr, dgram_len); fm_op.encap.len2_delta = sizeof(struct rte_udp_hdr) + sizeof(struct rte_vxlan_hdr);