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 3E6CCA034D for ; Mon, 20 Dec 2021 08:45:25 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 20FD041168; Mon, 20 Dec 2021 08:45:25 +0100 (CET) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id D4AF140395; Mon, 20 Dec 2021 08:45:21 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1639986322; x=1671522322; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=UuMDWu4ZzlWJYJ0wbuXbwnJkzlVLHu7Xzfj8imPpj1A=; b=d+jbOBJZeW3B4bdQKwIQgKjhy3npSN8RJ+VEP0zvtbV02vWZE+vcTTOY olBVKL1y70Oe1dbqdw8b8uQQcq7wenq3UuJvgdFdHGrRGfxgvSQJ5CdAL xBDFElPk79jLc8X9riuMxjce9tKNYGJ9TConJ7hAUH0TDAn5zXxxjLL75 NSrG9kdJ1I1q8p+3U4zt6TvTxGDWfopyTI9VfMaOIkXmHw5gvpi+uzXDb o9ZbqSFtEKe5RQB9fyFymkYph71AlYkpCHJ8Js13kUyYnuq46Ktr+iLJe E1168gD1JN2/aUzqx+GocJr2r6XblPqKP6cccN4eHvsYGB7ze4Gptn+tj A==; X-IronPort-AV: E=McAfee;i="6200,9189,10203"; a="240338810" X-IronPort-AV: E=Sophos;i="5.88,219,1635231600"; d="scan'208";a="240338810" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Dec 2021 23:45:20 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,219,1635231600"; d="scan'208";a="467298214" Received: from orsmsx604.amr.corp.intel.com ([10.22.229.17]) by orsmga006.jf.intel.com with ESMTP; 19 Dec 2021 23:45:20 -0800 Received: from orsmsx604.amr.corp.intel.com (10.22.229.17) by ORSMSX604.amr.corp.intel.com (10.22.229.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Sun, 19 Dec 2021 23:45:19 -0800 Received: from orsedg603.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_GCM_SHA256) id 15.1.2308.20 via Frontend Transport; Sun, 19 Dec 2021 23:45:19 -0800 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.43) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.20; Sun, 19 Dec 2021 23:45:18 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IAdvI/DI/fX2WJcg3udrG289FkUljPwNwYN1bDF6BjBZIfmHNK2iJyISF0099eZz5zPHBssRXxwi0ry/pb5wyBRHXRyyCWHRVbng5QeXwwyVYZTkDKnoT08Y+xaxSBZk1qWNYW7KNojaVz8JEpFTuls7hWmHF5hn0Wp3NpcJ4M9rhsKFwk/Jd8HD8CQGQBujuRkXXSHF1dPBhGyyQ5iaoqlRaUQgyxb+RepFghVlV/I7LjqWZVm4q74LkfSdFmuyWhLRtBU4RP04FxLtS9zYoO5KtvkvyNJxc1JD9LnydqgohT0eY5jX9LdFiR+BW1jlZDAlgfL7aa9iPnGsWYIH4g== 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=hpKige7zXldC621s8k6/nkzqpQg1q3py7AUrAe/VPBE=; b=CsmugQS3FY2QJNjTtJWJVKOGvXw8QDWeTYo7ikiK97igDb0yQK8iSfl9gttWIw0FLI5PNZN7SFdwsBGxDRIQI4pxfI/wVk3vnJdKj8CSgPd6e0gp6aL2URgBLYF0hq0X/pHY9OmnPvhZI71jqrjwWqTUT7QBeTFTcWTg14seRaWdOd23Q4OjALZ2pj5XPscmm+WQ+FY4rfibxSx9cS+GNRYQrznpG42uZOL2FhSnasj1Qitm+C20rhEgRroJED618SaC9x6obKbNDyQmmo5HixUNY3WQOyegBH/JzsGPgqR+OkRVksKQQaPR10FLxp1jfVaO/TBN3ffLsG85UAn23g== 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 Received: from BYAPR11MB3495.namprd11.prod.outlook.com (2603:10b6:a03:8a::14) by BYAPR11MB3496.namprd11.prod.outlook.com (2603:10b6:a03:8b::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4801.17; Mon, 20 Dec 2021 07:45:17 +0000 Received: from BYAPR11MB3495.namprd11.prod.outlook.com ([fe80::8b:8b64:1a16:859c]) by BYAPR11MB3495.namprd11.prod.outlook.com ([fe80::8b:8b64:1a16:859c%3]) with mapi id 15.20.4801.020; Mon, 20 Dec 2021 07:45:16 +0000 From: "Wang, Haiyue" To: Stephen Douthit , "Lu, Wenzhuo" CC: "dev@dpdk.org" , "Wang, Wen" , "stable@dpdk.org" Subject: RE: [PATCH v2 1/7] net/ixgbe: Fix ixgbe_is_sfp() to return valid result for X550EM_a devs Thread-Topic: [PATCH v2 1/7] net/ixgbe: Fix ixgbe_is_sfp() to return valid result for X550EM_a devs Thread-Index: AQHX6u9s7xGwhvub4keqRI50PpDO0aw7FF+Q Date: Mon, 20 Dec 2021 07:45:16 +0000 Message-ID: References: <20211206221922.644187-1-stephend@silicom-usa.com> <20211206221922.644187-2-stephend@silicom-usa.com> In-Reply-To: <20211206221922.644187-2-stephend@silicom-usa.com> Accept-Language: zh-CN, 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.6.200.16 authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 3d02f994-c83d-40e5-789d-08d9c38caa34 x-ms-traffictypediagnostic: BYAPR11MB3496:EE_ x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6790; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: fO+KGe3sB+koBieIvL+LtmcqrggHirl9iddJfcj6tF57CJvoWTPwPjoZuuYAdYYBTQGDPtOjMH1rDe4EVX8zX9euB7iMaOBXGkOtaSxhRAWDm0LTNmRRdr6LkJt8w7NmvqSQyfBYVjK0lQRRVV9aonWzdg5JAsHdqkqWECfZcuMS2vc1uJej9YMiIc5TqoYIYvtSd1X1o6FKoPECFx00Bszpt8k7n4hAHYKdsjEd8xxS6ZJwB2lWmLHpu9IwwVzyhZZSMuxGhYJ1rwTZuEQ/IUhZw/yYmGCkAuF4KB6k/A84f9jdJXTftEJjBWdKZDZZFJJ5o7kVAgDuqkiPPpYEF+yK2Gv+lvujOEjclN4GQ8TsN3KAy4DGlTWvPpyFonT/j4gPYKTzPP/avtK4FCMzbyFEqths2zKv5Q+bFjh40oxvIvJLlkz+7ZPVAcRyEr8nyFgGpHPX/ICy4ZZnIR/XWToYnIZc9UPgoTsUT5HebMU+NQr3MaCPJdCfCt2E2QDne9ic+XQ3niJhLsqfwXGCfDCgCJIPyGgUkx9kGzVbbT4oathWnWqdacEZFRcV7umsD+sG6BI7AYGIIuM4gQs73wVEu0IiAyXpq2pnm3kDJK7A2Z/L1K1CO08iVuDaSjJUA916dDl8EG4wxift4/qANwqZEonDo8eN39uzQB887i7U8kuUWDK2nJmtZf+gP84cpJbKMpS2VMQNjFr0FQYyhQ== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR11MB3495.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(122000001)(2906002)(83380400001)(86362001)(38100700002)(54906003)(8676002)(71200400001)(9686003)(26005)(66946007)(82960400001)(5660300002)(186003)(508600001)(55016003)(7696005)(6506007)(316002)(52536014)(33656002)(53546011)(38070700005)(110136005)(4326008)(64756008)(6636002)(76116006)(66556008)(66476007)(66446008)(8936002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?AKo4+0BVN/CudikrbzxJVp14AEpH41iELp+KEZ1zFkWM9QTNjgXzDCayYGMj?= =?us-ascii?Q?EcEAMgJQsLu6yYwzrkJDYCgKFE+upKT2aEQRjnKw42DrMd8SHlCZTYnv6XGf?= =?us-ascii?Q?moVGdflInHYYpon5ArtjlilbbqdgAxIXkg5abW2yZMyHh12itxKYECKX8bSG?= =?us-ascii?Q?MvL7V9iR96o3tCsrKJMaEqs4LaRHzACHL5fIXXYKlbL1F91NXZUE8Ws2SmLz?= =?us-ascii?Q?sgp1yi0U6JcnxHZ8X3ho1/aj8ZUTnmrt+la6q8m/AwJskd+igesT7BF0+1AE?= =?us-ascii?Q?Kbu+0YMtS847iJwUCgEdObVW/FPatblRkADIDIqSyv/VOSMVHBWvCpwLNMwr?= =?us-ascii?Q?RTlRjsgtf7DMyCkpWs1a13Pp12PtcrR/qrt1+9gXz6Z6G999aYyoKi/ncIyZ?= =?us-ascii?Q?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WzHXnVnhGFVqWobzrMn/?= =?us-ascii?Q?eZ6IZhNJL6u+RzAAC79Jx/OR45SKlt7D8r/c2DtIIrFZJY65tukW9BNoo8Zb?= =?us-ascii?Q?6wwUCI+za9l6FTQvWtoAALBPDVw85P2/u4HpkhwVte5crj7UZFw+U+O04WSR?= =?us-ascii?Q?W4d0M8izFKk9LDPkknnWro073zF9swVT9xu6xiScJ0dd8B6fxj9B+MOOnL9c?= =?us-ascii?Q?Orrxsac7qWMmDo7NDjlvNuW7eNTZbsGOPEUfJKpCOVFRRRjmV5rMU1gYp8RU?= =?us-ascii?Q?QEbzPDpma9rMdIjwQh6o3zgNqAFLOaa3oQeCpfRbwRAVjUgfMnaBsubswGEQ?= =?us-ascii?Q?BuT8ijeXaVke0EOaYocdhiE=3D?= 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: BYAPR11MB3495.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3d02f994-c83d-40e5-789d-08d9c38caa34 X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Dec 2021 07:45:16.6549 (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: M654Kwxn5zLE5Wk4bEDShYDduMM3NyvV/aOjvS9vx4B2BAZZybor0jMYD/tu8qyVOdNzgbcjDQEOuJvgp+h5Yw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB3496 X-OriginatorOrg: intel.com X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org > -----Original Message----- > From: Stephen Douthit > Sent: Tuesday, December 7, 2021 06:19 > To: Wang, Haiyue ; Lu, Wenzhuo > Cc: dev@dpdk.org; Wen Wang ; Stephen Douthit ; > stable@dpdk.org > Subject: [PATCH v2 1/7] net/ixgbe: Fix ixgbe_is_sfp() to return valid res= ult for X550EM_a devs >=20 > Currently all X500EM* MAC types fallthrough to the default case and get > reported as non-SFP regardless of media type, which isn't correct. >=20 > Fixes: 0790adeb567 ("ixgbe/base: support X550em_a device") > Cc: stable@dpdk.org >=20 > Signed-off-by: Stephen Douthit > --- > drivers/net/ixgbe/ixgbe_ethdev.c | 14 ++++++++++++++ > 1 file changed, 14 insertions(+) >=20 > diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_e= thdev.c > index fe61dba81d..66f7af95de 100644 > --- a/drivers/net/ixgbe/ixgbe_ethdev.c > +++ b/drivers/net/ixgbe/ixgbe_ethdev.c > @@ -781,6 +781,20 @@ ixgbe_is_sfp(struct ixgbe_hw *hw) > case ixgbe_phy_sfp_passive_unknown: > return 1; > default: > + /* x550em devices may be SFP, check media type */ > + switch (hw->mac.type) { > + case ixgbe_mac_X550EM_x: > + case ixgbe_mac_X550EM_a: > + switch (hw->mac.ops.get_media_type(hw)) { Use the API 'ixgbe_get_media_type' to avoid ops null ? > + case ixgbe_media_type_fiber: > + case ixgbe_media_type_fiber_qsfp: > + return 1; > + default: > + return 0; Since we care 'return 1' only, then the two defaults just "break;" ? > + } > + default: > + return 0;=20 Just 'break;' > + } > return 0; Then this default '0' will be used. > } > } > -- > 2.31.1