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 D4660A0093 for ; Tue, 19 May 2020 15:06:50 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CB2B91D603; Tue, 19 May 2020 15:06:50 +0200 (CEST) Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) by dpdk.org (Postfix) with ESMTP id D76121D652 for ; Tue, 19 May 2020 15:06:49 +0200 (CEST) Received: by mail-wm1-f68.google.com with SMTP id m185so3473906wme.3 for ; Tue, 19 May 2020 06:06:49 -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=EJjRVstYILx9WxhhI6bex9wINFJA4ghxdVDJ6Y3n4zA=; b=j4mdgF0btR7yTeW8y+tZt8ZRsCGwQOZaCIr3By6FQ4WoTzUlqtdKvzdStvuIrHy1cR gC9TOtkWy+JPK0D4KtS7GyUVyD8UxERpL4Mb6NJrjSx1fX6Ci42kCXBngmyAX8wO6N+V EmOB22hkaFVZQ8j3+XQXosZhahghfs5Gm71u5/ZXd7PoFo4mThzNZlphxcidvvhH9Nja cFdCPkn+Z1Ydln/StWm1bPLuTzXm+anjTXmU2uRblEVN3LD4S1C1uPKoDJwiVLCQ4MTV MeWNwDn6qcHST/m0OaCLtnN1vIyZtjeWsnRXnkddjPGnXXGTP/3Uo5uHGGfOOAoSH9dW 4V5Q== 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=EJjRVstYILx9WxhhI6bex9wINFJA4ghxdVDJ6Y3n4zA=; b=KQy8W8MyxY5stKu3ftrxTjnpIs3RrAw6PQLThc1PYd+tSAXRgTE20qwsGxMVVXAnx2 P/UpVN5uBF5tSz25sIEG2pKin54cvcY7gg98LEUnCaAh1Ys5b1pTTChAl/3L20XiX4e3 tRPfLi2/pRoX79WNuGX7GioVCaTczQDZmvXEYpbRcG/msuew+pci7NVGx+H1OtiWUR7b 3dm8SgZuGqL2+TBKH8GM05/ZsKA9C6lMHn2LGIB34y1WwWh00/hYFwVv+YOVpZEX2OSl po8piSJ4FscS2k+BCPj51G9dqAC5LRFF8Vz5iXGejyCaQlXFvvKLDTcXulBGVUR14gk1 M44w== X-Gm-Message-State: AOAM533kkg6NmWC4lTWvl1uDLj0BEGRZc9zH/wagavcKoU//+wSzEwKJ xiW36frf6I2sj/RwsEQ03DjhWP13rncGDiRS X-Google-Smtp-Source: ABdhPJx9/ZC3e2Tc/j+K9sjeTrdk0Pp5xNOhb8pE7M4/QiOhirJrZiMOjf76wnH4si7PfSVcxk2i2Q== X-Received: by 2002:a1c:2289:: with SMTP id i131mr5528190wmi.111.1589893609596; Tue, 19 May 2020 06:06:49 -0700 (PDT) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id x17sm20450135wrp.71.2020.05.19.06.06.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2020 06:06:49 -0700 (PDT) From: luca.boccassi@gmail.com To: Qi Zhang Cc: Jesse Brandeburg , Paul M Stillwell Jr , Qiming Yang , dpdk stable Date: Tue, 19 May 2020 14:02:33 +0100 Message-Id: <20200519130549.112823-18-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200519130549.112823-1-luca.boccassi@gmail.com> References: <20200519125804.104349-1-luca.boccassi@gmail.com> <20200519130549.112823-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/ice/base: fix MAC write command' has been queued to stable release 19.11.3 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.3 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 05/21/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 117ecae9206c67a12f5cfa7e01b6e01d12587c28 Mon Sep 17 00:00:00 2001 From: Qi Zhang Date: Mon, 23 Mar 2020 15:17:55 +0800 Subject: [PATCH] net/ice/base: fix MAC write command [ upstream commit 97ac817f430c40ed9cc03200c23aad1d3da84bca ] The manage MAC write command was implemented in an overly complex way that actually didn't work, as it wasn't symmetric to the manage MAC read command, and was feeding bytes out of order to the firmware. Fix the implementation by just using a simple array to represent the MAC address when it is being written via firmware command. Fixes: a90fae1d0755 ("net/ice/base: add admin queue structures and commands") Signed-off-by: Jesse Brandeburg Signed-off-by: Paul M Stillwell Jr Signed-off-by: Qi Zhang Acked-by: Qiming Yang --- drivers/net/ice/base/ice_adminq_cmd.h | 10 ++++------ drivers/net/ice/base/ice_common.c | 5 +---- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/drivers/net/ice/base/ice_adminq_cmd.h b/drivers/net/ice/base/ice_adminq_cmd.h index e6a1350baa..cb521ca178 100644 --- a/drivers/net/ice/base/ice_adminq_cmd.h +++ b/drivers/net/ice/base/ice_adminq_cmd.h @@ -158,13 +158,11 @@ struct ice_aqc_manage_mac_write { #define ICE_AQC_MAN_MAC_WR_MC_MAG_EN BIT(0) #define ICE_AQC_MAN_MAC_WR_WOL_LAA_PFR_KEEP BIT(1) #define ICE_AQC_MAN_MAC_WR_S 6 -#define ICE_AQC_MAN_MAC_WR_M (3 << ICE_AQC_MAN_MAC_WR_S) +#define ICE_AQC_MAN_MAC_WR_M MAKEMASK(3, ICE_AQC_MAN_MAC_WR_S) #define ICE_AQC_MAN_MAC_UPDATE_LAA 0 -#define ICE_AQC_MAN_MAC_UPDATE_LAA_WOL (BIT(0) << ICE_AQC_MAN_MAC_WR_S) - /* High 16 bits of MAC address in big endian order */ - __be16 sah; - /* Low 32 bits of MAC address in big endian order */ - __be32 sal; +#define ICE_AQC_MAN_MAC_UPDATE_LAA_WOL BIT(ICE_AQC_MAN_MAC_WR_S) + /* byte stream in network order */ + u8 mac_addr[ETH_ALEN]; __le32 addr_high; __le32 addr_low; }; diff --git a/drivers/net/ice/base/ice_common.c b/drivers/net/ice/base/ice_common.c index 8006c5d689..0dec997d87 100644 --- a/drivers/net/ice/base/ice_common.c +++ b/drivers/net/ice/base/ice_common.c @@ -2121,10 +2121,7 @@ ice_aq_manage_mac_write(struct ice_hw *hw, const u8 *mac_addr, u8 flags, ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_manage_mac_write); cmd->flags = flags; - - /* Prep values for flags, sah, sal */ - cmd->sah = HTONS(*((const u16 *)mac_addr)); - cmd->sal = HTONL(*((const u32 *)(mac_addr + 2))); + ice_memcpy(cmd->mac_addr, mac_addr, ETH_ALEN, ICE_NONDMA_TO_DMA); return ice_aq_send_cmd(hw, &desc, NULL, 0, cd); } -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-05-19 14:04:45.336069530 +0100 +++ 0018-net-ice-base-fix-MAC-write-command.patch 2020-05-19 14:04:44.120646632 +0100 @@ -1,8 +1,10 @@ -From 97ac817f430c40ed9cc03200c23aad1d3da84bca Mon Sep 17 00:00:00 2001 +From 117ecae9206c67a12f5cfa7e01b6e01d12587c28 Mon Sep 17 00:00:00 2001 From: Qi Zhang Date: Mon, 23 Mar 2020 15:17:55 +0800 Subject: [PATCH] net/ice/base: fix MAC write command +[ upstream commit 97ac817f430c40ed9cc03200c23aad1d3da84bca ] + The manage MAC write command was implemented in an overly complex way that actually didn't work, as it wasn't symmetric to the manage MAC read command, and was feeding bytes out of order to the firmware. Fix @@ -10,7 +12,6 @@ address when it is being written via firmware command. Fixes: a90fae1d0755 ("net/ice/base: add admin queue structures and commands") -Cc: stable@dpdk.org Signed-off-by: Jesse Brandeburg Signed-off-by: Paul M Stillwell Jr @@ -22,7 +23,7 @@ 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/drivers/net/ice/base/ice_adminq_cmd.h b/drivers/net/ice/base/ice_adminq_cmd.h -index d4c899dea3..3344481d65 100644 +index e6a1350baa..cb521ca178 100644 --- a/drivers/net/ice/base/ice_adminq_cmd.h +++ b/drivers/net/ice/base/ice_adminq_cmd.h @@ -158,13 +158,11 @@ struct ice_aqc_manage_mac_write { @@ -44,10 +45,10 @@ __le32 addr_low; }; diff --git a/drivers/net/ice/base/ice_common.c b/drivers/net/ice/base/ice_common.c -index ed4dfb3e3b..3fdc93ce98 100644 +index 8006c5d689..0dec997d87 100644 --- a/drivers/net/ice/base/ice_common.c +++ b/drivers/net/ice/base/ice_common.c -@@ -2077,10 +2077,7 @@ ice_aq_manage_mac_write(struct ice_hw *hw, const u8 *mac_addr, u8 flags, +@@ -2121,10 +2121,7 @@ ice_aq_manage_mac_write(struct ice_hw *hw, const u8 *mac_addr, u8 flags, ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_manage_mac_write); cmd->flags = flags;