From patchwork Tue Jul 29 03:57:07 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anish Bhatt X-Patchwork-Id: 374345 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id AC7C3140108 for ; Tue, 29 Jul 2014 13:57:46 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752528AbaG2D5k (ORCPT ); Mon, 28 Jul 2014 23:57:40 -0400 Received: from 99-65-72-227.uvs.sntcca.sbcglobal.net ([99.65.72.227]:46422 "EHLO stargate3.asicdesigners.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752223AbaG2D5k (ORCPT ); Mon, 28 Jul 2014 23:57:40 -0400 Received: from cerveza.asicdesigners.com (cerveza.asicdesigners.com [10.192.164.225]) by stargate3.asicdesigners.com (8.13.8/8.13.8) with ESMTP id s6T3vUuK004118; Mon, 28 Jul 2014 20:57:30 -0700 From: Anish Bhatt To: netdev@vger.kernel.org Cc: davem@davemloft.net, john.fastabend@gmail.com, Anish Bhatt Subject: [PATCH net-next] dcbnl : Fix misleading dcb_app->priority explanation Date: Mon, 28 Jul 2014 20:57:07 -0700 Message-Id: <1406606227-22776-1-git-send-email-anish@chelsio.com> X-Mailer: git-send-email 2.0.3 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Current explanation of dcb_app->priority is wrong. It says priority is expected to be a 3-bit unsigned integer which is only true when working with DCBx-IEEE. Use of dcb_app->priority by DCBx-CEE expects it to be 802.1p user priority bitmap. Updated accordingly This affects the cxgb4 driver, but I will post those changes as part of a larger changeset shortly. Fixes: 3e29027af4372 ("dcbnl: add support for ieee8021Qaz attributes") Signed-off-by: Anish Bhatt Acked-by: John Fastabend --- include/uapi/linux/dcbnl.h | 3 ++- net/dcb/dcbnl.c | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/include/uapi/linux/dcbnl.h b/include/uapi/linux/dcbnl.h index 6bb43382f3f3..e711f20dc522 100644 --- a/include/uapi/linux/dcbnl.h +++ b/include/uapi/linux/dcbnl.h @@ -148,7 +148,8 @@ struct cee_pfc { * * @selector: protocol identifier type * @protocol: protocol of type indicated - * @priority: 3-bit unsigned integer indicating priority + * @priority: 3-bit unsigned integer indicating priority for IEEE + * 8-bit 802.1p user priority bitmap for CEE * * ---- * Selector field values diff --git a/net/dcb/dcbnl.c b/net/dcb/dcbnl.c index c34af7a1d2d4..ca11d283bbeb 100644 --- a/net/dcb/dcbnl.c +++ b/net/dcb/dcbnl.c @@ -1776,7 +1776,7 @@ EXPORT_SYMBOL(dcb_getapp); * * Priority 0 is an invalid priority in CEE spec. This routine * removes applications from the app list if the priority is - * set to zero. + * set to zero. Priority is expected to be 8-bit 802.1p user priority bitmap */ int dcb_setapp(struct net_device *dev, struct dcb_app *new) { @@ -1837,7 +1837,8 @@ EXPORT_SYMBOL(dcb_ieee_getapp_mask); * * This adds Application data to the list. Multiple application * entries may exists for the same selector and protocol as long - * as the priorities are different. + * as the priorities are different. Priority is expected to be a + * 3-bit unsigned integer */ int dcb_ieee_setapp(struct net_device *dev, struct dcb_app *new) {