public inbox for dev@dpdk.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Soumyadeep Hore <soumyadeep.hore@intel.com>
Cc: dev@dpdk.org, bruce.richardson@intel.com,
	rajesh3.kumar@intel.com, aman.deep.singh@intel.com,
	manoj.kumar.subbarao@intel.com
Subject: Re: [PATCH v2 0/4] Enable PTP feature for MEV
Date: Tue, 20 Jan 2026 06:56:35 -0800	[thread overview]
Message-ID: <20260120065635.0d1de928@phoenix.local> (raw)
In-Reply-To: <20251028060758.233929-1-soumyadeep.hore@intel.com>

On Tue, 28 Oct 2025 02:07:54 -0400
Soumyadeep Hore <soumyadeep.hore@intel.com> wrote:

> Enabling basic PTP feature in IDPF PMD using virtchnl messages.
> 
> ---
> v2:
> - Fixed essential checkpatch warnings
> ---
> Milena Olech (1):
>   net/idpf: add a new API for PTP support
> 
> Soumyadeep Hore (3):
>   net/idpf: add PTP virtchnl2 support
>   net/intel: add support for Precision Time Protocol
>   doc: add PTP IDPF documentation
> 
>  doc/guides/nics/idpf.rst                      |  16 +
>  drivers/net/intel/common/tx.h                 |   1 +
>  drivers/net/intel/idpf/base/virtchnl2.h       | 324 ++++++---
>  drivers/net/intel/idpf/idpf_common_device.h   |   4 +
>  drivers/net/intel/idpf/idpf_common_rxtx.c     | 186 +++--
>  drivers/net/intel/idpf/idpf_common_rxtx.h     |  10 +
>  drivers/net/intel/idpf/idpf_common_virtchnl.c |  34 +-
>  drivers/net/intel/idpf/idpf_ethdev.c          | 275 ++++++++
>  drivers/net/intel/idpf/idpf_ptp.c             | 646 ++++++++++++++++++
>  drivers/net/intel/idpf/idpf_ptp.h             | 227 ++++++
>  drivers/net/intel/idpf/meson.build            |   1 +
>  11 files changed, 1562 insertions(+), 162 deletions(-)
>  create mode 100644 drivers/net/intel/idpf/idpf_ptp.c
>  create mode 100644 drivers/net/intel/idpf/idpf_ptp.h
> 

Lots more issues found by automated patch review


## DPDK Patch Review: PTP Support for IDPF Driver (v4)

**Series:** [PATCH v4 1-4/4] PTP support for IDPF  
**Submitter:** Soumyadeep Hore

---

### Summary

This 4-patch series adds Precision Time Protocol (PTP) support to the IDPF driver, including virtchnl2 API definitions, mailbox message handling, timesync ethdev operations, and documentation.

---

### Patch 1/4: `net/idpf: add a new API for PTP support`

**Commit Message:**
- ✅ Subject line 39 chars (≤60)
- ✅ Lowercase after colon
- ✅ Correct prefix `net/idpf:`
- ✅ No trailing period
- ✅ Has two Signed-off-by tags in correct order

**Code Issues:**
- ✅ This is base code in `drivers/net/intel/idpf/base/` which may use different conventions per AGENTS.md exception for base directories

---

### Patch 2/4: `net/idpf: add PTP virtchnl2 support`

**Commit Message:**
- ✅ Subject line 37 chars (≤60)  
- ✅ Imperative mood, lowercase, no period
- ✅ Has Signed-off-by

**License (SPDX):**
- ✅ `idpf_ptp.c` and `idpf_ptp.h` have proper SPDX-License-Identifier: BSD-3-Clause
- ⚠️ **Warning:** Copyright dates `2001-2025` seem incorrect—IDPF is relatively recent technology

**Code Style Issues:**

