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 A677AA04C8; Fri, 18 Sep 2020 12:46:30 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 124F21C2A3; Fri, 18 Sep 2020 12:46:30 +0200 (CEST) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 754D91C1C3 for ; Fri, 18 Sep 2020 12:46:28 +0200 (CEST) IronPort-SDR: NmMy95e3vPrET82+WXB6KOWu0PDoqv8B4REEV8iqm5qwbLGkD4yz+05L1XkuIxicHi9AMUzJF9 h+Y5Lknw9Ilg== X-IronPort-AV: E=McAfee;i="6000,8403,9747"; a="221468106" X-IronPort-AV: E=Sophos;i="5.77,274,1596524400"; d="scan'208";a="221468106" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Sep 2020 03:46:27 -0700 IronPort-SDR: XWCL6Xmh7iyjRPzmQe5MM1cqupz2J0U7RlFfad14hkx04lJe76W/WjJi/SsTcclCqylQpF6UyY mG/fcFlEmNJQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,274,1596524400"; d="scan'208";a="339761424" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by fmsmga002.fm.intel.com with ESMTP; 18 Sep 2020 03:46:27 -0700 Received: from fmsmsx607.amr.corp.intel.com (10.18.126.87) 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.1713.5; Fri, 18 Sep 2020 03:46:26 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx607.amr.corp.intel.com (10.18.126.87) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Fri, 18 Sep 2020 03:46:26 -0700 Received: from NAM02-CY1-obe.outbound.protection.outlook.com (104.47.37.58) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1713.5; Fri, 18 Sep 2020 03:46:26 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OGfkMVoGiD2AOiw+x2Ipe7Zj9AjUQnRt+Zo4hyY4IkUFoFws0gP7cc21K9bAATcmwnHEZ0CkTrqZDg0mZwTFqkLIsyCSY4pWRIZPbGMeG7HUq6jCs5V61FgmqqMs404KlOzU9IRah357Floj6MeN4nylMjlN7jBg/pzxCdQf4diKsBLnQDvWG8Injt+HAjB1Fps6hAFOCcGMnyH3p+ai9tQGx/f6BRn8o6iaxInuvm/VfiSQ+aAySieHLSw7tf/cZCacx65bLCGxIVbNr9lrhYNR608q7TJQJjikXqHPL3KT+2BOi7M1BGYfVqHDxDH1ZhYDfkPJvC0WAsBbAmYMWg== 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=0Ock+VAQe2fCGRert2pvjvEBKAN2L1KqAYR+muQl9Gc=; b=hpcmHIJtqkoOSzHGL0gOVGScshTCdzbVh4IwTwK4YRxyPUPH576EDo7g7AqC+msYrmPm0ILKUL7MufKl4ELCY6uAEPFIPsFCuGY2M3i2u7+TkK8juP8SPqoo/cHXSW9Bq9OVpy5h0e3tKo3pfar1qKrM5yVVHypGxvd+Pnfu6rZKnJ2T08isfgyf0kI8s78GbfrP6vhfJtN+0+a21c2h7jqQT7Pxd4TOnJkfDUWuzw2JBSTUqjzW376IbajEZjOi9Kwy9VqGyp6dgBprlQBtmRigFGzcaN5jp9DP9RhetvzaktoDXEZz7d/qI7Pzv2eF8jki/ENDQu6zQfJRoeJVdA== 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=0Ock+VAQe2fCGRert2pvjvEBKAN2L1KqAYR+muQl9Gc=; b=DSr9rcyTQcYMKmYwhftKV4ZfvUQboZF5+mvW7pmM2uFOQcKa36Mj2NlrxYoFhPjUPQts1sP5ImgniePq1LS7jSUc3TafdTVdkbloITeFJLC6YJfXLQDGJJz56Ak01fqvFDfgfFf8cq6kGE7bB0rC8osYTqNsaHIwqFcNlxzch9o= Received: from BYAPR11MB3301.namprd11.prod.outlook.com (2603:10b6:a03:7f::26) by BY5PR11MB4005.namprd11.prod.outlook.com (2603:10b6:a03:18c::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3370.19; Fri, 18 Sep 2020 10:46:24 +0000 Received: from BYAPR11MB3301.namprd11.prod.outlook.com ([fe80::f43b:a137:dab8:8b0b]) by BYAPR11MB3301.namprd11.prod.outlook.com ([fe80::f43b:a137:dab8:8b0b%6]) with mapi id 15.20.3391.011; Fri, 18 Sep 2020 10:46:24 +0000 From: "Ananyev, Konstantin" To: "humin (Connor)" , "dev@dpdk.org" CC: "thomas@monjalon.net" , "arybchenko@solarflare.com" , "Yigit, Ferruh" , "linuxarm@huawei.com" Thread-Topic: [V5 1/3] ethdev: introduce FEC API Thread-Index: AQHWjNA5qzveYw6BFUKlVHaXueoa1Klsx9BQgADcpICAAJHqIA== Date: Fri, 18 Sep 2020 10:46:23 +0000 Message-ID: References: <1599534347-20430-1-git-send-email-humin29@huawei.com> <1600332730-44952-1-git-send-email-humin29@huawei.com> <1600332730-44952-2-git-send-email-humin29@huawei.com> In-Reply-To: Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.5.1.3 authentication-results: huawei.com; dkim=none (message not signed) header.d=none;huawei.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [46.7.39.127] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 6238a53e-8eeb-4de3-2c07-08d85bc0168c x-ms-traffictypediagnostic: BY5PR11MB4005: 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:8273; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: SVYFoFnmKMRI+YvEHKNJnCjMr969WJlmxrllIhBUP7MzXUcOFvp4yv0Cxr4YZqmqQwvqwAOdwggF1Mnx3hnbsMM2jbwfGIAV0Of2BJC+U8wWjQ6Djq++w1jHkL/foSJyv0VYxdbKy6qPT+CfqJYLumR5wIbOCWAWznWp/e7N+ddZKsvCFHraxYvrNgxb2N9C7gLyeQov87GO44M8fdSw/ylbaDQ9/YsZGCW/yaSZqdCapR5jE+nj3UObnQFc4F/E9YvKOBGvR59Qzw3NkESe4Sj94/0RHiE1TURDaXgNWpWoHfIRsdeZIDsQAQMbfHi2 x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR11MB3301.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(346002)(366004)(396003)(136003)(39860400002)(110136005)(66946007)(55016002)(316002)(9686003)(5660300002)(52536014)(8936002)(64756008)(76116006)(86362001)(66476007)(66556008)(66446008)(54906003)(8676002)(478600001)(71200400001)(4326008)(6506007)(2906002)(186003)(33656002)(26005)(7696005); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: WOMllqP8Edptr2KBmfOoz/4AssSkigu2AI1fT21fPKElWFX74hslOz5EFAcB6c5WgFJAl683wMnJ9w/LbQXLujmNLfqVVSH6D5mDq4jmHy7/rrCt5Hss5HmRpzhP7t0s4SqRiHYN3Re+Ymjnh9Pmy2tMT0RO2LAhvEMSUfocDFdjVyjbloytwuR5rhOJpKxB6hzSrb9XEOUjmphztIX3Npr2NCdAaQMbAMxTBXCmHHSmAgKQ79TjmM6wkqtwnSf4INJ/7qXS4ftdg4ukKUiM3qCok55gFT7uu0/zmtOvfObkiyIqeMo9Exfxp8aIP2u4F52u83FYZbRu8X0JfwUaJkA/3z2d24nqFZnGGSzXxaM5cWe8BMljib8e8I55NVSetlsF4BjkH/Lp+b933fsz2+x76gO+wCEkOnQ1SjEHdlu4uURtki13SPPif0+pirZ9CUXvOMVb3MdosOdQz5i4zaTnnBrl5571UurdZOHU6FhwBb3ReD22ndmlqvSSW/p3uHD+Yoxd2bSFky/VHApy3VyhHS7kERGCqMTp8MbmQ8TNPaNoQUFFQ3NejLoitnQgGRVa+dSpv6p42J3dZRT4LwRxb6VlEDP0Q889F488bk5vkTfScJ1OsBqsRlQuwER8hIKgFO5bEaVEkXsBmJEFcA== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BYAPR11MB3301.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6238a53e-8eeb-4de3-2c07-08d85bc0168c X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Sep 2020 10:46:24.1759 (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: uLMwnmsDCCk1YupGXW8VxLjzqj7mYmvmbH6sdRPQIbA5/cidkE/k8jJz3uLyao0G12MrHyrUkX+qBeNIyCqj4M8mc0KOtQVPObCFI6aNd/s= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR11MB4005 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [V5 1/3] ethdev: introduce FEC API 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" > >> > >> +/** > >> + * This enum indicates the possible (forward error correction)FEC mod= es > >> + * of an ethdev port. > >> + */ > >> +enum rte_fec_mode { > >> + RTE_ETH_FEC_NOFEC =3D 0, /**< FEC is off */ > >> + RTE_ETH_FEC_BASER, /**< FEC using common algorithm */ > >> + RTE_ETH_FEC_RS, /**< FEC using RS algorithm */ > >> + RTE_ETH_FEC_AUTO, /**< FEC autonegotiation modes */ > >> + RTE_ETH_FEC_NUM > > > > It is better not to have RTE_ETH_FEC_NUM here: > > Any future additions to that enum would overwrite _NUM values and would > > considered as ABI breakage. > > Aprart from that: > > Acked-by: Konstantin Ananyev > > > HI, > it does not matter even though RTE_ETH_FEC_NUM value is changed > when adding new element to that enum. RTE_ETH_FEC_NUM is used as the MAX > vlaue of FEC modes, not one FEC mode itself. I understand that, but when in future you'll try to add some new mode, it will cause a change of RTE_ETH_FEC_NUM value. As I remember, abicheck will report it as ABI breakage. So adding new values to that enum will be really problematic. > One of the application scenarios is as follows,set "testpmd" as > an example: > show_fec_capability(uint32_t fec_cap) > { > uint32_t i; >=20 > if (fec_cap =3D=3D 0) { > printf("FEC is not supported\n"); > return; > } >=20 > printf("FEC capabilities: "); > for (i =3D RTE_ETH_FEC_BASER; i < RTE_ETH_FEC_NUM; i++) { I think you can use RTE_DIM(fec_mode_name) here instead of RTE_ETH_FEC_NUM. > if (fec_cap & 1U << i) BTW, one more thing - as you translate from mode to capa all over the place= , I think it deserves a separate macro for it. Something like: #define RTE_ETH_FEC_MODE_TO_CAPA(x) (1U << (x)) > printf("%s ", fec_mode_name[i].name); > } > printf("\n"); > } >=20 > Hope for your reply. >=20 > >> +}; > >> + > >> +/* This indicates FEC capabilities */ > >> +#define RTE_ETH_FEC_CAPA_NOFEC (1U << RTE_ETH_FEC_NOFEC) > >> +#define RTE_ETH_FEC_CAPA_BASER (1U << RTE_ETH_FEC_BASER) > >> +#define RTE_ETH_FEC_CAPA_RS (1U << RTE_ETH_FEC_RS) > >> +#define RTE_ETH_FEC_CAPA_AUTO (1U << RTE_ETH_FEC_AUTO) > >> + > >> +