Message ID | 1476915787-28205-2-git-send-email-daniels@research.att.com (mailing list archive) |
---|---|
State | Superseded, archived |
Delegated to: | Bruce Richardson |
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 7A03A6CD2; Thu, 20 Oct 2016 00:23:36 +0200 (CEST) Received: from mx0a-00191d01.pphosted.com (mx0a-00191d01.pphosted.com [67.231.149.140]) by dpdk.org (Postfix) with ESMTP id 7CDFE6CD1 for <dev@dpdk.org>; Thu, 20 Oct 2016 00:23:35 +0200 (CEST) Received: from pps.filterd (m0053301.ppops.net [127.0.0.1]) by mx0a-00191d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id u9JMKVTx019305; Wed, 19 Oct 2016 18:23:34 -0400 Received: from alpi155.enaf.aldc.att.com (sbcsmtp7.sbc.com [144.160.229.24]) by mx0a-00191d01.pphosted.com with ESMTP id 266hh484hp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 19 Oct 2016 18:23:34 -0400 Received: from enaf.aldc.att.com (localhost [127.0.0.1]) by alpi155.enaf.aldc.att.com (8.14.5/8.14.5) with ESMTP id u9JMNWH0029924; Wed, 19 Oct 2016 18:23:33 -0400 Received: from mlpi408.sfdc.sbc.com (mlpi408.sfdc.sbc.com [130.9.128.240]) by alpi155.enaf.aldc.att.com (8.14.5/8.14.5) with ESMTP id u9JMNPVa029791 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 19 Oct 2016 18:23:27 -0400 Received: from clpi183.sldc.sbc.com (clpi183.sldc.sbc.com [135.41.1.46]) by mlpi408.sfdc.sbc.com (RSA Interceptor); Wed, 19 Oct 2016 22:23:16 GMT Received: from sldc.sbc.com (localhost [127.0.0.1]) by clpi183.sldc.sbc.com (8.14.5/8.14.5) with ESMTP id u9JMNFeG011713; Wed, 19 Oct 2016 17:23:15 -0500 Received: from mail-green.research.att.com (mail-green.research.att.com [135.207.255.15]) by clpi183.sldc.sbc.com (8.14.5/8.14.5) with ESMTP id u9JMN9xD011428; Wed, 19 Oct 2016 17:23:10 -0500 Received: from cheetah.research.att.com (mt-230-10.research.att.com [135.207.230.10]) by mail-green.research.att.com (Postfix) with ESMTP id 19F1FE07C6; Wed, 19 Oct 2016 18:23:00 -0400 (EDT) From: "E. Scott Daniels" <daniels@research.att.com> To: helin.zhang@intel.com, bernard.iremonger@intel.com Cc: dev@dpdk.org, az5157@att.com, "E. Scott Daniels" <daniels@research.att.com> Date: Wed, 19 Oct 2016 18:23:07 -0400 Message-Id: <1476915787-28205-2-git-send-email-daniels@research.att.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1476915787-28205-1-git-send-email-daniels@research.att.com> References: <1476915787-28205-1-git-send-email-daniels@research.att.com> X-RSA-Inspected: yes X-RSA-Classifications: public X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-10-19_18:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_policy_notspam policy=outbound_policy score=0 priorityscore=1501 malwarescore=0 suspectscore=2 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609300000 definitions=main-1610190395 Subject: [dpdk-dev] [PATCH] net/ixgbe: prevent duplicate callback on list X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK <dev.dpdk.org> List-Unsubscribe: <http://dpdk.org/ml/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://dpdk.org/ml/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <http://dpdk.org/ml/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org Sender: "dev" <dev-bounces@dpdk.org> |
Commit Message
Scott Daniels
Oct. 19, 2016, 10:23 p.m. UTC
This change prevents the attempt to add a structure which is
already on the callback list. If a struct with matching
parameters is found on the list, then no action is taken. If
a struct with matching parameters is found on the list, then
no action is taken.
Signed-off-by: E. Scott Daniels <daniels@research.att.com>
---
lib/librte_ether/rte_ethdev.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
Comments
Hi Scott, > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of E. Scott Daniels > Sent: Thursday, October 20, 2016 6:23 AM > To: Zhang, Helin; Iremonger, Bernard > Cc: dev@dpdk.org; az5157@att.com; E. Scott Daniels > Subject: [dpdk-dev] [PATCH] net/ixgbe: prevent duplicate callback on list > > This change prevents the attempt to add a structure which is already on the > callback list. If a struct with matching parameters is found on the list, then no > action is taken. If a struct with matching parameters is found on the list, then no > action is taken. > > Signed-off-by: E. Scott Daniels <daniels@research.att.com> I think the fix itself is good. But 2 things, 1, normally we don't create a cover letter for a patch set which only has one patch. Just sending the patch itself is enough. 2, ' net/ixgbe: ' in the title is used to describe the component. So the title should be ' lib/ether: prevent duplicate callback on list'. Thanks.
On Wed, 19 Oct 2016, Lu, Wenzhuo wrote: > Hi Scott, > >> -----Original Message----- >> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of E. Scott Daniels >> Sent: Thursday, October 20, 2016 6:23 AM >> To: Zhang, Helin; Iremonger, Bernard >> Cc: dev@dpdk.org; az5157@att.com; E. Scott Daniels >> Subject: [dpdk-dev] [PATCH] net/ixgbe: prevent duplicate callback on list >> >> This change prevents the attempt to add a structure which is already on the >> callback list. If a struct with matching parameters is found on the list, then no >> action is taken. If a struct with matching parameters is found on the list, then no >> action is taken. >> >> Signed-off-by: E. Scott Daniels <daniels@research.att.com> > I think the fix itself is good. But 2 things, > 1, normally we don't create a cover letter for a patch set which only has one patch. Just sending the patch itself is enough. > 2, ' net/ixgbe: ' in the title is used to describe the component. So the title should be ' lib/ether: prevent duplicate callback on list'. > Thanks. Thanks for the advice. My mistake on the component. Is there an easy way to fix, or does it make sense just to nack this and I'll submit one with the correct component. Scott > >
Hi Scott, > -----Original Message----- > From: Scott Daniels [mailto:daniels@research.att.com] > Sent: Thursday, October 20, 2016 10:11 AM > To: Lu, Wenzhuo > Cc: Zhang, Helin; Iremonger, Bernard; dev@dpdk.org; ZELEZNIAK, ALEX > Subject: RE: [dpdk-dev] [PATCH] net/ixgbe: prevent duplicate callback on list > > > > On Wed, 19 Oct 2016, Lu, Wenzhuo wrote: > > > Hi Scott, > > > >> -----Original Message----- > >> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of E. Scott Daniels > >> Sent: Thursday, October 20, 2016 6:23 AM > >> To: Zhang, Helin; Iremonger, Bernard > >> Cc: dev@dpdk.org; az5157@att.com; E. Scott Daniels > >> Subject: [dpdk-dev] [PATCH] net/ixgbe: prevent duplicate callback on > >> list > >> > >> This change prevents the attempt to add a structure which is already > >> on the callback list. If a struct with matching parameters is found > >> on the list, then no action is taken. If a struct with matching > >> parameters is found on the list, then no action is taken. > >> > >> Signed-off-by: E. Scott Daniels <daniels@research.att.com> > > I think the fix itself is good. But 2 things, 1, normally we don't > > create a cover letter for a patch set which only has one patch. Just sending the > patch itself is enough. > > 2, ' net/ixgbe: ' in the title is used to describe the component. So the title > should be ' lib/ether: prevent duplicate callback on list'. > > Thanks. > > Thanks for the advice. My mistake on the component. Is there an easy way to > fix, or does it make sense just to nack this and I'll submit one with the correct > component. No need to NACK it. You can send a V2 with the correct component. And I think you can add my ack in the V2. Acked-by: Wenzhuo Lu <Wenzhuo.lu@intel.com> BTW, I forgot to mention that as it's a fix. We always add a Fixes tag in the commit log. You can find the example from other one's mails :) > > Scott > > > > >
On Wed, 19 Oct 2016, Lu, Wenzhuo wrote: > Hi Scott, > >> -----Original Message----- >> From: Scott Daniels [mailto:daniels@research.att.com] >> Sent: Thursday, October 20, 2016 10:11 AM >> To: Lu, Wenzhuo >> Cc: Zhang, Helin; Iremonger, Bernard; dev@dpdk.org; ZELEZNIAK, ALEX >> Subject: RE: [dpdk-dev] [PATCH] net/ixgbe: prevent duplicate callback on list >> >> >> >> On Wed, 19 Oct 2016, Lu, Wenzhuo wrote: >> >>> Hi Scott, >>> >>>> -----Original Message----- >>>> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of E. Scott Daniels >>>> Sent: Thursday, October 20, 2016 6:23 AM >>>> To: Zhang, Helin; Iremonger, Bernard >>>> Cc: dev@dpdk.org; az5157@att.com; E. Scott Daniels >>>> Subject: [dpdk-dev] [PATCH] net/ixgbe: prevent duplicate callback on >>>> list >>>> >>>> This change prevents the attempt to add a structure which is already >>>> on the callback list. If a struct with matching parameters is found >>>> on the list, then no action is taken. If a struct with matching >>>> parameters is found on the list, then no action is taken. >>>> >>>> Signed-off-by: E. Scott Daniels <daniels@research.att.com> >>> I think the fix itself is good. But 2 things, 1, normally we don't >>> create a cover letter for a patch set which only has one patch. Just sending the >> patch itself is enough. >>> 2, ' net/ixgbe: ' in the title is used to describe the component. So the title >> should be ' lib/ether: prevent duplicate callback on list'. >>> Thanks. >> >> Thanks for the advice. My mistake on the component. Is there an easy way to >> fix, or does it make sense just to nack this and I'll submit one with the correct >> component. > No need to NACK it. You can send a V2 with the correct component. And I think you can add my ack in the V2. > Acked-by: Wenzhuo Lu <Wenzhuo.lu@intel.com> > > BTW, I forgot to mention that as it's a fix. We always add a Fixes tag in the commit log. You can find the example from other one's mails :) Will do. The patch checker was squaking about the fixes tag and I remvoed it :( So, I need to figure out what it didn't like about it and I'll fix with a V2 and add your ack. Getting late here tonight, so tomorrow. Thanks Scott > >> >> Scott >> >>> >>> >
On Wed, 19 Oct 2016, DANIELS, EDWARD S (EDWARD) wrote: > *** Security Advisory: This Message Originated Outside of AT&T ***. > Reference http://cso.att.com/EmailSecurity/IDSP.html for more information. > > > > On Wed, 19 Oct 2016, Lu, Wenzhuo wrote: > >> Hi Scott, >> >>> -----Original Message----- >>> From: Scott Daniels [mailto:daniels@research.att.com] >>> Sent: Thursday, October 20, 2016 10:11 AM >>> To: Lu, Wenzhuo >>> Cc: Zhang, Helin; Iremonger, Bernard; dev@dpdk.org; ZELEZNIAK, ALEX >>> Subject: RE: [dpdk-dev] [PATCH] net/ixgbe: prevent duplicate callback on list >>> >>> >>> >>> On Wed, 19 Oct 2016, Lu, Wenzhuo wrote: >>> >>>> Hi Scott, >>>> >>>>> -----Original Message----- >>>>> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of E. Scott Daniels >>>>> Sent: Thursday, October 20, 2016 6:23 AM >>>>> To: Zhang, Helin; Iremonger, Bernard >>>>> Cc: dev@dpdk.org; az5157@att.com; E. Scott Daniels >>>>> Subject: [dpdk-dev] [PATCH] net/ixgbe: prevent duplicate callback on >>>>> list >>>>> >>>>> This change prevents the attempt to add a structure which is already >>>>> on the callback list. If a struct with matching parameters is found >>>>> on the list, then no action is taken. If a struct with matching >>>>> parameters is found on the list, then no action is taken. >>>>> >>>>> Signed-off-by: E. Scott Daniels <daniels@research.att.com> >>>> I think the fix itself is good. But 2 things, 1, normally we don't >>>> create a cover letter for a patch set which only has one patch. Just sending the >>> patch itself is enough. >>>> 2, ' net/ixgbe: ' in the title is used to describe the component. So the title >>> should be ' lib/ether: prevent duplicate callback on list'. >>>> Thanks. >>> >>> Thanks for the advice. My mistake on the component. Is there an easy way to >>> fix, or does it make sense just to nack this and I'll submit one with the correct >>> component. >> No need to NACK it. You can send a V2 with the correct component. And I think you can add my ack in the V2. >> Acked-by: Wenzhuo Lu <Wenzhuo.lu@intel.com> >> >> BTW, I forgot to mention that as it's a fix. We always add a Fixes tag in the commit log. You can find the example from other one's mails :) > > Will do. The patch checker was squaking about the fixes tag and I remvoed > it :( So, I need to figure out what it didn't like about it and I'll fix > with a V2 and add your ack. Getting late here tonight, so tomorrow. > > Thanks > Scott V2 created, but with the change to the component the subject is different: [PATCH v2] lib/ether: prevent duplicate callback on list > > >> > >>> >>> Scott >>> >>>> >>>> >> >
diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index 0d9d9c1..fde8112 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -2449,14 +2449,15 @@ rte_eth_dev_callback_register(uint8_t port_id, } /* create a new callback. */ - if (user_cb == NULL) + if (user_cb == NULL) { user_cb = rte_zmalloc("INTR_USER_CALLBACK", sizeof(struct rte_eth_dev_callback), 0); - if (user_cb != NULL) { - user_cb->cb_fn = cb_fn; - user_cb->cb_arg = cb_arg; - user_cb->event = event; - TAILQ_INSERT_TAIL(&(dev->link_intr_cbs), user_cb, next); + if (user_cb != NULL) { + user_cb->cb_fn = cb_fn; + user_cb->cb_arg = cb_arg; + user_cb->event = event; + TAILQ_INSERT_TAIL(&(dev->link_intr_cbs), user_cb, next); + } } rte_spinlock_unlock(&rte_eth_dev_cb_lock);