From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 680B541D52; Thu, 23 Feb 2023 16:00:08 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 557824321F; Thu, 23 Feb 2023 16:00:08 +0100 (CET) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id 65AC04321C; Thu, 23 Feb 2023 16:00:06 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1677164406; x=1708700406; h=date:from:to:cc:subject:message-id:references: content-transfer-encoding:in-reply-to:mime-version; bh=FNaDFLtt4FMZMgKAZS2MW9Hh0R3xvw1hvjH32heHNic=; b=hOkfFgYU5hty/1xPCnMcOSnNhA+jcmVquC9xlDwcPWJ8F6MD7utVzuLj NCyBGi03+BH1hyOHXTJHJP6wqohXZzWHKRUJoA0AQngqL4464UCW3nr1p bjL0V1sBUKf9r5BXEXtGh7lyps52AyqRXS3nTm93yo6deD47wNgPECmBC eY6IWZUJuDZxCpy6ipYVf+GIfGtTQvRGSfGPRNEf1srq1HUzMBTAmI1kl WA5IrZE2C6O5dhngA+pXwJGAnwA7x/ESqKWUfC9+hijQbeHdDjMSTjTzI jDGsqVeJrknat72xjCD/W3/kbn6C9lnGT3peFt2ziOLrmweIsiJSnVeQZ Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10630"; a="316971554" X-IronPort-AV: E=Sophos;i="5.97,320,1669104000"; d="scan'208";a="316971554" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Feb 2023 06:32:55 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10630"; a="918003545" X-IronPort-AV: E=Sophos;i="5.97,320,1669104000"; d="scan'208";a="918003545" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by fmsmga006.fm.intel.com with ESMTP; 23 Feb 2023 06:32:55 -0800 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Thu, 23 Feb 2023 06:32:54 -0800 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Thu, 23 Feb 2023 06:32:54 -0800 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16 via Frontend Transport; Thu, 23 Feb 2023 06:32:54 -0800 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (104.47.56.47) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.16; Thu, 23 Feb 2023 06:32:53 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZXhKMsCYbEusDHYsL5H7tFQS1Aio2I2CX7KzjTuDvdGrf2WX/ViDZozFTyMfgcA8d3tK+5e3880/jYrRg1jpUk7kaLvKeECL4b/2zENqi4G0hzE95hdxhDFY++lCfkWRfCKb/XQ8hdaDKsm5aVPYmy2n51IvytD/EfH4E1t9ZzgQ8ktY3YQ9yU1PSS3T214BkA5nqjcPwP9aN/KVYbc2ry6nTfigqp0sPeuZ66C+MpohvdvIrztl6QFb1a5jZTopyzu2vrD+4up4M+6Wpj7nUW2Xqe56f53eCBKqezJ/hucvOI9zL5nfe14K+bvG1QN5mHxpk1Nw/gPpKQQzf0S1NA== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=SqlMhOiBk319i6XX6WRDjlGz9jdn95JPdGB7bRrWYxs=; b=efbKFJmXSV3Y6NbwcSzDU79RbOwtF/+nNdVQC0XUY4WrMxKwtKVZjp0W0HWxSCENYGMGY0ii5PcELCulcsFnWStY2guykRMMwBhfENw2+3W+rxHSF0wNMCnVJ33d6EConlV0pKqTSgipLUVUTPgW5im0G0BWD9j9FjMKqkRs4FUphSkzjRs+cYUiCbbu7Qx55wvFQl9/umAwyuHA5133r9SvsGHR/UStfDYrdXhrnsPWaDLjhKD/UTt6JsSodtnphtJWNoYUvmwrcbhFT/gVhLoHoXTjU/vPvdsw4ipSWxCn2gtSkfnaFiRGOitC34WNjvWBz5YHkG6GcXbgzzBN6g== 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 Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) by SJ0PR11MB5134.namprd11.prod.outlook.com (2603:10b6:a03:2de::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.21; Thu, 23 Feb 2023 14:32:41 +0000 Received: from DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::18d0:ac53:aa1d:d19c]) by DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::18d0:ac53:aa1d:d19c%6]) with mapi id 15.20.6134.019; Thu, 23 Feb 2023 14:32:41 +0000 Date: Thu, 23 Feb 2023 14:32:34 +0000 From: Bruce Richardson To: Ferruh Yigit CC: , Honnappa Nagarahalli , "techboard@dpdk.org" , "dev@dpdk.org" , Huisong Li , "Chengwen Feng" , nd Subject: Re: MAC address set requires decision Message-ID: References: <26318485-9bb5-3dbe-ed76-8fdb3928861b@oss.nxp.com> <09b41503-3e69-e787-d10a-fa579333e49b@amd.com> Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <09b41503-3e69-e787-d10a-fa579333e49b@amd.com> X-ClientProxiedBy: LO4P123CA0208.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:1a5::15) To DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7309:EE_|SJ0PR11MB5134:EE_ X-MS-Office365-Filtering-Correlation-Id: 6d4d2886-90a6-46f4-92f2-08db15aad1a2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Uu0fkkYovY41mUqkxzwUBGqOidRi44ApL4/1tMZpZqKUTnBjdig3tMog75mum/TSej4pKw8uVtwMxXcaWmAprTAMvV4QhgkRB9o0l/Z4F6969hDbOEJVvWMSRS7sUzw19RNRrQMUhaRc7tn6/k4MszoNXSnLCJJqyNBOtk/a2yAMWy5BKSS5zaPHWLcHaejlUolQQl698ERAC/GAzFXnmqKAjQyjvFvggcwrbPo8KkFp1Gi+MhQa3Y5cEU9yMRbwM6L92Yk0BO7uJ+y1wiaBHVBTLLYClmgznhzE+P8PTt9dOjmxZhzzQlPT8V/q14lJQuPMQ+kozL182rfG5opjQMEIU7OkxYMZ+ALWrPYWciFrv/fZ3IABHdyevGV5OVgCHl7VCHrVhoQVqfICa6lkoQTZ/NzXIMJ05CzvUbdtbifVBWwJ/SJvR3OLWW45LFsDSKsyYIgSJrSUKq0e6e8joS1TjLFgj6UM6nOJ3Li4jY7tJBn5JwKDgex4O6kdzBLmnAdE5V8mmcJSLWlejgQfKB2R6weoB61fohwPQZWxYnRBomMqBSho6aBa/xfXCLJkkmgFU8Fp/a2kbXw+Z/xEHcLOTtZ+pYw252EN+KibYRSyaFxviYluctxq63XwzKcVV9tXCvS7PKT+hPy1MxXv4Q== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DS0PR11MB7309.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(136003)(366004)(39860400002)(376002)(346002)(396003)(451199018)(82960400001)(38100700002)(83380400001)(6486002)(54906003)(2906002)(316002)(53546011)(6506007)(6666004)(186003)(6512007)(26005)(478600001)(86362001)(41300700001)(8936002)(5660300002)(44832011)(8676002)(66476007)(66556008)(66946007)(6916009)(4326008); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?iso-8859-1?Q?Gf20ihmshIfJBUpvaNtgQBiGR+NbJHPBBrcY35hMmaiCtkcZb/hu7835sN?= =?iso-8859-1?Q?x+Hxvwzkb+YMaysSBV4BShAEz1QQUxtIcLHnSKt8aQw/jSrKEbcc5bUIgr?= =?iso-8859-1?Q?suJ9xC11QLapL3MWq7+mwue7epNAUOLfrFsSOVcwtYomI1yLFUvJHh44VA?= =?iso-8859-1?Q?FYMyIAKhIoTACydatUGixHIWWIwllHDuOVoh8wcjcEEX4hvkSHT2gNt2c8?= =?iso-8859-1?Q?HzVpYLVuYgIpXd6uhZpIwUkWDIO8AAY/Ld1M1nceLX356xz8Z+W3uyAPLU?= =?iso-8859-1?Q?UaTol90IltZbM+VmgzPA4/jKXUVTStFtOCLaGjOyRXaH6q8rHis6A5ilM+?= =?iso-8859-1?Q?icFWoOv4b95xjM4N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=?iso-8859-1?Q?0GDv3i+FinvJbOqNjg8HTbxtIGBvVcQ6i7ismN6g30QTuWEDN4BOae85zs?= =?iso-8859-1?Q?8+x9ti8Kpk8Ev++O09FYumtLxkzec+OOGgVUMmr/wfes792wXA0J51GL6L?= =?iso-8859-1?Q?Jp/UfmnMW66UoBKV0YsRNm4+bEv4lrYzoa+vdrdv5+RCRbHq92sLhIFsZF?= =?iso-8859-1?Q?iK54RyZKgBtQfEpj4SreleokTfTAN6/C+V+YOCqdb51DEaEHG+XPkYSEsH?= =?iso-8859-1?Q?zyX5Tu5ZjWuLPTUWiPGmn5zwkz+avQ9hPcJ/eyEEtr893pzd7KSzVDtKS7?= =?iso-8859-1?Q?TjXPAAaWF/+rnFAMpZSkLxzfRiC2F2xrL3F26phY1FwtHHjmb9MIO9MV8T?= =?iso-8859-1?Q?sZoYqQOaEKiXv/gEO3VZpbs9u5+SDUIWSlE6cwrUl+ZHEPA4gt/uc+vN7B?= =?iso-8859-1?Q?R8OdsQi45Ojb3cBnvR8=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 6d4d2886-90a6-46f4-92f2-08db15aad1a2 X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB7309.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Feb 2023 14:32:41.0961 (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: PkaR0rdoZ/fA1DnPKJ40bQb32wxcIrzlE8X2rHWqp8cvyW+h24IPdEOdPEYUs6qC9lDzOkdsafpb24touJ9M5DJNXgXgq5rcbsN92HZgjPo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR11MB5134 X-OriginatorOrg: intel.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Thu, Feb 23, 2023 at 02:18:59PM +0000, Ferruh Yigit wrote: > On 2/23/2023 4:32 AM, Hemant Agrawal wrote: > > > > On 22-Feb-23 11:25 PM, Honnappa Nagarahalli wrote: > >> -----Original Message----- > >>> From: Richardson, Bruce > >>> Sent: Thursday, February 16, 2023 9:05 AM > >>> To: Ferruh Yigit ; techboard@dpdk.org > >>> Cc: Huisong Li ; Chengwen Feng > >>> > >>> Subject: RE: MAC address set requires decision > >>> > >>> Alternative suggestions: > >>> > >>> 1. Don't allow "set" of mac address to value already in the list. The user must > >>> delete the entry manually first before adding it. Similarly, "add" fails if no > >>> default mac address is set. This ensures consistency by enforcing strict > >>> separation between the default mac address and the extra mac addresses. > >>> You can't have extra addresses without a default, and you can't have > >>> duplicates. > >>> > >>> 2. Always enforce overlap between the two lists - once default mac address is > >>> set (automatically adding it to the mac addresses list), you can only replace > >>> the default mac address by using an already-added one to the list. In this > >>> case, the default address is only really an index into the address list, and no > >>> deletion ever occurs. > >>> > >>> All the solutions below seem rather mixed to me, I'd rather see either strict > >>> overlap, or strict non-overlap. Both these cases make it that you need more > >>> calls to do certain tasks, e.g. with #2 to just replace mac address, you need to > >>> add, set, then delete, but we can always add new, clearly named APIs, to do > >>> these compound ops. On the plus side, with #2 we could make things doubly > >>> clear by changing the parameter type of "set" to be an index, rather than > >>> explicit mac, to make it clear what is happening, that you are choosing a > >>> default mac from a list of pre-configured options. > >>> > >>> Regards, > >>> /Bruce > > > > Both of the above option seems good.  The option #1 above is safe, where > > you are making the mac address set as independent of mac filtering. Also > > making sure that mac filter are not messed up. However, the application > > needs to add error handling now to delete and set. > > > > In the option #2,  I  assume, it will provide full backward > > compatibility i.e. the ethernet library can take care of the logic and > > application need not to implement anything extra ? If that is the case, > > it seems to be best. > > > > I think #2 is not fully backward compatible, > > Previously set() replaces MAC in list[0], so multiple set() commands end > up with single MAC address. So device will filter only one MAC. > > With #2, after first set(), application will need to add() first, later > set() and del() old MAC, if I understand correctly. > > prev: > set(MAC1) > set(MAC2) > set(MAC3) > > becomes: > set(MAC1) > add(MAC2) > set(MAC2) > del(MAC1) > add(MAC3) > set(MAC3) > del(MAC2) > > > Hence I think this complicates application that wants to just update > default MAC. > > I agree. I tend to think that #1 is the simplest and most backward-compatible of the options. The only case where we end up with different behaviour is the problematic (and already ambiguous) case where one attempts to set a default mac that is already specified in the "alternative" mac list for the card. It keeps all the simple cases as-is. /Bruce