| Severity | Location | Issue |
|----------|----------|-------|
| Warning | `idpf_ptp.c:762` | Unnecessary initialization: `int err = 0;` is assigned before use |
| Warning | `idpf_ptp.c:916,983,1013,1044` | Multiple unnecessary `int err = 0;` initializations |
| Warning | `idpf_ptp.h:1327` | `#include "rte_time.h"` should be `<rte_time.h>` for DPDK system headers |
| Warning | `idpf_ptp.h:1340-1388` | Mixed comment styles: some use `/* struct` (missing `@`), others use proper `/**` Doxygen |
| Warning | `idpf_ptp.h:1481-1486` | Bitfield syntax `:2` and `:6` on enum—may have portability concerns |
| Warning | Multiple | Implicit NULL comparisons (`if (!ptr)`) instead of explicit `if (ptr == NULL)` |

**Potential Bug:**
```c
// idpf_ptp.c:779-791
recv_ptp_caps_msg = rte_zmalloc(NULL, sizeof(struct virtchnl2_ptp_get_caps), 0);
...
recv_ptp_caps_msg = (struct virtchnl2_ptp_get_caps *)args.out_buffer;
```
⚠️ **Memory leak:** The originally allocated `recv_ptp_caps_msg` at line 779 is overwritten at line 791, leaking memory. The `free_mem` label at line 879 frees `args.out_buffer`, not the original allocation.

---

### Patch 3/4: `net/intel: add support for Precision Time Protocol`

**Commit Message:**
- ⚠️ **Warning:** Subject uses "Precision Time Protocol" — should be lowercase `precision time protocol` or abbreviated as `PTP` per case sensitivity rules
- ⚠️ **Warning:** Prefix `net/intel:` is generic—the changes are specifically in `idpf`, not all Intel drivers
- ✅ Has Signed-off-by

**Code Style Issues:**

| Severity | Location | Issue |
|----------|----------|-------|
| Error | `idpf_ethdev.c:2983` | `#include <math.h>` and use of `log2()` function—requires libm linkage, non-standard for DPDK |
| Error | `idpf_ethdev.c:2181` | `log2(incval) + log2(ppm)` — should use DPDK's `rte_log2_u64()` or similar |
| Warning | `idpf_ptp.h:1524` | Indentation uses spaces instead of tabs (hard tabs required per AGENTS.md) |
| Warning | `idpf_common_rxtx.c:1201-1202` | Poor alignment and excessive whitespace in assignment |
| Warning | `idpf_ethdev.c:2007,2217,2233` | Unnecessary `int ret = 0;` initializations |
| Warning | `idpf_ethdev.c:2066-2075` | Control flow issue: success path falls through to `err_ptp:` label |
| Warning | `idpf_ethdev.c:2097-2098` | Inconsistent parameter alignment in function signature |
| Info | `idpf_common_rxtx.h:1954-1958` | `FIELD_PREP` macro—consider if this should be shared or already exists in DPDK |

**Functional Concerns:**

1. **Scope:** Patch modifies `drivers/net/intel/common/tx.h` adding `latch_idx` to `ci_tx_queue`—this affects the common Intel driver structure, not just IDPF.

2. **Error handling in `idpf_timesync_enable()`:**
   ```c
   err_ptp:
       if (ret != 0) {
           rte_free(adapter->ptp);
           adapter->ptp = NULL;
       }
       return ret;
   ```
   On success, control still reaches this label but doesn't clean up partial state if later operations fail.

3. **Division in hot path:** Lines 1733, 1839, 1889 compute `rte_get_timer_cycles() / (rte_get_timer_hz() / 1000)` in the receive path—this division could be precomputed.

---

### Patch 4/4: `doc: add PTP IDPF documentation`

**Commit Message:**
- ⚠️ **Error:** Body starts with "Updated" (past tense)—should use imperative mood: "Update"
- ⚠️ **Warning:** Prefix `doc:` is too generic—should be `doc/guides/nics:` or similar
- ✅ Subject line 32 chars (≤60)
- ✅ Has Signed-off-by

