From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf0-f50.google.com (mail-lf0-f50.google.com [209.85.215.50]) by dpdk.org (Postfix) with ESMTP id 5BA522BFF for ; Wed, 5 Oct 2016 18:10:33 +0200 (CEST) Received: by mail-lf0-f50.google.com with SMTP id b75so85022754lfg.3 for ; Wed, 05 Oct 2016 09:10:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:user-agent:in-reply-to :references:mime-version:content-transfer-encoding; bh=nkUfipaWIgKG2RWCiOlgiOIfK2EsptuGV/Z0mZ8zNaA=; b=r6xwEhwSpYwe57IBM3tmjCINlZJpRTvu534rIb5mcAcaT9Gai2ELb+qvF/2g5/6m2S LoPr/5AEQFuaLn80Y+uXVicr9tQx2PJkMW9jbzjpdYVADoyacoR4HeXotTrJUDi84tw0 T95gmh7KORiSSsLu9aRveA4zT/snaUCTzxCpKPUF7mb/WvOHXhaTjTJM/Nrq4a0mUpKr ONjChi0AKeh8nZiT7DDo3Qc/M/mb7ilgJHHNpOuAQdiNbeXCLyJV2Cvf26Mk/k7+E2T1 eRUkqPXg9/AFXyyqL0wUL9o0piH9wlFxdq6L9qjmWVZIZfDD8vwuqWSJGZwP8x6mzcIz Lqjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:user-agent :in-reply-to:references:mime-version:content-transfer-encoding; bh=nkUfipaWIgKG2RWCiOlgiOIfK2EsptuGV/Z0mZ8zNaA=; b=ZVs7+mMNXaPI38at8z2JGML1JiFQ9qfSuky7AT5NdFkF9rk9lwnXtX8C5z2e2pOLWt 7aFpBbgIGbCul+jjWh51AJ6rdJuDfzWXXDrFwTmj5BwshUlb3UBipHo3VIMlNwGqirKC DrKI6oz5FMFDlhQqZ/UlplyMa8BrMfiCJXvDivVUkgfkI9gui7o03DMje83qdsJ67m2d B9RQJkZwWpMKzEu6klWLXqhiWx4fO/HnOy2mX0aC5NiCQvAJTkrQJcVJuyy+Bbfe6fsl XUiFLqwiSmU+iyho7Iz940FOJcdpZtonlf8EVqkEe49oq8Ytx1klpOqRu3kLjzRUnYiy 64Xg== X-Gm-Message-State: AA6/9RlQy/yYrlC7MIP2Q83vXE4U6qILyJKSReYJhhyRxcjiWoAR50fJxQ2NnnrDQ7P3XDcd X-Received: by 10.194.240.71 with SMTP id vy7mr8277158wjc.90.1475683832631; Wed, 05 Oct 2016 09:10:32 -0700 (PDT) Received: from xps13.localnet (guy78-3-82-239-227-177.fbx.proxad.net. [82.239.227.177]) by smtp.gmail.com with ESMTPSA id r142sm10289153wme.10.2016.10.05.09.10.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Oct 2016 09:10:31 -0700 (PDT) From: Thomas Monjalon To: Bernard Iremonger Cc: dev@dpdk.org, rahul.r.shah@intel.com, wenzhuo.lu@intel.com, az5157@att.com, jerin.jacob@caviumnetworks.com Date: Wed, 05 Oct 2016 18:10:29 +0200 Message-ID: <2148835.WQXRyfBhcc@xps13> User-Agent: KMail/4.14.10 (Linux/4.5.4-1-ARCH; KDE/4.14.11; x86_64; ; ) In-Reply-To: <1475592734-22355-2-git-send-email-bernard.iremonger@intel.com> References: <1475250308-5498-1-git-send-email-bernard.iremonger@intel.com> <1475592734-22355-2-git-send-email-bernard.iremonger@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v4 1/2] 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: Wed, 05 Oct 2016 16:10:33 -0000 2016-10-04 15:52, Bernard Iremonger: > 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. I have some difficulties to parse this explanation. Please could you reword it and precise the direction of the message and the use case context? > --- a/lib/librte_ether/rte_ethdev.c > +++ b/lib/librte_ether/rte_ethdev.c > @@ -2510,6 +2510,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); > +} This function is just adding a parameter, compared to the legacy _rte_eth_dev_callback_process. Why calling it process_vf? And by the way, why not just replacing the legacy function? As it is a driver interface, there is no ABI restriction. > + > +void > +_rte_eth_dev_callback_process_generic(struct rte_eth_dev *dev, > + enum rte_eth_event_type event, void *param) > +{ [...] > --- a/lib/librte_ether/rte_ethdev.h > +++ b/lib/librte_ether/rte_ethdev.h > @@ -3026,6 +3026,7 @@ 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 */ > }; Either we choose to have a "generic" VF event well documented, or it is just a specific event with a tip on where to find the doc. Here we need at least to know how to handle the argument. > +/** > + * @internal Executes all the user application registered callbacks. Used by: > + * _rte_eth_dev_callback_process and _rte_eth_dev_callback_process_vf > + * It is for DPDK internal user only. User application should not call it > + * directly. > + * > + * @param dev > + * Pointer to struct rte_eth_dev. > + * @param event > + * Eth device interrupt event type. > + * > + * @param param > + * parameters to pass back to user application. > + * > + * @return > + * void > + */ > +void > +_rte_eth_dev_callback_process_generic(struct rte_eth_dev *dev, > + enum rte_eth_event_type event, void *param); This is really an internal function and should not be exported at all.