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 3E9C5A00C5; Fri, 8 May 2020 08:58:23 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 059DD1D97E; Fri, 8 May 2020 08:58:22 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 340DB1D635 for ; Fri, 8 May 2020 08:58:19 +0200 (CEST) IronPort-SDR: QnIwtzspD0xn/AhNcvi7XFDKbFLZW9hAM3lfK1HL7jAQKqgSPD938hZSi4yJtCJ6HtGjunOXbC qyhoM4MzQ1eQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 May 2020 23:58:19 -0700 IronPort-SDR: 3u6Y4PN9VlLJBLct2xS7KXC5iHtvX7bqHqzw/0ZBhSCaZEckVsyE9vphNJjF2SvXo8OC/yDyyc GIjc55B7hRkg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,366,1583222400"; d="scan'208";a="407924362" Received: from orsmsx104.amr.corp.intel.com ([10.22.225.131]) by orsmga004.jf.intel.com with ESMTP; 07 May 2020 23:58:18 -0700 Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) by ORSMSX104.amr.corp.intel.com (10.22.225.131) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 7 May 2020 23:58:18 -0700 Received: from orsmsx604.amr.corp.intel.com (10.22.229.17) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 7 May 2020 23:58:18 -0700 Received: from ORSEDG001.ED.cps.intel.com (10.7.248.4) by orsmsx604.amr.corp.intel.com (10.22.229.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Thu, 7 May 2020 23:58:18 -0700 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.42) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 7 May 2020 23:58:15 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bHD+0iZ+z6lAM46dc8/+3pM0O8zbUxB1eGhfutM60iBmonYR9C9wJDNwqL5jsX0oyOCPifOma1f6+bys7vasmgZnO9UDUQqjs9Tw1nGgNf+h2aGAtocbrvJTgJ8v3LGqOV9bIVP9tePDvDk2ZTUoRBKq9gLwNfzdY8fOpR5ua8lwMyzqvXlneo9odeq+pGS4VYr3J8sxeU+X/lA+ejjDHGIbIHQoSrIu46p7y3k1X1tgXIICbB7EnnjA1coqCtbqJ3kTUL2j0HdcqW8njoSJ+E5YHDJvfXb9k+rFaJ1cCA4PN6nheGtaZqTcyQ4GEv1mdgSL8RbTgWgk/WOU1gV8Dg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=g12D61SkII7+9Qg6T1oVnXWnetr6QqYatTxVTJxDTU4=; b=SJwdDSMNYAJilfnR/+f989ogYCDsI6fcd9tJ51zhsNnhpo/z9Rr6fI4vFnlIcr8gubsvd8NM44XT4eH6n5BAxSYzLsWAXarc/8EPA4/INNHkU8nGtSw0C3N4oWAoB56Z5dEhnloAUiY4VeSlEenmYjYTO80/GMKgh+xHZkmlXJ1PDXsVLhLQ/i0ZeLAZ2EUhdK4S33IllkjTx7zMRLIQPmqA9n8FNeSHi5shLX/GKYdOMAEz2dNpHxN2LymXAguM6g6/yB0JFda66uwzUr/9Vc8iLs277vK13+67OS/6bPG9RJSRMCHYn8IUH0woaJOSVMlyTxkPyMH2elfg5tDISw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=g12D61SkII7+9Qg6T1oVnXWnetr6QqYatTxVTJxDTU4=; b=RoMJFLEdXF1XLNCbj9MNcEfYjAAwuNXz3SjxUrmdxnMMjdIP216FGiyNYQOt47c9gHbnIJlajzN/0FC1wTMD3UTe2bUl5tM+M0rPeQMM3GyGfTssJhXpdgzUytkJOzh86Uagu0lMwp9W3x7X3q+fAZnrd6TKtXnYJrwI2x5kv5s= Received: from MWHPR11MB1391.namprd11.prod.outlook.com (2603:10b6:300:23::15) by MWHPR11MB1327.namprd11.prod.outlook.com (2603:10b6:300:2a::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.29; Fri, 8 May 2020 06:58:10 +0000 Received: from MWHPR11MB1391.namprd11.prod.outlook.com ([fe80::c809:34b4:173b:d211]) by MWHPR11MB1391.namprd11.prod.outlook.com ([fe80::c809:34b4:173b:d211%7]) with mapi id 15.20.2979.028; Fri, 8 May 2020 06:58:10 +0000 From: "Zhao1, Wei" To: "Sun, GuinanX" , "dev@dpdk.org" CC: "Lu, Wenzhuo" , "Yang, Qiming" , "Sun, GuinanX" , "Guo, Jia" Thread-Topic: [dpdk-dev] [PATCH v3] net/ixgbe: add support for VF MAC address add and remove Thread-Index: AQHVugoKCDs1D6psCUSexxpRCOENy6ielO+w Date: Fri, 8 May 2020 06:58:10 +0000 Message-ID: References: <20191203145457.72154-1-guinanx.sun@intel.com> <20191224032357.3317-1-guinanx.sun@intel.com> In-Reply-To: <20191224032357.3317-1-guinanx.sun@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiOGIxNWU0ODktMTBkNC00MWI5LTg0ZDYtMzU4OTRkMmY0MDYxIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiMlJQdVZuSCtlT2gxOGE4N3VFYkNxRDVYRm1CSDUzeStEb3VQWXZWelVpVnFHNVJJSnVPMDZXM3ZZcmQ4bUV1RyJ9 dlp-version: 11.0.600.7 dlp-product: dlpe-windows x-ctpclassification: CTP_NT dlp-reaction: no-action authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.55.52.200] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 8378da59-7822-4d0a-4fbd-08d7f31d2b8b x-ms-traffictypediagnostic: MWHPR11MB1327: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6430; x-forefront-prvs: 039735BC4E x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: PYM5hb3LCyZ7KoaxUTy4d5MB3FN00lodZqk+XOX7BbDvDrGzRf7zMJUBfssNKHbvNf6mxioP1r4NyV4C40e5QMBES0V0EQTEZ3UIoAcTsuKsWFStY5iPHkE3gzRN98hyHAWmL126OkkqYpxZautXXbxn4O9nvUwmzpmTym50wg9drz2GKx/scKIBivJJ3meqe4loM240Ad7SU5lQoXRjh/5nfqarLWhbZPa+xq+jRG2mycek0tf5eYtuJoQIMp9VdHUx0mOteRwkXY7WK3iogGChOeXghIkC0gfrxXgW7eP8inl1qIxpofgnyzQIrLa1TP5WQJ2CEfCEWSpXQpi+Jq47iYHdPxY33+ngpsWTx1fqI/xeCCsp3uz84NFGT+B71v13YpSYPJ5tdpMXqekOTWaMrwcSz+JXbR4I4sOcfUZg3VvziR4Xd1RjwlJkYGfSmahE8G8vmUMdFfMuvymmdYxYpEWsu67PnKKTsdsckuFPJvyfnzYRDkJjEN+c5UD+KsZ3tE/u7EaYtroZQzuuTw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR11MB1391.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(136003)(346002)(376002)(396003)(366004)(39860400002)(33430700001)(55016002)(76116006)(26005)(71200400001)(66946007)(7696005)(83300400001)(110136005)(5660300002)(8936002)(66446008)(66556008)(9686003)(66476007)(83280400001)(83310400001)(83320400001)(83290400001)(64756008)(54906003)(478600001)(6506007)(53546011)(52536014)(33656002)(107886003)(4326008)(86362001)(2906002)(186003)(33440700001)(316002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: NVjnP5HCrVuK1RlIVYii0Yd5nJSw1/Cnft+QuOgncqh/H0deIPls5p0BaUxxiGkvvu9mOAxknm9WRcEs9kW7vM1rdGIM99yjpUlOYvt8sa6XM3yMPPYSu5YMQbW4UbdQcr6VbOptswVzbd15UsdH5Agit1tgxztBhxyw4XiJc/Ah3ikf0sGyoRQspbaQ6xspBl7W68vgR9SyOd+q8R77Ek3gqhegNhRlTsfIbgq1ApPX/0/awtI3ZMg4NCezZKN5egSV+AG1YfsP96g00jyEfwPEwKJyI9V/kwCvcuhgCySHvoKhePkXMsvAB5DibfMkKmRXTuiuesOeETs/STPUdwMxU3MYaXbofRj8e7ak91yd2MmiRSmif2Tu9p9gHTE8ymdDfS23B8RcbXEtJoRL1eywqvQQm0nO4v3oUfFpAVS5L4xM0SuWsKULZzW2e2EFbVrxaDj+yiZrEhCYhQgulPnp0c8+dZXvv6wglH66iCE= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 8378da59-7822-4d0a-4fbd-08d7f31d2b8b X-MS-Exchange-CrossTenant-originalarrivaltime: 08 May 2020 06:58:10.5246 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: LzPA2y2mSV0tY1hSukJstufynRl5hFCyL6fJ7C5snE3YajdrZsQmPHfdehoLo1T+5xHvOfUaa8wVdOdgcCjjLA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1327 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v3] net/ixgbe: add support for VF MAC address add and remove X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi, Guinan There is a bug for this patch: The second input parameter of function hw->mac.ops.set_rar() should be inde= x of MAC address register IXGBE_RAL/H. This index should be management by pf host for all the vf, not only index f= or one vf, or vf1 maybe overwrite this MAC address of vf0. Although this patch has been merged, please commit fix patch for it. > -----Original Message----- > From: dev On Behalf Of Guinan Sun > Sent: Tuesday, December 24, 2019 11:24 AM > To: dev@dpdk.org > Cc: Lu, Wenzhuo ; Yang, Qiming > ; Sun, GuinanX > Subject: [dpdk-dev] [PATCH v3] net/ixgbe: add support for VF MAC address = add > and remove >=20 > Ixgbe PMD pf host code needs to support ixgbevf mac address add and remov= e. > For this purpose, a response was added between pf and vf to update the ma= c > address. >=20 > Signed-off-by: Guinan Sun > --- > v3: > * Changed from `RTE_LOG` to `PMD_DRV_LOG`. > v2: > * Changed the title of commit message. > * Checked null in front of valid ether addr check. > --- > drivers/net/ixgbe/ixgbe_ethdev.h | 1 + > drivers/net/ixgbe/ixgbe_pf.c | 35 > ++++++++++++++++++++++++++++++++ > 2 files changed, 36 insertions(+) >=20 > diff --git a/drivers/net/ixgbe/ixgbe_ethdev.h > b/drivers/net/ixgbe/ixgbe_ethdev.h > index 76a1b9d18..e1cd8fd16 100644 > --- a/drivers/net/ixgbe/ixgbe_ethdev.h > +++ b/drivers/net/ixgbe/ixgbe_ethdev.h > @@ -270,6 +270,7 @@ struct ixgbe_vf_info { > uint8_t api_version; > uint16_t switch_domain_id; > uint16_t xcast_mode; > + uint16_t mac_count; > }; >=20 > /* > diff --git a/drivers/net/ixgbe/ixgbe_pf.c b/drivers/net/ixgbe/ixgbe_pf.c = index > d0d85e138..c93c0fdc2 100644 > --- a/drivers/net/ixgbe/ixgbe_pf.c > +++ b/drivers/net/ixgbe/ixgbe_pf.c > @@ -748,6 +748,37 @@ ixgbe_set_vf_mc_promisc(struct rte_eth_dev *dev, > uint32_t vf, uint32_t *msgbuf) > return 0; > } >=20 > +static int > +ixgbe_set_vf_macvlan_msg(struct rte_eth_dev *dev, uint32_t vf, uint32_t > +*msgbuf) { > + struct ixgbe_hw *hw =3D > IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private); > + struct ixgbe_vf_info *vf_info =3D > + *(IXGBE_DEV_PRIVATE_TO_P_VFDATA(dev->data->dev_private)); > + uint8_t *new_mac =3D (uint8_t *)(&msgbuf[1]); > + int index =3D (msgbuf[0] & IXGBE_VT_MSGINFO_MASK) >> > + IXGBE_VT_MSGINFO_SHIFT; > + > + if (index) { > + if (new_mac =3D=3D NULL) > + return -1; > + > + if (!rte_is_valid_assigned_ether_addr( > + (struct rte_ether_addr *)new_mac)) { > + PMD_DRV_LOG(ERR, "set invalid mac vf:%d\n", vf); > + return -1; > + } > + > + vf_info[vf].mac_count++; > + > + hw->mac.ops.set_rar(hw, vf_info[vf].mac_count, > + new_mac, vf, IXGBE_RAH_AV); > + } else { > + hw->mac.ops.clear_rar(hw, vf_info[vf].mac_count); > + vf_info[vf].mac_count =3D 0; > + } > + return 0; > +} > + > static int > ixgbe_rcv_msg_from_vf(struct rte_eth_dev *dev, uint16_t vf) { @@ -835,6 > +866,10 @@ ixgbe_rcv_msg_from_vf(struct rte_eth_dev *dev, uint16_t vf) > if (retval =3D=3D RTE_PMD_IXGBE_MB_EVENT_PROCEED) > retval =3D ixgbe_set_vf_mc_promisc(dev, vf, msgbuf); > break; > + case IXGBE_VF_SET_MACVLAN: > + if (retval =3D=3D RTE_PMD_IXGBE_MB_EVENT_PROCEED) > + retval =3D ixgbe_set_vf_macvlan_msg(dev, vf, msgbuf); > + break; > default: > PMD_DRV_LOG(DEBUG, "Unhandled Msg %8.8x", > (unsigned)msgbuf[0]); > retval =3D IXGBE_ERR_MBX; > -- > 2.17.1