From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg0-f67.google.com (mail-pg0-f67.google.com [74.125.83.67]) by dpdk.org (Postfix) with ESMTP id 1A7AE1559 for ; Mon, 18 Jun 2018 20:58:41 +0200 (CEST) Received: by mail-pg0-f67.google.com with SMTP id c10-v6so7946705pgu.9 for ; Mon, 18 Jun 2018 11:58:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=X0e7PBvWNkdCWKXleeZqEFb2NAXqT4PpAGbhj56qpVY=; b=Da6zHYygYlbFKXx6e4YohcfXkTfh9ykj6RxbFUJtCvxJ/v0pEnoAZixREXjE1KEiuv C8hs++EhSLUqlASsEbVWu3Wux5GzOFyc8W2r9gl1+pINUB2B5fsXydyCvBtcnOBWc1gX mcVgRxyX0WBGcQ1GLNkcumcMx81TlE+Vtf+KCax1Ch+k12GcHIiHs1xjt7f2LPZg7lUU 22EEihqfUVq9DtOrek+WN5Yk2pKXHigexMyT07PH+8EXYTA2RTfjLJOuVyo7A+ZiT68R 5DqhxIxjOCD3rRKjnD2w3658wAC4/6IZOIGt+nkb1oWEbaVF7uSA3Ulf3oyK8EQDhx0t gISw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=X0e7PBvWNkdCWKXleeZqEFb2NAXqT4PpAGbhj56qpVY=; b=pPEq9h4PMPa4+4mfmIP0Opo5SOZoGEPbYvrSqm2ZodNCE0w+7akKJ19RZHyHhy8ifE sxI99ngqspm2OuAe8kWHqfGGlhWv6VU8gdCyZC7hWZiAMJA6cvnU3AJUxbda7KpcEKSt kJ8lcNaUBEKlR6hBfPum53ebiAUFRC/qD5tI2BmoaKmmdnhlZWay1/MOuOwAHWPXtuJb gwCijzXPjNTqY8+Zh+pBlbS2gtPNRVOkLZ3NWX9M2UIGIelcdEEDdpB6Bj9Ywcgk6Vcx SAIr9vGL2iMDbyX8HLciKznFtlPIW5qL5fnNwFRUQH0mShbyfreN08CccI1yeuPmW+ej rUrw== X-Gm-Message-State: APt69E11v6DfwfjJKLhg45jOGMILQUkD9+UcXn2I0+1eP63zd3ZrNF3v G+0JKV58zrD6qyabaf47S52GWg== X-Google-Smtp-Source: ADUXVKLQxaWNlwf6GNIwbwsMomFbWqpQl9qd/qZaUgLmvw++IzzciLowbL1mCdqIlR3xCDq7xMcRKg== X-Received: by 2002:a63:8a4a:: with SMTP id y71-v6mr11677470pgd.291.1529348320271; Mon, 18 Jun 2018 11:58:40 -0700 (PDT) Received: from xeon-e3 (204-195-35-107.wavecable.com. [204.195.35.107]) by smtp.gmail.com with ESMTPSA id 10-v6sm35952056pfs.111.2018.06.18.11.58.40 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 18 Jun 2018 11:58:40 -0700 (PDT) Date: Mon, 18 Jun 2018 11:58:33 -0700 From: Stephen Hemminger To: Alex Kiselev Cc: Chas Williams , "dev@dpdk.org" Message-ID: <20180618115833.161b14d8@xeon-e3> In-Reply-To: <20180618122720.5B3F51559@dpdk.org> References: <20180618122720.5B3F51559@dpdk.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v2] net/bonding: add add/remove mac addrs 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: , X-List-Received-Date: Mon, 18 Jun 2018 18:58:41 -0000 On Mon, 18 Jun 2018 15:27:16 +0300 Alex Kiselev wrote: > +static const struct ether_addr null_mac_addr; > + > +/* > + * Add additional MAC addresses to the slave > + */ > +int > +slave_add_mac_addresses(struct rte_eth_dev *bonded_eth_dev, > + uint16_t slave_port_id) > +{ > + int i, ret; > + struct ether_addr *mac_addr; > + > + /* add additional MACs to the slave */ > + for (i = 1; i < BOND_MAX_MAC_ADDRS; i++) { > + mac_addr = &bonded_eth_dev->data->mac_addrs[i]; > + if (is_same_ether_addr(mac_addr, &null_mac_addr)) > + break; > + > + ret = rte_eth_dev_mac_addr_add(slave_port_id, mac_addr, 0); > + if (ret < 0) > + return ret; > + } > + > + return 0; You need to unwind if adding MAC address to one of the slave devices worked, and the second one did not.