From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from rcdn-iport-8.cisco.com (rcdn-iport-8.cisco.com [173.37.86.79]) by dpdk.org (Postfix) with ESMTP id D957B1B194 for ; Thu, 16 Nov 2017 08:16:34 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=8376; q=dns/txt; s=iport; t=1510816594; x=1512026194; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=jmn821wag+19AB3BiZnv6ppGjZBirJT7WyJa0MoKSnE=; b=Iz3oulISxtrZfHvyft92PcDRVM9v5tuZ6VMvFuQGBUdF7kxNYW/iT9J0 xbZT5HrLEvkDe8h5Qo4KBi+3EUaxVRL367myHDvH+CVF3IFR3RaO0sUiC ARziOeDX0jVnGn0W74DQx+ZPaOiqsrhTbFKzlBvy32a4193oWfLEof8kP 0=; X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0CbAACqOg1a/5hdJa1eGQEBAQEBAQEBA?= =?us-ascii?q?QEBAQcBAQEBAYM2ZG4nB4N4ih+PIIF9hzmBI4kRhHGCEQojhRgCGoR3PxgBAQE?= =?us-ascii?q?BAQEBAQFrKIUeAQEBAQIBIwQNRQwEAgEIEQQBAQECAiMDAgICHxEUAQgIAgQBD?= =?us-ascii?q?QUIigQDDQgQqUaBbTqHPQ2DSQEBAQEBAQEBAQEBAQEBAQEBAQEBAR2BD4Ilgge?= =?us-ascii?q?BVYFpgh2BDYJrgkSCfoJjBYo0hz2QCT0Ch2uIIIRwgh5hiS2HIUiJa4I8OohYA?= =?us-ascii?q?hEZAYE4AR84QoEyehWDHQEBDgmCUxyBZ3eKGwGBEAEBAQ?= X-IronPort-AV: E=Sophos;i="5.44,402,1505779200"; d="scan'208";a="319429965" Received: from rcdn-core-1.cisco.com ([173.37.93.152]) by rcdn-iport-8.cisco.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Nov 2017 07:16:33 +0000 Received: from XCH-RTP-020.cisco.com (xch-rtp-020.cisco.com [64.101.220.160]) by rcdn-core-1.cisco.com (8.14.5/8.14.5) with ESMTP id vAG7GW1u007314 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=FAIL); Thu, 16 Nov 2017 07:16:33 GMT Received: from xch-rtp-017.cisco.com (64.101.220.157) by XCH-RTP-020.cisco.com (64.101.220.160) with Microsoft SMTP Server (TLS) id 15.0.1320.4; Thu, 16 Nov 2017 02:16:32 -0500 Received: from xch-rtp-017.cisco.com ([64.101.220.157]) by XCH-RTP-017.cisco.com ([64.101.220.157]) with mapi id 15.00.1320.000; Thu, 16 Nov 2017 02:16:32 -0500 From: "Hanoch Haim (hhaim)" To: Olivier MATZ , Konstantin Ananyev CC: Ilya Matveychikov , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v3] mbuf: cleanup rte_pktmbuf_lastseg(), fix atomic usage Thread-Index: AQHTXg+5U6hJZK650Ei3mGGQZg+VYqMWBrKAgACRIhA= Date: Thu, 16 Nov 2017 07:16:31 +0000 Message-ID: <2fa9a7806c9e447995d6017c6def9894@XCH-RTP-017.cisco.com> References: <20171115091413.27119-1-hhaim@cisco.com> <1D98684F-B8A9-4037-8534-0D4E3A1FD34C@gmail.com> <20171115173058.mrkrv3usbl5sfw3h@platinum> In-Reply-To: <20171115173058.mrkrv3usbl5sfw3h@platinum> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [64.103.125.33] Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v3] mbuf: cleanup rte_pktmbuf_lastseg(), fix atomic usage 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: , X-List-Received-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IHJ0ZV9hdG9taWMxNl9hZGRfcmV0dXJuKCZtLT5yZWZj bnRfYXRvbWljLCAtMSk7IA0KKyNlbHNlDQorICAgICAgICAgICAgICAgcmV0ID0gLS1tLT5yZWZj bnQ7DQorI2VuZGlmDQorICAgICAgICAgICAgICAgaWYgKHJldCAhPSAwKQ0KKyAgICAgICAgICAg ICAgICAgICAgICAgcmV0dXJuIE5VTEw7DQogDQogICAgICAgICAgICAgICAgaWYgKFJURV9NQlVG X0lORElSRUNUKG0pKQ0KICAgICAgICAgICAgICAgICAgICAgICAgcnRlX3BrdG1idWZfZGV0YWNo KG0pOyBAQCAtMTM3NSw3ICsxMzg1LDYgQEAgcnRlX3BrdG1idWZfcHJlZnJlZV9zZWcoc3RydWN0 IHJ0ZV9tYnVmICptKQ0KIA0KICAgICAgICAgICAgICAgIHJldHVybiBtOw0KICAgICAgICB9DQot ICAgICAgIHJldHVybiBOVUxMOw0KIH0NCiANCiAvKiBkZXByZWNhdGVkLCByZXBsYWNlZCBieSBy dGVfcGt0bWJ1Zl9wcmVmcmVlX3NlZygpICovID09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PQ0KDQpbMV0gaHR0cDovL2RwZGsub3JnL2Rldi9wYXRjaHdvcmsvcGF0Y2gvMzEzNzgvDQoNCg0K UmVnYXJkcywNCk9saXZpZXINCg==