From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8DDAFA04A2; Thu, 3 Mar 2022 18:35:37 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 25B4C42719; Thu, 3 Mar 2022 18:35:37 +0100 (CET) Received: from mail-io1-f54.google.com (mail-io1-f54.google.com [209.85.166.54]) by mails.dpdk.org (Postfix) with ESMTP id E908440687 for ; Thu, 3 Mar 2022 18:35:35 +0100 (CET) Received: by mail-io1-f54.google.com with SMTP id 195so6716523iou.0 for ; Thu, 03 Mar 2022 09:35:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=SRhqONT4MjfV3lWhV9oy6+BNRveLQc9Cc74ivl3jgaQ=; b=C8yMKPxnIZMCh+aUtQIn1i9w5/7MwsfBAKSyoGFDysb3sgOjiG8l7TlNVQeV+P4FzI CiqucHNRTfqba45A2PX7e+PlB81kNtqBDCq1HX5InqtyC5BnKdDEox1+5dq5mmMR5gsV JBlvKiklBqIanM+lLXnLJfRQ5qSBat7dMyUG7yuFTDxkywT57mtjT/N+4aUklIJIMbMy ZXsn4/83/sn4wo8zScAL1iI0on847Fmw2Trks+rMulsRits6U1PNQPpV0rc4EeR0JJcv 673eubY9x20IvG/NtZu4vyMZ5th9nUCXedRky5E8Nan0kf2cenFZdlC9pPPy+bteAs70 /wVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=SRhqONT4MjfV3lWhV9oy6+BNRveLQc9Cc74ivl3jgaQ=; b=ge9cu1tU0H5ytUZiuLYNgC7+ebYiyRKuod/KvweEhHK8LdrHkGp8ZrC+1SnG4aO2/n azxuge6/fIcHUiV6YpC6h8UQlWVTW1gRXcgZXBdxt2k1Rjtekx700ZUwlH/FRU+LqYlN XIAUSIZkzZxM4D1o1CFnB/3VuRzpmK7I1FLOGqPbqHmgUtF8FhH9PpTf2ICvTfXQPfCs /j1fquViH90dD0p9Rjas+QEHpxa+hSonsFFk9KHYK1iJhkxKzAU4bRqjwVVSpLHc6RJC lsclZf6KSe48mnV/EZGi1dNoW6ztYSiCU4oNWYbYJ0Pg1MmJPKFb4MgUsWATzWZg4sD/ m3RA== X-Gm-Message-State: AOAM533KA1/06Jfa4pMkixhNU7ujKNNe3bIFyGRJVp8/fypd5wAvY6cV ROiIqWe0QjUaQwtuFvZpySkAQlWOGGYefSHnca8= X-Google-Smtp-Source: ABdhPJxdrP1JEkksI19sIC0O2ICvw0E8QEUTZLAEmvOY05BqZV58NY+isYoUhItff8g6wjDBLTl+31bBUrBRWdQznhs= X-Received: by 2002:a02:69c2:0:b0:311:b65e:388b with SMTP id e185-20020a0269c2000000b00311b65e388bmr30101890jac.123.1646328935258; Thu, 03 Mar 2022 09:35:35 -0800 (PST) MIME-Version: 1.0 References: <20220303070042.29075-1-ndabilpuram@marvell.com> <20220303070042.29075-2-ndabilpuram@marvell.com> In-Reply-To: <20220303070042.29075-2-ndabilpuram@marvell.com> From: Jerin Jacob Date: Thu, 3 Mar 2022 23:05:09 +0530 Message-ID: Subject: Re: [PATCH 2/2] common/cnxk: fix VF data offset To: Nithin Dabilpuram Cc: Jerin Jacob , Kiran Kumar K , Sunil Kumar Kori , Satha Rao , Ray Kinsella , dpdk-dev , Harman Kalra Content-Type: text/plain; charset="UTF-8" X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Thu, Mar 3, 2022 at 12:31 PM Nithin Dabilpuram wrote: > > From: Harman Kalra > > Data offset should be adjusted for VF to skip extra 8 bytes of timestamp, > if its PF has PTP enabled. > > Fixes: c443e0d326e1 ("common/cnxk: support NIX PTP") > Cc: skori@marvell.com > > Signed-off-by: Harman Kalra Acked-by: Jerin Jacob Updated the git commit as follows and applied to dpdk-next-net-mrvl/for-next-net. Thanks common/cnxk: fix mbuf data offset for VF If PF has PTP enabled the data offset should be adjusted for VF to skip extra 8 bytes of timestamp as the MAC inserts 8 bytes before the ethernet header. Fixes: c443e0d326e1 ("common/cnxk: support NIX PTP") Cc: stable@dpdk.org Signed-off-by: Harman Kalra Acked-by: Jerin Jacob > --- > drivers/common/cnxk/roc_nix.h | 1 + > drivers/common/cnxk/roc_nix_ptp.c | 8 ++++++++ > drivers/common/cnxk/version.map | 1 + > drivers/net/cnxk/cnxk_ethdev.c | 4 ++++ > 4 files changed, 14 insertions(+) > > diff --git a/drivers/common/cnxk/roc_nix.h b/drivers/common/cnxk/roc_nix.h > index 5e6eb58..dbb816d 100644 > --- a/drivers/common/cnxk/roc_nix.h > +++ b/drivers/common/cnxk/roc_nix.h > @@ -864,6 +864,7 @@ int __roc_api roc_nix_ptp_sync_time_adjust(struct roc_nix *roc_nix, > int __roc_api roc_nix_ptp_info_cb_register(struct roc_nix *roc_nix, > ptp_info_update_t ptp_update); > void __roc_api roc_nix_ptp_info_cb_unregister(struct roc_nix *roc_nix); > +bool __roc_api roc_nix_ptp_is_enable(struct roc_nix *roc_nix); > > /* VLAN */ > int __roc_api > diff --git a/drivers/common/cnxk/roc_nix_ptp.c b/drivers/common/cnxk/roc_nix_ptp.c > index 03c4c6e..05e4211 100644 > --- a/drivers/common/cnxk/roc_nix_ptp.c > +++ b/drivers/common/cnxk/roc_nix_ptp.c > @@ -120,3 +120,11 @@ roc_nix_ptp_info_cb_unregister(struct roc_nix *roc_nix) > > dev->ops->ptp_info_update = NULL; > } > + > +bool > +roc_nix_ptp_is_enable(struct roc_nix *roc_nix) > +{ > + struct nix *nix = roc_nix_to_nix_priv(roc_nix); > + > + return nix->ptp_en; > +} > diff --git a/drivers/common/cnxk/version.map b/drivers/common/cnxk/version.map > index d346e6f..2a122e5 100644 > --- a/drivers/common/cnxk/version.map > +++ b/drivers/common/cnxk/version.map > @@ -206,6 +206,7 @@ INTERNAL { > roc_nix_ptp_clock_read; > roc_nix_ptp_info_cb_register; > roc_nix_ptp_info_cb_unregister; > + roc_nix_ptp_is_enable; > roc_nix_ptp_rx_ena_dis; > roc_nix_ptp_sync_time_adjust; > roc_nix_ptp_tx_ena_dis; > diff --git a/drivers/net/cnxk/cnxk_ethdev.c b/drivers/net/cnxk/cnxk_ethdev.c > index deb95ae..1fa4131 100644 > --- a/drivers/net/cnxk/cnxk_ethdev.c > +++ b/drivers/net/cnxk/cnxk_ethdev.c > @@ -1123,6 +1123,10 @@ cnxk_nix_configure(struct rte_eth_dev *eth_dev) > goto fail_configure; > } > > + /* Check if ptp is enable in PF owning this VF*/ > + if (!roc_nix_is_pf(nix) && (!roc_nix_is_sdp(nix))) > + dev->ptp_en = roc_nix_ptp_is_enable(nix); > + > dev->npc.channel = roc_nix_get_base_chan(nix); > > nb_rxq = data->nb_rx_queues; > -- > 2.8.4 >