**Documentation Completeness:**
- ❌ **Missing:** Release notes entry in `doc/guides/rel_notes/` (required per AGENTS.md for new features)
- ❌ **Missing:** Update to `doc/guides/nics/features/idpf.ini` feature matrix (required per AGENTS.md)

**Content:**
- ✅ Documentation matches the implementation
- ⚠️ "Synchronisation" uses British spelling—DPDK typically uses American English

---

### Overall Assessment

**Errors (must fix):**
1. Memory leak in `idpf_ptp_get_caps()` 
2. Use of `<math.h>` and `log2()` function—should use DPDK equivalents
3. Commit message body starts with past tense "Updated" (patch 4)
4. Missing release notes for new feature
5. Missing feature matrix update in `doc/guides/nics/features/`

**Warnings (should fix):**
1. Multiple unnecessary variable initializations (`int err = 0;`)
2. Implicit NULL/zero comparisons instead of explicit
3. Inconsistent include style (`"rte_time.h"` vs `<rte_time.h>`)
4. Copyright year range `2001-2025` seems incorrect
5. Mixed indentation (spaces vs tabs) in idpf_ptp.h
6. Subject case for "Precision Time Protocol" 
7. Generic commit prefixes (`net/intel:`, `doc:`)
8. Division operation in Rx hot path could be optimized

