From patchwork Mon Dec 23 21:34:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eveline Raine X-Patchwork-Id: 1215075 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=mellanox.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=Mellanox.com header.i=@Mellanox.com header.b="iK66JBVk"; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47hXgQ01wrz9sP3 for ; Tue, 24 Dec 2019 08:34:41 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id C755D854EF; Mon, 23 Dec 2019 21:34:39 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ALBWP2lNr0u7; Mon, 23 Dec 2019 21:34:39 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by fraxinus.osuosl.org (Postfix) with ESMTP id 2C7928547D; Mon, 23 Dec 2019 21:34:39 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 223DDC1D81; Mon, 23 Dec 2019 21:34:39 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists.linuxfoundation.org (Postfix) with ESMTP id BEE13C0881 for ; Mon, 23 Dec 2019 21:34:37 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id AD04720517 for ; Mon, 23 Dec 2019 21:34:37 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GwcssvXqYOji for ; Mon, 23 Dec 2019 21:34:36 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50053.outbound.protection.outlook.com [40.107.5.53]) by silver.osuosl.org (Postfix) with ESMTPS id 2DAEA20485 for ; Mon, 23 Dec 2019 21:34:36 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DaQ34b8RBvYoJumLikb+e+5u0M/zYnGNBwXuxhH/G9sEKwcUoSNkRGEn59qu3Kg8mPCFWfA+A+PiLkMKhZ3/HH3dBAiuMNLKBbIilScza1h6YJPacrfTf2PJTqVcOl138TXLlQ9D9SU+ckYkzne2keCIUcRxlXhazVPiLMXP0s4nxKzy/sxeId8m3Wz0ZTXHDJ62Jk1be8TTa1nXu6rlr42jU5h9YfQUgiUoG5Kf025AlDgL4hwRAalD0M81V6fJ7hrXR6Quyd0oUH+erQ9VbOehghRg/SsEHfN5hMeSzuZMImEHj7+BWhSNVVw5oAy+/USRX1nghNoXJ6KFCI2hqg== 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=mq/abS2FL3tr1BJ8cxxtta/5jyaNc1ECbhpqLsdTja0=; b=bgsWObc/LGsk4YCCnodoDRrzzg39+JUG/LSCvpKzLu15Z8rzX6N43HHMYc9hRAxOrqaqG4WnL9ckxXEaCXUTUVOUvKY5KLoOXYoW7Tod+u/rMbWw84YLX/d4lziLPSvKGbtnx6oG/nuWgbwJlbf54XeurztYF3JtOxMnjKm+0DZb0mrK18+SqaRHkT1UnaqfD18V67M5oYHDWir9PB29pEtlBhwPSUsU5zPb2xhrfDz1v04slB04HuK0z8lk3wJLtTVGZhJa7iESKdhjqXEbQML6CTOwkVChkBL9F0mhp7qm3A/a+TEIlFVHlIY/o2UbksDp8YKjr/5pOVehVd3XMw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mq/abS2FL3tr1BJ8cxxtta/5jyaNc1ECbhpqLsdTja0=; b=iK66JBVkhr8PeM8yJGqTKwNSfViY7imuS2aJ/+K0APnGmD4IUpyYBVnqt4GwMLdyl8e9qx2M0PySZyKB2hd3DY75JZaiNhI/kApbhdfgKZg+hV8wvrAjWHGJxoE8nAd6m6tnnwwzxZvJeCsp9u1hLi83zWMKgfK92R1SfywXsUg= Received: from VI1PR05MB4894.eurprd05.prod.outlook.com (20.177.50.222) by VI1PR05MB5887.eurprd05.prod.outlook.com (20.178.127.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2559.15; Mon, 23 Dec 2019 21:34:34 +0000 Received: from VI1PR05MB4894.eurprd05.prod.outlook.com ([fe80::2d0f:3ee7:bef2:fa06]) by VI1PR05MB4894.eurprd05.prod.outlook.com ([fe80::2d0f:3ee7:bef2:fa06%5]) with mapi id 15.20.2559.017; Mon, 23 Dec 2019 21:34:34 +0000 From: Eveline Raine To: "dev@openvswitch.org" Thread-Topic: [PATCH 1/1] vswitchd: Allow setting MAC on DPDK interfaces Thread-Index: AQHVudjE99F06to4WkWhUSQajqGdEg== Date: Mon, 23 Dec 2019 21:34:33 +0000 Message-ID: <20191223213357.49351-2-eveliner@mellanox.com> References: <20191223213357.49351-1-eveliner@mellanox.com> In-Reply-To: <20191223213357.49351-1-eveliner@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: VI1PR04CA0136.eurprd04.prod.outlook.com (2603:10a6:803:f0::34) To VI1PR05MB4894.eurprd05.prod.outlook.com (2603:10a6:803:5b::30) authentication-results: spf=none (sender IP is ) smtp.mailfrom=eveliner@mellanox.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.24.1 x-originating-ip: [31.172.141.222] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 6ccfbac9-5916-45d3-7c83-08d787efe6e5 x-ms-traffictypediagnostic: VI1PR05MB5887:|VI1PR05MB5887: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:5797; x-forefront-prvs: 0260457E99 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(346002)(376002)(366004)(136003)(396003)(39860400002)(199004)(189003)(54906003)(4326008)(6486002)(478600001)(2616005)(36756003)(6512007)(316002)(81166006)(1076003)(107886003)(81156014)(8676002)(6916009)(8936002)(2906002)(66446008)(64756008)(186003)(6506007)(71200400001)(86362001)(66556008)(5660300002)(66946007)(66476007)(26005)(52116002); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR05MB5887; H:VI1PR05MB4894.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 5yG+hJ00Zus+7dLRifeFhKQBLP2biZtIFcC9AdBbxZ0Sqgoraapq65Q4bIw5fAtLEZ3YUdUaZ1LU0B6NdFVfYcejnkP3D/nKeOnXqWTStRGnd1TQ1bpXckUZiH82u+SANlCcPQUXuqY2OaGgV28iTrzvtzzckR2QMsColYnF7VXzkbY3dN5RcnpzDapvQ5V0/3KsrU0XYQCMwMGe9dmYBIOz3U4+5J52KchNoMrLvxo5kX8xpJEFAA33j4fZws+777/crApJSqUGwcPj4nHHM+78/4G/MF7o/EwIa62f+Oi+cl6r+BgoMtimJHIHT5Lz5M9TUOn+SDLXFry4JYqOlJRXVm65P5EUSHN+JpcTKlTPnZdNJ37twS6XtIiacD/kqJdZe5eoQ7EKjQHZdRCduuyHl2V4c1H9Hn6giZlqHPUoh0I0yYQMt3sW6pviPfdt MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6ccfbac9-5916-45d3-7c83-08d787efe6e5 X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Dec 2019 21:34:33.8926 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: ac84b47vJAqOBjx7Z+8GKnv49hPNkGgogkf7pzNYjr66FZ5+9D1M1eYeY858IN+tCM0CahW8EU+GhFZbl2ueqQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB5887 Cc: Adrian Chiris , Ilya Maximets , Majd Dibbiny , Ameer Mahagneh Subject: [ovs-dev] [PATCH 1/1] vswitchd: Allow setting MAC on DPDK interfaces X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" When setting mac address for an interface using ovs-vsctl command: ovs-vsctl set interface mac=XX:XX:XX:XX:XX:XX iface_set_mac() is responsible to delegate a request to set MAC to a netdev-specific set_etheraddr(). At the moment iface_set_mac() skips all interfaces except those with type = "internal", making it impossible to change MAC on any DPDK port. Since DPDK ports are owned by the OVS process, OVSDB can be considered the source of truth for them. In particular, the source of truth for their MAC addresses - so, OVS can take responsibility for setting them. Therefore this check is extended to "dpdk" type. Acked-by: Roni Bar Yanai Tested-by: Adrian Chiris Signed-off-by: Eveline Raine Acked-by: Ophir Munk --- vswitchd/bridge.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c index 5de0a264a..355364afd 100644 --- a/vswitchd/bridge.c +++ b/vswitchd/bridge.c @@ -4696,7 +4696,7 @@ iface_set_mac(const struct bridge *br, const struct port *port, struct iface *if struct eth_addr ea, *mac = NULL; struct iface *hw_addr_iface; - if (strcmp(iface->type, "internal")) { + if (strcmp(iface->type, "internal") && strcmp(iface->type, "dpdk")) { return; }