From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0056.outbound.protection.outlook.com [104.47.41.56]) by dpdk.org (Postfix) with ESMTP id E2A642716 for ; Fri, 9 Sep 2016 16:11:00 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=9GoE51zu+1Fq/RFEzi6CZJzkXCW95OHN+VEPQ/YE6Yg=; b=NKiBWs6c6KVaFOVn1NV9inr29FBv8XZHqcGkIPu8Wzbd9QHB1/nTWDO9yceVWrKbHgGZBPc7iN+KeZvDj3k+I8EyfuroZX6Ooli/mV6S2Mm3GfT0QPVjZQfhWIVM5OQI3/g45rOeWakvsMGHkuaK2eEdoYaeswD8/8BZL9uDA00= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.Jacob@cavium.com; Received: from localhost.localdomain (171.61.104.44) by BLUPR0701MB1715.namprd07.prod.outlook.com (10.163.85.141) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.609.9; Fri, 9 Sep 2016 14:10:56 +0000 Date: Fri, 9 Sep 2016 19:40:32 +0530 From: Jerin Jacob To: Bernard Iremonger CC: , , , azelezniak Message-ID: <20160909141031.GA4100@localhost.localdomain> References: <1471528125-26357-1-git-send-email-bernard.iremonger@intel.com> <1472202620-20487-1-git-send-email-bernard.iremonger@intel.com> <1472202620-20487-2-git-send-email-bernard.iremonger@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <1472202620-20487-2-git-send-email-bernard.iremonger@intel.com> User-Agent: Mutt/1.6.2 (2016-07-01) X-Originating-IP: [171.61.104.44] X-ClientProxiedBy: MA1PR01CA0015.INDPRD01.PROD.OUTLOOK.COM (10.164.117.22) To BLUPR0701MB1715.namprd07.prod.outlook.com (10.163.85.141) X-MS-Office365-Filtering-Correlation-Id: e23ffd8d-6fca-483c-cb9c-08d3d8bb1fab X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1715; 2:FQoNUPkdun2DAg1RPTgWIaHf1gcRZcEKR4uFyY8SYPCNlW+L5nDHVkbXhV27Sc3hqzH07zaLeNj61dvx+kjPuoktjcv3t6vDysJsCYnw5K5HxGoLMLCKB2u/mydUseWQY29W9LWHRXQ5WRDFVMWe416b5zHB2G2IE9vcVhulAmI9hAldCoK2C0ELTOseufZL; 3:ZWIEy+wllMirysGY0IqZZVIhDGimNBLvaO7TAvb3EZrQxpMRyeo+Lj2XQxoen61e4GEpS9e0g6YE7H2ahk44UWEEK9Yp0Wnq7ahUnPvhhOayO1QCnRJop1vJyR6i/Bhh X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR0701MB1715; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1715; 25:bZZByIIo2zeY1z21gDk5+txkLvsge2CTVEpp/FGj8l7dEf8sY/xbfDmndnk7ScmDWayOhsYtpAbnX8hQZN1sEIaZwAXeFQH0Y7xl9hdKYJw68e/efXt5XG40GkOwgkoYoO/1EgBQZPXodIRcHg5Dw0/X2AO7KSw4J/QXbmWmU1n3UW8Yn4DE50Lyhl+kYEsuUP3WOgLvHq8058wO75pRZ3KVL2Z6EMcPXclEnh8Zl2ppbboZmItHNpXCEq+fyeRNhSTKR925JFHPGuQn8l3SvPoUkgsm8qXYFkOZVlZKHMo6q5tV36l++ApVJDr0yjl0x8ILQ3fT4HfYBX/me3rf4lgD9UAInNDw39u/FU56rK5fIVW2lb0R/NsSRxxNarYOgNLnr23brjZAsk+j8LKRzS7NFvVEwKvLJZ5beOTXcyiuIsSuUz3Jp/hf1ewevGuHhACdk5ho5GXjftVEZQNvqTKcg17fwU1aHqpUfvO7WdJGJhqo2CyDLeyVlH2KRfkY0cs6PLsq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WB7HOmzjGJpj6Z9HSkjgujvwGpvWOX6lWbTiQux9VWpGORbJblYJ87TnHk6YI= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(97927398514766)(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001); SRVR:BLUPR0701MB1715; BCL:0; PCL:0; RULEID:; SRVR:BLUPR0701MB1715; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1715; 4:tfuWPESVJNw6Zx42DVI/kde7mKYNd1ceoawCNUoHwW5/Wzk4ivuxjrIgJbfu3O8YrK4uDuau6qrKceivfnJRvz6MvjyyJdwZSOARZfxLLFVa1mqWeHtxiQbiVDzolVDtX1SnxHxFPF24O7Wwo02oBAtRLczGtj2TUWJ+TbuGYpHuxW1rqHe4Y5jOfhcA0beOY1VuTHE94jabUIgQGBwVYkZOcmaBulPpqxrYlJGOvm2KjztJTwZu6HE9YxUPz6XuMpCMxmP3uoTR2hebk0Jx3qK8Ekn5L1eRER8j25dM0xviiXUjUDq33R19Y4praycvR1aq9nEW6TYiGxuuPG67kTyWrK8D3yLnoaFdoEHeAIX9XYjQcL6uSkUn3Yen49IyTLv8OGneuIeiWN7+lbmcpTFBSLGFXrVigMYuyl3PrUFpr5ptp8JDo2+Idm0aaS9NBZHA21Khi+X2+09KMvhUNA== X-Forefront-PRVS: 00603B7EEF X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(6069001)(7916002)(24454002)(199003)(189002)(110136002)(19580405001)(50466002)(5660300001)(97736004)(19580395003)(2906002)(92566002)(68736007)(2950100001)(575784001)(83506001)(4001350100001)(105586002)(77096005)(106356001)(46406003)(33656002)(9686002)(66066001)(7846002)(76176999)(101416001)(189998001)(54356999)(305945005)(4326007)(3846002)(81166006)(23726003)(42186005)(6116002)(586003)(8676002)(61506002)(97756001)(47776003)(50986999)(81156014)(7736002)(1076002)(18370500001)(217873001); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR0701MB1715; H:localhost.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR0701MB1715; 23:KJgq6GlRdA4tcTVUabt70G5Vaesq7Po36b1a080?= =?us-ascii?Q?MnLr/dwjM0TdRqJbvrHpDX+0ky3aNjt4IA3+++WOGaob7CNJod54/oITSGfU?= =?us-ascii?Q?olPSVI2TApE2Csmz4O9jFYSBhCOkm8qsS8XavdrWrb2UT/Ib93rUmJmrSUCx?= =?us-ascii?Q?NsnKU5m6PHOBLDixse+7i2K2hoH7kOPTId09MDomPEZhh35373AifTqap/Na?= =?us-ascii?Q?eKQBPLMhKub9/dNhKWQrCcuEsuYd6h/LeY4lyxU3x+icTk/XagZR5E8E+wOH?= =?us-ascii?Q?pUinjsTx59CAc+lQER/w1G2/pWUoejLkyq/qNn2RkNEEVFq6GMMc9H/6QKy8?= =?us-ascii?Q?8obPsbTDXzvVqMZSV5PJQr4cIL0wPfV5JIX9+Zav8GKHGYejM8sqHXsdi+yF?= =?us-ascii?Q?G/nfOQMvVzw3Pwxqm0+7T1T6k0xZ3WOV0+tv3QGWifFBfi6u3pbd9r6s9yh/?= =?us-ascii?Q?+BQSOpVohWpjnuXxIt801GADbtbqPhrt+qIWKdx+flzQHE9Y4CMzP4XigEMG?= =?us-ascii?Q?uDuyfFw2B1Ca0DPdVlVRNzPWxwqB3/8PZ6XHfIxQDnbBw4H5dWtKIevuD5S8?= =?us-ascii?Q?ElLjNhCbiRMsvSsqq/3NtCOu7c/brvKRWti8sDDQxQjpANZO+doCCv5ra7Oa?= =?us-ascii?Q?wbndla3Ll2n2qyUw9Pa6ZPk1+fU2tHcaxnRC5lU9ppS/M1bCIw2mXjEykG6I?= =?us-ascii?Q?PuHhjTJ9kUHJBvR3KMCjK0Na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GkT3wym8JVgYu0Ssxo/Hw2+J7SpfULs6vPQmxETIqadibzJtH/EKhR0HztkqNHJKUO/kw6wA==; 24:KoMmw0VGP8NCl4zORgTvrABiaE1o/97oiI6m8r8/5WAcbcOS2Z7d9qCreG5QKn3urKiyg4usFcvWVf0Wr49f+cS+WRZapdpeO0EWrntrt7Y=; 7:heHWl+DfsQ6jykfSB49jWxvZP0qqKDgcX+zvW1RuXTy0k/spv2WCNnfVLTWcrBQFWkzXm/Pv1ctzZSpeDXjDKX0YIaodRWnVyejnLMSBdb+QRI/ZXbYaK0m3zuq+LLbjOt64Al9uh+KhnxQAxUvGPeVFBXzvxJLkvWldBNRn9P/amQnVn8OhqPN+uPdl2ndGmRHjopHTfHX8FwjdWMtlxr1Gl+m66XH6xT3iblIKQq9HyrEvVq098XBYYXvIQAhM SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Sep 2016 14:10:56.9939 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0701MB1715 Subject: Re: [dpdk-dev] [RFC PATCH v2 1/5] librte_ether: add internal callback functions X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Sep 2016 14:11:01 -0000 On Fri, Aug 26, 2016 at 10:10:16AM +0100, Bernard Iremonger wrote: > add _rte_eth_dev_callback_process_vf function. > add _rte_eth_dev_callback_process_generic function > > Adding a callback to the user application on VF to PF mailbox message, > allows passing information to the application controlling the PF > when a VF mailbox event message is received, such as VF reset. > > Signed-off-by: azelezniak > Signed-off-by: Bernard Iremonger > --- > lib/librte_ether/rte_ethdev.c | 17 ++++++++++ > lib/librte_ether/rte_ethdev.h | 61 ++++++++++++++++++++++++++++++++++ > lib/librte_ether/rte_ether_version.map | 7 ++++ > 3 files changed, 85 insertions(+) > > diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c > index f62a9ec..1388ea3 100644 > --- a/lib/librte_ether/rte_ethdev.c > +++ b/lib/librte_ether/rte_ethdev.c > @@ -2690,6 +2690,20 @@ void > _rte_eth_dev_callback_process(struct rte_eth_dev *dev, > enum rte_eth_event_type event) > { > + return _rte_eth_dev_callback_process_generic(dev, event, NULL); > +} > + > +void > +_rte_eth_dev_callback_process_vf(struct rte_eth_dev *dev, > + enum rte_eth_event_type event, void *param) > +{ > + return _rte_eth_dev_callback_process_generic(dev, event, param); > +} > + > +void > +_rte_eth_dev_callback_process_generic(struct rte_eth_dev *dev, > + enum rte_eth_event_type event, void *param) > +{ > struct rte_eth_dev_callback *cb_lst; > struct rte_eth_dev_callback dev_cb; > > @@ -2699,6 +2713,9 @@ _rte_eth_dev_callback_process(struct rte_eth_dev *dev, > continue; > dev_cb = *cb_lst; > cb_lst->active = 1; > + if (param != NULL) > + dev_cb.cb_arg = (void *) param; > + > rte_spinlock_unlock(&rte_eth_dev_cb_lock); > dev_cb.cb_fn(dev->data->port_id, dev_cb.event, > dev_cb.cb_arg); > diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h > index b0fe033..4fb0b9c 100644 > --- a/lib/librte_ether/rte_ethdev.h > +++ b/lib/librte_ether/rte_ethdev.h > @@ -3047,9 +3047,27 @@ enum rte_eth_event_type { > /**< queue state event (enabled/disabled) */ > RTE_ETH_EVENT_INTR_RESET, > /**< reset interrupt event, sent to VF on PF reset */ > + RTE_ETH_EVENT_VF_MBOX, /**< PF mailbox processing callback */ > RTE_ETH_EVENT_MAX /**< max value of this enum */ > }; > > +/** > + * Response sent back to ixgbe driver from user app after callback > + */ > +enum rte_eth_mb_event_rsp { > + RTE_ETH_MB_EVENT_NOOP_ACK, /**< skip mbox request and ACK */ > + RTE_ETH_MB_EVENT_NOOP_NACK, /**< skip mbox request and NACK */ > + RTE_ETH_MB_EVENT_PROCEED, /**< proceed with mbox request */ > + RTE_ETH_MB_EVENT_MAX /**< max value of this enum */ > +}; Do we really need to define the specifics of PF to VF MBOX communication in normative ethdev specification? Each drivers may have different PF to VF MBOX definitions so it may not be very portable. What is the use-case here? If its for VF configuration, I think we can do it as separate 'sync' functions for each functionality so that PMDs will have room hiding the specifics on MBOX definitions.