**Info:**
1. `FIELD_PREP` macro added—verify this doesn't duplicate existing DPDK functionality
2. Patch 3 modifies common Intel tx.h—ensure other Intel drivers aren't affected

      parent reply	other threads:[~2026-01-20 14:56 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-24 12:08 [PATCH v1 0/4] Enable PTP feature for MEV Soumyadeep Hore
2025-10-24 12:08 ` [PATCH v1 1/4] net/idpf: add a new API for PTP support Soumyadeep Hore
2025-10-24 12:08 ` [PATCH v1 2/4] net/idpf: add PTP virtchnl2 support Soumyadeep Hore
2025-10-24 12:08 ` [PATCH v1 3/4] net/intel: add support for Precision Time Protocol Soumyadeep Hore
2025-10-24 12:08 ` [PATCH v1 4/4] doc: add PTP IDPF documentation Soumyadeep Hore
2025-10-24 16:28   ` Stephen Hemminger
2025-10-28  6:07   ` [PATCH v2 0/4] Enable PTP feature for MEV Soumyadeep Hore
2025-10-28  6:07     ` [PATCH v2 1/4] net/idpf: add a new API for PTP support Soumyadeep Hore
2025-10-28  6:07     ` [PATCH v2 2/4] net/idpf: add PTP virtchnl2 support Soumyadeep Hore
2025-10-28  6:07     ` [PATCH v2 3/4] net/intel: add support for Precision Time Protocol Soumyadeep Hore
2025-10-28  6:07     ` [PATCH v2 4/4] doc: add PTP IDPF documentation Soumyadeep Hore
2025-10-30  9:41       ` Bruce Richardson
2026-01-20 14:34       ` Stephen Hemminger
2025-11-03 16:06     ` [PATCH v3 0/4] Enable PTP feature for MEV Soumyadeep Hore
2025-11-03 16:06       ` [PATCH v3 1/4] net/idpf: add a new API for PTP support Soumyadeep Hore
2025-11-03 16:06       ` [PATCH v3 2/4] net/idpf: add PTP virtchnl2 support Soumyadeep Hore
2025-11-03 16:06       ` [PATCH v3 3/4] net/intel: add support for Precision Time Protocol Soumyadeep Hore
2025-12-16 12:43         ` Bruce Richardson
2025-11-03 16:06       ` [PATCH v3 4/4] doc: add PTP IDPF documentation Soumyadeep Hore
2026-01-20 19:11       ` [PATCH v4 0/4] Enable PTP feature for MEV Soumyadeep Hore
2026-01-20 19:11         ` [PATCH v4 1/4] net/idpf: add a new API for PTP support Soumyadeep Hore
2026-01-20 19:11         ` [PATCH v4 2/4] net/idpf: add PTP virtchnl2 support Soumyadeep Hore
2026-01-20 19:11         ` [PATCH v4 3/4] net/intel: add support for Precision Time Protocol Soumyadeep Hore
2026-01-23  0:04           ` [PATCH v5 0/4] Enable PTP feature for MEV Soumyadeep Hore
2026-01-22 23:40             ` Stephen Hemminger
2026-01-23  0:04             ` [PATCH v5 1/4] net/idpf: add a new API for PTP support Soumyadeep Hore
2026-02-03 11:56               ` Bruce Richardson
2026-01-23  0:04             ` [PATCH v5 2/4] net/idpf: add PTP virtchnl2 support Soumyadeep Hore
2026-02-03 12:52               ` Bruce Richardson
2026-02-14  7:10                 ` Hore, Soumyadeep
2026-02-14 19:49               ` [PATCH v6 0/4] Enable PTP feature for MEV Soumyadeep Hore
2026-02-14 19:49                 ` [PATCH v6 1/4] net/idpf/base: add a new API for PTP support Soumyadeep Hore
2026-02-26  9:57                   ` Kumar, Rajesh3
2026-02-14 19:49                 ` [PATCH v6 2/4] net/idpf: add PTP virtchnl2 support Soumyadeep Hore
2026-02-26 10:15                   ` Kumar, Rajesh3
2026-02-26 11:12                     ` Hore, Soumyadeep
2026-02-14 19:49                 ` [PATCH v6 3/4] net/idpf: add timesync support Soumyadeep Hore
2026-02-26 10:32                   ` Kumar, Rajesh3
2026-02-14 19:49                 ` [PATCH v6 4/4] doc/guides: add PTP IDPF documentation Soumyadeep Hore
2026-02-26 10:39                   ` Kumar, Rajesh3
2026-02-27  0:33                   ` [PATCH v7 0/4] Enable PTP feature for MEV Soumyadeep Hore
2026-02-27  0:33                     ` [PATCH v7 1/4] net/idpf/base: add a new API for PTP support Soumyadeep Hore
2026-02-27  0:33                     ` [PATCH v7 2/4] net/idpf: add PTP virtchnl2 support Soumyadeep Hore
2026-02-26 12:00                       ` Kumar, Rajesh3
2026-02-27  0:33                     ` [PATCH v7 3/4] net/idpf: add timesync support Soumyadeep Hore
2026-02-27  0:33                     ` [PATCH v7 4/4] doc/guides: add PTP IDPF documentation Soumyadeep Hore
2026-03-01  9:10                       ` [PATCH v8 0/4] Enable PTP feature for MEV Soumyadeep Hore
2026-03-01  9:10                         ` [PATCH v8 1/4] net/idpf/base: add a new API for PTP support Soumyadeep Hore
2026-03-01  9:10                         ` [PATCH v8 2/4] net/idpf: add PTP virtchnl2 support Soumyadeep Hore
2026-03-01  9:10                         ` [PATCH v8 3/4] net/idpf: add timesync support Soumyadeep Hore
2026-03-01  9:10                         ` [PATCH v8 4/4] doc/guides: add PTP IDPF documentation Soumyadeep Hore
2026-03-02 11:19                         ` [PATCH v8 0/4] Enable PTP feature for MEV Bruce Richardson
2026-01-23  0:04             ` [PATCH v5 3/4] net/intel: add support for PTP Soumyadeep Hore
2026-02-03 15:37               ` Bruce Richardson
2026-01-23  0:04             ` [PATCH v5 4/4] doc: add PTP IDPF documentation Soumyadeep Hore
2026-01-20 19:11         ` [PATCH v4 " Soumyadeep Hore
2026-01-20 14:56     ` Stephen Hemminger [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260120065635.0d1de928@phoenix.local \
    --to=stephen@networkplumber.org \
    --cc=aman.deep.singh@intel.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=manoj.kumar.subbarao@intel.com \
    --cc=rajesh3.kumar@intel.com \
    --cc=soumyadeep.hore@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox