From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8A169A0564 for ; Sun, 15 Mar 2020 08:52:00 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5895F3B5; Sun, 15 Mar 2020 08:52:00 +0100 (CET) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2080.outbound.protection.outlook.com [40.107.20.80]) by dpdk.org (Postfix) with ESMTP id 528F13B5; Sun, 15 Mar 2020 08:51:59 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WW24lcDe+kvl1MhUL9o/CbxVMfijq92nWEe3gUBcM24NUBa4Pgi6QxRsgU66Mn0eceK7ob8SA1DQ1CGkrytJmAzZeCVP5Ad4QkhGQFzEs1epsRRFEh/vY0+lOA9JF1Uj4MErvi0eRaSSBUQmWABWMxm1JFfqPL6skk07BCuT9/2uA5LXsdcE4GL9Yb49D+QLM1F5Yp8CKHEZITlFfw4EO/3V1UnMVDBevy1knEnQm9jN+yFR5BRaIMsVcOScE7qgacZJdZVlgsJgd9cFLRZ+RjWPKJys+FZFNMjVtuOcv78GPvI38zuxZt7LA6juBo+9nJaT5lNAZ4pZd2pdNlqsbg== 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-SenderADCheck; bh=qSiXhLMI0qQmWOHgvuLMCDJuNwRO3XUT9cZRSyAid9k=; b=ULaCg00dqBsaMpvExyYNJsFjJUKqvvdG8Xh3iFFvqBQSMaZWk/wFP/YuVwTcJV/oK3GVIhuN3kFZA3hmR80WY6yhhB8KhUVtSi9cWezxpX9r4pYO0q1TLT63j+dkOuM5qCLjL9fkzPxBZv9Mf+LGT/YgZIRj26f45ywcJyeDNPe9HUf2DHaQbKEVAdMfoWTsK8ZZUrIZK0SDq4+ohhPN0+ZHVAmBfKglm/8LXSQGFEBk5PaOxb9NMmSNIvjbo1TnxADIoA8GiXsd59qjNR0Tk6cDKNK7f6OS0XTA569wtOD8v78hi3ohkIMs7iKbnXEyhPXknVe10ki9aY9HEUUJfQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qSiXhLMI0qQmWOHgvuLMCDJuNwRO3XUT9cZRSyAid9k=; b=keYvls2ZHMJz4D2wtErkU+BuDkT8rz64KC9gZ85PX1bNuzb0SqqmCp/aPbBDIlQKgR6ZchZH9TYRSZOC90FTX414WJGMrTKw+YjaveDcJiz+G7V0Z6w7ltN1lKRmEJZ5mg+iXgWQqQD4enI2Enk5Zwhbmyz1r0WarKNjE49RGgs= Received: from AM0PR0502MB4019.eurprd05.prod.outlook.com (52.133.39.139) by AM0PR0502MB3842.eurprd05.prod.outlook.com (52.133.49.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2814.19; Sun, 15 Mar 2020 07:51:57 +0000 Received: from AM0PR0502MB4019.eurprd05.prod.outlook.com ([fe80::a564:a117:9022:1fee]) by AM0PR0502MB4019.eurprd05.prod.outlook.com ([fe80::a564:a117:9022:1fee%7]) with mapi id 15.20.2814.019; Sun, 15 Mar 2020 07:51:57 +0000 From: Matan Azrad To: Stephen Hemminger , "dev@dpdk.org" CC: "stable@dpdk.org" Thread-Topic: [PATCH 2/7] examples/l2fwd-cat: block attempts to use owned ports Thread-Index: AQHV+JKZFSS96oBlF0upFypJknGj+6hJSqBQ Date: Sun, 15 Mar 2020 07:51:57 +0000 Message-ID: References: <20200312172047.19973-1-stephen@networkplumber.org> <20200312172047.19973-3-stephen@networkplumber.org> In-Reply-To: <20200312172047.19973-3-stephen@networkplumber.org> Accept-Language: en-US, he-IL Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=matan@mellanox.com; x-originating-ip: [77.125.85.240] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 14c93788-da92-4f52-326e-08d7c8b5bcbd x-ms-traffictypediagnostic: AM0PR0502MB3842: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7219; x-forefront-prvs: 0343AC1D30 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(136003)(376002)(396003)(39850400004)(366004)(346002)(199004)(76116006)(52536014)(71200400001)(66476007)(33656002)(86362001)(5660300002)(2906002)(66556008)(64756008)(66446008)(66946007)(186003)(8936002)(4326008)(55016002)(9686003)(478600001)(7696005)(316002)(6506007)(8676002)(81156014)(26005)(81166006)(110136005); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR0502MB3842; H:AM0PR0502MB4019.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: VjRdpg3qJ099upP9qaw5HI/ScT9yBaOFZ1/rlLhgmXuY3LOtbIHfLqOp4H4RxIKsaCozvm9LgQXabyWgNy9bJViD1EnJkF3jSldpPwAo/f6DHQGosZIVZb6pJsW6goe0jYwfNB/bkNxt2/7kPJo6+YQmvn6viy0HtpQT7XEGRx/09tq6By9UbvE1LmMQ312JuE067k8j+46wBxFfx1nJwHtDioeM3lNB05CpFH0rwpMTwMB5vYbF12+XE5AR88Yf2kGfbKmTaxj9+iqgxMyPnVEb9LzlG9EdDH4tNrRo5dz4bXdkniw8v3UgFgN4/kGQI8VEsIJuwZmNrXmbUKsKnLTlvc9/pgiEm1WMqZsI68sU4wFAZmWXoBNsTe9zuE9wpr49a8GI9+Rui2dG0SbBq9nQNPCfe+Y8Ti8p6thzq9Vmxa/prN11k43dNWEdsr3D x-ms-exchange-antispam-messagedata: y4r7cvIWtZLhgYPs5xL3hEUavgmn/7adQrBqra5FmE5fj2gbQOpvbTUMjR03AdlpcLKgQ6upaA3+Y6OO9nYBCVvlUXcsG/Geyrcbmz6MTlXW2WPnd30u4i9gO+jTZ9Cj6BjqzGquc1SKH+HL8WoZgw== x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 14c93788-da92-4f52-326e-08d7c8b5bcbd X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Mar 2020 07:51:57.6266 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: U8iM5b5DLSvOskT19tGWt4s9TIoPSlblLa2QMqL6kvpkT0aHWjuAVt8OX+yQ+fcaxnmI3scP74N/8TFG08w/Vg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR0502MB3842 Subject: Re: [dpdk-stable] [PATCH 2/7] examples/l2fwd-cat: block attempts to use owned ports X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 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 Sender: "stable" Hi Stephen From: Stephen Hemminger I think the correct terminology here is (can be the title): Make the application be port ownership aware. Some applications may be ownership aware and others not. > If a ethdev port is in use for a sub device, then it should not be allowe= d in the > portmask of application. > Fixes: 5b7ba31148a8 ("ethdev: add port ownership") > Cc: matan@mellanox.com > Cc: stable@dpdk.org > Signed-off-by: Stephen Hemminger > --- > examples/l2fwd-cat/Makefile | 2 ++ > examples/l2fwd-cat/l2fwd-cat.c | 3 +++ > examples/l2fwd-cat/meson.build | 1 + > 3 files changed, 6 insertions(+) >=20 > diff --git a/examples/l2fwd-cat/Makefile b/examples/l2fwd-cat/Makefile > index b0e53c37e8d8..aa19347c1545 100644 > --- a/examples/l2fwd-cat/Makefile > +++ b/examples/l2fwd-cat/Makefile > @@ -20,6 +20,7 @@ static: build/$(APP)-static PKGCONF ?=3D pkg-config >=20 > PC_FILE :=3D $(shell $(PKGCONF) --path libdpdk 2>/dev/null) > +CFLAGS +=3D -DALLOW_EXPERIMENTAL_API > CFLAGS +=3D -O3 $(shell $(PKGCONF) --cflags libdpdk) LDFLAGS_SHARED =3D > $(shell $(PKGCONF) --libs libdpdk) LDFLAGS_STATIC =3D -Wl,-Bstatic $(she= ll > $(PKGCONF) --static --libs libdpdk) @@ -65,6 +66,7 @@ endif >=20 > EXTRA_CFLAGS +=3D -O3 -g -Wfatal-errors >=20 > +CFLAGS +=3D -DALLOW_EXPERIMENTAL_API > CFLAGS +=3D -I$(PQOS_INSTALL_PATH)/../include >=20 > LDLIBS +=3D -L$(PQOS_INSTALL_PATH) > diff --git a/examples/l2fwd-cat/l2fwd-cat.c b/examples/l2fwd-cat/l2fwd- > cat.c index 6838f288c621..c1c59b2d81f2 100644 > --- a/examples/l2fwd-cat/l2fwd-cat.c > +++ b/examples/l2fwd-cat/l2fwd-cat.c > @@ -42,6 +42,9 @@ port_init(uint16_t port, struct rte_mempool > *mbuf_pool) > if (!rte_eth_dev_is_valid_port(port)) > return -1; >=20 > + if (!rte_eth_dev_is_owned_by(portid, RTE_ETH_DEV_NO_OWNER)) > { > + return -1; > + > /* Configure the Ethernet device. */ > retval =3D rte_eth_dev_configure(port, rx_rings, tx_rings, > &port_conf); > if (retval !=3D 0) > diff --git a/examples/l2fwd-cat/meson.build b/examples/l2fwd- > cat/meson.build index 4e2777a03358..5c062c1354e3 100644 > --- a/examples/l2fwd-cat/meson.build > +++ b/examples/l2fwd-cat/meson.build > @@ -6,6 +6,7 @@ > # To build this example as a standalone application with an already-inst= alled > # DPDK instance, use 'make' >=20 > +allow_experimental_apis =3D true > pqos =3D cc.find_library('pqos', required: false) build =3D pqos.found(= ) ext_deps > +=3D pqos > -- > 2.20.1