DPDK patches and discussions
 help / color / mirror / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download: 
* [dpdk-dev] [PATCH v10 2/3] devtools: script to send notifications of expired symbols
    2021-08-31 14:50  5%   ` [dpdk-dev] [PATCH v10 1/3] devtools: script to track symbols over releases Ray Kinsella
@ 2021-08-31 14:50  5%   ` Ray Kinsella
  2021-09-01 12:46  0%     ` Aaron Conole
  2021-09-01 13:01  5%     ` David Marchand
  2021-08-31 14:50 17%   ` [dpdk-dev] [PATCH v10 3/3] maintainers: add new abi scripts Ray Kinsella
  2021-09-01 12:31  0%   ` [dpdk-dev] [PATCH v10 0/3] devtools: scripts to count and track symbols Aaron Conole
  3 siblings, 2 replies; 200+ results
From: Ray Kinsella @ 2021-08-31 14:50 UTC (permalink / raw)
  To: dev
  Cc: bruce.richardson, stephen, ferruh.yigit, thomas, ktraynor, mdr, aconole

Use this script with the output of the DPDK symbol tool, to notify
maintainers of expired symbols by email. You need to define the environment
variable DPDK_GETMAINTAINER_PATH for this tool to work.

Use terminal output to review the emails before sending.
e.g.
$ devtools/symbol-tool.py list-expired --format-output csv \
| DPDK_GETMAINTAINER_PATH=<somewhere>/get_maintainer.pl \
devtools/notify_expired_symbols.py --format-output terminal

Then use email output to send the emails to the maintainers.
e.g.
$ devtools/symbol-tool.py list-expired --format-output csv \
| DPDK_GETMAINTAINER_PATH=<somewhere>/get_maintainer.pl \
devtools/notify_expired_symbols.py --format-output email \
--smtp-server <server> --sender <someone@somewhere.com> \
--password <password> --cc <someone@somewhere.com>

Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
---
 devtools/notify-symbol-maintainers.py | 256 ++++++++++++++++++++++++++
 1 file changed, 256 insertions(+)
 create mode 100755 devtools/notify-symbol-maintainers.py

diff --git a/devtools/notify-symbol-maintainers.py b/devtools/notify-symbol-maintainers.py
new file mode 100755
index 0000000000..ee554687ff
--- /dev/null
+++ b/devtools/notify-symbol-maintainers.py
@@ -0,0 +1,256 @@
+#!/usr/bin/env python3
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2021 Intel Corporation
+# pylint: disable=invalid-name
+'''Tool to notify maintainers of expired symbols'''
+import smtplib
+import ssl
+import sys
+import subprocess
+import argparse
+from argparse import RawTextHelpFormatter
+import time
+from email.message import EmailMessage
+
+DESCRIPTION = '''
+Use this script with the output of the DPDK symbol tool, to notify maintainers
+and contributors of expired symbols by email. You need to define the environment
+variable DPDK_GETMAINTAINER_PATH for this tool to work.
+
+Use terminal output to review the emails before sending.
+e.g.
+$ devtools/symbol-tool.py list-expired --format-output csv \\
+| DPDK_GETMAINTAINER_PATH=<somewhere>/get_maintainer.pl \\
+{s} --format-output terminal
+
+Then use email output to send the emails to the maintainers.
+e.g.
+$ devtools/symbol-tool.py list-expired --format-output csv \\
+| DPDK_GETMAINTAINER_PATH=<somewhere>/get_maintainer.pl \\
+{s} --format-output email \\
+--smtp-server <server> --sender <someone@somewhere.com> --password <password> \\
+--cc <someone@somewhere.com>
+'''
+
+EMAIL_TEMPLATE = '''Hi there,
+
+Please note the symbols listed below have expired. In line with the DPDK ABI
+policy, they should be scheduled for removal, in the next DPDK release.
+
+For more information, please see the DPDK ABI Policy, section 3.5.3.
+https://doc.dpdk.org/guides/contributing/abi_policy.html
+
+Thanks,
+
+The DPDK Symbol Bot
+
+'''
+
+ABI_POLICY = 'doc/guides/contributing/abi_policy.rst'
+MAINTAINERS = 'MAINTAINERS'
+get_maintainer = ['devtools/get-maintainer.sh', \
+                  '--email', '-f']
+
+def _get_maintainers(libpath):
+    '''Get the maintainers for given library'''
+    try:
+        cmd = get_maintainer + [libpath]
+        result = subprocess.run(cmd, \
+                                stdout=subprocess.PIPE, \
+                                stderr=subprocess.PIPE,
+                                check=True)
+    except subprocess.CalledProcessError:
+        return None
+
+    if result is None:
+        return None
+
+    email = result.stdout.decode('utf-8')
+    if email == '':
+        return None
+
+    email = list(filter(None,email.split('\n')))
+    return email
+
+default_maintainers = _get_maintainers(ABI_POLICY) + \
+    _get_maintainers(MAINTAINERS)
+
+def get_maintainers(libpath):
+    '''Get the maintainers for given library'''
+    maintainers=_get_maintainers(libpath)
+
+    if maintainers is None:
+        maintainers = default_maintainers
+
+    return maintainers
+
+def get_message(library, symbols, config):
+    '''Build email message from symbols, config and maintainers'''
+    contributors = {}
+    message = {}
+    maintainers = get_maintainers(library)
+
+    if maintainers != default_maintainers:
+        message['CC'] = default_maintainers.copy()
+
+    if 'CC' in config:
+        message.setdefault('CC',[]).append(config['CC'])
+
+    message['Subject'] = 'Expired symbols in {}\n'.format(library)
+
+    body = EMAIL_TEMPLATE
+    body += '{:<50}{:<25}{:<25}\n'.format('Symbol','Contributor','Email')
+    for sym in symbols:
+        body += ('{:<50}{:<25}{:<25}\n'.format(sym,\
+                                               symbols[sym]['name'],
+                                               symbols[sym]['email'],
+        ))
+        email = symbols[sym]['email']
+        contributors[email] = ''
+
+    contributors = list(contributors.keys())
+
+    message['To'] = maintainers + contributors
+    message['Body'] = body
+
+    return message
+
+class OutputEmail():
+    '''Format the output for email'''
+    def __init__(self, config):
+        self.config = config
+
+        self.terminal = OutputTerminal(config)
+        context = ssl.create_default_context()
+
+        # Try to log in to server and send email
+        try:
+            self.server = smtplib.SMTP(config['smtp_server'], 587)
+            self.server.starttls(context=context) # Secure the connection
+            self.server.login(config['sender'], config['password'])
+        except Exception as exception:
+            print(exception)
+            raise exception
+
+    def message(self,message):
+        '''send email'''
+        self.terminal.message(message)
+
+        msg = EmailMessage()
+        msg.set_content(message.pop('Body'))
+
+        for key in message.keys():
+            msg[key] = message[key]
+
+        msg['From'] = self.config['sender']
+        msg['Reply-To'] = 'no-reply@dpdk.org'
+
+        self.server.send_message(msg)
+
+        time.sleep(1)
+
+    def __del__(self):
+        self.server.quit()
+
+class OutputTerminal(): # pylint: disable=too-few-public-methods
+    '''Format the output for the terminal'''
+    def __init__(self, config):
+        self.config = config
+
+    def message(self,message):
+        '''Print email to terminal'''
+
+        terminal = 'To:' + ', '.join(message['To']) + '\n'
+        if 'sender' in self.config.keys():
+            terminal += 'From:' + self.config['sender'] + '\n'
+
+        terminal += 'Reply-To:' + 'no-reply@dpdk.org' + '\n'
+
+        if 'CC' in message:
+            terminal += 'CC:' + ', '.join(message['CC']) + '\n'
+
+        terminal += 'Subject:' + message['Subject'] + '\n'
+        terminal += 'Body:' + message['Body'] + '\n'
+
+        print(terminal)
+        print('-' * 80)
+
+def parse_config(args):
+    '''put the command line args in the right places'''
+    config = {}
+    error_msg = None
+
+    outputs = {
+        None : OutputTerminal,
+        'terminal' : OutputTerminal,
+        'email' : OutputEmail
+    }
+
+    if args.format_output == 'email':
+        if args.smtp_server is None:
+            error_msg = 'SMTP server'
+        else:
+            config['smtp_server'] = args.smtp_server
+
+        if args.sender is None:
+            error_msg = 'sender'
+        else:
+            config['sender'] = args.sender
+
+        if args.password is None:
+            error_msg = 'password'
+        else:
+            config['password'] = args.password
+
+    if args.cc is not None:
+        config['CC'] = args.cc
+
+    if error_msg is not None:
+        print('Please specify a {} for email output'.format(error_msg))
+        return None
+
+    config['output'] = outputs[args.format_output]
+    return config
+
+def main():
+    '''Main entry point'''
+    parser = argparse.ArgumentParser(description=DESCRIPTION.format(s=__file__), \
+                                     formatter_class=RawTextHelpFormatter)
+    parser.add_argument('--format-output', choices=['terminal','email'], \
+                        default='terminal')
+    parser.add_argument('--smtp-server')
+    parser.add_argument('--password')
+    parser.add_argument('--sender')
+    parser.add_argument('--cc')
+
+    args = parser.parse_args()
+    config = parse_config(args)
+    if config is None:
+        return
+
+    symbols = {}
+    lastlib = library = ''
+
+    output = config['output'](config)
+
+    for line in sys.stdin:
+        line = line.rstrip('\n')
+
+        if line.find('mapfile') >= 0:
+            continue
+        library, symbol, name, email = line.split(',')
+
+        if library != lastlib:
+            message = get_message(lastlib, symbols, config)
+            output.message(message)
+            symbols = {}
+
+        lastlib = library
+        symbols[symbol] = {'name' : name, 'email' : email}
+
+    #print the last library
+    message = get_message(lastlib, symbols, config)
+    output.message(message)
+
+if __name__ == '__main__':
+    main()
-- 
2.26.2


^ permalink raw reply	[relevance 5%]

* [dpdk-dev] [PATCH v10 1/3] devtools: script to track symbols over releases
  @ 2021-08-31 14:50  5%   ` Ray Kinsella
  2021-08-31 14:50  5%   ` [dpdk-dev] [PATCH v10 2/3] devtools: script to send notifications of expired symbols Ray Kinsella
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 200+ results
From: Ray Kinsella @ 2021-08-31 14:50 UTC (permalink / raw)
  To: dev
  Cc: bruce.richardson, stephen, ferruh.yigit, thomas, ktraynor, mdr, aconole

This script tracks the growth of stable and experimental symbols
over releases since v19.11. The script has the ability to
count the added symbols between two dpdk releases, and to
list experimental symbols present in two dpdk releases
(expired symbols).

example usages:

Count symbols added since v19.11
$ devtools/symbol-tool.py count-symbols

Count symbols added since v20.11
$ devtools/symbol-tool.py count-symbols --releases v20.11,v21.05

List experimental symbols present in v20.11 and v21.05
$ devtools/symbol-tool.py list-expired --releases v20.11,v21.05

List experimental symbols in libraries only, present since v19.11
$ devtools/symbol-tool.py list-expired --directory lib

Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
---
 devtools/symbol-tool.py | 482 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 482 insertions(+)
 create mode 100755 devtools/symbol-tool.py

diff --git a/devtools/symbol-tool.py b/devtools/symbol-tool.py
new file mode 100755
index 0000000000..3d093a0802
--- /dev/null
+++ b/devtools/symbol-tool.py
@@ -0,0 +1,482 @@
+#!/usr/bin/env python3
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2021 Intel Corporation
+# pylint: disable=invalid-name
+'''Tool to count or list symbols in each DPDK release'''
+from pathlib import Path
+import sys
+import os
+import subprocess
+import argparse
+from argparse import RawTextHelpFormatter
+import re
+import datetime
+try:
+    from parsley import makeGrammar
+except ImportError:
+    print('This script uses the package Parsley to parse C Mapfiles.\n'
+          'This can be installed with \"pip install parsley".')
+    sys.exit()
+
+DESCRIPTION = '''
+This script tracks the growth of stable and experimental symbols
+over releases since v19.11. The script has the ability to
+count the added symbols between two dpdk releases, and to
+list experimental symbols present in two dpdk releases
+(expired symbols), including the name & email of the original contributor.
+
+example usages:
+
+Count symbols added since v19.11
+$ {s} count-symbols
+
+Count symbols added since v20.11
+$ {s} count-symbols --releases v20.11,v21.05
+
+List experimental symbols present in v20.11 and v21.05
+$ {s} list-expired --releases v20.11,v21.05
+
+List experimental symbols in libraries only, present since v19.11
+$ {s} list-expired --directory lib
+'''
+
+MAP_GRAMMAR = r"""
+
+ws = (' ' | '\r' | '\n' | '\t')*
+
+ABI_VER = ({})
+DPDK_VER = ('DPDK_' ABI_VER)
+ABI_NAME = ('INTERNAL' | 'EXPERIMENTAL' | DPDK_VER)
+comment = '#' (~'\n' anything)+ '\n'
+symbol = (~(';' | '}}' | '#') anything )+:c ';' -> ''.join(c)
+global = 'global:'
+local = 'local: *;'
+symbols = comment* symbol:s ws comment* -> s
+
+abi = (abi_section+):m -> dict(m)
+abi_section = (ws ABI_NAME:e ws '{{' ws global* (~local ws symbols)*:s ws local* ws '}}' ws DPDK_VER* ';' ws) -> (e,s)
+"""
+
+def get_abi_versions():
+    '''Returns a string of possible dpdk abi versions'''
+
+    year = datetime.date.today().year - 2000
+    tags = " |".join(['\'{}\''.format(i) \
+                     for i in reversed(range(21, year + 1)) ])
+    tags  = tags + ' | \'20.0.1\' | \'20.0\' | \'20\''
+
+    return tags
+
+def get_dpdk_releases():
+    '''Returns a list of dpdk release tags names  since v19.11'''
+
+    year = datetime.date.today().year - 2000
+    year_range = "|".join("{}".format(i) for i in range(19,year + 1))
+    pattern = re.compile(r'^\"v(' +  year_range + r')\.\d{2}\"$')
+
+    cmd = ['git', 'for-each-ref', '--sort=taggerdate', '--format', '"%(tag)"']
+    try:
+        result = subprocess.run(cmd, \
+                                stdout=subprocess.PIPE, \
+                                stderr=subprocess.PIPE,
+                                check=True)
+    except subprocess.CalledProcessError:
+        print("Failed to interogate git for release tags")
+        sys.exit()
+
+
+    tags = result.stdout.decode('utf-8').split('\n')
+
+    # find the non-rcs between now and v19.11
+    tags = [ tag.replace('\"','') \
+             for tag in reversed(tags) \
+             if pattern.match(tag) ][:-3]
+
+    return tags
+
+def fix_directory_name(path):
+    '''Prepend librte to the source directory name'''
+    mapfilepath1 = str(path.parent.name)
+    mapfilepath2 = str(path.parents[1])
+    mapfilepath = mapfilepath2 + '/librte_' + mapfilepath1
+
+    return mapfilepath
+
+def directory_renamed(path, rel):
+    '''Fix removal of the librte_ from the directory names'''
+
+    mapfilepath = fix_directory_name(path)
+    tagfile = '{}:{}/{}'.format(rel, mapfilepath,  path.name)
+
+    try:
+        result = subprocess.run(['git', 'show', tagfile], \
+                                stdout=subprocess.PIPE, \
+                                stderr=subprocess.PIPE,
+                                check=True)
+    except subprocess.CalledProcessError:
+        result = None
+
+    return result
+
+def mapfile_renamed(path, rel):
+    '''Fix renaming of the map file'''
+    newfile = None
+
+    result = subprocess.run(['git', 'ls-tree', \
+                             rel, str(path.parent) + '/'], \
+                            stdout=subprocess.PIPE, \
+                            stderr=subprocess.PIPE,
+                            check=True)
+    dentries = result.stdout.decode('utf-8')
+    dentries = dentries.split('\n')
+
+    # filter entries looking for the map file
+    dentries = [dentry for dentry in dentries if dentry.endswith('.map')]
+    if len(dentries) > 1 or len(dentries) == 0:
+        return None
+
+    dparts = dentries[0].split('/')
+    newfile = dparts[len(dparts) - 1]
+
+    if newfile is not None:
+        tagfile = '{}:{}/{}'.format(rel, path.parent, newfile)
+
+        try:
+            result = subprocess.run(['git', 'show', tagfile], \
+                                    stdout=subprocess.PIPE, \
+                                    stderr=subprocess.PIPE,
+                                    check=True)
+        except subprocess.CalledProcessError:
+            result = None
+
+    else:
+        result = None
+
+    return result
+
+def mapfile_and_directory_renamed(path, rel):
+    '''Fix renaming of the map file & the source directory'''
+    mapfilepath = Path("{}/{}".format(fix_directory_name(path),path.name))
+
+    return mapfile_renamed(mapfilepath, rel)
+
+FIX_STRATEGIES = [directory_renamed, \
+                  mapfile_renamed, \
+                  mapfile_and_directory_renamed]
+
+def get_symbols(map_parser, release, mapfile_path):
+    '''Count the symbols for a given release and mapfile'''
+    abi_sections = {}
+
+    tagfile = '{}:{}'.format(release,mapfile_path)
+    try:
+        result = subprocess.run(['git', 'show', tagfile], \
+                                stdout=subprocess.PIPE, \
+                                stderr=subprocess.PIPE,
+                                check=True)
+    except subprocess.CalledProcessError:
+        result = None
+
+    for fix_strategy in FIX_STRATEGIES:
+        if result is not None:
+            break
+        result = fix_strategy(mapfile_path, release)
+
+    if result is not None:
+        mapfile = result.stdout.decode('utf-8')
+        abi_sections = map_parser(mapfile).abi()
+
+    return abi_sections
+
+def get_terminal_rows():
+    '''Find the number of rows in the terminal'''
+
+    try:
+        return os.get_terminal_size().lines
+    except IOError:
+        return 0
+
+class SymbolOwner():
+    '''Find the symbols original contributors name and email'''
+    symbol_regex = {}
+    blame_regex = {'name' : r'author\s(.*)', \
+                        'email' : r'author-mail\s<(.*)>'}
+
+    def __init__(self, libpath, symbol):
+        self.libpath = libpath
+        self.symbol = symbol
+
+        #find variable definitions in C files, and functions in headers.
+        self.symbol_regex = \
+            {'*.c' :  r'^(?!extern).*' + self.symbol + '[^()]*;', \
+             '*.h' : r'__rte_experimental(?:.*\n){0,2}.*' + self.symbol}
+
+    def find_symbol_location(self):
+        '''Find where the symbol is definited in the source'''
+        for key in self.symbol_regex:
+            for path in Path(self.libpath).rglob(key):
+                file_text = open(path).read()
+
+                #find where the symbol is defined, either preceeded by
+                #rte_experimental tag (functions) or followed by a ; (variables)
+
+                exp = self.symbol_regex[key]
+                pattern = re.compile(exp, re.MULTILINE)
+                search = pattern.search(file_text)
+
+                if search is not None:
+                    symbol_pos = search.span()[1]
+                    symbol_line = file_text.count('\n', 0, symbol_pos) + 1
+
+                    return [str(path),symbol_line]
+        return None
+
+    def find_symbol_owner(self):
+        '''Find the symbols original contributors name and email'''
+        owners = {}
+        location = self.find_symbol_location()
+
+        if location is None:
+            return None
+
+        line = '-L {},{}'.format(location[1],location[1])
+        #git blame -p(orcelain) -L(ine) path
+        args = ['-p', line, location[0]]
+
+        try:
+            result = subprocess.run(['git', 'blame'] + args, \
+                                stdout=subprocess.PIPE, \
+                                stderr=subprocess.PIPE,
+                                check=True)
+        except subprocess.CalledProcessError:
+            return None
+
+        blame = result.stdout.decode('utf-8')
+        for key in self.blame_regex:
+            pattern = re.compile(self.blame_regex[key], re.MULTILINE)
+            match = pattern.search(blame)
+
+            owners[key] = match.groups()[0]
+
+        return owners
+
+class SymbolCountOutput():
+    '''Format the output to supported formats'''
+    output_fmt = ""
+    column_fmt = ""
+
+    def __init__(self, format_output, dpdk_releases):
+        self.OUTPUT_FORMATS[format_output](self,dpdk_releases)
+        self.column_titles = ['mapfile'] +  dpdk_releases
+
+        self.terminal_rows = get_terminal_rows()
+        self.row = 0
+
+    def set_terminal_output(self,dpdk_rel):
+        '''Set the output format to Tabbed Separated Values'''
+
+        self.output_fmt = '{:<50}' + \
+            ''.join(['{:<6}{:<6}'] * (len(dpdk_rel)))
+        self.column_fmt = '{:50}' + \
+            ''.join(['{:<12}'] * (len(dpdk_rel)))
+
+    def set_csv_output(self,dpdk_rel):
+        '''Set the output format to Comma Separated Values'''
+
+        self.output_fmt = '{},' + \
+            ','.join(['{},{}'] * (len(dpdk_rel)))
+        self.column_fmt = '{},' + \
+            ','.join(['{},'] * (len(dpdk_rel)))
+
+    def print_columns(self):
+        '''Print column rows with release names'''
+        print(self.column_fmt.format(*self.column_titles))
+        self.row += 1
+
+    def print_row(self, mapfile, symbols):
+        '''Print row of symbol values'''
+        mapfile = str(mapfile)
+        print(self.output_fmt.format(*([mapfile] + symbols)))
+        self.row += 1
+
+        if((self.terminal_rows>0) and ((self.row % self.terminal_rows) == 0)):
+            self.print_columns()
+
+    OUTPUT_FORMATS = { None: set_terminal_output, \
+                   'terminal': set_terminal_output, \
+                   'csv': set_csv_output }
+
+class ListExpiredOutput():
+    '''Format the output to supported formats'''
+    output_fmt = ""
+    column_fmt = ""
+
+    def __init__(self, format_output, dpdk_releases):
+        self.terminal = True
+        self.OUTPUT_FORMATS[format_output](self,dpdk_releases)
+        self.column_titles = ['mapfile'] +  \
+            ['expired (' + ','.join(dpdk_releases) + ')'] + \
+            ['contributor name', 'contributor email']
+
+    def set_terminal_output(self, _):
+        '''Set the output format to Tabbed Separated Values'''
+
+        self.output_fmt = '{:<50}{:<50}{:<25}{:<25}'
+        self.column_fmt = '{:50}{:50}{:25}{:25}'
+
+    def set_csv_output(self, _):
+        '''Set the output format to Comma Separated Values'''
+
+        self.output_fmt = '{},{},{},{}'
+        self.column_fmt = '{},{},{},{}'
+        self.terminal = False
+
+    def print_columns(self):
+        '''Print column rows with release names'''
+        print(self.column_fmt.format(*self.column_titles))
+
+    def print_row(self, mapfile, symbols, owner):
+        '''Print row of symbol values'''
+
+        for symbol in symbols:
+            mapfile = str(mapfile)
+            name = owner[symbol]['name'] \
+                if owner[symbol] is not None else ''
+            email = owner[symbol]['email'] \
+                if owner[symbol] is not None else ''
+
+            print(self.output_fmt.format(mapfile, symbol, name, email))
+            if self.terminal:
+                mapfile = ''
+
+    OUTPUT_FORMATS = { None: set_terminal_output, \
+                   'terminal': set_terminal_output, \
+                   'csv': set_csv_output }
+
+class CountSymbolsAction:
+    ''' Logic to count symbols added since a give release '''
+    IGNORE_SECTIONS = ['EXPERIMENTAL','INTERNAL']
+
+    def __init__(self, mapfile_path, mapfile_parser, format_output):
+        self.path = mapfile_path
+        self.parser = mapfile_parser
+        self.format_output = format_output
+        self.symbols_count = []
+
+    def add_mapfile(self, release):
+        ''' add a version mapfile '''
+        symbol_count = experimental_count = 0
+
+        symbols = get_symbols(self.parser, release, self.path)
+
+        # which versions are present, and we care about
+        abi_vers = [abi_ver \
+                    for abi_ver in symbols \
+                    if abi_ver not in self.IGNORE_SECTIONS]
+
+        for abi_ver in abi_vers:
+            symbol_count += len(symbols[abi_ver])
+
+        # count experimental symbols
+        if 'EXPERIMENTAL' in symbols.keys():
+            experimental_count = len(symbols['EXPERIMENTAL'])
+
+        self.symbols_count += [symbol_count, experimental_count]
+
+    def __del__(self):
+        self.format_output.print_row(self.path.parent, self.symbols_count)
+
+class ListExpiredAction:
+    ''' Logic to list expired symbols between two releases '''
+
+    def __init__(self, mapfile_path, mapfile_parser, format_output):
+        self.path = mapfile_path
+        self.parser = mapfile_parser
+        self.format_output = format_output
+        self.experimental_symbols = []
+
+    def add_mapfile(self, release):
+        ''' add a version mapfile '''
+        symbols = get_symbols(self.parser, release, self.path)
+
+        if 'EXPERIMENTAL' in symbols.keys():
+            experimental = [exp.strip() for exp in symbols['EXPERIMENTAL']]
+
+            self.experimental_symbols.append(experimental)
+
+    def __del__(self):
+        if len(self.experimental_symbols) != 2:
+            return
+
+        tmp = self.experimental_symbols
+        # find symbols present in both dpdk releases
+        intersect_syms = [sym for sym in tmp[0] if sym in tmp[1]]
+
+        # check for empty set
+        if intersect_syms == []:
+            return
+
+        sym_owner = {}
+        for sym in intersect_syms:
+            sym_owner[sym] = SymbolOwner(self.path.parent, sym).find_symbol_owner()
+
+        self.format_output.print_row(self.path.parent, intersect_syms, sym_owner)
+
+SRC_DIRECTORIES = 'drivers,lib'
+
+ACTIONS = {None: CountSymbolsAction, \
+           'count-symbols': CountSymbolsAction, \
+           'list-expired': ListExpiredAction}
+
+ACTION_OUTPUT = {None: SymbolCountOutput, \
+                 'count-symbols': SymbolCountOutput, \
+                 'list-expired': ListExpiredOutput}
+
+def main():
+    '''Main entry point'''
+
+    dpdk_releases = get_dpdk_releases()
+
+    parser = argparse.ArgumentParser(description=DESCRIPTION.format(s=__file__), \
+                                     formatter_class=RawTextHelpFormatter
+                                     )
+    parser.add_argument('mode', choices=['count-symbols','list-expired'])
+    parser.add_argument('--format-output', choices=['terminal','csv'], \
+                        default='terminal')
+    parser.add_argument('--directory', choices=SRC_DIRECTORIES.split(','),
+                        default=SRC_DIRECTORIES)
+    parser.add_argument('--releases', \
+                        help='2 x comma separated release tags e.g. \'' \
+                        + ','.join([dpdk_releases[0],dpdk_releases[-1]]) \
+                        + '\'')
+    args = parser.parse_args()
+
+    if args.releases is not None:
+        dpdk_releases = args.releases.split(',')
+
+    if args.mode == 'list-expired':
+        if len(dpdk_releases) < 2:
+            sys.exit('Please specify two releases to compare ' \
+                     'in \'list-expired\' mode.')
+        dpdk_releases = [dpdk_releases[0], dpdk_releases[len(dpdk_releases) - 1]]
+
+    action = ACTIONS[args.mode]
+    format_output = ACTION_OUTPUT[args.mode](args.format_output, dpdk_releases)
+
+    map_grammar = MAP_GRAMMAR.format(get_abi_versions())
+    map_parser = makeGrammar(map_grammar, {})
+
+    format_output.print_columns()
+
+    for src_dir in args.directory.split(','):
+        for path in Path(src_dir).rglob('*.map'):
+            release_action = action(path, map_parser, format_output)
+
+            for release in dpdk_releases:
+                release_action.add_mapfile(release)
+
+            # all the magic happens in the destructor
+            del release_action
+
+if __name__ == '__main__':
+    main()
-- 
2.26.2


^ permalink raw reply	[relevance 5%]

* [dpdk-dev] [PATCH v10 3/3] maintainers: add new abi scripts
    2021-08-31 14:50  5%   ` [dpdk-dev] [PATCH v10 1/3] devtools: script to track symbols over releases Ray Kinsella
  2021-08-31 14:50  5%   ` [dpdk-dev] [PATCH v10 2/3] devtools: script to send notifications of expired symbols Ray Kinsella
@ 2021-08-31 14:50 17%   ` Ray Kinsella
  2021-09-01 12:31  0%   ` [dpdk-dev] [PATCH v10 0/3] devtools: scripts to count and track symbols Aaron Conole
  3 siblings, 0 replies; 200+ results
From: Ray Kinsella @ 2021-08-31 14:50 UTC (permalink / raw)
  To: dev
  Cc: bruce.richardson, stephen, ferruh.yigit, thomas, ktraynor, mdr, aconole

Add new abi management scripts to the MAINTAINERS file.

Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
---
 MAINTAINERS | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 266f5ac1da..ff8245271f 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -129,6 +129,8 @@ F: devtools/gen-abi.sh
 F: devtools/libabigail.abignore
 F: devtools/update-abi.sh
 F: devtools/update_version_map_abi.py
+F: devtools/notify-symbol-maintainers.py
+F: devtools/symbol-tool.py
 F: buildtools/check-symbols.sh
 F: buildtools/map-list-symbol.sh
 F: drivers/*/*/*.map
-- 
2.26.2


^ permalink raw reply	[relevance 17%]

* Re: [dpdk-dev] [PATCH v3] ethdev: fix representor port ID search by name
  @ 2021-08-31 15:41  0%   ` Andrew Rybchenko
  0 siblings, 0 replies; 200+ results
From: Andrew Rybchenko @ 2021-08-31 15:41 UTC (permalink / raw)
  To: Ajit Khaparde, Somnath Kotur, John Daley, Hyong Youb Kim,
	Beilei Xing, Qiming Yang, Qi Zhang, Haiyue Wang, Matan Azrad,
	Shahaf Shuler, Viacheslav Ovsiienko, Thomas Monjalon,
	Ferruh Yigit
  Cc: dev, Viacheslav Galaktionov

On 8/20/21 3:18 PM, Andrew Rybchenko wrote:
> From: Viacheslav Galaktionov <viacheslav.galaktionov@oktetlabs.ru>
> 
> Getting a list of representors from a representor does not make sense.
> Instead, a parent device should be used.
> 
> To this end, extend the rte_eth_dev_data structure to include the port ID
> of the parent device for representors.
> 
> Signed-off-by: Viacheslav Galaktionov <viacheslav.galaktionov@oktetlabs.ru>
> Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
> ---
> The new field is added into the hole in rte_eth_dev_data structure.
> The patch does not change ABI, but extra care is required since ABI
> check is disabled for the structure because of the libabigail bug [1].
> 
> Potentially it is bad for out-of-tree drivers which implement
> representors but do not fill in a new parert_port_id field in
> rte_eth_dev_data structure. Do we care?
> 
> May be the patch should add lines to release notes, but I'd like
> to get initial feedback first.
> 
> mlx5 changes should be reviwed by maintainers very carefully, since
> we are not sure if we patch it correctly.
> 
> [1] https://sourceware.org/bugzilla/show_bug.cgi?id=28060
> 
> v3:
>     - fix mlx5 build breakage
> 
> v2:
>     - fix mlx5 review notes
>     - try device port ID first before parent in order to address
>       backward compatibility issue
> 
>  drivers/net/bnxt/bnxt_reps.c             |  1 +
>  drivers/net/enic/enic_vf_representor.c   |  1 +
>  drivers/net/i40e/i40e_vf_representor.c   |  1 +
>  drivers/net/ice/ice_dcf_vf_representor.c |  1 +
>  drivers/net/ixgbe/ixgbe_vf_representor.c |  1 +
>  drivers/net/mlx5/linux/mlx5_os.c         | 17 +++++++++++++++++
>  drivers/net/mlx5/windows/mlx5_os.c       | 17 +++++++++++++++++
>  lib/ethdev/ethdev_driver.h               |  6 +++---
>  lib/ethdev/rte_class_eth.c               | 22 ++++++++++++++++++++--
>  lib/ethdev/rte_ethdev.c                  |  8 ++++----
>  lib/ethdev/rte_ethdev_core.h             |  4 ++++
>  11 files changed, 70 insertions(+), 9 deletions(-)

There is later follow up in v2 review notes which should be
addressed. I'll send v4 tomorrow.

^ permalink raw reply	[relevance 0%]

* Re: [dpdk-dev] [EXT] [PATCH] doc: announce library refactor for ABI improvement
  @ 2021-08-31 15:48  4%       ` Kinsella, Ray
  0 siblings, 0 replies; 200+ results
From: Kinsella, Ray @ 2021-08-31 15:48 UTC (permalink / raw)
  To: Andrew Rybchenko, Bruce Richardson, Akhil Goyal
  Cc: Ferruh Yigit, dev, Konstantin Ananyev, Jerin Jacob Kollanukkaran



On 26/08/2021 16:44, Andrew Rybchenko wrote:
> On 8/26/21 2:04 PM, Bruce Richardson wrote:
>> On Thu, Aug 26, 2021 at 10:46:35AM +0000, Akhil Goyal wrote:
>>>> Target is to reduce the public interface surface to improve the ABI
>>>> stability and this is preparation for the longer term stable ABI
>>>> support.
>>>>
>>>> Mainly device abstraction layer libraries are impacted because they have
>>>> two interfaces, one is public interface to the applications and other is
>>>> internal interface to the drivers. Some driver/internal interface
>>>> structures/symbols are in the public interface by mistake, this work is
>>>> to clean them.
>>>> Also some libraries has 'static inline' functions for performance
>>>> reasons (like ones in the ethdev), this work plans to split the
>>>> structures and hide the part that is not used by inline functions.
>>>>
>>>> The need of the work for the stable ABI already discussed and planned by
>>>> the DPDK technical board:
>>>> https://mails.dpdk.org/archives/dev/2021-July/214662.html
>>>>
>>>> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
>>>> ---
>>> Acked-by: Akhil Goyal <gakhil@marvell.com>
>>
>> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
>>
> 
> Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
>
Acked-by: Ray Kinsella <mdr@ashroe.eu>

^ permalink raw reply	[relevance 4%]

* Re: [dpdk-dev] [PATCH] doc: announce change in vfio dma mapping
  @ 2021-08-31 16:01  3% ` Ferruh Yigit
  2021-09-01  1:41  0%   ` Ding, Xuan
  0 siblings, 1 reply; 200+ results
From: Ferruh Yigit @ 2021-08-31 16:01 UTC (permalink / raw)
  To: Xuan Ding, dev, anatoly.burakov
  Cc: maxime.coquelin, chenbo.xia, jiayu.hu, bruce.richardson

On 8/31/2021 2:10 PM, Xuan Ding wrote:
> Currently, the VFIO subsystem will compact adjacent DMA regions for the
> purposes of saving space in the internal list of mappings. This has a
> side effect of compacting two separate mappings that just happen to be
> adjacent in memory. Since VFIO implementation on IA platforms also does
> not allow partial unmapping of memory mapped for DMA, the current DPDK
> VFIO implementation will prevent unmapping of accidentally adjacent
> maps even though it could have been unmapped [1].
> 
> The proper fix for this issue is to change the VFIO DMA mapping API to
> also include page size, and always map memory page-by-page.
> 
> [1] https://mails.dpdk.org/archives/dev/2021-July/213493.html
> 
> Signed-off-by: Xuan Ding <xuan.ding@intel.com>
> ---
>  doc/guides/rel_notes/deprecation.rst | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
> index 76a4abfd6b..1234420caf 100644
> --- a/doc/guides/rel_notes/deprecation.rst
> +++ b/doc/guides/rel_notes/deprecation.rst
> @@ -287,3 +287,6 @@ Deprecation Notices
>    reserved bytes to 2 (from 3), and use 1 byte to indicate warnings and other
>    information from the crypto/security operation. This field will be used to
>    communicate events such as soft expiry with IPsec in lookaside mode.
> +
> +* vfio: the functions `rte_vfio_container_dma_map` will be amended to
> +  include page size. This change is targeted for DPDK 22.02.
> 

Is this means adding a new parameter to API?
If so this is an ABI/API break and we can't do this change in the 22.02.

^ permalink raw reply	[relevance 3%]

* [dpdk-dev] [PATCH v4] ethdev: fix representor port ID search by name
    @ 2021-08-31 16:06  3% ` Andrew Rybchenko
  2021-08-31 16:32  0%   ` Wang, Haiyue
                     ` (2 more replies)
  2021-09-13 11:26  4% ` [dpdk-dev] [PATCH v5] " Andrew Rybchenko
  2 siblings, 3 replies; 200+ results
From: Andrew Rybchenko @ 2021-08-31 16:06 UTC (permalink / raw)
  To: Ajit Khaparde, Somnath Kotur, John Daley, Hyong Youb Kim,
	Beilei Xing, Qiming Yang, Qi Zhang, Haiyue Wang, Matan Azrad,
	Shahaf Shuler, Viacheslav Ovsiienko, Thomas Monjalon,
	Ferruh Yigit
  Cc: dev, Viacheslav Galaktionov

From: Viacheslav Galaktionov <viacheslav.galaktionov@oktetlabs.ru>

Getting a list of representors from a representor does not make sense.
Instead, a parent device should be used.

To this end, extend the rte_eth_dev_data structure to include the port ID
of the backing device for representors.

Signed-off-by: Viacheslav Galaktionov <viacheslav.galaktionov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
---
The new field is added into the hole in rte_eth_dev_data structure.
The patch does not change ABI, but extra care is required since ABI
check is disabled for the structure because of the libabigail bug [1].

Potentially it is bad for out-of-tree drivers which implement
representors but do not fill in a new parert_port_id field in
rte_eth_dev_data structure. Do we care?

mlx5 changes should be reviwed by maintainers very carefully, since
we are not sure if we patch it correctly.

[1] https://sourceware.org/bugzilla/show_bug.cgi?id=28060

v4:
    - apply mlx5 review notes: remove fallback from generic ethdev
      code and add fallback to mlx5 code to handle legacy usecase

v3:
    - fix mlx5 build breakage

v2:
    - fix mlx5 review notes
    - try device port ID first before parent in order to address
      backward compatibility issue

 drivers/net/bnxt/bnxt_reps.c             |  1 +
 drivers/net/enic/enic_vf_representor.c   |  1 +
 drivers/net/i40e/i40e_vf_representor.c   |  1 +
 drivers/net/ice/ice_dcf_vf_representor.c |  1 +
 drivers/net/ixgbe/ixgbe_vf_representor.c |  1 +
 drivers/net/mlx5/linux/mlx5_os.c         | 13 +++++++++++++
 drivers/net/mlx5/windows/mlx5_os.c       | 13 +++++++++++++
 lib/ethdev/ethdev_driver.h               |  6 +++---
 lib/ethdev/rte_class_eth.c               |  2 +-
 lib/ethdev/rte_ethdev.c                  |  8 ++++----
 lib/ethdev/rte_ethdev_core.h             |  6 ++++++
 11 files changed, 45 insertions(+), 8 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_reps.c b/drivers/net/bnxt/bnxt_reps.c
index bdbad53b7d..902591cd39 100644
--- a/drivers/net/bnxt/bnxt_reps.c
+++ b/drivers/net/bnxt/bnxt_reps.c
@@ -187,6 +187,7 @@ int bnxt_representor_init(struct rte_eth_dev *eth_dev, void *params)
 	eth_dev->data->dev_flags |= RTE_ETH_DEV_REPRESENTOR |
 					RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS;
 	eth_dev->data->representor_id = rep_params->vf_id;
+	eth_dev->data->parent_port_id = rep_params->parent_dev->data->port_id;
 
 	rte_eth_random_addr(vf_rep_bp->dflt_mac_addr);
 	memcpy(vf_rep_bp->mac_addr, vf_rep_bp->dflt_mac_addr,
diff --git a/drivers/net/enic/enic_vf_representor.c b/drivers/net/enic/enic_vf_representor.c
index 79dd6e5640..6ee7967ce9 100644
--- a/drivers/net/enic/enic_vf_representor.c
+++ b/drivers/net/enic/enic_vf_representor.c
@@ -662,6 +662,7 @@ int enic_vf_representor_init(struct rte_eth_dev *eth_dev, void *init_params)
 	eth_dev->data->dev_flags |= RTE_ETH_DEV_REPRESENTOR |
 					RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS;
 	eth_dev->data->representor_id = vf->vf_id;
+	eth_dev->data->parent_port_id = pf->port_id;
 	eth_dev->data->mac_addrs = rte_zmalloc("enic_mac_addr_vf",
 		sizeof(struct rte_ether_addr) *
 		ENIC_UNICAST_PERFECT_FILTERS, 0);
diff --git a/drivers/net/i40e/i40e_vf_representor.c b/drivers/net/i40e/i40e_vf_representor.c
index 0481b55381..04d1842a5c 100644
--- a/drivers/net/i40e/i40e_vf_representor.c
+++ b/drivers/net/i40e/i40e_vf_representor.c
@@ -514,6 +514,7 @@ i40e_vf_representor_init(struct rte_eth_dev *ethdev, void *init_params)
 	ethdev->data->dev_flags |= RTE_ETH_DEV_REPRESENTOR |
 					RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS;
 	ethdev->data->representor_id = representor->vf_id;
+	ethdev->data->parent_port_id = pf->dev_data->port_id;
 
 	/* Setting the number queues allocated to the VF */
 	ethdev->data->nb_rx_queues = vf->vsi->nb_qps;
diff --git a/drivers/net/ice/ice_dcf_vf_representor.c b/drivers/net/ice/ice_dcf_vf_representor.c
index 970461f3e9..c7cd3fd290 100644
--- a/drivers/net/ice/ice_dcf_vf_representor.c
+++ b/drivers/net/ice/ice_dcf_vf_representor.c
@@ -418,6 +418,7 @@ ice_dcf_vf_repr_init(struct rte_eth_dev *vf_rep_eth_dev, void *init_param)
 
 	vf_rep_eth_dev->data->dev_flags |= RTE_ETH_DEV_REPRESENTOR;
 	vf_rep_eth_dev->data->representor_id = repr->vf_id;
+	vf_rep_eth_dev->data->parent_port_id = repr->dcf_eth_dev->data->port_id;
 
 	vf_rep_eth_dev->data->mac_addrs = &repr->mac_addr;
 
diff --git a/drivers/net/ixgbe/ixgbe_vf_representor.c b/drivers/net/ixgbe/ixgbe_vf_representor.c
index d5b636a194..7a2063849e 100644
--- a/drivers/net/ixgbe/ixgbe_vf_representor.c
+++ b/drivers/net/ixgbe/ixgbe_vf_representor.c
@@ -197,6 +197,7 @@ ixgbe_vf_representor_init(struct rte_eth_dev *ethdev, void *init_params)
 
 	ethdev->data->dev_flags |= RTE_ETH_DEV_REPRESENTOR;
 	ethdev->data->representor_id = representor->vf_id;
+	ethdev->data->parent_port_id = representor->pf_ethdev->data->port_id;
 
 	/* Set representor device ops */
 	ethdev->dev_ops = &ixgbe_vf_representor_dev_ops;
diff --git a/drivers/net/mlx5/linux/mlx5_os.c b/drivers/net/mlx5/linux/mlx5_os.c
index 5f8766aa48..adbb9fbb10 100644
--- a/drivers/net/mlx5/linux/mlx5_os.c
+++ b/drivers/net/mlx5/linux/mlx5_os.c
@@ -1677,6 +1677,19 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev,
 	if (priv->representor) {
 		eth_dev->data->dev_flags |= RTE_ETH_DEV_REPRESENTOR;
 		eth_dev->data->representor_id = priv->representor_id;
+		MLX5_ETH_FOREACH_DEV(port_id, &priv->pci_dev->device) {
+			struct mlx5_priv *opriv =
+				rte_eth_devices[port_id].data->dev_private;
+			if (opriv &&
+			    opriv->master &&
+			    opriv->domain_id == priv->domain_id &&
+			    opriv->sh == priv->sh) {
+				eth_dev->data->parent_port_id = port_id;
+				break;
+			}
+		}
+		if (port_id >= RTE_MAX_ETHPORTS)
+			eth_dev->data->parent_port_id = eth_dev->data->port_id;
 	}
 	priv->mp_id.port_id = eth_dev->data->port_id;
 	strlcpy(priv->mp_id.name, MLX5_MP_NAME, RTE_MP_MAX_NAME_LEN);
diff --git a/drivers/net/mlx5/windows/mlx5_os.c b/drivers/net/mlx5/windows/mlx5_os.c
index 7e1df1c751..c266b39696 100644
--- a/drivers/net/mlx5/windows/mlx5_os.c
+++ b/drivers/net/mlx5/windows/mlx5_os.c
@@ -543,6 +543,19 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev,
 	if (priv->representor) {
 		eth_dev->data->dev_flags |= RTE_ETH_DEV_REPRESENTOR;
 		eth_dev->data->representor_id = priv->representor_id;
+		MLX5_ETH_FOREACH_DEV(port_id, &priv->pci_dev->device) {
+			struct mlx5_priv *opriv =
+				rte_eth_devices[port_id].data->dev_private;
+			if (opriv &&
+			    opriv->master &&
+			    opriv->domain_id == priv->domain_id &&
+			    opriv->sh == priv->sh) {
+				eth_dev->data->parent_port_id = port_id;
+				break;
+			}
+		}
+		if (port_id >= RTE_MAX_ETHPORTS)
+			eth_dev->data->parent_port_id = eth_dev->data->port_id;
 	}
 	/*
 	 * Store associated network device interface index. This index
diff --git a/lib/ethdev/ethdev_driver.h b/lib/ethdev/ethdev_driver.h
index 40e474aa7e..b940e6cb38 100644
--- a/lib/ethdev/ethdev_driver.h
+++ b/lib/ethdev/ethdev_driver.h
@@ -1248,8 +1248,8 @@ struct rte_eth_devargs {
  * For backward compatibility, if no representor info, direct
  * map legacy VF (no controller and pf).
  *
- * @param ethdev
- *  Handle of ethdev port.
+ * @param port_id
+ *  Port ID of the backing device.
  * @param type
  *  Representor type.
  * @param controller
@@ -1266,7 +1266,7 @@ struct rte_eth_devargs {
  */
 __rte_internal
 int
-rte_eth_representor_id_get(const struct rte_eth_dev *ethdev,
+rte_eth_representor_id_get(uint16_t port_id,
 			   enum rte_eth_representor_type type,
 			   int controller, int pf, int representor_port,
 			   uint16_t *repr_id);
diff --git a/lib/ethdev/rte_class_eth.c b/lib/ethdev/rte_class_eth.c
index 1fe5fa1f36..e3b7ab9728 100644
--- a/lib/ethdev/rte_class_eth.c
+++ b/lib/ethdev/rte_class_eth.c
@@ -95,7 +95,7 @@ eth_representor_cmp(const char *key __rte_unused,
 		c = i / (np * nf);
 		p = (i / nf) % np;
 		f = i % nf;
-		if (rte_eth_representor_id_get(edev,
+		if (rte_eth_representor_id_get(edev->data->parent_port_id,
 			eth_da.type,
 			eth_da.nb_mh_controllers == 0 ? -1 :
 					eth_da.mh_controllers[c],
diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c
index 9d95cd11e1..228ef7bf23 100644
--- a/lib/ethdev/rte_ethdev.c
+++ b/lib/ethdev/rte_ethdev.c
@@ -5997,7 +5997,7 @@ rte_eth_devargs_parse(const char *dargs, struct rte_eth_devargs *eth_da)
 }
 
 int
-rte_eth_representor_id_get(const struct rte_eth_dev *ethdev,
+rte_eth_representor_id_get(uint16_t port_id,
 			   enum rte_eth_representor_type type,
 			   int controller, int pf, int representor_port,
 			   uint16_t *repr_id)
@@ -6013,7 +6013,7 @@ rte_eth_representor_id_get(const struct rte_eth_dev *ethdev,
 		return -EINVAL;
 
 	/* Get PMD representor range info. */
-	ret = rte_eth_representor_info_get(ethdev->data->port_id, NULL);
+	ret = rte_eth_representor_info_get(port_id, NULL);
 	if (ret == -ENOTSUP && type == RTE_ETH_REPRESENTOR_VF &&
 	    controller == -1 && pf == -1) {
 		/* Direct mapping for legacy VF representor. */
@@ -6028,7 +6028,7 @@ rte_eth_representor_id_get(const struct rte_eth_dev *ethdev,
 	if (info == NULL)
 		return -ENOMEM;
 	info->nb_ranges_alloc = n;
-	ret = rte_eth_representor_info_get(ethdev->data->port_id, info);
+	ret = rte_eth_representor_info_get(port_id, info);
 	if (ret < 0)
 		goto out;
 
@@ -6047,7 +6047,7 @@ rte_eth_representor_id_get(const struct rte_eth_dev *ethdev,
 			continue;
 		if (info->ranges[i].id_end < info->ranges[i].id_base) {
 			RTE_LOG(WARNING, EAL, "Port %hu invalid representor ID Range %u - %u, entry %d\n",
-				ethdev->data->port_id, info->ranges[i].id_base,
+				port_id, info->ranges[i].id_base,
 				info->ranges[i].id_end, i);
 			continue;
 
diff --git a/lib/ethdev/rte_ethdev_core.h b/lib/ethdev/rte_ethdev_core.h
index edf96de2dc..72fefa59c2 100644
--- a/lib/ethdev/rte_ethdev_core.h
+++ b/lib/ethdev/rte_ethdev_core.h
@@ -185,6 +185,12 @@ struct rte_eth_dev_data {
 			/**< Switch-specific identifier.
 			 *   Valid if RTE_ETH_DEV_REPRESENTOR in dev_flags.
 			 */
+	uint16_t parent_port_id;
+			/**< Port ID of the backing device.
+			 *   This device will be used to query representor
+			 *   info and calculate representor IDs.
+			 *   Valid if RTE_ETH_DEV_REPRESENTOR in dev_flags.
+			 */
 
 	pthread_mutex_t flow_ops_mutex; /**< rte_flow ops mutex. */
 	uint64_t reserved_64s[4]; /**< Reserved for future fields */
-- 
2.30.2


^ permalink raw reply	[relevance 3%]

* [dpdk-dev] [PATCH v1] bbdev: remove experimental tag from API
  @ 2021-08-31 16:25  3% ` Nicolas Chautru
    1 sibling, 0 replies; 200+ results
From: Nicolas Chautru @ 2021-08-31 16:25 UTC (permalink / raw)
  To: dev, gakhil
  Cc: thomas, trix, hemant.agrawal, mingshan.zhang, arun.joshi,
	david.marchand, mdr, Nicolas Chautru

This promotes the bbdev interface to stable.
Overdue for some time as bbdev interface has been stable.

Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
---
 doc/guides/rel_notes/release_21_11.rst |  2 ++
 lib/bbdev/rte_bbdev.h                  | 32 --------------------------------
 lib/bbdev/rte_bbdev_op.h               |  9 ---------
 lib/bbdev/rte_bbdev_pmd.h              |  7 -------
 lib/bbdev/version.map                  |  2 +-
 5 files changed, 3 insertions(+), 49 deletions(-)

diff --git a/doc/guides/rel_notes/release_21_11.rst b/doc/guides/rel_notes/release_21_11.rst
index d707a55..2b1edb5 100644
--- a/doc/guides/rel_notes/release_21_11.rst
+++ b/doc/guides/rel_notes/release_21_11.rst
@@ -83,6 +83,8 @@ API Changes
    This section is a comment. Do not overwrite or remove it.
    Also, make sure to start the actual text at the margin.
    =======================================================
+* bbdev: the experimental tag is dropped from the bbdev library, and its
+  interfaces are considered stable as of DPDK 21.11.
 
 
 ABI Changes
diff --git a/lib/bbdev/rte_bbdev.h b/lib/bbdev/rte_bbdev.h
index 7017124..bff08a8 100644
--- a/lib/bbdev/rte_bbdev.h
+++ b/lib/bbdev/rte_bbdev.h
@@ -10,10 +10,6 @@
  *
  * Wireless base band device abstraction APIs.
  *
- * @warning
- * @b EXPERIMENTAL:
- * All functions in this file may be changed or removed without prior notice.
- *
  * This API allows an application to discover, configure and use a device to
  * process operations. An asynchronous API (enqueue, followed by later dequeue)
  * is used for processing operations.
@@ -55,7 +51,6 @@ enum rte_bbdev_state {
  * @return
  *   The total number of usable devices.
  */
-__rte_experimental
 uint16_t
 rte_bbdev_count(void);
 
@@ -68,7 +63,6 @@ enum rte_bbdev_state {
  * @return
  *   true if device ID is valid and device is attached, false otherwise.
  */
-__rte_experimental
 bool
 rte_bbdev_is_valid(uint16_t dev_id);
 
@@ -82,7 +76,6 @@ enum rte_bbdev_state {
  *   - The next device, or
  *   - RTE_BBDEV_MAX_DEVS if none found
  */
-__rte_experimental
 uint16_t
 rte_bbdev_find_next(uint16_t dev_id);
 
@@ -112,7 +105,6 @@ enum rte_bbdev_state {
  *   - -EBUSY if the identified device has already started
  *   - -ENOMEM if unable to allocate memory
  */
-__rte_experimental
 int
 rte_bbdev_setup_queues(uint16_t dev_id, uint16_t num_queues, int socket_id);
 
@@ -130,7 +122,6 @@ enum rte_bbdev_state {
  *   - -EBUSY if the identified device has already started
  *   - -ENOTSUP if the interrupts are not supported by the device
  */
-__rte_experimental
 int
 rte_bbdev_intr_enable(uint16_t dev_id);
 
@@ -160,7 +151,6 @@ struct rte_bbdev_queue_conf {
  *   - EINVAL if the identified queue size or priority are invalid
  *   - EBUSY if the identified queue or its device have already started
  */
-__rte_experimental
 int
 rte_bbdev_queue_configure(uint16_t dev_id, uint16_t queue_id,
 		const struct rte_bbdev_queue_conf *conf);
@@ -176,7 +166,6 @@ struct rte_bbdev_queue_conf {
  *   - 0 on success
  *   - negative value on failure - as returned from PMD driver
  */
-__rte_experimental
 int
 rte_bbdev_start(uint16_t dev_id);
 
@@ -190,7 +179,6 @@ struct rte_bbdev_queue_conf {
  * @return
  *   - 0 on success
  */
-__rte_experimental
 int
 rte_bbdev_stop(uint16_t dev_id);
 
@@ -204,7 +192,6 @@ struct rte_bbdev_queue_conf {
  * @return
  *   - 0 on success
  */
-__rte_experimental
 int
 rte_bbdev_close(uint16_t dev_id);
 
@@ -222,7 +209,6 @@ struct rte_bbdev_queue_conf {
  *   - 0 on success
  *   - negative value on failure - as returned from PMD driver
  */
-__rte_experimental
 int
 rte_bbdev_queue_start(uint16_t dev_id, uint16_t queue_id);
 
@@ -238,7 +224,6 @@ struct rte_bbdev_queue_conf {
  *   - 0 on success
  *   - negative value on failure - as returned from PMD driver
  */
-__rte_experimental
 int
 rte_bbdev_queue_stop(uint16_t dev_id, uint16_t queue_id);
 
@@ -272,7 +257,6 @@ struct rte_bbdev_stats {
  *   - 0 on success
  *   - EINVAL if invalid parameter pointer is provided
  */
-__rte_experimental
 int
 rte_bbdev_stats_get(uint16_t dev_id, struct rte_bbdev_stats *stats);
 
@@ -284,7 +268,6 @@ struct rte_bbdev_stats {
  * @return
  *   - 0 on success
  */
-__rte_experimental
 int
 rte_bbdev_stats_reset(uint16_t dev_id);
 
@@ -347,7 +330,6 @@ struct rte_bbdev_info {
  *   - 0 on success
  *   - EINVAL if invalid parameter pointer is provided
  */
-__rte_experimental
 int
 rte_bbdev_info_get(uint16_t dev_id, struct rte_bbdev_info *dev_info);
 
@@ -374,7 +356,6 @@ struct rte_bbdev_queue_info {
  *   - 0 on success
  *   - EINVAL if invalid parameter pointer is provided
  */
-__rte_experimental
 int
 rte_bbdev_queue_info_get(uint16_t dev_id, uint16_t queue_id,
 		struct rte_bbdev_queue_info *queue_info);
@@ -490,7 +471,6 @@ struct __rte_cache_aligned rte_bbdev {
  *   The number of operations actually enqueued (this is the number of processed
  *   entries in the @p ops array).
  */
-__rte_experimental
 static inline uint16_t
 rte_bbdev_enqueue_enc_ops(uint16_t dev_id, uint16_t queue_id,
 		struct rte_bbdev_enc_op **ops, uint16_t num_ops)
@@ -521,7 +501,6 @@ struct __rte_cache_aligned rte_bbdev {
  *   The number of operations actually enqueued (this is the number of processed
  *   entries in the @p ops array).
  */
-__rte_experimental
 static inline uint16_t
 rte_bbdev_enqueue_dec_ops(uint16_t dev_id, uint16_t queue_id,
 		struct rte_bbdev_dec_op **ops, uint16_t num_ops)
@@ -552,7 +531,6 @@ struct __rte_cache_aligned rte_bbdev {
  *   The number of operations actually enqueued (this is the number of processed
  *   entries in the @p ops array).
  */
-__rte_experimental
 static inline uint16_t
 rte_bbdev_enqueue_ldpc_enc_ops(uint16_t dev_id, uint16_t queue_id,
 		struct rte_bbdev_enc_op **ops, uint16_t num_ops)
@@ -583,7 +561,6 @@ struct __rte_cache_aligned rte_bbdev {
  *   The number of operations actually enqueued (this is the number of processed
  *   entries in the @p ops array).
  */
-__rte_experimental
 static inline uint16_t
 rte_bbdev_enqueue_ldpc_dec_ops(uint16_t dev_id, uint16_t queue_id,
 		struct rte_bbdev_dec_op **ops, uint16_t num_ops)
@@ -616,7 +593,6 @@ struct __rte_cache_aligned rte_bbdev {
  *   The number of operations actually dequeued (this is the number of entries
  *   copied into the @p ops array).
  */
-__rte_experimental
 static inline uint16_t
 rte_bbdev_dequeue_enc_ops(uint16_t dev_id, uint16_t queue_id,
 		struct rte_bbdev_enc_op **ops, uint16_t num_ops)
@@ -649,7 +625,6 @@ struct __rte_cache_aligned rte_bbdev {
  *   copied into the @p ops array).
  */
 
-__rte_experimental
 static inline uint16_t
 rte_bbdev_dequeue_dec_ops(uint16_t dev_id, uint16_t queue_id,
 		struct rte_bbdev_dec_op **ops, uint16_t num_ops)
@@ -681,7 +656,6 @@ struct __rte_cache_aligned rte_bbdev {
  *   The number of operations actually dequeued (this is the number of entries
  *   copied into the @p ops array).
  */
-__rte_experimental
 static inline uint16_t
 rte_bbdev_dequeue_ldpc_enc_ops(uint16_t dev_id, uint16_t queue_id,
 		struct rte_bbdev_enc_op **ops, uint16_t num_ops)
@@ -712,7 +686,6 @@ struct __rte_cache_aligned rte_bbdev {
  *   The number of operations actually dequeued (this is the number of entries
  *   copied into the @p ops array).
  */
-__rte_experimental
 static inline uint16_t
 rte_bbdev_dequeue_ldpc_dec_ops(uint16_t dev_id, uint16_t queue_id,
 		struct rte_bbdev_dec_op **ops, uint16_t num_ops)
@@ -764,7 +737,6 @@ typedef void (*rte_bbdev_cb_fn)(uint16_t dev_id,
  * @return
  *   Zero on success, negative value on failure.
  */
-__rte_experimental
 int
 rte_bbdev_callback_register(uint16_t dev_id, enum rte_bbdev_event_type event,
 		rte_bbdev_cb_fn cb_fn, void *cb_arg);
@@ -788,7 +760,6 @@ typedef void (*rte_bbdev_cb_fn)(uint16_t dev_id,
  *   - EINVAL if invalid parameter pointer is provided
  *   - EAGAIN if the provided callback pointer does not exist
  */
-__rte_experimental
 int
 rte_bbdev_callback_unregister(uint16_t dev_id, enum rte_bbdev_event_type event,
 		rte_bbdev_cb_fn cb_fn, void *cb_arg);
@@ -809,7 +780,6 @@ typedef void (*rte_bbdev_cb_fn)(uint16_t dev_id,
  *   - 0 on success
  *   - negative value on failure - as returned from PMD driver
  */
-__rte_experimental
 int
 rte_bbdev_queue_intr_enable(uint16_t dev_id, uint16_t queue_id);
 
@@ -826,7 +796,6 @@ typedef void (*rte_bbdev_cb_fn)(uint16_t dev_id,
  *   - 0 on success
  *   - negative value on failure - as returned from PMD driver
  */
-__rte_experimental
 int
 rte_bbdev_queue_intr_disable(uint16_t dev_id, uint16_t queue_id);
 
@@ -854,7 +823,6 @@ typedef void (*rte_bbdev_cb_fn)(uint16_t dev_id,
  *   - ENOTSUP if interrupts are not supported by the identified device
  *   - negative value on failure - as returned from PMD driver
  */
-__rte_experimental
 int
 rte_bbdev_queue_intr_ctl(uint16_t dev_id, uint16_t queue_id, int epfd, int op,
 		void *data);
diff --git a/lib/bbdev/rte_bbdev_op.h b/lib/bbdev/rte_bbdev_op.h
index f946842..ef3ecdb 100644
--- a/lib/bbdev/rte_bbdev_op.h
+++ b/lib/bbdev/rte_bbdev_op.h
@@ -9,9 +9,6 @@
  * @file rte_bbdev_op.h
  *
  * Defines wireless base band layer 1 operations and capabilities
- *
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice
  */
 
 #ifdef __cplusplus
@@ -815,7 +812,6 @@ struct rte_bbdev_op_pool_private {
  *   Operation type as string or NULL if op_type is invalid
  *
  */
-__rte_experimental
 const char*
 rte_bbdev_op_type_str(enum rte_bbdev_op_type op_type);
 
@@ -839,7 +835,6 @@ struct rte_bbdev_op_pool_private {
  *   - Pointer to a mempool on success,
  *   - NULL pointer on failure.
  */
-__rte_experimental
 struct rte_mempool *
 rte_bbdev_op_pool_create(const char *name, enum rte_bbdev_op_type type,
 		unsigned int num_elements, unsigned int cache_size,
@@ -859,7 +854,6 @@ struct rte_mempool *
  *   - 0 on success
  *   - EINVAL if invalid mempool is provided
  */
-__rte_experimental
 static inline int
 rte_bbdev_enc_op_alloc_bulk(struct rte_mempool *mempool,
 		struct rte_bbdev_enc_op **ops, uint16_t num_ops)
@@ -896,7 +890,6 @@ struct rte_mempool *
  *   - 0 on success
  *   - EINVAL if invalid mempool is provided
  */
-__rte_experimental
 static inline int
 rte_bbdev_dec_op_alloc_bulk(struct rte_mempool *mempool,
 		struct rte_bbdev_dec_op **ops, uint16_t num_ops)
@@ -929,7 +922,6 @@ struct rte_mempool *
  * @param num_ops
  *   Number of structures
  */
-__rte_experimental
 static inline void
 rte_bbdev_dec_op_free_bulk(struct rte_bbdev_dec_op **ops, unsigned int num_ops)
 {
@@ -947,7 +939,6 @@ struct rte_mempool *
  * @param num_ops
  *   Number of structures
  */
-__rte_experimental
 static inline void
 rte_bbdev_enc_op_free_bulk(struct rte_bbdev_enc_op **ops, unsigned int num_ops)
 {
diff --git a/lib/bbdev/rte_bbdev_pmd.h b/lib/bbdev/rte_bbdev_pmd.h
index 237e336..dd0e359 100644
--- a/lib/bbdev/rte_bbdev_pmd.h
+++ b/lib/bbdev/rte_bbdev_pmd.h
@@ -10,9 +10,6 @@
  *
  * Wireless base band driver-facing APIs.
  *
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice
- *
  * This API provides the mechanism for device drivers to register with the
  * bbdev interface. User applications should not use this API.
  */
@@ -43,7 +40,6 @@
  * @return
  *   - Slot in the rte_bbdev array for a new device;
  */
-__rte_experimental
 struct rte_bbdev *
 rte_bbdev_allocate(const char *name);
 
@@ -56,7 +52,6 @@ struct rte_bbdev *
  * @return
  *   - 0 on success, negative on error
  */
-__rte_experimental
 int
 rte_bbdev_release(struct rte_bbdev *bbdev);
 
@@ -71,7 +66,6 @@ struct rte_bbdev *
  *   - NULL otherwise
  *
  */
-__rte_experimental
 struct rte_bbdev *
 rte_bbdev_get_named_dev(const char *name);
 
@@ -190,7 +184,6 @@ struct rte_bbdev_ops {
  * @param ret_param
  *   To pass data back to user application.
  */
-__rte_experimental
 void
 rte_bbdev_pmd_callback_process(struct rte_bbdev *dev,
 	enum rte_bbdev_event_type event, void *ret_param);
diff --git a/lib/bbdev/version.map b/lib/bbdev/version.map
index 3624eb1..cce3f3c 100644
--- a/lib/bbdev/version.map
+++ b/lib/bbdev/version.map
@@ -1,4 +1,4 @@
-EXPERIMENTAL {
+DPDK_22 {
 	global:
 
 	rte_bbdev_allocate;
-- 
1.8.3.1


^ permalink raw reply	[relevance 3%]

* Re: [dpdk-dev] [PATCH v4] ethdev: fix representor port ID search by name
  2021-08-31 16:06  3% ` [dpdk-dev] [PATCH v4] " Andrew Rybchenko
@ 2021-08-31 16:32  0%   ` Wang, Haiyue
  2021-08-31 16:37  0%     ` Andrew Rybchenko
  2021-09-01  5:15  0%   ` Xing, Beilei
  2021-09-01 14:55  0%   ` Ferruh Yigit
  2 siblings, 1 reply; 200+ results
From: Wang, Haiyue @ 2021-08-31 16:32 UTC (permalink / raw)
  To: Andrew Rybchenko, Ajit Khaparde, Somnath Kotur, Daley, John,
	Hyong Youb Kim, Xing, Beilei, Yang, Qiming, Zhang, Qi Z,
	Matan Azrad, Shahaf Shuler, Viacheslav Ovsiienko,
	Thomas Monjalon, Yigit, Ferruh
  Cc: dev, Viacheslav Galaktionov

> -----Original Message-----
> From: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
> Sent: Wednesday, September 1, 2021 00:06
> To: Ajit Khaparde <ajit.khaparde@broadcom.com>; Somnath Kotur <somnath.kotur@broadcom.com>; Daley,
> John <johndale@cisco.com>; Hyong Youb Kim <hyonkim@cisco.com>; Xing, Beilei <beilei.xing@intel.com>;
> Yang, Qiming <qiming.yang@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>; Wang, Haiyue
> <haiyue.wang@intel.com>; Matan Azrad <matan@nvidia.com>; Shahaf Shuler <shahafs@nvidia.com>;
> Viacheslav Ovsiienko <viacheslavo@nvidia.com>; Thomas Monjalon <thomas@monjalon.net>; Yigit, Ferruh
> <ferruh.yigit@intel.com>
> Cc: dev@dpdk.org; Viacheslav Galaktionov <viacheslav.galaktionov@oktetlabs.ru>
> Subject: [PATCH v4] ethdev: fix representor port ID search by name
> 
> From: Viacheslav Galaktionov <viacheslav.galaktionov@oktetlabs.ru>
> 
> Getting a list of representors from a representor does not make sense.
> Instead, a parent device should be used.
> 
> To this end, extend the rte_eth_dev_data structure to include the port ID
> of the backing device for representors.
> 
> Signed-off-by: Viacheslav Galaktionov <viacheslav.galaktionov@oktetlabs.ru>
> Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
> ---
> The new field is added into the hole in rte_eth_dev_data structure.
> The patch does not change ABI, but extra care is required since ABI
> check is disabled for the structure because of the libabigail bug [1].
> 
> Potentially it is bad for out-of-tree drivers which implement
> representors but do not fill in a new parert_port_id field in
> rte_eth_dev_data structure. Do we care?

Set the `parent_port_id` to ' RTE_MAX_ETHPORTS' as an invalid port ID
in rte_eth_dev_allocate ?

> 
> mlx5 changes should be reviwed by maintainers very carefully, since
> we are not sure if we patch it correctly.
> 
> [1] https://sourceware.org/bugzilla/show_bug.cgi?id=28060
> 
> v4:
>     - apply mlx5 review notes: remove fallback from generic ethdev
>       code and add fallback to mlx5 code to handle legacy usecase
> 
> v3:
>     - fix mlx5 build breakage
> 
> v2:
>     - fix mlx5 review notes
>     - try device port ID first before parent in order to address
>       backward compatibility issue
> 
>  drivers/net/bnxt/bnxt_reps.c             |  1 +
>  drivers/net/enic/enic_vf_representor.c   |  1 +
>  drivers/net/i40e/i40e_vf_representor.c   |  1 +
>  drivers/net/ice/ice_dcf_vf_representor.c |  1 +
>  drivers/net/ixgbe/ixgbe_vf_representor.c |  1 +
>  drivers/net/mlx5/linux/mlx5_os.c         | 13 +++++++++++++
>  drivers/net/mlx5/windows/mlx5_os.c       | 13 +++++++++++++
>  lib/ethdev/ethdev_driver.h               |  6 +++---
>  lib/ethdev/rte_class_eth.c               |  2 +-
>  lib/ethdev/rte_ethdev.c                  |  8 ++++----
>  lib/ethdev/rte_ethdev_core.h             |  6 ++++++
>  11 files changed, 45 insertions(+), 8 deletions(-)
> 

For ixgbe_vf, ice_dcf

Acked-by: Haiyue Wang <haiyue.wang@intel.com>

> --
> 2.30.2


^ permalink raw reply	[relevance 0%]

* Re: [dpdk-dev] [PATCH v4] ethdev: fix representor port ID search by name
  2021-08-31 16:32  0%   ` Wang, Haiyue
@ 2021-08-31 16:37  0%     ` Andrew Rybchenko
  0 siblings, 0 replies; 200+ results
From: Andrew Rybchenko @ 2021-08-31 16:37 UTC (permalink / raw)
  To: Wang, Haiyue, Ajit Khaparde, Somnath Kotur, Daley, John,
	Hyong Youb Kim, Xing, Beilei, Yang, Qiming, Zhang, Qi Z,
	Matan Azrad, Shahaf Shuler, Viacheslav Ovsiienko,
	Thomas Monjalon, Yigit, Ferruh
  Cc: dev, Viacheslav Galaktionov

On 8/31/21 7:32 PM, Wang, Haiyue wrote:
>> -----Original Message-----
>> From: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
>> Sent: Wednesday, September 1, 2021 00:06
>> To: Ajit Khaparde <ajit.khaparde@broadcom.com>; Somnath Kotur <somnath.kotur@broadcom.com>; Daley,
>> John <johndale@cisco.com>; Hyong Youb Kim <hyonkim@cisco.com>; Xing, Beilei <beilei.xing@intel.com>;
>> Yang, Qiming <qiming.yang@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>; Wang, Haiyue
>> <haiyue.wang@intel.com>; Matan Azrad <matan@nvidia.com>; Shahaf Shuler <shahafs@nvidia.com>;
>> Viacheslav Ovsiienko <viacheslavo@nvidia.com>; Thomas Monjalon <thomas@monjalon.net>; Yigit, Ferruh
>> <ferruh.yigit@intel.com>
>> Cc: dev@dpdk.org; Viacheslav Galaktionov <viacheslav.galaktionov@oktetlabs.ru>
>> Subject: [PATCH v4] ethdev: fix representor port ID search by name
>>
>> From: Viacheslav Galaktionov <viacheslav.galaktionov@oktetlabs.ru>
>>
>> Getting a list of representors from a representor does not make sense.
>> Instead, a parent device should be used.
>>
>> To this end, extend the rte_eth_dev_data structure to include the port ID
>> of the backing device for representors.
>>
>> Signed-off-by: Viacheslav Galaktionov <viacheslav.galaktionov@oktetlabs.ru>
>> Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
>> ---
>> The new field is added into the hole in rte_eth_dev_data structure.
>> The patch does not change ABI, but extra care is required since ABI
>> check is disabled for the structure because of the libabigail bug [1].
>>
>> Potentially it is bad for out-of-tree drivers which implement
>> representors but do not fill in a new parert_port_id field in
>> rte_eth_dev_data structure. Do we care?
> 
> Set the `parent_port_id` to ' RTE_MAX_ETHPORTS' as an invalid port ID
> in rte_eth_dev_allocate ?

I like the idea. It should be safer this way. Many thanks.

^ permalink raw reply	[relevance 0%]

* Re: [dpdk-dev] [PATCH] doc: announce change in vfio dma mapping
  2021-08-31 16:01  3% ` Ferruh Yigit
@ 2021-09-01  1:41  0%   ` Ding, Xuan
  2021-09-01  9:56  3%     ` Ferruh Yigit
  0 siblings, 1 reply; 200+ results
From: Ding, Xuan @ 2021-09-01  1:41 UTC (permalink / raw)
  To: Yigit, Ferruh, dev, Burakov, Anatoly
  Cc: maxime.coquelin, Xia, Chenbo, Hu, Jiayu, Richardson, Bruce

Hi Ferruh,

> -----Original Message-----
> From: Yigit, Ferruh <ferruh.yigit@intel.com>
> Sent: Wednesday, September 1, 2021 12:01 AM
> To: Ding, Xuan <xuan.ding@intel.com>; dev@dpdk.org; Burakov, Anatoly
> <anatoly.burakov@intel.com>
> Cc: maxime.coquelin@redhat.com; Xia, Chenbo <chenbo.xia@intel.com>; Hu,
> Jiayu <jiayu.hu@intel.com>; Richardson, Bruce <bruce.richardson@intel.com>
> Subject: Re: [PATCH] doc: announce change in vfio dma mapping
> 
> On 8/31/2021 2:10 PM, Xuan Ding wrote:
> > Currently, the VFIO subsystem will compact adjacent DMA regions for the
> > purposes of saving space in the internal list of mappings. This has a
> > side effect of compacting two separate mappings that just happen to be
> > adjacent in memory. Since VFIO implementation on IA platforms also does
> > not allow partial unmapping of memory mapped for DMA, the current
> DPDK
> > VFIO implementation will prevent unmapping of accidentally adjacent
> > maps even though it could have been unmapped [1].
> >
> > The proper fix for this issue is to change the VFIO DMA mapping API to
> > also include page size, and always map memory page-by-page.
> >
> > [1] https://mails.dpdk.org/archives/dev/2021-July/213493.html
> >
> > Signed-off-by: Xuan Ding <xuan.ding@intel.com>
> > ---
> >  doc/guides/rel_notes/deprecation.rst | 3 +++
> >  1 file changed, 3 insertions(+)
> >
> > diff --git a/doc/guides/rel_notes/deprecation.rst
> b/doc/guides/rel_notes/deprecation.rst
> > index 76a4abfd6b..1234420caf 100644
> > --- a/doc/guides/rel_notes/deprecation.rst
> > +++ b/doc/guides/rel_notes/deprecation.rst
> > @@ -287,3 +287,6 @@ Deprecation Notices
> >    reserved bytes to 2 (from 3), and use 1 byte to indicate warnings and
> other
> >    information from the crypto/security operation. This field will be used to
> >    communicate events such as soft expiry with IPsec in lookaside mode.
> > +
> > +* vfio: the functions `rte_vfio_container_dma_map` will be amended to
> > +  include page size. This change is targeted for DPDK 22.02.
> >
> 
> Is this means adding a new parameter to API?
> If so this is an ABI/API break and we can't do this change in the 22.02.

Our original plan is add a new parameter in order not to use a new function name, so you mean, any changes to the API can only be done in the LTS version?
If so, we can only add a new API and retire the old one in 22.11.

Thanks for you classification.

^ permalink raw reply	[relevance 0%]

* Re: [dpdk-dev] [PATCH v4] ethdev: fix representor port ID search by name
  2021-08-31 16:06  3% ` [dpdk-dev] [PATCH v4] " Andrew Rybchenko
  2021-08-31 16:32  0%   ` Wang, Haiyue
@ 2021-09-01  5:15  0%   ` Xing, Beilei
  2021-09-01 14:55  0%   ` Ferruh Yigit
  2 siblings, 0 replies; 200+ results
From: Xing, Beilei @ 2021-09-01  5:15 UTC (permalink / raw)
  To: Andrew Rybchenko, Ajit Khaparde, Somnath Kotur, Daley, John,
	Hyong Youb Kim, Yang, Qiming, Zhang, Qi Z, Wang, Haiyue,
	Matan Azrad, Shahaf Shuler, Viacheslav Ovsiienko,
	Thomas Monjalon, Yigit, Ferruh
  Cc: dev, Viacheslav Galaktionov



> -----Original Message-----
> From: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
> Sent: Wednesday, September 1, 2021 12:06 AM
> To: Ajit Khaparde <ajit.khaparde@broadcom.com>; Somnath Kotur
> <somnath.kotur@broadcom.com>; Daley, John <johndale@cisco.com>;
> Hyong Youb Kim <hyonkim@cisco.com>; Xing, Beilei <beilei.xing@intel.com>;
> Yang, Qiming <qiming.yang@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>;
> Wang, Haiyue <haiyue.wang@intel.com>; Matan Azrad
> <matan@nvidia.com>; Shahaf Shuler <shahafs@nvidia.com>; Viacheslav
> Ovsiienko <viacheslavo@nvidia.com>; Thomas Monjalon
> <thomas@monjalon.net>; Yigit, Ferruh <ferruh.yigit@intel.com>
> Cc: dev@dpdk.org; Viacheslav Galaktionov
> <viacheslav.galaktionov@oktetlabs.ru>
> Subject: [PATCH v4] ethdev: fix representor port ID search by name
> 
> From: Viacheslav Galaktionov <viacheslav.galaktionov@oktetlabs.ru>
> 
> Getting a list of representors from a representor does not make sense.
> Instead, a parent device should be used.
> 
> To this end, extend the rte_eth_dev_data structure to include the port ID of
> the backing device for representors.
> 
> Signed-off-by: Viacheslav Galaktionov <viacheslav.galaktionov@oktetlabs.ru>
> Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
> ---
> The new field is added into the hole in rte_eth_dev_data structure.
> The patch does not change ABI, but extra care is required since ABI check is
> disabled for the structure because of the libabigail bug [1].
> 
> Potentially it is bad for out-of-tree drivers which implement representors but
> do not fill in a new parert_port_id field in rte_eth_dev_data structure. Do we
> care?
> 
> mlx5 changes should be reviwed by maintainers very carefully, since we are
> not sure if we patch it correctly.
> 
> [1] https://sourceware.org/bugzilla/show_bug.cgi?id=28060
> 
> v4:
>     - apply mlx5 review notes: remove fallback from generic ethdev
>       code and add fallback to mlx5 code to handle legacy usecase
> 
> v3:
>     - fix mlx5 build breakage
> 
> v2:
>     - fix mlx5 review notes
>     - try device port ID first before parent in order to address
>       backward compatibility issue
> 
>  drivers/net/bnxt/bnxt_reps.c             |  1 +
>  drivers/net/enic/enic_vf_representor.c   |  1 +
>  drivers/net/i40e/i40e_vf_representor.c   |  1 +
>  drivers/net/ice/ice_dcf_vf_representor.c |  1 +
> drivers/net/ixgbe/ixgbe_vf_representor.c |  1 +
>  drivers/net/mlx5/linux/mlx5_os.c         | 13 +++++++++++++
>  drivers/net/mlx5/windows/mlx5_os.c       | 13 +++++++++++++
>  lib/ethdev/ethdev_driver.h               |  6 +++---
>  lib/ethdev/rte_class_eth.c               |  2 +-
>  lib/ethdev/rte_ethdev.c                  |  8 ++++----
>  lib/ethdev/rte_ethdev_core.h             |  6 ++++++
>  11 files changed, 45 insertions(+), 8 deletions(-)
> 

For i40e part,
Acked-by: Beilei Xing <beilei.xing@intel.com>

^ permalink raw reply	[relevance 0%]

* [dpdk-dev] [PATCH v1 0/3] Promote some API to stable
@ 2021-09-01  5:07  3% Haiyue Wang
  2021-09-01  5:07  3% ` [dpdk-dev] [PATCH v1 1/3] net/ixgbe: promote " Haiyue Wang
                   ` (3 more replies)
  0 siblings, 4 replies; 200+ results
From: Haiyue Wang @ 2021-09-01  5:07 UTC (permalink / raw)
  To: dev; +Cc: mdr, thomas, Haiyue Wang

According to DPDK ABI Policy, section 3.5.3.
https://doc.dpdk.org/guides/contributing/abi_policy.html

Promote some API reported by DPDK Symbol Bot to stable.

Haiyue Wang (3):
  net/ixgbe: promote some API to stable
  net/ice: promote some API to stable
  ethdev: promote burst mode API to stable

 drivers/net/ice/rte_pmd_ice.h     |  3 ---
 drivers/net/ice/version.map       | 11 ++++-------
 drivers/net/ixgbe/rte_pmd_ixgbe.h |  5 -----
 drivers/net/ixgbe/version.map     | 10 +++++-----
 lib/ethdev/rte_ethdev.h           |  2 --
 lib/ethdev/version.map            |  4 ++--
 6 files changed, 11 insertions(+), 24 deletions(-)

-- 
2.33.0


^ permalink raw reply	[relevance 3%]

* [dpdk-dev] [PATCH v1 1/3] net/ixgbe: promote some API to stable
  2021-09-01  5:07  3% [dpdk-dev] [PATCH v1 0/3] Promote some API to stable Haiyue Wang
@ 2021-09-01  5:07  3% ` Haiyue Wang
  2021-09-01  9:02  0%   ` Ferruh Yigit
  2021-09-01  5:07  3% ` [dpdk-dev] [PATCH v1 2/3] net/ice: " Haiyue Wang
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 200+ results
From: Haiyue Wang @ 2021-09-01  5:07 UTC (permalink / raw)
  To: dev; +Cc: mdr, thomas, Haiyue Wang

The DPDK Symbol Bot reports:
Please note the symbols listed below have expired. In line with the
DPDK ABI policy, they should be scheduled for removal, in the next
DPDK release.

Symbol
rte_pmd_ixgbe_mdio_lock
rte_pmd_ixgbe_mdio_unlock
rte_pmd_ixgbe_mdio_unlocked_read
rte_pmd_ixgbe_mdio_unlocked_write
rte_pmd_ixgbe_upd_fctrl_sbp

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
---
 drivers/net/ixgbe/rte_pmd_ixgbe.h |  5 -----
 drivers/net/ixgbe/version.map     | 10 +++++-----
 2 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/drivers/net/ixgbe/rte_pmd_ixgbe.h b/drivers/net/ixgbe/rte_pmd_ixgbe.h
index 90fc8160b1..7fcdbe7452 100644
--- a/drivers/net/ixgbe/rte_pmd_ixgbe.h
+++ b/drivers/net/ixgbe/rte_pmd_ixgbe.h
@@ -586,7 +586,6 @@ int rte_pmd_ixgbe_bypass_wd_reset(uint16_t port);
  *   - (-ENODEV) if *port* invalid.
  *   - (IXGBE_ERR_SWFW_SYNC) If sw/fw semaphore acquisition failed
  */
-__rte_experimental
 int
 rte_pmd_ixgbe_mdio_lock(uint16_t port);
 
@@ -600,7 +599,6 @@ rte_pmd_ixgbe_mdio_lock(uint16_t port);
  *   - (-ENOTSUP) if hardware doesn't support.
  *   - (-ENODEV) if *port* invalid.
  */
-__rte_experimental
 int
 rte_pmd_ixgbe_mdio_unlock(uint16_t port);
 
@@ -622,7 +620,6 @@ rte_pmd_ixgbe_mdio_unlock(uint16_t port);
  *   - (-ENODEV) if *port* invalid.
  *   - (IXGBE_ERR_PHY) If PHY read command failed
  */
-__rte_experimental
 int
 rte_pmd_ixgbe_mdio_unlocked_read(uint16_t port, uint32_t reg_addr,
 				 uint32_t dev_type, uint16_t *phy_data);
@@ -646,7 +643,6 @@ rte_pmd_ixgbe_mdio_unlocked_read(uint16_t port, uint32_t reg_addr,
  *   - (-ENODEV) if *port* invalid.
  *   - (IXGBE_ERR_PHY) If PHY read command failed
  */
-__rte_experimental
 int
 rte_pmd_ixgbe_mdio_unlocked_write(uint16_t port, uint32_t reg_addr,
 				  uint32_t dev_type, uint16_t phy_data);
@@ -725,7 +721,6 @@ enum {
  *   - (-ENODEV) if *port* invalid.
  *   - (-ENOTSUP) if hardware doesn't support this feature.
  */
-__rte_experimental
 int
 rte_pmd_ixgbe_upd_fctrl_sbp(uint16_t port, int enable);
 
diff --git a/drivers/net/ixgbe/version.map b/drivers/net/ixgbe/version.map
index bca5cc5826..f0f29d8749 100644
--- a/drivers/net/ixgbe/version.map
+++ b/drivers/net/ixgbe/version.map
@@ -16,6 +16,10 @@ DPDK_22 {
 	rte_pmd_ixgbe_macsec_enable;
 	rte_pmd_ixgbe_macsec_select_rxsa;
 	rte_pmd_ixgbe_macsec_select_txsa;
+	rte_pmd_ixgbe_mdio_lock;
+	rte_pmd_ixgbe_mdio_unlock;
+	rte_pmd_ixgbe_mdio_unlocked_read;
+	rte_pmd_ixgbe_mdio_unlocked_write;
 	rte_pmd_ixgbe_ping_vf;
 	rte_pmd_ixgbe_set_all_queues_drop_en;
 	rte_pmd_ixgbe_set_tc_bw_alloc;
@@ -31,6 +35,7 @@ DPDK_22 {
 	rte_pmd_ixgbe_set_vf_vlan_filter;
 	rte_pmd_ixgbe_set_vf_vlan_insert;
 	rte_pmd_ixgbe_set_vf_vlan_stripq;
+	rte_pmd_ixgbe_upd_fctrl_sbp;
 
 	local: *;
 };
@@ -40,9 +45,4 @@ EXPERIMENTAL {
 
 	rte_pmd_ixgbe_get_fdir_info;
 	rte_pmd_ixgbe_get_fdir_stats;
-	rte_pmd_ixgbe_mdio_lock;
-	rte_pmd_ixgbe_mdio_unlock;
-	rte_pmd_ixgbe_mdio_unlocked_read;
-	rte_pmd_ixgbe_mdio_unlocked_write;
-	rte_pmd_ixgbe_upd_fctrl_sbp;
 };
-- 
2.33.0


^ permalink raw reply	[relevance 3%]

* [dpdk-dev] [PATCH v1 2/3] net/ice: promote some API to stable
  2021-09-01  5:07  3% [dpdk-dev] [PATCH v1 0/3] Promote some API to stable Haiyue Wang
  2021-09-01  5:07  3% ` [dpdk-dev] [PATCH v1 1/3] net/ixgbe: promote " Haiyue Wang
@ 2021-09-01  5:07  3% ` Haiyue Wang
  2021-09-01  5:07  3% ` [dpdk-dev] [PATCH v1 3/3] ethdev: promote burst mode " Haiyue Wang
  2021-09-06  5:56  3% ` [dpdk-dev] [PATCH v2] " Haiyue Wang
  3 siblings, 0 replies; 200+ results
From: Haiyue Wang @ 2021-09-01  5:07 UTC (permalink / raw)
  To: dev; +Cc: mdr, thomas, Haiyue Wang, Qiming Yang, Qi Zhang

The DPDK Symbol Bot reports:
Please note the symbols listed below have expired. In line with the
DPDK ABI policy, they should be scheduled for removal, in the next
DPDK release.

Symbol
rte_net_ice_dynfield_proto_xtr_metadata_offs
rte_net_ice_dynflag_proto_xtr_vlan_mask
rte_net_ice_dynflag_proto_xtr_ipv4_mask
rte_net_ice_dynflag_proto_xtr_ipv6_mask
rte_net_ice_dynflag_proto_xtr_ipv6_flow_mask
rte_net_ice_dynflag_proto_xtr_tcp_mask

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
---
 drivers/net/ice/rte_pmd_ice.h |  3 ---
 drivers/net/ice/version.map   | 11 ++++-------
 2 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/drivers/net/ice/rte_pmd_ice.h b/drivers/net/ice/rte_pmd_ice.h
index 9a436a140b..c0f19fcc89 100644
--- a/drivers/net/ice/rte_pmd_ice.h
+++ b/drivers/net/ice/rte_pmd_ice.h
@@ -149,7 +149,6 @@ extern uint64_t rte_net_ice_dynflag_proto_xtr_ip_offset_mask;
  * @return
  *   True if registered, false otherwise.
  */
-__rte_experimental
 static __rte_always_inline int
 rte_net_ice_dynf_proto_xtr_metadata_avail(void)
 {
@@ -164,7 +163,6 @@ rte_net_ice_dynf_proto_xtr_metadata_avail(void)
  * @return
  *   The saved protocol extraction metadata.
  */
-__rte_experimental
 static __rte_always_inline uint32_t
 rte_net_ice_dynf_proto_xtr_metadata_get(struct rte_mbuf *m)
 {
@@ -177,7 +175,6 @@ rte_net_ice_dynf_proto_xtr_metadata_get(struct rte_mbuf *m)
  * @param m
  *    The pointer to the mbuf.
  */
-__rte_experimental
 static inline void
 rte_net_ice_dump_proto_xtr_metadata(struct rte_mbuf *m)
 {
diff --git a/drivers/net/ice/version.map b/drivers/net/ice/version.map
index cc837f1c00..1a633fd95e 100644
--- a/drivers/net/ice/version.map
+++ b/drivers/net/ice/version.map
@@ -1,16 +1,13 @@
 DPDK_22 {
-	local: *;
-};
-
-EXPERIMENTAL {
 	global:
 
-	# added in 19.11
 	rte_net_ice_dynfield_proto_xtr_metadata_offs;
-	rte_net_ice_dynflag_proto_xtr_vlan_mask;
+	rte_net_ice_dynflag_proto_xtr_ip_offset_mask;
 	rte_net_ice_dynflag_proto_xtr_ipv4_mask;
 	rte_net_ice_dynflag_proto_xtr_ipv6_mask;
 	rte_net_ice_dynflag_proto_xtr_ipv6_flow_mask;
 	rte_net_ice_dynflag_proto_xtr_tcp_mask;
-	rte_net_ice_dynflag_proto_xtr_ip_offset_mask;
+	rte_net_ice_dynflag_proto_xtr_vlan_mask;
+
+	local: *;
 };
-- 
2.33.0


^ permalink raw reply	[relevance 3%]

* [dpdk-dev] [PATCH v1 3/3] ethdev: promote burst mode API to stable
  2021-09-01  5:07  3% [dpdk-dev] [PATCH v1 0/3] Promote some API to stable Haiyue Wang
  2021-09-01  5:07  3% ` [dpdk-dev] [PATCH v1 1/3] net/ixgbe: promote " Haiyue Wang
  2021-09-01  5:07  3% ` [dpdk-dev] [PATCH v1 2/3] net/ice: " Haiyue Wang
@ 2021-09-01  5:07  3% ` Haiyue Wang
  2021-09-01  9:07  0%   ` Ferruh Yigit
  2021-09-06  5:56  3% ` [dpdk-dev] [PATCH v2] " Haiyue Wang
  3 siblings, 1 reply; 200+ results
From: Haiyue Wang @ 2021-09-01  5:07 UTC (permalink / raw)
  To: dev; +Cc: mdr, thomas, Haiyue Wang, Ferruh Yigit, Andrew Rybchenko

The DPDK Symbol Bot reports:
Please note the symbols listed below have expired. In line with the
DPDK ABI policy, they should be scheduled for removal, in the next
DPDK release.

Symbol
rte_eth_rx_burst_mode_get
rte_eth_tx_burst_mode_get

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
---
 lib/ethdev/rte_ethdev.h | 2 --
 lib/ethdev/version.map  | 4 ++--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h
index d2b27c351f..3277e8f8fb 100644
--- a/lib/ethdev/rte_ethdev.h
+++ b/lib/ethdev/rte_ethdev.h
@@ -4361,7 +4361,6 @@ int rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id,
  *   - -ENOTSUP: routine is not supported by the device PMD.
  *   - -EINVAL:  The queue_id is out of range.
  */
-__rte_experimental
 int rte_eth_rx_burst_mode_get(uint16_t port_id, uint16_t queue_id,
 	struct rte_eth_burst_mode *mode);
 
@@ -4383,7 +4382,6 @@ int rte_eth_rx_burst_mode_get(uint16_t port_id, uint16_t queue_id,
  *   - -ENOTSUP: routine is not supported by the device PMD.
  *   - -EINVAL:  The queue_id is out of range.
  */
-__rte_experimental
 int rte_eth_tx_burst_mode_get(uint16_t port_id, uint16_t queue_id,
 	struct rte_eth_burst_mode *mode);
 
diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map
index 3eece75b72..6a12b0664a 100644
--- a/lib/ethdev/version.map
+++ b/lib/ethdev/version.map
@@ -87,6 +87,7 @@ DPDK_22 {
 	rte_eth_promiscuous_get;
 	rte_eth_remove_rx_callback;
 	rte_eth_remove_tx_callback;
+	rte_eth_rx_burst_mode_get;
 	rte_eth_rx_queue_info_get;
 	rte_eth_rx_queue_setup;
 	rte_eth_set_queue_rate_limit;
@@ -104,6 +105,7 @@ DPDK_22 {
 	rte_eth_tx_buffer_drop_callback;
 	rte_eth_tx_buffer_init;
 	rte_eth_tx_buffer_set_err_callback;
+	rte_eth_tx_burst_mode_get;
 	rte_eth_tx_done_cleanup;
 	rte_eth_tx_queue_info_get;
 	rte_eth_tx_queue_setup;
@@ -166,9 +168,7 @@ EXPERIMENTAL {
 
 	# added in 19.11
 	rte_eth_dev_hairpin_capability_get;
-	rte_eth_rx_burst_mode_get;
 	rte_eth_rx_hairpin_queue_setup;
-	rte_eth_tx_burst_mode_get;
 	rte_eth_tx_hairpin_queue_setup;
 	rte_flow_dynf_metadata_offs;
 	rte_flow_dynf_metadata_mask;
-- 
2.33.0


^ permalink raw reply	[relevance 3%]

* Re: [dpdk-dev] [EXT] Re: [RFC 11/15] eventdev: reserve fields in timer object
  @ 2021-09-01  6:48  0%     ` Pavan Nikhilesh Bhagavatula
  2021-09-07 21:02  0%       ` Carrillo, Erik G
  0 siblings, 1 reply; 200+ results
From: Pavan Nikhilesh Bhagavatula @ 2021-09-01  6:48 UTC (permalink / raw)
  To: Stephen Hemminger, Erik Gabriel Carrillo
  Cc: Jerin Jacob Kollanukkaran, konstantin.ananyev, dev

>On Tue, 24 Aug 2021 01:10:15 +0530
><pbhagavatula@marvell.com> wrote:
>
>> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>>
>> Reserve fields in rte_event_timer data structure to address future
>> use cases.
>> Also, remove volatile from rte_event_timer.
>>
>> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
>
>Reserve fields are not a good idea. They don't solve future API/ABI
>problems.
>
>The issue is that you need to zero them and check they are zero
>otherwise
>they can't safely be used later.  This happened with the Linux kernel
>system calls where in several cases a flag field was added for future.
>The problem is that old programs would work with any garbage in the
>flag
>field, and therefore the flag could not be extended.

The change is in rte_event_timer which is a fastpath object similar to 
rte_mbuf.
I think fast path objects don't have the above mentioned caveat.

>
>A better way to make structures internal opaque objects that
>can be resized.  Why is rte_event_timer_adapter exposed in API?

rte_event_timer_adapter has similar API semantics of  rte_mempool, 
the objects of the adapter are rte_event_timer objects which have
information of the timer state.

Erik,

I think we should move the fields in current rte_event_timer structure
around, currently we have

struct rte_event_timer {
	struct rte_event ev;
	volatile enum rte_event_timer_state state;
              x-------x 4 byte hole x---------x
	uint64_t timeout_ticks;
	uint64_t impl_opaque[2];
	uint8_t user_meta[0];
} __rte_cache_aligned;

Move to

struct rte_event_timer {
	struct rte_event ev;
	uint64_t timeout_ticks;
	uint64_t impl_opaque[2];
	uint64_t rsvd;
	enum rte_event_timer_state state;
	uint8_t user_meta[0];
} __rte_cache_aligned;

Since its cache aligned, the size doesn't change.

Thoughts?

Thanks,
Pavan.


^ permalink raw reply	[relevance 0%]

* Re: [dpdk-dev] [PATCH v1 1/3] net/ixgbe: promote some API to stable
  2021-09-01  5:07  3% ` [dpdk-dev] [PATCH v1 1/3] net/ixgbe: promote " Haiyue Wang
@ 2021-09-01  9:02  0%   ` Ferruh Yigit
  2021-09-01 11:13  3%     ` Wang, Haiyue
  0 siblings, 1 reply; 200+ results
From: Ferruh Yigit @ 2021-09-01  9:02 UTC (permalink / raw)
  To: Haiyue Wang, dev; +Cc: mdr, thomas

On 9/1/2021 6:07 AM, Haiyue Wang wrote:
> The DPDK Symbol Bot reports:
> Please note the symbols listed below have expired. In line with the
> DPDK ABI policy, they should be scheduled for removal, in the next
> DPDK release.
> 
> Symbol
> rte_pmd_ixgbe_mdio_lock
> rte_pmd_ixgbe_mdio_unlock
> rte_pmd_ixgbe_mdio_unlocked_read
> rte_pmd_ixgbe_mdio_unlocked_write
> rte_pmd_ixgbe_upd_fctrl_sbp

I wonder if we should keep PMD specific APIs as experimental (Not talking about
mbuf 'dynfield' / 'dynflag' APIs, we can promote them).

If an application is using PMD specific API, not sure if it will concern about
PMD specific APIs.
And keeping PMD specific APIs lets us remove them as soon as we can, also adds
additional discourage for users to use them.

> 
> Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>


<...>



^ permalink raw reply	[relevance 0%]

* Re: [dpdk-dev] [PATCH v1 3/3] ethdev: promote burst mode API to stable
  2021-09-01  5:07  3% ` [dpdk-dev] [PATCH v1 3/3] ethdev: promote burst mode " Haiyue Wang
@ 2021-09-01  9:07  0%   ` Ferruh Yigit
  2021-09-01 13:49  0%     ` Kinsella, Ray
  0 siblings, 1 reply; 200+ results
From: Ferruh Yigit @ 2021-09-01  9:07 UTC (permalink / raw)
  To: Haiyue Wang, dev; +Cc: mdr, thomas, Andrew Rybchenko

On 9/1/2021 6:07 AM, Haiyue Wang wrote:
> The DPDK Symbol Bot reports:
> Please note the symbols listed below have expired. In line with the
> DPDK ABI policy, they should be scheduled for removal, in the next
> DPDK release.
> 
> Symbol
> rte_eth_rx_burst_mode_get
> rte_eth_tx_burst_mode_get
> 
> Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>

Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>

^ permalink raw reply	[relevance 0%]

* Re: [dpdk-dev] [PATCH] doc: announce change in vfio dma mapping
  2021-09-01  1:41  0%   ` Ding, Xuan
@ 2021-09-01  9:56  3%     ` Ferruh Yigit
  2021-09-01 11:01  0%       ` Burakov, Anatoly
  0 siblings, 1 reply; 200+ results
From: Ferruh Yigit @ 2021-09-01  9:56 UTC (permalink / raw)
  To: Ding, Xuan, dev, Burakov, Anatoly
  Cc: maxime.coquelin, Xia, Chenbo, Hu, Jiayu, Richardson, Bruce

On 9/1/2021 2:41 AM, Ding, Xuan wrote:
> Hi Ferruh,
> 
>> -----Original Message-----
>> From: Yigit, Ferruh <ferruh.yigit@intel.com>
>> Sent: Wednesday, September 1, 2021 12:01 AM
>> To: Ding, Xuan <xuan.ding@intel.com>; dev@dpdk.org; Burakov, Anatoly
>> <anatoly.burakov@intel.com>
>> Cc: maxime.coquelin@redhat.com; Xia, Chenbo <chenbo.xia@intel.com>; Hu,
>> Jiayu <jiayu.hu@intel.com>; Richardson, Bruce <bruce.richardson@intel.com>
>> Subject: Re: [PATCH] doc: announce change in vfio dma mapping
>>
>> On 8/31/2021 2:10 PM, Xuan Ding wrote:
>>> Currently, the VFIO subsystem will compact adjacent DMA regions for the
>>> purposes of saving space in the internal list of mappings. This has a
>>> side effect of compacting two separate mappings that just happen to be
>>> adjacent in memory. Since VFIO implementation on IA platforms also does
>>> not allow partial unmapping of memory mapped for DMA, the current
>> DPDK
>>> VFIO implementation will prevent unmapping of accidentally adjacent
>>> maps even though it could have been unmapped [1].
>>>
>>> The proper fix for this issue is to change the VFIO DMA mapping API to
>>> also include page size, and always map memory page-by-page.
>>>
>>> [1] https://mails.dpdk.org/archives/dev/2021-July/213493.html
>>>
>>> Signed-off-by: Xuan Ding <xuan.ding@intel.com>
>>> ---
>>>  doc/guides/rel_notes/deprecation.rst | 3 +++
>>>  1 file changed, 3 insertions(+)
>>>
>>> diff --git a/doc/guides/rel_notes/deprecation.rst
>> b/doc/guides/rel_notes/deprecation.rst
>>> index 76a4abfd6b..1234420caf 100644
>>> --- a/doc/guides/rel_notes/deprecation.rst
>>> +++ b/doc/guides/rel_notes/deprecation.rst
>>> @@ -287,3 +287,6 @@ Deprecation Notices
>>>    reserved bytes to 2 (from 3), and use 1 byte to indicate warnings and
>> other
>>>    information from the crypto/security operation. This field will be used to
>>>    communicate events such as soft expiry with IPsec in lookaside mode.
>>> +
>>> +* vfio: the functions `rte_vfio_container_dma_map` will be amended to
>>> +  include page size. This change is targeted for DPDK 22.02.
>>>
>>
>> Is this means adding a new parameter to API?
>> If so this is an ABI/API break and we can't do this change in the 22.02.
> 
> Our original plan is add a new parameter in order not to use a new function name, so you mean, any changes to the API can only be done in the LTS version?
> If so, we can only add a new API and retire the old one in 22.11.
> 

We can add a new API anytime. Adding new parameter to an existing API can be
done on the ABI break release.

You can add the new API in this release, and start using it.
And mark the old API as deprecated in this release. This lets existing binaries
to keep using it, but app needs to switch to new API for compilation.
Old API can be removed on 22.11, and you will need a deprecation notice before
22.11 for it.

Is above plan works for you?


^ permalink raw reply	[relevance 3%]

* Re: [dpdk-dev] [PATCH] doc: announce change in vfio dma mapping
  2021-09-01  9:56  3%     ` Ferruh Yigit
@ 2021-09-01 11:01  0%       ` Burakov, Anatoly
  2021-09-01 11:42  4%         ` Ferruh Yigit
  0 siblings, 1 reply; 200+ results
From: Burakov, Anatoly @ 2021-09-01 11:01 UTC (permalink / raw)
  To: Ferruh Yigit, Ding, Xuan, dev
  Cc: maxime.coquelin, Xia, Chenbo, Hu, Jiayu, Richardson, Bruce

On 01-Sep-21 10:56 AM, Ferruh Yigit wrote:
> On 9/1/2021 2:41 AM, Ding, Xuan wrote:
>> Hi Ferruh,
>>
>>> -----Original Message-----
>>> From: Yigit, Ferruh <ferruh.yigit@intel.com>
>>> Sent: Wednesday, September 1, 2021 12:01 AM
>>> To: Ding, Xuan <xuan.ding@intel.com>; dev@dpdk.org; Burakov, Anatoly
>>> <anatoly.burakov@intel.com>
>>> Cc: maxime.coquelin@redhat.com; Xia, Chenbo <chenbo.xia@intel.com>; Hu,
>>> Jiayu <jiayu.hu@intel.com>; Richardson, Bruce <bruce.richardson@intel.com>
>>> Subject: Re: [PATCH] doc: announce change in vfio dma mapping
>>>
>>> On 8/31/2021 2:10 PM, Xuan Ding wrote:
>>>> Currently, the VFIO subsystem will compact adjacent DMA regions for the
>>>> purposes of saving space in the internal list of mappings. This has a
>>>> side effect of compacting two separate mappings that just happen to be
>>>> adjacent in memory. Since VFIO implementation on IA platforms also does
>>>> not allow partial unmapping of memory mapped for DMA, the current
>>> DPDK
>>>> VFIO implementation will prevent unmapping of accidentally adjacent
>>>> maps even though it could have been unmapped [1].
>>>>
>>>> The proper fix for this issue is to change the VFIO DMA mapping API to
>>>> also include page size, and always map memory page-by-page.
>>>>
>>>> [1] https://mails.dpdk.org/archives/dev/2021-July/213493.html
>>>>
>>>> Signed-off-by: Xuan Ding <xuan.ding@intel.com>
>>>> ---
>>>>   doc/guides/rel_notes/deprecation.rst | 3 +++
>>>>   1 file changed, 3 insertions(+)
>>>>
>>>> diff --git a/doc/guides/rel_notes/deprecation.rst
>>> b/doc/guides/rel_notes/deprecation.rst
>>>> index 76a4abfd6b..1234420caf 100644
>>>> --- a/doc/guides/rel_notes/deprecation.rst
>>>> +++ b/doc/guides/rel_notes/deprecation.rst
>>>> @@ -287,3 +287,6 @@ Deprecation Notices
>>>>     reserved bytes to 2 (from 3), and use 1 byte to indicate warnings and
>>> other
>>>>     information from the crypto/security operation. This field will be used to
>>>>     communicate events such as soft expiry with IPsec in lookaside mode.
>>>> +
>>>> +* vfio: the functions `rte_vfio_container_dma_map` will be amended to
>>>> +  include page size. This change is targeted for DPDK 22.02.
>>>>
>>>
>>> Is this means adding a new parameter to API?
>>> If so this is an ABI/API break and we can't do this change in the 22.02.
>>
>> Our original plan is add a new parameter in order not to use a new function name, so you mean, any changes to the API can only be done in the LTS version?
>> If so, we can only add a new API and retire the old one in 22.11.
>>
> 
> We can add a new API anytime. Adding new parameter to an existing API can be
> done on the ABI break release.

So, 22.11 then?

> 
> You can add the new API in this release, and start using it.
> And mark the old API as deprecated in this release. This lets existing binaries
> to keep using it, but app needs to switch to new API for compilation.
> Old API can be removed on 22.11, and you will need a deprecation notice before
> 22.11 for it.
> 
> Is above plan works for you?
> 

We have slightly rethought our approach, and the functionality that Xuan 
requires does not rely on this API. They can, for all intents and 
purposes, be considered unrelated issues.

I still think it's a good idea to update the API that way, so I would 
like to do that, and if we have to wait until 22.11 to fix it, I'm OK 
with that. Since there no longer is any urgency here, it's acceptable to 
wait for the next LTS to break it.

-- 
Thanks,
Anatoly

^ permalink raw reply	[relevance 0%]

* Re: [dpdk-dev] [PATCH v1 1/3] net/ixgbe: promote some API to stable
  2021-09-01  9:02  0%   ` Ferruh Yigit
@ 2021-09-01 11:13  3%     ` Wang, Haiyue
  2021-09-01 13:55  0%       ` Kinsella, Ray
  0 siblings, 1 reply; 200+ results
From: Wang, Haiyue @ 2021-09-01 11:13 UTC (permalink / raw)
  To: Yigit, Ferruh, dev; +Cc: mdr, thomas

> -----Original Message-----
> From: Yigit, Ferruh <ferruh.yigit@intel.com>
> Sent: Wednesday, September 1, 2021 17:02
> To: Wang, Haiyue <haiyue.wang@intel.com>; dev@dpdk.org
> Cc: mdr@ashroe.eu; thomas@monjalon.net
> Subject: Re: [dpdk-dev] [PATCH v1 1/3] net/ixgbe: promote some API to stable
> 
> On 9/1/2021 6:07 AM, Haiyue Wang wrote:
> > The DPDK Symbol Bot reports:
> > Please note the symbols listed below have expired. In line with the
> > DPDK ABI policy, they should be scheduled for removal, in the next
> > DPDK release.
> >
> > Symbol
> > rte_pmd_ixgbe_mdio_lock
> > rte_pmd_ixgbe_mdio_unlock
> > rte_pmd_ixgbe_mdio_unlocked_read
> > rte_pmd_ixgbe_mdio_unlocked_write
> > rte_pmd_ixgbe_upd_fctrl_sbp
> 
> I wonder if we should keep PMD specific APIs as experimental (Not talking about
> mbuf 'dynfield' / 'dynflag' APIs, we can promote them).

Yes, makes sense.

> 
> If an application is using PMD specific API, not sure if it will concern about
> PMD specific APIs.
> And keeping PMD specific APIs lets us remove them as soon as we can, also adds
> additional discourage for users to use them.

Can update this to DPDK ABI Policy, section 3.5.3.
https://doc.dpdk.org/guides/contributing/abi_policy.html

> 
> >
> > Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
> 
> 
> <...>
> 


^ permalink raw reply	[relevance 3%]

* Re: [dpdk-dev] [PATCH] doc: announce change in vfio dma mapping
  2021-09-01 11:01  0%       ` Burakov, Anatoly
@ 2021-09-01 11:42  4%         ` Ferruh Yigit
  2021-09-01 13:25  4%           ` Burakov, Anatoly
  0 siblings, 1 reply; 200+ results
From: Ferruh Yigit @ 2021-09-01 11:42 UTC (permalink / raw)
  To: Burakov, Anatoly, Ding, Xuan, dev
  Cc: maxime.coquelin, Xia, Chenbo, Hu, Jiayu, Richardson, Bruce,
	Thomas Monjalon, Ray Kinsella

On 9/1/2021 12:01 PM, Burakov, Anatoly wrote:
> On 01-Sep-21 10:56 AM, Ferruh Yigit wrote:
>> On 9/1/2021 2:41 AM, Ding, Xuan wrote:
>>> Hi Ferruh,
>>>
>>>> -----Original Message-----
>>>> From: Yigit, Ferruh <ferruh.yigit@intel.com>
>>>> Sent: Wednesday, September 1, 2021 12:01 AM
>>>> To: Ding, Xuan <xuan.ding@intel.com>; dev@dpdk.org; Burakov, Anatoly
>>>> <anatoly.burakov@intel.com>
>>>> Cc: maxime.coquelin@redhat.com; Xia, Chenbo <chenbo.xia@intel.com>; Hu,
>>>> Jiayu <jiayu.hu@intel.com>; Richardson, Bruce <bruce.richardson@intel.com>
>>>> Subject: Re: [PATCH] doc: announce change in vfio dma mapping
>>>>
>>>> On 8/31/2021 2:10 PM, Xuan Ding wrote:
>>>>> Currently, the VFIO subsystem will compact adjacent DMA regions for the
>>>>> purposes of saving space in the internal list of mappings. This has a
>>>>> side effect of compacting two separate mappings that just happen to be
>>>>> adjacent in memory. Since VFIO implementation on IA platforms also does
>>>>> not allow partial unmapping of memory mapped for DMA, the current
>>>> DPDK
>>>>> VFIO implementation will prevent unmapping of accidentally adjacent
>>>>> maps even though it could have been unmapped [1].
>>>>>
>>>>> The proper fix for this issue is to change the VFIO DMA mapping API to
>>>>> also include page size, and always map memory page-by-page.
>>>>>
>>>>> [1] https://mails.dpdk.org/archives/dev/2021-July/213493.html
>>>>>
>>>>> Signed-off-by: Xuan Ding <xuan.ding@intel.com>
>>>>> ---
>>>>>   doc/guides/rel_notes/deprecation.rst | 3 +++
>>>>>   1 file changed, 3 insertions(+)
>>>>>
>>>>> diff --git a/doc/guides/rel_notes/deprecation.rst
>>>> b/doc/guides/rel_notes/deprecation.rst
>>>>> index 76a4abfd6b..1234420caf 100644
>>>>> --- a/doc/guides/rel_notes/deprecation.rst
>>>>> +++ b/doc/guides/rel_notes/deprecation.rst
>>>>> @@ -287,3 +287,6 @@ Deprecation Notices
>>>>>     reserved bytes to 2 (from 3), and use 1 byte to indicate warnings and
>>>> other
>>>>>     information from the crypto/security operation. This field will be used to
>>>>>     communicate events such as soft expiry with IPsec in lookaside mode.
>>>>> +
>>>>> +* vfio: the functions `rte_vfio_container_dma_map` will be amended to
>>>>> +  include page size. This change is targeted for DPDK 22.02.
>>>>>
>>>>
>>>> Is this means adding a new parameter to API?
>>>> If so this is an ABI/API break and we can't do this change in the 22.02.
>>>
>>> Our original plan is add a new parameter in order not to use a new function
>>> name, so you mean, any changes to the API can only be done in the LTS version?
>>> If so, we can only add a new API and retire the old one in 22.11.
>>>
>>
>> We can add a new API anytime. Adding new parameter to an existing API can be
>> done on the ABI break release.
> 
> So, 22.11 then?
> 

Yes.

>>
>> You can add the new API in this release, and start using it.
>> And mark the old API as deprecated in this release. This lets existing binaries
>> to keep using it, but app needs to switch to new API for compilation.
>> Old API can be removed on 22.11, and you will need a deprecation notice before
>> 22.11 for it.
>>
>> Is above plan works for you?
>>
> 
> We have slightly rethought our approach, and the functionality that Xuan
> requires does not rely on this API. They can, for all intents and purposes, be
> considered unrelated issues.
> 
> I still think it's a good idea to update the API that way, so I would like to do
> that, and if we have to wait until 22.11 to fix it, I'm OK with that. Since
> there no longer is any urgency here, it's acceptable to wait for the next LTS to
> break it.
> 

Got it.

As far as I understand, main motivation in techboard decision was to prevent the
ABI break as much as possible (main reason of decision wasn't deprecation notice
being late). But if the correct thing to do is to rename the API (and break the
ABI), I don't see the benefit to wait one more year, it is just delaying the
impact and adding overhead to us.
I am for being pragmatic and doing the change in this release if API rename is
better option, perhaps we can visit the issue again in techboard.

Can you please describe why renaming API is better option, comparing to adding
new API with new parameter?

Thanks,
ferruh

^ permalink raw reply	[relevance 4%]

* Re: [dpdk-dev] [PATCH v10 0/3] devtools: scripts to count and track symbols
                       ` (2 preceding siblings ...)
  2021-08-31 14:50 17%   ` [dpdk-dev] [PATCH v10 3/3] maintainers: add new abi scripts Ray Kinsella
@ 2021-09-01 12:31  0%   ` Aaron Conole
  3 siblings, 0 replies; 200+ results
From: Aaron Conole @ 2021-09-01 12:31 UTC (permalink / raw)
  To: Ray Kinsella
  Cc: dev, bruce.richardson, stephen, ferruh.yigit, thomas, ktraynor

Ray Kinsella <mdr@ashroe.eu> writes:

> Scripts to count and track the lifecycle of DPDK symbols.
>
> The symbol-tool script reports on the growth of symbols over releases
> and list expired symbols. The notify-symbol-maintainers script
> consumes the input from symbol-tool and generates email notifications
> of expired symbols.
>
> v2: reworked to fix pylint errors
> v3: sent with the correct in-reply-to
> v4: fix typos picked up by the CI
> v5: fix terminal_size & directory args
> v6: added list-expired, to list expired experimental symbols
> v7: fix typo in comments
> v8: added tool to notify maintainers of expired symbols
> v9: removed hardcoded emails addressed and script names
> v10: added ability to identify and notify the original contributors
>
> Ray Kinsella (3):
>   devtools: script to track symbols over releases
>   devtools: script to send notifications of expired symbols
>   maintainers: add new abi scripts
>
>  MAINTAINERS                           |   2 +
>  devtools/notify-symbol-maintainers.py | 256 ++++++++++++++
>  devtools/symbol-tool.py               | 482 ++++++++++++++++++++++++++
>  3 files changed, 740 insertions(+)
>  create mode 100755 devtools/notify-symbol-maintainers.py
>  create mode 100755 devtools/symbol-tool.py

I get a whole mess of flake8 issues from this series (mostly 'backslash
is redundant' and whitespace issues).  I'm using flake8 because it
pretty well enforces PEP8 style guide.  I would like to see it
addressed, but also I see that many of the python files in the DPDK tree
don't actually pass.  Example::

  $ flake8 ./usertools/dpdk-devbind.py | wc -l
  34
  $ flake8 ./usertools/dpdk-devbind.py | sed 's@./usertools/dpdk-devbind.py[:0-9]* @@' | sort -u
  E128 continuation line under-indented for visual indent
  E302 expected 2 blank lines, found 1
  E305 expected 2 blank lines after class or function definition, found 1
  E501 line too long (105 > 79 characters)
  E501 line too long (80 > 79 characters)
  E501 line too long (82 > 79 characters)
  E501 line too long (83 > 79 characters)
  E501 line too long (84 > 79 characters)
  E501 line too long (85 > 79 characters)
  E501 line too long (86 > 79 characters)
  E501 line too long (91 > 79 characters)
  E502 the backslash is redundant between brackets
  E722 do not use bare 'except'

Looks like we repeat the same kinds of errors everywhere (this is on
multiple tools).  Some of our in-tree python is better than others (like
app/test/autotest.py which only has 1 flake).

Maybe we can address this.  Other comments inline on the patches.


^ permalink raw reply	[relevance 0%]

* Re: [dpdk-dev] [PATCH v10 2/3] devtools: script to send notifications of expired symbols
  2021-08-31 14:50  5%   ` [dpdk-dev] [PATCH v10 2/3] devtools: script to send notifications of expired symbols Ray Kinsella
@ 2021-09-01 12:46  0%     ` Aaron Conole
  2021-09-03 11:15  0%       ` Kinsella, Ray
  2021-09-03 13:32  0%       ` Kinsella, Ray
  2021-09-01 13:01  5%     ` David Marchand
  1 sibling, 2 replies; 200+ results
From: Aaron Conole @ 2021-09-01 12:46 UTC (permalink / raw)
  To: Ray Kinsella
  Cc: dev, bruce.richardson, stephen, ferruh.yigit, thomas, ktraynor

Ray Kinsella <mdr@ashroe.eu> writes:

> Use this script with the output of the DPDK symbol tool, to notify
> maintainers of expired symbols by email. You need to define the environment
> variable DPDK_GETMAINTAINER_PATH for this tool to work.
>
> Use terminal output to review the emails before sending.
> e.g.
> $ devtools/symbol-tool.py list-expired --format-output csv \
> | DPDK_GETMAINTAINER_PATH=<somewhere>/get_maintainer.pl \
> devtools/notify_expired_symbols.py --format-output terminal
>
> Then use email output to send the emails to the maintainers.
> e.g.
> $ devtools/symbol-tool.py list-expired --format-output csv \
> | DPDK_GETMAINTAINER_PATH=<somewhere>/get_maintainer.pl \
> devtools/notify_expired_symbols.py --format-output email \
> --smtp-server <server> --sender <someone@somewhere.com> \
> --password <password> --cc <someone@somewhere.com>
>
> Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
> ---
>  devtools/notify-symbol-maintainers.py | 256 ++++++++++++++++++++++++++
>  1 file changed, 256 insertions(+)
>  create mode 100755 devtools/notify-symbol-maintainers.py
>
> diff --git a/devtools/notify-symbol-maintainers.py b/devtools/notify-symbol-maintainers.py
> new file mode 100755
> index 0000000000..ee554687ff
> --- /dev/null
> +++ b/devtools/notify-symbol-maintainers.py
> @@ -0,0 +1,256 @@
> +#!/usr/bin/env python3
> +# SPDX-License-Identifier: BSD-3-Clause
> +# Copyright(c) 2021 Intel Corporation
> +# pylint: disable=invalid-name
> +'''Tool to notify maintainers of expired symbols'''
> +import smtplib
> +import ssl
> +import sys
> +import subprocess
> +import argparse
> +from argparse import RawTextHelpFormatter
> +import time
> +from email.message import EmailMessage
> +
> +DESCRIPTION = '''
> +Use this script with the output of the DPDK symbol tool, to notify maintainers
> +and contributors of expired symbols by email. You need to define the environment
> +variable DPDK_GETMAINTAINER_PATH for this tool to work.
> +
> +Use terminal output to review the emails before sending.
> +e.g.
> +$ devtools/symbol-tool.py list-expired --format-output csv \\
> +| DPDK_GETMAINTAINER_PATH=<somewhere>/get_maintainer.pl \\
> +{s} --format-output terminal
> +
> +Then use email output to send the emails to the maintainers.
> +e.g.
> +$ devtools/symbol-tool.py list-expired --format-output csv \\
> +| DPDK_GETMAINTAINER_PATH=<somewhere>/get_maintainer.pl \\
> +{s} --format-output email \\
> +--smtp-server <server> --sender <someone@somewhere.com> --password <password> \\
> +--cc <someone@somewhere.com>
> +'''
> +
> +EMAIL_TEMPLATE = '''Hi there,
> +
> +Please note the symbols listed below have expired. In line with the DPDK ABI
> +policy, they should be scheduled for removal, in the next DPDK release.
> +
> +For more information, please see the DPDK ABI Policy, section 3.5.3.
> +https://doc.dpdk.org/guides/contributing/abi_policy.html
> +
> +Thanks,
> +
> +The DPDK Symbol Bot
> +
> +'''
> +
> +ABI_POLICY = 'doc/guides/contributing/abi_policy.rst'
> +MAINTAINERS = 'MAINTAINERS'
> +get_maintainer = ['devtools/get-maintainer.sh', \
> +                  '--email', '-f']

Maybe it's best to make this something that can be overridden.  There's
a series to change the .sh files to .py files.  Perhaps an environment
variable or argument?

> +def _get_maintainers(libpath):
> +    '''Get the maintainers for given library'''
> +    try:
> +        cmd = get_maintainer + [libpath]
> +        result = subprocess.run(cmd, \
> +                                stdout=subprocess.PIPE, \
> +                                stderr=subprocess.PIPE,
> +                                check=True)
> +    except subprocess.CalledProcessError:
> +        return None

You might consider handling

   except FileNotFoundError:
      ....

With a graceful exit and error message.  In case the get_maintainers
path changes.

> +    if result is None:
> +        return None
> +
> +    email = result.stdout.decode('utf-8')
> +    if email == '':
> +        return None
> +
> +    email = list(filter(None,email.split('\n')))
> +    return email
> +
> +default_maintainers = _get_maintainers(ABI_POLICY) + \
> +    _get_maintainers(MAINTAINERS)
> +
> +def get_maintainers(libpath):
> +    '''Get the maintainers for given library'''
> +    maintainers=_get_maintainers(libpath)
> +
> +    if maintainers is None:
> +        maintainers = default_maintainers
> +
> +    return maintainers
> +
> +def get_message(library, symbols, config):
> +    '''Build email message from symbols, config and maintainers'''
> +    contributors = {}
> +    message = {}
> +    maintainers = get_maintainers(library)
> +
> +    if maintainers != default_maintainers:
> +        message['CC'] = default_maintainers.copy()
> +
> +    if 'CC' in config:
> +        message.setdefault('CC',[]).append(config['CC'])
> +
> +    message['Subject'] = 'Expired symbols in {}\n'.format(library)
> +
> +    body = EMAIL_TEMPLATE
> +    body += '{:<50}{:<25}{:<25}\n'.format('Symbol','Contributor','Email')
> +    for sym in symbols:
> +        body += ('{:<50}{:<25}{:<25}\n'.format(sym,\
> +                                               symbols[sym]['name'],
> +                                               symbols[sym]['email'],
> +        ))
> +        email = symbols[sym]['email']
> +        contributors[email] = ''
> +
> +    contributors = list(contributors.keys())
> +
> +    message['To'] = maintainers + contributors
> +    message['Body'] = body
> +
> +    return message
> +
> +class OutputEmail():
> +    '''Format the output for email'''
> +    def __init__(self, config):
> +        self.config = config
> +
> +        self.terminal = OutputTerminal(config)
> +        context = ssl.create_default_context()
> +
> +        # Try to log in to server and send email
> +        try:
> +            self.server = smtplib.SMTP(config['smtp_server'], 587)
> +            self.server.starttls(context=context) # Secure the connection
> +            self.server.login(config['sender'], config['password'])
> +        except Exception as exception:
> +            print(exception)
> +            raise exception
> +
> +    def message(self,message):
> +        '''send email'''
> +        self.terminal.message(message)
> +
> +        msg = EmailMessage()
> +        msg.set_content(message.pop('Body'))
> +
> +        for key in message.keys():
> +            msg[key] = message[key]
> +
> +        msg['From'] = self.config['sender']
> +        msg['Reply-To'] = 'no-reply@dpdk.org'
> +
> +        self.server.send_message(msg)
> +
> +        time.sleep(1)

Why this sleep is needed?

> +
> +    def __del__(self):
> +        self.server.quit()
> +
> +class OutputTerminal(): # pylint: disable=too-few-public-methods
> +    '''Format the output for the terminal'''
> +    def __init__(self, config):
> +        self.config = config
> +
> +    def message(self,message):
> +        '''Print email to terminal'''
> +
> +        terminal = 'To:' + ', '.join(message['To']) + '\n'
> +        if 'sender' in self.config.keys():
> +            terminal += 'From:' + self.config['sender'] + '\n'
> +
> +        terminal += 'Reply-To:' + 'no-reply@dpdk.org' + '\n'
> +
> +        if 'CC' in message:
> +            terminal += 'CC:' + ', '.join(message['CC']) + '\n'
> +
> +        terminal += 'Subject:' + message['Subject'] + '\n'
> +        terminal += 'Body:' + message['Body'] + '\n'
> +
> +        print(terminal)
> +        print('-' * 80)
> +
> +def parse_config(args):
> +    '''put the command line args in the right places'''
> +    config = {}
> +    error_msg = None
> +
> +    outputs = {
> +        None : OutputTerminal,
> +        'terminal' : OutputTerminal,
> +        'email' : OutputEmail
> +    }
> +
> +    if args.format_output == 'email':
> +        if args.smtp_server is None:
> +            error_msg = 'SMTP server'
> +        else:
> +            config['smtp_server'] = args.smtp_server
> +
> +        if args.sender is None:
> +            error_msg = 'sender'
> +        else:
> +            config['sender'] = args.sender
> +
> +        if args.password is None:
> +            error_msg = 'password'
> +        else:
> +            config['password'] = args.password
> +
> +    if args.cc is not None:
> +        config['CC'] = args.cc
> +
> +    if error_msg is not None:
> +        print('Please specify a {} for email output'.format(error_msg))
> +        return None
> +
> +    config['output'] = outputs[args.format_output]
> +    return config
> +
> +def main():
> +    '''Main entry point'''
> +    parser = argparse.ArgumentParser(description=DESCRIPTION.format(s=__file__), \
> +                                     formatter_class=RawTextHelpFormatter)
> +    parser.add_argument('--format-output', choices=['terminal','email'], \
> +                        default='terminal')
> +    parser.add_argument('--smtp-server')
> +    parser.add_argument('--password')
> +    parser.add_argument('--sender')
> +    parser.add_argument('--cc')
> +
> +    args = parser.parse_args()
> +    config = parse_config(args)
> +    if config is None:
> +        return
> +
> +    symbols = {}
> +    lastlib = library = ''
> +
> +    output = config['output'](config)
> +
> +    for line in sys.stdin:
> +        line = line.rstrip('\n')
> +
> +        if line.find('mapfile') >= 0:
> +            continue
> +        library, symbol, name, email = line.split(',')
> +
> +        if library != lastlib:
> +            message = get_message(lastlib, symbols, config)
> +            output.message(message)
> +            symbols = {}
> +
> +        lastlib = library
> +        symbols[symbol] = {'name' : name, 'email' : email}
> +
> +    #print the last library
> +    message = get_message(lastlib, symbols, config)
> +    output.message(message)
> +
> +if __name__ == '__main__':
> +    main()


^ permalink raw reply	[relevance 0%]

* Re: [dpdk-dev] [PATCH v10 2/3] devtools: script to send notifications of expired symbols
  2021-08-31 14:50  5%   ` [dpdk-dev] [PATCH v10 2/3] devtools: script to send notifications of expired symbols Ray Kinsella
  2021-09-01 12:46  0%     ` Aaron Conole
@ 2021-09-01 13:01  5%     ` David Marchand
  2021-09-03 13:28  0%       ` Kinsella, Ray
  1 sibling, 1 reply; 200+ results
From: David Marchand @ 2021-09-01 13:01 UTC (permalink / raw)
  To: Ray Kinsella
  Cc: dev, Bruce Richardson, Stephen Hemminger, Yigit, Ferruh,
	Thomas Monjalon, Kevin Traynor, Aaron Conole

Hello Ray,

On Tue, Aug 31, 2021 at 4:51 PM Ray Kinsella <mdr@ashroe.eu> wrote:
>
> Use this script with the output of the DPDK symbol tool, to notify
> maintainers of expired symbols by email. You need to define the environment
> variable DPDK_GETMAINTAINER_PATH for this tool to work.
>
> Use terminal output to review the emails before sending.

Two comments:
- there are references of a previous name for the script,
%s/notify_expired_symbols.py/notify-symbol-maintainers.py/g

- and a reminder for the empty report that we received yesterday.
I think this can be reproduced with:

$ DPDK_GETMAINTAINER_PATH=devtools/get_maintainer.pl
devtools/notify-symbol-maintainers.py --format-output terminal <<EOF
> mapfile,expired (v21.08,v19.11),contributor name,contributor email
> lib/rib,rte_rib6_get_ip,Stephen Hemminger,stephen@networkplumber.org
> EOF
To:Ray Kinsella <mdr@ashroe.eu>, Thomas Monjalon <thomas@monjalon.net>
Reply-To:no-reply@dpdk.org
Subject:Expired symbols in

Body:Hi there,

Please note the symbols listed below have expired. In line with the DPDK ABI
policy, they should be scheduled for removal, in the next DPDK release.

For more information, please see the DPDK ABI Policy, section 3.5.3.
https://doc.dpdk.org/guides/contributing/abi_policy.html

Thanks,

The DPDK Symbol Bot

Symbol                                            Contributor
    Email


--------------------------------------------------------------------------------

^^^^
Here, empty report.

To:Vladimir Medvedkin <vladimir.medvedkin@intel.com>, stephen@networkplumber.org
Reply-To:no-reply@dpdk.org
CC:Ray Kinsella <mdr@ashroe.eu>, Thomas Monjalon <thomas@monjalon.net>
Subject:Expired symbols in lib/rib

Body:Hi there,

Please note the symbols listed below have expired. In line with the DPDK ABI
policy, they should be scheduled for removal, in the next DPDK release.

For more information, please see the DPDK ABI Policy, section 3.5.3.
https://doc.dpdk.org/guides/contributing/abi_policy.html

Thanks,

The DPDK Symbol Bot

Symbol                                            Contributor
    Email
rte_rib6_get_ip                                   Stephen Hemminger
    stephen@networkplumber.org


--------------------------------------------------------------------------------


-- 
David Marchand


^ permalink raw reply	[relevance 5%]

* Re: [dpdk-dev] [PATCH] doc: announce change in vfio dma mapping
  2021-09-01 11:42  4%         ` Ferruh Yigit
@ 2021-09-01 13:25  4%           ` Burakov, Anatoly
  2021-09-02  9:50  3%             ` Ferruh Yigit
  0 siblings, 1 reply; 200+ results
From: Burakov, Anatoly @ 2021-09-01 13:25 UTC (permalink / raw)
  To: Ferruh Yigit, Ding, Xuan, dev
  Cc: maxime.coquelin, Xia, Chenbo, Hu, Jiayu, Richardson, Bruce,
	Thomas Monjalon, Ray Kinsella

On 01-Sep-21 12:42 PM, Ferruh Yigit wrote:
> On 9/1/2021 12:01 PM, Burakov, Anatoly wrote:
>> On 01-Sep-21 10:56 AM, Ferruh Yigit wrote:
>>> On 9/1/2021 2:41 AM, Ding, Xuan wrote:
>>>> Hi Ferruh,
>>>>
>>>>> -----Original Message-----
>>>>> From: Yigit, Ferruh <ferruh.yigit@intel.com>
>>>>> Sent: Wednesday, September 1, 2021 12:01 AM
>>>>> To: Ding, Xuan <xuan.ding@intel.com>; dev@dpdk.org; Burakov, Anatoly
>>>>> <anatoly.burakov@intel.com>
>>>>> Cc: maxime.coquelin@redhat.com; Xia, Chenbo <chenbo.xia@intel.com>; Hu,
>>>>> Jiayu <jiayu.hu@intel.com>; Richardson, Bruce <bruce.richardson@intel.com>
>>>>> Subject: Re: [PATCH] doc: announce change in vfio dma mapping
>>>>>
>>>>> On 8/31/2021 2:10 PM, Xuan Ding wrote:
>>>>>> Currently, the VFIO subsystem will compact adjacent DMA regions for the
>>>>>> purposes of saving space in the internal list of mappings. This has a
>>>>>> side effect of compacting two separate mappings that just happen to be
>>>>>> adjacent in memory. Since VFIO implementation on IA platforms also does
>>>>>> not allow partial unmapping of memory mapped for DMA, the current
>>>>> DPDK
>>>>>> VFIO implementation will prevent unmapping of accidentally adjacent
>>>>>> maps even though it could have been unmapped [1].
>>>>>>
>>>>>> The proper fix for this issue is to change the VFIO DMA mapping API to
>>>>>> also include page size, and always map memory page-by-page.
>>>>>>
>>>>>> [1] https://mails.dpdk.org/archives/dev/2021-July/213493.html
>>>>>>
>>>>>> Signed-off-by: Xuan Ding <xuan.ding@intel.com>
>>>>>> ---
>>>>>>    doc/guides/rel_notes/deprecation.rst | 3 +++
>>>>>>    1 file changed, 3 insertions(+)
>>>>>>
>>>>>> diff --git a/doc/guides/rel_notes/deprecation.rst
>>>>> b/doc/guides/rel_notes/deprecation.rst
>>>>>> index 76a4abfd6b..1234420caf 100644
>>>>>> --- a/doc/guides/rel_notes/deprecation.rst
>>>>>> +++ b/doc/guides/rel_notes/deprecation.rst
>>>>>> @@ -287,3 +287,6 @@ Deprecation Notices
>>>>>>      reserved bytes to 2 (from 3), and use 1 byte to indicate warnings and
>>>>> other
>>>>>>      information from the crypto/security operation. This field will be used to
>>>>>>      communicate events such as soft expiry with IPsec in lookaside mode.
>>>>>> +
>>>>>> +* vfio: the functions `rte_vfio_container_dma_map` will be amended to
>>>>>> +  include page size. This change is targeted for DPDK 22.02.
>>>>>>
>>>>>
>>>>> Is this means adding a new parameter to API?
>>>>> If so this is an ABI/API break and we can't do this change in the 22.02.
>>>>
>>>> Our original plan is add a new parameter in order not to use a new function
>>>> name, so you mean, any changes to the API can only be done in the LTS version?
>>>> If so, we can only add a new API and retire the old one in 22.11.
>>>>
>>>
>>> We can add a new API anytime. Adding new parameter to an existing API can be
>>> done on the ABI break release.
>>
>> So, 22.11 then?
>>
> 
> Yes.
> 
>>>
>>> You can add the new API in this release, and start using it.
>>> And mark the old API as deprecated in this release. This lets existing binaries
>>> to keep using it, but app needs to switch to new API for compilation.
>>> Old API can be removed on 22.11, and you will need a deprecation notice before
>>> 22.11 for it.
>>>
>>> Is above plan works for you?
>>>
>>
>> We have slightly rethought our approach, and the functionality that Xuan
>> requires does not rely on this API. They can, for all intents and purposes, be
>> considered unrelated issues.
>>
>> I still think it's a good idea to update the API that way, so I would like to do
>> that, and if we have to wait until 22.11 to fix it, I'm OK with that. Since
>> there no longer is any urgency here, it's acceptable to wait for the next LTS to
>> break it.
>>
> 
> Got it.
> 
> As far as I understand, main motivation in techboard decision was to prevent the
> ABI break as much as possible (main reason of decision wasn't deprecation notice
> being late). But if the correct thing to do is to rename the API (and break the
> ABI), I don't see the benefit to wait one more year, it is just delaying the
> impact and adding overhead to us.
> I am for being pragmatic and doing the change in this release if API rename is
> better option, perhaps we can visit the issue again in techboard.
> 
> Can you please describe why renaming API is better option, comparing to adding
> new API with new parameter?

I take it you meant "why renaming API *isn't* a better option".

The problem we're solving is that the API in question does not know 
about page sizes and thus can't map segments page-by-page. I mean I 
/guess/ we could have two API's (one paged, one not paged), but then we 
get into all kinds of hairy things about the API leaking the details of 
underlying platform.

Bottom line: i like current API function name. It's concise, it's 
descriptive. It's only missing a parameter, which i would like to add. A 
rename has been suggested (deprecate old API, add new API with a 
different name, and with added parameter), but honestly, I don't see why 
we have to do that because this is predicated upon the assumption that 
we *can't* break ABI at all, under any circumstances.

Can you please explain to me what is wrong with keeping a versioned 
symbol? Like, keep the old function around to keep ABI compatibility, 
but break the API compatibility for those who target 22.02 or later? 
That's what symbol versioning is *for*, is it not?

-- 
Thanks,
Anatoly

^ permalink raw reply	[relevance 4%]

* Re: [dpdk-dev] [PATCH v2 1/6] bbdev: add capability for CRC16 check
  @ 2021-09-01 13:36  3%   ` Tom Rix
  2021-09-01 15:00  3%     ` Chautru, Nicolas
  0 siblings, 1 reply; 200+ results
From: Tom Rix @ 2021-09-01 13:36 UTC (permalink / raw)
  To: Nicolas Chautru, dev, gakhil
  Cc: thomas, hemant.agrawal, mingshan.zhang, arun.joshi


On 8/19/21 2:10 PM, Nicolas Chautru wrote:
> Adding a missing operation when CRC16
> is being used for TB CRC check.
>
> Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
> ---
>   app/test-bbdev/test_bbdev_vector.c     |  2 ++
>   doc/guides/prog_guide/bbdev.rst        |  3 +++
>   doc/guides/rel_notes/release_21_11.rst |  1 +
>   lib/bbdev/rte_bbdev_op.h               | 34 ++++++++++++++++++----------------
>   4 files changed, 24 insertions(+), 16 deletions(-)
>
> diff --git a/app/test-bbdev/test_bbdev_vector.c b/app/test-bbdev/test_bbdev_vector.c
> index 614dbd1..8d796b1 100644
> --- a/app/test-bbdev/test_bbdev_vector.c
> +++ b/app/test-bbdev/test_bbdev_vector.c
> @@ -167,6 +167,8 @@
>   		*op_flag_value = RTE_BBDEV_LDPC_CRC_TYPE_24B_CHECK;
>   	else if (!strcmp(token, "RTE_BBDEV_LDPC_CRC_TYPE_24B_DROP"))
>   		*op_flag_value = RTE_BBDEV_LDPC_CRC_TYPE_24B_DROP;
> +	else if (!strcmp(token, "RTE_BBDEV_LDPC_CRC_TYPE_16_CHECK"))
> +		*op_flag_value = RTE_BBDEV_LDPC_CRC_TYPE_16_CHECK;
>   	else if (!strcmp(token, "RTE_BBDEV_LDPC_DEINTERLEAVER_BYPASS"))
>   		*op_flag_value = RTE_BBDEV_LDPC_DEINTERLEAVER_BYPASS;
>   	else if (!strcmp(token, "RTE_BBDEV_LDPC_HQ_COMBINE_IN_ENABLE"))
> diff --git a/doc/guides/prog_guide/bbdev.rst b/doc/guides/prog_guide/bbdev.rst
> index 9619280..8bd7cba 100644
> --- a/doc/guides/prog_guide/bbdev.rst
> +++ b/doc/guides/prog_guide/bbdev.rst
> @@ -891,6 +891,9 @@ given below.
>   |RTE_BBDEV_LDPC_CRC_TYPE_24B_DROP                                    |
>   | Set to drop the last CRC bits decoding output                      |
>   +--------------------------------------------------------------------+
> +|RTE_BBDEV_LDPC_CRC_TYPE_16_CHECK                                    |
> +| Set for code block CRC-16 checking                                 |
> ++--------------------------------------------------------------------+
>   |RTE_BBDEV_LDPC_DEINTERLEAVER_BYPASS                                 |
>   | Set for bit-level de-interleaver bypass on input stream            |
>   +--------------------------------------------------------------------+
> diff --git a/doc/guides/rel_notes/release_21_11.rst b/doc/guides/rel_notes/release_21_11.rst
> index d707a55..69dd518 100644
> --- a/doc/guides/rel_notes/release_21_11.rst
> +++ b/doc/guides/rel_notes/release_21_11.rst
> @@ -84,6 +84,7 @@ API Changes
>      Also, make sure to start the actual text at the margin.
>      =======================================================
>   
> +* bbdev: Added capability related to more comprehensive CRC options.
>   
>   ABI Changes
>   -----------
> diff --git a/lib/bbdev/rte_bbdev_op.h b/lib/bbdev/rte_bbdev_op.h
> index f946842..7c44ddd 100644
> --- a/lib/bbdev/rte_bbdev_op.h
> +++ b/lib/bbdev/rte_bbdev_op.h
> @@ -142,51 +142,53 @@ enum rte_bbdev_op_ldpcdec_flag_bitmasks {
>   	RTE_BBDEV_LDPC_CRC_TYPE_24B_CHECK = (1ULL << 1),
>   	/** Set to drop the last CRC bits decoding output */
>   	RTE_BBDEV_LDPC_CRC_TYPE_24B_DROP = (1ULL << 2),
> +	/** Set for transport block CRC-16 checking */
> +	RTE_BBDEV_LDPC_CRC_TYPE_16_CHECK = (1ULL << 3),

Changing these enums will break the abi backwards.

Why not add the new one at the end ?

Tom

>   	/** Set for bit-level de-interleaver bypass on Rx stream. */
> -	RTE_BBDEV_LDPC_DEINTERLEAVER_BYPASS = (1ULL << 3),
> +	RTE_BBDEV_LDPC_DEINTERLEAVER_BYPASS = (1ULL << 4),
>   	/** Set for HARQ combined input stream enable. */
> -	RTE_BBDEV_LDPC_HQ_COMBINE_IN_ENABLE = (1ULL << 4),
> +	RTE_BBDEV_LDPC_HQ_COMBINE_IN_ENABLE = (1ULL << 5),
>   	/** Set for HARQ combined output stream enable. */
> -	RTE_BBDEV_LDPC_HQ_COMBINE_OUT_ENABLE = (1ULL << 5),
> +	RTE_BBDEV_LDPC_HQ_COMBINE_OUT_ENABLE = (1ULL << 6),
>   	/** Set for LDPC decoder bypass.
>   	 *  RTE_BBDEV_LDPC_HQ_COMBINE_OUT_ENABLE must be set.
>   	 */
> -	RTE_BBDEV_LDPC_DECODE_BYPASS = (1ULL << 6),
> +	RTE_BBDEV_LDPC_DECODE_BYPASS = (1ULL << 7),
>   	/** Set for soft-output stream enable */
> -	RTE_BBDEV_LDPC_SOFT_OUT_ENABLE = (1ULL << 7),
> +	RTE_BBDEV_LDPC_SOFT_OUT_ENABLE = (1ULL << 8),
>   	/** Set for Rate-Matching bypass on soft-out stream. */
> -	RTE_BBDEV_LDPC_SOFT_OUT_RM_BYPASS = (1ULL << 8),
> +	RTE_BBDEV_LDPC_SOFT_OUT_RM_BYPASS = (1ULL << 9),
>   	/** Set for bit-level de-interleaver bypass on soft-output stream. */
> -	RTE_BBDEV_LDPC_SOFT_OUT_DEINTERLEAVER_BYPASS = (1ULL << 9),
> +	RTE_BBDEV_LDPC_SOFT_OUT_DEINTERLEAVER_BYPASS = (1ULL << 10),
>   	/** Set for iteration stopping on successful decode condition
>   	 *  i.e. a successful syndrome check.
>   	 */
> -	RTE_BBDEV_LDPC_ITERATION_STOP_ENABLE = (1ULL << 10),
> +	RTE_BBDEV_LDPC_ITERATION_STOP_ENABLE = (1ULL << 11),
>   	/** Set if a device supports decoder dequeue interrupts. */
> -	RTE_BBDEV_LDPC_DEC_INTERRUPTS = (1ULL << 11),
> +	RTE_BBDEV_LDPC_DEC_INTERRUPTS = (1ULL << 12),
>   	/** Set if a device supports scatter-gather functionality. */
> -	RTE_BBDEV_LDPC_DEC_SCATTER_GATHER = (1ULL << 12),
> +	RTE_BBDEV_LDPC_DEC_SCATTER_GATHER = (1ULL << 13),
>   	/** Set if a device supports input/output HARQ compression. */
> -	RTE_BBDEV_LDPC_HARQ_6BIT_COMPRESSION = (1ULL << 13),
> +	RTE_BBDEV_LDPC_HARQ_6BIT_COMPRESSION = (1ULL << 14),
>   	/** Set if a device supports input LLR compression. */
> -	RTE_BBDEV_LDPC_LLR_COMPRESSION = (1ULL << 14),
> +	RTE_BBDEV_LDPC_LLR_COMPRESSION = (1ULL << 15),
>   	/** Set if a device supports HARQ input from
>   	 *  device's internal memory.
>   	 */
> -	RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_IN_ENABLE = (1ULL << 15),
> +	RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_IN_ENABLE = (1ULL << 16),
>   	/** Set if a device supports HARQ output to
>   	 *  device's internal memory.
>   	 */
> -	RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_OUT_ENABLE = (1ULL << 16),
> +	RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_OUT_ENABLE = (1ULL << 17),
>   	/** Set if a device supports loop-back access to
>   	 *  HARQ internal memory. Intended for troubleshooting.
>   	 */
> -	RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_LOOPBACK = (1ULL << 17),
> +	RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_LOOPBACK = (1ULL << 18),
>   	/** Set if a device includes LLR filler bits in the circular buffer
>   	 *  for HARQ memory. If not set, it is assumed the filler bits are not
>   	 *  in HARQ memory and handled directly by the LDPC decoder.
>   	 */
> -	RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_FILLERS = (1ULL << 18)
> +	RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_FILLERS = (1ULL << 19)
>   };
>   
>   /** Flags for LDPC encoder operation and capability structure */


^ permalink raw reply	[relevance 3%]

* Re: [dpdk-dev] [PATCH v1 3/3] ethdev: promote burst mode API to stable
  2021-09-01  9:07  0%   ` Ferruh Yigit
@ 2021-09-01 13:49  0%     ` Kinsella, Ray
  0 siblings, 0 replies; 200+ results
From: Kinsella, Ray @ 2021-09-01 13:49 UTC (permalink / raw)
  To: Ferruh Yigit, Haiyue Wang, dev; +Cc: thomas, Andrew Rybchenko



On 01/09/2021 10:07, Ferruh Yigit wrote:
> On 9/1/2021 6:07 AM, Haiyue Wang wrote:
>> The DPDK Symbol Bot reports:
>> Please note the symbols listed below have expired. In line with the
>> DPDK ABI policy, they should be scheduled for removal, in the next
>> DPDK release.
>>
>> Symbol
>> rte_eth_rx_burst_mode_get
>> rte_eth_tx_burst_mode_get
>>
>> Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
> 
> Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
> 
Acked-by: Ray Kinsella <mdr@ashroe.eu>

^ permalink raw reply	[relevance 0%]

* Re: [dpdk-dev] [PATCH v1 1/3] net/ixgbe: promote some API to stable
  2021-09-01 11:13  3%     ` Wang, Haiyue
@ 2021-09-01 13:55  0%       ` Kinsella, Ray
  0 siblings, 0 replies; 200+ results
From: Kinsella, Ray @ 2021-09-01 13:55 UTC (permalink / raw)
  To: Wang, Haiyue, Yigit, Ferruh, dev; +Cc: thomas, David Marchand



On 01/09/2021 12:13, Wang, Haiyue wrote:
>> -----Original Message-----
>> From: Yigit, Ferruh <ferruh.yigit@intel.com>
>> Sent: Wednesday, September 1, 2021 17:02
>> To: Wang, Haiyue <haiyue.wang@intel.com>; dev@dpdk.org
>> Cc: mdr@ashroe.eu; thomas@monjalon.net
>> Subject: Re: [dpdk-dev] [PATCH v1 1/3] net/ixgbe: promote some API to stable
>>
>> On 9/1/2021 6:07 AM, Haiyue Wang wrote:
>>> The DPDK Symbol Bot reports:
>>> Please note the symbols listed below have expired. In line with the
>>> DPDK ABI policy, they should be scheduled for removal, in the next
>>> DPDK release.
>>>
>>> Symbol
>>> rte_pmd_ixgbe_mdio_lock
>>> rte_pmd_ixgbe_mdio_unlock
>>> rte_pmd_ixgbe_mdio_unlocked_read
>>> rte_pmd_ixgbe_mdio_unlocked_write
>>> rte_pmd_ixgbe_upd_fctrl_sbp
>>
>> I wonder if we should keep PMD specific APIs as experimental (Not talking about
>> mbuf 'dynfield' / 'dynflag' APIs, we can promote them).
> 
> Yes, makes sense.
> 
>>
>> If an application is using PMD specific API, not sure if it will concern about
>> PMD specific APIs.
>> And keeping PMD specific APIs lets us remove them as soon as we can, also adds
>> additional discourage for users to use them.
> 
> Can update this to DPDK ABI Policy, section 3.5.3.
> https://doc.dpdk.org/guides/contributing/abi_policy.html

I understand and agree.
However we never made any exceptions for PMD specific APIs in the policy.

Leave them as experimental for the moment.
I will add a clause to the policy ....

Thomas / David - any opinion?

> 
>>
>>>
>>> Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
>>
>>
>> <...>
>>
> 

^ permalink raw reply	[relevance 0%]

* Re: [dpdk-dev] [PATCH v1] bbdev: remove experimental tag from API
  @ 2021-09-01 14:54  3%       ` Chautru, Nicolas
  2021-09-13 19:44  0%         ` Maxime Coquelin
  0 siblings, 1 reply; 200+ results
From: Chautru, Nicolas @ 2021-09-01 14:54 UTC (permalink / raw)
  To: Kinsella, Ray, Hemant Agrawal, David Marchand
  Cc: dev, Akhil Goyal, Thomas Monjalon, Tom Rix, Zhang, Mingshan,
	Joshi, Arun, Maxime Coquelin



> -----Original Message-----
> From: Kinsella, Ray <mdr@ashroe.eu>
> Sent: Wednesday, September 1, 2021 4:15 AM
> To: Hemant Agrawal <hemant.agrawal@nxp.com>; David Marchand
> <david.marchand@redhat.com>; Chautru, Nicolas
> <nicolas.chautru@intel.com>
> Cc: dev <dev@dpdk.org>; Akhil Goyal <gakhil@marvell.com>; Thomas
> Monjalon <thomas@monjalon.net>; Tom Rix <trix@redhat.com>; Zhang,
> Mingshan <mingshan.zhang@intel.com>; Joshi, Arun
> <arun.joshi@intel.com>; Maxime Coquelin <maxime.coquelin@redhat.com>
> Subject: Re: [PATCH v1] bbdev: remove experimental tag from API
> 
> 
> 
> On 01/09/2021 04:52, Hemant Agrawal wrote:
> >>
> >> On Tue, Aug 31, 2021 at 6:27 PM Nicolas Chautru
> >> <nicolas.chautru@intel.com> wrote:
> >>>
> >>> This was previously suggested last year
> >>>
> >>
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpat
> >> c
> >>> hes.dpdk.org%2Fproject%2Fdpdk%2Fpatch%2F1593213242-157394-2-
> git-
> >> send-e
> >>> mail-
> >>
> nicolas.chautru%40intel.com%2F&amp;data=04%7C01%7Chemant.agrawal%
> >>>
> >>
> 40nxp.com%7Cfcdfb339ec284057db1508d96c9dd048%7C686ea1d3bc2b4c6f
> >> a92cd99
> >>>
> >> c5c301635%7C0%7C0%7C637660247324212288%7CUnknown%7CTWFpbGZ
> >> sb3d8eyJWIjo
> >>>
> >>
> iMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1
> >> 000&amp
> >>>
> ;sdata=%2FYwaT29I4XlUxedcdCeyvM5z1R5QeNGTLLPY3XQBKjU%3D&amp
> >> ;reserved=0
> >>> but there was request from community to wait another year to confirm
> >> formally this api is mature.
> >>
> >> The request was to wait for a new vendor (i.e. non Intel) to
> >> implement a bbdev driver for their hw.
> >>
> >> NXP proposed a driver for this class:
> >>
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpat
> >> ch
> work.dpdk.org%2Fproject%2Fdpdk%2Flist%2F%3Fseries%3D16642%26state
> >>
> %3D%252A%26archive%3Dboth&amp;data=04%7C01%7Chemant.agrawal%
> >>
> 40nxp.com%7Cfcdfb339ec284057db1508d96c9dd048%7C686ea1d3bc2b4c6f
> >> a92cd99c5c301635%7C0%7C0%7C637660247324212288%7CUnknown%7CT
> >>
> WFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLC
> >>
> JXVCI6Mn0%3D%7C1000&amp;sdata=iorsQ7wAXyU2%2FaqeV5CrDp9asl8ztZ
> >> nSrbDuJpCv9Gk%3D&amp;reserved=0
> >>
> >> What is the status of this driver?
> >
> > [Hemant]  We are in process of resending the patches in next few days.
> 
> Ok - just so we are clear - the net-net of that, is that the bbdev APIs will be
> 'experimental'
> for another year, right?

There is little reason to defer further I believe. Henant please confirm you are not looking at any ABI change based on discussion for the last few months.

> 
> >
> >> I see no update on the bbdev API, which seems good, but a
> >> confirmation is needed.

Indeed that's all we need. Confirmation no change is require for new PMD.

> >>
> >>
> >> --
> >> David Marchand
> >

^ permalink raw reply	[relevance 3%]

* Re: [dpdk-dev] [PATCH v4] ethdev: fix representor port ID search by name
  2021-08-31 16:06  3% ` [dpdk-dev] [PATCH v4] " Andrew Rybchenko
  2021-08-31 16:32  0%   ` Wang, Haiyue
  2021-09-01  5:15  0%   ` Xing, Beilei
@ 2021-09-01 14:55  0%   ` Ferruh Yigit
  2 siblings, 0 replies; 200+ results
From: Ferruh Yigit @ 2021-09-01 14:55 UTC (permalink / raw)
  To: Andrew Rybchenko, Ajit Khaparde, Somnath Kotur, John Daley,
	Hyong Youb Kim, Beilei Xing, Qiming Yang, Qi Zhang, Haiyue Wang,
	Matan Azrad, Shahaf Shuler, Viacheslav Ovsiienko,
	Thomas Monjalon
  Cc: dev, Viacheslav Galaktionov, declan.doherty

On 8/31/2021 5:06 PM, Andrew Rybchenko wrote:
> From: Viacheslav Galaktionov <viacheslav.galaktionov@oktetlabs.ru>
> 
> Getting a list of representors from a representor does not make sense.
> Instead, a parent device should be used.
> 

Which code is getting list of the representors?

As far as I can see impacted APIs are:
'rte_eth_representor_id_get()'
'rte_eth_representor_info_get()'

Which are now getting 'parent_port_id' as argument, instead of representro port id.

'rte_eth_representor_info_get()' is using 'representor_info_get()' dev_ops,
which is only implemented by 'mlx5', so is this problem only valid for 'mlx5'
and can it be solved within PMD implementation?


> To this end, extend the rte_eth_dev_data structure to include the port ID
> of the backing device for representors.
> 
> Signed-off-by: Viacheslav Galaktionov <viacheslav.galaktionov@oktetlabs.ru>
> Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
> ---
> The new field is added into the hole in rte_eth_dev_data structure.
> The patch does not change ABI, but extra care is required since ABI
> check is disabled for the structure because of the libabigail bug [1].
> 
> Potentially it is bad for out-of-tree drivers which implement
> representors but do not fill in a new parert_port_id field in
> rte_eth_dev_data structure. Do we care?
> 
> mlx5 changes should be reviwed by maintainers very carefully, since
> we are not sure if we patch it correctly.
> 
> [1] https://sourceware.org/bugzilla/show_bug.cgi?id=28060
> 
> v4:
>     - apply mlx5 review notes: remove fallback from generic ethdev
>       code and add fallback to mlx5 code to handle legacy usecase
> 
> v3:
>     - fix mlx5 build breakage
> 
> v2:
>     - fix mlx5 review notes
>     - try device port ID first before parent in order to address
>       backward compatibility issue
> 

<...>

> index edf96de2dc..72fefa59c2 100644
> --- a/lib/ethdev/rte_ethdev_core.h
> +++ b/lib/ethdev/rte_ethdev_core.h
> @@ -185,6 +185,12 @@ struct rte_eth_dev_data {
>  			/**< Switch-specific identifier.
>  			 *   Valid if RTE_ETH_DEV_REPRESENTOR in dev_flags.
>  			 */
> +	uint16_t parent_port_id;

Why 'parent'? Isn't this for the port that port representator represents, does
it called 'parent'? Above that device mentioned as 'backing device' a few times,
so would something like 'peer_port_id' better?




> +			/**< Port ID of the backing device.
> +			 *   This device will be used to query representor
> +			 *   info and calculate representor IDs.
> +			 *   Valid if RTE_ETH_DEV_REPRESENTOR in dev_flags.
> +			 */
>  


Overall I am not feeling good about adding representor port related information
withing the device data struct.
I wonder if this information can be kept in the device private data.

Or, it is hard to explain but can we use something like inheritance, a
representor specific dev_data derived from original dev_data. We can store
dev_data pointers in 'struct rte_eth_dev' but can cast it to representor
specific dev_data when type is representor.

struct rte_eth_dev_data_rep
	struct rte_eth_dev_data
	<representor specific fields>

This brings lots of complexity though, specially in allocating/freeing this
struct, not sure if it worth to the effort.


^ permalink raw reply	[relevance 0%]

* Re: [dpdk-dev] [PATCH v2 1/6] bbdev: add capability for CRC16 check
  2021-09-01 13:36  3%   ` Tom Rix
@ 2021-09-01 15:00  3%     ` Chautru, Nicolas
  2021-09-11 19:11  0%       ` Tom Rix
  0 siblings, 1 reply; 200+ results
From: Chautru, Nicolas @ 2021-09-01 15:00 UTC (permalink / raw)
  To: Tom Rix, dev, gakhil; +Cc: thomas, hemant.agrawal, Zhang, Mingshan, Joshi, Arun



> -----Original Message-----
> From: Tom Rix <trix@redhat.com>
> Sent: Wednesday, September 1, 2021 6:37 AM
> To: Chautru, Nicolas <nicolas.chautru@intel.com>; dev@dpdk.org;
> gakhil@marvell.com
> Cc: thomas@monjalon.net; hemant.agrawal@nxp.com; Zhang, Mingshan
> <mingshan.zhang@intel.com>; Joshi, Arun <arun.joshi@intel.com>
> Subject: Re: [PATCH v2 1/6] bbdev: add capability for CRC16 check
> 
> 
> On 8/19/21 2:10 PM, Nicolas Chautru wrote:
> > Adding a missing operation when CRC16
> > is being used for TB CRC check.
> >
> > Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
> > ---
> >   app/test-bbdev/test_bbdev_vector.c     |  2 ++
> >   doc/guides/prog_guide/bbdev.rst        |  3 +++
> >   doc/guides/rel_notes/release_21_11.rst |  1 +
> >   lib/bbdev/rte_bbdev_op.h               | 34 ++++++++++++++++++--------------
> --
> >   4 files changed, 24 insertions(+), 16 deletions(-)
> >
> > diff --git a/app/test-bbdev/test_bbdev_vector.c
> > b/app/test-bbdev/test_bbdev_vector.c
> > index 614dbd1..8d796b1 100644
> > --- a/app/test-bbdev/test_bbdev_vector.c
> > +++ b/app/test-bbdev/test_bbdev_vector.c
> > @@ -167,6 +167,8 @@
> >   		*op_flag_value = RTE_BBDEV_LDPC_CRC_TYPE_24B_CHECK;
> >   	else if (!strcmp(token, "RTE_BBDEV_LDPC_CRC_TYPE_24B_DROP"))
> >   		*op_flag_value = RTE_BBDEV_LDPC_CRC_TYPE_24B_DROP;
> > +	else if (!strcmp(token, "RTE_BBDEV_LDPC_CRC_TYPE_16_CHECK"))
> > +		*op_flag_value = RTE_BBDEV_LDPC_CRC_TYPE_16_CHECK;
> >   	else if (!strcmp(token,
> "RTE_BBDEV_LDPC_DEINTERLEAVER_BYPASS"))
> >   		*op_flag_value =
> RTE_BBDEV_LDPC_DEINTERLEAVER_BYPASS;
> >   	else if (!strcmp(token,
> "RTE_BBDEV_LDPC_HQ_COMBINE_IN_ENABLE"))
> > diff --git a/doc/guides/prog_guide/bbdev.rst
> > b/doc/guides/prog_guide/bbdev.rst index 9619280..8bd7cba 100644
> > --- a/doc/guides/prog_guide/bbdev.rst
> > +++ b/doc/guides/prog_guide/bbdev.rst
> > @@ -891,6 +891,9 @@ given below.
> >   |RTE_BBDEV_LDPC_CRC_TYPE_24B_DROP                                    |
> >   | Set to drop the last CRC bits decoding output                      |
> >
> > +--------------------------------------------------------------------+
> > +|RTE_BBDEV_LDPC_CRC_TYPE_16_CHECK                                    |
> > +| Set for code block CRC-16 checking                                 |
> > ++--------------------------------------------------------------------+
> >   |RTE_BBDEV_LDPC_DEINTERLEAVER_BYPASS                                 |
> >   | Set for bit-level de-interleaver bypass on input stream            |
> >
> > +--------------------------------------------------------------------+
> > diff --git a/doc/guides/rel_notes/release_21_11.rst
> > b/doc/guides/rel_notes/release_21_11.rst
> > index d707a55..69dd518 100644
> > --- a/doc/guides/rel_notes/release_21_11.rst
> > +++ b/doc/guides/rel_notes/release_21_11.rst
> > @@ -84,6 +84,7 @@ API Changes
> >      Also, make sure to start the actual text at the margin.
> >      =======================================================
> >
> > +* bbdev: Added capability related to more comprehensive CRC options.
> >
> >   ABI Changes
> >   -----------
> > diff --git a/lib/bbdev/rte_bbdev_op.h b/lib/bbdev/rte_bbdev_op.h index
> > f946842..7c44ddd 100644
> > --- a/lib/bbdev/rte_bbdev_op.h
> > +++ b/lib/bbdev/rte_bbdev_op.h
> > @@ -142,51 +142,53 @@ enum rte_bbdev_op_ldpcdec_flag_bitmasks {
> >   	RTE_BBDEV_LDPC_CRC_TYPE_24B_CHECK = (1ULL << 1),
> >   	/** Set to drop the last CRC bits decoding output */
> >   	RTE_BBDEV_LDPC_CRC_TYPE_24B_DROP = (1ULL << 2),
> > +	/** Set for transport block CRC-16 checking */
> > +	RTE_BBDEV_LDPC_CRC_TYPE_16_CHECK = (1ULL << 3),
> 
> Changing these enums will break the abi backwards.
> 
> Why not add the new one at the end ?

To keep all the CRC related flags next to each other for better readability and logical clarity. The ABI is still marked as experimental. 

> 
> Tom
> 
> >   	/** Set for bit-level de-interleaver bypass on Rx stream. */
> > -	RTE_BBDEV_LDPC_DEINTERLEAVER_BYPASS = (1ULL << 3),
> > +	RTE_BBDEV_LDPC_DEINTERLEAVER_BYPASS = (1ULL << 4),
> >   	/** Set for HARQ combined input stream enable. */
> > -	RTE_BBDEV_LDPC_HQ_COMBINE_IN_ENABLE = (1ULL << 4),
> > +	RTE_BBDEV_LDPC_HQ_COMBINE_IN_ENABLE = (1ULL << 5),
> >   	/** Set for HARQ combined output stream enable. */
> > -	RTE_BBDEV_LDPC_HQ_COMBINE_OUT_ENABLE = (1ULL << 5),
> > +	RTE_BBDEV_LDPC_HQ_COMBINE_OUT_ENABLE = (1ULL << 6),
> >   	/** Set for LDPC decoder bypass.
> >   	 *  RTE_BBDEV_LDPC_HQ_COMBINE_OUT_ENABLE must be set.
> >   	 */
> > -	RTE_BBDEV_LDPC_DECODE_BYPASS = (1ULL << 6),
> > +	RTE_BBDEV_LDPC_DECODE_BYPASS = (1ULL << 7),
> >   	/** Set for soft-output stream enable */
> > -	RTE_BBDEV_LDPC_SOFT_OUT_ENABLE = (1ULL << 7),
> > +	RTE_BBDEV_LDPC_SOFT_OUT_ENABLE = (1ULL << 8),
> >   	/** Set for Rate-Matching bypass on soft-out stream. */
> > -	RTE_BBDEV_LDPC_SOFT_OUT_RM_BYPASS = (1ULL << 8),
> > +	RTE_BBDEV_LDPC_SOFT_OUT_RM_BYPASS = (1ULL << 9),
> >   	/** Set for bit-level de-interleaver bypass on soft-output stream. */
> > -	RTE_BBDEV_LDPC_SOFT_OUT_DEINTERLEAVER_BYPASS = (1ULL <<
> 9),
> > +	RTE_BBDEV_LDPC_SOFT_OUT_DEINTERLEAVER_BYPASS = (1ULL <<
> 10),
> >   	/** Set for iteration stopping on successful decode condition
> >   	 *  i.e. a successful syndrome check.
> >   	 */
> > -	RTE_BBDEV_LDPC_ITERATION_STOP_ENABLE = (1ULL << 10),
> > +	RTE_BBDEV_LDPC_ITERATION_STOP_ENABLE = (1ULL << 11),
> >   	/** Set if a device supports decoder dequeue interrupts. */
> > -	RTE_BBDEV_LDPC_DEC_INTERRUPTS = (1ULL << 11),
> > +	RTE_BBDEV_LDPC_DEC_INTERRUPTS = (1ULL << 12),
> >   	/** Set if a device supports scatter-gather functionality. */
> > -	RTE_BBDEV_LDPC_DEC_SCATTER_GATHER = (1ULL << 12),
> > +	RTE_BBDEV_LDPC_DEC_SCATTER_GATHER = (1ULL << 13),
> >   	/** Set if a device supports input/output HARQ compression. */
> > -	RTE_BBDEV_LDPC_HARQ_6BIT_COMPRESSION = (1ULL << 13),
> > +	RTE_BBDEV_LDPC_HARQ_6BIT_COMPRESSION = (1ULL << 14),
> >   	/** Set if a device supports input LLR compression. */
> > -	RTE_BBDEV_LDPC_LLR_COMPRESSION = (1ULL << 14),
> > +	RTE_BBDEV_LDPC_LLR_COMPRESSION = (1ULL << 15),
> >   	/** Set if a device supports HARQ input from
> >   	 *  device's internal memory.
> >   	 */
> > -	RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_IN_ENABLE = (1ULL
> << 15),
> > +	RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_IN_ENABLE = (1ULL
> << 16),
> >   	/** Set if a device supports HARQ output to
> >   	 *  device's internal memory.
> >   	 */
> > -	RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_OUT_ENABLE =
> (1ULL << 16),
> > +	RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_OUT_ENABLE =
> (1ULL << 17),
> >   	/** Set if a device supports loop-back access to
> >   	 *  HARQ internal memory. Intended for troubleshooting.
> >   	 */
> > -	RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_LOOPBACK = (1ULL
> << 17),
> > +	RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_LOOPBACK = (1ULL
> << 18),
> >   	/** Set if a device includes LLR filler bits in the circular buffer
> >   	 *  for HARQ memory. If not set, it is assumed the filler bits are not
> >   	 *  in HARQ memory and handled directly by the LDPC decoder.
> >   	 */
> > -	RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_FILLERS = (1ULL <<
> 18)
> > +	RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_FILLERS = (1ULL <<
> 19)
> >   };
> >
> >   /** Flags for LDPC encoder operation and capability structure */


^ permalink raw reply	[relevance 3%]

* Re: [dpdk-dev] [PATCH] doc: announce change in vfio dma mapping
  2021-09-01 13:25  4%           ` Burakov, Anatoly
@ 2021-09-02  9:50  3%             ` Ferruh Yigit
  2021-09-02 16:13  0%               ` Kinsella, Ray
  0 siblings, 1 reply; 200+ results
From: Ferruh Yigit @ 2021-09-02  9:50 UTC (permalink / raw)
  To: Burakov, Anatoly, Ding, Xuan, dev, Ray Kinsella
  Cc: maxime.coquelin, Xia, Chenbo, Hu, Jiayu, Richardson, Bruce,
	Thomas Monjalon

On 9/1/2021 2:25 PM, Burakov, Anatoly wrote:
> On 01-Sep-21 12:42 PM, Ferruh Yigit wrote:
>> On 9/1/2021 12:01 PM, Burakov, Anatoly wrote:
>>> On 01-Sep-21 10:56 AM, Ferruh Yigit wrote:
>>>> On 9/1/2021 2:41 AM, Ding, Xuan wrote:
>>>>> Hi Ferruh,
>>>>>
>>>>>> -----Original Message-----
>>>>>> From: Yigit, Ferruh <ferruh.yigit@intel.com>
>>>>>> Sent: Wednesday, September 1, 2021 12:01 AM
>>>>>> To: Ding, Xuan <xuan.ding@intel.com>; dev@dpdk.org; Burakov, Anatoly
>>>>>> <anatoly.burakov@intel.com>
>>>>>> Cc: maxime.coquelin@redhat.com; Xia, Chenbo <chenbo.xia@intel.com>; Hu,
>>>>>> Jiayu <jiayu.hu@intel.com>; Richardson, Bruce <bruce.richardson@intel.com>
>>>>>> Subject: Re: [PATCH] doc: announce change in vfio dma mapping
>>>>>>
>>>>>> On 8/31/2021 2:10 PM, Xuan Ding wrote:
>>>>>>> Currently, the VFIO subsystem will compact adjacent DMA regions for the
>>>>>>> purposes of saving space in the internal list of mappings. This has a
>>>>>>> side effect of compacting two separate mappings that just happen to be
>>>>>>> adjacent in memory. Since VFIO implementation on IA platforms also does
>>>>>>> not allow partial unmapping of memory mapped for DMA, the current
>>>>>> DPDK
>>>>>>> VFIO implementation will prevent unmapping of accidentally adjacent
>>>>>>> maps even though it could have been unmapped [1].
>>>>>>>
>>>>>>> The proper fix for this issue is to change the VFIO DMA mapping API to
>>>>>>> also include page size, and always map memory page-by-page.
>>>>>>>
>>>>>>> [1] https://mails.dpdk.org/archives/dev/2021-July/213493.html
>>>>>>>
>>>>>>> Signed-off-by: Xuan Ding <xuan.ding@intel.com>
>>>>>>> ---
>>>>>>>    doc/guides/rel_notes/deprecation.rst | 3 +++
>>>>>>>    1 file changed, 3 insertions(+)
>>>>>>>
>>>>>>> diff --git a/doc/guides/rel_notes/deprecation.rst
>>>>>> b/doc/guides/rel_notes/deprecation.rst
>>>>>>> index 76a4abfd6b..1234420caf 100644
>>>>>>> --- a/doc/guides/rel_notes/deprecation.rst
>>>>>>> +++ b/doc/guides/rel_notes/deprecation.rst
>>>>>>> @@ -287,3 +287,6 @@ Deprecation Notices
>>>>>>>      reserved bytes to 2 (from 3), and use 1 byte to indicate warnings and
>>>>>> other
>>>>>>>      information from the crypto/security operation. This field will be
>>>>>>> used to
>>>>>>>      communicate events such as soft expiry with IPsec in lookaside mode.
>>>>>>> +
>>>>>>> +* vfio: the functions `rte_vfio_container_dma_map` will be amended to
>>>>>>> +  include page size. This change is targeted for DPDK 22.02.
>>>>>>>
>>>>>>
>>>>>> Is this means adding a new parameter to API?
>>>>>> If so this is an ABI/API break and we can't do this change in the 22.02.
>>>>>
>>>>> Our original plan is add a new parameter in order not to use a new function
>>>>> name, so you mean, any changes to the API can only be done in the LTS version?
>>>>> If so, we can only add a new API and retire the old one in 22.11.
>>>>>
>>>>
>>>> We can add a new API anytime. Adding new parameter to an existing API can be
>>>> done on the ABI break release.
>>>
>>> So, 22.11 then?
>>>
>>
>> Yes.
>>
>>>>
>>>> You can add the new API in this release, and start using it.
>>>> And mark the old API as deprecated in this release. This lets existing binaries
>>>> to keep using it, but app needs to switch to new API for compilation.
>>>> Old API can be removed on 22.11, and you will need a deprecation notice before
>>>> 22.11 for it.
>>>>
>>>> Is above plan works for you?
>>>>
>>>
>>> We have slightly rethought our approach, and the functionality that Xuan
>>> requires does not rely on this API. They can, for all intents and purposes, be
>>> considered unrelated issues.
>>>
>>> I still think it's a good idea to update the API that way, so I would like to do
>>> that, and if we have to wait until 22.11 to fix it, I'm OK with that. Since
>>> there no longer is any urgency here, it's acceptable to wait for the next LTS to
>>> break it.
>>>
>>
>> Got it.
>>
>> As far as I understand, main motivation in techboard decision was to prevent the
>> ABI break as much as possible (main reason of decision wasn't deprecation notice
>> being late). But if the correct thing to do is to rename the API (and break the
>> ABI), I don't see the benefit to wait one more year, it is just delaying the
>> impact and adding overhead to us.
>> I am for being pragmatic and doing the change in this release if API rename is
>> better option, perhaps we can visit the issue again in techboard.
>>
>> Can you please describe why renaming API is better option, comparing to adding
>> new API with new parameter?
> 
> I take it you meant "why renaming API *isn't* a better option".
> 
> The problem we're solving is that the API in question does not know about page
> sizes and thus can't map segments page-by-page. I mean I /guess/ we could have
> two API's (one paged, one not paged), but then we get into all kinds of hairy
> things about the API leaking the details of underlying platform.
> 
> Bottom line: i like current API function name. It's concise, it's descriptive.
> It's only missing a parameter, which i would like to add. A rename has been
> suggested (deprecate old API, add new API with a different name, and with added
> parameter), but honestly, I don't see why we have to do that because this is
> predicated upon the assumption that we *can't* break ABI at all, under any
> circumstances.
> 
> Can you please explain to me what is wrong with keeping a versioned symbol?
> Like, keep the old function around to keep ABI compatibility, but break the API
> compatibility for those who target 22.02 or later? That's what symbol versioning
> is *for*, is it not?
> 

Nothing wrong with symbol versioning, indeed that is preferred way if it works
for you, I didn't get that symbol versioning is planned.

@Ray,
Since symbol versioning is planned, ABI won't break, but API will change, can
this change be done in this release without deprecation notice?
Later we can have a deprecation notice to remove old symbol on 22.11.

Thanks,
ferruh

^ permalink raw reply	[relevance 3%]

* Re: [dpdk-dev] [PATCH v5 0/5] eal: enable global device syntax by default
  @ 2021-09-02 14:46  0%     ` Thomas Monjalon
  0 siblings, 0 replies; 200+ results
From: Thomas Monjalon @ 2021-09-02 14:46 UTC (permalink / raw)
  To: Xueming Li; +Cc: Gaetan Rivet, dev, Asaf Penso, mdr, david.marchand

14/04/2021 21:49, Thomas Monjalon:
> 13/04/2021 05:14, Xueming Li:
> > Xueming Li (5):
> >   devargs: unify scratch buffer storage
> >   devargs: fix memory leak on parsing error
> >   kvargs: add get by key function
> >   bus: add device arguments name parsing API
> >   devargs: parse global device syntax
> 
> The patch 4 adds a new callback in rte_bus.
> I thought about it during the whole day and I don't see any good way
> to merge it without breaking the ABI compatibility.
> 
> Only first 3 patches are applied for now, thanks.

Last 2 patches are applied for 21.11, thanks.



^ permalink raw reply	[relevance 0%]

* Re: [dpdk-dev] [PATCH] doc: announce change in vfio dma mapping
  2021-09-02  9:50  3%             ` Ferruh Yigit
@ 2021-09-02 16:13  0%               ` Kinsella, Ray
  2021-09-06  8:51  0%                 ` Ding, Xuan
  0 siblings, 1 reply; 200+ results
From: Kinsella, Ray @ 2021-09-02 16:13 UTC (permalink / raw)
  To: Ferruh Yigit, Burakov, Anatoly, Ding, Xuan, dev
  Cc: maxime.coquelin, Xia, Chenbo, Hu, Jiayu, Richardson, Bruce,
	Thomas Monjalon



On 02/09/2021 10:50, Ferruh Yigit wrote:
> On 9/1/2021 2:25 PM, Burakov, Anatoly wrote:
>> On 01-Sep-21 12:42 PM, Ferruh Yigit wrote:
>>> On 9/1/2021 12:01 PM, Burakov, Anatoly wrote:
>>>> On 01-Sep-21 10:56 AM, Ferruh Yigit wrote:
>>>>> On 9/1/2021 2:41 AM, Ding, Xuan wrote:
>>>>>> Hi Ferruh,
>>>>>>
>>>>>>> -----Original Message-----
>>>>>>> From: Yigit, Ferruh <ferruh.yigit@intel.com>
>>>>>>> Sent: Wednesday, September 1, 2021 12:01 AM
>>>>>>> To: Ding, Xuan <xuan.ding@intel.com>; dev@dpdk.org; Burakov, Anatoly
>>>>>>> <anatoly.burakov@intel.com>
>>>>>>> Cc: maxime.coquelin@redhat.com; Xia, Chenbo <chenbo.xia@intel.com>; Hu,
>>>>>>> Jiayu <jiayu.hu@intel.com>; Richardson, Bruce <bruce.richardson@intel.com>
>>>>>>> Subject: Re: [PATCH] doc: announce change in vfio dma mapping
>>>>>>>
>>>>>>> On 8/31/2021 2:10 PM, Xuan Ding wrote:
>>>>>>>> Currently, the VFIO subsystem will compact adjacent DMA regions for the
>>>>>>>> purposes of saving space in the internal list of mappings. This has a
>>>>>>>> side effect of compacting two separate mappings that just happen to be
>>>>>>>> adjacent in memory. Since VFIO implementation on IA platforms also does
>>>>>>>> not allow partial unmapping of memory mapped for DMA, the current
>>>>>>> DPDK
>>>>>>>> VFIO implementation will prevent unmapping of accidentally adjacent
>>>>>>>> maps even though it could have been unmapped [1].
>>>>>>>>
>>>>>>>> The proper fix for this issue is to change the VFIO DMA mapping API to
>>>>>>>> also include page size, and always map memory page-by-page.
>>>>>>>>
>>>>>>>> [1] https://mails.dpdk.org/archives/dev/2021-July/213493.html
>>>>>>>>
>>>>>>>> Signed-off-by: Xuan Ding <xuan.ding@intel.com>
>>>>>>>> ---
>>>>>>>>    doc/guides/rel_notes/deprecation.rst | 3 +++
>>>>>>>>    1 file changed, 3 insertions(+)
>>>>>>>>
>>>>>>>> diff --git a/doc/guides/rel_notes/deprecation.rst
>>>>>>> b/doc/guides/rel_notes/deprecation.rst
>>>>>>>> index 76a4abfd6b..1234420caf 100644
>>>>>>>> --- a/doc/guides/rel_notes/deprecation.rst
>>>>>>>> +++ b/doc/guides/rel_notes/deprecation.rst
>>>>>>>> @@ -287,3 +287,6 @@ Deprecation Notices
>>>>>>>>      reserved bytes to 2 (from 3), and use 1 byte to indicate warnings and
>>>>>>> other
>>>>>>>>      information from the crypto/security operation. This field will be
>>>>>>>> used to
>>>>>>>>      communicate events such as soft expiry with IPsec in lookaside mode.
>>>>>>>> +
>>>>>>>> +* vfio: the functions `rte_vfio_container_dma_map` will be amended to
>>>>>>>> +  include page size. This change is targeted for DPDK 22.02.
>>>>>>>>
>>>>>>>
>>>>>>> Is this means adding a new parameter to API?
>>>>>>> If so this is an ABI/API break and we can't do this change in the 22.02.
>>>>>>
>>>>>> Our original plan is add a new parameter in order not to use a new function
>>>>>> name, so you mean, any changes to the API can only be done in the LTS version?
>>>>>> If so, we can only add a new API and retire the old one in 22.11.
>>>>>>
>>>>>
>>>>> We can add a new API anytime. Adding new parameter to an existing API can be
>>>>> done on the ABI break release.
>>>>
>>>> So, 22.11 then?
>>>>
>>>
>>> Yes.
>>>
>>>>>
>>>>> You can add the new API in this release, and start using it.
>>>>> And mark the old API as deprecated in this release. This lets existing binaries
>>>>> to keep using it, but app needs to switch to new API for compilation.
>>>>> Old API can be removed on 22.11, and you will need a deprecation notice before
>>>>> 22.11 for it.
>>>>>
>>>>> Is above plan works for you?
>>>>>
>>>>
>>>> We have slightly rethought our approach, and the functionality that Xuan
>>>> requires does not rely on this API. They can, for all intents and purposes, be
>>>> considered unrelated issues.
>>>>
>>>> I still think it's a good idea to update the API that way, so I would like to do
>>>> that, and if we have to wait until 22.11 to fix it, I'm OK with that. Since
>>>> there no longer is any urgency here, it's acceptable to wait for the next LTS to
>>>> break it.
>>>>
>>>
>>> Got it.
>>>
>>> As far as I understand, main motivation in techboard decision was to prevent the
>>> ABI break as much as possible (main reason of decision wasn't deprecation notice
>>> being late). But if the correct thing to do is to rename the API (and break the
>>> ABI), I don't see the benefit to wait one more year, it is just delaying the
>>> impact and adding overhead to us.
>>> I am for being pragmatic and doing the change in this release if API rename is
>>> better option, perhaps we can visit the issue again in techboard.
>>>
>>> Can you please describe why renaming API is better option, comparing to adding
>>> new API with new parameter?
>>
>> I take it you meant "why renaming API *isn't* a better option".
>>
>> The problem we're solving is that the API in question does not know about page
>> sizes and thus can't map segments page-by-page. I mean I /guess/ we could have
>> two API's (one paged, one not paged), but then we get into all kinds of hairy
>> things about the API leaking the details of underlying platform.
>>
>> Bottom line: i like current API function name. It's concise, it's descriptive.
>> It's only missing a parameter, which i would like to add. A rename has been
>> suggested (deprecate old API, add new API with a different name, and with added
>> parameter), but honestly, I don't see why we have to do that because this is
>> predicated upon the assumption that we *can't* break ABI at all, under any
>> circumstances.
>>
>> Can you please explain to me what is wrong with keeping a versioned symbol?
>> Like, keep the old function around to keep ABI compatibility, but break the API
>> compatibility for those who target 22.02 or later? That's what symbol versioning
>> is *for*, is it not?
>>
> 
> Nothing wrong with symbol versioning, indeed that is preferred way if it works
> for you, I didn't get that symbol versioning is planned.
> 
> @Ray,
> Since symbol versioning is planned, ABI won't break, but API will change, can
> this change be done in this release without deprecation notice?

Yes - I would think so.
Since we are going to the effort of using symbol versioning nothing is being depreciated as such (yet). 

> Later we can have a deprecation notice to remove old symbol on 22.11.
> 
> Thanks,
> ferruh
> 

^ permalink raw reply	[relevance 0%]

* Re: [dpdk-dev] [PATCH v8] doc: add release milestones definition
  @ 2021-09-02 16:33  0%   ` Ferruh Yigit
  0 siblings, 0 replies; 200+ results
From: Ferruh Yigit @ 2021-09-02 16:33 UTC (permalink / raw)
  To: Thomas Monjalon, dev
  Cc: david.marchand, Asaf Penso, John McNamara, Ajit Khaparde,
	Bruce Richardson

On 8/26/2021 11:11 AM, Thomas Monjalon wrote:
> From: Asaf Penso <asafp@nvidia.com>
> 
> Adding more information about the release milestones.
> This includes the scope of change, expectations, etc.
> 
> Signed-off-by: Asaf Penso <asafp@nvidia.com>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> Acked-by: John McNamara <john.mcnamara@intel.com>
> Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
> v2: fix styling format and add content in the commit message
> v3: change punctuation and avoid plural form when unneeded
> v4: avoid abbreviations, "Priority" in -rc, and reword as John suggests
> v5: note that release candidates may vary
> v6: merge RFC and proposal deadline, add roadmap link and reduce duplication
> v7: make expectations clearer and stricter
> v8: add tests, more fixes, maintainers approval and new API rules
> ---
>  doc/guides/contributing/patches.rst | 85 +++++++++++++++++++++++++++--
>  1 file changed, 80 insertions(+), 5 deletions(-)
> 
> diff --git a/doc/guides/contributing/patches.rst b/doc/guides/contributing/patches.rst
> index b9cc6e67ae..ef784d0f99 100644
> --- a/doc/guides/contributing/patches.rst
> +++ b/doc/guides/contributing/patches.rst
> @@ -164,6 +164,10 @@ Make your planned changes in the cloned ``dpdk`` repo. Here are some guidelines
>    the :doc:`ABI policy <abi_policy>` and :ref:`ABI versioning <abi_versioning>`
>    guides. New external functions should also be added in alphabetical order.
>  
> +* Any new API function should be used in ``/app`` test directory.
> +
> +* When introducing a new device API, at least one driver should implement it.
> +

ack

>  * Important changes will require an addition to the release notes in ``doc/guides/rel_notes/``.
>    See the :ref:`Release Notes section of the Documentation Guidelines <doc_guidelines>` for details.
>  
> @@ -177,6 +181,8 @@ Make your planned changes in the cloned ``dpdk`` repo. Here are some guidelines
>  * Add documentation, if relevant, in the form of Doxygen comments or a User Guide in RST format.
>    See the :ref:`Documentation Guidelines <doc_guidelines>`.
>  
> +* Code and related documentation must be updated atomically in the same patch.
> +

ack

>  Once the changes have been made you should commit them to your local repo.
>  
>  For small changes, that do not require specific explanations, it is better to keep things together in the
> @@ -185,11 +191,6 @@ Larger changes that require different explanations should be separated into logi
>  A good way of thinking about whether a patch should be split is to consider whether the change could be
>  applied without dependencies as a backport.
>  
> -It is better to keep the related documentation changes in the same patch
> -file as the code, rather than one big documentation patch at the end of a
> -patchset. This makes it easier for future maintenance and development of the
> -code.
> -
>  As a guide to how patches should be structured run ``git log`` on similar files.
>  
>  
> @@ -663,3 +664,77 @@ patch accepted. The general cycle for patch review and acceptance is:
>       than rework of the original.
>     * Trivial patches may be merged sooner than described above at the tree committer's
>       discretion.
> +
> +
> +Milestones definition
> +---------------------
> +
> +Each DPDK release has milestones that help everyone to converge to the release date.
> +The following is a list of these milestones together with
> +concrete definitions and expectations for a typical release cycle.
> +An average cycle lasts 3 months and have 4 release candidates in the last month.
> +Test reports are expected to be received after each release candidate.
> +The number and expectations of release candidates might vary slightly.
> +The schedule is updated in the `roadmap <https://core.dpdk.org/roadmap/#dates>`_.
> +
> +.. note::
> +   Sooner is always better. Deadlines are not ideal dates.
> +
> +   Integration is never guaranteed but everyone can help.
> +
> +Roadmap
> +~~~~~~~
> +
> +* Announce new features in libraries, drivers, applications, and examples.
> +* To be published before the first day of the release cycle.
> +
> +Proposal Deadline
> +~~~~~~~~~~~~~~~~~
> +
> +* Must send an RFC (Request For Comments) or a complete patch of new features.
> +* Early RFC gives time for design review before complete implementation.
> +* Should include at least the API changes in libraries and applications.
> +* Library code should be quite complete at the deadline.
> +* Nice to have: driver implementation, example code, and documentation.
> +
> +rc1
> +~~~
> +
> +* Priority: libraries. No library feature should be accepted after -rc1.
> +* API changes or additions must be implemented in libraries.
> +* The API must include Doxygen documentation
> +  and be part of the relevant .rst files (library-specific and release notes).
> +* API should be used in a test application (``/app``).
> +* At least one PMD should implement the API.
> +  It may be a draft sent in a separate series.
> +* The above should be sent to the mailing list at least 2 weeks before -rc1
> +  to give time for review and maintainers approval.
> +* If no review after 10 days, a reminder should be sent.
> +* Nice to have: example code (``/examples``)
> +
> +rc2
> +~~~
> +
> +* Priority: drivers. No driver feature should be accepted after -rc2.
> +* A driver change must include documentation
> +  in the relevant .rst files (driver-specific and release notes).
> +* The above should be sent to the mailing list at least 2 weeks before -rc2.

Is 'the above' driver changes? It is good the have all driver changes two weeks
before -rc2 but taking into account that overall time between -rc1 & -rc2 is 3/4
weeks, two weeks before -rc2 may be hard to do practically.
We may go with this and try and evaluate later or reduce the requirement to one
week before -rc2, what do you think?

> +* Any issue found in -rc1 should be fixed.
> +
> +rc3
> +~~~
> +
> +* Priority: applications. No application feature should be accepted after -rc3.
> +* New functionality that does not depend on libraries update
> +  can be integrated as part of -rc3.
> +* The application change must include documentation in the relevant .rst files
> +  (application-specific and release notes if significant).
> +* Libraries and drivers cleanup are allowed.
> +* Small driver reworks.
> +* Critical and minor bug fixes.

As mentioned before, my concern is this may create false impression that bugs
are fixed only in this phase. What about remove this line completely and update
below -rc4 one as 'Critical bug fixes only.'? I think that makes intention more
clear.

> +
> +rc4
> +~~~
> +
> +* Documentation updates.
> +* Critical bug fixes.
> 


^ permalink raw reply	[relevance 0%]

* [dpdk-dev] [PATCH 2/5] pdump: support pcapng and filtering
  @ 2021-09-03  0:47  1% ` Stephen Hemminger
  2021-09-03  0:47  2% ` [dpdk-dev] [PATCH 4/5] doc: changes for new pcapng and dumpcap Stephen Hemminger
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 200+ results
From: Stephen Hemminger @ 2021-09-03  0:47 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

This enhances the DPDK pdump library to support new
pcapng format and filtering via BPF.

The internal client/server protocol is changed to support
two versions: the original pdump basic version and a
new pcapng version.

The internal version number (not part of exposed API or ABI)
is intentionally increased to cause any attempt to try
mismatched primary/secondary process to fail.

Add new API to do allow filtering of captured packets with
DPDK BPF (eBPF) filter program. It keeps statistics
on packets captured, filtered, and missed (because ring was full).

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/meson.build       |   4 +-
 lib/pdump/meson.build |   2 +-
 lib/pdump/rte_pdump.c | 386 +++++++++++++++++++++++++++++-------------
 lib/pdump/rte_pdump.h | 117 ++++++++++++-
 lib/pdump/version.map |   8 +
 5 files changed, 394 insertions(+), 123 deletions(-)

diff --git a/lib/meson.build b/lib/meson.build
index 514be90b09ec..b59bec494275 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -26,6 +26,7 @@ libraries = [
         'timer',   # eventdev depends on this
         'acl',
         'bbdev',
+        'bpf',
         'bitratestats',
         'cfgfile',
         'compressdev',
@@ -43,7 +44,6 @@ libraries = [
         'member',
 	'pcapng',
         'power',
-        'pdump',
         'rawdev',
         'regexdev',
         'rib',
@@ -55,10 +55,10 @@ libraries = [
         'ipsec', # ipsec lib depends on net, crypto and security
         'fib', #fib lib depends on rib
         'port', # pkt framework libs which use other libs from above
+	'pdump', # pdump lib depends on bpf pcapng
         'table',
         'pipeline',
         'flow_classify', # flow_classify lib depends on pkt framework table lib
-        'bpf',
         'graph',
         'node',
 ]
diff --git a/lib/pdump/meson.build b/lib/pdump/meson.build
index 3a95eabde6a6..51ceb2afdec5 100644
--- a/lib/pdump/meson.build
+++ b/lib/pdump/meson.build
@@ -3,4 +3,4 @@
 
 sources = files('rte_pdump.c')
 headers = files('rte_pdump.h')
-deps += ['ethdev']
+deps += ['ethdev', 'bpf', 'pcapng']
diff --git a/lib/pdump/rte_pdump.c b/lib/pdump/rte_pdump.c
index 382217bc1564..3237c54af69e 100644
--- a/lib/pdump/rte_pdump.c
+++ b/lib/pdump/rte_pdump.c
@@ -9,6 +9,7 @@
 #include <rte_log.h>
 #include <rte_errno.h>
 #include <rte_string_fns.h>
+#include <rte_pcapng.h>
 
 #include "rte_pdump.h"
 
@@ -27,30 +28,26 @@ enum pdump_operation {
 	ENABLE = 2
 };
 
+/*
+ * Note: version numbers intentionally start at 3
+ * in order to catch any application built with older out
+ * version of DPDK using incompatiable client request format.
+ */
 enum pdump_version {
-	V1 = 1
+	PDUMP_CLIENT_LEGACY = 3,
+	PDUMP_CLIENT_PCAPNG = 4,
 };
 
 struct pdump_request {
 	uint16_t ver;
 	uint16_t op;
-	uint32_t flags;
-	union pdump_data {
-		struct enable_v1 {
-			char device[RTE_DEV_NAME_MAX_LEN];
-			uint16_t queue;
-			struct rte_ring *ring;
-			struct rte_mempool *mp;
-			void *filter;
-		} en_v1;
-		struct disable_v1 {
-			char device[RTE_DEV_NAME_MAX_LEN];
-			uint16_t queue;
-			struct rte_ring *ring;
-			struct rte_mempool *mp;
-			void *filter;
-		} dis_v1;
-	} data;
+	uint16_t flags;
+	uint16_t queue;
+	struct rte_ring *ring;
+	struct rte_mempool *mp;
+	const struct rte_bpf *filter;
+	uint32_t snaplen;
+	char device[RTE_DEV_NAME_MAX_LEN];
 };
 
 struct pdump_response {
@@ -63,36 +60,67 @@ static struct pdump_rxtx_cbs {
 	struct rte_ring *ring;
 	struct rte_mempool *mp;
 	const struct rte_eth_rxtx_callback *cb;
-	void *filter;
+	const struct rte_bpf *filter;
+	enum pdump_version ver;
+	uint32_t snaplen;
+	struct rte_pdump_stats stats;
 } rx_cbs[RTE_MAX_ETHPORTS][RTE_MAX_QUEUES_PER_PORT],
 tx_cbs[RTE_MAX_ETHPORTS][RTE_MAX_QUEUES_PER_PORT];
 
 
-static inline void
-pdump_copy(struct rte_mbuf **pkts, uint16_t nb_pkts, void *user_params)
+static void
+pdump_copy(uint16_t port_id, uint16_t queue,
+	   enum rte_pcapng_direction direction,
+	   struct rte_mbuf **pkts, uint16_t nb_pkts, void *user_params)
 {
 	unsigned int i;
 	int ring_enq;
 	uint16_t d_pkts = 0;
 	struct rte_mbuf *dup_bufs[nb_pkts];
-	struct pdump_rxtx_cbs *cbs;
+	struct pdump_rxtx_cbs *cbs = user_params;
+	uint64_t ts;
 	struct rte_ring *ring;
 	struct rte_mempool *mp;
 	struct rte_mbuf *p;
+	uint64_t bpf_rc[nb_pkts];
+
+	if (cbs->filter &&
+	    !rte_bpf_exec_burst(cbs->filter, (void **)pkts, bpf_rc, nb_pkts))
+		return;	/* our work here is done */
 
-	cbs  = user_params;
+	ts = rte_get_tsc_cycles();
 	ring = cbs->ring;
 	mp = cbs->mp;
 	for (i = 0; i < nb_pkts; i++) {
-		p = rte_pktmbuf_copy(pkts[i], mp, 0, UINT32_MAX);
-		if (p)
+		/*
+		 * Similar behavior to rte_bpf_eth callback.
+		 * if BPF program returns zero value for a given packet,
+		 * then it will be ignored.
+		 */
+		if (cbs->filter && bpf_rc[i] == 0)
+			continue;
+
+		/*
+		 * If using pcapng then want to wrap packets
+		 * otherwise a simple copy.
+		 */
+		if (cbs->ver == PDUMP_CLIENT_PCAPNG)
+			p = rte_pcapng_copy(port_id, queue,
+					    pkts[i], mp, cbs->snaplen,
+					    ts, direction);
+		else
+			p = rte_pktmbuf_copy(pkts[i], mp, 0, cbs->snaplen);
+
+		if (likely(p != NULL))
 			dup_bufs[d_pkts++] = p;
 	}
 
+	cbs->stats.accepted += d_pkts;
 	ring_enq = rte_ring_enqueue_burst(ring, (void *)dup_bufs, d_pkts, NULL);
 	if (unlikely(ring_enq < d_pkts)) {
 		unsigned int drops = d_pkts - ring_enq;
 
+		cbs->stats.missed += drops;
 		PDUMP_LOG(DEBUG,
 			"only %d of packets enqueued to ring\n", ring_enq);
 		rte_pktmbuf_free_bulk(&dup_bufs[ring_enq], drops);
@@ -100,43 +128,50 @@ pdump_copy(struct rte_mbuf **pkts, uint16_t nb_pkts, void *user_params)
 }
 
 static uint16_t
-pdump_rx(uint16_t port __rte_unused, uint16_t qidx __rte_unused,
+pdump_rx(uint16_t port, uint16_t queue,
 	struct rte_mbuf **pkts, uint16_t nb_pkts,
 	uint16_t max_pkts __rte_unused,
 	void *user_params)
 {
-	pdump_copy(pkts, nb_pkts, user_params);
+	pdump_copy(port, queue, RTE_PCAPNG_DIRECTION_IN,
+		   pkts, nb_pkts, user_params);
 	return nb_pkts;
 }
 
 static uint16_t
-pdump_tx(uint16_t port __rte_unused, uint16_t qidx __rte_unused,
+pdump_tx(uint16_t port, uint16_t queue,
 		struct rte_mbuf **pkts, uint16_t nb_pkts, void *user_params)
 {
-	pdump_copy(pkts, nb_pkts, user_params);
+	pdump_copy(port, queue, RTE_PCAPNG_DIRECTION_OUT,
+		   pkts, nb_pkts, user_params);
 	return nb_pkts;
 }
 
 static int
-pdump_register_rx_callbacks(uint16_t end_q, uint16_t port, uint16_t queue,
-				struct rte_ring *ring, struct rte_mempool *mp,
-				uint16_t operation)
+pdump_register_rx_callbacks(enum pdump_version ver,
+			    uint16_t end_q, uint16_t port, uint16_t queue,
+			    struct rte_ring *ring, struct rte_mempool *mp,
+			    uint16_t operation, uint32_t snaplen)
 {
 	uint16_t qid;
-	struct pdump_rxtx_cbs *cbs = NULL;
 
 	qid = (queue == RTE_PDUMP_ALL_QUEUES) ? 0 : queue;
 	for (; qid < end_q; qid++) {
-		cbs = &rx_cbs[port][qid];
-		if (cbs && operation == ENABLE) {
+		struct pdump_rxtx_cbs *cbs = &rx_cbs[port][qid];
+
+		if (operation == ENABLE) {
 			if (cbs->cb) {
 				PDUMP_LOG(ERR,
 					"rx callback for port=%d queue=%d, already exists\n",
 					port, qid);
 				return -EEXIST;
 			}
+			cbs->ver = ver;
 			cbs->ring = ring;
 			cbs->mp = mp;
+			cbs->snaplen = snaplen;
+			memset(&cbs->stats, 0, sizeof(cbs->stats));
+
 			cbs->cb = rte_eth_add_first_rx_callback(port, qid,
 								pdump_rx, cbs);
 			if (cbs->cb == NULL) {
@@ -145,8 +180,7 @@ pdump_register_rx_callbacks(uint16_t end_q, uint16_t port, uint16_t queue,
 					rte_errno);
 				return rte_errno;
 			}
-		}
-		if (cbs && operation == DISABLE) {
+		} else if (operation == DISABLE) {
 			int ret;
 
 			if (cbs->cb == NULL) {
@@ -170,26 +204,30 @@ pdump_register_rx_callbacks(uint16_t end_q, uint16_t port, uint16_t queue,
 }
 
 static int
-pdump_register_tx_callbacks(uint16_t end_q, uint16_t port, uint16_t queue,
-				struct rte_ring *ring, struct rte_mempool *mp,
-				uint16_t operation)
+pdump_register_tx_callbacks(enum pdump_version ver,
+			    uint16_t end_q, uint16_t port, uint16_t queue,
+			    struct rte_ring *ring, struct rte_mempool *mp,
+			    uint16_t operation, uint32_t snaplen)
 {
 
 	uint16_t qid;
-	struct pdump_rxtx_cbs *cbs = NULL;
 
 	qid = (queue == RTE_PDUMP_ALL_QUEUES) ? 0 : queue;
 	for (; qid < end_q; qid++) {
-		cbs = &tx_cbs[port][qid];
-		if (cbs && operation == ENABLE) {
+		struct pdump_rxtx_cbs *cbs = &tx_cbs[port][qid];
+
+		if (operation == ENABLE) {
 			if (cbs->cb) {
 				PDUMP_LOG(ERR,
 					"tx callback for port=%d queue=%d, already exists\n",
 					port, qid);
 				return -EEXIST;
 			}
+			cbs->ver = ver;
 			cbs->ring = ring;
 			cbs->mp = mp;
+			cbs->snaplen = snaplen;
+			memset(&cbs->stats, 0, sizeof(cbs->stats));
 			cbs->cb = rte_eth_add_tx_callback(port, qid, pdump_tx,
 								cbs);
 			if (cbs->cb == NULL) {
@@ -198,8 +236,7 @@ pdump_register_tx_callbacks(uint16_t end_q, uint16_t port, uint16_t queue,
 					rte_errno);
 				return rte_errno;
 			}
-		}
-		if (cbs && operation == DISABLE) {
+		} else if (operation == DISABLE) {
 			int ret;
 
 			if (cbs->cb == NULL) {
@@ -233,32 +270,25 @@ set_pdump_rxtx_cbs(const struct pdump_request *p)
 	struct rte_ring *ring;
 	struct rte_mempool *mp;
 
+	if (!(p->ver == PDUMP_CLIENT_LEGACY ||
+	      p->ver == PDUMP_CLIENT_PCAPNG)) {
+		PDUMP_LOG(ERR,
+			  "incorrect client version %u\n", p->ver);
+		return -EINVAL;
+	}
+
 	flags = p->flags;
 	operation = p->op;
-	if (operation == ENABLE) {
-		ret = rte_eth_dev_get_port_by_name(p->data.en_v1.device,
-				&port);
-		if (ret < 0) {
-			PDUMP_LOG(ERR,
-				"failed to get port id for device id=%s\n",
-				p->data.en_v1.device);
-			return -EINVAL;
-		}
-		queue = p->data.en_v1.queue;
-		ring = p->data.en_v1.ring;
-		mp = p->data.en_v1.mp;
-	} else {
-		ret = rte_eth_dev_get_port_by_name(p->data.dis_v1.device,
-				&port);
-		if (ret < 0) {
-			PDUMP_LOG(ERR,
-				"failed to get port id for device id=%s\n",
-				p->data.dis_v1.device);
-			return -EINVAL;
-		}
-		queue = p->data.dis_v1.queue;
-		ring = p->data.dis_v1.ring;
-		mp = p->data.dis_v1.mp;
+	queue = p->queue;
+	ring = p->ring;
+	mp = p->mp;
+
+	ret = rte_eth_dev_get_port_by_name(p->device, &port);
+	if (ret < 0) {
+		PDUMP_LOG(ERR,
+			  "failed to get port id for device id=%s\n",
+			  p->device);
+		return -EINVAL;
 	}
 
 	/* validation if packet capture is for all queues */
@@ -296,8 +326,8 @@ set_pdump_rxtx_cbs(const struct pdump_request *p)
 	/* register RX callback */
 	if (flags & RTE_PDUMP_FLAG_RX) {
 		end_q = (queue == RTE_PDUMP_ALL_QUEUES) ? nb_rx_q : queue + 1;
-		ret = pdump_register_rx_callbacks(end_q, port, queue, ring, mp,
-							operation);
+		ret = pdump_register_rx_callbacks(p->ver, end_q, port, queue, ring, mp,
+						  operation, p->snaplen);
 		if (ret < 0)
 			return ret;
 	}
@@ -305,8 +335,8 @@ set_pdump_rxtx_cbs(const struct pdump_request *p)
 	/* register TX callback */
 	if (flags & RTE_PDUMP_FLAG_TX) {
 		end_q = (queue == RTE_PDUMP_ALL_QUEUES) ? nb_tx_q : queue + 1;
-		ret = pdump_register_tx_callbacks(end_q, port, queue, ring, mp,
-							operation);
+		ret = pdump_register_tx_callbacks(p->ver, end_q, port, queue, ring, mp,
+						  operation, p->snaplen);
 		if (ret < 0)
 			return ret;
 	}
@@ -349,6 +379,8 @@ rte_pdump_init(void)
 {
 	int ret;
 
+	rte_pcapng_init();
+
 	ret = rte_mp_action_register(PDUMP_MP, pdump_server);
 	if (ret && rte_errno != ENOTSUP)
 		return -1;
@@ -392,14 +424,21 @@ pdump_validate_ring_mp(struct rte_ring *ring, struct rte_mempool *mp)
 static int
 pdump_validate_flags(uint32_t flags)
 {
-	if (flags != RTE_PDUMP_FLAG_RX && flags != RTE_PDUMP_FLAG_TX &&
-		flags != RTE_PDUMP_FLAG_RXTX) {
+	if ((flags & RTE_PDUMP_FLAG_RXTX) == 0) {
 		PDUMP_LOG(ERR,
 			"invalid flags, should be either rx/tx/rxtx\n");
 		rte_errno = EINVAL;
 		return -1;
 	}
 
+	/* mask off the flags we know about */
+	if (flags & ~(RTE_PDUMP_FLAG_RXTX | RTE_PDUMP_FLAG_PCAPNG)) {
+		PDUMP_LOG(ERR,
+			  "unknown flags: %#x\n", flags);
+		rte_errno = ENOTSUP;
+		return -1;
+	}
+
 	return 0;
 }
 
@@ -426,12 +465,12 @@ pdump_validate_port(uint16_t port, char *name)
 }
 
 static int
-pdump_prepare_client_request(char *device, uint16_t queue,
-				uint32_t flags,
-				uint16_t operation,
-				struct rte_ring *ring,
-				struct rte_mempool *mp,
-				void *filter)
+pdump_prepare_client_request(const char *device, uint16_t queue,
+			     uint32_t flags, uint32_t snaplen,
+			     uint16_t operation,
+			     struct rte_ring *ring,
+			     struct rte_mempool *mp,
+			     const struct rte_bpf *filter)
 {
 	int ret = -1;
 	struct rte_mp_msg mp_req, *mp_rep;
@@ -440,23 +479,23 @@ pdump_prepare_client_request(char *device, uint16_t queue,
 	struct pdump_request *req = (struct pdump_request *)mp_req.param;
 	struct pdump_response *resp;
 
-	req->ver = 1;
-	req->flags = flags;
+	memset(req, 0, sizeof(*req));
+	if (flags & RTE_PDUMP_FLAG_PCAPNG)
+		req->ver = PDUMP_CLIENT_PCAPNG;
+	else
+		req->ver = PDUMP_CLIENT_LEGACY;
+
+	req->flags = flags & RTE_PDUMP_FLAG_RXTX;
 	req->op = operation;
+	req->queue = queue;
+	strlcpy(req->device, device,sizeof(req->device));
+
 	if ((operation & ENABLE) != 0) {
-		strlcpy(req->data.en_v1.device, device,
-			sizeof(req->data.en_v1.device));
-		req->data.en_v1.queue = queue;
-		req->data.en_v1.ring = ring;
-		req->data.en_v1.mp = mp;
-		req->data.en_v1.filter = filter;
-	} else {
-		strlcpy(req->data.dis_v1.device, device,
-			sizeof(req->data.dis_v1.device));
-		req->data.dis_v1.queue = queue;
-		req->data.dis_v1.ring = NULL;
-		req->data.dis_v1.mp = NULL;
-		req->data.dis_v1.filter = NULL;
+		req->queue = queue;
+		req->ring = ring;
+		req->mp = mp;
+		req->filter = filter;
+		req->snaplen = snaplen;
 	}
 
 	strlcpy(mp_req.name, PDUMP_MP, RTE_MP_MAX_NAME_LEN);
@@ -477,11 +516,17 @@ pdump_prepare_client_request(char *device, uint16_t queue,
 	return ret;
 }
 
-int
-rte_pdump_enable(uint16_t port, uint16_t queue, uint32_t flags,
-			struct rte_ring *ring,
-			struct rte_mempool *mp,
-			void *filter)
+/*
+ * There are two versions of this function, because although original API
+ * left place holder for future filter, it never checked the value.
+ * Therefore the API can't depend on application passing a non
+ * bogus value.
+ */
+static int
+pdump_enable(uint16_t port, uint16_t queue,
+	     uint32_t flags, uint32_t snaplen,
+	     struct rte_ring *ring, struct rte_mempool *mp,
+	     const struct rte_bpf *filter)
 {
 	int ret;
 	char name[RTE_DEV_NAME_MAX_LEN];
@@ -496,20 +541,42 @@ rte_pdump_enable(uint16_t port, uint16_t queue, uint32_t flags,
 	if (ret < 0)
 		return ret;
 
-	ret = pdump_prepare_client_request(name, queue, flags,
-						ENABLE, ring, mp, filter);
+	if (snaplen == 0)
+		snaplen = UINT32_MAX;
 
-	return ret;
+	return pdump_prepare_client_request(name, queue, flags, snaplen,
+					    ENABLE, ring, mp, filter);
 }
 
 int
-rte_pdump_enable_by_deviceid(char *device_id, uint16_t queue,
-				uint32_t flags,
-				struct rte_ring *ring,
-				struct rte_mempool *mp,
-				void *filter)
+rte_pdump_enable(uint16_t port, uint16_t queue, uint32_t flags,
+		 struct rte_ring *ring,
+		 struct rte_mempool *mp,
+		 void *filter __rte_unused)
 {
-	int ret = 0;
+	return pdump_enable(port, queue, flags, 0,
+			    ring, mp, NULL);
+}
+
+int
+rte_pdump_enable_bpf(uint16_t port, uint16_t queue,
+		     uint32_t flags, uint32_t snaplen,
+		     struct rte_ring *ring,
+		     struct rte_mempool *mp,
+		     const struct rte_bpf *filter)
+{
+	return pdump_enable(port, queue, flags, snaplen,
+			    ring, mp, filter);
+}
+
+static int
+pdump_enable_by_deviceid(const char *device_id, uint16_t queue,
+			 uint32_t flags, uint32_t snaplen,
+			 struct rte_ring *ring,
+			 struct rte_mempool *mp,
+			 const struct rte_bpf *filter)
+{
+	int ret;
 
 	ret = pdump_validate_ring_mp(ring, mp);
 	if (ret < 0)
@@ -518,10 +585,30 @@ rte_pdump_enable_by_deviceid(char *device_id, uint16_t queue,
 	if (ret < 0)
 		return ret;
 
-	ret = pdump_prepare_client_request(device_id, queue, flags,
-						ENABLE, ring, mp, filter);
+	return pdump_prepare_client_request(device_id, queue, flags, snaplen,
+					    ENABLE, ring, mp, filter);
+}
 
-	return ret;
+int
+rte_pdump_enable_by_deviceid(char *device_id, uint16_t queue,
+			     uint32_t flags,
+			     struct rte_ring *ring,
+			     struct rte_mempool *mp,
+			     void *filter __rte_unused)
+{
+	return pdump_enable_by_deviceid(device_id, queue, flags, 0,
+					ring, mp, NULL);
+}
+
+int
+rte_pdump_enable_bpf_by_deviceid(const char *device_id, uint16_t queue,
+				 uint32_t flags, uint32_t snaplen,
+				 struct rte_ring *ring,
+				 struct rte_mempool *mp,
+				 const struct rte_bpf *filter)
+{
+	return pdump_enable_by_deviceid(device_id, queue, flags, snaplen,
+					ring, mp, filter);
 }
 
 int
@@ -537,8 +624,8 @@ rte_pdump_disable(uint16_t port, uint16_t queue, uint32_t flags)
 	if (ret < 0)
 		return ret;
 
-	ret = pdump_prepare_client_request(name, queue, flags,
-						DISABLE, NULL, NULL, NULL);
+	ret = pdump_prepare_client_request(name, queue, flags, 0,
+					   DISABLE, NULL, NULL, NULL);
 
 	return ret;
 }
@@ -553,8 +640,73 @@ rte_pdump_disable_by_deviceid(char *device_id, uint16_t queue,
 	if (ret < 0)
 		return ret;
 
-	ret = pdump_prepare_client_request(device_id, queue, flags,
-						DISABLE, NULL, NULL, NULL);
+	ret = pdump_prepare_client_request(device_id, queue, flags, 0,
+					   DISABLE, NULL, NULL, NULL);
 
 	return ret;
 }
+
+static void
+pdump_sum_stats(struct rte_pdump_stats *total,
+		const struct pdump_rxtx_cbs *cbs,
+		uint16_t nq)
+{
+	uint16_t qid;
+
+	memset(total, 0, sizeof(*total));
+
+	for (qid = 0; qid < nq; qid++) {
+		total->received += cbs[qid].stats.received;
+		total->missed += cbs[qid].stats.missed;
+		total->accepted += cbs[qid].stats.accepted;
+	}
+}
+
+int
+rte_pdump_get_stats(uint16_t port, uint16_t queue,
+		    struct rte_pdump_stats *rx_stats,
+		    struct rte_pdump_stats *tx_stats)
+{
+	uint16_t nb_rx_q = 0, nb_tx_q = 0;
+
+	if (port >= RTE_MAX_ETHPORTS) {
+		PDUMP_LOG(ERR, "Invalid port id %u\n", port);
+		rte_errno = EINVAL;
+		return -1;
+	}
+
+	if (queue == RTE_PDUMP_ALL_QUEUES) {
+		struct rte_eth_dev_info dev_info;
+		int ret;
+
+		ret = rte_eth_dev_info_get(port, &dev_info);
+		if (ret != 0) {
+			PDUMP_LOG(ERR,
+				"Error during getting device (port %u) info: %s\n",
+				port, strerror(-ret));
+			return ret;
+		}
+		nb_rx_q = dev_info.nb_rx_queues;
+		nb_tx_q = dev_info.nb_tx_queues;
+	} else if (queue >= RTE_MAX_QUEUES_PER_PORT) {
+		PDUMP_LOG(ERR, "Invalid queue id %u\n", queue);
+		rte_errno = EINVAL;
+		return -1;
+	}
+
+	if (rx_stats) {
+		if (queue == RTE_PDUMP_ALL_QUEUES)
+			pdump_sum_stats(rx_stats, &rx_cbs[port][0], nb_rx_q);
+		else
+			*rx_stats = rx_cbs[port][queue].stats;
+	}
+
+	if (tx_stats) {
+		if (queue == RTE_PDUMP_ALL_QUEUES)
+			pdump_sum_stats(tx_stats, &tx_cbs[port][0], nb_tx_q);
+		else
+			*tx_stats = tx_cbs[port][queue].stats;
+	}
+
+	return 0;
+}
diff --git a/lib/pdump/rte_pdump.h b/lib/pdump/rte_pdump.h
index 6b00fc17aeb2..992331fddffb 100644
--- a/lib/pdump/rte_pdump.h
+++ b/lib/pdump/rte_pdump.h
@@ -15,6 +15,7 @@
 #include <stdint.h>
 #include <rte_mempool.h>
 #include <rte_ring.h>
+#include <rte_bpf.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -26,7 +27,9 @@ enum {
 	RTE_PDUMP_FLAG_RX = 1,  /* receive direction */
 	RTE_PDUMP_FLAG_TX = 2,  /* transmit direction */
 	/* both receive and transmit directions */
-	RTE_PDUMP_FLAG_RXTX = (RTE_PDUMP_FLAG_RX|RTE_PDUMP_FLAG_TX)
+	RTE_PDUMP_FLAG_RXTX = (RTE_PDUMP_FLAG_RX|RTE_PDUMP_FLAG_TX),
+
+	RTE_PDUMP_FLAG_PCAPNG = 4, /* format for pcapng */
 };
 
 /**
@@ -68,7 +71,7 @@ rte_pdump_uninit(void);
  * @param mp
  *  mempool on to which original packets will be mirrored or duplicated.
  * @param filter
- *  place holder for packet filtering.
+ *  Unused should be NULL.
  *
  * @return
  *    0 on success, -1 on error, rte_errno is set accordingly.
@@ -80,6 +83,42 @@ rte_pdump_enable(uint16_t port, uint16_t queue, uint32_t flags,
 		struct rte_mempool *mp,
 		void *filter);
 
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
+ *
+ * Enables packet capturing on given port and queue with filtering.
+ *
+ * @param port
+ *  port on which packet capturing should be enabled.
+ * @param queue
+ *  queue of a given port on which packet capturing should be enabled.
+ *  users should pass on value UINT16_MAX to enable packet capturing on all
+ *  queues of a given port.
+ * @param flags
+ *  flags specifies RTE_PDUMP_FLAG_RX/RTE_PDUMP_FLAG_TX/RTE_PDUMP_FLAG_RXTX
+ *  on which packet capturing should be enabled for a given port and queue.
+ * @param snaplen
+ *  snapshot length. No more than snaplen bytes of the network packet
+ *  will be saved.  Use 0 or 262144 to capture all of the packet.
+ * @param ring
+ *  ring on which captured packets will be enqueued for user.
+ * @param mp
+ *  mempool on to which original packets will be mirrored or duplicated.
+ * @param filter
+ *  BPF filter to run to filter packes (can be NULL)
+ *
+ * @return
+ *    0 on success, -1 on error, rte_errno is set accordingly.
+ */
+__rte_experimental
+int
+rte_pdump_enable_bpf(uint16_t port, uint16_t queue,
+		     uint32_t flags, uint32_t snaplen,
+		     struct rte_ring *ring,
+		     struct rte_mempool *mp,
+		     const struct rte_bpf *filter);
+
 /**
  * Disables packet capturing on given port and queue.
  *
@@ -118,7 +157,7 @@ rte_pdump_disable(uint16_t port, uint16_t queue, uint32_t flags);
  * @param mp
  *  mempool on to which original packets will be mirrored or duplicated.
  * @param filter
- *  place holder for packet filtering.
+ *  unused should be NULL
  *
  * @return
  *    0 on success, -1 on error, rte_errno is set accordingly.
@@ -131,6 +170,44 @@ rte_pdump_enable_by_deviceid(char *device_id, uint16_t queue,
 				struct rte_mempool *mp,
 				void *filter);
 
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
+ *
+ * Enables packet capturing on given device id and queue with filtering.
+ * device_id can be name or pci address of device.
+ *
+ * @param device_id
+ *  device id on which packet capturing should be enabled.
+ * @param queue
+ *  queue of a given device id on which packet capturing should be enabled.
+ *  users should pass on value UINT16_MAX to enable packet capturing on all
+ *  queues of a given device id.
+ * @param flags
+ *  flags specifies RTE_PDUMP_FLAG_RX/RTE_PDUMP_FLAG_TX/RTE_PDUMP_FLAG_RXTX
+ *  on which packet capturing should be enabled for a given port and queue.
+ * @param snaplen
+ *  snapshot length. No more than snaplen bytes of the network packet
+ *  will be saved.  Use 0 or 262144 to capture all of the packet.
+ * @param ring
+ *  ring on which captured packets will be enqueued for user.
+ * @param mp
+ *  mempool on to which original packets will be mirrored or duplicated.
+ * @param filter
+ *  BPF filter to run to filter packes (can be NULL)
+ *
+ * @return
+ *    0 on success, -1 on error, rte_errno is set accordingly.
+ */
+__rte_experimental
+int
+rte_pdump_enable_bpf_by_deviceid(const char *device_id, uint16_t queue,
+				 uint32_t flags, uint32_t snaplen,
+				 struct rte_ring *ring,
+				 struct rte_mempool *mp,
+				 const struct rte_bpf *filter);
+
+
 /**
  * Disables packet capturing on given device_id and queue.
  * device_id can be name or pci address of device.
@@ -153,6 +230,40 @@ int
 rte_pdump_disable_by_deviceid(char *device_id, uint16_t queue,
 				uint32_t flags);
 
+struct rte_pdump_stats {
+	uint64_t received;	/**< callback called */
+	uint64_t accepted;	/**< allowed by filter */
+	uint64_t missed;	/**< ring full */
+};
+
+/**
+ * Query packet capture statistics.
+ *
+ * @param port
+ *  port on which packet capturing should be enabled.
+ * @param queue
+ *  queue of a given port on which packet capturing should be enabled.
+ *  users should pass on value UINT16_MAX to enable packet capturing on all
+ *  queues of a given port.
+ * @param rx_stats
+ *   A pointer to a structure of type *rte_pdump_stats* to be filled with
+ *   the values of the capture statistics:
+ *   - *received* with the total of received packets.
+ *   - *accepted* with the total of packets matched by the filter.
+ *   - *missed*   with the total of packets missed because of ring full.
+ * @param tx_stats
+ *   - *received* with the total of transmitted packets.
+ *   - *accepted* with the total of packets matched by the filter.
+ *   - *missed*   with the total of packets missed because of ring full.
+ * @return
+ *   Zero if successful. Non-zero otherwise.
+ */
+__rte_experimental
+int
+rte_pdump_get_stats(uint16_t port, uint16_t queue,
+		    struct rte_pdump_stats *rx_stats,
+		    struct rte_pdump_stats *tx_stats);
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/lib/pdump/version.map b/lib/pdump/version.map
index f0a9d12c9a9e..b4c20b56f237 100644
--- a/lib/pdump/version.map
+++ b/lib/pdump/version.map
@@ -10,3 +10,11 @@ DPDK_22 {
 
 	local: *;
 };
+
+EXPERIMENTAL {
+	global:
+
+	rte_pdump_enable_bpf;
+	rte_pdump_enable_bpf_by_deviceid;
+	rte_pdump_get_stats;
+};
-- 
2.30.2


^ permalink raw reply	[relevance 1%]

* [dpdk-dev] [PATCH 4/5] doc: changes for new pcapng and dumpcap
    2021-09-03  0:47  1% ` [dpdk-dev] [PATCH 2/5] pdump: support pcapng and filtering Stephen Hemminger
@ 2021-09-03  0:47  2% ` Stephen Hemminger
                     ` (8 subsequent siblings)
  10 siblings, 0 replies; 200+ results
From: Stephen Hemminger @ 2021-09-03  0:47 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

Describe the new packet capture library and utilities

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 doc/api/doxy-api-index.md                     |  1 +
 doc/api/doxy-api.conf.in                      |  1 +
 doc/guides/howto/packet_capture_framework.rst | 67 ++++++++--------
 doc/guides/prog_guide/index.rst               |  1 +
 doc/guides/prog_guide/pcapng_lib.rst          | 24 ++++++
 doc/guides/prog_guide/pdump_lib.rst           | 28 +++++--
 doc/guides/rel_notes/release_21_11.rst        | 10 +++
 doc/guides/tools/dumpcap.rst                  | 80 +++++++++++++++++++
 doc/guides/tools/index.rst                    |  1 +
 9 files changed, 174 insertions(+), 39 deletions(-)
 create mode 100644 doc/guides/prog_guide/pcapng_lib.rst
 create mode 100644 doc/guides/tools/dumpcap.rst

diff --git a/doc/api/doxy-api-index.md b/doc/api/doxy-api-index.md
index 1992107a0356..ee07394d1c78 100644
--- a/doc/api/doxy-api-index.md
+++ b/doc/api/doxy-api-index.md
@@ -223,3 +223,4 @@ The public API headers are grouped by topics:
   [experimental APIs]  (@ref rte_compat.h),
   [ABI versioning]     (@ref rte_function_versioning.h),
   [version]            (@ref rte_version.h)
+  [pcapng]             (@ref rte_pcapng.h)
diff --git a/doc/api/doxy-api.conf.in b/doc/api/doxy-api.conf.in
index 325a0195c6ab..aba17799a9a1 100644
--- a/doc/api/doxy-api.conf.in
+++ b/doc/api/doxy-api.conf.in
@@ -58,6 +58,7 @@ INPUT                   = @TOPDIR@/doc/api/doxy-api-index.md \
                           @TOPDIR@/lib/metrics \
                           @TOPDIR@/lib/node \
                           @TOPDIR@/lib/net \
+                          @TOPDIR@/lib/pcapng \
                           @TOPDIR@/lib/pci \
                           @TOPDIR@/lib/pdump \
                           @TOPDIR@/lib/pipeline \
diff --git a/doc/guides/howto/packet_capture_framework.rst b/doc/guides/howto/packet_capture_framework.rst
index c31bac52340e..78baa609a021 100644
--- a/doc/guides/howto/packet_capture_framework.rst
+++ b/doc/guides/howto/packet_capture_framework.rst
@@ -1,18 +1,19 @@
 ..  SPDX-License-Identifier: BSD-3-Clause
     Copyright(c) 2017 Intel Corporation.
 
-DPDK pdump Library and pdump Tool
-=================================
+DPDK packet capture libraries and tools
+=======================================
 
 This document describes how the Data Plane Development Kit (DPDK) Packet
 Capture Framework is used for capturing packets on DPDK ports. It is intended
 for users of DPDK who want to know more about the Packet Capture feature and
 for those who want to monitor traffic on DPDK-controlled devices.
 
-The DPDK packet capture framework was introduced in DPDK v16.07. The DPDK
-packet capture framework consists of the DPDK pdump library and DPDK pdump
-tool.
-
+The DPDK packet capture framework was introduced in DPDK v16.07 and
+enhanced in 21.1. The DPDK packet capture framework consists of the
+libraries for collecting packets ``librte_pdump`` and writing packets
+to a file ``librte_pcapng``. There are two sample applications:
+``dpdk-dumpcap`` and older ``dpdk-pdump``.
 
 Introduction
 ------------
@@ -22,43 +23,46 @@ allow users to initialize the packet capture framework and to enable or
 disable packet capture. The library works on a multi process communication model and its
 usage is recommended for debugging purposes.
 
-The :ref:`dpdk-pdump <pdump_tool>` tool is developed based on the
-``librte_pdump`` library.  It runs as a DPDK secondary process and is capable
-of enabling or disabling packet capture on DPDK ports. The ``dpdk-pdump`` tool
-provides command-line options with which users can request enabling or
-disabling of the packet capture on DPDK ports.
+The :ref:`librte_pcapng <pcapng_library>` library provides the APIs to format
+packets and write them to a file in Pcapng format.
+
+
+The :ref:`dpdk-dumpcap <dumpcap_tool>` is a tool that captures packets in
+like Wireshark dumpcap does for Linux. It runs as a DPDK secondary process and
+captures packets from one or more interfaces and writes them to a file
+in Pcapng format.  The ``dpdk-dumpcap`` tool is designed to take
+most of the same options as the Wireshark ``dumpcap`` command.
 
-The application which initializes the packet capture framework will be a primary process
-and the application that enables or disables the packet capture will
-be a secondary process. The primary process sends the Rx and Tx packets from the DPDK ports
-to the secondary process.
+Without any options it will use the packet capture framework to
+capture traffic from the first available DPDK port.
 
 In DPDK the ``testpmd`` application can be used to initialize the packet
-capture framework and acts as a server, and the ``dpdk-pdump`` tool acts as a
+capture framework and acts as a server, and the ``dpdk-dumpcap`` tool acts as a
 client. To view Rx or Tx packets of ``testpmd``, the application should be
-launched first, and then the ``dpdk-pdump`` tool. Packets from ``testpmd``
-will be sent to the tool, which then sends them on to the Pcap PMD device and
-that device writes them to the Pcap file or to an external interface depending
-on the command-line option used.
+launched first, and then the ``dpdk-dumpcap`` tool. Packets from ``testpmd``
+will be sent to the tool, and then to the Pcapng file.
 
 Some things to note:
 
-* The ``dpdk-pdump`` tool can only be used in conjunction with a primary
+* All tools using ``librte_pdump`` can only be used in conjunction with a primary
   application which has the packet capture framework initialized already. In
   dpdk, only ``testpmd`` is modified to initialize packet capture framework,
-  other applications remain untouched. So, if the ``dpdk-pdump`` tool has to
+  other applications remain untouched. So, if the ``dpdk-dumpcap`` tool has to
   be used with any application other than the testpmd, the user needs to
   explicitly modify that application to call the packet capture framework
   initialization code. Refer to the ``app/test-pmd/testpmd.c`` code and look
   for ``pdump`` keyword to see how this is done.
 
-* The ``dpdk-pdump`` tool depends on the libpcap based PMD.
+* The ``dpdk-pdump`` tool is an older tool created as demonstration of ``librte_pdump``
+  library. The ``dpdk-pdump`` tool provides more limited functionality and
+  and depends on the Pcap PMD. It is retained only for compatibility reasons;
+  users should use ``dpdk-dumpcap`` instead.
 
 
 Test Environment
 ----------------
 
-The overview of using the Packet Capture Framework and the ``dpdk-pdump`` tool
+The overview of using the Packet Capture Framework and the ``dpdk-dumpcap`` utility
 for packet capturing on the DPDK port in
 :numref:`figure_packet_capture_framework`.
 
@@ -66,13 +70,13 @@ for packet capturing on the DPDK port in
 
 .. figure:: img/packet_capture_framework.*
 
-   Packet capturing on a DPDK port using the dpdk-pdump tool.
+   Packet capturing on a DPDK port using the dpdk-dumpcap utility.
 
 
 Running the Application
 -----------------------
 
-The following steps demonstrate how to run the ``dpdk-pdump`` tool to capture
+The following steps demonstrate how to run the ``dpdk-dumpcap`` tool to capture
 Rx side packets on dpdk_port0 in :numref:`figure_packet_capture_framework` and
 inspect them using ``tcpdump``.
 
@@ -80,16 +84,15 @@ inspect them using ``tcpdump``.
 
      sudo <build_dir>/app/dpdk-testpmd -c 0xf0 -n 4 -- -i --port-topology=chained
 
-#. Launch the pdump tool as follows::
+#. Launch the dpdk-dump as follows::
 
-     sudo <build_dir>/app/dpdk-pdump -- \
-          --pdump 'port=0,queue=*,rx-dev=/tmp/capture.pcap'
+     sudo <build_dir>/app/dpdk-dumpcap -w /tmp/capture.pcapng
 
 #. Send traffic to dpdk_port0 from traffic generator.
-   Inspect packets captured in the file capture.pcap using a tool
-   that can interpret Pcap files, for example tcpdump::
+   Inspect packets captured in the file capture.pcap using a tool such as
+   tcpdump or tshark that can interpret Pcapng files::
 
-     $tcpdump -nr /tmp/capture.pcap
+     $ tcpdump -nr /tmp/capture.pcapng
      reading from file /tmp/capture.pcap, link-type EN10MB (Ethernet)
      11:11:36.891404 IP 4.4.4.4.whois++ > 3.3.3.3.whois++: UDP, length 18
      11:11:36.891442 IP 4.4.4.4.whois++ > 3.3.3.3.whois++: UDP, length 18
diff --git a/doc/guides/prog_guide/index.rst b/doc/guides/prog_guide/index.rst
index 2dce507f46a3..b440c77c2ba1 100644
--- a/doc/guides/prog_guide/index.rst
+++ b/doc/guides/prog_guide/index.rst
@@ -43,6 +43,7 @@ Programmer's Guide
     ip_fragment_reassembly_lib
     generic_receive_offload_lib
     generic_segmentation_offload_lib
+    pcapng_lib
     pdump_lib
     multi_proc_support
     kernel_nic_interface
diff --git a/doc/guides/prog_guide/pcapng_lib.rst b/doc/guides/prog_guide/pcapng_lib.rst
new file mode 100644
index 000000000000..36379b530a57
--- /dev/null
+++ b/doc/guides/prog_guide/pcapng_lib.rst
@@ -0,0 +1,24 @@
+..  SPDX-License-Identifier: BSD-3-Clause
+    Copyright(c) 2016 Intel Corporation.
+
+.. _pcapng_library:
+
+Packet Capture File Writer
+==========================
+
+Pcapng is a library for creating files in Pcapng file format.
+The Pcapng file format is the default capture file format for modern
+network capture processing tools. It can be read by wireshark and tcpdump.
+
+Usage
+-----
+
+Before the library can be used the function ``rte_pcapng_init``
+should be called once to initialize timestamp computation.
+
+
+References
+----------
+* Draft RFC https://www.ietf.org/id/draft-tuexen-opsawg-pcapng-03.html
+
+* Project repository  https://github.com/pcapng/pcapng/
diff --git a/doc/guides/prog_guide/pdump_lib.rst b/doc/guides/prog_guide/pdump_lib.rst
index 62c0b015b2fe..9af91415e5ea 100644
--- a/doc/guides/prog_guide/pdump_lib.rst
+++ b/doc/guides/prog_guide/pdump_lib.rst
@@ -3,10 +3,10 @@
 
 .. _pdump_library:
 
-The librte_pdump Library
-========================
+The Packet Capture Library
+==========================
 
-The ``librte_pdump`` library provides a framework for packet capturing in DPDK.
+The DPDK ``pdump`` library provides a framework for packet capturing in DPDK.
 The library does the complete copy of the Rx and Tx mbufs to a new mempool and
 hence it slows down the performance of the applications, so it is recommended
 to use this library for debugging purposes.
@@ -23,11 +23,19 @@ or disable the packet capture, and to uninitialize it.
 
 * ``rte_pdump_enable()``:
   This API enables the packet capture on a given port and queue.
-  Note: The filter option in the API is a place holder for future enhancements.
+
+* ``rte_pdump_enable_bpf()``
+  This API enables the packet capture on a given port and queue.
+  It also allows setting an optional filter using DPDK BPF interpreter and
+  setting the captured packet length.
 
 * ``rte_pdump_enable_by_deviceid()``:
   This API enables the packet capture on a given device id (``vdev name or pci address``) and queue.
-  Note: The filter option in the API is a place holder for future enhancements.
+
+* ``rte_pdump_enable_bpf_by_deviceid()``
+  This API enables the packet capture on a given device id (``vdev name or pci address``) and queue.
+  It also allows seating an optional filter using DPDK BPF interpreter and
+  setting the captured packet length.
 
 * ``rte_pdump_disable()``:
   This API disables the packet capture on a given port and queue.
@@ -61,6 +69,12 @@ and enables the packet capture by registering the Ethernet RX and TX callbacks f
 and queue combinations. Then the primary process will mirror the packets to the new mempool and enqueue them to
 the rte_ring that secondary process have passed to these APIs.
 
+The packet ring supports one of two formats. The default format enqueues copies of the original packets
+into the rte_ring. If the ``RTE_PDUMP_FLAG_PCAPNG`` is set the mbuf data is extended with header and trailer
+to match the format of Pcapng enhanced packet block. The enhanced packet block has meta-data such as the
+timestamp, port and queue the packet was captured on. It is up to the application consuming the
+packets from the ring to select the format desired.
+
 The library APIs ``rte_pdump_disable()`` and ``rte_pdump_disable_by_deviceid()`` disables the packet capture.
 For the calls to these APIs from secondary process, the library creates the "pdump disable" request and sends
 the request to the primary process over the multi process channel. The primary process takes this request and
@@ -74,5 +88,5 @@ function.
 Use Case: Packet Capturing
 --------------------------
 
-The DPDK ``app/pdump`` tool is developed based on this library to capture packets in DPDK.
-Users can use this as an example to develop their own packet capturing tools.
+The DPDK ``app/dpdk-dumpcap`` utility uses this library
+to capture packets in DPDK.
diff --git a/doc/guides/rel_notes/release_21_11.rst b/doc/guides/rel_notes/release_21_11.rst
index 675b5738348b..ee24cbfdb99d 100644
--- a/doc/guides/rel_notes/release_21_11.rst
+++ b/doc/guides/rel_notes/release_21_11.rst
@@ -62,6 +62,16 @@ New Features
   * Added bus-level parsing of the devargs syntax.
   * Kept compatibility with the legacy syntax as parsing fallback.
 
+* **Enhance Packet capture.**
+
+  * New dpdk-dumpcap program that has most of the features of the
+    wireshark dumpcap utility including capture of multiple interfaces,
+    stopping after number of bytes, packets.
+  * New library for writing pcapng packet capture files.
+  * Enhancement to the pdump library to support:
+    * Packet filter with BPF.
+    * Pcapng format with timestamps and meta-data.
+    * Fixes packet capture with stripped VLAN tags.
 
 Removed Items
 -------------
diff --git a/doc/guides/tools/dumpcap.rst b/doc/guides/tools/dumpcap.rst
new file mode 100644
index 000000000000..90993bd5be5e
--- /dev/null
+++ b/doc/guides/tools/dumpcap.rst
@@ -0,0 +1,80 @@
+..  SPDX-License-Identifier: BSD-3-Clause
+    Copyright(c) 2020 Microsoft Corporation.
+
+.. _dumpcap_tool:
+
+dpdk-dumpcap Application
+========================
+
+The ``dpdk-dumpcap`` tool is a Data Plane Development Kit (DPDK)
+network traffic dump tool.  The interface is similar to  the dumpcap tool in Wireshark.
+It runs as a secondary DPDK process and lets you capture packets that are
+coming into and out of a DPDK primary process.
+The ``dpdk-dumpcap`` writes files in Pcapng packet format using
+capture file format is pcapng.
+
+Without any options set it will use DPDK to capture traffic from the first
+available DPDK interface and write the received raw packet data, along
+with timestamps into a pcapng file.
+
+If the ``-w`` option is not specified, ``dpdk-dumpcap`` writes to a newly
+create file with a name chosen based on interface name and timestamp.
+If ``-w`` option is specified, then that file is used.
+
+   .. Note::
+      * The ``dpdk-dumpcap`` tool can only be used in conjunction with a primary
+        application which has the packet capture framework initialized already.
+        In dpdk, only the ``testpmd`` is modified to initialize packet capture
+        framework, other applications remain untouched. So, if the ``dpdk-dumpcap``
+        tool has to be used with any application other than the testpmd, user
+        needs to explicitly modify that application to call packet capture
+        framework initialization code. Refer ``app/test-pmd/testpmd.c``
+        code to see how this is done.
+
+      * The ``dpdk-dumpcap`` tool runs as a DPDK secondary process. It exits when
+        the primary application exits.
+
+
+Running the Application
+-----------------------
+
+To list interfaces available for capture use ``--list-interfaces``.
+
+To capture on multiple interfaces at once, use multiple ``-I`` flags.
+
+Example
+-------
+
+.. code-block:: console
+
+   # ./<build_dir>/app/dpdk-dumpcap --list-interfaces
+   0. 000:00:03.0
+   1. 000:00:03.1
+
+   # ./<build_dir>/app/dpdk-dumpcap -I 0000:00:03.0 -c 6 -w /tmp/sample.pcapng
+   Packets captured: 6
+   Packets received/dropped on interface '0000:00:03.0' 6/0
+
+
+Limitations
+-----------
+The following options of Wireshark ``dumpcap`` are not yet implemented:
+
+   * ``-f <capture filter>`` -- needs translation from classic BPF to eBPF.
+
+   * ``-b|--ring-buffer`` -- more complex file management.
+
+   * ``-C <byte_limit>`` -- doesn't make sense in DPDK model.
+
+   * ``-t`` -- use a thread per interface
+
+   * Timestamp type.
+
+   * Link data types. Only EN10MB (Ethernet) is supported.
+
+   * Wireless related options:  ``-I|--monitor-mode`` and  ``-k <freq>``
+
+
+.. Note::
+   * The options to ``dpdk-dumpcap`` are like the Wireshark dumpcap program and
+     are not the same as ``dpdk-pdump`` and other DPDK applications.
diff --git a/doc/guides/tools/index.rst b/doc/guides/tools/index.rst
index 93dde4148e90..b71c12b8f2dd 100644
--- a/doc/guides/tools/index.rst
+++ b/doc/guides/tools/index.rst
@@ -8,6 +8,7 @@ DPDK Tools User Guides
     :maxdepth: 2
     :numbered:
 
+    dumpcap
     proc_info
     pdump
     pmdinfo
-- 
2.30.2


^ permalink raw reply	[relevance 2%]

* Re: [dpdk-dev] [PATCH v2 1/5] net/enetfec: introduce NXP ENETFEC driver
  @ 2021-09-03  7:14  3%   ` David Marchand
  2021-09-10  3:47  0%     ` [dpdk-dev] [EXT] " Apeksha Gupta
  0 siblings, 1 reply; 200+ results
From: David Marchand @ 2021-09-03  7:14 UTC (permalink / raw)
  To: Apeksha Gupta
  Cc: Andrew Rybchenko, Yigit, Ferruh, dev, Hemant Agrawal, Sachin Saxena

On Thu, Sep 2, 2021 at 8:01 PM Apeksha Gupta <apeksha.gupta@nxp.com> wrote:
>
> ENETFEC (Fast Ethernet Controller) is a network poll mode driver
> for NXP SoC i.MX 8M Mini.
>
> This patch adds skeleton for enetfec driver with probe function.
>
> Signed-off-by: Sachin Saxena <sachin.saxena@nxp.com>
> Signed-off-by: Apeksha Gupta <apeksha.gupta@nxp.com>
> ---
>  doc/guides/nics/enetfec.rst          | 121 ++++++++++++++++++++
>  doc/guides/nics/features/enetfec.ini |   8 ++
>  doc/guides/nics/index.rst            |   1 +
>  drivers/net/enetfec/enet_ethdev.c    |  95 ++++++++++++++++
>  drivers/net/enetfec/enet_ethdev.h    | 160 +++++++++++++++++++++++++++
>  drivers/net/enetfec/enet_pmd_logs.h  |  31 ++++++
>  drivers/net/enetfec/meson.build      |  15 +++
>  drivers/net/enetfec/version.map      |   3 +
>  drivers/net/meson.build              |   1 +
>  9 files changed, 435 insertions(+)
>  create mode 100644 doc/guides/nics/enetfec.rst
>  create mode 100644 doc/guides/nics/features/enetfec.ini
>  create mode 100644 drivers/net/enetfec/enet_ethdev.c
>  create mode 100644 drivers/net/enetfec/enet_ethdev.h
>  create mode 100644 drivers/net/enetfec/enet_pmd_logs.h
>  create mode 100644 drivers/net/enetfec/meson.build
>  create mode 100644 drivers/net/enetfec/version.map

Please update MAINTAINERS and release notes in this first patch.

>
> diff --git a/doc/guides/nics/enetfec.rst b/doc/guides/nics/enetfec.rst
> new file mode 100644
> index 0000000000..f151bb26c4
> --- /dev/null
> +++ b/doc/guides/nics/enetfec.rst
> @@ -0,0 +1,121 @@
> +.. SPDX-License-Identifier: BSD-3-Clause
> +   Copyright 2021 NXP
> +
> +ENETFEC Poll Mode Driver
> +========================
> +
> +The ENETFEC NIC PMD (**librte_net_enetfec**) provides poll mode driver
> +support for the inbuilt NIC found in the ** NXP i.MX 8M Mini** SoC.
> +
> +More information can be found at NXP Official Website
> +<https://www.nxp.com/products/processors-and-microcontrollers/arm-processors/i-mx-applications-processors/i-mx-8-processors/i-mx-8m-mini-arm-cortex-a53-cortex-m4-audio-voice-video:i.MX8MMINI>
> +
> +ENETFEC
> +-------
> +
> +This section provides an overview of the NXP ENETFEC and how it is
> +integrated into the DPDK.
> +
> +Contents summary
> +
> +- ENETFEC overview
> +- ENETFEC features
> +- Supported ENETFEC SoCs
> +- Prerequisites
> +- Driver compilation and testing
> +- Limitations
> +
> +ENETFEC Overview
> +~~~~~~~~~~~~~~~~
> +The i.MX 8M Mini Media Applications Processor is built to achieve both high
> +performance and low power consumption. ENETFEC is a hardware programmable
> +packet forwarding engine to provide high performance Ethernet interface.
> +The diagram below shows a system level overview of ENETFEC:
> +
> +   ====================================================+===============
> +   US   +-----------------------------------------+    | Kernel Space
> +        |                                         |    |
> +        |              ENETFEC Driver             |    |
> +        +-----------------------------------------+    |
> +                          ^   |                        |
> +   ENETFEC            RXQ |   | TXQ                   |
> +   PMD                    |   |                       |
> +                          |   v                       |   +----------+

Misalignment of the right part.


> +                     +-------------+                   |   | fec-uio  |

What is fec-uio?
I can't find it in upstream linux kernel.


> +                     | net_enetfec |                   |   +----------+
> +                     +-------------+                   |
> +                          ^   |                        |
> +                      TXQ |   | RXQ                    |
> +                          |   |                        |
> +                          |   v                        |
> +    ===================================================+===============
> +         +----------------------------------------+
> +         |                                        |        HW
> +         |  i.MX 8M MINI EVK                      |
> +         |               +-----+                  |
> +         |               | MAC |                  |
> +         +---------------+-----+------------------+
> +                        | PHY |
> +                        +-----+

Misalignment.


> +
> +ENETFEC Ethernet driver is traditional DPDK PMD driver running in the userspace.
> +The MAC and PHY are the hardware blocks. 'fec-uio' is the UIO driver, ENETFEC PMD
> +uses UIO interface to interact with kernel for PHY initialisation and for mapping
> +the allocated memory of register & BD in kernel with DPDK which gives access to
> +non-cacheable memory for BD. net_enetfec is logical Ethernet interface, created by
> +ENETFEC driver.
> +
> +- ENETFEC driver registers the device in virtual device driver.
> +- RTE framework scans and will invoke the probe function of ENETFEC driver.
> +- The probe function will set the basic device registers and also setups BD rings.
> +- On packet Rx the respective BD Ring status bit is set which is then used for
> +  packet processing.
> +- Then Tx is done first followed by Rx via logical interfaces.
> +
> +ENETFEC Features
> +~~~~~~~~~~~~~~~~~
> +
> +- ARMv8
> +
> +Supported ENETFEC SoCs
> +~~~~~~~~~~~~~~~~~~~~~~
> +
> +- i.MX 8M Mini
> +
> +Prerequisites
> +~~~~~~~~~~~~~
> +
> +There are three main pre-requisites for executing ENETFEC PMD on a i.MX 8M Mini
> +compatible board:
> +
> +1. **ARM 64 Tool Chain**
> +
> +   For example, the `*aarch64* Linaro Toolchain <https://releases.linaro.org/components/toolchain/binaries/7.4-2019.02/aarch64-linux-gnu/gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu.tar.xz>`_.
> +
> +2. **Linux Kernel**
> +
> +  It can be obtained from `NXP's Github hosting <https://source.codeaurora.org/external/qoriq/qoriq-components/linux>`_.
> +
> +3. **Rootfile system**
> +
> +   Any *aarch64* supporting filesystem can be used. For example,
> +   Ubuntu 18.04 LTS (Bionic) or 20.04 LTS(Focal) userland which can be obtained
> +   from `here <http://cdimage.ubuntu.com/ubuntu-base/releases/18.04/release/ubuntu-base-18.04.1-base-arm64.tar.gz>`_.
> +
> +4. The Ethernet device will be registered as virtual device, so ENETFEC has dependency on
> +   **rte_bus_vdev** library and it is mandatory to use `--vdev` with value `net_enetfec` to
> +   run DPDK application.
> +
> +Driver compilation and testing
> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> +
> +Follow instructions available in the document
> +:ref:`compiling and testing a PMD for a NIC <pmd_build_and_test>`
> +to launch **testpmd**

dpdk-testpmd.


> +
> +Limitations
> +~~~~~~~~~~~
> +
> +- Multi queue is not supported.
> +- Link status is down always.
> +- Single Ethernet interface.
> diff --git a/doc/guides/nics/features/enetfec.ini b/doc/guides/nics/features/enetfec.ini
> new file mode 100644
> index 0000000000..5700697981
> --- /dev/null
> +++ b/doc/guides/nics/features/enetfec.ini
> @@ -0,0 +1,8 @@
> +;
> +; Supported features of the 'enetfec' network poll mode driver.
> +;
> +; Refer to default.ini for the full list of available PMD features.
> +;
> +[Features]
> +ARMv8                = Y
> +Usage doc            = Y
> diff --git a/doc/guides/nics/index.rst b/doc/guides/nics/index.rst
> index 784d5d39f6..777fdab4a0 100644
> --- a/doc/guides/nics/index.rst
> +++ b/doc/guides/nics/index.rst
> @@ -26,6 +26,7 @@ Network Interface Controller Drivers
>      e1000em
>      ena
>      enetc
> +    enetfec
>      enic
>      fm10k
>      hinic
> diff --git a/drivers/net/enetfec/enet_ethdev.c b/drivers/net/enetfec/enet_ethdev.c
> new file mode 100644
> index 0000000000..88774788cf
> --- /dev/null
> +++ b/drivers/net/enetfec/enet_ethdev.c
> @@ -0,0 +1,95 @@
> +/* SPDX-License-Identifier: BSD-3-Clause
> + * Copyright 2020-2021 NXP
> + */
> +
> +#include <stdio.h>
> +#include <fcntl.h>
> +#include <stdlib.h>
> +#include <unistd.h>
> +#include <errno.h>
> +#include <rte_kvargs.h>
> +#include <ethdev_vdev.h>
> +#include <rte_bus_vdev.h>
> +#include <rte_dev.h>
> +#include <rte_ether.h>
> +#include "enet_ethdev.h"
> +#include "enet_pmd_logs.h"
> +
> +#define ENETFEC_NAME_PMD                net_enetfec
> +#define ENETFEC_VDEV_GEM_ID_ARG         "intf"
> +#define ENETFEC_CDEV_INVALID_FD         -1
> +
> +int enetfec_logtype_pmd;

If using RTE_LOG_REGISTER* macros (see below), you don't need this definition.


> +
> +static int
> +enetfec_eth_init(struct rte_eth_dev *dev)
> +{
> +       rte_eth_dev_probing_finish(dev);
> +       return 0;
> +}
> +
> +static int
> +pmd_enetfec_probe(struct rte_vdev_device *vdev)
> +{
> +       struct rte_eth_dev *dev = NULL;
> +       struct enetfec_private *fep;
> +       const char *name;
> +       int rc;
> +
> +       name = rte_vdev_device_name(vdev);
> +       if (name == NULL)
> +               return -EINVAL;
> +       ENETFEC_PMD_LOG(INFO, "Initializing pmd_fec for %s", name);
> +
> +       dev = rte_eth_vdev_allocate(vdev, sizeof(*fep));
> +       if (dev == NULL)
> +               return -ENOMEM;
> +
> +       /* setup board info structure */
> +       fep = dev->data->dev_private;
> +       fep->dev = dev;
> +       rc = enetfec_eth_init(dev);
> +       if (rc)
> +               goto failed_init;
> +
> +       return 0;
> +
> +failed_init:
> +       ENETFEC_PMD_ERR("Failed to init");
> +       return rc;
> +}
> +
> +static int
> +pmd_enetfec_remove(struct rte_vdev_device *vdev)
> +{
> +       struct rte_eth_dev *eth_dev = NULL;
> +       int ret;
> +
> +       /* find the ethdev entry */
> +       eth_dev = rte_eth_dev_allocated(rte_vdev_device_name(vdev));
> +       if (eth_dev == NULL)
> +               return -ENODEV;
> +
> +       ret = rte_eth_dev_release_port(eth_dev);
> +       if (ret != 0)
> +               return -EINVAL;
> +
> +       ENETFEC_PMD_INFO("Closing sw device");
> +       return 0;
> +}
> +
> +static struct rte_vdev_driver pmd_enetfec_drv = {
> +       .probe = pmd_enetfec_probe,
> +       .remove = pmd_enetfec_remove,
> +};
> +
> +RTE_PMD_REGISTER_VDEV(ENETFEC_NAME_PMD, pmd_enetfec_drv);
> +RTE_PMD_REGISTER_PARAM_STRING(ENETFEC_NAME_PMD, ENETFEC_VDEV_GEM_ID_ARG "=<int>");
> +
> +RTE_INIT(enetfec_pmd_init_log)
> +{
> +       int ret;
> +       ret = rte_log_register_type_and_pick_level(ENETFEC_LOGTYPE_PREFIX "driver",
> +                                                  RTE_LOG_NOTICE);
> +       enetfec_logtype_pmd = (ret < 0) ? RTE_LOGTYPE_PMD : ret;
> +}

Please use RTE_LOG_REGISTER_DEFAULT.


> diff --git a/drivers/net/enetfec/enet_ethdev.h b/drivers/net/enetfec/enet_ethdev.h
> new file mode 100644
> index 0000000000..8c61176fb5
> --- /dev/null
> +++ b/drivers/net/enetfec/enet_ethdev.h
> @@ -0,0 +1,160 @@
> +/* SPDX-License-Identifier: BSD-3-Clause
> + * Copyright 2020-2021 NXP
> + */
> +
> +#ifndef __ENETFEC_ETHDEV_H__
> +#define __ENETFEC_ETHDEV_H__
> +
> +#include <compat.h>
> +#include <rte_ethdev.h>
> +
> +/* Common log type name prefix */
> +#define ENETFEC_LOGTYPE_PREFIX "pmd.net.enetfec."
> +
> +/*
> + * ENETFEC with AVB IP can support maximum 3 rx and tx queues.
> + */
> +#define ENETFEC_MAX_Q          3
> +
> +#define BD_LEN                 49152
> +#define ENETFEC_TX_FR_SIZE     2048
> +#define MAX_TX_BD_RING_SIZE    512     /* It should be power of 2 */
> +#define MAX_RX_BD_RING_SIZE    512
> +
> +/* full duplex or half duplex */
> +#define HALF_DUPLEX             0x00
> +#define FULL_DUPLEX             0x01
> +#define UNKNOWN_DUPLEX          0xff
> +
> +#define PKT_MAX_BUF_SIZE        1984
> +#define OPT_FRAME_SIZE         (PKT_MAX_BUF_SIZE << 16)
> +#define ETH_ALEN               RTE_ETHER_ADDR_LEN
> +#define ETH_HLEN               RTE_ETHER_HDR_LEN
> +#define VLAN_HLEN              4
> +
> +struct bufdesc {
> +       uint16_t                bd_datlen;  /* buffer data length */
> +       uint16_t                bd_sc;      /* buffer control & status */
> +       uint32_t                bd_bufaddr; /* buffer address */
> +};
> +
> +struct bufdesc_ex {
> +       struct                  bufdesc desc;
> +       uint32_t                bd_esc;
> +       uint32_t                bd_prot;
> +       uint32_t                bd_bdu;
> +       uint32_t                ts;
> +       uint16_t                res0[4];
> +};
> +
> +struct bufdesc_prop {
> +       int                     que_id;
> +       /* Addresses of Tx and Rx buffers */
> +       struct bufdesc          *base;
> +       struct bufdesc          *last;
> +       struct bufdesc          *cur;
> +       void __iomem            *active_reg_desc;
> +       uint64_t                descr_baseaddr_p;
> +       unsigned short          ring_size;
> +       unsigned char           d_size;
> +       unsigned char           d_size_log2;
> +};
> +
> +struct enetfec_priv_tx_q {
> +       struct bufdesc_prop     bd;
> +       struct rte_mbuf         *tx_mbuf[MAX_TX_BD_RING_SIZE];
> +       struct bufdesc          *dirty_tx;
> +       struct rte_mempool      *pool;
> +       struct enetfec_private  *fep;
> +};
> +
> +struct enetfec_priv_rx_q {
> +       struct bufdesc_prop     bd;
> +       struct rte_mbuf         *rx_mbuf[MAX_RX_BD_RING_SIZE];
> +       struct rte_mempool      *pool;
> +       struct enetfec_private  *fep;
> +};
> +
> +/* Buffer descriptors of FEC are used to track the ring buffers. Buffer
> + * descriptor base is x_bd_base. Currently available buffer are x_cur
> + * and x_cur. where x is rx or tx. Current buffer is tracked by dirty_tx
> + * that is sent by the controller.
> + * The tx_cur and dirty_tx are same in completely full and empty
> + * conditions. Actual condition is determined by empty & ready bits.
> + */
> +struct enetfec_private {
> +       struct rte_eth_dev      *dev;
> +       struct rte_eth_stats    stats;
> +       struct rte_mempool      *pool;
> +       uint16_t                max_rx_queues;
> +       uint16_t                max_tx_queues;
> +       unsigned int            total_tx_ring_size;
> +       unsigned int            total_rx_ring_size;
> +       bool                    bufdesc_ex;
> +       unsigned int            tx_align;
> +       unsigned int            rx_align;
> +       int                     full_duplex;
> +       unsigned int            phy_speed;
> +       u_int32_t               quirks;
> +       int                     flag_csum;
> +       int                     flag_pause;
> +       int                     flag_wol;
> +       bool                    rgmii_txc_delay;
> +       bool                    rgmii_rxc_delay;
> +       int                     link;
> +       void                    *hw_baseaddr_v;
> +       uint64_t                hw_baseaddr_p;
> +       void                    *bd_addr_v;
> +       uint64_t                bd_addr_p;
> +       uint64_t                bd_addr_p_r[ENETFEC_MAX_Q];
> +       uint64_t                bd_addr_p_t[ENETFEC_MAX_Q];
> +       void                    *dma_baseaddr_r[ENETFEC_MAX_Q];
> +       void                    *dma_baseaddr_t[ENETFEC_MAX_Q];
> +       uint64_t                cbus_size;
> +       unsigned int            reg_size;
> +       unsigned int            bd_size;
> +       int                     hw_ts_rx_en;
> +       int                     hw_ts_tx_en;
> +       struct enetfec_priv_rx_q *rx_queues[ENETFEC_MAX_Q];
> +       struct enetfec_priv_tx_q *tx_queues[ENETFEC_MAX_Q];
> +};
> +
> +#define writel(v, p) ({*(volatile unsigned int *)(p) = (v); })
> +#define readl(p) rte_read32(p)
> +
> +static inline struct
> +bufdesc *enet_get_nextdesc(struct bufdesc *bdp, struct bufdesc_prop *bd)
> +{
> +       return (bdp >= bd->last) ? bd->base
> +                       : (struct bufdesc *)(((void *)bdp) + bd->d_size);
> +}
> +
> +static inline struct
> +bufdesc *enet_get_prevdesc(struct bufdesc *bdp, struct bufdesc_prop *bd)
> +{
> +       return (bdp <= bd->base) ? bd->last
> +                       : (struct bufdesc *)(((void *)bdp) - bd->d_size);
> +}
> +
> +static inline int
> +enet_get_bd_index(struct bufdesc *bdp, struct bufdesc_prop *bd)
> +{
> +       return ((const char *)bdp - (const char *)bd->base) >> bd->d_size_log2;
> +}
> +
> +static inline int
> +fls64(unsigned long word)
> +{
> +       return (64 - __builtin_clzl(word)) - 1;
> +}
> +
> +uint16_t enetfec_recv_pkts(void *rxq1, __rte_unused struct rte_mbuf **rx_pkts,
> +               uint16_t nb_pkts);
> +uint16_t enetfec_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
> +               uint16_t nb_pkts);
> +struct bufdesc *enet_get_nextdesc(struct bufdesc *bdp,
> +               struct bufdesc_prop *bd);
> +int enet_new_rxbdp(struct enetfec_private *fep, struct bufdesc *bdp,
> +               struct rte_mbuf *mbuf);
> +
> +#endif /*__ENETFEC_ETHDEV_H__*/
> diff --git a/drivers/net/enetfec/enet_pmd_logs.h b/drivers/net/enetfec/enet_pmd_logs.h
> new file mode 100644
> index 0000000000..e7b3964a0e
> --- /dev/null
> +++ b/drivers/net/enetfec/enet_pmd_logs.h
> @@ -0,0 +1,31 @@
> +/* SPDX-License-Identifier: BSD-3-Clause
> + * Copyright 2020-2021 NXP
> + */
> +
> +#ifndef _ENETFEC_LOGS_H_
> +#define _ENETFEC_LOGS_H_
> +
> +extern int enetfec_logtype_pmd;
> +
> +/* PMD related logs */
> +#define ENETFEC_PMD_LOG(level, fmt, args...) \
> +       rte_log(RTE_LOG_ ## level, enetfec_logtype_pmd, "\nfec_net: %s()" \
> +               fmt "\n", __func__, ##args)
> +
> +#define PMD_INIT_FUNC_TRACE() ENET_PMD_LOG(DEBUG, " >>")
> +
> +#define ENETFEC_PMD_DEBUG(fmt, args...) \
> +       ENETFEC_PMD_LOG(DEBUG, fmt, ## args)
> +#define ENETFEC_PMD_ERR(fmt, args...) \
> +       ENETFEC_PMD_LOG(ERR, fmt, ## args)
> +#define ENETFEC_PMD_INFO(fmt, args...) \
> +       ENETFEC_PMD_LOG(INFO, fmt, ## args)
> +
> +#define ENETFEC_PMD_WARN(fmt, args...) \
> +       ENETFEC_PMD_LOG(WARNING, fmt, ## args)
> +
> +/* DP Logs, toggled out at compile time if level lower than current level */
> +#define ENETFEC_DP_LOG(level, fmt, args...) \
> +       RTE_LOG_DP(level, PMD, fmt, ## args)
> +
> +#endif /* _ENETFEC_LOGS_H_ */
> diff --git a/drivers/net/enetfec/meson.build b/drivers/net/enetfec/meson.build
> new file mode 100644
> index 0000000000..252bf83309
> --- /dev/null
> +++ b/drivers/net/enetfec/meson.build
> @@ -0,0 +1,15 @@
> +# SPDX-License-Identifier: BSD-3-Clause
> +# Copyright 2021 NXP
> +
> +if not is_linux
> +       build = false
> +       reason = 'only supported on linux'

The doc specifies that only armv8 is supported.


> +endif
> +
> +deps += ['common_dpaax']
> +
> +sources = files('enet_ethdev.c')
> +
> +if cc.has_argument('-Wno-pointer-arith')
> +       cflags += '-Wno-pointer-arith'
> +endif

Can't this be fixed in the code rather than ignored?


> diff --git a/drivers/net/enetfec/version.map b/drivers/net/enetfec/version.map
> new file mode 100644
> index 0000000000..170c04fe53
> --- /dev/null
> +++ b/drivers/net/enetfec/version.map
> @@ -0,0 +1,3 @@
> +DPDK_20.0 {

Wrong ABI version.


> +        local: *;
> +};
> diff --git a/drivers/net/meson.build b/drivers/net/meson.build
> index bcf488f203..92f433d5e8 100644
> --- a/drivers/net/meson.build
> +++ b/drivers/net/meson.build
> @@ -19,6 +19,7 @@ drivers = [
>          'e1000',
>          'ena',
>          'enetc',
> +       'enetfec',

Indent.


>          'enic',
>          'failsafe',
>          'fm10k',
> --
> 2.17.1
>

-- 
David Marchand


^ permalink raw reply	[relevance 3%]

* [dpdk-dev] [PATCH v1] ethdev: clarify flow action PORT ID semantics
  @ 2021-09-03  7:46  3% ` Andrew Rybchenko
  0 siblings, 0 replies; 200+ results
From: Andrew Rybchenko @ 2021-09-03  7:46 UTC (permalink / raw)
  To: Thomas Monjalon, Ferruh Yigit, Ori Kam
  Cc: dev, Eli Britstein, Ilya Maximets, Ajit Khaparde, Ivan Malov,
	John Daley, Hyong Youb Kim, Jerin Jacob, Nithin Dabilpuram,
	Kiran Kumar K, Somnath Kotur

From: Ivan Malov <ivan.malov@oktetlabs.ru>

Definition of action PORT_ID is ambiguous.

Documentation says "Directs matching traffic to a given DPDK port ID."
It suggests that an application will receive corresponding traffic on
the port using ethdev Rx burst API. Some network PMDs implement PORT_ID
action this way.

However, OvS+DPDK uses PORT_ID action a way which is natural it to
bypass OvS and redirect corresponding traffic to wire if the DPDK port
is a physical function or to a virtual function if the DPDK port is
a VF representor. Anyway corresponding packets will not be received
using ethdev Rx burst API by the OvS+DPDK. Other network PMDs implement
the PORT_ID action following the semantics.

The latter semantics may be explained to match the above definition
taking port representor definition into account which says that port
representor is a ghost of the real port and redirecting a traffic to
it means redirecting the traffic to the corresponding real port.
However, representors are not the only use case, and solution should
be extended anyway to support both options.

Since these interpretations of the PORT_ID action semantics are basically
opposite and both have reasons behind, it is bad to silently break some
applications changing default meaning. So make it backward incompatible
to ensure that all applications are updated to use it in a right way.

Stick to ingress/egress terminology to specify direction since it is
well defined from DPDK application point of view:
 - ingress to be received via the specified port;
 - egress as if it would-be transmitted via the specified port.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
---
The patch is a follow up of the long discussion of the RFC [1].
It is just an attempt to summarize some results of the discussion.

Small quote from the discussion:

On June 3, 2021, 11:05 a.m. UTC, Ilya Maximets wrote:
> On June 3, 2021, 10:33 a.m. UTC, Andrew Rybchenko wrote:
> >
> > A. Add "ingress" bit with "egress" as unset meaning.
> >    Yes, that's what is current behaviour assumed and
> >    used by OvS and implemented in some PMDs.
> >    My problem with it that it is, IMHO, inconsistent
> >    default value (as explained above).
> >
> > B. Add "egress" bit with "ingress" as unset meaning.
> >    Basically it is what is suggested in the RFC, but
> >    the problem of the suggestion is the silent breakage
> >    of existing users (let's put it a side if it is
> >    correct usage or misuse). It is still the fact.
> >
> > C. Encode above in ethdev port ID MSB.
> >    The problem of the solution is that encoding
> >    makes sense for representors, but the problem
> >    exists for non-representor ports as well.
> >    I have no good ideas on terminology in the case
> >    if we try to solve it for non-representors.
> >
> > D. Break API and ABI and add enum with unset(default)/
> >    ingress/egress members to enforce application to
> >    specify direction.
> >
> > It is unclear what we'll do in the case of A, B and D
> > if we encode representor in port ID MSB in any case.
>
> My opinion:
>
>  - Option D is the best choice for rte_flow.  No defaults, users forced
>    to explicitly choose the direction in HW-independent way.
>
>  - I agree that option C somewhat conflicts with the 'ingress/egress'
>    flag idea and it is more hardware-specific.  Therefore if option C
>    is going to be implemented it should be implemented in concept of
>    option A, i.e. 'egress' is default option if port ID MSB is not set.

If the solution is accepted, testpmd must be updated to require action
direction specification and drivers which implement the action must be
updated to handle direction properly and reject unspecified value with
appropriate error message.

If the patch does not address all concerns and there is still
significant disagreement on the topic, it would be good to schedule
call to discuss it.

[1] https://patches.dpdk.org/project/dpdk/patch/20210601111420.5549-1-ivan.malov@oktetlabs.ru/

 doc/guides/prog_guide/rte_flow.rst     |  7 ++++++-
 doc/guides/rel_notes/deprecation.rst   |  6 ------
 doc/guides/rel_notes/release_21_11.rst |  4 ++++
 lib/ethdev/rte_flow.h                  | 25 ++++++++++++++++++++++++-
 4 files changed, 34 insertions(+), 8 deletions(-)

diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst
index 2b42d5ec8c..89404b38af 100644
--- a/doc/guides/prog_guide/rte_flow.rst
+++ b/doc/guides/prog_guide/rte_flow.rst
@@ -1919,7 +1919,10 @@ See `Item: PHY_PORT`_.
 
 Action: ``PORT_ID``
 ^^^^^^^^^^^^^^^^^^^
-Directs matching traffic to a given DPDK port ID.
+
+Directs matching traffic to the specified DPDK port (ingress) or to
+the would-be destination as if the application itself sent this traffic
+from the said DPDK port (egress).
 
 See `Item: PORT_ID`_.
 
@@ -1934,6 +1937,8 @@ See `Item: PORT_ID`_.
    +--------------+---------------------------------------+
    | ``id``       | DPDK port ID                          |
    +--------------+---------------------------------------+
+   | ``dir``      | egress or ingress                     |
+   +--------------+---------------------------------------+
 
 Action: ``METER``
 ^^^^^^^^^^^^^^^^^
diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index 76a4abfd6b..4ec6927c86 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -128,12 +128,6 @@ Deprecation Notices
   is deprecated and will be removed in DPDK 21.11. Shared counters should
   be managed using shared actions API (``rte_flow_shared_action_create`` etc).
 
-* ethdev: Definition of the flow API action ``RTE_FLOW_ACTION_TYPE_PORT_ID``
-  is ambiguous and needs clarification.
-  Structure ``rte_flow_action_port_id`` will be extended to specify
-  traffic direction to the represented entity or ethdev port itself
-  in DPDK 21.11.
-
 * ethdev: Flow API documentation is unclear if ethdev port used to create
   a flow rule adds any implicit match criteria in the case of transfer rules.
   The semantics will be clarified in DPDK 21.11 and it will require fixes in
diff --git a/doc/guides/rel_notes/release_21_11.rst b/doc/guides/rel_notes/release_21_11.rst
index d707a554ef..b7aa175a32 100644
--- a/doc/guides/rel_notes/release_21_11.rst
+++ b/doc/guides/rel_notes/release_21_11.rst
@@ -84,6 +84,10 @@ API Changes
    Also, make sure to start the actual text at the margin.
    =======================================================
 
+* ethdev: ``struct rte_flow_action_port_id`` is extended with the direction
+  field with unspecified default, so all ``PORT_ID`` flow API action users
+  must be updated to make correct choice.
+
 
 ABI Changes
 -----------
diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h
index 70f455d47d..3b83ed7d3a 100644
--- a/lib/ethdev/rte_flow.h
+++ b/lib/ethdev/rte_flow.h
@@ -2632,10 +2632,32 @@ struct rte_flow_action_phy_port {
 	uint32_t index; /**< Physical port index. */
 };
 
+/** Traffic direction from application point of view. */
+enum rte_flow_direction {
+	/**
+	 * Invalid value which should not be used and must be
+	 * rejected by drivers.
+	 */
+	RTE_FLOW_DIRECTION_UNSPECIFIED = 0,
+	/** As if the traffic was sent by the application. */
+	RTE_FLOW_EGRESS,
+	/** To be received by the application. */
+	RTE_FLOW_INGRESS,
+};
+
 /**
  * RTE_FLOW_ACTION_TYPE_PORT_ID
  *
- * Directs matching traffic to a given DPDK port ID.
+ * Directs matching traffic to an ethdev with the given DPDK port ID or
+ * to the upstream port (the peer side of the wire) corresponding to it.
+ *
+ * It's assumed that it's the PMD (typically, its instance at the admin
+ * PF) which controls the binding between a (representor) ethdev and an
+ * upstream port. Typical bindings: VF rep. <=> VF, PF <=> network port.
+ * If the PMD instance is unaware of the binding between the ethdev and
+ * its upstream port (or can't control it), it should reject the action
+ * with the egress direction specified and log an appropriate error
+ * message.
  *
  * @see RTE_FLOW_ITEM_TYPE_PORT_ID
  */
@@ -2643,6 +2665,7 @@ struct rte_flow_action_port_id {
 	uint32_t original:1; /**< Use original DPDK port ID if possible. */
 	uint32_t reserved:31; /**< Reserved, must be zero. */
 	uint32_t id; /**< DPDK port ID. */
+	enum rte_flow_direction dir; /**< Direction to route traffic to. */
 };
 
 /**
-- 
2.30.2


^ permalink raw reply	[relevance 3%]

* Re: [dpdk-dev] [PATCH v10 2/3] devtools: script to send notifications of expired symbols
  2021-09-01 12:46  0%     ` Aaron Conole
@ 2021-09-03 11:15  0%       ` Kinsella, Ray
  2021-09-03 13:32  0%       ` Kinsella, Ray
  1 sibling, 0 replies; 200+ results
From: Kinsella, Ray @ 2021-09-03 11:15 UTC (permalink / raw)
  To: Aaron Conole
  Cc: dev, bruce.richardson, stephen, ferruh.yigit, thomas, ktraynor



On 01/09/2021 13:46, Aaron Conole wrote:
> Ray Kinsella <mdr@ashroe.eu> writes:
> 
>> Use this script with the output of the DPDK symbol tool, to notify
>> maintainers of expired symbols by email. You need to define the environment
>> variable DPDK_GETMAINTAINER_PATH for this tool to work.
>>
>> Use terminal output to review the emails before sending.
>> e.g.
>> $ devtools/symbol-tool.py list-expired --format-output csv \
>> | DPDK_GETMAINTAINER_PATH=<somewhere>/get_maintainer.pl \
>> devtools/notify_expired_symbols.py --format-output terminal
>>
>> Then use email output to send the emails to the maintainers.
>> e.g.
>> $ devtools/symbol-tool.py list-expired --format-output csv \
>> | DPDK_GETMAINTAINER_PATH=<somewhere>/get_maintainer.pl \
>> devtools/notify_expired_symbols.py --format-output email \
>> --smtp-server <server> --sender <someone@somewhere.com> \
>> --password <password> --cc <someone@somewhere.com>
>>
>> Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
>> ---
>>  devtools/notify-symbol-maintainers.py | 256 ++++++++++++++++++++++++++
>>  1 file changed, 256 insertions(+)
>>  create mode 100755 devtools/notify-symbol-maintainers.py
>>
>> diff --git a/devtools/notify-symbol-maintainers.py b/devtools/notify-symbol-maintainers.py
>> new file mode 100755
>> index 0000000000..ee554687ff
>> --- /dev/null
>> +++ b/devtools/notify-symbol-maintainers.py
>> @@ -0,0 +1,256 @@
>> +#!/usr/bin/env python3
>> +# SPDX-License-Identifier: BSD-3-Clause
>> +# Copyright(c) 2021 Intel Corporation
>> +# pylint: disable=invalid-name
>> +'''Tool to notify maintainers of expired symbols'''
>> +import smtplib
>> +import ssl
>> +import sys
>> +import subprocess
>> +import argparse
>> +from argparse import RawTextHelpFormatter
>> +import time
>> +from email.message import EmailMessage
>> +
>> +DESCRIPTION = '''
>> +Use this script with the output of the DPDK symbol tool, to notify maintainers
>> +and contributors of expired symbols by email. You need to define the environment
>> +variable DPDK_GETMAINTAINER_PATH for this tool to work.
>> +
>> +Use terminal output to review the emails before sending.
>> +e.g.
>> +$ devtools/symbol-tool.py list-expired --format-output csv \\
>> +| DPDK_GETMAINTAINER_PATH=<somewhere>/get_maintainer.pl \\
>> +{s} --format-output terminal
>> +
>> +Then use email output to send the emails to the maintainers.
>> +e.g.
>> +$ devtools/symbol-tool.py list-expired --format-output csv \\
>> +| DPDK_GETMAINTAINER_PATH=<somewhere>/get_maintainer.pl \\
>> +{s} --format-output email \\
>> +--smtp-server <server> --sender <someone@somewhere.com> --password <password> \\
>> +--cc <someone@somewhere.com>
>> +'''
>> +
>> +EMAIL_TEMPLATE = '''Hi there,
>> +
>> +Please note the symbols listed below have expired. In line with the DPDK ABI
>> +policy, they should be scheduled for removal, in the next DPDK release.
>> +
>> +For more information, please see the DPDK ABI Policy, section 3.5.3.
>> +https://doc.dpdk.org/guides/contributing/abi_policy.html
>> +
>> +Thanks,
>> +
>> +The DPDK Symbol Bot
>> +
>> +'''
>> +
>> +ABI_POLICY = 'doc/guides/contributing/abi_policy.rst'
>> +MAINTAINERS = 'MAINTAINERS'
>> +get_maintainer = ['devtools/get-maintainer.sh', \
>> +                  '--email', '-f']
> 
> Maybe it's best to make this something that can be overridden.  There's
> a series to change the .sh files to .py files.  Perhaps an environment
> variable or argument?

ACK

> 
>> +def _get_maintainers(libpath):
>> +    '''Get the maintainers for given library'''
>> +    try:
>> +        cmd = get_maintainer + [libpath]
>> +        result = subprocess.run(cmd, \
>> +                                stdout=subprocess.PIPE, \
>> +                                stderr=subprocess.PIPE,
>> +                                check=True)
>> +    except subprocess.CalledProcessError:
>> +        return None
> 
> You might consider handling
> 
>    except FileNotFoundError:
>       ....
> 
> With a graceful exit and error message.  In case the get_maintainers
> path changes.

ACK

> 
>> +    if result is None:
>> +        return None
>> +
>> +    email = result.stdout.decode('utf-8')
>> +    if email == '':
>> +        return None
>> +
>> +    email = list(filter(None,email.split('\n')))
>> +    return email
>> +
>> +default_maintainers = _get_maintainers(ABI_POLICY) + \
>> +    _get_maintainers(MAINTAINERS)
>> +
>> +def get_maintainers(libpath):
>> +    '''Get the maintainers for given library'''
>> +    maintainers=_get_maintainers(libpath)
>> +
>> +    if maintainers is None:
>> +        maintainers = default_maintainers
>> +
>> +    return maintainers
>> +
>> +def get_message(library, symbols, config):
>> +    '''Build email message from symbols, config and maintainers'''
>> +    contributors = {}
>> +    message = {}
>> +    maintainers = get_maintainers(library)
>> +
>> +    if maintainers != default_maintainers:
>> +        message['CC'] = default_maintainers.copy()
>> +
>> +    if 'CC' in config:
>> +        message.setdefault('CC',[]).append(config['CC'])
>> +
>> +    message['Subject'] = 'Expired symbols in {}\n'.format(library)
>> +
>> +    body = EMAIL_TEMPLATE
>> +    body += '{:<50}{:<25}{:<25}\n'.format('Symbol','Contributor','Email')
>> +    for sym in symbols:
>> +        body += ('{:<50}{:<25}{:<25}\n'.format(sym,\
>> +                                               symbols[sym]['name'],
>> +                                               symbols[sym]['email'],
>> +        ))
>> +        email = symbols[sym]['email']
>> +        contributors[email] = ''
>> +
>> +    contributors = list(contributors.keys())
>> +
>> +    message['To'] = maintainers + contributors
>> +    message['Body'] = body
>> +
>> +    return message
>> +
>> +class OutputEmail():
>> +    '''Format the output for email'''
>> +    def __init__(self, config):
>> +        self.config = config
>> +
>> +        self.terminal = OutputTerminal(config)
>> +        context = ssl.create_default_context()
>> +
>> +        # Try to log in to server and send email
>> +        try:
>> +            self.server = smtplib.SMTP(config['smtp_server'], 587)
>> +            self.server.starttls(context=context) # Secure the connection
>> +            self.server.login(config['sender'], config['password'])
>> +        except Exception as exception:
>> +            print(exception)
>> +            raise exception
>> +
>> +    def message(self,message):
>> +        '''send email'''
>> +        self.terminal.message(message)
>> +
>> +        msg = EmailMessage()
>> +        msg.set_content(message.pop('Body'))
>> +
>> +        for key in message.keys():
>> +            msg[key] = message[key]
>> +
>> +        msg['From'] = self.config['sender']
>> +        msg['Reply-To'] = 'no-reply@dpdk.org'
>> +
>> +        self.server.send_message(msg)
>> +
>> +        time.sleep(1)
> 
> Why this sleep is needed?

Don't hammer the mail server :-)

> 
>> +
>> +    def __del__(self):
>> +        self.server.quit()
>> +
>> +class OutputTerminal(): # pylint: disable=too-few-public-methods
>> +    '''Format the output for the terminal'''
>> +    def __init__(self, config):
>> +        self.config = config
>> +
>> +    def message(self,message):
>> +        '''Print email to terminal'''
>> +
>> +        terminal = 'To:' + ', '.join(message['To']) + '\n'
>> +        if 'sender' in self.config.keys():
>> +            terminal += 'From:' + self.config['sender'] + '\n'
>> +
>> +        terminal += 'Reply-To:' + 'no-reply@dpdk.org' + '\n'
>> +
>> +        if 'CC' in message:
>> +            terminal += 'CC:' + ', '.join(message['CC']) + '\n'
>> +
>> +        terminal += 'Subject:' + message['Subject'] + '\n'
>> +        terminal += 'Body:' + message['Body'] + '\n'
>> +
>> +        print(terminal)
>> +        print('-' * 80)
>> +
>> +def parse_config(args):
>> +    '''put the command line args in the right places'''
>> +    config = {}
>> +    error_msg = None
>> +
>> +    outputs = {
>> +        None : OutputTerminal,
>> +        'terminal' : OutputTerminal,
>> +        'email' : OutputEmail
>> +    }
>> +
>> +    if args.format_output == 'email':
>> +        if args.smtp_server is None:
>> +            error_msg = 'SMTP server'
>> +        else:
>> +            config['smtp_server'] = args.smtp_server
>> +
>> +        if args.sender is None:
>> +            error_msg = 'sender'
>> +        else:
>> +            config['sender'] = args.sender
>> +
>> +        if args.password is None:
>> +            error_msg = 'password'
>> +        else:
>> +            config['password'] = args.password
>> +
>> +    if args.cc is not None:
>> +        config['CC'] = args.cc
>> +
>> +    if error_msg is not None:
>> +        print('Please specify a {} for email output'.format(error_msg))
>> +        return None
>> +
>> +    config['output'] = outputs[args.format_output]
>> +    return config
>> +
>> +def main():
>> +    '''Main entry point'''
>> +    parser = argparse.ArgumentParser(description=DESCRIPTION.format(s=__file__), \
>> +                                     formatter_class=RawTextHelpFormatter)
>> +    parser.add_argument('--format-output', choices=['terminal','email'], \
>> +                        default='terminal')
>> +    parser.add_argument('--smtp-server')
>> +    parser.add_argument('--password')
>> +    parser.add_argument('--sender')
>> +    parser.add_argument('--cc')
>> +
>> +    args = parser.parse_args()
>> +    config = parse_config(args)
>> +    if config is None:
>> +        return
>> +
>> +    symbols = {}
>> +    lastlib = library = ''
>> +
>> +    output = config['output'](config)
>> +
>> +    for line in sys.stdin:
>> +        line = line.rstrip('\n')
>> +
>> +        if line.find('mapfile') >= 0:
>> +            continue
>> +        library, symbol, name, email = line.split(',')
>> +
>> +        if library != lastlib:
>> +            message = get_message(lastlib, symbols, config)
>> +            output.message(message)
>> +            symbols = {}
>> +
>> +        lastlib = library
>> +        symbols[symbol] = {'name' : name, 'email' : email}
>> +
>> +    #print the last library
>> +    message = get_message(lastlib, symbols, config)
>> +    output.message(message)
>> +
>> +if __name__ == '__main__':
>> +    main()
> 

^ permalink raw reply	[relevance 0%]

* [dpdk-dev] [PATCH v1 0/7] make rte_intr_handle internal
  @ 2021-09-03 12:40  4% ` Harman Kalra
  2021-09-03 12:40  1%   ` [dpdk-dev] [PATCH v1 3/7] eal/interrupts: avoid direct access to interrupt handle Harman Kalra
  2021-09-15 14:13  0%   ` [dpdk-dev] [PATCH v1 0/7] make rte_intr_handle internal Harman Kalra
  0 siblings, 2 replies; 200+ results
From: Harman Kalra @ 2021-09-03 12:40 UTC (permalink / raw)
  To: dev; +Cc: Harman Kalra

Moving struct rte_intr_handle as an internal structure to
avoid any ABI breakages in future. Since this structure defines
some static arrays and changing respective macros breaks the ABI.
Eg:
Currently RTE_MAX_RXTX_INTR_VEC_ID imposes a limit of maximum 512
MSI-X interrupts that can be defined for a PCI device, while PCI
specification allows maximum 2048 MSI-X interrupts that can be used.
If some PCI device requires more than 512 vectors, either change the
RTE_MAX_RXTX_INTR_VEC_ID limit or dynamically allocate based on
PCI device MSI-X size on probe time. Either way its an ABI breakage.

Change already included in 21.11 ABI improvement spreadsheet (item 42):
https://urldefense.proofpoint.com/v2/url?u=https-3A__docs.google.com_s
preadsheets_d_1betlC000ua5SsSiJIcC54mCCCJnW6voH5Dqv9UxeyfE_edit-23gid-
3D0&d=DwICaQ&c=nKjWec2b6R0mOyPaz7xtfQ&r=5ESHPj7V-7JdkxT_Z_SU6RrS37ys4U
XudBQ_rrS5LRo&m=7dl3OmXU7QHMmWYB6V1hYJtq1cUkjfhXUwze2Si_48c&s=lh6DEGhR
Bg1shODpAy3RQk-H-0uQx5icRfUBf9dtCp4&e=


This series makes struct rte_intr_handle totally opaque to the outside
world by wrapping it inside a .c file and providing get set wrapper APIs
to read or manipulate its fields.. Any changes to be made to any of the
fields should be done via these get set APIs.
Introduced a new eal_common_interrupts.c where all these APIs are defined
and also hides struct rte_intr_handle definition.

Details on each patch of the series:
Patch 1: eal: interrupt handle API prototypes
This patch provides prototypes of all the new get set APIs, and
also rearranges the headers related to interrupt framework. Epoll
related definitions prototypes are moved into a new header i.e.
rte_epoll.h and APIs defined in rte_eal_interrupts.h which were
driver specific are moved to rte_interrupts.h (as anyways it was
accessible and used outside DPDK library. Later in the series
rte_eal_interrupts.h is removed.

Patch 2: eal/interrupts: implement get set APIs
Implementing all get, set and alloc APIs. Alloc APIs are implemented
to allocate memory for interrupt handle instance. Currently most of
the drivers defines interrupt handle instance as static but now it cant
be static as size of rte_intr_handle is unknown to all the drivers.
Drivers are expected to allocate interrupt instances during initialization
and free these instances during cleanup phase.

Patch 3: eal/interrupts: avoid direct access to interrupt handle
Modifying the interrupt framework for linux and freebsd to use these
get set alloc APIs as per requirement and avoid accessing the fields
directly.

Patch 4: test/interrupt: apply get set interrupt handle APIs
Updating interrupt test suite to use interrupt handle APIs.

Patch 5: drivers: remove direct access to interrupt handle fields
Modifying all the drivers and libraries which are currently directly
accessing the interrupt handle fields. Drivers are expected to
allocated the interrupt instance, use get set APIs with the allocated
interrupt handle and free it on cleanup.

Patch 6: eal/interrupts: make interrupt handle structure opaque
In this patch rte_eal_interrupt.h is removed, struct rte_intr_handle
definition is moved to c file to make it completely opaque. As part of
interrupt handle allocation, array like efds and elist(which are currently
static) are dynamically allocated with default size
(RTE_MAX_RXTX_INTR_VEC_ID). Later these arrays can be reallocated as per
device requirement using new API rte_intr_handle_event_list_update().
Eg, on PCI device probing MSIX size can be queried and these arrays can
be reallocated accordingly.

Patch 7: eal/alarm: introduce alarm fini routine
Introducing alarm fini routine, as the memory allocated for alarm interrupt
instance can be freed in alarm fini.

Testing performed:
1. Validated the series by running interrupts and alarm test suite.
2. Validate l3fwd power functionality with octeontx2 and i40e intel cards,
   where interrupts are expected on packet arrival.

v1:
* Fixed freebsd compilation failure
* Fixed seg fault in case of memif

Harman Kalra (7):
  eal: interrupt handle API prototypes
  eal/interrupts: implement get set APIs
  eal/interrupts: avoid direct access to interrupt handle
  test/interrupt: apply get set interrupt handle APIs
  drivers: remove direct access to interrupt handle fields
  eal/interrupts: make interrupt handle structure opaque
  eal/alarm: introduce alarm fini routine

 MAINTAINERS                                   |   1 +
 app/test/test_interrupts.c                    | 237 +++---
 drivers/baseband/acc100/rte_acc100_pmd.c      |  18 +-
 .../fpga_5gnr_fec/rte_fpga_5gnr_fec.c         |  13 +-
 drivers/baseband/fpga_lte_fec/fpga_lte_fec.c  |  14 +-
 drivers/bus/auxiliary/auxiliary_common.c      |   2 +
 drivers/bus/auxiliary/linux/auxiliary.c       |  11 +
 drivers/bus/auxiliary/rte_bus_auxiliary.h     |   2 +-
 drivers/bus/dpaa/dpaa_bus.c                   |  28 +-
 drivers/bus/dpaa/rte_dpaa_bus.h               |   2 +-
 drivers/bus/fslmc/fslmc_bus.c                 |  17 +-
 drivers/bus/fslmc/fslmc_vfio.c                |  32 +-
 drivers/bus/fslmc/portal/dpaa2_hw_dpio.c      |  21 +-
 drivers/bus/fslmc/portal/dpaa2_hw_pvt.h       |   2 +-
 drivers/bus/fslmc/rte_fslmc.h                 |   2 +-
 drivers/bus/ifpga/ifpga_bus.c                 |  16 +-
 drivers/bus/ifpga/rte_bus_ifpga.h             |   2 +-
 drivers/bus/pci/bsd/pci.c                     |  21 +-
 drivers/bus/pci/linux/pci.c                   |   4 +-
 drivers/bus/pci/linux/pci_uio.c               |  73 +-
 drivers/bus/pci/linux/pci_vfio.c              | 115 ++-
 drivers/bus/pci/pci_common.c                  |  29 +-
 drivers/bus/pci/pci_common_uio.c              |  21 +-
 drivers/bus/pci/rte_bus_pci.h                 |   4 +-
 drivers/bus/vmbus/linux/vmbus_bus.c           |   7 +
 drivers/bus/vmbus/linux/vmbus_uio.c           |  37 +-
 drivers/bus/vmbus/rte_bus_vmbus.h             |   2 +-
 drivers/bus/vmbus/vmbus_common_uio.c          |  24 +-
 drivers/common/cnxk/roc_cpt.c                 |   8 +-
 drivers/common/cnxk/roc_dev.c                 |  14 +-
 drivers/common/cnxk/roc_irq.c                 | 106 +--
 drivers/common/cnxk/roc_nix_irq.c             |  37 +-
 drivers/common/cnxk/roc_npa.c                 |   2 +-
 drivers/common/cnxk/roc_platform.h            |  34 +
 drivers/common/cnxk/roc_sso.c                 |   4 +-
 drivers/common/cnxk/roc_tim.c                 |   4 +-
 drivers/common/octeontx2/otx2_dev.c           |  14 +-
 drivers/common/octeontx2/otx2_irq.c           | 117 +--
 .../octeontx2/otx2_cryptodev_hw_access.c      |   4 +-
 drivers/event/octeontx2/otx2_evdev_irq.c      |  12 +-
 drivers/mempool/octeontx2/otx2_mempool.c      |   2 +-
 drivers/net/atlantic/atl_ethdev.c             |  22 +-
 drivers/net/avp/avp_ethdev.c                  |   8 +-
 drivers/net/axgbe/axgbe_ethdev.c              |  12 +-
 drivers/net/axgbe/axgbe_mdio.c                |   6 +-
 drivers/net/bnx2x/bnx2x_ethdev.c              |  10 +-
 drivers/net/bnxt/bnxt_ethdev.c                |  32 +-
 drivers/net/bnxt/bnxt_irq.c                   |   4 +-
 drivers/net/dpaa/dpaa_ethdev.c                |  47 +-
 drivers/net/dpaa2/dpaa2_ethdev.c              |  10 +-
 drivers/net/e1000/em_ethdev.c                 |  24 +-
 drivers/net/e1000/igb_ethdev.c                |  84 ++-
 drivers/net/ena/ena_ethdev.c                  |  36 +-
 drivers/net/enic/enic_main.c                  |  27 +-
 drivers/net/failsafe/failsafe.c               |  24 +-
 drivers/net/failsafe/failsafe_intr.c          |  45 +-
 drivers/net/failsafe/failsafe_ops.c           |  23 +-
 drivers/net/failsafe/failsafe_private.h       |   2 +-
 drivers/net/fm10k/fm10k_ethdev.c              |  32 +-
 drivers/net/hinic/hinic_pmd_ethdev.c          |  10 +-
 drivers/net/hns3/hns3_ethdev.c                |  50 +-
 drivers/net/hns3/hns3_ethdev_vf.c             |  57 +-
 drivers/net/hns3/hns3_rxtx.c                  |   2 +-
 drivers/net/i40e/i40e_ethdev.c                |  55 +-
 drivers/net/i40e/i40e_ethdev_vf.c             |  43 +-
 drivers/net/iavf/iavf_ethdev.c                |  41 +-
 drivers/net/iavf/iavf_vchnl.c                 |   4 +-
 drivers/net/ice/ice_dcf.c                     |  10 +-
 drivers/net/ice/ice_dcf_ethdev.c              |  23 +-
 drivers/net/ice/ice_ethdev.c                  |  51 +-
 drivers/net/igc/igc_ethdev.c                  |  47 +-
 drivers/net/ionic/ionic_ethdev.c              |  12 +-
 drivers/net/ixgbe/ixgbe_ethdev.c              |  70 +-
 drivers/net/memif/memif_socket.c              | 114 ++-
 drivers/net/memif/memif_socket.h              |   4 +-
 drivers/net/memif/rte_eth_memif.c             |  63 +-
 drivers/net/memif/rte_eth_memif.h             |   2 +-
 drivers/net/mlx4/mlx4.c                       |  20 +-
 drivers/net/mlx4/mlx4.h                       |   2 +-
 drivers/net/mlx4/mlx4_intr.c                  |  48 +-
 drivers/net/mlx5/linux/mlx5_os.c              |  56 +-
 drivers/net/mlx5/linux/mlx5_socket.c          |  26 +-
 drivers/net/mlx5/mlx5.h                       |   6 +-
 drivers/net/mlx5/mlx5_rxq.c                   |  43 +-
 drivers/net/mlx5/mlx5_trigger.c               |   4 +-
 drivers/net/mlx5/mlx5_txpp.c                  |  27 +-
 drivers/net/netvsc/hn_ethdev.c                |   4 +-
 drivers/net/nfp/nfp_common.c                  |  28 +-
 drivers/net/nfp/nfp_ethdev.c                  |  13 +-
 drivers/net/nfp/nfp_ethdev_vf.c               |  13 +-
 drivers/net/ngbe/ngbe_ethdev.c                |  31 +-
 drivers/net/octeontx2/otx2_ethdev_irq.c       |  35 +-
 drivers/net/qede/qede_ethdev.c                |  16 +-
 drivers/net/sfc/sfc_intr.c                    |  29 +-
 drivers/net/tap/rte_eth_tap.c                 |  37 +-
 drivers/net/tap/rte_eth_tap.h                 |   2 +-
 drivers/net/tap/tap_intr.c                    |  33 +-
 drivers/net/thunderx/nicvf_ethdev.c           |  13 +
 drivers/net/thunderx/nicvf_struct.h           |   2 +-
 drivers/net/txgbe/txgbe_ethdev.c              |  36 +-
 drivers/net/txgbe/txgbe_ethdev_vf.c           |  35 +-
 drivers/net/vhost/rte_eth_vhost.c             |  78 +-
 drivers/net/virtio/virtio_ethdev.c            |  17 +-
 .../net/virtio/virtio_user/virtio_user_dev.c  |  53 +-
 drivers/net/vmxnet3/vmxnet3_ethdev.c          |  45 +-
 drivers/raw/ifpga/ifpga_rawdev.c              |  42 +-
 drivers/raw/ntb/ntb.c                         |  10 +-
 .../regex/octeontx2/otx2_regexdev_hw_access.c |   4 +-
 drivers/vdpa/ifc/ifcvf_vdpa.c                 |   5 +-
 drivers/vdpa/mlx5/mlx5_vdpa.c                 |  11 +
 drivers/vdpa/mlx5/mlx5_vdpa.h                 |   4 +-
 drivers/vdpa/mlx5/mlx5_vdpa_event.c           |  22 +-
 drivers/vdpa/mlx5/mlx5_vdpa_virtq.c           |  46 +-
 lib/bbdev/rte_bbdev.c                         |   4 +-
 lib/eal/common/eal_common_interrupts.c        | 668 +++++++++++++++++
 lib/eal/common/eal_private.h                  |  11 +
 lib/eal/common/meson.build                    |   2 +
 lib/eal/freebsd/eal.c                         |   1 +
 lib/eal/freebsd/eal_alarm.c                   |  56 +-
 lib/eal/freebsd/eal_interrupts.c              |  94 ++-
 lib/eal/include/meson.build                   |   2 +-
 lib/eal/include/rte_eal_interrupts.h          | 269 -------
 lib/eal/include/rte_eal_trace.h               |  24 +-
 lib/eal/include/rte_epoll.h                   | 116 +++
 lib/eal/include/rte_interrupts.h              | 673 +++++++++++++++++-
 lib/eal/linux/eal.c                           |   1 +
 lib/eal/linux/eal_alarm.c                     |  39 +-
 lib/eal/linux/eal_dev.c                       |  65 +-
 lib/eal/linux/eal_interrupts.c                | 294 +++++---
 lib/eal/version.map                           |  30 +
 lib/ethdev/ethdev_pci.h                       |   2 +-
 lib/ethdev/rte_ethdev.c                       |  14 +-
 132 files changed, 3797 insertions(+), 1685 deletions(-)
 create mode 100644 lib/eal/common/eal_common_interrupts.c
 delete mode 100644 lib/eal/include/rte_eal_interrupts.h
 create mode 100644 lib/eal/include/rte_epoll.h

-- 
2.18.0


^ permalink raw reply	[relevance 4%]

* [dpdk-dev] [PATCH v1 3/7] eal/interrupts: avoid direct access to interrupt handle
  2021-09-03 12:40  4% ` [dpdk-dev] [PATCH v1 " Harman Kalra
@ 2021-09-03 12:40  1%   ` Harman Kalra
  2021-09-15 14:13  0%   ` [dpdk-dev] [PATCH v1 0/7] make rte_intr_handle internal Harman Kalra
  1 sibling, 0 replies; 200+ results
From: Harman Kalra @ 2021-09-03 12:40 UTC (permalink / raw)
  To: dev, Harman Kalra, Bruce Richardson

Making changes to the interrupt framework to use interrupt handle
APIs to get/set any field. Direct access to any of the fields
should be avoided to avoid any ABI breakage in future.

Signed-off-by: Harman Kalra <hkalra@marvell.com>
---
 lib/eal/freebsd/eal_interrupts.c |  94 ++++++----
 lib/eal/linux/eal_interrupts.c   | 294 +++++++++++++++++++------------
 2 files changed, 242 insertions(+), 146 deletions(-)

diff --git a/lib/eal/freebsd/eal_interrupts.c b/lib/eal/freebsd/eal_interrupts.c
index 86810845fe..171006f19f 100644
--- a/lib/eal/freebsd/eal_interrupts.c
+++ b/lib/eal/freebsd/eal_interrupts.c
@@ -40,7 +40,7 @@ struct rte_intr_callback {
 
 struct rte_intr_source {
 	TAILQ_ENTRY(rte_intr_source) next;
-	struct rte_intr_handle intr_handle; /**< interrupt handle */
+	struct rte_intr_handle *intr_handle; /**< interrupt handle */
 	struct rte_intr_cb_list callbacks;  /**< user callbacks */
 	uint32_t active;
 };
@@ -60,7 +60,7 @@ static int
 intr_source_to_kevent(const struct rte_intr_handle *ih, struct kevent *ke)
 {
 	/* alarm callbacks are special case */
-	if (ih->type == RTE_INTR_HANDLE_ALARM) {
+	if (rte_intr_handle_type_get(ih) == RTE_INTR_HANDLE_ALARM) {
 		uint64_t timeout_ns;
 
 		/* get soonest alarm timeout */
@@ -75,7 +75,7 @@ intr_source_to_kevent(const struct rte_intr_handle *ih, struct kevent *ke)
 	} else {
 		ke->filter = EVFILT_READ;
 	}
-	ke->ident = ih->fd;
+	ke->ident = rte_intr_handle_fd_get(ih);
 
 	return 0;
 }
@@ -89,7 +89,8 @@ rte_intr_callback_register(const struct rte_intr_handle *intr_handle,
 	int ret = 0, add_event = 0;
 
 	/* first do parameter checking */
-	if (intr_handle == NULL || intr_handle->fd < 0 || cb == NULL) {
+	if (intr_handle == NULL || rte_intr_handle_fd_get(intr_handle) < 0 ||
+	    cb == NULL) {
 		RTE_LOG(ERR, EAL,
 			"Registering with invalid input parameter\n");
 		return -EINVAL;
@@ -103,7 +104,8 @@ rte_intr_callback_register(const struct rte_intr_handle *intr_handle,
 
 	/* find the source for this intr_handle */
 	TAILQ_FOREACH(src, &intr_sources, next) {
-		if (src->intr_handle.fd == intr_handle->fd)
+		if (rte_intr_handle_fd_get(src->intr_handle) ==
+		    rte_intr_handle_fd_get(intr_handle))
 			break;
 	}
 
@@ -112,8 +114,8 @@ rte_intr_callback_register(const struct rte_intr_handle *intr_handle,
 	 * thing on the list should be eal_alarm_callback() and we may
 	 * be called just to reset the timer.
 	 */
-	if (src != NULL && src->intr_handle.type == RTE_INTR_HANDLE_ALARM &&
-		 !TAILQ_EMPTY(&src->callbacks)) {
+	if (src != NULL && rte_intr_handle_type_get(src->intr_handle) ==
+		RTE_INTR_HANDLE_ALARM && !TAILQ_EMPTY(&src->callbacks)) {
 		callback = NULL;
 	} else {
 		/* allocate a new interrupt callback entity */
@@ -135,9 +137,20 @@ rte_intr_callback_register(const struct rte_intr_handle *intr_handle,
 				ret = -ENOMEM;
 				goto fail;
 			} else {
-				src->intr_handle = *intr_handle;
-				TAILQ_INIT(&src->callbacks);
-				TAILQ_INSERT_TAIL(&intr_sources, src, next);
+				src->intr_handle =
+					rte_intr_handle_instance_alloc(
+					RTE_INTR_HANDLE_DEFAULT_SIZE, false);
+				if (src->intr_handle == NULL) {
+					RTE_LOG(ERR, EAL, "Can not create intr instance\n");
+					free(callback);
+					ret = -ENOMEM;
+				} else {
+					rte_intr_handle_instance_index_set(
+					      src->intr_handle, intr_handle, 0);
+					TAILQ_INIT(&src->callbacks);
+					TAILQ_INSERT_TAIL(&intr_sources, src,
+							  next);
+				}
 			}
 		}
 
@@ -151,7 +164,8 @@ rte_intr_callback_register(const struct rte_intr_handle *intr_handle,
 	/* add events to the queue. timer events are special as we need to
 	 * re-set the timer.
 	 */
-	if (add_event || src->intr_handle.type == RTE_INTR_HANDLE_ALARM) {
+	if (add_event || rte_intr_handle_type_get(src->intr_handle) ==
+							RTE_INTR_HANDLE_ALARM) {
 		struct kevent ke;
 
 		memset(&ke, 0, sizeof(ke));
@@ -173,12 +187,13 @@ rte_intr_callback_register(const struct rte_intr_handle *intr_handle,
 			 */
 			if (errno == ENODEV)
 				RTE_LOG(DEBUG, EAL, "Interrupt handle %d not supported\n",
-					src->intr_handle.fd);
+				rte_intr_handle_fd_get(src->intr_handle));
 			else
 				RTE_LOG(ERR, EAL, "Error adding fd %d "
-						"kevent, %s\n",
-						src->intr_handle.fd,
-						strerror(errno));
+					"kevent, %s\n",
+					rte_intr_handle_fd_get(
+							src->intr_handle),
+					strerror(errno));
 			ret = -errno;
 			goto fail;
 		}
@@ -213,7 +228,7 @@ rte_intr_callback_unregister_pending(const struct rte_intr_handle *intr_handle,
 	struct rte_intr_callback *cb, *next;
 
 	/* do parameter checking first */
-	if (intr_handle == NULL || intr_handle->fd < 0) {
+	if (intr_handle == NULL || rte_intr_handle_fd_get(intr_handle) < 0) {
 		RTE_LOG(ERR, EAL,
 		"Unregistering with invalid input parameter\n");
 		return -EINVAL;
@@ -228,7 +243,8 @@ rte_intr_callback_unregister_pending(const struct rte_intr_handle *intr_handle,
 
 	/* check if the insterrupt source for the fd is existent */
 	TAILQ_FOREACH(src, &intr_sources, next)
-		if (src->intr_handle.fd == intr_handle->fd)
+		if (rte_intr_handle_fd_get(src->intr_handle) ==
+					rte_intr_handle_fd_get(intr_handle))
 			break;
 
 	/* No interrupt source registered for the fd */
@@ -268,7 +284,7 @@ rte_intr_callback_unregister(const struct rte_intr_handle *intr_handle,
 	struct rte_intr_callback *cb, *next;
 
 	/* do parameter checking first */
-	if (intr_handle == NULL || intr_handle->fd < 0) {
+	if (intr_handle == NULL || rte_intr_handle_fd_get(intr_handle) < 0) {
 		RTE_LOG(ERR, EAL,
 		"Unregistering with invalid input parameter\n");
 		return -EINVAL;
@@ -282,7 +298,8 @@ rte_intr_callback_unregister(const struct rte_intr_handle *intr_handle,
 
 	/* check if the insterrupt source for the fd is existent */
 	TAILQ_FOREACH(src, &intr_sources, next)
-		if (src->intr_handle.fd == intr_handle->fd)
+		if (rte_intr_handle_fd_get(src->intr_handle) ==
+					rte_intr_handle_fd_get(intr_handle))
 			break;
 
 	/* No interrupt source registered for the fd */
@@ -314,7 +331,8 @@ rte_intr_callback_unregister(const struct rte_intr_handle *intr_handle,
 		 */
 		if (kevent(kq, &ke, 1, NULL, 0, NULL) < 0) {
 			RTE_LOG(ERR, EAL, "Error removing fd %d kevent, %s\n",
-				src->intr_handle.fd, strerror(errno));
+				rte_intr_handle_fd_get(src->intr_handle),
+				strerror(errno));
 			/* removing non-existent even is an expected condition
 			 * in some circumstances (e.g. oneshot events).
 			 */
@@ -365,17 +383,18 @@ rte_intr_enable(const struct rte_intr_handle *intr_handle)
 	if (intr_handle == NULL)
 		return -1;
 
-	if (intr_handle->type == RTE_INTR_HANDLE_VDEV) {
+	if (rte_intr_handle_type_get(intr_handle) == RTE_INTR_HANDLE_VDEV) {
 		rc = 0;
 		goto out;
 	}
 
-	if (intr_handle->fd < 0 || intr_handle->uio_cfg_fd < 0) {
+	if (rte_intr_handle_fd_get(intr_handle) < 0 ||
+				rte_intr_handle_dev_fd_get(intr_handle) < 0) {
 		rc = -1;
 		goto out;
 	}
 
-	switch (intr_handle->type) {
+	switch (rte_intr_handle_type_get(intr_handle)) {
 	/* not used at this moment */
 	case RTE_INTR_HANDLE_ALARM:
 		rc = -1;
@@ -388,7 +407,7 @@ rte_intr_enable(const struct rte_intr_handle *intr_handle)
 	default:
 		RTE_LOG(ERR, EAL,
 			"Unknown handle type of fd %d\n",
-					intr_handle->fd);
+					rte_intr_handle_fd_get(intr_handle));
 		rc = -1;
 		break;
 	}
@@ -406,17 +425,18 @@ rte_intr_disable(const struct rte_intr_handle *intr_handle)
 	if (intr_handle == NULL)
 		return -1;
 
-	if (intr_handle->type == RTE_INTR_HANDLE_VDEV) {
+	if (rte_intr_handle_type_get(intr_handle) == RTE_INTR_HANDLE_VDEV) {
 		rc = 0;
 		goto out;
 	}
 
-	if (intr_handle->fd < 0 || intr_handle->uio_cfg_fd < 0) {
+	if (rte_intr_handle_fd_get(intr_handle) < 0 ||
+				rte_intr_handle_dev_fd_get(intr_handle) < 0) {
 		rc = -1;
 		goto out;
 	}
 
-	switch (intr_handle->type) {
+	switch (rte_intr_handle_type_get(intr_handle)) {
 	/* not used at this moment */
 	case RTE_INTR_HANDLE_ALARM:
 		rc = -1;
@@ -429,7 +449,7 @@ rte_intr_disable(const struct rte_intr_handle *intr_handle)
 	default:
 		RTE_LOG(ERR, EAL,
 			"Unknown handle type of fd %d\n",
-					intr_handle->fd);
+					rte_intr_handle_fd_get(intr_handle));
 		rc = -1;
 		break;
 	}
@@ -441,7 +461,8 @@ rte_intr_disable(const struct rte_intr_handle *intr_handle)
 int
 rte_intr_ack(const struct rte_intr_handle *intr_handle)
 {
-	if (intr_handle && intr_handle->type == RTE_INTR_HANDLE_VDEV)
+	if (intr_handle &&
+	    rte_intr_handle_type_get(intr_handle) == RTE_INTR_HANDLE_VDEV)
 		return 0;
 
 	return -1;
@@ -463,7 +484,8 @@ eal_intr_process_interrupts(struct kevent *events, int nfds)
 
 		rte_spinlock_lock(&intr_lock);
 		TAILQ_FOREACH(src, &intr_sources, next)
-			if (src->intr_handle.fd == event_fd)
+			if (rte_intr_handle_fd_get(src->intr_handle) ==
+								event_fd)
 				break;
 		if (src == NULL) {
 			rte_spinlock_unlock(&intr_lock);
@@ -475,7 +497,7 @@ eal_intr_process_interrupts(struct kevent *events, int nfds)
 		rte_spinlock_unlock(&intr_lock);
 
 		/* set the length to be read dor different handle type */
-		switch (src->intr_handle.type) {
+		switch (rte_intr_handle_type_get(src->intr_handle)) {
 		case RTE_INTR_HANDLE_ALARM:
 			bytes_read = 0;
 			call = true;
@@ -546,7 +568,8 @@ eal_intr_process_interrupts(struct kevent *events, int nfds)
 				/* mark for deletion from the queue */
 				ke.flags = EV_DELETE;
 
-				if (intr_source_to_kevent(&src->intr_handle, &ke) < 0) {
+				if (intr_source_to_kevent(src->intr_handle,
+							  &ke) < 0) {
 					RTE_LOG(ERR, EAL, "Cannot convert to kevent\n");
 					rte_spinlock_unlock(&intr_lock);
 					return;
@@ -557,7 +580,9 @@ eal_intr_process_interrupts(struct kevent *events, int nfds)
 				 */
 				if (kevent(kq, &ke, 1, NULL, 0, NULL) < 0) {
 					RTE_LOG(ERR, EAL, "Error removing fd %d kevent, "
-						"%s\n", src->intr_handle.fd,
+						"%s\n",
+						rte_intr_handle_fd_get(
+							src->intr_handle),
 						strerror(errno));
 					/* removing non-existent even is an expected
 					 * condition in some circumstances
@@ -567,7 +592,8 @@ eal_intr_process_interrupts(struct kevent *events, int nfds)
 
 				TAILQ_REMOVE(&src->callbacks, cb, next);
 				if (cb->ucb_fn)
-					cb->ucb_fn(&src->intr_handle, cb->cb_arg);
+					cb->ucb_fn(src->intr_handle,
+						   cb->cb_arg);
 				free(cb);
 			}
 		}
diff --git a/lib/eal/linux/eal_interrupts.c b/lib/eal/linux/eal_interrupts.c
index 22b3b7bcd9..570eddf088 100644
--- a/lib/eal/linux/eal_interrupts.c
+++ b/lib/eal/linux/eal_interrupts.c
@@ -20,6 +20,7 @@
 #include <stdbool.h>
 
 #include <rte_common.h>
+#include <rte_epoll.h>
 #include <rte_interrupts.h>
 #include <rte_memory.h>
 #include <rte_launch.h>
@@ -82,7 +83,7 @@ struct rte_intr_callback {
 
 struct rte_intr_source {
 	TAILQ_ENTRY(rte_intr_source) next;
-	struct rte_intr_handle intr_handle; /**< interrupt handle */
+	struct rte_intr_handle *intr_handle; /**< interrupt handle */
 	struct rte_intr_cb_list callbacks;  /**< user callbacks */
 	uint32_t active;
 };
@@ -112,7 +113,7 @@ static int
 vfio_enable_intx(const struct rte_intr_handle *intr_handle) {
 	struct vfio_irq_set *irq_set;
 	char irq_set_buf[IRQ_SET_BUF_LEN];
-	int len, ret;
+	int len, ret, vfio_dev_fd;
 	int *fd_ptr;
 
 	len = sizeof(irq_set_buf);
@@ -125,13 +126,14 @@ vfio_enable_intx(const struct rte_intr_handle *intr_handle) {
 	irq_set->index = VFIO_PCI_INTX_IRQ_INDEX;
 	irq_set->start = 0;
 	fd_ptr = (int *) &irq_set->data;
-	*fd_ptr = intr_handle->fd;
+	*fd_ptr = rte_intr_handle_fd_get(intr_handle);
 
-	ret = ioctl(intr_handle->vfio_dev_fd, VFIO_DEVICE_SET_IRQS, irq_set);
+	vfio_dev_fd = rte_intr_handle_dev_fd_get(intr_handle);
+	ret = ioctl(vfio_dev_fd, VFIO_DEVICE_SET_IRQS, irq_set);
 
 	if (ret) {
 		RTE_LOG(ERR, EAL, "Error enabling INTx interrupts for fd %d\n",
-						intr_handle->fd);
+					rte_intr_handle_fd_get(intr_handle));
 		return -1;
 	}
 
@@ -144,11 +146,11 @@ vfio_enable_intx(const struct rte_intr_handle *intr_handle) {
 	irq_set->index = VFIO_PCI_INTX_IRQ_INDEX;
 	irq_set->start = 0;
 
-	ret = ioctl(intr_handle->vfio_dev_fd, VFIO_DEVICE_SET_IRQS, irq_set);
+	ret = ioctl(vfio_dev_fd, VFIO_DEVICE_SET_IRQS, irq_set);
 
 	if (ret) {
 		RTE_LOG(ERR, EAL, "Error unmasking INTx interrupts for fd %d\n",
-						intr_handle->fd);
+					rte_intr_handle_fd_get(intr_handle));
 		return -1;
 	}
 	return 0;
@@ -159,7 +161,7 @@ static int
 vfio_disable_intx(const struct rte_intr_handle *intr_handle) {
 	struct vfio_irq_set *irq_set;
 	char irq_set_buf[IRQ_SET_BUF_LEN];
-	int len, ret;
+	int len, ret, vfio_dev_fd;
 
 	len = sizeof(struct vfio_irq_set);
 
@@ -171,11 +173,12 @@ vfio_disable_intx(const struct rte_intr_handle *intr_handle) {
 	irq_set->index = VFIO_PCI_INTX_IRQ_INDEX;
 	irq_set->start = 0;
 
-	ret = ioctl(intr_handle->vfio_dev_fd, VFIO_DEVICE_SET_IRQS, irq_set);
+	vfio_dev_fd = rte_intr_handle_dev_fd_get(intr_handle);
+	ret = ioctl(vfio_dev_fd, VFIO_DEVICE_SET_IRQS, irq_set);
 
 	if (ret) {
 		RTE_LOG(ERR, EAL, "Error masking INTx interrupts for fd %d\n",
-						intr_handle->fd);
+					rte_intr_handle_fd_get(intr_handle));
 		return -1;
 	}
 
@@ -187,11 +190,12 @@ vfio_disable_intx(const struct rte_intr_handle *intr_handle) {
 	irq_set->index = VFIO_PCI_INTX_IRQ_INDEX;
 	irq_set->start = 0;
 
-	ret = ioctl(intr_handle->vfio_dev_fd, VFIO_DEVICE_SET_IRQS, irq_set);
+	ret = ioctl(vfio_dev_fd, VFIO_DEVICE_SET_IRQS, irq_set);
 
 	if (ret) {
 		RTE_LOG(ERR, EAL,
-			"Error disabling INTx interrupts for fd %d\n", intr_handle->fd);
+			"Error disabling INTx interrupts for fd %d\n",
+			rte_intr_handle_fd_get(intr_handle));
 		return -1;
 	}
 	return 0;
@@ -202,6 +206,7 @@ static int
 vfio_ack_intx(const struct rte_intr_handle *intr_handle)
 {
 	struct vfio_irq_set irq_set;
+	int vfio_dev_fd;
 
 	/* unmask INTx */
 	memset(&irq_set, 0, sizeof(irq_set));
@@ -211,9 +216,10 @@ vfio_ack_intx(const struct rte_intr_handle *intr_handle)
 	irq_set.index = VFIO_PCI_INTX_IRQ_INDEX;
 	irq_set.start = 0;
 
-	if (ioctl(intr_handle->vfio_dev_fd, VFIO_DEVICE_SET_IRQS, &irq_set)) {
+	vfio_dev_fd = rte_intr_handle_dev_fd_get(intr_handle);
+	if (ioctl(vfio_dev_fd, VFIO_DEVICE_SET_IRQS, &irq_set)) {
 		RTE_LOG(ERR, EAL, "Error unmasking INTx interrupts for fd %d\n",
-			intr_handle->fd);
+			rte_intr_handle_fd_get(intr_handle));
 		return -1;
 	}
 	return 0;
@@ -225,7 +231,7 @@ vfio_enable_msi(const struct rte_intr_handle *intr_handle) {
 	int len, ret;
 	char irq_set_buf[IRQ_SET_BUF_LEN];
 	struct vfio_irq_set *irq_set;
-	int *fd_ptr;
+	int *fd_ptr, vfio_dev_fd;
 
 	len = sizeof(irq_set_buf);
 
@@ -236,13 +242,14 @@ vfio_enable_msi(const struct rte_intr_handle *intr_handle) {
 	irq_set->index = VFIO_PCI_MSI_IRQ_INDEX;
 	irq_set->start = 0;
 	fd_ptr = (int *) &irq_set->data;
-	*fd_ptr = intr_handle->fd;
+	*fd_ptr = rte_intr_handle_fd_get(intr_handle);
 
-	ret = ioctl(intr_handle->vfio_dev_fd, VFIO_DEVICE_SET_IRQS, irq_set);
+	vfio_dev_fd = rte_intr_handle_dev_fd_get(intr_handle);
+	ret = ioctl(vfio_dev_fd, VFIO_DEVICE_SET_IRQS, irq_set);
 
 	if (ret) {
 		RTE_LOG(ERR, EAL, "Error enabling MSI interrupts for fd %d\n",
-						intr_handle->fd);
+					rte_intr_handle_fd_get(intr_handle));
 		return -1;
 	}
 	return 0;
@@ -253,7 +260,7 @@ static int
 vfio_disable_msi(const struct rte_intr_handle *intr_handle) {
 	struct vfio_irq_set *irq_set;
 	char irq_set_buf[IRQ_SET_BUF_LEN];
-	int len, ret;
+	int len, ret, vfio_dev_fd;
 
 	len = sizeof(struct vfio_irq_set);
 
@@ -264,11 +271,13 @@ vfio_disable_msi(const struct rte_intr_handle *intr_handle) {
 	irq_set->index = VFIO_PCI_MSI_IRQ_INDEX;
 	irq_set->start = 0;
 
-	ret = ioctl(intr_handle->vfio_dev_fd, VFIO_DEVICE_SET_IRQS, irq_set);
+	vfio_dev_fd = rte_intr_handle_dev_fd_get(intr_handle);
+	ret = ioctl(vfio_dev_fd, VFIO_DEVICE_SET_IRQS, irq_set);
 
 	if (ret)
 		RTE_LOG(ERR, EAL,
-			"Error disabling MSI interrupts for fd %d\n", intr_handle->fd);
+			"Error disabling MSI interrupts for fd %d\n",
+			rte_intr_handle_fd_get(intr_handle));
 
 	return ret;
 }
@@ -279,30 +288,34 @@ vfio_enable_msix(const struct rte_intr_handle *intr_handle) {
 	int len, ret;
 	char irq_set_buf[MSIX_IRQ_SET_BUF_LEN];
 	struct vfio_irq_set *irq_set;
-	int *fd_ptr;
+	int *fd_ptr, vfio_dev_fd, i;
 
 	len = sizeof(irq_set_buf);
 
 	irq_set = (struct vfio_irq_set *) irq_set_buf;
 	irq_set->argsz = len;
 	/* 0 < irq_set->count < RTE_MAX_RXTX_INTR_VEC_ID + 1 */
-	irq_set->count = intr_handle->max_intr ?
-		(intr_handle->max_intr > RTE_MAX_RXTX_INTR_VEC_ID + 1 ?
-		RTE_MAX_RXTX_INTR_VEC_ID + 1 : intr_handle->max_intr) : 1;
+	irq_set->count = rte_intr_handle_max_intr_get(intr_handle) ?
+		(rte_intr_handle_max_intr_get(intr_handle) >
+		 RTE_MAX_RXTX_INTR_VEC_ID + 1 ?	RTE_MAX_RXTX_INTR_VEC_ID + 1 :
+		 rte_intr_handle_max_intr_get(intr_handle)) : 1;
+
 	irq_set->flags = VFIO_IRQ_SET_DATA_EVENTFD | VFIO_IRQ_SET_ACTION_TRIGGER;
 	irq_set->index = VFIO_PCI_MSIX_IRQ_INDEX;
 	irq_set->start = 0;
 	fd_ptr = (int *) &irq_set->data;
 	/* INTR vector offset 0 reserve for non-efds mapping */
-	fd_ptr[RTE_INTR_VEC_ZERO_OFFSET] = intr_handle->fd;
-	memcpy(&fd_ptr[RTE_INTR_VEC_RXTX_OFFSET], intr_handle->efds,
-		sizeof(*intr_handle->efds) * intr_handle->nb_efd);
+	fd_ptr[RTE_INTR_VEC_ZERO_OFFSET] = rte_intr_handle_fd_get(intr_handle);
+	for (i = 0; i < rte_intr_handle_nb_efd_get(intr_handle); i++)
+		fd_ptr[RTE_INTR_VEC_RXTX_OFFSET + i] =
+			rte_intr_handle_efds_index_get(intr_handle, i);
 
-	ret = ioctl(intr_handle->vfio_dev_fd, VFIO_DEVICE_SET_IRQS, irq_set);
+	vfio_dev_fd = rte_intr_handle_dev_fd_get(intr_handle);
+	ret = ioctl(vfio_dev_fd, VFIO_DEVICE_SET_IRQS, irq_set);
 
 	if (ret) {
 		RTE_LOG(ERR, EAL, "Error enabling MSI-X interrupts for fd %d\n",
-						intr_handle->fd);
+					rte_intr_handle_fd_get(intr_handle));
 		return -1;
 	}
 
@@ -314,7 +327,7 @@ static int
 vfio_disable_msix(const struct rte_intr_handle *intr_handle) {
 	struct vfio_irq_set *irq_set;
 	char irq_set_buf[MSIX_IRQ_SET_BUF_LEN];
-	int len, ret;
+	int len, ret, vfio_dev_fd;
 
 	len = sizeof(struct vfio_irq_set);
 
@@ -325,11 +338,13 @@ vfio_disable_msix(const struct rte_intr_handle *intr_handle) {
 	irq_set->index = VFIO_PCI_MSIX_IRQ_INDEX;
 	irq_set->start = 0;
 
-	ret = ioctl(intr_handle->vfio_dev_fd, VFIO_DEVICE_SET_IRQS, irq_set);
+	vfio_dev_fd = rte_intr_handle_dev_fd_get(intr_handle);
+	ret = ioctl(vfio_dev_fd, VFIO_DEVICE_SET_IRQS, irq_set);
 
 	if (ret)
 		RTE_LOG(ERR, EAL,
-			"Error disabling MSI-X interrupts for fd %d\n", intr_handle->fd);
+			"Error disabling MSI-X interrupts for fd %d\n",
+			rte_intr_handle_fd_get(intr_handle));
 
 	return ret;
 }
@@ -342,7 +357,7 @@ vfio_enable_req(const struct rte_intr_handle *intr_handle)
 	int len, ret;
 	char irq_set_buf[IRQ_SET_BUF_LEN];
 	struct vfio_irq_set *irq_set;
-	int *fd_ptr;
+	int *fd_ptr, vfio_dev_fd;
 
 	len = sizeof(irq_set_buf);
 
@@ -354,13 +369,14 @@ vfio_enable_req(const struct rte_intr_handle *intr_handle)
 	irq_set->index = VFIO_PCI_REQ_IRQ_INDEX;
 	irq_set->start = 0;
 	fd_ptr = (int *) &irq_set->data;
-	*fd_ptr = intr_handle->fd;
+	*fd_ptr = rte_intr_handle_fd_get(intr_handle);
 
-	ret = ioctl(intr_handle->vfio_dev_fd, VFIO_DEVICE_SET_IRQS, irq_set);
+	vfio_dev_fd = rte_intr_handle_dev_fd_get(intr_handle);
+	ret = ioctl(vfio_dev_fd, VFIO_DEVICE_SET_IRQS, irq_set);
 
 	if (ret) {
 		RTE_LOG(ERR, EAL, "Error enabling req interrupts for fd %d\n",
-						intr_handle->fd);
+					rte_intr_handle_fd_get(intr_handle));
 		return -1;
 	}
 
@@ -373,7 +389,7 @@ vfio_disable_req(const struct rte_intr_handle *intr_handle)
 {
 	struct vfio_irq_set *irq_set;
 	char irq_set_buf[IRQ_SET_BUF_LEN];
-	int len, ret;
+	int len, ret, vfio_dev_fd;
 
 	len = sizeof(struct vfio_irq_set);
 
@@ -384,11 +400,12 @@ vfio_disable_req(const struct rte_intr_handle *intr_handle)
 	irq_set->index = VFIO_PCI_REQ_IRQ_INDEX;
 	irq_set->start = 0;
 
-	ret = ioctl(intr_handle->vfio_dev_fd, VFIO_DEVICE_SET_IRQS, irq_set);
+	vfio_dev_fd = rte_intr_handle_dev_fd_get(intr_handle);
+	ret = ioctl(vfio_dev_fd, VFIO_DEVICE_SET_IRQS, irq_set);
 
 	if (ret)
 		RTE_LOG(ERR, EAL, "Error disabling req interrupts for fd %d\n",
-			intr_handle->fd);
+			rte_intr_handle_fd_get(intr_handle));
 
 	return ret;
 }
@@ -399,20 +416,22 @@ static int
 uio_intx_intr_disable(const struct rte_intr_handle *intr_handle)
 {
 	unsigned char command_high;
+	int uio_cfg_fd;
 
 	/* use UIO config file descriptor for uio_pci_generic */
-	if (pread(intr_handle->uio_cfg_fd, &command_high, 1, 5) != 1) {
+	uio_cfg_fd = rte_intr_handle_dev_fd_get(intr_handle);
+	if (pread(uio_cfg_fd, &command_high, 1, 5) != 1) {
 		RTE_LOG(ERR, EAL,
 			"Error reading interrupts status for fd %d\n",
-			intr_handle->uio_cfg_fd);
+			uio_cfg_fd);
 		return -1;
 	}
 	/* disable interrupts */
 	command_high |= 0x4;
-	if (pwrite(intr_handle->uio_cfg_fd, &command_high, 1, 5) != 1) {
+	if (pwrite(uio_cfg_fd, &command_high, 1, 5) != 1) {
 		RTE_LOG(ERR, EAL,
 			"Error disabling interrupts for fd %d\n",
-			intr_handle->uio_cfg_fd);
+			uio_cfg_fd);
 		return -1;
 	}
 
@@ -423,20 +442,22 @@ static int
 uio_intx_intr_enable(const struct rte_intr_handle *intr_handle)
 {
 	unsigned char command_high;
+	int uio_cfg_fd;
 
 	/* use UIO config file descriptor for uio_pci_generic */
-	if (pread(intr_handle->uio_cfg_fd, &command_high, 1, 5) != 1) {
+	uio_cfg_fd = rte_intr_handle_dev_fd_get(intr_handle);
+	if (pread(uio_cfg_fd, &command_high, 1, 5) != 1) {
 		RTE_LOG(ERR, EAL,
 			"Error reading interrupts status for fd %d\n",
-			intr_handle->uio_cfg_fd);
+			uio_cfg_fd);
 		return -1;
 	}
 	/* enable interrupts */
 	command_high &= ~0x4;
-	if (pwrite(intr_handle->uio_cfg_fd, &command_high, 1, 5) != 1) {
+	if (pwrite(uio_cfg_fd, &command_high, 1, 5) != 1) {
 		RTE_LOG(ERR, EAL,
 			"Error enabling interrupts for fd %d\n",
-			intr_handle->uio_cfg_fd);
+			uio_cfg_fd);
 		return -1;
 	}
 
@@ -448,10 +469,11 @@ uio_intr_disable(const struct rte_intr_handle *intr_handle)
 {
 	const int value = 0;
 
-	if (write(intr_handle->fd, &value, sizeof(value)) < 0) {
+	if (write(rte_intr_handle_fd_get(intr_handle), &value,
+		  sizeof(value)) < 0) {
 		RTE_LOG(ERR, EAL,
 			"Error disabling interrupts for fd %d (%s)\n",
-			intr_handle->fd, strerror(errno));
+			rte_intr_handle_fd_get(intr_handle), strerror(errno));
 		return -1;
 	}
 	return 0;
@@ -462,10 +484,11 @@ uio_intr_enable(const struct rte_intr_handle *intr_handle)
 {
 	const int value = 1;
 
-	if (write(intr_handle->fd, &value, sizeof(value)) < 0) {
+	if (write(rte_intr_handle_fd_get(intr_handle), &value,
+		  sizeof(value)) < 0) {
 		RTE_LOG(ERR, EAL,
 			"Error enabling interrupts for fd %d (%s)\n",
-			intr_handle->fd, strerror(errno));
+			rte_intr_handle_fd_get(intr_handle), strerror(errno));
 		return -1;
 	}
 	return 0;
@@ -482,7 +505,8 @@ rte_intr_callback_register(const struct rte_intr_handle *intr_handle,
 	wake_thread = 0;
 
 	/* first do parameter checking */
-	if (intr_handle == NULL || intr_handle->fd < 0 || cb == NULL) {
+	if (intr_handle == NULL || rte_intr_handle_fd_get(intr_handle) < 0 ||
+	    cb == NULL) {
 		RTE_LOG(ERR, EAL,
 			"Registering with invalid input parameter\n");
 		return -EINVAL;
@@ -503,7 +527,8 @@ rte_intr_callback_register(const struct rte_intr_handle *intr_handle,
 
 	/* check if there is at least one callback registered for the fd */
 	TAILQ_FOREACH(src, &intr_sources, next) {
-		if (src->intr_handle.fd == intr_handle->fd) {
+		if (rte_intr_handle_fd_get(src->intr_handle) ==
+					rte_intr_handle_fd_get(intr_handle)) {
 			/* we had no interrupts for this */
 			if (TAILQ_EMPTY(&src->callbacks))
 				wake_thread = 1;
@@ -522,12 +547,22 @@ rte_intr_callback_register(const struct rte_intr_handle *intr_handle,
 			free(callback);
 			ret = -ENOMEM;
 		} else {
-			src->intr_handle = *intr_handle;
-			TAILQ_INIT(&src->callbacks);
-			TAILQ_INSERT_TAIL(&(src->callbacks), callback, next);
-			TAILQ_INSERT_TAIL(&intr_sources, src, next);
-			wake_thread = 1;
-			ret = 0;
+			src->intr_handle = rte_intr_handle_instance_alloc(
+					RTE_INTR_HANDLE_DEFAULT_SIZE, false);
+			if (src->intr_handle == NULL) {
+				RTE_LOG(ERR, EAL, "Can not create intr instance\n");
+				free(callback);
+				ret = -ENOMEM;
+			} else {
+				rte_intr_handle_instance_index_set(
+					src->intr_handle, intr_handle, 0);
+				TAILQ_INIT(&src->callbacks);
+				TAILQ_INSERT_TAIL(&(src->callbacks), callback,
+						  next);
+				TAILQ_INSERT_TAIL(&intr_sources, src, next);
+				wake_thread = 1;
+				ret = 0;
+			}
 		}
 	}
 
@@ -555,7 +590,7 @@ rte_intr_callback_unregister_pending(const struct rte_intr_handle *intr_handle,
 	struct rte_intr_callback *cb, *next;
 
 	/* do parameter checking first */
-	if (intr_handle == NULL || intr_handle->fd < 0) {
+	if (intr_handle == NULL || rte_intr_handle_fd_get(intr_handle) < 0) {
 		RTE_LOG(ERR, EAL,
 		"Unregistering with invalid input parameter\n");
 		return -EINVAL;
@@ -565,7 +600,8 @@ rte_intr_callback_unregister_pending(const struct rte_intr_handle *intr_handle,
 
 	/* check if the insterrupt source for the fd is existent */
 	TAILQ_FOREACH(src, &intr_sources, next)
-		if (src->intr_handle.fd == intr_handle->fd)
+		if (rte_intr_handle_fd_get(src->intr_handle) ==
+					rte_intr_handle_fd_get(intr_handle))
 			break;
 
 	/* No interrupt source registered for the fd */
@@ -605,7 +641,7 @@ rte_intr_callback_unregister(const struct rte_intr_handle *intr_handle,
 	struct rte_intr_callback *cb, *next;
 
 	/* do parameter checking first */
-	if (intr_handle == NULL || intr_handle->fd < 0) {
+	if (intr_handle == NULL || rte_intr_handle_fd_get(intr_handle) < 0) {
 		RTE_LOG(ERR, EAL,
 		"Unregistering with invalid input parameter\n");
 		return -EINVAL;
@@ -615,7 +651,8 @@ rte_intr_callback_unregister(const struct rte_intr_handle *intr_handle,
 
 	/* check if the insterrupt source for the fd is existent */
 	TAILQ_FOREACH(src, &intr_sources, next)
-		if (src->intr_handle.fd == intr_handle->fd)
+		if (rte_intr_handle_fd_get(src->intr_handle) ==
+					rte_intr_handle_fd_get(intr_handle))
 			break;
 
 	/* No interrupt source registered for the fd */
@@ -646,6 +683,7 @@ rte_intr_callback_unregister(const struct rte_intr_handle *intr_handle,
 		/* all callbacks for that source are removed. */
 		if (TAILQ_EMPTY(&src->callbacks)) {
 			TAILQ_REMOVE(&intr_sources, src, next);
+			rte_intr_handle_instance_free(src->intr_handle);
 			free(src);
 		}
 	}
@@ -677,22 +715,23 @@ rte_intr_callback_unregister_sync(const struct rte_intr_handle *intr_handle,
 int
 rte_intr_enable(const struct rte_intr_handle *intr_handle)
 {
-	int rc = 0;
+	int rc = 0, uio_cfg_fd;
 
 	if (intr_handle == NULL)
 		return -1;
 
-	if (intr_handle->type == RTE_INTR_HANDLE_VDEV) {
+	if (rte_intr_handle_type_get(intr_handle) == RTE_INTR_HANDLE_VDEV) {
 		rc = 0;
 		goto out;
 	}
 
-	if (intr_handle->fd < 0 || intr_handle->uio_cfg_fd < 0) {
+	uio_cfg_fd = rte_intr_handle_dev_fd_get(intr_handle);
+	if (rte_intr_handle_fd_get(intr_handle) < 0 || uio_cfg_fd < 0) {
 		rc = -1;
 		goto out;
 	}
 
-	switch (intr_handle->type){
+	switch (rte_intr_handle_type_get(intr_handle)) {
 	/* write to the uio fd to enable the interrupt */
 	case RTE_INTR_HANDLE_UIO:
 		if (uio_intr_enable(intr_handle))
@@ -734,7 +773,7 @@ rte_intr_enable(const struct rte_intr_handle *intr_handle)
 	default:
 		RTE_LOG(ERR, EAL,
 			"Unknown handle type of fd %d\n",
-					intr_handle->fd);
+					rte_intr_handle_fd_get(intr_handle));
 		rc = -1;
 		break;
 	}
@@ -757,13 +796,18 @@ rte_intr_enable(const struct rte_intr_handle *intr_handle)
 int
 rte_intr_ack(const struct rte_intr_handle *intr_handle)
 {
-	if (intr_handle && intr_handle->type == RTE_INTR_HANDLE_VDEV)
+	int uio_cfg_fd;
+
+	if (intr_handle && rte_intr_handle_type_get(intr_handle) ==
+							RTE_INTR_HANDLE_VDEV)
 		return 0;
 
-	if (!intr_handle || intr_handle->fd < 0 || intr_handle->uio_cfg_fd < 0)
+	uio_cfg_fd = rte_intr_handle_dev_fd_get(intr_handle);
+	if (!intr_handle || rte_intr_handle_fd_get(intr_handle) < 0 ||
+								uio_cfg_fd < 0)
 		return -1;
 
-	switch (intr_handle->type) {
+	switch (rte_intr_handle_type_get(intr_handle)) {
 	/* Both acking and enabling are same for UIO */
 	case RTE_INTR_HANDLE_UIO:
 		if (uio_intr_enable(intr_handle))
@@ -796,7 +840,7 @@ rte_intr_ack(const struct rte_intr_handle *intr_handle)
 	/* unknown handle type */
 	default:
 		RTE_LOG(ERR, EAL, "Unknown handle type of fd %d\n",
-			intr_handle->fd);
+			rte_intr_handle_fd_get(intr_handle));
 		return -1;
 	}
 
@@ -806,22 +850,23 @@ rte_intr_ack(const struct rte_intr_handle *intr_handle)
 int
 rte_intr_disable(const struct rte_intr_handle *intr_handle)
 {
-	int rc = 0;
+	int rc = 0, uio_cfg_fd;
 
 	if (intr_handle == NULL)
 		return -1;
 
-	if (intr_handle->type == RTE_INTR_HANDLE_VDEV) {
+	if (rte_intr_handle_type_get(intr_handle) == RTE_INTR_HANDLE_VDEV) {
 		rc = 0;
 		goto out;
 	}
 
-	if (intr_handle->fd < 0 || intr_handle->uio_cfg_fd < 0) {
+	uio_cfg_fd = rte_intr_handle_dev_fd_get(intr_handle);
+	if (rte_intr_handle_fd_get(intr_handle) < 0 || uio_cfg_fd < 0) {
 		rc = -1;
 		goto out;
 	}
 
-	switch (intr_handle->type){
+	switch (rte_intr_handle_type_get(intr_handle)) {
 	/* write to the uio fd to disable the interrupt */
 	case RTE_INTR_HANDLE_UIO:
 		if (uio_intr_disable(intr_handle))
@@ -863,7 +908,7 @@ rte_intr_disable(const struct rte_intr_handle *intr_handle)
 	default:
 		RTE_LOG(ERR, EAL,
 			"Unknown handle type of fd %d\n",
-					intr_handle->fd);
+					rte_intr_handle_fd_get(intr_handle));
 		rc = -1;
 		break;
 	}
@@ -896,7 +941,7 @@ eal_intr_process_interrupts(struct epoll_event *events, int nfds)
 		}
 		rte_spinlock_lock(&intr_lock);
 		TAILQ_FOREACH(src, &intr_sources, next)
-			if (src->intr_handle.fd ==
+			if (rte_intr_handle_fd_get(src->intr_handle) ==
 					events[n].data.fd)
 				break;
 		if (src == NULL){
@@ -909,7 +954,7 @@ eal_intr_process_interrupts(struct epoll_event *events, int nfds)
 		rte_spinlock_unlock(&intr_lock);
 
 		/* set the length to be read dor different handle type */
-		switch (src->intr_handle.type) {
+		switch (rte_intr_handle_type_get(src->intr_handle)) {
 		case RTE_INTR_HANDLE_UIO:
 		case RTE_INTR_HANDLE_UIO_INTX:
 			bytes_read = sizeof(buf.uio_intr_count);
@@ -973,6 +1018,7 @@ eal_intr_process_interrupts(struct epoll_event *events, int nfds)
 					TAILQ_REMOVE(&src->callbacks, cb, next);
 					free(cb);
 				}
+				rte_intr_handle_instance_free(src->intr_handle);
 				free(src);
 				return -1;
 			} else if (bytes_read == 0)
@@ -1012,7 +1058,8 @@ eal_intr_process_interrupts(struct epoll_event *events, int nfds)
 			if (cb->pending_delete) {
 				TAILQ_REMOVE(&src->callbacks, cb, next);
 				if (cb->ucb_fn)
-					cb->ucb_fn(&src->intr_handle, cb->cb_arg);
+					cb->ucb_fn(src->intr_handle,
+						   cb->cb_arg);
 				free(cb);
 				rv++;
 			}
@@ -1021,6 +1068,7 @@ eal_intr_process_interrupts(struct epoll_event *events, int nfds)
 		/* all callbacks for that source are removed. */
 		if (TAILQ_EMPTY(&src->callbacks)) {
 			TAILQ_REMOVE(&intr_sources, src, next);
+			rte_intr_handle_instance_free(src->intr_handle);
 			free(src);
 		}
 
@@ -1123,16 +1171,18 @@ eal_intr_thread_main(__rte_unused void *arg)
 				continue; /* skip those with no callbacks */
 			memset(&ev, 0, sizeof(ev));
 			ev.events = EPOLLIN | EPOLLPRI | EPOLLRDHUP | EPOLLHUP;
-			ev.data.fd = src->intr_handle.fd;
+			ev.data.fd = rte_intr_handle_fd_get(src->intr_handle);
 
 			/**
 			 * add all the uio device file descriptor
 			 * into wait list.
 			 */
 			if (epoll_ctl(pfd, EPOLL_CTL_ADD,
-					src->intr_handle.fd, &ev) < 0){
+				rte_intr_handle_fd_get(src->intr_handle),
+								&ev) < 0) {
 				rte_panic("Error adding fd %d epoll_ctl, %s\n",
-					src->intr_handle.fd, strerror(errno));
+				rte_intr_handle_fd_get(src->intr_handle),
+				strerror(errno));
 			}
 			else
 				numfds++;
@@ -1185,7 +1235,7 @@ eal_intr_proc_rxtx_intr(int fd, const struct rte_intr_handle *intr_handle)
 	int bytes_read = 0;
 	int nbytes;
 
-	switch (intr_handle->type) {
+	switch (rte_intr_handle_type_get(intr_handle)) {
 	case RTE_INTR_HANDLE_UIO:
 	case RTE_INTR_HANDLE_UIO_INTX:
 		bytes_read = sizeof(buf.uio_intr_count);
@@ -1198,7 +1248,7 @@ eal_intr_proc_rxtx_intr(int fd, const struct rte_intr_handle *intr_handle)
 		break;
 #endif
 	case RTE_INTR_HANDLE_VDEV:
-		bytes_read = intr_handle->efd_counter_size;
+		bytes_read = rte_intr_handle_efd_counter_size_get(intr_handle);
 		/* For vdev, number of bytes to read is set by driver */
 		break;
 	case RTE_INTR_HANDLE_EXT:
@@ -1419,8 +1469,8 @@ rte_intr_rx_ctl(struct rte_intr_handle *intr_handle, int epfd,
 	efd_idx = (vec >= RTE_INTR_VEC_RXTX_OFFSET) ?
 		(vec - RTE_INTR_VEC_RXTX_OFFSET) : vec;
 
-	if (!intr_handle || intr_handle->nb_efd == 0 ||
-	    efd_idx >= intr_handle->nb_efd) {
+	if (!intr_handle || rte_intr_handle_nb_efd_get(intr_handle) == 0 ||
+	    efd_idx >= (unsigned int)rte_intr_handle_nb_efd_get(intr_handle)) {
 		RTE_LOG(ERR, EAL, "Wrong intr vector number.\n");
 		return -EPERM;
 	}
@@ -1428,7 +1478,7 @@ rte_intr_rx_ctl(struct rte_intr_handle *intr_handle, int epfd,
 	switch (op) {
 	case RTE_INTR_EVENT_ADD:
 		epfd_op = EPOLL_CTL_ADD;
-		rev = &intr_handle->elist[efd_idx];
+		rev = rte_intr_handle_elist_index_get(intr_handle, efd_idx);
 		if (__atomic_load_n(&rev->status,
 				__ATOMIC_RELAXED) != RTE_EPOLL_INVALID) {
 			RTE_LOG(INFO, EAL, "Event already been added.\n");
@@ -1442,7 +1492,9 @@ rte_intr_rx_ctl(struct rte_intr_handle *intr_handle, int epfd,
 		epdata->cb_fun = (rte_intr_event_cb_t)eal_intr_proc_rxtx_intr;
 		epdata->cb_arg = (void *)intr_handle;
 		rc = rte_epoll_ctl(epfd, epfd_op,
-				   intr_handle->efds[efd_idx], rev);
+				   rte_intr_handle_efds_index_get(intr_handle,
+								  efd_idx),
+				   rev);
 		if (!rc)
 			RTE_LOG(DEBUG, EAL,
 				"efd %d associated with vec %d added on epfd %d"
@@ -1452,7 +1504,7 @@ rte_intr_rx_ctl(struct rte_intr_handle *intr_handle, int epfd,
 		break;
 	case RTE_INTR_EVENT_DEL:
 		epfd_op = EPOLL_CTL_DEL;
-		rev = &intr_handle->elist[efd_idx];
+		rev = rte_intr_handle_elist_index_get(intr_handle, efd_idx);
 		if (__atomic_load_n(&rev->status,
 				__ATOMIC_RELAXED) == RTE_EPOLL_INVALID) {
 			RTE_LOG(INFO, EAL, "Event does not exist.\n");
@@ -1477,8 +1529,9 @@ rte_intr_free_epoll_fd(struct rte_intr_handle *intr_handle)
 	uint32_t i;
 	struct rte_epoll_event *rev;
 
-	for (i = 0; i < intr_handle->nb_efd; i++) {
-		rev = &intr_handle->elist[i];
+	for (i = 0; i < (uint32_t)rte_intr_handle_nb_efd_get(intr_handle);
+									i++) {
+		rev = rte_intr_handle_elist_index_get(intr_handle, i);
 		if (__atomic_load_n(&rev->status,
 				__ATOMIC_RELAXED) == RTE_EPOLL_INVALID)
 			continue;
@@ -1498,7 +1551,8 @@ rte_intr_efd_enable(struct rte_intr_handle *intr_handle, uint32_t nb_efd)
 
 	assert(nb_efd != 0);
 
-	if (intr_handle->type == RTE_INTR_HANDLE_VFIO_MSIX) {
+	if (rte_intr_handle_type_get(intr_handle) ==
+						RTE_INTR_HANDLE_VFIO_MSIX) {
 		for (i = 0; i < n; i++) {
 			fd = eventfd(0, EFD_NONBLOCK | EFD_CLOEXEC);
 			if (fd < 0) {
@@ -1507,21 +1561,34 @@ rte_intr_efd_enable(struct rte_intr_handle *intr_handle, uint32_t nb_efd)
 					errno, strerror(errno));
 				return -errno;
 			}
-			intr_handle->efds[i] = fd;
+
+			if (rte_intr_handle_efds_index_set(intr_handle, i, fd))
+				return -rte_errno;
 		}
-		intr_handle->nb_efd   = n;
-		intr_handle->max_intr = NB_OTHER_INTR + n;
-	} else if (intr_handle->type == RTE_INTR_HANDLE_VDEV) {
+
+		if (rte_intr_handle_nb_efd_set(intr_handle, n))
+			return -rte_errno;
+
+		if (rte_intr_handle_max_intr_set(intr_handle,
+						 NB_OTHER_INTR + n))
+			return -rte_errno;
+	} else if (rte_intr_handle_type_get(intr_handle) ==
+							RTE_INTR_HANDLE_VDEV) {
 		/* only check, initialization would be done in vdev driver.*/
-		if (intr_handle->efd_counter_size >
-		    sizeof(union rte_intr_read_buffer)) {
+		if ((uint64_t)rte_intr_handle_efd_counter_size_get(intr_handle)
+		    > sizeof(union rte_intr_read_buffer)) {
 			RTE_LOG(ERR, EAL, "the efd_counter_size is oversized");
 			return -EINVAL;
 		}
 	} else {
-		intr_handle->efds[0]  = intr_handle->fd;
-		intr_handle->nb_efd   = RTE_MIN(nb_efd, 1U);
-		intr_handle->max_intr = NB_OTHER_INTR;
+		if (rte_intr_handle_efds_index_set(intr_handle, 0,
+					   rte_intr_handle_fd_get(intr_handle)))
+			return -rte_errno;
+		if (rte_intr_handle_nb_efd_set(intr_handle,
+					       RTE_MIN(nb_efd, 1U)))
+			return -rte_errno;
+		if (rte_intr_handle_max_intr_set(intr_handle, NB_OTHER_INTR))
+			return -rte_errno;
 	}
 
 	return 0;
@@ -1533,18 +1600,20 @@ rte_intr_efd_disable(struct rte_intr_handle *intr_handle)
 	uint32_t i;
 
 	rte_intr_free_epoll_fd(intr_handle);
-	if (intr_handle->max_intr > intr_handle->nb_efd) {
-		for (i = 0; i < intr_handle->nb_efd; i++)
-			close(intr_handle->efds[i]);
+	if (rte_intr_handle_max_intr_get(intr_handle) >
+				rte_intr_handle_nb_efd_get(intr_handle)) {
+		for (i = 0; i <
+			(uint32_t)rte_intr_handle_nb_efd_get(intr_handle); i++)
+			close(rte_intr_handle_efds_index_get(intr_handle, i));
 	}
-	intr_handle->nb_efd = 0;
-	intr_handle->max_intr = 0;
+	rte_intr_handle_nb_efd_set(intr_handle, 0);
+	rte_intr_handle_max_intr_set(intr_handle, 0);
 }
 
 int
 rte_intr_dp_is_en(struct rte_intr_handle *intr_handle)
 {
-	return !(!intr_handle->nb_efd);
+	return !(!rte_intr_handle_nb_efd_get(intr_handle));
 }
 
 int
@@ -1553,16 +1622,17 @@ rte_intr_allow_others(struct rte_intr_handle *intr_handle)
 	if (!rte_intr_dp_is_en(intr_handle))
 		return 1;
 	else
-		return !!(intr_handle->max_intr - intr_handle->nb_efd);
+		return !!(rte_intr_handle_max_intr_get(intr_handle) -
+				rte_intr_handle_nb_efd_get(intr_handle));
 }
 
 int
 rte_intr_cap_multiple(struct rte_intr_handle *intr_handle)
 {
-	if (intr_handle->type == RTE_INTR_HANDLE_VFIO_MSIX)
+	if (rte_intr_handle_type_get(intr_handle) == RTE_INTR_HANDLE_VFIO_MSIX)
 		return 1;
 
-	if (intr_handle->type == RTE_INTR_HANDLE_VDEV)
+	if (rte_intr_handle_type_get(intr_handle) == RTE_INTR_HANDLE_VDEV)
 		return 1;
 
 	return 0;
-- 
2.18.0


^ permalink raw reply	[relevance 1%]

* [dpdk-dev] [PATCH v11 0/3] devtools: scripts to count and track symbols
    @ 2021-09-03 13:23  3% ` Ray Kinsella
  2021-09-03 13:23  5%   ` [dpdk-dev] [PATCH v11 1/3] devtools: script to track symbols over releases Ray Kinsella
                     ` (2 more replies)
  2021-09-08 15:12  3% ` [dpdk-dev] [PATCH v11 0/3] devtools: scripts to count and track symbols Ray Kinsella
                   ` (2 subsequent siblings)
  4 siblings, 3 replies; 200+ results
From: Ray Kinsella @ 2021-09-03 13:23 UTC (permalink / raw)
  To: dev
  Cc: bruce.richardson, stephen, ferruh.yigit, thomas, ktraynor, mdr, aconole

Scripts to count and track the lifecycle of DPDK symbols.

The symbol-tool script reports on the growth of symbols over releases
and list expired symbols. The notify-symbol-maintainers script
consumes the input from symbol-tool and generates email notifications
of expired symbols.

v2: reworked to fix pylint errors
v3: sent with the correct in-reply-to
v4: fix typos picked up by the CI
v5: fix terminal_size & directory args
v6: added list-expired, to list expired experimental symbols
v7: fix typo in comments
v8: added tool to notify maintainers of expired symbols
v9: removed hardcoded emails addressed and script names
v10: added ability to identify and notify the original contributors
v11: addressed feedback from Aaron Conole, including PEP8 errors.

Ray Kinsella (3):
  devtools: script to track symbols over releases
  devtools: script to send notifications of expired symbols
  maintainers: add new abi scripts

 MAINTAINERS                           |   2 +
 devtools/notify-symbol-maintainers.py | 302 +++++++++++++++
 devtools/symbol-tool.py               | 505 ++++++++++++++++++++++++++
 3 files changed, 809 insertions(+)
 create mode 100755 devtools/notify-symbol-maintainers.py
 create mode 100755 devtools/symbol-tool.py

-- 
2.26.2


^ permalink raw reply	[relevance 3%]

* [dpdk-dev] [PATCH v11 1/3] devtools: script to track symbols over releases
  2021-09-03 13:23  3% ` [dpdk-dev] [PATCH v11 " Ray Kinsella
@ 2021-09-03 13:23  5%   ` Ray Kinsella
  2021-09-03 13:23  5%   ` [dpdk-dev] [PATCH v11 2/3] devtools: script to send notifications of expired symbols Ray Kinsella
  2021-09-03 13:23 17%   ` [dpdk-dev] [PATCH v11 3/3] maintainers: add new abi scripts Ray Kinsella
  2 siblings, 0 replies; 200+ results
From: Ray Kinsella @ 2021-09-03 13:23 UTC (permalink / raw)
  To: dev
  Cc: bruce.richardson, stephen, ferruh.yigit, thomas, ktraynor, mdr, aconole

This script tracks the growth of stable and experimental symbols
over releases since v19.11. The script has the ability to
count the added symbols between two dpdk releases, and to
list experimental symbols present in two dpdk releases
(expired symbols).

example usages:

Count symbols added since v19.11
$ devtools/symbol-tool.py count-symbols

Count symbols added since v20.11
$ devtools/symbol-tool.py count-symbols --releases v20.11,v21.05

List experimental symbols present in v20.11 and v21.05
$ devtools/symbol-tool.py list-expired --releases v20.11,v21.05

List experimental symbols in libraries only, present since v19.11
$ devtools/symbol-tool.py list-expired --directory lib

Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
---
 devtools/symbol-tool.py | 505 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 505 insertions(+)
 create mode 100755 devtools/symbol-tool.py

diff --git a/devtools/symbol-tool.py b/devtools/symbol-tool.py
new file mode 100755
index 0000000000..a0b81c1b90
--- /dev/null
+++ b/devtools/symbol-tool.py
@@ -0,0 +1,505 @@
+#!/usr/bin/env python3
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2021 Intel Corporation
+# pylint: disable=invalid-name
+'''Tool to count or list symbols in each DPDK release'''
+from pathlib import Path
+import sys
+import os
+import subprocess
+import argparse
+from argparse import RawTextHelpFormatter
+import re
+import datetime
+try:
+    from parsley import makeGrammar
+except ImportError:
+    print('This script uses the package Parsley to parse C Mapfiles.\n'
+          'This can be installed with \"pip install parsley".')
+    sys.exit()
+
+DESCRIPTION = '''
+This script tracks the growth of stable and experimental symbols
+over releases since v19.11. The script has the ability to
+count the added symbols between two dpdk releases, and to
+list experimental symbols present in two dpdk releases
+(expired symbols), including the name & email of the original contributor.
+
+example usages:
+
+Count symbols added since v19.11
+$ {s} count-symbols
+
+Count symbols added since v20.11
+$ {s} count-symbols --releases v20.11,v21.05
+
+List experimental symbols present in v20.11 and v21.05
+$ {s} list-expired --releases v20.11,v21.05
+
+List experimental symbols in libraries only, present since v19.11
+$ {s} list-expired --directory lib
+'''
+
+MAP_GRAMMAR = r"""
+
+ws = (' ' | '\r' | '\n' | '\t')*
+
+ABI_VER = ({})
+DPDK_VER = ('DPDK_' ABI_VER)
+ABI_NAME = ('INTERNAL' | 'EXPERIMENTAL' | DPDK_VER)
+comment = '#' (~'\n' anything)+ '\n'
+symbol = (~(';' | '}}' | '#') anything )+:c ';' -> ''.join(c)
+global = 'global:'
+local = 'local: *;'
+symbols = comment* symbol:s ws comment* -> s
+
+abi = (abi_section+):m -> dict(m)
+abi_section = (ws ABI_NAME:e ws '{{' ws global* (~local ws symbols)*:s ws local* ws '}}' ws DPDK_VER* ';' ws) -> (e,s)
+"""  # noqa: E501
+
+
+def get_abi_versions():
+    '''Returns a string of possible dpdk abi versions'''
+
+    year = datetime.date.today().year - 2000
+    tags = " |".join(['\'{}\''.format(i)
+                     for i in reversed(range(21, year + 1))])
+    tags = tags + ' | \'20.0.1\' | \'20.0\' | \'20\''
+
+    return tags
+
+
+def get_dpdk_releases():
+    '''Returns a list of dpdk release tags names  since v19.11'''
+
+    year = datetime.date.today().year - 2000
+    year_range = "|".join("{}".format(i) for i in range(19, year + 1))
+    pattern = re.compile(r'^\"v(' + year_range + r')\.\d{2}\"$')
+
+    cmd = ['git', 'for-each-ref', '--sort=taggerdate', '--format', '"%(tag)"']
+    try:
+        result = subprocess.run(cmd,
+                                stdout=subprocess.PIPE,
+                                stderr=subprocess.PIPE,
+                                check=True)
+    except subprocess.CalledProcessError:
+        print("Failed to interogate git for release tags")
+        sys.exit()
+
+    tags = result.stdout.decode('utf-8').split('\n')
+
+    # find the non-rcs between now and v19.11
+    tags = [tag.replace('\"', '')
+            for tag in reversed(tags)
+            if pattern.match(tag)][:-3]
+
+    return tags
+
+
+def fix_directory_name(path):
+    '''Prepend librte to the source directory name'''
+    mapfilepath1 = str(path.parent.name)
+    mapfilepath2 = str(path.parents[1])
+    mapfilepath = mapfilepath2 + '/librte_' + mapfilepath1
+
+    return mapfilepath
+
+
+def directory_renamed(path, rel):
+    '''Fix removal of the librte_ from the directory names'''
+
+    mapfilepath = fix_directory_name(path)
+    tagfile = '{}:{}/{}'.format(rel, mapfilepath,  path.name)
+
+    try:
+        result = subprocess.run(['git', 'show', tagfile],
+                                stdout=subprocess.PIPE,
+                                stderr=subprocess.PIPE,
+                                check=True)
+    except subprocess.CalledProcessError:
+        result = None
+
+    return result
+
+
+def mapfile_renamed(path, rel):
+    '''Fix renaming of the map file'''
+    newfile = None
+
+    result = subprocess.run(['git', 'ls-tree',
+                             rel, str(path.parent) + '/'],
+                            stdout=subprocess.PIPE,
+                            stderr=subprocess.PIPE,
+                            check=True)
+    dentries = result.stdout.decode('utf-8')
+    dentries = dentries.split('\n')
+
+    # filter entries looking for the map file
+    dentries = [dentry for dentry in dentries if dentry.endswith('.map')]
+    if len(dentries) > 1 or len(dentries) == 0:
+        return None
+
+    dparts = dentries[0].split('/')
+    newfile = dparts[len(dparts) - 1]
+
+    if newfile is not None:
+        tagfile = '{}:{}/{}'.format(rel, path.parent, newfile)
+
+        try:
+            result = subprocess.run(['git', 'show', tagfile],
+                                    stdout=subprocess.PIPE,
+                                    stderr=subprocess.PIPE,
+                                    check=True)
+        except subprocess.CalledProcessError:
+            result = None
+
+    else:
+        result = None
+
+    return result
+
+
+def mapfile_and_directory_renamed(path, rel):
+    '''Fix renaming of the map file & the source directory'''
+    mapfilepath = Path("{}/{}".format(fix_directory_name(path), path.name))
+
+    return mapfile_renamed(mapfilepath, rel)
+
+
+FIX_STRATEGIES = [directory_renamed,
+                  mapfile_renamed,
+                  mapfile_and_directory_renamed]
+
+
+def get_symbols(map_parser, release, mapfile_path):
+    '''Count the symbols for a given release and mapfile'''
+    abi_sections = {}
+
+    tagfile = '{}:{}'.format(release, mapfile_path)
+    try:
+        result = subprocess.run(['git', 'show', tagfile],
+                                stdout=subprocess.PIPE,
+                                stderr=subprocess.PIPE,
+                                check=True)
+    except subprocess.CalledProcessError:
+        result = None
+
+    for fix_strategy in FIX_STRATEGIES:
+        if result is not None:
+            break
+        result = fix_strategy(mapfile_path, release)
+
+    if result is not None:
+        mapfile = result.stdout.decode('utf-8')
+        abi_sections = map_parser(mapfile).abi()
+
+    return abi_sections
+
+
+def get_terminal_rows():
+    '''Find the number of rows in the terminal'''
+
+    try:
+        return os.get_terminal_size().lines
+    except IOError:
+        return 0
+
+
+class SymbolOwner():
+    '''Find the symbols original contributors name and email'''
+    symbol_regex = {}
+    blame_regex = {'name': r'author\s(.*)',
+                   'email': r'author-mail\s<(.*)>'}
+
+    def __init__(self, libpath, symbol):
+        self.libpath = libpath
+        self.symbol = symbol
+
+        # find variable definitions in C files, and functions in headers.
+        self.symbol_regex = \
+            {'*.c':  r'^(?!extern).*' + self.symbol + '[^()]*;',
+             '*.h': r'__rte_experimental(?:.*\n){0,2}.*' + self.symbol}
+
+    def find_symbol_location(self):
+        '''Find where the symbol is definited in the source'''
+        for key in self.symbol_regex:
+            for path in Path(self.libpath).rglob(key):
+                file_text = open(path).read()
+
+                # find where the symbol is defined, either preceeded by
+                # rte_experimental tag (functions)
+                # or followed by a ; (variables)
+
+                exp = self.symbol_regex[key]
+                pattern = re.compile(exp, re.MULTILINE)
+                search = pattern.search(file_text)
+
+                if search is not None:
+                    symbol_pos = search.span()[1]
+                    symbol_line = file_text.count('\n', 0, symbol_pos) + 1
+
+                    return [str(path), symbol_line]
+        return None
+
+    def find_symbol_owner(self):
+        '''Find the symbols original contributors name and email'''
+        owners = {}
+        location = self.find_symbol_location()
+
+        if location is None:
+            return None
+
+        line = '-L {},{}'.format(location[1], location[1])
+        # git blame -p(orcelain) -L(ine) path
+        args = ['-p', line, location[0]]
+
+        try:
+            result = subprocess.run(['git', 'blame'] + args,
+                                    stdout=subprocess.PIPE,
+                                    stderr=subprocess.PIPE,
+                                    check=True)
+        except subprocess.CalledProcessError:
+            return None
+
+        blame = result.stdout.decode('utf-8')
+        for key in self.blame_regex:
+            pattern = re.compile(self.blame_regex[key], re.MULTILINE)
+            match = pattern.search(blame)
+
+            owners[key] = match.groups()[0]
+
+        return owners
+
+
+class SymbolCountOutput():
+    '''Format the output to supported formats'''
+    output_fmt = ""
+    column_fmt = ""
+
+    def __init__(self, format_output, dpdk_releases):
+        self.OUTPUT_FORMATS[format_output](self, dpdk_releases)
+        self.column_titles = ['mapfile'] + dpdk_releases
+
+        self.terminal_rows = get_terminal_rows()
+        self.row = 0
+
+    def set_terminal_output(self, dpdk_rel):
+        '''Set the output format to Tabbed Separated Values'''
+
+        self.output_fmt = '{:<50}' + \
+            ''.join(['{:<6}{:<6}'] * (len(dpdk_rel)))
+        self.column_fmt = '{:50}' + \
+            ''.join(['{:<12}'] * (len(dpdk_rel)))
+
+    def set_csv_output(self, dpdk_rel):
+        '''Set the output format to Comma Separated Values'''
+
+        self.output_fmt = '{},' + \
+            ','.join(['{},{}'] * (len(dpdk_rel)))
+        self.column_fmt = '{},' + \
+            ','.join(['{},'] * (len(dpdk_rel)))
+
+    def print_columns(self):
+        '''Print column rows with release names'''
+        print(self.column_fmt.format(*self.column_titles))
+        self.row += 1
+
+    def print_row(self, mapfile, symbols):
+        '''Print row of symbol values'''
+        mapfile = str(mapfile)
+        print(self.output_fmt.format(*([mapfile] + symbols)))
+        self.row += 1
+
+        if((self.terminal_rows > 0) and
+           ((self.row % self.terminal_rows) == 0)):
+            self.print_columns()
+
+    OUTPUT_FORMATS = {None: set_terminal_output,
+                      'terminal': set_terminal_output,
+                      'csv': set_csv_output}
+
+
+class ListExpiredOutput():
+    '''Format the output to supported formats'''
+    output_fmt = ""
+    column_fmt = ""
+
+    def __init__(self, format_output, dpdk_releases):
+        self.terminal = True
+        self.OUTPUT_FORMATS[format_output](self, dpdk_releases)
+        self.column_titles = ['mapfile'] + \
+            ['expired (' + ','.join(dpdk_releases) + ')'] + \
+            ['contributor name', 'contributor email']
+
+    def set_terminal_output(self, _):
+        '''Set the output format to Tabbed Separated Values'''
+
+        self.output_fmt = '{:<50}{:<50}{:<25}{:<25}'
+        self.column_fmt = '{:50}{:50}{:25}{:25}'
+
+    def set_csv_output(self, _):
+        '''Set the output format to Comma Separated Values'''
+
+        self.output_fmt = '{},{},{},{}'
+        self.column_fmt = '{},{},{},{}'
+        self.terminal = False
+
+    def print_columns(self):
+        '''Print column rows with release names'''
+        print(self.column_fmt.format(*self.column_titles))
+
+    def print_row(self, mapfile, symbols, owner):
+        '''Print row of symbol values'''
+
+        for symbol in symbols:
+            mapfile = str(mapfile)
+            name = owner[symbol]['name'] \
+                if owner[symbol] is not None else ''
+            email = owner[symbol]['email'] \
+                if owner[symbol] is not None else ''
+
+            print(self.output_fmt.format(mapfile, symbol, name, email))
+            if self.terminal:
+                mapfile = ''
+
+    OUTPUT_FORMATS = {None: set_terminal_output,
+                      'terminal': set_terminal_output,
+                      'csv': set_csv_output}
+
+
+class CountSymbolsAction:
+    ''' Logic to count symbols added since a give release '''
+    IGNORE_SECTIONS = ['EXPERIMENTAL', 'INTERNAL']
+
+    def __init__(self, mapfile_path, mapfile_parser, format_output):
+        self.path = mapfile_path
+        self.parser = mapfile_parser
+        self.format_output = format_output
+        self.symbols_count = []
+
+    def add_mapfile(self, release):
+        ''' add a version mapfile '''
+        symbol_count = experimental_count = 0
+
+        symbols = get_symbols(self.parser, release, self.path)
+
+        # which versions are present, and we care about
+        abi_vers = [abi_ver
+                    for abi_ver in symbols
+                    if abi_ver not in self.IGNORE_SECTIONS]
+
+        for abi_ver in abi_vers:
+            symbol_count += len(symbols[abi_ver])
+
+        # count experimental symbols
+        if 'EXPERIMENTAL' in symbols.keys():
+            experimental_count = len(symbols['EXPERIMENTAL'])
+
+        self.symbols_count += [symbol_count, experimental_count]
+
+    def __del__(self):
+        self.format_output.print_row(self.path.parent, self.symbols_count)
+
+
+class ListExpiredAction:
+    ''' Logic to list expired symbols between two releases '''
+
+    def __init__(self, mapfile_path, mapfile_parser, format_output):
+        self.path = mapfile_path
+        self.parser = mapfile_parser
+        self.format_output = format_output
+        self.experimental_symbols = []
+
+    def add_mapfile(self, release):
+        ''' add a version mapfile '''
+        symbols = get_symbols(self.parser, release, self.path)
+
+        if 'EXPERIMENTAL' in symbols.keys():
+            experimental = [exp.strip() for exp in symbols['EXPERIMENTAL']]
+
+            self.experimental_symbols.append(experimental)
+
+    def __del__(self):
+        if len(self.experimental_symbols) != 2:
+            return
+
+        tmp = self.experimental_symbols
+        # find symbols present in both dpdk releases
+        intersect_syms = [sym for sym in tmp[0] if sym in tmp[1]]
+
+        # check for empty set
+        if intersect_syms == []:
+            return
+
+        sym_owner = {}
+        for sym in intersect_syms:
+            sym_owner[sym] = \
+                SymbolOwner(self.path.parent, sym).find_symbol_owner()
+
+        self.format_output.print_row(self.path.parent,
+                                     intersect_syms,
+                                     sym_owner)
+
+
+SRC_DIRECTORIES = 'drivers,lib'
+
+ACTIONS = {None: CountSymbolsAction,
+           'count-symbols': CountSymbolsAction,
+           'list-expired': ListExpiredAction}
+
+ACTION_OUTPUT = {None: SymbolCountOutput,
+                 'count-symbols': SymbolCountOutput,
+                 'list-expired': ListExpiredOutput}
+
+
+def main():
+    '''Main entry point'''
+
+    dpdk_releases = get_dpdk_releases()
+
+    parser = \
+        argparse.ArgumentParser(description=DESCRIPTION.format(s=__file__),
+                                formatter_class=RawTextHelpFormatter)
+
+    parser.add_argument('mode', choices=['count-symbols', 'list-expired'])
+    parser.add_argument('--format-output', choices=['terminal', 'csv'],
+                        default='terminal')
+    parser.add_argument('--directory', choices=SRC_DIRECTORIES.split(','),
+                        default=SRC_DIRECTORIES)
+    parser.add_argument('--releases',
+                        help='2 x comma separated release tags e.g. \''
+                        + ','.join([dpdk_releases[0], dpdk_releases[-1]])
+                        + '\'')
+    args = parser.parse_args()
+
+    if args.releases is not None:
+        dpdk_releases = args.releases.split(',')
+
+    if args.mode == 'list-expired':
+        if len(dpdk_releases) < 2:
+            sys.exit('Please specify two releases to compare '
+                     'in \'list-expired\' mode.')
+        dpdk_releases = [dpdk_releases[0],
+                         dpdk_releases[len(dpdk_releases) - 1]]
+
+    action = ACTIONS[args.mode]
+    format_output = ACTION_OUTPUT[args.mode](args.format_output, dpdk_releases)
+
+    map_grammar = MAP_GRAMMAR.format(get_abi_versions())
+    map_parser = makeGrammar(map_grammar, {})
+
+    format_output.print_columns()
+
+    for src_dir in args.directory.split(','):
+        for path in Path(src_dir).rglob('*.map'):
+            release_action = action(path, map_parser, format_output)
+
+            for release in dpdk_releases:
+                release_action.add_mapfile(release)
+
+            # all the magic happens in the destructor
+            del release_action
+
+
+if __name__ == '__main__':
+    main()
-- 
2.26.2


^ permalink raw reply	[relevance 5%]

* [dpdk-dev] [PATCH v11 2/3] devtools: script to send notifications of expired symbols
  2021-09-03 13:23  3% ` [dpdk-dev] [PATCH v11 " Ray Kinsella
  2021-09-03 13:23  5%   ` [dpdk-dev] [PATCH v11 1/3] devtools: script to track symbols over releases Ray Kinsella
@ 2021-09-03 13:23  5%   ` Ray Kinsella
  2021-09-03 13:23 17%   ` [dpdk-dev] [PATCH v11 3/3] maintainers: add new abi scripts Ray Kinsella
  2 siblings, 0 replies; 200+ results
From: Ray Kinsella @ 2021-09-03 13:23 UTC (permalink / raw)
  To: dev
  Cc: bruce.richardson, stephen, ferruh.yigit, thomas, ktraynor, mdr, aconole

Use this script with the output of the DPDK symbol tool, to notify
maintainers of expired symbols by email. You need to define the environment
variable DPDK_GETMAINTAINER_PATH for this tool to work.

Use terminal output to review the emails before sending.
e.g.
$ devtools/symbol-tool.py list-expired --format-output csv \
| DPDK_GETMAINTAINER_PATH=<somewhere>/get_maintainer.pl \
devtools/notify_expired_symbols.py --format-output terminal

Then use email output to send the emails to the maintainers.
e.g.
$ devtools/symbol-tool.py list-expired --format-output csv \
| DPDK_GETMAINTAINER_PATH=<somewhere>/get_maintainer.pl \
devtools/notify_expired_symbols.py --format-output email \
--smtp-server <server> --sender <someone@somewhere.com> \
--password <password> --cc <someone@somewhere.com>

Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
---
 devtools/notify-symbol-maintainers.py | 302 ++++++++++++++++++++++++++
 1 file changed, 302 insertions(+)
 create mode 100755 devtools/notify-symbol-maintainers.py

diff --git a/devtools/notify-symbol-maintainers.py b/devtools/notify-symbol-maintainers.py
new file mode 100755
index 0000000000..edf330f88b
--- /dev/null
+++ b/devtools/notify-symbol-maintainers.py
@@ -0,0 +1,302 @@
+#!/usr/bin/env python3
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2021 Intel Corporation
+# pylint: disable=invalid-name
+'''Tool to notify maintainers of expired symbols'''
+import os
+import smtplib
+import ssl
+import sys
+import subprocess
+import argparse
+from argparse import RawTextHelpFormatter
+import time
+from email.message import EmailMessage
+from pathlib import Path
+
+DESCRIPTION = '''
+Use this script with the output of the DPDK symbol tool, to notify maintainers
+and contributors of expired symbols by email. You need to define the environment
+variable DPDK_GETMAINTAINER_PATH for this tool to work.
+
+Use terminal output to review the emails before sending.
+e.g.
+$ devtools/symbol-tool.py list-expired --format-output csv \\
+| DPDK_GETMAINTAINER_PATH=<somewhere>/get_maintainer.pl \\
+{s} --format-output terminal
+
+Then use email output to send the emails to the maintainers.
+e.g.
+$ devtools/symbol-tool.py list-expired --format-output csv \\
+| DPDK_GETMAINTAINER_PATH=<somewhere>/get_maintainer.pl \\
+{s} --format-output email \\
+--smtp-server <server> --sender <someone@somewhere.com> --password <password> \\
+--cc <someone@somewhere.com>
+'''  # noqa: E501
+
+EMAIL_TEMPLATE = '''Hi there,
+
+Please note the symbols listed below have expired. In line with the DPDK ABI
+policy, they should be scheduled for removal, in the next DPDK release.
+
+For more information, please see the DPDK ABI Policy, section 3.5.3.
+https://doc.dpdk.org/guides/contributing/abi_policy.html
+
+Thanks,
+
+The DPDK Symbol Bot
+
+'''  # noqa: E501
+
+ABI_POLICY = 'doc/guides/contributing/abi_policy.rst'
+DPDK_GMP_ENV_VAR = 'DPDK_GETMAINTAINER_PATH'
+MAINTAINERS = 'MAINTAINERS'
+get_maintainer = ['devtools/get-maintainer.sh',
+                  '--email', '-f']
+
+
+class EnvironException(Exception):
+    '''Subclass exception for Pylint\'s happiness.'''
+
+
+def _die_on_exception(e):
+    '''Print an exception, and quit'''
+
+    print('Fatal Error: ' + str(e))
+    sys.exit()
+
+
+def _check_get_maintainers_env():
+    '''Check get maintainers scripts are setup'''
+
+    if not Path(get_maintainer[0]).is_file():
+        raise EnvironException('Cannot locate DPDK\'s get maintainers script, '
+                               ' usually at $' + get_maintainer[0] + '.')
+
+    if DPDK_GMP_ENV_VAR not in os.environ:
+        raise EnvironException(DPDK_GMP_ENV_VAR + ' is not defined.')
+
+    if not Path(os.environ[DPDK_GMP_ENV_VAR]).is_file():
+        raise EnvironException('Cannot locate get maintainers script, usually'
+                               ' at ' + DPDK_GMP_ENV_VAR + '.')
+
+
+def _get_maintainers(libpath):
+    '''Get the maintainers for given library'''
+
+    try:
+        _check_get_maintainers_env()
+    except EnvironException as e:
+        _die_on_exception(e)
+
+    try:
+        cmd = get_maintainer + [libpath]
+        result = subprocess.run(cmd,
+                                stdout=subprocess.PIPE,
+                                stderr=subprocess.PIPE,
+                                check=True)
+    except subprocess.CalledProcessError as e:
+        _die_on_exception(e)
+
+    if result is None:
+        return None
+
+    email = result.stdout.decode('utf-8')
+    if email == '':
+        return None
+
+    email = list(filter(None, email.split('\n')))
+    return email
+
+
+default_maintainers = _get_maintainers(ABI_POLICY) + \
+    _get_maintainers(MAINTAINERS)
+
+
+def get_maintainers(libpath):
+    '''Get the maintainers for given library'''
+    maintainers = _get_maintainers(libpath)
+
+    if maintainers is None:
+        maintainers = default_maintainers
+
+    return maintainers
+
+
+def get_message(library, symbols, config):
+    '''Build email message from symbols, config and maintainers'''
+    contributors = {}
+    message = {}
+    maintainers = get_maintainers(library)
+
+    if maintainers != default_maintainers:
+        message['CC'] = default_maintainers.copy()
+
+    if 'CC' in config:
+        message.setdefault('CC', []).append(config['CC'])
+
+    message['Subject'] = 'Expired symbols in {}\n'.format(library)
+
+    body = EMAIL_TEMPLATE
+    body += '{:<50}{:<25}{:<25}\n'.format('Symbol', 'Contributor', 'Email')
+    for sym in symbols:
+        body += ('{:<50}{:<25}{:<25}\n'.format(sym,
+                                               symbols[sym]['name'],
+                                               symbols[sym]['email']))
+        email = symbols[sym]['email']
+        contributors[email] = ''
+
+    contributors = list(contributors.keys())
+
+    message['To'] = maintainers + contributors
+    message['Body'] = body
+
+    return message
+
+
+class OutputEmail():
+    '''Format the output for email'''
+
+    def __init__(self, config):
+        self.config = config
+
+        self.terminal = OutputTerminal(config)
+        context = ssl.create_default_context()
+
+        # Try to log in to server and send email
+        try:
+            self.server = smtplib.SMTP(config['smtp_server'], 587)
+            self.server.starttls(context=context)  # Secure the connection
+            self.server.login(config['sender'], config['password'])
+        except EnvironException as e:
+            _die_on_exception(e)
+
+    def message(self, message):
+        '''send email'''
+        self.terminal.message(message)
+
+        msg = EmailMessage()
+        msg.set_content(message.pop('Body'))
+
+        for key in message.keys():
+            msg[key] = message[key]
+
+        msg['From'] = self.config['sender']
+        msg['Reply-To'] = 'no-reply@dpdk.org'
+
+        self.server.send_message(msg)
+
+        time.sleep(1)
+
+    def __del__(self):
+        self.server.quit()
+
+
+class OutputTerminal():  # pylint: disable=too-few-public-methods
+    '''Format the output for the terminal'''
+
+    def __init__(self, config):
+        self.config = config
+
+    def message(self, message):
+        '''Print email to terminal'''
+
+        terminal = 'To:' + ', '.join(message['To']) + '\n'
+        if 'sender' in self.config.keys():
+            terminal += 'From:' + self.config['sender'] + '\n'
+
+        terminal += 'Reply-To:' + 'no-reply@dpdk.org' + '\n'
+
+        if 'CC' in message:
+            terminal += 'CC:' + ', '.join(message['CC']) + '\n'
+
+        terminal += 'Subject:' + message['Subject'] + '\n'
+        terminal += 'Body:' + message['Body'] + '\n'
+
+        print(terminal)
+        print('-' * 80)
+
+
+def parse_config(args):
+    '''put the command line args in the right places'''
+    config = {}
+    error_msg = None
+
+    outputs = {
+        None: OutputTerminal,
+        'terminal': OutputTerminal,
+        'email': OutputEmail
+    }
+
+    if args.format_output == 'email':
+        if args.smtp_server is None:
+            error_msg = 'SMTP server'
+        else:
+            config['smtp_server'] = args.smtp_server
+
+        if args.sender is None:
+            error_msg = 'sender'
+        else:
+            config['sender'] = args.sender
+
+        if args.password is None:
+            error_msg = 'password'
+        else:
+            config['password'] = args.password
+
+    if args.cc is not None:
+        config['CC'] = args.cc
+
+    if error_msg is not None:
+        print('Please specify a {} for email output'.format(error_msg))
+        return None
+
+    config['output'] = outputs[args.format_output]
+    return config
+
+
+def main():
+    '''Main entry point'''
+    parser = \
+        argparse.ArgumentParser(description=DESCRIPTION.format(s=__file__),
+                                formatter_class=RawTextHelpFormatter)
+    parser.add_argument('--format-output',
+                        choices=['terminal', 'email'],
+                        default='terminal')
+    parser.add_argument('--smtp-server')
+    parser.add_argument('--password')
+    parser.add_argument('--sender')
+    parser.add_argument('--cc')
+
+    args = parser.parse_args()
+    config = parse_config(args)
+    if config is None:
+        return
+
+    symbols = {}
+    lastlib = library = ''
+
+    output = config['output'](config)
+
+    for line in sys.stdin:
+        line = line.rstrip('\n')
+
+        if line.find('mapfile') >= 0:
+            continue
+        library, symbol, name, email = line.split(',')
+
+        if library != lastlib:
+            message = get_message(lastlib, symbols, config)
+            output.message(message)
+            symbols = {}
+
+        lastlib = library
+        symbols[symbol] = {'name': name, 'email': email}
+
+    # print the last library
+    message = get_message(lastlib, symbols, config)
+    output.message(message)
+
+
+if __name__ == '__main__':
+    main()
-- 
2.26.2


^ permalink raw reply	[relevance 5%]

* [dpdk-dev] [PATCH v11 3/3] maintainers: add new abi scripts
  2021-09-03 13:23  3% ` [dpdk-dev] [PATCH v11 " Ray Kinsella
  2021-09-03 13:23  5%   ` [dpdk-dev] [PATCH v11 1/3] devtools: script to track symbols over releases Ray Kinsella
  2021-09-03 13:23  5%   ` [dpdk-dev] [PATCH v11 2/3] devtools: script to send notifications of expired symbols Ray Kinsella
@ 2021-09-03 13:23 17%   ` Ray Kinsella
  2 siblings, 0 replies; 200+ results
From: Ray Kinsella @ 2021-09-03 13:23 UTC (permalink / raw)
  To: dev
  Cc: bruce.richardson, stephen, ferruh.yigit, thomas, ktraynor, mdr, aconole

Add new abi management scripts to the MAINTAINERS file.

Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
---
 MAINTAINERS | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 266f5ac1da..ff8245271f 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -129,6 +129,8 @@ F: devtools/gen-abi.sh
 F: devtools/libabigail.abignore
 F: devtools/update-abi.sh
 F: devtools/update_version_map_abi.py
+F: devtools/notify-symbol-maintainers.py
+F: devtools/symbol-tool.py
 F: buildtools/check-symbols.sh
 F: buildtools/map-list-symbol.sh
 F: drivers/*/*/*.map
-- 
2.26.2


^ permalink raw reply	[relevance 17%]

* Re: [dpdk-dev] [PATCH v10 2/3] devtools: script to send notifications of expired symbols
  2021-09-01 13:01  5%     ` David Marchand
@ 2021-09-03 13:28  0%       ` Kinsella, Ray
  0 siblings, 0 replies; 200+ results
From: Kinsella, Ray @ 2021-09-03 13:28 UTC (permalink / raw)
  To: David Marchand
  Cc: dev, Bruce Richardson, Stephen Hemminger, Yigit, Ferruh,
	Thomas Monjalon, Kevin Traynor, Aaron Conole

Hi David,


On 01/09/2021 14:01, David Marchand wrote:
> Hello Ray,
> 
> On Tue, Aug 31, 2021 at 4:51 PM Ray Kinsella <mdr@ashroe.eu> wrote:
>>
>> Use this script with the output of the DPDK symbol tool, to notify
>> maintainers of expired symbols by email. You need to define the environment
>> variable DPDK_GETMAINTAINER_PATH for this tool to work.
>>
>> Use terminal output to review the emails before sending.

Just realized I missed this. 

> 
> Two comments:
> - there are references of a previous name for the script,
> %s/notify_expired_symbols.py/notify-symbol-maintainers.py/g

Fixed in v11 = I used __file__ instead.

> - and a reminder for the empty report that we received yesterday.
> I think this can be reproduced with:

Yes - I remember that, I will fix in v12.

> 
> $ DPDK_GETMAINTAINER_PATH=devtools/get_maintainer.pl
> devtools/notify-symbol-maintainers.py --format-output terminal <<EOF
>> mapfile,expired (v21.08,v19.11),contributor name,contributor email
>> lib/rib,rte_rib6_get_ip,Stephen Hemminger,stephen@networkplumber.org
>> EOF
> To:Ray Kinsella <mdr@ashroe.eu>, Thomas Monjalon <thomas@monjalon.net>
> Reply-To:no-reply@dpdk.org
> Subject:Expired symbols in
> 
> Body:Hi there,
> 
> Please note the symbols listed below have expired. In line with the DPDK ABI
> policy, they should be scheduled for removal, in the next DPDK release.
> 
> For more information, please see the DPDK ABI Policy, section 3.5.3.
> https://doc.dpdk.org/guides/contributing/abi_policy.html
> 
> Thanks,
> 
> The DPDK Symbol Bot
> 
> Symbol                                            Contributor
>     Email
> 
> 
> --------------------------------------------------------------------------------
> 
> ^^^^
> Here, empty report.
> 
> To:Vladimir Medvedkin <vladimir.medvedkin@intel.com>, stephen@networkplumber.org
> Reply-To:no-reply@dpdk.org
> CC:Ray Kinsella <mdr@ashroe.eu>, Thomas Monjalon <thomas@monjalon.net>
> Subject:Expired symbols in lib/rib
> 
> Body:Hi there,
> 
> Please note the symbols listed below have expired. In line with the DPDK ABI
> policy, they should be scheduled for removal, in the next DPDK release.
> 
> For more information, please see the DPDK ABI Policy, section 3.5.3.
> https://doc.dpdk.org/guides/contributing/abi_policy.html
> 
> Thanks,
> 
> The DPDK Symbol Bot
> 
> Symbol                                            Contributor
>     Email
> rte_rib6_get_ip                                   Stephen Hemminger
>     stephen@networkplumber.org
> 
> 
> --------------------------------------------------------------------------------
> 
> 

^ permalink raw reply	[relevance 0%]

* Re: [dpdk-dev] [PATCH v10 2/3] devtools: script to send notifications of expired symbols
  2021-09-01 12:46  0%     ` Aaron Conole
  2021-09-03 11:15  0%       ` Kinsella, Ray
@ 2021-09-03 13:32  0%       ` Kinsella, Ray
  1 sibling, 0 replies; 200+ results
From: Kinsella, Ray @ 2021-09-03 13:32 UTC (permalink / raw)
  To: Aaron Conole
  Cc: dev, bruce.richardson, stephen, ferruh.yigit, thomas, ktraynor



On 01/09/2021 13:46, Aaron Conole wrote:
> Ray Kinsella <mdr@ashroe.eu> writes:
> 
>> Use this script with the output of the DPDK symbol tool, to notify
>> maintainers of expired symbols by email. You need to define the environment
>> variable DPDK_GETMAINTAINER_PATH for this tool to work.
>>
>> Use terminal output to review the emails before sending.
>> e.g.
>> $ devtools/symbol-tool.py list-expired --format-output csv \
>> | DPDK_GETMAINTAINER_PATH=<somewhere>/get_maintainer.pl \
>> devtools/notify_expired_symbols.py --format-output terminal
>>
>> Then use email output to send the emails to the maintainers.
>> e.g.
>> $ devtools/symbol-tool.py list-expired --format-output csv \
>> | DPDK_GETMAINTAINER_PATH=<somewhere>/get_maintainer.pl \
>> devtools/notify_expired_symbols.py --format-output email \
>> --smtp-server <server> --sender <someone@somewhere.com> \
>> --password <password> --cc <someone@somewhere.com>
>>
>> Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
>> ---
>>  devtools/notify-symbol-maintainers.py | 256 ++++++++++++++++++++++++++
>>  1 file changed, 256 insertions(+)
>>  create mode 100755 devtools/notify-symbol-maintainers.py
>>
>> diff --git a/devtools/notify-symbol-maintainers.py b/devtools/notify-symbol-maintainers.py
>> new file mode 100755
>> index 0000000000..ee554687ff
>> --- /dev/null
>> +++ b/devtools/notify-symbol-maintainers.py
>> @@ -0,0 +1,256 @@
>> +#!/usr/bin/env python3
>> +# SPDX-License-Identifier: BSD-3-Clause
>> +# Copyright(c) 2021 Intel Corporation
>> +# pylint: disable=invalid-name
>> +'''Tool to notify maintainers of expired symbols'''
>> +import smtplib
>> +import ssl
>> +import sys
>> +import subprocess
>> +import argparse
>> +from argparse import RawTextHelpFormatter
>> +import time
>> +from email.message import EmailMessage
>> +
>> +DESCRIPTION = '''
>> +Use this script with the output of the DPDK symbol tool, to notify maintainers
>> +and contributors of expired symbols by email. You need to define the environment
>> +variable DPDK_GETMAINTAINER_PATH for this tool to work.
>> +
>> +Use terminal output to review the emails before sending.
>> +e.g.
>> +$ devtools/symbol-tool.py list-expired --format-output csv \\
>> +| DPDK_GETMAINTAINER_PATH=<somewhere>/get_maintainer.pl \\
>> +{s} --format-output terminal
>> +
>> +Then use email output to send the emails to the maintainers.
>> +e.g.
>> +$ devtools/symbol-tool.py list-expired --format-output csv \\
>> +| DPDK_GETMAINTAINER_PATH=<somewhere>/get_maintainer.pl \\
>> +{s} --format-output email \\
>> +--smtp-server <server> --sender <someone@somewhere.com> --password <password> \\
>> +--cc <someone@somewhere.com>
>> +'''
>> +
>> +EMAIL_TEMPLATE = '''Hi there,
>> +
>> +Please note the symbols listed below have expired. In line with the DPDK ABI
>> +policy, they should be scheduled for removal, in the next DPDK release.
>> +
>> +For more information, please see the DPDK ABI Policy, section 3.5.3.
>> +https://doc.dpdk.org/guides/contributing/abi_policy.html
>> +
>> +Thanks,
>> +
>> +The DPDK Symbol Bot
>> +
>> +'''
>> +
>> +ABI_POLICY = 'doc/guides/contributing/abi_policy.rst'
>> +MAINTAINERS = 'MAINTAINERS'
>> +get_maintainer = ['devtools/get-maintainer.sh', \
>> +                  '--email', '-f']
> 
> Maybe it's best to make this something that can be overridden.  There's
> a series to change the .sh files to .py files.  Perhaps an environment
> variable or argument?
> 
>> +def _get_maintainers(libpath):
>> +    '''Get the maintainers for given library'''
>> +    try:
>> +        cmd = get_maintainer + [libpath]
>> +        result = subprocess.run(cmd, \
>> +                                stdout=subprocess.PIPE, \
>> +                                stderr=subprocess.PIPE,
>> +                                check=True)
>> +    except subprocess.CalledProcessError:
>> +        return None
> 
> You might consider handling
> 
>    except FileNotFoundError:
>       ....
> 
> With a graceful exit and error message.  In case the get_maintainers
> path changes.
> 

So FYI - this get's into the weed a bit.
As there is already a DPDK_GETMAINTAINER_PATH environment variable,
what would you call a new variable.

So instead I added logic for the script to sanity check that _everything_
is defined and where it expects it to be, and then complain loudly 
and die when it is not.

The devtools scripts already cross-reference either each, so I'd expect
any changes changing to get-maintainers.sh to get-maintainers.py to take
care of cross-references. 

Ray K


^ permalink raw reply	[relevance 0%]

* [dpdk-dev] DPDK Release Status Meeting 2021-09-02
@ 2021-09-03 16:31  3% Mcnamara, John
  0 siblings, 0 replies; 200+ results
From: Mcnamara, John @ 2021-09-03 16:31 UTC (permalink / raw)
  To: dev; +Cc: thomas, Yigit, Ferruh

Release status meeting minutes 2021-09-02
=========================================

Agenda:
* Release Dates
* Subtrees
* Roadmaps
* LTS
* Defects
* Opens

Participants:
* ARM
* Broadcom
* Canonical
* Intel
* Marvell
* Nvidia
* Red Hat


Release Dates
-------------

* v21.11 dates
  * Proposal/V1:    Friday, 10 September
  * -rc1:           Friday, 15 October
  * Release:        Friday, 19 November


Subtrees
--------

* main
  * Reviews starting

* next-net
  * Reviews ongoing
  * Reviewing Ethdev patches
  * Will pull from sub-tree today

* next-net-brcm
  * Patchset of 14 patches pending on patchwork
  * All other patches are merged into the Broadcom subtree

* next-net-intel
  - Reviews and merging ongoing

* next-net-mlx
  - PR not pulled due to comments that need to be addressed
  - New version sent today.

* next-net-mrvl
  - Some patches submitted and already pulled by Ferruh

* next-crypto
  * Started merging
  * PR ready early next week

* next-eventdev
  * Arourn 15 patches
  * Changes for API hiding (for ABI stability)

* next-virtio
  * Reviewing patches
  * Xilinx driver reviewed
  * DMA Device RFC under review
  * 30 patches on list
  * New vdpa driver


LTS
---

* v19.11 (next version is v19.11.10)
  * Awaiting test reports
  * Proposed release: Sept 6

* v20.11 (next version is v20.11.3)
  * Awaiting test reports
  * Proposed release: Sept 6

* Distros
  * v20.11 in Debian 11
  * v20.11 in Ubuntu 21.04


Defects
-------

* Bugzilla links, 'Bugs',  added for hosted projects
  - https://www.dpdk.org/hosted-projects/


Opens
-----

* Call for roadmaps
* Proposal to submit roadmaps during the release week


DPDK Release Status Meetings
----------------------------

The DPDK Release Status Meeting is intended for DPDK Committers to discuss the status of the master tree and sub-trees, and for project managers to track progress or milestone dates.

The meeting occurs on every Thursdays at 8:30 UTC. on https://meet.jit.si/DPDK

If you wish to attend just send an email to "John McNamara <john.mcnamara@intel.com>" for the invite.

^ permalink raw reply	[relevance 3%]

* [dpdk-dev] [PATCH v2 2/5] pdump: support pcapng and filtering
  @ 2021-09-03 22:06  1%   ` Stephen Hemminger
  2021-09-03 22:06  1%   ` [dpdk-dev] [PATCH v2 4/5] doc: changes for new pcapng and dumpcap Stephen Hemminger
  1 sibling, 0 replies; 200+ results
From: Stephen Hemminger @ 2021-09-03 22:06 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

This enhances the DPDK pdump library to support new
pcapng format and filtering via BPF.

The internal client/server protocol is changed to support
two versions: the original pdump basic version and a
new pcapng version.

The internal version number (not part of exposed API or ABI)
is intentionally increased to cause any attempt to try
mismatched primary/secondary process to fail.

Add new API to do allow filtering of captured packets with
DPDK BPF (eBPF) filter program. It keeps statistics
on packets captured, filtered, and missed (because ring was full).

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/meson.build       |   4 +-
 lib/pdump/meson.build |   2 +-
 lib/pdump/rte_pdump.c | 419 ++++++++++++++++++++++++++++++------------
 lib/pdump/rte_pdump.h | 110 ++++++++++-
 lib/pdump/version.map |   8 +
 5 files changed, 415 insertions(+), 128 deletions(-)

diff --git a/lib/meson.build b/lib/meson.build
index 51bf9c2d11f0..4b01949fe715 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -26,6 +26,7 @@ libraries = [
         'timer',   # eventdev depends on this
         'acl',
         'bbdev',
+        'bpf',
         'bitratestats',
         'cfgfile',
         'compressdev',
@@ -43,7 +44,6 @@ libraries = [
         'member',
         'pcapng',
         'power',
-        'pdump',
         'rawdev',
         'regexdev',
         'rib',
@@ -55,10 +55,10 @@ libraries = [
         'ipsec', # ipsec lib depends on net, crypto and security
         'fib', #fib lib depends on rib
         'port', # pkt framework libs which use other libs from above
+	'pdump', # pdump lib depends on bpf pcapng
         'table',
         'pipeline',
         'flow_classify', # flow_classify lib depends on pkt framework table lib
-        'bpf',
         'graph',
         'node',
 ]
diff --git a/lib/pdump/meson.build b/lib/pdump/meson.build
index 3a95eabde6a6..51ceb2afdec5 100644
--- a/lib/pdump/meson.build
+++ b/lib/pdump/meson.build
@@ -3,4 +3,4 @@
 
 sources = files('rte_pdump.c')
 headers = files('rte_pdump.h')
-deps += ['ethdev']
+deps += ['ethdev', 'bpf', 'pcapng']
diff --git a/lib/pdump/rte_pdump.c b/lib/pdump/rte_pdump.c
index 382217bc1564..dde536c2e047 100644
--- a/lib/pdump/rte_pdump.c
+++ b/lib/pdump/rte_pdump.c
@@ -7,8 +7,10 @@
 #include <rte_ethdev.h>
 #include <rte_lcore.h>
 #include <rte_log.h>
+#include <rte_memzone.h>
 #include <rte_errno.h>
 #include <rte_string_fns.h>
+#include <rte_pcapng.h>
 
 #include "rte_pdump.h"
 
@@ -27,30 +29,26 @@ enum pdump_operation {
 	ENABLE = 2
 };
 
+/*
+ * Note: version numbers intentionally start at 3
+ * in order to catch any application built with older out
+ * version of DPDK using incompatiable client request format.
+ */
 enum pdump_version {
-	V1 = 1
+	PDUMP_CLIENT_LEGACY = 3,
+	PDUMP_CLIENT_PCAPNG = 4,
 };
 
 struct pdump_request {
 	uint16_t ver;
 	uint16_t op;
-	uint32_t flags;
-	union pdump_data {
-		struct enable_v1 {
-			char device[RTE_DEV_NAME_MAX_LEN];
-			uint16_t queue;
-			struct rte_ring *ring;
-			struct rte_mempool *mp;
-			void *filter;
-		} en_v1;
-		struct disable_v1 {
-			char device[RTE_DEV_NAME_MAX_LEN];
-			uint16_t queue;
-			struct rte_ring *ring;
-			struct rte_mempool *mp;
-			void *filter;
-		} dis_v1;
-	} data;
+	uint16_t flags;
+	uint16_t queue;
+	struct rte_ring *ring;
+	struct rte_mempool *mp;
+	const struct rte_bpf *filter;
+	uint32_t snaplen;
+	char device[RTE_DEV_NAME_MAX_LEN];
 };
 
 struct pdump_response {
@@ -63,80 +61,137 @@ static struct pdump_rxtx_cbs {
 	struct rte_ring *ring;
 	struct rte_mempool *mp;
 	const struct rte_eth_rxtx_callback *cb;
-	void *filter;
+	const struct rte_bpf *filter;
+	enum pdump_version ver;
+	uint32_t snaplen;
 } rx_cbs[RTE_MAX_ETHPORTS][RTE_MAX_QUEUES_PER_PORT],
 tx_cbs[RTE_MAX_ETHPORTS][RTE_MAX_QUEUES_PER_PORT];
 
-
-static inline void
-pdump_copy(struct rte_mbuf **pkts, uint16_t nb_pkts, void *user_params)
+static const char *MZ_RTE_PDUMP_STATS = "rte_pdump_stats";
+
+/* Shared memory between primary and secondary processes. */
+static struct {
+	struct rte_pdump_stats rx[RTE_MAX_ETHPORTS][RTE_MAX_QUEUES_PER_PORT];
+	struct rte_pdump_stats tx[RTE_MAX_ETHPORTS][RTE_MAX_QUEUES_PER_PORT];
+} *pdump_stats;
+
+/* Create a clone of mbuf to be placed into ring. */
+static void
+pdump_copy(uint16_t port_id, uint16_t queue,
+	   enum rte_pcapng_direction direction,
+	   struct rte_mbuf **pkts, uint16_t nb_pkts,
+	   const struct pdump_rxtx_cbs *cbs,
+	   struct rte_pdump_stats *stats)
 {
 	unsigned int i;
 	int ring_enq;
 	uint16_t d_pkts = 0;
 	struct rte_mbuf *dup_bufs[nb_pkts];
-	struct pdump_rxtx_cbs *cbs;
+	uint64_t ts;
 	struct rte_ring *ring;
 	struct rte_mempool *mp;
 	struct rte_mbuf *p;
+	uint64_t bpf_rc[nb_pkts];
+
+	if (cbs->filter &&
+	    !rte_bpf_exec_burst(cbs->filter, (void **)pkts, bpf_rc, nb_pkts)) {
+		/* All packets were filtered out */
+		__atomic_fetch_add(&stats->filtered, nb_pkts, __ATOMIC_RELAXED);
+		return;
+	}
 
-	cbs  = user_params;
+	ts = rte_get_tsc_cycles();
 	ring = cbs->ring;
 	mp = cbs->mp;
 	for (i = 0; i < nb_pkts; i++) {
-		p = rte_pktmbuf_copy(pkts[i], mp, 0, UINT32_MAX);
-		if (p)
+		/*
+		 * Similar behavior to rte_bpf_eth callback.
+		 * if BPF program returns zero value for a given packet,
+		 * then it will be ignored.
+		 */
+		if (cbs->filter && bpf_rc[i] == 0) {
+			__atomic_fetch_add(&stats->filtered,
+					   1, __ATOMIC_RELAXED);
+			continue;
+		}
+
+		/*
+		 * If using pcapng then want to wrap packets
+		 * otherwise a simple copy.
+		 */
+		if (cbs->ver == PDUMP_CLIENT_PCAPNG)
+			p = rte_pcapng_copy(port_id, queue,
+					    pkts[i], mp, cbs->snaplen,
+					    ts, direction);
+		else
+			p = rte_pktmbuf_copy(pkts[i], mp, 0, cbs->snaplen);
+
+		if (unlikely(p == NULL))
+			__atomic_fetch_add(&stats->nombuf, 1, __ATOMIC_RELAXED);
+		else
 			dup_bufs[d_pkts++] = p;
 	}
 
+	__atomic_fetch_add(&stats->accepted, d_pkts, __ATOMIC_RELAXED);
+
 	ring_enq = rte_ring_enqueue_burst(ring, (void *)dup_bufs, d_pkts, NULL);
 	if (unlikely(ring_enq < d_pkts)) {
 		unsigned int drops = d_pkts - ring_enq;
 
-		PDUMP_LOG(DEBUG,
-			"only %d of packets enqueued to ring\n", ring_enq);
+		__atomic_fetch_add(&stats->ringfull, drops, __ATOMIC_RELAXED);
 		rte_pktmbuf_free_bulk(&dup_bufs[ring_enq], drops);
 	}
 }
 
 static uint16_t
-pdump_rx(uint16_t port __rte_unused, uint16_t qidx __rte_unused,
+pdump_rx(uint16_t port, uint16_t queue,
 	struct rte_mbuf **pkts, uint16_t nb_pkts,
-	uint16_t max_pkts __rte_unused,
-	void *user_params)
+	uint16_t max_pkts __rte_unused, void *user_params)
 {
-	pdump_copy(pkts, nb_pkts, user_params);
+	const struct pdump_rxtx_cbs *cbs = user_params;
+	struct rte_pdump_stats *stats = &pdump_stats->rx[port][queue];
+
+	pdump_copy(port, queue, RTE_PCAPNG_DIRECTION_IN,
+		   pkts, nb_pkts, cbs, stats);
 	return nb_pkts;
 }
 
 static uint16_t
-pdump_tx(uint16_t port __rte_unused, uint16_t qidx __rte_unused,
+pdump_tx(uint16_t port, uint16_t queue,
 		struct rte_mbuf **pkts, uint16_t nb_pkts, void *user_params)
 {
-	pdump_copy(pkts, nb_pkts, user_params);
+	const struct pdump_rxtx_cbs *cbs = user_params;
+	struct rte_pdump_stats *stats = &pdump_stats->tx[port][queue];
+
+	pdump_copy(port, queue, RTE_PCAPNG_DIRECTION_OUT,
+		   pkts, nb_pkts, cbs, stats);
 	return nb_pkts;
 }
 
 static int
-pdump_register_rx_callbacks(uint16_t end_q, uint16_t port, uint16_t queue,
-				struct rte_ring *ring, struct rte_mempool *mp,
-				uint16_t operation)
+pdump_register_rx_callbacks(enum pdump_version ver,
+			    uint16_t end_q, uint16_t port, uint16_t queue,
+			    struct rte_ring *ring, struct rte_mempool *mp,
+			    uint16_t operation, uint32_t snaplen)
 {
 	uint16_t qid;
-	struct pdump_rxtx_cbs *cbs = NULL;
 
 	qid = (queue == RTE_PDUMP_ALL_QUEUES) ? 0 : queue;
 	for (; qid < end_q; qid++) {
-		cbs = &rx_cbs[port][qid];
-		if (cbs && operation == ENABLE) {
+		struct pdump_rxtx_cbs *cbs = &rx_cbs[port][qid];
+
+		if (operation == ENABLE) {
 			if (cbs->cb) {
 				PDUMP_LOG(ERR,
 					"rx callback for port=%d queue=%d, already exists\n",
 					port, qid);
 				return -EEXIST;
 			}
+			cbs->ver = ver;
 			cbs->ring = ring;
 			cbs->mp = mp;
+			cbs->snaplen = snaplen;
+
 			cbs->cb = rte_eth_add_first_rx_callback(port, qid,
 								pdump_rx, cbs);
 			if (cbs->cb == NULL) {
@@ -145,8 +200,7 @@ pdump_register_rx_callbacks(uint16_t end_q, uint16_t port, uint16_t queue,
 					rte_errno);
 				return rte_errno;
 			}
-		}
-		if (cbs && operation == DISABLE) {
+		} else if (operation == DISABLE) {
 			int ret;
 
 			if (cbs->cb == NULL) {
@@ -170,26 +224,30 @@ pdump_register_rx_callbacks(uint16_t end_q, uint16_t port, uint16_t queue,
 }
 
 static int
-pdump_register_tx_callbacks(uint16_t end_q, uint16_t port, uint16_t queue,
-				struct rte_ring *ring, struct rte_mempool *mp,
-				uint16_t operation)
+pdump_register_tx_callbacks(enum pdump_version ver,
+			    uint16_t end_q, uint16_t port, uint16_t queue,
+			    struct rte_ring *ring, struct rte_mempool *mp,
+			    uint16_t operation, uint32_t snaplen)
 {
 
 	uint16_t qid;
-	struct pdump_rxtx_cbs *cbs = NULL;
 
 	qid = (queue == RTE_PDUMP_ALL_QUEUES) ? 0 : queue;
 	for (; qid < end_q; qid++) {
-		cbs = &tx_cbs[port][qid];
-		if (cbs && operation == ENABLE) {
+		struct pdump_rxtx_cbs *cbs = &tx_cbs[port][qid];
+
+		if (operation == ENABLE) {
 			if (cbs->cb) {
 				PDUMP_LOG(ERR,
 					"tx callback for port=%d queue=%d, already exists\n",
 					port, qid);
 				return -EEXIST;
 			}
+			cbs->ver = ver;
 			cbs->ring = ring;
 			cbs->mp = mp;
+			cbs->snaplen = snaplen;
+
 			cbs->cb = rte_eth_add_tx_callback(port, qid, pdump_tx,
 								cbs);
 			if (cbs->cb == NULL) {
@@ -198,8 +256,7 @@ pdump_register_tx_callbacks(uint16_t end_q, uint16_t port, uint16_t queue,
 					rte_errno);
 				return rte_errno;
 			}
-		}
-		if (cbs && operation == DISABLE) {
+		} else if (operation == DISABLE) {
 			int ret;
 
 			if (cbs->cb == NULL) {
@@ -233,32 +290,25 @@ set_pdump_rxtx_cbs(const struct pdump_request *p)
 	struct rte_ring *ring;
 	struct rte_mempool *mp;
 
+	if (!(p->ver == PDUMP_CLIENT_LEGACY ||
+	      p->ver == PDUMP_CLIENT_PCAPNG)) {
+		PDUMP_LOG(ERR,
+			  "incorrect client version %u\n", p->ver);
+		return -EINVAL;
+	}
+
 	flags = p->flags;
 	operation = p->op;
-	if (operation == ENABLE) {
-		ret = rte_eth_dev_get_port_by_name(p->data.en_v1.device,
-				&port);
-		if (ret < 0) {
-			PDUMP_LOG(ERR,
-				"failed to get port id for device id=%s\n",
-				p->data.en_v1.device);
-			return -EINVAL;
-		}
-		queue = p->data.en_v1.queue;
-		ring = p->data.en_v1.ring;
-		mp = p->data.en_v1.mp;
-	} else {
-		ret = rte_eth_dev_get_port_by_name(p->data.dis_v1.device,
-				&port);
-		if (ret < 0) {
-			PDUMP_LOG(ERR,
-				"failed to get port id for device id=%s\n",
-				p->data.dis_v1.device);
-			return -EINVAL;
-		}
-		queue = p->data.dis_v1.queue;
-		ring = p->data.dis_v1.ring;
-		mp = p->data.dis_v1.mp;
+	queue = p->queue;
+	ring = p->ring;
+	mp = p->mp;
+
+	ret = rte_eth_dev_get_port_by_name(p->device, &port);
+	if (ret < 0) {
+		PDUMP_LOG(ERR,
+			  "failed to get port id for device id=%s\n",
+			  p->device);
+		return -EINVAL;
 	}
 
 	/* validation if packet capture is for all queues */
@@ -296,8 +346,8 @@ set_pdump_rxtx_cbs(const struct pdump_request *p)
 	/* register RX callback */
 	if (flags & RTE_PDUMP_FLAG_RX) {
 		end_q = (queue == RTE_PDUMP_ALL_QUEUES) ? nb_rx_q : queue + 1;
-		ret = pdump_register_rx_callbacks(end_q, port, queue, ring, mp,
-							operation);
+		ret = pdump_register_rx_callbacks(p->ver, end_q, port, queue, ring, mp,
+						  operation, p->snaplen);
 		if (ret < 0)
 			return ret;
 	}
@@ -305,8 +355,8 @@ set_pdump_rxtx_cbs(const struct pdump_request *p)
 	/* register TX callback */
 	if (flags & RTE_PDUMP_FLAG_TX) {
 		end_q = (queue == RTE_PDUMP_ALL_QUEUES) ? nb_tx_q : queue + 1;
-		ret = pdump_register_tx_callbacks(end_q, port, queue, ring, mp,
-							operation);
+		ret = pdump_register_tx_callbacks(p->ver, end_q, port, queue, ring, mp,
+						  operation, p->snaplen);
 		if (ret < 0)
 			return ret;
 	}
@@ -347,8 +397,20 @@ pdump_server(const struct rte_mp_msg *mp_msg, const void *peer)
 int
 rte_pdump_init(void)
 {
+	const struct rte_memzone *mz;
 	int ret;
 
+	mz = rte_memzone_reserve(MZ_RTE_PDUMP_STATS, sizeof(*pdump_stats),
+				 rte_socket_id(), 0);
+	if (mz == NULL) {
+		PDUMP_LOG(ERR, "cannot allocate pdump statistics\n");
+		rte_errno = ENOMEM;
+		return -1;
+	}
+	pdump_stats = mz->addr;
+
+	rte_pcapng_init();
+
 	ret = rte_mp_action_register(PDUMP_MP, pdump_server);
 	if (ret && rte_errno != ENOTSUP)
 		return -1;
@@ -392,14 +454,21 @@ pdump_validate_ring_mp(struct rte_ring *ring, struct rte_mempool *mp)
 static int
 pdump_validate_flags(uint32_t flags)
 {
-	if (flags != RTE_PDUMP_FLAG_RX && flags != RTE_PDUMP_FLAG_TX &&
-		flags != RTE_PDUMP_FLAG_RXTX) {
+	if ((flags & RTE_PDUMP_FLAG_RXTX) == 0) {
 		PDUMP_LOG(ERR,
 			"invalid flags, should be either rx/tx/rxtx\n");
 		rte_errno = EINVAL;
 		return -1;
 	}
 
+	/* mask off the flags we know about */
+	if (flags & ~(RTE_PDUMP_FLAG_RXTX | RTE_PDUMP_FLAG_PCAPNG)) {
+		PDUMP_LOG(ERR,
+			  "unknown flags: %#x\n", flags);
+		rte_errno = ENOTSUP;
+		return -1;
+	}
+
 	return 0;
 }
 
@@ -426,12 +495,12 @@ pdump_validate_port(uint16_t port, char *name)
 }
 
 static int
-pdump_prepare_client_request(char *device, uint16_t queue,
-				uint32_t flags,
-				uint16_t operation,
-				struct rte_ring *ring,
-				struct rte_mempool *mp,
-				void *filter)
+pdump_prepare_client_request(const char *device, uint16_t queue,
+			     uint32_t flags, uint32_t snaplen,
+			     uint16_t operation,
+			     struct rte_ring *ring,
+			     struct rte_mempool *mp,
+			     const struct rte_bpf *filter)
 {
 	int ret = -1;
 	struct rte_mp_msg mp_req, *mp_rep;
@@ -440,23 +509,23 @@ pdump_prepare_client_request(char *device, uint16_t queue,
 	struct pdump_request *req = (struct pdump_request *)mp_req.param;
 	struct pdump_response *resp;
 
-	req->ver = 1;
-	req->flags = flags;
+	memset(req, 0, sizeof(*req));
+	if (flags & RTE_PDUMP_FLAG_PCAPNG)
+		req->ver = PDUMP_CLIENT_PCAPNG;
+	else
+		req->ver = PDUMP_CLIENT_LEGACY;
+
+	req->flags = flags & RTE_PDUMP_FLAG_RXTX;
 	req->op = operation;
+	req->queue = queue;
+	strlcpy(req->device, device,sizeof(req->device));
+
 	if ((operation & ENABLE) != 0) {
-		strlcpy(req->data.en_v1.device, device,
-			sizeof(req->data.en_v1.device));
-		req->data.en_v1.queue = queue;
-		req->data.en_v1.ring = ring;
-		req->data.en_v1.mp = mp;
-		req->data.en_v1.filter = filter;
-	} else {
-		strlcpy(req->data.dis_v1.device, device,
-			sizeof(req->data.dis_v1.device));
-		req->data.dis_v1.queue = queue;
-		req->data.dis_v1.ring = NULL;
-		req->data.dis_v1.mp = NULL;
-		req->data.dis_v1.filter = NULL;
+		req->queue = queue;
+		req->ring = ring;
+		req->mp = mp;
+		req->filter = filter;
+		req->snaplen = snaplen;
 	}
 
 	strlcpy(mp_req.name, PDUMP_MP, RTE_MP_MAX_NAME_LEN);
@@ -477,11 +546,17 @@ pdump_prepare_client_request(char *device, uint16_t queue,
 	return ret;
 }
 
-int
-rte_pdump_enable(uint16_t port, uint16_t queue, uint32_t flags,
-			struct rte_ring *ring,
-			struct rte_mempool *mp,
-			void *filter)
+/*
+ * There are two versions of this function, because although original API
+ * left place holder for future filter, it never checked the value.
+ * Therefore the API can't depend on application passing a non
+ * bogus value.
+ */
+static int
+pdump_enable(uint16_t port, uint16_t queue,
+	     uint32_t flags, uint32_t snaplen,
+	     struct rte_ring *ring, struct rte_mempool *mp,
+	     const struct rte_bpf *filter)
 {
 	int ret;
 	char name[RTE_DEV_NAME_MAX_LEN];
@@ -496,20 +571,42 @@ rte_pdump_enable(uint16_t port, uint16_t queue, uint32_t flags,
 	if (ret < 0)
 		return ret;
 
-	ret = pdump_prepare_client_request(name, queue, flags,
-						ENABLE, ring, mp, filter);
+	if (snaplen == 0)
+		snaplen = UINT32_MAX;
 
-	return ret;
+	return pdump_prepare_client_request(name, queue, flags, snaplen,
+					    ENABLE, ring, mp, filter);
 }
 
 int
-rte_pdump_enable_by_deviceid(char *device_id, uint16_t queue,
-				uint32_t flags,
-				struct rte_ring *ring,
-				struct rte_mempool *mp,
-				void *filter)
+rte_pdump_enable(uint16_t port, uint16_t queue, uint32_t flags,
+		 struct rte_ring *ring,
+		 struct rte_mempool *mp,
+		 void *filter __rte_unused)
 {
-	int ret = 0;
+	return pdump_enable(port, queue, flags, 0,
+			    ring, mp, NULL);
+}
+
+int
+rte_pdump_enable_bpf(uint16_t port, uint16_t queue,
+		     uint32_t flags, uint32_t snaplen,
+		     struct rte_ring *ring,
+		     struct rte_mempool *mp,
+		     const struct rte_bpf *filter)
+{
+	return pdump_enable(port, queue, flags, snaplen,
+			    ring, mp, filter);
+}
+
+static int
+pdump_enable_by_deviceid(const char *device_id, uint16_t queue,
+			 uint32_t flags, uint32_t snaplen,
+			 struct rte_ring *ring,
+			 struct rte_mempool *mp,
+			 const struct rte_bpf *filter)
+{
+	int ret;
 
 	ret = pdump_validate_ring_mp(ring, mp);
 	if (ret < 0)
@@ -518,10 +615,30 @@ rte_pdump_enable_by_deviceid(char *device_id, uint16_t queue,
 	if (ret < 0)
 		return ret;
 
-	ret = pdump_prepare_client_request(device_id, queue, flags,
-						ENABLE, ring, mp, filter);
+	return pdump_prepare_client_request(device_id, queue, flags, snaplen,
+					    ENABLE, ring, mp, filter);
+}
 
-	return ret;
+int
+rte_pdump_enable_by_deviceid(char *device_id, uint16_t queue,
+			     uint32_t flags,
+			     struct rte_ring *ring,
+			     struct rte_mempool *mp,
+			     void *filter __rte_unused)
+{
+	return pdump_enable_by_deviceid(device_id, queue, flags, 0,
+					ring, mp, NULL);
+}
+
+int
+rte_pdump_enable_bpf_by_deviceid(const char *device_id, uint16_t queue,
+				 uint32_t flags, uint32_t snaplen,
+				 struct rte_ring *ring,
+				 struct rte_mempool *mp,
+				 const struct rte_bpf *filter)
+{
+	return pdump_enable_by_deviceid(device_id, queue, flags, snaplen,
+					ring, mp, filter);
 }
 
 int
@@ -537,8 +654,8 @@ rte_pdump_disable(uint16_t port, uint16_t queue, uint32_t flags)
 	if (ret < 0)
 		return ret;
 
-	ret = pdump_prepare_client_request(name, queue, flags,
-						DISABLE, NULL, NULL, NULL);
+	ret = pdump_prepare_client_request(name, queue, flags, 0,
+					   DISABLE, NULL, NULL, NULL);
 
 	return ret;
 }
@@ -553,8 +670,66 @@ rte_pdump_disable_by_deviceid(char *device_id, uint16_t queue,
 	if (ret < 0)
 		return ret;
 
-	ret = pdump_prepare_client_request(device_id, queue, flags,
-						DISABLE, NULL, NULL, NULL);
+	ret = pdump_prepare_client_request(device_id, queue, flags, 0,
+					   DISABLE, NULL, NULL, NULL);
 
 	return ret;
 }
+
+static void
+pdump_sum_stats(uint16_t port, uint16_t nq,
+		const struct rte_pdump_stats stats[RTE_MAX_ETHPORTS][RTE_MAX_QUEUES_PER_PORT],
+		struct rte_pdump_stats *total)
+{
+	uint64_t *sum = (uint64_t *)total;
+	unsigned int i;
+	uint64_t val;
+	uint16_t qid;
+
+	for (qid = 0; qid < nq; qid++) {
+		const uint64_t *perq = (const uint64_t *)&stats[port][qid];
+
+		for (i = 0; i < sizeof(*total) / sizeof (uint64_t); i++) {
+			val = __atomic_load_n(&perq[i], __ATOMIC_RELAXED);
+			sum[i] += val;
+		}
+	}
+}
+
+int
+rte_pdump_stats(uint16_t port, struct rte_pdump_stats *stats)
+{
+	struct rte_eth_dev_info dev_info;
+	const struct rte_memzone *mz;
+	int ret;
+
+	memset(stats, 0, sizeof(*stats));
+	ret = rte_eth_dev_info_get(port, &dev_info);
+	if (ret != 0) {
+		PDUMP_LOG(ERR,
+			  "Error during getting device (port %u) info: %s\n",
+			  port, strerror(-ret));
+		return ret;
+	}
+
+	if (pdump_stats == NULL) {
+		if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
+			PDUMP_LOG(ERR,
+				  "pdump not initialized\n");
+			rte_errno = EINVAL;
+			return -1;
+		}
+
+		mz = rte_memzone_lookup(MZ_RTE_PDUMP_STATS);
+		if (mz == NULL) {
+			PDUMP_LOG(ERR, "cannont find pdump stats\n");
+			rte_errno = EINVAL;
+			return -1;
+		}
+		pdump_stats = mz->addr;
+	}
+
+	pdump_sum_stats(port, dev_info.nb_rx_queues, pdump_stats->rx, stats);
+	pdump_sum_stats(port, dev_info.nb_tx_queues, pdump_stats->tx, stats);
+	return 0;
+}
diff --git a/lib/pdump/rte_pdump.h b/lib/pdump/rte_pdump.h
index 6b00fc17aeb2..03320f5ac2ab 100644
--- a/lib/pdump/rte_pdump.h
+++ b/lib/pdump/rte_pdump.h
@@ -15,6 +15,7 @@
 #include <stdint.h>
 #include <rte_mempool.h>
 #include <rte_ring.h>
+#include <rte_bpf.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -26,7 +27,9 @@ enum {
 	RTE_PDUMP_FLAG_RX = 1,  /* receive direction */
 	RTE_PDUMP_FLAG_TX = 2,  /* transmit direction */
 	/* both receive and transmit directions */
-	RTE_PDUMP_FLAG_RXTX = (RTE_PDUMP_FLAG_RX|RTE_PDUMP_FLAG_TX)
+	RTE_PDUMP_FLAG_RXTX = (RTE_PDUMP_FLAG_RX|RTE_PDUMP_FLAG_TX),
+
+	RTE_PDUMP_FLAG_PCAPNG = 4, /* format for pcapng */
 };
 
 /**
@@ -68,7 +71,7 @@ rte_pdump_uninit(void);
  * @param mp
  *  mempool on to which original packets will be mirrored or duplicated.
  * @param filter
- *  place holder for packet filtering.
+ *  Unused should be NULL.
  *
  * @return
  *    0 on success, -1 on error, rte_errno is set accordingly.
@@ -80,6 +83,41 @@ rte_pdump_enable(uint16_t port, uint16_t queue, uint32_t flags,
 		struct rte_mempool *mp,
 		void *filter);
 
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
+ *
+ * Enables packet capturing on given port and queue with filtering.
+ *
+ * @param port_id
+ *  The Ethernet port on which packet capturing should be enabled.
+ * @param queue
+ *  The queue on the Ethernet port which packet capturing
+ *  should be enabled. Pass UINT16_MAX to enable packet capturing on all
+ *  queues of a given port.
+ * @param flags
+ *  Pdump library flags that specify direction and packet format.
+ * @param snaplen
+ *  The upper limit on bytes to copy.
+ *  Passing UINT32_MAX means capture all the possible data.
+ * @param ring
+ *  The ring on which captured packets will be enqueued for user.
+ * @param mp
+ *  The mempool on to which original packets will be mirrored or duplicated.
+ * @param filter
+ *  Use BPF filter to run to filter packes (can be NULL)
+ *
+ * @return
+ *    0 on success, -1 on error, rte_errno is set accordingly.
+ */
+__rte_experimental
+int
+rte_pdump_enable_bpf(uint16_t port_id, uint16_t queue,
+		     uint32_t flags, uint32_t snaplen,
+		     struct rte_ring *ring,
+		     struct rte_mempool *mp,
+		     const struct rte_bpf *filter);
+
 /**
  * Disables packet capturing on given port and queue.
  *
@@ -118,7 +156,7 @@ rte_pdump_disable(uint16_t port, uint16_t queue, uint32_t flags);
  * @param mp
  *  mempool on to which original packets will be mirrored or duplicated.
  * @param filter
- *  place holder for packet filtering.
+ *  unused should be NULL
  *
  * @return
  *    0 on success, -1 on error, rte_errno is set accordingly.
@@ -131,6 +169,43 @@ rte_pdump_enable_by_deviceid(char *device_id, uint16_t queue,
 				struct rte_mempool *mp,
 				void *filter);
 
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
+ *
+ * Enables packet capturing on given device id and queue with filtering.
+ * device_id can be name or pci address of device.
+ *
+ * @param device_id
+ *  device id on which packet capturing should be enabled.
+ * @param queue
+ *  The queue on the Ethernet port which packet capturing
+ *  should be enabled. Pass UINT16_MAX to enable packet capturing on all
+ *  queues of a given port.
+ * @param flags
+ *  Pdump library flags that specify direction and packet format.
+ * @param snaplen
+ *  The upper limit on bytes to copy.
+ *  Passing UINT32_MAX means capture all the possible data.
+ * @param ring
+ *  The ring on which captured packets will be enqueued for user.
+ * @param mp
+ *  The mempool on to which original packets will be mirrored or duplicated.
+ * @param filter
+ *  Use BPF filter to run to filter packes (can be NULL)
+ *
+ * @return
+ *    0 on success, -1 on error, rte_errno is set accordingly.
+ */
+__rte_experimental
+int
+rte_pdump_enable_bpf_by_deviceid(const char *device_id, uint16_t queue,
+				 uint32_t flags, uint32_t snaplen,
+				 struct rte_ring *ring,
+				 struct rte_mempool *mp,
+				 const struct rte_bpf *filter);
+
+
 /**
  * Disables packet capturing on given device_id and queue.
  * device_id can be name or pci address of device.
@@ -153,6 +228,35 @@ int
 rte_pdump_disable_by_deviceid(char *device_id, uint16_t queue,
 				uint32_t flags);
 
+
+/**
+ * A structure used to retrieve statistics from packet capture.
+ * The statistics are sum of both receive and transmit queues.
+ */
+struct rte_pdump_stats {
+	uint64_t accepted; /**< Number of packets accepted by filter. */
+	uint64_t filtered; /**< Number of packets rejected by filter. */
+	uint64_t nombuf;   /**< Number of mbuf allocation failures. */
+	uint64_t ringfull; /**< Number of missed packets due to ring full. */
+
+	uint64_t reserved[4]; /**< Reserved and pad to cache line */
+};
+
+/**
+ * Retrieve the packet capture statistics for a queue.
+ *
+ * @param port_id
+ *   The port identifier of the Ethernet device.
+ * @param stats
+ *   A pointer to structure of type *rte_pdump_stats* to be filled in.
+ * @return
+ *   Zero if successful. -1 on error and rte_errno is set.
+ */
+__rte_experimental
+int
+rte_pdump_stats(uint16_t port_id, struct rte_pdump_stats *stats);
+
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/lib/pdump/version.map b/lib/pdump/version.map
index f0a9d12c9a9e..ce5502d9cdf4 100644
--- a/lib/pdump/version.map
+++ b/lib/pdump/version.map
@@ -10,3 +10,11 @@ DPDK_22 {
 
 	local: *;
 };
+
+EXPERIMENTAL {
+	global:
+
+	rte_pdump_enable_bpf;
+	rte_pdump_enable_bpf_by_deviceid;
+	rte_pdump_stats;
+};
-- 
2.30.2


^ permalink raw reply	[relevance 1%]

* [dpdk-dev] [PATCH v2 4/5] doc: changes for new pcapng and dumpcap
    2021-09-03 22:06  1%   ` [dpdk-dev] [PATCH v2 2/5] pdump: support pcapng and filtering Stephen Hemminger
@ 2021-09-03 22:06  1%   ` Stephen Hemminger
  1 sibling, 0 replies; 200+ results
From: Stephen Hemminger @ 2021-09-03 22:06 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

Describe the new packet capture library and utilities

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 doc/api/doxy-api-index.md                     |  1 +
 doc/api/doxy-api.conf.in                      |  1 +
 .../howto/img/packet_capture_framework.svg    | 96 +++++++++----------
 doc/guides/howto/packet_capture_framework.rst | 67 ++++++-------
 doc/guides/prog_guide/index.rst               |  1 +
 doc/guides/prog_guide/pcapng_lib.rst          | 24 +++++
 doc/guides/prog_guide/pdump_lib.rst           | 28 ++++--
 doc/guides/rel_notes/release_21_11.rst        | 10 ++
 doc/guides/tools/dumpcap.rst                  | 80 ++++++++++++++++
 doc/guides/tools/index.rst                    |  1 +
 10 files changed, 222 insertions(+), 87 deletions(-)
 create mode 100644 doc/guides/prog_guide/pcapng_lib.rst
 create mode 100644 doc/guides/tools/dumpcap.rst

diff --git a/doc/api/doxy-api-index.md b/doc/api/doxy-api-index.md
index 1992107a0356..ee07394d1c78 100644
--- a/doc/api/doxy-api-index.md
+++ b/doc/api/doxy-api-index.md
@@ -223,3 +223,4 @@ The public API headers are grouped by topics:
   [experimental APIs]  (@ref rte_compat.h),
   [ABI versioning]     (@ref rte_function_versioning.h),
   [version]            (@ref rte_version.h)
+  [pcapng]             (@ref rte_pcapng.h)
diff --git a/doc/api/doxy-api.conf.in b/doc/api/doxy-api.conf.in
index 325a0195c6ab..aba17799a9a1 100644
--- a/doc/api/doxy-api.conf.in
+++ b/doc/api/doxy-api.conf.in
@@ -58,6 +58,7 @@ INPUT                   = @TOPDIR@/doc/api/doxy-api-index.md \
                           @TOPDIR@/lib/metrics \
                           @TOPDIR@/lib/node \
                           @TOPDIR@/lib/net \
+                          @TOPDIR@/lib/pcapng \
                           @TOPDIR@/lib/pci \
                           @TOPDIR@/lib/pdump \
                           @TOPDIR@/lib/pipeline \
diff --git a/doc/guides/howto/img/packet_capture_framework.svg b/doc/guides/howto/img/packet_capture_framework.svg
index a76baf71fdee..1c2646a81096 100644
--- a/doc/guides/howto/img/packet_capture_framework.svg
+++ b/doc/guides/howto/img/packet_capture_framework.svg
@@ -1,6 +1,4 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
 <svg
    xmlns:osb="http://www.openswatchbook.org/uri/2009/osb"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
@@ -16,8 +14,8 @@
    viewBox="0 0 425.19685 283.46457"
    id="svg2"
    version="1.1"
-   inkscape:version="0.91 r13725"
-   sodipodi:docname="drawing-pcap.svg">
+   inkscape:version="1.0.2 (e86c870879, 2021-01-15)"
+   sodipodi:docname="packet_capture_framework.svg">
   <defs
      id="defs4">
     <marker
@@ -228,7 +226,7 @@
        x2="487.64606"
        y2="258.38232"
        gradientUnits="userSpaceOnUse"
-       gradientTransform="translate(-84.916417,744.90779)" />
+       gradientTransform="matrix(1.1457977,0,0,0.99944907,-151.97019,745.05014)" />
     <linearGradient
        inkscape:collect="always"
        xlink:href="#linearGradient5784"
@@ -277,17 +275,18 @@
      borderopacity="1.0"
      inkscape:pageopacity="0.0"
      inkscape:pageshadow="2"
-     inkscape:zoom="0.57434918"
-     inkscape:cx="215.17857"
-     inkscape:cy="285.26445"
+     inkscape:zoom="1"
+     inkscape:cx="226.77165"
+     inkscape:cy="78.124511"
      inkscape:document-units="px"
      inkscape:current-layer="layer1"
      showgrid="false"
-     inkscape:window-width="1874"
-     inkscape:window-height="971"
-     inkscape:window-x="2"
-     inkscape:window-y="24"
-     inkscape:window-maximized="0" />
+     inkscape:window-width="2560"
+     inkscape:window-height="1414"
+     inkscape:window-x="0"
+     inkscape:window-y="0"
+     inkscape:window-maximized="1"
+     inkscape:document-rotation="0" />
   <metadata
      id="metadata7">
     <rdf:RDF>
@@ -296,7 +295,7 @@
         <dc:format>image/svg+xml</dc:format>
         <dc:type
            rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
-        <dc:title></dc:title>
+        <dc:title />
       </cc:Work>
     </rdf:RDF>
   </metadata>
@@ -321,15 +320,15 @@
        y="790.82452" />
     <text
        xml:space="preserve"
-       style="font-style:normal;font-weight:normal;font-size:12.5px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
        x="61.050636"
        y="807.3205"
-       id="text4152"
-       sodipodi:linespacing="125%"><tspan
+       id="text4152"><tspan
          sodipodi:role="line"
          id="tspan4154"
          x="61.050636"
-         y="807.3205">DPDK Primary Application</tspan></text>
+         y="807.3205"
+         style="font-size:12.5px;line-height:1.25">DPDK Primary Application</tspan></text>
     <rect
        style="fill:#000000;fill-opacity:0;stroke:#257cdc;stroke-width:2;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
        id="rect4156-6"
@@ -339,19 +338,20 @@
        y="827.01843" />
     <text
        xml:space="preserve"
-       style="font-style:normal;font-weight:normal;font-size:12.5px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
        x="350.68585"
        y="841.16058"
-       id="text4189"
-       sodipodi:linespacing="125%"><tspan
+       id="text4189"><tspan
          sodipodi:role="line"
          id="tspan4191"
          x="350.68585"
-         y="841.16058">dpdk-pdump</tspan><tspan
+         y="841.16058"
+         style="font-size:12.5px;line-height:1.25">dpdk-dumpcap</tspan><tspan
          sodipodi:role="line"
          x="350.68585"
          y="856.78558"
-         id="tspan4193">tool</tspan></text>
+         id="tspan4193"
+         style="font-size:12.5px;line-height:1.25">tool</tspan></text>
     <rect
        style="fill:#000000;fill-opacity:0;stroke:#257cdc;stroke-width:2;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
        id="rect4156-6-4"
@@ -361,15 +361,15 @@
        y="891.16315" />
     <text
        xml:space="preserve"
-       style="font-style:normal;font-weight:normal;font-size:12.5px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
        x="352.70612"
        y="905.3053"
-       id="text4189-1"
-       sodipodi:linespacing="125%"><tspan
+       id="text4189-1"><tspan
          sodipodi:role="line"
          x="352.70612"
          y="905.3053"
-         id="tspan4193-3">PCAP PMD</tspan></text>
+         id="tspan4193-3"
+         style="font-size:12.5px;line-height:1.25">librte_pcapng</tspan></text>
     <rect
        style="fill:url(#linearGradient5745);fill-opacity:1;stroke:#257cdc;stroke-width:2;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
        id="rect4156-6-6"
@@ -379,15 +379,15 @@
        y="923.9931" />
     <text
        xml:space="preserve"
-       style="font-style:normal;font-weight:normal;font-size:12.5px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
        x="136.02846"
        y="938.13525"
-       id="text4189-0"
-       sodipodi:linespacing="125%"><tspan
+       id="text4189-0"><tspan
          sodipodi:role="line"
          x="136.02846"
          y="938.13525"
-         id="tspan4193-6">dpdk_port0</tspan></text>
+         id="tspan4193-6"
+         style="font-size:12.5px;line-height:1.25">dpdk_port0</tspan></text>
     <rect
        style="fill:#000000;fill-opacity:0;stroke:#257cdc;stroke-width:2;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
        id="rect4156-6-5"
@@ -397,33 +397,33 @@
        y="824.99817" />
     <text
        xml:space="preserve"
-       style="font-style:normal;font-weight:normal;font-size:12.5px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
        x="137.54369"
        y="839.14026"
-       id="text4189-4"
-       sodipodi:linespacing="125%"><tspan
+       id="text4189-4"><tspan
          sodipodi:role="line"
          x="137.54369"
          y="839.14026"
-         id="tspan4193-2">librte_pdump</tspan></text>
+         id="tspan4193-2"
+         style="font-size:12.5px;line-height:1.25">librte_pdump</tspan></text>
     <rect
-       style="fill:url(#linearGradient5788);fill-opacity:1;stroke:#257cdc;stroke-width:1;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       style="fill:url(#linearGradient5788);fill-opacity:1;stroke:#257cdc;stroke-width:1.07013;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
        id="rect4156-6-4-5"
-       width="94.449265"
-       height="35.355339"
-       x="307.7804"
-       y="985.61243" />
+       width="108.21974"
+       height="35.335861"
+       x="297.9809"
+       y="985.62219" />
     <text
        xml:space="preserve"
-       style="font-style:normal;font-weight:normal;font-size:12.5px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
        x="352.70618"
        y="999.75458"
-       id="text4189-1-8"
-       sodipodi:linespacing="125%"><tspan
+       id="text4189-1-8"><tspan
          sodipodi:role="line"
          x="352.70618"
          y="999.75458"
-         id="tspan4193-3-2">capture.pcap</tspan></text>
+         id="tspan4193-3-2"
+         style="font-size:12.5px;line-height:1.25">capture.pcapng</tspan></text>
     <rect
        style="fill:url(#linearGradient5788-1);fill-opacity:1;stroke:#257cdc;stroke-width:1.12555885;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
        id="rect4156-6-4-5-1"
@@ -433,15 +433,15 @@
        y="983.14984" />
     <text
        xml:space="preserve"
-       style="font-style:normal;font-weight:normal;font-size:12.5px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
        x="136.53352"
        y="1002.785"
-       id="text4189-1-8-4"
-       sodipodi:linespacing="125%"><tspan
+       id="text4189-1-8-4"><tspan
          sodipodi:role="line"
          x="136.53352"
          y="1002.785"
-         id="tspan4193-3-2-7">Traffic Generator</tspan></text>
+         id="tspan4193-3-2-7"
+         style="font-size:12.5px;line-height:1.25">Traffic Generator</tspan></text>
     <path
        style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#marker7331)"
        d="m 351.46948,927.02357 c 0,57.5787 0,57.5787 0,57.5787"
diff --git a/doc/guides/howto/packet_capture_framework.rst b/doc/guides/howto/packet_capture_framework.rst
index c31bac52340e..78baa609a021 100644
--- a/doc/guides/howto/packet_capture_framework.rst
+++ b/doc/guides/howto/packet_capture_framework.rst
@@ -1,18 +1,19 @@
 ..  SPDX-License-Identifier: BSD-3-Clause
     Copyright(c) 2017 Intel Corporation.
 
-DPDK pdump Library and pdump Tool
-=================================
+DPDK packet capture libraries and tools
+=======================================
 
 This document describes how the Data Plane Development Kit (DPDK) Packet
 Capture Framework is used for capturing packets on DPDK ports. It is intended
 for users of DPDK who want to know more about the Packet Capture feature and
 for those who want to monitor traffic on DPDK-controlled devices.
 
-The DPDK packet capture framework was introduced in DPDK v16.07. The DPDK
-packet capture framework consists of the DPDK pdump library and DPDK pdump
-tool.
-
+The DPDK packet capture framework was introduced in DPDK v16.07 and
+enhanced in 21.1. The DPDK packet capture framework consists of the
+libraries for collecting packets ``librte_pdump`` and writing packets
+to a file ``librte_pcapng``. There are two sample applications:
+``dpdk-dumpcap`` and older ``dpdk-pdump``.
 
 Introduction
 ------------
@@ -22,43 +23,46 @@ allow users to initialize the packet capture framework and to enable or
 disable packet capture. The library works on a multi process communication model and its
 usage is recommended for debugging purposes.
 
-The :ref:`dpdk-pdump <pdump_tool>` tool is developed based on the
-``librte_pdump`` library.  It runs as a DPDK secondary process and is capable
-of enabling or disabling packet capture on DPDK ports. The ``dpdk-pdump`` tool
-provides command-line options with which users can request enabling or
-disabling of the packet capture on DPDK ports.
+The :ref:`librte_pcapng <pcapng_library>` library provides the APIs to format
+packets and write them to a file in Pcapng format.
+
+
+The :ref:`dpdk-dumpcap <dumpcap_tool>` is a tool that captures packets in
+like Wireshark dumpcap does for Linux. It runs as a DPDK secondary process and
+captures packets from one or more interfaces and writes them to a file
+in Pcapng format.  The ``dpdk-dumpcap`` tool is designed to take
+most of the same options as the Wireshark ``dumpcap`` command.
 
-The application which initializes the packet capture framework will be a primary process
-and the application that enables or disables the packet capture will
-be a secondary process. The primary process sends the Rx and Tx packets from the DPDK ports
-to the secondary process.
+Without any options it will use the packet capture framework to
+capture traffic from the first available DPDK port.
 
 In DPDK the ``testpmd`` application can be used to initialize the packet
-capture framework and acts as a server, and the ``dpdk-pdump`` tool acts as a
+capture framework and acts as a server, and the ``dpdk-dumpcap`` tool acts as a
 client. To view Rx or Tx packets of ``testpmd``, the application should be
-launched first, and then the ``dpdk-pdump`` tool. Packets from ``testpmd``
-will be sent to the tool, which then sends them on to the Pcap PMD device and
-that device writes them to the Pcap file or to an external interface depending
-on the command-line option used.
+launched first, and then the ``dpdk-dumpcap`` tool. Packets from ``testpmd``
+will be sent to the tool, and then to the Pcapng file.
 
 Some things to note:
 
-* The ``dpdk-pdump`` tool can only be used in conjunction with a primary
+* All tools using ``librte_pdump`` can only be used in conjunction with a primary
   application which has the packet capture framework initialized already. In
   dpdk, only ``testpmd`` is modified to initialize packet capture framework,
-  other applications remain untouched. So, if the ``dpdk-pdump`` tool has to
+  other applications remain untouched. So, if the ``dpdk-dumpcap`` tool has to
   be used with any application other than the testpmd, the user needs to
   explicitly modify that application to call the packet capture framework
   initialization code. Refer to the ``app/test-pmd/testpmd.c`` code and look
   for ``pdump`` keyword to see how this is done.
 
-* The ``dpdk-pdump`` tool depends on the libpcap based PMD.
+* The ``dpdk-pdump`` tool is an older tool created as demonstration of ``librte_pdump``
+  library. The ``dpdk-pdump`` tool provides more limited functionality and
+  and depends on the Pcap PMD. It is retained only for compatibility reasons;
+  users should use ``dpdk-dumpcap`` instead.
 
 
 Test Environment
 ----------------
 
-The overview of using the Packet Capture Framework and the ``dpdk-pdump`` tool
+The overview of using the Packet Capture Framework and the ``dpdk-dumpcap`` utility
 for packet capturing on the DPDK port in
 :numref:`figure_packet_capture_framework`.
 
@@ -66,13 +70,13 @@ for packet capturing on the DPDK port in
 
 .. figure:: img/packet_capture_framework.*
 
-   Packet capturing on a DPDK port using the dpdk-pdump tool.
+   Packet capturing on a DPDK port using the dpdk-dumpcap utility.
 
 
 Running the Application
 -----------------------
 
-The following steps demonstrate how to run the ``dpdk-pdump`` tool to capture
+The following steps demonstrate how to run the ``dpdk-dumpcap`` tool to capture
 Rx side packets on dpdk_port0 in :numref:`figure_packet_capture_framework` and
 inspect them using ``tcpdump``.
 
@@ -80,16 +84,15 @@ inspect them using ``tcpdump``.
 
      sudo <build_dir>/app/dpdk-testpmd -c 0xf0 -n 4 -- -i --port-topology=chained
 
-#. Launch the pdump tool as follows::
+#. Launch the dpdk-dump as follows::
 
-     sudo <build_dir>/app/dpdk-pdump -- \
-          --pdump 'port=0,queue=*,rx-dev=/tmp/capture.pcap'
+     sudo <build_dir>/app/dpdk-dumpcap -w /tmp/capture.pcapng
 
 #. Send traffic to dpdk_port0 from traffic generator.
-   Inspect packets captured in the file capture.pcap using a tool
-   that can interpret Pcap files, for example tcpdump::
+   Inspect packets captured in the file capture.pcap using a tool such as
+   tcpdump or tshark that can interpret Pcapng files::
 
-     $tcpdump -nr /tmp/capture.pcap
+     $ tcpdump -nr /tmp/capture.pcapng
      reading from file /tmp/capture.pcap, link-type EN10MB (Ethernet)
      11:11:36.891404 IP 4.4.4.4.whois++ > 3.3.3.3.whois++: UDP, length 18
      11:11:36.891442 IP 4.4.4.4.whois++ > 3.3.3.3.whois++: UDP, length 18
diff --git a/doc/guides/prog_guide/index.rst b/doc/guides/prog_guide/index.rst
index 2dce507f46a3..b440c77c2ba1 100644
--- a/doc/guides/prog_guide/index.rst
+++ b/doc/guides/prog_guide/index.rst
@@ -43,6 +43,7 @@ Programmer's Guide
     ip_fragment_reassembly_lib
     generic_receive_offload_lib
     generic_segmentation_offload_lib
+    pcapng_lib
     pdump_lib
     multi_proc_support
     kernel_nic_interface
diff --git a/doc/guides/prog_guide/pcapng_lib.rst b/doc/guides/prog_guide/pcapng_lib.rst
new file mode 100644
index 000000000000..36379b530a57
--- /dev/null
+++ b/doc/guides/prog_guide/pcapng_lib.rst
@@ -0,0 +1,24 @@
+..  SPDX-License-Identifier: BSD-3-Clause
+    Copyright(c) 2016 Intel Corporation.
+
+.. _pcapng_library:
+
+Packet Capture File Writer
+==========================
+
+Pcapng is a library for creating files in Pcapng file format.
+The Pcapng file format is the default capture file format for modern
+network capture processing tools. It can be read by wireshark and tcpdump.
+
+Usage
+-----
+
+Before the library can be used the function ``rte_pcapng_init``
+should be called once to initialize timestamp computation.
+
+
+References
+----------
+* Draft RFC https://www.ietf.org/id/draft-tuexen-opsawg-pcapng-03.html
+
+* Project repository  https://github.com/pcapng/pcapng/
diff --git a/doc/guides/prog_guide/pdump_lib.rst b/doc/guides/prog_guide/pdump_lib.rst
index 62c0b015b2fe..9af91415e5ea 100644
--- a/doc/guides/prog_guide/pdump_lib.rst
+++ b/doc/guides/prog_guide/pdump_lib.rst
@@ -3,10 +3,10 @@
 
 .. _pdump_library:
 
-The librte_pdump Library
-========================
+The Packet Capture Library
+==========================
 
-The ``librte_pdump`` library provides a framework for packet capturing in DPDK.
+The DPDK ``pdump`` library provides a framework for packet capturing in DPDK.
 The library does the complete copy of the Rx and Tx mbufs to a new mempool and
 hence it slows down the performance of the applications, so it is recommended
 to use this library for debugging purposes.
@@ -23,11 +23,19 @@ or disable the packet capture, and to uninitialize it.
 
 * ``rte_pdump_enable()``:
   This API enables the packet capture on a given port and queue.
-  Note: The filter option in the API is a place holder for future enhancements.
+
+* ``rte_pdump_enable_bpf()``
+  This API enables the packet capture on a given port and queue.
+  It also allows setting an optional filter using DPDK BPF interpreter and
+  setting the captured packet length.
 
 * ``rte_pdump_enable_by_deviceid()``:
   This API enables the packet capture on a given device id (``vdev name or pci address``) and queue.
-  Note: The filter option in the API is a place holder for future enhancements.
+
+* ``rte_pdump_enable_bpf_by_deviceid()``
+  This API enables the packet capture on a given device id (``vdev name or pci address``) and queue.
+  It also allows seating an optional filter using DPDK BPF interpreter and
+  setting the captured packet length.
 
 * ``rte_pdump_disable()``:
   This API disables the packet capture on a given port and queue.
@@ -61,6 +69,12 @@ and enables the packet capture by registering the Ethernet RX and TX callbacks f
 and queue combinations. Then the primary process will mirror the packets to the new mempool and enqueue them to
 the rte_ring that secondary process have passed to these APIs.
 
+The packet ring supports one of two formats. The default format enqueues copies of the original packets
+into the rte_ring. If the ``RTE_PDUMP_FLAG_PCAPNG`` is set the mbuf data is extended with header and trailer
+to match the format of Pcapng enhanced packet block. The enhanced packet block has meta-data such as the
+timestamp, port and queue the packet was captured on. It is up to the application consuming the
+packets from the ring to select the format desired.
+
 The library APIs ``rte_pdump_disable()`` and ``rte_pdump_disable_by_deviceid()`` disables the packet capture.
 For the calls to these APIs from secondary process, the library creates the "pdump disable" request and sends
 the request to the primary process over the multi process channel. The primary process takes this request and
@@ -74,5 +88,5 @@ function.
 Use Case: Packet Capturing
 --------------------------
 
-The DPDK ``app/pdump`` tool is developed based on this library to capture packets in DPDK.
-Users can use this as an example to develop their own packet capturing tools.
+The DPDK ``app/dpdk-dumpcap`` utility uses this library
+to capture packets in DPDK.
diff --git a/doc/guides/rel_notes/release_21_11.rst b/doc/guides/rel_notes/release_21_11.rst
index 675b5738348b..ee24cbfdb99d 100644
--- a/doc/guides/rel_notes/release_21_11.rst
+++ b/doc/guides/rel_notes/release_21_11.rst
@@ -62,6 +62,16 @@ New Features
   * Added bus-level parsing of the devargs syntax.
   * Kept compatibility with the legacy syntax as parsing fallback.
 
+* **Enhance Packet capture.**
+
+  * New dpdk-dumpcap program that has most of the features of the
+    wireshark dumpcap utility including capture of multiple interfaces,
+    stopping after number of bytes, packets.
+  * New library for writing pcapng packet capture files.
+  * Enhancement to the pdump library to support:
+    * Packet filter with BPF.
+    * Pcapng format with timestamps and meta-data.
+    * Fixes packet capture with stripped VLAN tags.
 
 Removed Items
 -------------
diff --git a/doc/guides/tools/dumpcap.rst b/doc/guides/tools/dumpcap.rst
new file mode 100644
index 000000000000..90993bd5be5e
--- /dev/null
+++ b/doc/guides/tools/dumpcap.rst
@@ -0,0 +1,80 @@
+..  SPDX-License-Identifier: BSD-3-Clause
+    Copyright(c) 2020 Microsoft Corporation.
+
+.. _dumpcap_tool:
+
+dpdk-dumpcap Application
+========================
+
+The ``dpdk-dumpcap`` tool is a Data Plane Development Kit (DPDK)
+network traffic dump tool.  The interface is similar to  the dumpcap tool in Wireshark.
+It runs as a secondary DPDK process and lets you capture packets that are
+coming into and out of a DPDK primary process.
+The ``dpdk-dumpcap`` writes files in Pcapng packet format using
+capture file format is pcapng.
+
+Without any options set it will use DPDK to capture traffic from the first
+available DPDK interface and write the received raw packet data, along
+with timestamps into a pcapng file.
+
+If the ``-w`` option is not specified, ``dpdk-dumpcap`` writes to a newly
+create file with a name chosen based on interface name and timestamp.
+If ``-w`` option is specified, then that file is used.
+
+   .. Note::
+      * The ``dpdk-dumpcap`` tool can only be used in conjunction with a primary
+        application which has the packet capture framework initialized already.
+        In dpdk, only the ``testpmd`` is modified to initialize packet capture
+        framework, other applications remain untouched. So, if the ``dpdk-dumpcap``
+        tool has to be used with any application other than the testpmd, user
+        needs to explicitly modify that application to call packet capture
+        framework initialization code. Refer ``app/test-pmd/testpmd.c``
+        code to see how this is done.
+
+      * The ``dpdk-dumpcap`` tool runs as a DPDK secondary process. It exits when
+        the primary application exits.
+
+
+Running the Application
+-----------------------
+
+To list interfaces available for capture use ``--list-interfaces``.
+
+To capture on multiple interfaces at once, use multiple ``-I`` flags.
+
+Example
+-------
+
+.. code-block:: console
+
+   # ./<build_dir>/app/dpdk-dumpcap --list-interfaces
+   0. 000:00:03.0
+   1. 000:00:03.1
+
+   # ./<build_dir>/app/dpdk-dumpcap -I 0000:00:03.0 -c 6 -w /tmp/sample.pcapng
+   Packets captured: 6
+   Packets received/dropped on interface '0000:00:03.0' 6/0
+
+
+Limitations
+-----------
+The following options of Wireshark ``dumpcap`` are not yet implemented:
+
+   * ``-f <capture filter>`` -- needs translation from classic BPF to eBPF.
+
+   * ``-b|--ring-buffer`` -- more complex file management.
+
+   * ``-C <byte_limit>`` -- doesn't make sense in DPDK model.
+
+   * ``-t`` -- use a thread per interface
+
+   * Timestamp type.
+
+   * Link data types. Only EN10MB (Ethernet) is supported.
+
+   * Wireless related options:  ``-I|--monitor-mode`` and  ``-k <freq>``
+
+
+.. Note::
+   * The options to ``dpdk-dumpcap`` are like the Wireshark dumpcap program and
+     are not the same as ``dpdk-pdump`` and other DPDK applications.
diff --git a/doc/guides/tools/index.rst b/doc/guides/tools/index.rst
index 93dde4148e90..b71c12b8f2dd 100644
--- a/doc/guides/tools/index.rst
+++ b/doc/guides/tools/index.rst
@@ -8,6 +8,7 @@ DPDK Tools User Guides
     :maxdepth: 2
     :numbered:
 
+    dumpcap
     proc_info
     pdump
     pmdinfo
-- 
2.30.2


^ permalink raw reply	[relevance 1%]

* [dpdk-dev] [PATCH v20 0/7] support dmadev
  @ 2021-09-04 10:10  3% ` Chengwen Feng
  2021-09-06 13:37  0%   ` Bruce Richardson
  2021-09-07 12:56  3% ` [dpdk-dev] [PATCH v21 " Chengwen Feng
  2021-09-16  3:41  3% ` [dpdk-dev] [PATCH v22 0/5] " Chengwen Feng
  2 siblings, 1 reply; 200+ results
From: Chengwen Feng @ 2021-09-04 10:10 UTC (permalink / raw)
  To: thomas, ferruh.yigit, bruce.richardson, jerinj, jerinjacobk,
	andrew.rybchenko
  Cc: dev, mb, nipun.gupta, hemant.agrawal, maxime.coquelin,
	honnappa.nagarahalli, david.marchand, sburla, pkapoor,
	konstantin.ananyev, conor.walsh, kevin.laatz

This patch set contains seven patch for new add dmadev.

Chengwen Feng (7):
  dmadev: introduce DMA device library public APIs
  dmadev: introduce DMA device library internal header
  dmadev: introduce DMA device library PMD header
  dmadev: introduce DMA device library implementation
  doc: add DMA device library guide
  dma/skeleton: introduce skeleton dmadev driver
  app/test: add dmadev API test

---
v20:
* delete unnecessary and duplicate include header files.
* the conf_sz parameter is added to the configure and vchan-setup
  callbacks of the PMD, this is mainly used to enhance ABI
  compatibility.
* the rte_dmadev structure field is rearranged to reserve more space
  for I/O functions.
* fix some ambiguous and unnecessary comments.
* fix the potential memory leak of ut.
* redefine skeldma_init_once to skeldma_count.
* suppress rte_dmadev error output when execute ut.
v19:
* squash maintainer patch to patch #1.
v18:
* RTE_DMA_STATUS_* add BUS_READ/WRITE_ERR, PAGE_FAULT.
* rte_dmadev dataplane API add judge dev_started when debug enable.
* rte_dmadev_start/vchan_setup add judge device configured.
* rte_dmadev_dump support format capability name.
* optimized the comments of rte_dmadev.
* fix skeldma_copy always return zero when enqueue successful.
* log encapsulation macro add newline characters.
* test_dmadev_api support rte_dmadev_dump() ut.
v17:
* remove rte_dmadev_selftest() API.
* move dmadev API test from dma/skeleton to app/test.
* fix compile error of dma/skeleton driver when building for x86-32.
* fix iol spell check warning of dmadev.rst.

 MAINTAINERS                            |    7 +
 app/test/meson.build                   |    4 +
 app/test/test_dmadev.c                 |   43 +
 app/test/test_dmadev_api.c             |  543 ++++++++++++
 config/rte_config.h                    |    3 +
 doc/api/doxy-api-index.md              |    1 +
 doc/api/doxy-api.conf.in               |    1 +
 doc/guides/prog_guide/dmadev.rst       |  125 +++
 doc/guides/prog_guide/img/dmadev.svg   |  283 +++++++
 doc/guides/prog_guide/index.rst        |    1 +
 doc/guides/rel_notes/release_21_11.rst |    5 +
 drivers/dma/meson.build                |   11 +
 drivers/dma/skeleton/meson.build       |    7 +
 drivers/dma/skeleton/skeleton_dmadev.c |  594 ++++++++++++++
 drivers/dma/skeleton/skeleton_dmadev.h |   61 ++
 drivers/dma/skeleton/version.map       |    3 +
 drivers/meson.build                    |    1 +
 lib/dmadev/meson.build                 |    7 +
 lib/dmadev/rte_dmadev.c                |  607 ++++++++++++++
 lib/dmadev/rte_dmadev.h                | 1047 ++++++++++++++++++++++++
 lib/dmadev/rte_dmadev_core.h           |  183 +++++
 lib/dmadev/rte_dmadev_pmd.h            |   72 ++
 lib/dmadev/version.map                 |   35 +
 lib/meson.build                        |    1 +
 24 files changed, 3645 insertions(+)
 create mode 100644 app/test/test_dmadev.c
 create mode 100644 app/test/test_dmadev_api.c
 create mode 100644 doc/guides/prog_guide/dmadev.rst
 create mode 100644 doc/guides/prog_guide/img/dmadev.svg
 create mode 100644 drivers/dma/meson.build
 create mode 100644 drivers/dma/skeleton/meson.build
 create mode 100644 drivers/dma/skeleton/skeleton_dmadev.c
 create mode 100644 drivers/dma/skeleton/skeleton_dmadev.h
 create mode 100644 drivers/dma/skeleton/version.map
 create mode 100644 lib/dmadev/meson.build
 create mode 100644 lib/dmadev/rte_dmadev.c
 create mode 100644 lib/dmadev/rte_dmadev.h
 create mode 100644 lib/dmadev/rte_dmadev_core.h
 create mode 100644 lib/dmadev/rte_dmadev_pmd.h
 create mode 100644 lib/dmadev/version.map

-- 
2.33.0


^ permalink raw reply	[relevance 3%]

* [dpdk-dev] [PATCH v2] ethdev: promote burst mode API to stable
  2021-09-01  5:07  3% [dpdk-dev] [PATCH v1 0/3] Promote some API to stable Haiyue Wang
                   ` (2 preceding siblings ...)
  2021-09-01  5:07  3% ` [dpdk-dev] [PATCH v1 3/3] ethdev: promote burst mode " Haiyue Wang
@ 2021-09-06  5:56  3% ` Haiyue Wang
  2021-09-06  6:36  0%   ` Andrew Rybchenko
  3 siblings, 1 reply; 200+ results
From: Haiyue Wang @ 2021-09-06  5:56 UTC (permalink / raw)
  To: dev
  Cc: Haiyue Wang, Ferruh Yigit, Ray Kinsella, Thomas Monjalon,
	Andrew Rybchenko

The DPDK Symbol Bot reports:
Please note the symbols listed below have expired. In line with the
DPDK ABI policy, they should be scheduled for removal, in the next
DPDK release.

Symbol
rte_eth_rx_burst_mode_get
rte_eth_tx_burst_mode_get

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
---

v2: Drop the PMD API promote to stable

---
 lib/ethdev/rte_ethdev.h | 2 --
 lib/ethdev/version.map  | 4 ++--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h
index d2b27c351f..3277e8f8fb 100644
--- a/lib/ethdev/rte_ethdev.h
+++ b/lib/ethdev/rte_ethdev.h
@@ -4361,7 +4361,6 @@ int rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id,
  *   - -ENOTSUP: routine is not supported by the device PMD.
  *   - -EINVAL:  The queue_id is out of range.
  */
-__rte_experimental
 int rte_eth_rx_burst_mode_get(uint16_t port_id, uint16_t queue_id,
 	struct rte_eth_burst_mode *mode);
 
@@ -4383,7 +4382,6 @@ int rte_eth_rx_burst_mode_get(uint16_t port_id, uint16_t queue_id,
  *   - -ENOTSUP: routine is not supported by the device PMD.
  *   - -EINVAL:  The queue_id is out of range.
  */
-__rte_experimental
 int rte_eth_tx_burst_mode_get(uint16_t port_id, uint16_t queue_id,
 	struct rte_eth_burst_mode *mode);
 
diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map
index 3eece75b72..6a12b0664a 100644
--- a/lib/ethdev/version.map
+++ b/lib/ethdev/version.map
@@ -87,6 +87,7 @@ DPDK_22 {
 	rte_eth_promiscuous_get;
 	rte_eth_remove_rx_callback;
 	rte_eth_remove_tx_callback;
+	rte_eth_rx_burst_mode_get;
 	rte_eth_rx_queue_info_get;
 	rte_eth_rx_queue_setup;
 	rte_eth_set_queue_rate_limit;
@@ -104,6 +105,7 @@ DPDK_22 {
 	rte_eth_tx_buffer_drop_callback;
 	rte_eth_tx_buffer_init;
 	rte_eth_tx_buffer_set_err_callback;
+	rte_eth_tx_burst_mode_get;
 	rte_eth_tx_done_cleanup;
 	rte_eth_tx_queue_info_get;
 	rte_eth_tx_queue_setup;
@@ -166,9 +168,7 @@ EXPERIMENTAL {
 
 	# added in 19.11
 	rte_eth_dev_hairpin_capability_get;
-	rte_eth_rx_burst_mode_get;
 	rte_eth_rx_hairpin_queue_setup;
-	rte_eth_tx_burst_mode_get;
 	rte_eth_tx_hairpin_queue_setup;
 	rte_flow_dynf_metadata_offs;
 	rte_flow_dynf_metadata_mask;
-- 
2.33.0


^ permalink raw reply	[relevance 3%]

* Re: [dpdk-dev] [PATCH v2] ethdev: promote burst mode API to stable
  2021-09-06  5:56  3% ` [dpdk-dev] [PATCH v2] " Haiyue Wang
@ 2021-09-06  6:36  0%   ` Andrew Rybchenko
  2021-09-15  8:46  0%     ` Ferruh Yigit
  0 siblings, 1 reply; 200+ results
From: Andrew Rybchenko @ 2021-09-06  6:36 UTC (permalink / raw)
  To: Haiyue Wang, dev; +Cc: Ferruh Yigit, Ray Kinsella, Thomas Monjalon

On 9/6/21 8:56 AM, Haiyue Wang wrote:
> The DPDK Symbol Bot reports:
> Please note the symbols listed below have expired. In line with the
> DPDK ABI policy, they should be scheduled for removal, in the next
> DPDK release.
> 
> Symbol
> rte_eth_rx_burst_mode_get
> rte_eth_tx_burst_mode_get
> 
> Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
> Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
> Acked-by: Ray Kinsella <mdr@ashroe.eu>

Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>


^ permalink raw reply	[relevance 0%]

* Re: [dpdk-dev] [PATCH] doc: announce change in vfio dma mapping
  2021-09-02 16:13  0%               ` Kinsella, Ray
@ 2021-09-06  8:51  0%                 ` Ding, Xuan
  2021-09-06 13:43  0%                   ` Ferruh Yigit
  0 siblings, 1 reply; 200+ results
From: Ding, Xuan @ 2021-09-06  8:51 UTC (permalink / raw)
  To: Kinsella, Ray, Yigit, Ferruh, Burakov, Anatoly, dev
  Cc: maxime.coquelin, Xia, Chenbo, Hu, Jiayu, Richardson, Bruce,
	Thomas Monjalon

Hi,

> -----Original Message-----
> From: Kinsella, Ray <mdr@ashroe.eu>
> Sent: Friday, September 3, 2021 12:13 AM
> To: Yigit, Ferruh <ferruh.yigit@intel.com>; Burakov, Anatoly
> <anatoly.burakov@intel.com>; Ding, Xuan <xuan.ding@intel.com>;
> dev@dpdk.org
> Cc: maxime.coquelin@redhat.com; Xia, Chenbo <chenbo.xia@intel.com>; Hu,
> Jiayu <jiayu.hu@intel.com>; Richardson, Bruce <bruce.richardson@intel.com>;
> Thomas Monjalon <thomas@monjalon.net>
> Subject: Re: [PATCH] doc: announce change in vfio dma mapping
> 
> 
> 
> On 02/09/2021 10:50, Ferruh Yigit wrote:
> > On 9/1/2021 2:25 PM, Burakov, Anatoly wrote:
> >> On 01-Sep-21 12:42 PM, Ferruh Yigit wrote:
> >>> On 9/1/2021 12:01 PM, Burakov, Anatoly wrote:
> >>>> On 01-Sep-21 10:56 AM, Ferruh Yigit wrote:
> >>>>> On 9/1/2021 2:41 AM, Ding, Xuan wrote:
> >>>>>> Hi Ferruh,
> >>>>>>
> >>>>>>> -----Original Message-----
> >>>>>>> From: Yigit, Ferruh <ferruh.yigit@intel.com>
> >>>>>>> Sent: Wednesday, September 1, 2021 12:01 AM
> >>>>>>> To: Ding, Xuan <xuan.ding@intel.com>; dev@dpdk.org; Burakov,
> Anatoly
> >>>>>>> <anatoly.burakov@intel.com>
> >>>>>>> Cc: maxime.coquelin@redhat.com; Xia, Chenbo
> <chenbo.xia@intel.com>; Hu,
> >>>>>>> Jiayu <jiayu.hu@intel.com>; Richardson, Bruce
> <bruce.richardson@intel.com>
> >>>>>>> Subject: Re: [PATCH] doc: announce change in vfio dma mapping
> >>>>>>>
> >>>>>>> On 8/31/2021 2:10 PM, Xuan Ding wrote:
> >>>>>>>> Currently, the VFIO subsystem will compact adjacent DMA regions for
> the
> >>>>>>>> purposes of saving space in the internal list of mappings. This has a
> >>>>>>>> side effect of compacting two separate mappings that just happen to
> be
> >>>>>>>> adjacent in memory. Since VFIO implementation on IA platforms also
> does
> >>>>>>>> not allow partial unmapping of memory mapped for DMA, the current
> >>>>>>> DPDK
> >>>>>>>> VFIO implementation will prevent unmapping of accidentally adjacent
> >>>>>>>> maps even though it could have been unmapped [1].
> >>>>>>>>
> >>>>>>>> The proper fix for this issue is to change the VFIO DMA mapping API to
> >>>>>>>> also include page size, and always map memory page-by-page.
> >>>>>>>>
> >>>>>>>> [1] https://mails.dpdk.org/archives/dev/2021-July/213493.html
> >>>>>>>>
> >>>>>>>> Signed-off-by: Xuan Ding <xuan.ding@intel.com>
> >>>>>>>> ---
> >>>>>>>>    doc/guides/rel_notes/deprecation.rst | 3 +++
> >>>>>>>>    1 file changed, 3 insertions(+)
> >>>>>>>>
> >>>>>>>> diff --git a/doc/guides/rel_notes/deprecation.rst
> >>>>>>> b/doc/guides/rel_notes/deprecation.rst
> >>>>>>>> index 76a4abfd6b..1234420caf 100644
> >>>>>>>> --- a/doc/guides/rel_notes/deprecation.rst
> >>>>>>>> +++ b/doc/guides/rel_notes/deprecation.rst
> >>>>>>>> @@ -287,3 +287,6 @@ Deprecation Notices
> >>>>>>>>      reserved bytes to 2 (from 3), and use 1 byte to indicate warnings
> and
> >>>>>>> other
> >>>>>>>>      information from the crypto/security operation. This field will be
> >>>>>>>> used to
> >>>>>>>>      communicate events such as soft expiry with IPsec in lookaside
> mode.
> >>>>>>>> +
> >>>>>>>> +* vfio: the functions `rte_vfio_container_dma_map` will be amended
> to
> >>>>>>>> +  include page size. This change is targeted for DPDK 22.02.
> >>>>>>>>
> >>>>>>>
> >>>>>>> Is this means adding a new parameter to API?
> >>>>>>> If so this is an ABI/API break and we can't do this change in the 22.02.
> >>>>>>
> >>>>>> Our original plan is add a new parameter in order not to use a new
> function
> >>>>>> name, so you mean, any changes to the API can only be done in the LTS
> version?
> >>>>>> If so, we can only add a new API and retire the old one in 22.11.
> >>>>>>
> >>>>>
> >>>>> We can add a new API anytime. Adding new parameter to an existing API
> can be
> >>>>> done on the ABI break release.
> >>>>
> >>>> So, 22.11 then?
> >>>>
> >>>
> >>> Yes.
> >>>
> >>>>>
> >>>>> You can add the new API in this release, and start using it.
> >>>>> And mark the old API as deprecated in this release. This lets existing
> binaries
> >>>>> to keep using it, but app needs to switch to new API for compilation.
> >>>>> Old API can be removed on 22.11, and you will need a deprecation notice
> before
> >>>>> 22.11 for it.
> >>>>>
> >>>>> Is above plan works for you?
> >>>>>
> >>>>
> >>>> We have slightly rethought our approach, and the functionality that Xuan
> >>>> requires does not rely on this API. They can, for all intents and purposes, be
> >>>> considered unrelated issues.
> >>>>
> >>>> I still think it's a good idea to update the API that way, so I would like to do
> >>>> that, and if we have to wait until 22.11 to fix it, I'm OK with that. Since
> >>>> there no longer is any urgency here, it's acceptable to wait for the next LTS
> to
> >>>> break it.
> >>>>
> >>>
> >>> Got it.
> >>>
> >>> As far as I understand, main motivation in techboard decision was to
> prevent the
> >>> ABI break as much as possible (main reason of decision wasn't deprecation
> notice
> >>> being late). But if the correct thing to do is to rename the API (and break the
> >>> ABI), I don't see the benefit to wait one more year, it is just delaying the
> >>> impact and adding overhead to us.
> >>> I am for being pragmatic and doing the change in this release if API rename
> is
> >>> better option, perhaps we can visit the issue again in techboard.
> >>>
> >>> Can you please describe why renaming API is better option, comparing to
> adding
> >>> new API with new parameter?
> >>
> >> I take it you meant "why renaming API *isn't* a better option".
> >>
> >> The problem we're solving is that the API in question does not know about
> page
> >> sizes and thus can't map segments page-by-page. I mean I /guess/ we could
> have
> >> two API's (one paged, one not paged), but then we get into all kinds of hairy
> >> things about the API leaking the details of underlying platform.
> >>
> >> Bottom line: i like current API function name. It's concise, it's descriptive.
> >> It's only missing a parameter, which i would like to add. A rename has been
> >> suggested (deprecate old API, add new API with a different name, and with
> added
> >> parameter), but honestly, I don't see why we have to do that because this is
> >> predicated upon the assumption that we *can't* break ABI at all, under any
> >> circumstances.
> >>
> >> Can you please explain to me what is wrong with keeping a versioned symbol?
> >> Like, keep the old function around to keep ABI compatibility, but break the
> API
> >> compatibility for those who target 22.02 or later? That's what symbol
> versioning
> >> is *for*, is it not?
> >>
> >
> > Nothing wrong with symbol versioning, indeed that is preferred way if it works
> > for you, I didn't get that symbol versioning is planned.
> >
> > @Ray,
> > Since symbol versioning is planned, ABI won't break, but API will change, can
> > this change be done in this release without deprecation notice?
> 
> Yes - I would think so.
> Since we are going to the effort of using symbol versioning nothing is being
> depreciated as such (yet).
> 
> > Later we can have a deprecation notice to remove old symbol on 22.11.

Thanks for your explanation.
@Yigit, Ferruh Does it mean that we can do API change in 21.11? If so, we will
follow the process and target API change in this release. :)

Regards,
Xuan

> >
> > Thanks,
> > ferruh
> >

^ permalink raw reply	[relevance 0%]

* Re: [dpdk-dev] [PATCH v20 0/7] support dmadev
  2021-09-04 10:10  3% ` [dpdk-dev] [PATCH v20 0/7] support dmadev Chengwen Feng
@ 2021-09-06 13:37  0%   ` Bruce Richardson
  0 siblings, 0 replies; 200+ results
From: Bruce Richardson @ 2021-09-06 13:37 UTC (permalink / raw)
  To: Chengwen Feng
  Cc: thomas, ferruh.yigit, jerinj, jerinjacobk, andrew.rybchenko, dev,
	mb, nipun.gupta, hemant.agrawal, maxime.coquelin,
	honnappa.nagarahalli, david.marchand, sburla, pkapoor,
	konstantin.ananyev, conor.walsh, kevin.laatz

On Sat, Sep 04, 2021 at 06:10:20PM +0800, Chengwen Feng wrote:
> This patch set contains seven patch for new add dmadev.
> 
> Chengwen Feng (7):
>   dmadev: introduce DMA device library public APIs
>   dmadev: introduce DMA device library internal header
>   dmadev: introduce DMA device library PMD header
>   dmadev: introduce DMA device library implementation
>   doc: add DMA device library guide
>   dma/skeleton: introduce skeleton dmadev driver
>   app/test: add dmadev API test
> 
> ---
> v20:
> * delete unnecessary and duplicate include header files.
> * the conf_sz parameter is added to the configure and vchan-setup
>   callbacks of the PMD, this is mainly used to enhance ABI
>   compatibility.
> * the rte_dmadev structure field is rearranged to reserve more space
>   for I/O functions.
> * fix some ambiguous and unnecessary comments.
> * fix the potential memory leak of ut.
> * redefine skeldma_init_once to skeldma_count.
> * suppress rte_dmadev error output when execute ut.
Thanks for V20, those I've checked look like some good changes.

/Bruce

^ permalink raw reply	[relevance 0%]

* Re: [dpdk-dev] [PATCH] doc: announce change in vfio dma mapping
  2021-09-06  8:51  0%                 ` Ding, Xuan
@ 2021-09-06 13:43  0%                   ` Ferruh Yigit
  2021-09-07 15:21  0%                     ` Burakov, Anatoly
  0 siblings, 1 reply; 200+ results
From: Ferruh Yigit @ 2021-09-06 13:43 UTC (permalink / raw)
  To: Ding, Xuan, Kinsella, Ray, Burakov, Anatoly, dev
  Cc: maxime.coquelin, Xia, Chenbo, Hu, Jiayu, Richardson, Bruce,
	Thomas Monjalon

On 9/6/2021 9:51 AM, Ding, Xuan wrote:
> Hi,
> 
>> -----Original Message-----
>> From: Kinsella, Ray <mdr@ashroe.eu>
>> Sent: Friday, September 3, 2021 12:13 AM
>> To: Yigit, Ferruh <ferruh.yigit@intel.com>; Burakov, Anatoly
>> <anatoly.burakov@intel.com>; Ding, Xuan <xuan.ding@intel.com>;
>> dev@dpdk.org
>> Cc: maxime.coquelin@redhat.com; Xia, Chenbo <chenbo.xia@intel.com>; Hu,
>> Jiayu <jiayu.hu@intel.com>; Richardson, Bruce <bruce.richardson@intel.com>;
>> Thomas Monjalon <thomas@monjalon.net>
>> Subject: Re: [PATCH] doc: announce change in vfio dma mapping
>>
>>
>>
>> On 02/09/2021 10:50, Ferruh Yigit wrote:
>>> On 9/1/2021 2:25 PM, Burakov, Anatoly wrote:
>>>> On 01-Sep-21 12:42 PM, Ferruh Yigit wrote:
>>>>> On 9/1/2021 12:01 PM, Burakov, Anatoly wrote:
>>>>>> On 01-Sep-21 10:56 AM, Ferruh Yigit wrote:
>>>>>>> On 9/1/2021 2:41 AM, Ding, Xuan wrote:
>>>>>>>> Hi Ferruh,
>>>>>>>>
>>>>>>>>> -----Original Message-----
>>>>>>>>> From: Yigit, Ferruh <ferruh.yigit@intel.com>
>>>>>>>>> Sent: Wednesday, September 1, 2021 12:01 AM
>>>>>>>>> To: Ding, Xuan <xuan.ding@intel.com>; dev@dpdk.org; Burakov,
>> Anatoly
>>>>>>>>> <anatoly.burakov@intel.com>
>>>>>>>>> Cc: maxime.coquelin@redhat.com; Xia, Chenbo
>> <chenbo.xia@intel.com>; Hu,
>>>>>>>>> Jiayu <jiayu.hu@intel.com>; Richardson, Bruce
>> <bruce.richardson@intel.com>
>>>>>>>>> Subject: Re: [PATCH] doc: announce change in vfio dma mapping
>>>>>>>>>
>>>>>>>>> On 8/31/2021 2:10 PM, Xuan Ding wrote:
>>>>>>>>>> Currently, the VFIO subsystem will compact adjacent DMA regions for
>> the
>>>>>>>>>> purposes of saving space in the internal list of mappings. This has a
>>>>>>>>>> side effect of compacting two separate mappings that just happen to
>> be
>>>>>>>>>> adjacent in memory. Since VFIO implementation on IA platforms also
>> does
>>>>>>>>>> not allow partial unmapping of memory mapped for DMA, the current
>>>>>>>>> DPDK
>>>>>>>>>> VFIO implementation will prevent unmapping of accidentally adjacent
>>>>>>>>>> maps even though it could have been unmapped [1].
>>>>>>>>>>
>>>>>>>>>> The proper fix for this issue is to change the VFIO DMA mapping API to
>>>>>>>>>> also include page size, and always map memory page-by-page.
>>>>>>>>>>
>>>>>>>>>> [1] https://mails.dpdk.org/archives/dev/2021-July/213493.html
>>>>>>>>>>
>>>>>>>>>> Signed-off-by: Xuan Ding <xuan.ding@intel.com>
>>>>>>>>>> ---
>>>>>>>>>>    doc/guides/rel_notes/deprecation.rst | 3 +++
>>>>>>>>>>    1 file changed, 3 insertions(+)
>>>>>>>>>>
>>>>>>>>>> diff --git a/doc/guides/rel_notes/deprecation.rst
>>>>>>>>> b/doc/guides/rel_notes/deprecation.rst
>>>>>>>>>> index 76a4abfd6b..1234420caf 100644
>>>>>>>>>> --- a/doc/guides/rel_notes/deprecation.rst
>>>>>>>>>> +++ b/doc/guides/rel_notes/deprecation.rst
>>>>>>>>>> @@ -287,3 +287,6 @@ Deprecation Notices
>>>>>>>>>>      reserved bytes to 2 (from 3), and use 1 byte to indicate warnings
>> and
>>>>>>>>> other
>>>>>>>>>>      information from the crypto/security operation. This field will be
>>>>>>>>>> used to
>>>>>>>>>>      communicate events such as soft expiry with IPsec in lookaside
>> mode.
>>>>>>>>>> +
>>>>>>>>>> +* vfio: the functions `rte_vfio_container_dma_map` will be amended
>> to
>>>>>>>>>> +  include page size. This change is targeted for DPDK 22.02.
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Is this means adding a new parameter to API?
>>>>>>>>> If so this is an ABI/API break and we can't do this change in the 22.02.
>>>>>>>>
>>>>>>>> Our original plan is add a new parameter in order not to use a new
>> function
>>>>>>>> name, so you mean, any changes to the API can only be done in the LTS
>> version?
>>>>>>>> If so, we can only add a new API and retire the old one in 22.11.
>>>>>>>>
>>>>>>>
>>>>>>> We can add a new API anytime. Adding new parameter to an existing API
>> can be
>>>>>>> done on the ABI break release.
>>>>>>
>>>>>> So, 22.11 then?
>>>>>>
>>>>>
>>>>> Yes.
>>>>>
>>>>>>>
>>>>>>> You can add the new API in this release, and start using it.
>>>>>>> And mark the old API as deprecated in this release. This lets existing
>> binaries
>>>>>>> to keep using it, but app needs to switch to new API for compilation.
>>>>>>> Old API can be removed on 22.11, and you will need a deprecation notice
>> before
>>>>>>> 22.11 for it.
>>>>>>>
>>>>>>> Is above plan works for you?
>>>>>>>
>>>>>>
>>>>>> We have slightly rethought our approach, and the functionality that Xuan
>>>>>> requires does not rely on this API. They can, for all intents and purposes, be
>>>>>> considered unrelated issues.
>>>>>>
>>>>>> I still think it's a good idea to update the API that way, so I would like to do
>>>>>> that, and if we have to wait until 22.11 to fix it, I'm OK with that. Since
>>>>>> there no longer is any urgency here, it's acceptable to wait for the next LTS
>> to
>>>>>> break it.
>>>>>>
>>>>>
>>>>> Got it.
>>>>>
>>>>> As far as I understand, main motivation in techboard decision was to
>> prevent the
>>>>> ABI break as much as possible (main reason of decision wasn't deprecation
>> notice
>>>>> being late). But if the correct thing to do is to rename the API (and break the
>>>>> ABI), I don't see the benefit to wait one more year, it is just delaying the
>>>>> impact and adding overhead to us.
>>>>> I am for being pragmatic and doing the change in this release if API rename
>> is
>>>>> better option, perhaps we can visit the issue again in techboard.
>>>>>
>>>>> Can you please describe why renaming API is better option, comparing to
>> adding
>>>>> new API with new parameter?
>>>>
>>>> I take it you meant "why renaming API *isn't* a better option".
>>>>
>>>> The problem we're solving is that the API in question does not know about
>> page
>>>> sizes and thus can't map segments page-by-page. I mean I /guess/ we could
>> have
>>>> two API's (one paged, one not paged), but then we get into all kinds of hairy
>>>> things about the API leaking the details of underlying platform.
>>>>
>>>> Bottom line: i like current API function name. It's concise, it's descriptive.
>>>> It's only missing a parameter, which i would like to add. A rename has been
>>>> suggested (deprecate old API, add new API with a different name, and with
>> added
>>>> parameter), but honestly, I don't see why we have to do that because this is
>>>> predicated upon the assumption that we *can't* break ABI at all, under any
>>>> circumstances.
>>>>
>>>> Can you please explain to me what is wrong with keeping a versioned symbol?
>>>> Like, keep the old function around to keep ABI compatibility, but break the
>> API
>>>> compatibility for those who target 22.02 or later? That's what symbol
>> versioning
>>>> is *for*, is it not?
>>>>
>>>
>>> Nothing wrong with symbol versioning, indeed that is preferred way if it works
>>> for you, I didn't get that symbol versioning is planned.
>>>
>>> @Ray,
>>> Since symbol versioning is planned, ABI won't break, but API will change, can
>>> this change be done in this release without deprecation notice?
>>
>> Yes - I would think so.
>> Since we are going to the effort of using symbol versioning nothing is being
>> depreciated as such (yet).
>>
>>> Later we can have a deprecation notice to remove old symbol on 22.11.
> 
> Thanks for your explanation.
> @Yigit, Ferruh Does it mean that we can do API change in 21.11? If so, we will
> follow the process and target API change in this release. :)
> 

With symbol versioning, yes you can make the change in this release.

You can send another deprecation notice to remove the old symbol for 22.11, that
can be sent anytime until 22.08 released.


^ permalink raw reply	[relevance 0%]

* [dpdk-dev] [PATCH v2 1/3] security: support user specified IV
  @ 2021-09-06 14:58  4%   ` Anoob Joseph
  2021-09-07 16:17  3%   ` [dpdk-dev] [PATCH v3 0/3] Add user specified IV with lookaside IPsec Anoob Joseph
  1 sibling, 0 replies; 200+ results
From: Anoob Joseph @ 2021-09-06 14:58 UTC (permalink / raw)
  To: Akhil Goyal, Declan Doherty, Fan Zhang, Konstantin Ananyev
  Cc: Anoob Joseph, Jerin Jacob, Archana Muniganti, Tejasree Kondoj,
	Hemant Agrawal, Radu Nicolau, Ciara Power, Gagandeep Singh, dev

Enable user to provide IV to be used per security operation. This
would be used with lookaside protocol offload for comparing
against known vectors.

By default, PMD would generate IV internally and would be random.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
---
 doc/guides/rel_notes/release_21_11.rst |  5 +++++
 lib/security/rte_security.h            | 14 ++++++++++++++
 2 files changed, 19 insertions(+)

diff --git a/doc/guides/rel_notes/release_21_11.rst b/doc/guides/rel_notes/release_21_11.rst
index 83da727..a1813bd 100644
--- a/doc/guides/rel_notes/release_21_11.rst
+++ b/doc/guides/rel_notes/release_21_11.rst
@@ -105,6 +105,11 @@ API Changes
    Also, make sure to start the actual text at the margin.
    =======================================================
 
+* security: add IPsec SA option to disable IV generation
+
+  * Added IPsec SA option to disable IV generation to allow known vector
+    tests as well as usage of application provided IV on supported PMDs.
+
 
 ABI Changes
 -----------
diff --git a/lib/security/rte_security.h b/lib/security/rte_security.h
index 88d31de..b4b6776 100644
--- a/lib/security/rte_security.h
+++ b/lib/security/rte_security.h
@@ -181,6 +181,20 @@ struct rte_security_ipsec_sa_options {
 	 * * 0: Disable per session security statistics collection for this SA.
 	 */
 	uint32_t stats : 1;
+
+	/** Disable IV generation in PMD
+	 *
+	 * * 1: Disable IV generation in PMD. When disabled, IV provided in
+	 *      rte_crypto_op will be used by the PMD.
+	 *
+	 * * 0: Enable IV generation in PMD. When enabled, PMD generated random
+	 *      value would be used and application is not required to provide
+	 *      IV.
+	 *
+	 * Note: For inline cases, IV generation would always need to be handled
+	 * by the PMD.
+	 */
+	uint32_t iv_gen_disable : 1;
 };
 
 /** IPSec security association direction */
-- 
2.7.4


^ permalink raw reply	[relevance 4%]

* Re: [dpdk-dev] [RFC PATCH v2] raw/ptdma: introduce ptdma driver
  @ 2021-09-06 17:17  3% ` David Marchand
  0 siblings, 0 replies; 200+ results
From: David Marchand @ 2021-09-06 17:17 UTC (permalink / raw)
  To: Selwin Sebastian; +Cc: dev, Thomas Monjalon

On Mon, Sep 6, 2021 at 6:56 PM Selwin Sebastian
<selwin.sebastian@amd.com> wrote:
>
> Add support for PTDMA driver

- This description is rather short.

Can this new driver be implemented as a dmadev?
See (current revision):
https://patchwork.dpdk.org/project/dpdk/list/?series=18677&state=%2A&archive=both


- In any case, quick comments on this patch:
Please update release notes.
vfio-pci should be preferred over igb_uio.
Please check indent in meson.
ABI version is incorrect in version.map.
RTE_LOG_REGISTER_DEFAULT should be preferred.
The patch is monolithic, could it be split per functionnality to ease review?

Copy relevant maintainers and/or (sub-)tree maintainers to make them
aware of this work, and get those patches reviewed.
Please submit new revisions of patchsets with increased revision
number in title + changelog that helps track what changed between
revisions.

Some of those points are described in:
https://doc.dpdk.org/guides/contributing/patches.html


Thanks.

-- 
David Marchand


^ permalink raw reply	[relevance 3%]

* Re: [dpdk-dev] [RFC 0/7] hide eth dev related structures
  @ 2021-09-06 18:09  0%   ` Ferruh Yigit
  2021-09-14 13:33  3%   ` Ananyev, Konstantin
  1 sibling, 0 replies; 200+ results
From: Ferruh Yigit @ 2021-09-06 18:09 UTC (permalink / raw)
  To: Jerin Jacob, Konstantin Ananyev
  Cc: dpdk-dev, Thomas Monjalon, Andrew Rybchenko, Qiming Yang,
	Qi Zhang, Beilei Xing, techboard

On 8/26/2021 1:37 PM, Jerin Jacob wrote:
> On Fri, Aug 20, 2021 at 9:59 PM Konstantin Ananyev
> <konstantin.ananyev@intel.com> wrote:
>>
>> NOTE: This is just an RFC to start further discussion and collect the feedback.
>> Due to significant amount of work, changes required are applied only to two
>> PMDs so far: net/i40e and net/ice.
>> So to build it you'll need to add:
>> -Denable_drivers='common/*,mempool/*,net/ice,net/i40e'
>> to your config options.
> 
>>
>> That approach was selected to avoid(/minimize) possible performance losses.
>>
>> So far I done only limited amount functional and performance testing.
>> Didn't spot any functional problems, and performance numbers
>> remains the same before and after the patch on my box (testpmd, macswap fwd).
> 
> 
> Based on testing on octeonxt2. We see some regression in testpmd and
> bit on l3fwd too.
> 
> Without patch: 73.5mpps/core in testpmd iofwd
> With out patch: 72 5mpps/core in testpmd iofwd
> 

So roughly 1.3% drop.

> Based on my understanding it is due to additional indirection.
> 

What is the additional indirection? I can see all dereferences area same.

> My suggestion to fix the problem by:
> Removing the additional `data` redirection and pull callback function
> pointers back
> and keep rest as opaque as done in the existing patch like [1]
> 
> I don't believe this has any real implication on future ABI stability
> as we will not be adding
> any new item in rte_eth_fp in any way as new features can be added in slowpath
> rte_eth_dev as mentioned in the patch.
> 
> [2] is the patch of doing the same as I don't see any performance
> regression after [2].
> 

Only there is an additional check after Konstantin's patch (in both
'rte_eth_rx_burst()' & 'rte_eth_tx_burst()'):
"
if (port_id >= RTE_MAX_ETHPORTS)
        return -EINVAL;
"

Which I can see removed again in your patch [2] which fixes the regression. I
wonder if this can be reason of restoring the performance drop, can you please
test original patch by just removing the 'RTE_MAX_ETHPORTS' check?

Thanks,
ferruh

> 
> [1]
> - struct rte_eth_burst_api {
> - struct rte_eth_fp {
> + void *data;
>   rte_eth_rx_burst_t rx_pkt_burst;
>   /**< PMD receive function. */
>   rte_eth_tx_burst_t tx_pkt_burst;
> @@ -85,8 +100,19 @@ struct rte_eth_burst_api {
>   /**< Check the status of a Rx descriptor. */
>   rte_eth_tx_descriptor_status_t tx_descriptor_status;
>   /**< Check the status of a Tx descriptor. */
> + /**
> + * User-supplied functions called from rx_burst to post-process
> + * received packets before passing them to the user
> + */
> + struct rte_eth_rxtx_callback
> + *post_rx_burst_cbs[RTE_MAX_QUEUES_PER_PORT];
> + /**
> + * User-supplied functions called from tx_burst to pre-process
> + * received packets before passing them to the driver for transmission.
> + */
> + struct rte_eth_rxtx_callback *pre_tx_burst_cbs[RTE_MAX_QUEUES_PER_PORT];
>   uintptr_t reserved[2];
> -} __rte_cache_min_aligned;
> +} __rte_cache_aligned;
> 
> [2]
> https://pastebin.com/CuqkrCW4
> 


^ permalink raw reply	[relevance 0%]

* Re: [dpdk-dev] [PATCH v4 4/4] doc: remove deprecation notice for security fast path change
  @ 2021-09-06 18:57  3%     ` Akhil Goyal
  0 siblings, 0 replies; 200+ results
From: Akhil Goyal @ 2021-09-06 18:57 UTC (permalink / raw)
  To: Nithin Kumar Dabilpuram, dev
  Cc: Jerin Jacob Kollanukkaran, hemant.agrawal, thomas, g.singh,
	ferruh.yigit, roy.fan.zhang, olivier.matz, declan.doherty,
	radu.nicolau, jiawenwu, konstantin.ananyev,
	Nithin Kumar Dabilpuram

> Remove deprecation notice for security fast path change.
> 
> Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
> ---
>  doc/guides/rel_notes/deprecation.rst | 4 ----
>  1 file changed, 4 deletions(-)
> 
> diff --git a/doc/guides/rel_notes/deprecation.rst
> b/doc/guides/rel_notes/deprecation.rst
> index 76a4abf..2e38a36 100644
> --- a/doc/guides/rel_notes/deprecation.rst
> +++ b/doc/guides/rel_notes/deprecation.rst
> @@ -279,10 +279,6 @@ Deprecation Notices
>    content. On Linux and FreeBSD, supported prior to DPDK 20.11,
>    original structure will be kept until DPDK 21.11.
> 
> -* security: The functions ``rte_security_set_pkt_metadata`` and
> -  ``rte_security_get_userdata`` will be made inline functions and additional
> -  flags will be added in structure ``rte_security_ctx`` in DPDK 21.11.
> -
Corresponding update in release notes is also needed when a deprecation notice is removed.
You can update in the ABI/API changes section of the release notes.
Also squash this patch in the 2/4 patch. Doc changes should be part of the patch.

Regards

^ permalink raw reply	[relevance 3%]

* [dpdk-dev] [RFC PATCH v5 0/5] Add PIE support for HQoS library
  @ 2021-09-07  7:33  3% ` Liguzinski, WojciechX
    2021-09-07 14:11  3%   ` [dpdk-dev] [RFC PATCH v6 0/5] Add PIE support for HQoS library Liguzinski, WojciechX
  0 siblings, 2 replies; 200+ results
From: Liguzinski, WojciechX @ 2021-09-07  7:33 UTC (permalink / raw)
  To: dev, jasvinder.singh, cristian.dumitrescu; +Cc: megha.ajmera

DPDK sched library is equipped with mechanism that secures it from the bufferbloat problem
which is a situation when excess buffers in the network cause high latency and latency
variation. Currently, it supports RED for active queue management (which is designed
to control the queue length but it does not control latency directly and is now being
obsoleted). However, more advanced queue management is required to address this problem
and provide desirable quality of service to users.

This solution (RFC) proposes usage of new algorithm called "PIE" (Proportional Integral
controller Enhanced) that can effectively and directly control queuing latency to address
the bufferbloat problem.

The implementation of mentioned functionality includes modification of existing and
adding a new set of data structures to the library, adding PIE related APIs.
This affects structures in public API/ABI. That is why deprecation notice is going
to be prepared and sent.

Liguzinski, WojciechX (3):
  sched: add PIE based congestion management
  example/qos_sched: add PIE support
  example/ip_pipeline: add PIE support
  doc/guides/prog_guide: added PIE
  app/test: add tests for PIE

 app/test/autotest_data.py                    |   18 +
 app/test/meson.build                         |    4 +
 app/test/test_pie.c                          | 1076 ++++++++++++++++++
 config/rte_config.h                          |    1 -
 doc/guides/prog_guide/glossary.rst           |    3 +
 doc/guides/prog_guide/qos_framework.rst      |   60 +-
 doc/guides/prog_guide/traffic_management.rst |   13 +-
 drivers/net/softnic/rte_eth_softnic_tm.c     |    6 +-
 examples/ip_pipeline/tmgr.c                  |    6 +-
 examples/qos_sched/app_thread.c              |    1 -
 examples/qos_sched/cfg_file.c                |   82 +-
 examples/qos_sched/init.c                    |    7 +-
 examples/qos_sched/profile.cfg               |  196 ++--
 lib/sched/meson.build                        |   10 +-
 lib/sched/rte_pie.c                          |   86 ++
 lib/sched/rte_pie.h                          |  398 +++++++
 lib/sched/rte_sched.c                        |  228 ++--
 lib/sched/rte_sched.h                        |   53 +-
 lib/sched/version.map                        |    3 +
 19 files changed, 2061 insertions(+), 190 deletions(-)
 create mode 100644 app/test/test_pie.c
 create mode 100644 lib/sched/rte_pie.c
 create mode 100644 lib/sched/rte_pie.h

-- 
2.25.1


^ permalink raw reply	[relevance 3%]

* Re: [dpdk-dev] [PATCH v3] eventdev: update crypto adapter metadata structures
  @ 2021-09-07  8:34  0%   ` Jerin Jacob
  2021-09-07  8:53  0%   ` Gujjar, Abhinandan S
  1 sibling, 0 replies; 200+ results
From: Jerin Jacob @ 2021-09-07  8:34 UTC (permalink / raw)
  To: Shijith Thotton
  Cc: dpdk-dev, Jerin Jacob, Anoob Joseph, Pavan Nikhilesh,
	Akhil Goyal, Abhinandan Gujjar, Ray Kinsella, Ankur Dwivedi

On Tue, Aug 31, 2021 at 1:27 PM Shijith Thotton <sthotton@marvell.com> wrote:
>
> In crypto adapter metadata, reserved bytes in request info structure is
> a space holder for response info. It enforces an order of operation if
> the structures are updated using memcpy to avoid overwriting response
> info. It is logical to move the reserved space out of request info. It
> also solves the ordering issue mentioned before.
>
> This patch removes the reserve field from request info and makes event
> crypto metadata type to structure from union to make space for response
> info.
>
> App and drivers are updated as per metadata change.
>
> Signed-off-by: Shijith Thotton <sthotton@marvell.com>
> Acked-by: Anoob Joseph <anoobj@marvell.com>


@Gujjar, Abhinandan S  @Akhil Goyal

Could you review the crypto adapter-related change?



> ---
> v3:
> * Updated ABI section of release notes.
>
> v2:
> * Updated deprecation notice.
>
> v1:
> * Rebased.
>
>  app/test/test_event_crypto_adapter.c              | 14 +++++++-------
>  doc/guides/rel_notes/deprecation.rst              |  6 ------
>  doc/guides/rel_notes/release_21_11.rst            |  2 ++
>  drivers/crypto/octeontx/otx_cryptodev_ops.c       |  8 ++++----
>  drivers/crypto/octeontx2/otx2_cryptodev_ops.c     |  4 ++--
>  .../event/octeontx2/otx2_evdev_crypto_adptr_tx.h  |  4 ++--
>  lib/eventdev/rte_event_crypto_adapter.c           |  8 ++++----
>  lib/eventdev/rte_event_crypto_adapter.h           | 15 +++++----------
>  8 files changed, 26 insertions(+), 35 deletions(-)
>
> diff --git a/app/test/test_event_crypto_adapter.c b/app/test/test_event_crypto_adapter.c
> index 3ad20921e2..0d73694d3a 100644
> --- a/app/test/test_event_crypto_adapter.c
> +++ b/app/test/test_event_crypto_adapter.c
> @@ -168,7 +168,7 @@ test_op_forward_mode(uint8_t session_less)
>  {
>         struct rte_crypto_sym_xform cipher_xform;
>         struct rte_cryptodev_sym_session *sess;
> -       union rte_event_crypto_metadata m_data;
> +       struct rte_event_crypto_metadata m_data;
>         struct rte_crypto_sym_op *sym_op;
>         struct rte_crypto_op *op;
>         struct rte_mbuf *m;
> @@ -368,7 +368,7 @@ test_op_new_mode(uint8_t session_less)
>  {
>         struct rte_crypto_sym_xform cipher_xform;
>         struct rte_cryptodev_sym_session *sess;
> -       union rte_event_crypto_metadata m_data;
> +       struct rte_event_crypto_metadata m_data;
>         struct rte_crypto_sym_op *sym_op;
>         struct rte_crypto_op *op;
>         struct rte_mbuf *m;
> @@ -406,7 +406,7 @@ test_op_new_mode(uint8_t session_less)
>                 if (cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_SESSION_PRIVATE_DATA) {
>                         /* Fill in private user data information */
>                         rte_memcpy(&m_data.response_info, &response_info,
> -                                  sizeof(m_data));
> +                                  sizeof(response_info));
>                         rte_cryptodev_sym_session_set_user_data(sess,
>                                                 &m_data, sizeof(m_data));
>                 }
> @@ -426,7 +426,7 @@ test_op_new_mode(uint8_t session_less)
>                 op->private_data_offset = len;
>                 /* Fill in private data information */
>                 rte_memcpy(&m_data.response_info, &response_info,
> -                          sizeof(m_data));
> +                          sizeof(response_info));
>                 rte_memcpy((uint8_t *)op + len, &m_data, sizeof(m_data));
>         }
>
> @@ -519,7 +519,7 @@ configure_cryptodev(void)
>                         DEFAULT_NUM_XFORMS *
>                         sizeof(struct rte_crypto_sym_xform) +
>                         MAXIMUM_IV_LENGTH +
> -                       sizeof(union rte_event_crypto_metadata),
> +                       sizeof(struct rte_event_crypto_metadata),
>                         rte_socket_id());
>         if (params.op_mpool == NULL) {
>                 RTE_LOG(ERR, USER1, "Can't create CRYPTO_OP_POOL\n");
> @@ -549,12 +549,12 @@ configure_cryptodev(void)
>          * to include the session headers & private data
>          */
>         session_size = rte_cryptodev_sym_get_private_session_size(TEST_CDEV_ID);
> -       session_size += sizeof(union rte_event_crypto_metadata);
> +       session_size += sizeof(struct rte_event_crypto_metadata);
>
>         params.session_mpool = rte_cryptodev_sym_session_pool_create(
>                         "CRYPTO_ADAPTER_SESSION_MP",
>                         MAX_NB_SESSIONS, 0, 0,
> -                       sizeof(union rte_event_crypto_metadata),
> +                       sizeof(struct rte_event_crypto_metadata),
>                         SOCKET_ID_ANY);
>         TEST_ASSERT_NOT_NULL(params.session_mpool,
>                         "session mempool allocation failed\n");
> diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
> index 76a4abfd6b..58ee95c020 100644
> --- a/doc/guides/rel_notes/deprecation.rst
> +++ b/doc/guides/rel_notes/deprecation.rst
> @@ -266,12 +266,6 @@ Deprecation Notices
>    values to the function ``rte_event_eth_rx_adapter_queue_add`` using
>    the structure ``rte_event_eth_rx_adapter_queue_add``.
>
> -* eventdev: Reserved bytes of ``rte_event_crypto_request`` is a space holder
> -  for ``response_info``. Both should be decoupled for better clarity.
> -  New space for ``response_info`` can be made by changing
> -  ``rte_event_crypto_metadata`` type to structure from union.
> -  This change is targeted for DPDK 21.11.
> -
>  * metrics: The function ``rte_metrics_init`` will have a non-void return
>    in order to notify errors instead of calling ``rte_exit``.
>
> diff --git a/doc/guides/rel_notes/release_21_11.rst b/doc/guides/rel_notes/release_21_11.rst
> index d707a554ef..ab76d5dd55 100644
> --- a/doc/guides/rel_notes/release_21_11.rst
> +++ b/doc/guides/rel_notes/release_21_11.rst
> @@ -100,6 +100,8 @@ ABI Changes
>     Also, make sure to start the actual text at the margin.
>     =======================================================
>
> +* eventdev: Modified type of ``union rte_event_crypto_metadata`` to struct and
> +  removed reserved bytes from ``struct rte_event_crypto_request``.
>
>  Known Issues
>  ------------
> diff --git a/drivers/crypto/octeontx/otx_cryptodev_ops.c b/drivers/crypto/octeontx/otx_cryptodev_ops.c
> index eac6796cfb..c51be63146 100644
> --- a/drivers/crypto/octeontx/otx_cryptodev_ops.c
> +++ b/drivers/crypto/octeontx/otx_cryptodev_ops.c
> @@ -710,17 +710,17 @@ submit_request_to_sso(struct ssows *ws, uintptr_t req,
>         ssovf_store_pair(add_work, req, ws->grps[rsp_info->queue_id]);
>  }
>
> -static inline union rte_event_crypto_metadata *
> +static inline struct rte_event_crypto_metadata *
>  get_event_crypto_mdata(struct rte_crypto_op *op)
>  {
> -       union rte_event_crypto_metadata *ec_mdata;
> +       struct rte_event_crypto_metadata *ec_mdata;
>
>         if (op->sess_type == RTE_CRYPTO_OP_WITH_SESSION)
>                 ec_mdata = rte_cryptodev_sym_session_get_user_data(
>                                                            op->sym->session);
>         else if (op->sess_type == RTE_CRYPTO_OP_SESSIONLESS &&
>                  op->private_data_offset)
> -               ec_mdata = (union rte_event_crypto_metadata *)
> +               ec_mdata = (struct rte_event_crypto_metadata *)
>                         ((uint8_t *)op + op->private_data_offset);
>         else
>                 return NULL;
> @@ -731,7 +731,7 @@ get_event_crypto_mdata(struct rte_crypto_op *op)
>  uint16_t __rte_hot
>  otx_crypto_adapter_enqueue(void *port, struct rte_crypto_op *op)
>  {
> -       union rte_event_crypto_metadata *ec_mdata;
> +       struct rte_event_crypto_metadata *ec_mdata;
>         struct cpt_instance *instance;
>         struct cpt_request_info *req;
>         struct rte_event *rsp_info;
> diff --git a/drivers/crypto/octeontx2/otx2_cryptodev_ops.c b/drivers/crypto/octeontx2/otx2_cryptodev_ops.c
> index 42100154cd..952d1352f4 100644
> --- a/drivers/crypto/octeontx2/otx2_cryptodev_ops.c
> +++ b/drivers/crypto/octeontx2/otx2_cryptodev_ops.c
> @@ -453,7 +453,7 @@ otx2_ca_enqueue_req(const struct otx2_cpt_qp *qp,
>                     struct rte_crypto_op *op,
>                     uint64_t cpt_inst_w7)
>  {
> -       union rte_event_crypto_metadata *m_data;
> +       struct rte_event_crypto_metadata *m_data;
>         union cpt_inst_s inst;
>         uint64_t lmt_status;
>
> @@ -468,7 +468,7 @@ otx2_ca_enqueue_req(const struct otx2_cpt_qp *qp,
>                 }
>         } else if (op->sess_type == RTE_CRYPTO_OP_SESSIONLESS &&
>                    op->private_data_offset) {
> -               m_data = (union rte_event_crypto_metadata *)
> +               m_data = (struct rte_event_crypto_metadata *)
>                          ((uint8_t *)op +
>                           op->private_data_offset);
>         } else {
> diff --git a/drivers/event/octeontx2/otx2_evdev_crypto_adptr_tx.h b/drivers/event/octeontx2/otx2_evdev_crypto_adptr_tx.h
> index ecf7eb9f56..458e8306d7 100644
> --- a/drivers/event/octeontx2/otx2_evdev_crypto_adptr_tx.h
> +++ b/drivers/event/octeontx2/otx2_evdev_crypto_adptr_tx.h
> @@ -16,7 +16,7 @@
>  static inline uint16_t
>  otx2_ca_enq(uintptr_t tag_op, const struct rte_event *ev)
>  {
> -       union rte_event_crypto_metadata *m_data;
> +       struct rte_event_crypto_metadata *m_data;
>         struct rte_crypto_op *crypto_op;
>         struct rte_cryptodev *cdev;
>         struct otx2_cpt_qp *qp;
> @@ -37,7 +37,7 @@ otx2_ca_enq(uintptr_t tag_op, const struct rte_event *ev)
>                 qp_id = m_data->request_info.queue_pair_id;
>         } else if (crypto_op->sess_type == RTE_CRYPTO_OP_SESSIONLESS &&
>                    crypto_op->private_data_offset) {
> -               m_data = (union rte_event_crypto_metadata *)
> +               m_data = (struct rte_event_crypto_metadata *)
>                          ((uint8_t *)crypto_op +
>                           crypto_op->private_data_offset);
>                 cdev_id = m_data->request_info.cdev_id;
> diff --git a/lib/eventdev/rte_event_crypto_adapter.c b/lib/eventdev/rte_event_crypto_adapter.c
> index e1d38d383d..6977391ae9 100644
> --- a/lib/eventdev/rte_event_crypto_adapter.c
> +++ b/lib/eventdev/rte_event_crypto_adapter.c
> @@ -333,7 +333,7 @@ eca_enq_to_cryptodev(struct rte_event_crypto_adapter *adapter,
>                  struct rte_event *ev, unsigned int cnt)
>  {
>         struct rte_event_crypto_adapter_stats *stats = &adapter->crypto_stats;
> -       union rte_event_crypto_metadata *m_data = NULL;
> +       struct rte_event_crypto_metadata *m_data = NULL;
>         struct crypto_queue_pair_info *qp_info = NULL;
>         struct rte_crypto_op *crypto_op;
>         unsigned int i, n;
> @@ -371,7 +371,7 @@ eca_enq_to_cryptodev(struct rte_event_crypto_adapter *adapter,
>                         len++;
>                 } else if (crypto_op->sess_type == RTE_CRYPTO_OP_SESSIONLESS &&
>                                 crypto_op->private_data_offset) {
> -                       m_data = (union rte_event_crypto_metadata *)
> +                       m_data = (struct rte_event_crypto_metadata *)
>                                  ((uint8_t *)crypto_op +
>                                         crypto_op->private_data_offset);
>                         cdev_id = m_data->request_info.cdev_id;
> @@ -504,7 +504,7 @@ eca_ops_enqueue_burst(struct rte_event_crypto_adapter *adapter,
>                   struct rte_crypto_op **ops, uint16_t num)
>  {
>         struct rte_event_crypto_adapter_stats *stats = &adapter->crypto_stats;
> -       union rte_event_crypto_metadata *m_data = NULL;
> +       struct rte_event_crypto_metadata *m_data = NULL;
>         uint8_t event_dev_id = adapter->eventdev_id;
>         uint8_t event_port_id = adapter->event_port_id;
>         struct rte_event events[BATCH_SIZE];
> @@ -523,7 +523,7 @@ eca_ops_enqueue_burst(struct rte_event_crypto_adapter *adapter,
>                                         ops[i]->sym->session);
>                 } else if (ops[i]->sess_type == RTE_CRYPTO_OP_SESSIONLESS &&
>                                 ops[i]->private_data_offset) {
> -                       m_data = (union rte_event_crypto_metadata *)
> +                       m_data = (struct rte_event_crypto_metadata *)
>                                  ((uint8_t *)ops[i] +
>                                   ops[i]->private_data_offset);
>                 }
> diff --git a/lib/eventdev/rte_event_crypto_adapter.h b/lib/eventdev/rte_event_crypto_adapter.h
> index f8c6cca87c..3c24d9d9df 100644
> --- a/lib/eventdev/rte_event_crypto_adapter.h
> +++ b/lib/eventdev/rte_event_crypto_adapter.h
> @@ -200,11 +200,6 @@ enum rte_event_crypto_adapter_mode {
>   * provide event request information to the adapter.
>   */
>  struct rte_event_crypto_request {
> -       uint8_t resv[8];
> -       /**< Overlaps with first 8 bytes of struct rte_event
> -        * that encode the response event information. Application
> -        * is expected to fill in struct rte_event response_info.
> -        */
>         uint16_t cdev_id;
>         /**< cryptodev ID to be used */
>         uint16_t queue_pair_id;
> @@ -223,16 +218,16 @@ struct rte_event_crypto_request {
>   * operation. If the transfer is done by SW, event response information
>   * will be used by the adapter.
>   */
> -union rte_event_crypto_metadata {
> -       struct rte_event_crypto_request request_info;
> -       /**< Request information to be filled in by application
> -        * for RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD mode.
> -        */
> +struct rte_event_crypto_metadata {
>         struct rte_event response_info;
>         /**< Response information to be filled in by application
>          * for RTE_EVENT_CRYPTO_ADAPTER_OP_NEW and
>          * RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD mode.
>          */
> +       struct rte_event_crypto_request request_info;
> +       /**< Request information to be filled in by application
> +        * for RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD mode.
> +        */
>  };
>
>  /**
> --
> 2.25.1
>

^ permalink raw reply	[relevance 0%]

* Re: [dpdk-dev] [PATCH] RFC: ethdev: add reassembly offload
  @ 2021-09-07  8:47  4% ` Ferruh Yigit
  2021-09-08 10:29  0%   ` [dpdk-dev] [EXT] " Anoob Joseph
  0 siblings, 1 reply; 200+ results
From: Ferruh Yigit @ 2021-09-07  8:47 UTC (permalink / raw)
  To: Akhil Goyal, dev
  Cc: anoobj, radu.nicolau, declan.doherty, hemant.agrawal, matan,
	konstantin.ananyev, thomas, adwivedi, andrew.rybchenko

On 8/23/2021 11:02 AM, Akhil Goyal wrote:
> Reassembly is a costly operation if it is done in
> software, however, if it is offloaded to HW, it can
> considerably save application cycles.
> The operation becomes even more costlier if IP fragmants
> are encrypted.
> 
> To resolve above two issues, a new offload
> DEV_RX_OFFLOAD_REASSEMBLY is introduced in ethdev for
> devices which can attempt reassembly of packets in hardware.
> rte_eth_dev_info is added with the reassembly capabilities
> which a device can support.
> Now, if IP fragments are encrypted, reassembly can also be
> attempted while doing inline IPsec processing.
> This is controlled by a flag in rte_security_ipsec_sa_options
> to enable reassembly of encrypted IP fragments in the inline
> path.
> 
> The resulting reassembled packet would be a typical
> segmented mbuf in case of success.
> 
> And if reassembly of fragments is failed or is incomplete (if
> fragments do not come before the reass_timeout), the mbuf is
> updated with an ol_flag PKT_RX_REASSEMBLY_INCOMPLETE and
> mbuf is returned as is. Now application may decide the fate
> of the packet to wait more for fragments to come or drop.
> 
> Signed-off-by: Akhil Goyal <gakhil@marvell.com>
> ---
>  lib/ethdev/rte_ethdev.c     |  1 +
>  lib/ethdev/rte_ethdev.h     | 18 +++++++++++++++++-
>  lib/mbuf/rte_mbuf_core.h    |  3 ++-
>  lib/security/rte_security.h | 10 ++++++++++
>  4 files changed, 30 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c
> index 9d95cd11e1..1ab3a093cf 100644
> --- a/lib/ethdev/rte_ethdev.c
> +++ b/lib/ethdev/rte_ethdev.c
> @@ -119,6 +119,7 @@ static const struct {
>  	RTE_RX_OFFLOAD_BIT2STR(VLAN_FILTER),
>  	RTE_RX_OFFLOAD_BIT2STR(VLAN_EXTEND),
>  	RTE_RX_OFFLOAD_BIT2STR(JUMBO_FRAME),
> +	RTE_RX_OFFLOAD_BIT2STR(REASSEMBLY),
>  	RTE_RX_OFFLOAD_BIT2STR(SCATTER),
>  	RTE_RX_OFFLOAD_BIT2STR(TIMESTAMP),
>  	RTE_RX_OFFLOAD_BIT2STR(SECURITY),
> diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h
> index d2b27c351f..e89a4dc1eb 100644
> --- a/lib/ethdev/rte_ethdev.h
> +++ b/lib/ethdev/rte_ethdev.h
> @@ -1360,6 +1360,7 @@ struct rte_eth_conf {
>  #define DEV_RX_OFFLOAD_VLAN_FILTER	0x00000200
>  #define DEV_RX_OFFLOAD_VLAN_EXTEND	0x00000400
>  #define DEV_RX_OFFLOAD_JUMBO_FRAME	0x00000800
> +#define DEV_RX_OFFLOAD_REASSEMBLY	0x00001000

previous '0x00001000' was 'DEV_RX_OFFLOAD_CRC_STRIP', it has been long that
offload has been removed, but not sure if it cause any problem to re-use it.

>  #define DEV_RX_OFFLOAD_SCATTER		0x00002000
>  /**
>   * Timestamp is set by the driver in RTE_MBUF_DYNFIELD_TIMESTAMP_NAME
> @@ -1477,6 +1478,20 @@ struct rte_eth_dev_portconf {
>   */
>  #define RTE_ETH_DEV_SWITCH_DOMAIN_ID_INVALID	(UINT16_MAX)
>  
> +/**
> + * Reassembly capabilities that a device can support.
> + * The device which can support reassembly offload should set
> + * DEV_RX_OFFLOAD_REASSEMBLY
> + */
> +struct rte_eth_reass_capa {
> +	/** Maximum time in ns that a fragment can wait for further fragments */
> +	uint64_t reass_timeout;
> +	/** Maximum number of fragments that device can reassemble */
> +	uint16_t max_frags;
> +	/** Reserved for future capabilities */
> +	uint16_t reserved[3];
> +};
> +

I wonder if there is any other hardware around supports reassembly offload, it
would be good to get more feedback on the capabilities list.

>  /**
>   * Ethernet device associated switch information
>   */
> @@ -1582,8 +1597,9 @@ struct rte_eth_dev_info {
>  	 * embedded managed interconnect/switch.
>  	 */
>  	struct rte_eth_switch_info switch_info;
> +	/* Reassembly capabilities of a device for reassembly offload */
> +	struct rte_eth_reass_capa reass_capa;
>  
> -	uint64_t reserved_64s[2]; /**< Reserved for future fields */

Reserved fields were added to be able to update the struct without breaking the
ABI, so that a critical change doesn't have to wait until next ABI break release.
Since this is ABI break release, we can keep the reserved field and add the new
struct. Or this can be an opportunity to get rid of the reserved field.

Personally I have no objection to get rid of the reserved field, but better to
agree on this explicitly.

>  	void *reserved_ptrs[2];   /**< Reserved for future fields */
>  };
>  
> diff --git a/lib/mbuf/rte_mbuf_core.h b/lib/mbuf/rte_mbuf_core.h
> index bb38d7f581..cea25c87f7 100644
> --- a/lib/mbuf/rte_mbuf_core.h
> +++ b/lib/mbuf/rte_mbuf_core.h
> @@ -200,10 +200,11 @@ extern "C" {
>  #define PKT_RX_OUTER_L4_CKSUM_BAD	(1ULL << 21)
>  #define PKT_RX_OUTER_L4_CKSUM_GOOD	(1ULL << 22)
>  #define PKT_RX_OUTER_L4_CKSUM_INVALID	((1ULL << 21) | (1ULL << 22))
> +#define PKT_RX_REASSEMBLY_INCOMPLETE	(1ULL << 23)
>  

Similar comment with Andrew's, what is the expectation from application if this
flag exists? Can we drop it to simplify the logic in the application?

>  /* add new RX flags here, don't forget to update PKT_FIRST_FREE */
>  
> -#define PKT_FIRST_FREE (1ULL << 23)
> +#define PKT_FIRST_FREE (1ULL << 24)
>  #define PKT_LAST_FREE (1ULL << 40)
>  
>  /* add new TX flags here, don't forget to update PKT_LAST_FREE  */
> diff --git a/lib/security/rte_security.h b/lib/security/rte_security.h
> index 88d31de0a6..364eeb5cd4 100644
> --- a/lib/security/rte_security.h
> +++ b/lib/security/rte_security.h
> @@ -181,6 +181,16 @@ struct rte_security_ipsec_sa_options {
>  	 * * 0: Disable per session security statistics collection for this SA.
>  	 */
>  	uint32_t stats : 1;
> +
> +	/** Enable reassembly on incoming packets.
> +	 *
> +	 * * 1: Enable driver to try reassembly of encrypted IP packets for
> +	 *      this SA, if supported by the driver. This feature will work
> +	 *      only if rx_offload DEV_RX_OFFLOAD_REASSEMBLY is set in
> +	 *      inline ethernet device.
> +	 * * 0: Disable reassembly of packets (default).
> +	 */
> +	uint32_t reass_en : 1;
>  };
>  
>  /** IPSec security association direction */
> 


^ permalink raw reply	[relevance 4%]

* Re: [dpdk-dev] [PATCH v3] eventdev: update crypto adapter metadata structures
    2021-09-07  8:34  0%   ` Jerin Jacob
@ 2021-09-07  8:53  0%   ` Gujjar, Abhinandan S
  2021-09-07 10:37  0%     ` Shijith Thotton
  1 sibling, 1 reply; 200+ results
From: Gujjar, Abhinandan S @ 2021-09-07  8:53 UTC (permalink / raw)
  To: Shijith Thotton, dev
  Cc: jerinj, anoobj, pbhagavatula, gakhil, Ray Kinsella, Ankur Dwivedi

Hi Shijith,

> -----Original Message-----
> From: Shijith Thotton <sthotton@marvell.com>
> Sent: Tuesday, August 31, 2021 1:27 PM
> To: dev@dpdk.org
> Cc: Shijith Thotton <sthotton@marvell.com>; jerinj@marvell.com;
> anoobj@marvell.com; pbhagavatula@marvell.com; gakhil@marvell.com;
> Gujjar, Abhinandan S <abhinandan.gujjar@intel.com>; Ray Kinsella
> <mdr@ashroe.eu>; Ankur Dwivedi <adwivedi@marvell.com>
> Subject: [PATCH v3] eventdev: update crypto adapter metadata structures
> 
> In crypto adapter metadata, reserved bytes in request info structure is a
> space holder for response info. It enforces an order of operation if the
> structures are updated using memcpy to avoid overwriting response info. It
> is logical to move the reserved space out of request info. It also solves the
> ordering issue mentioned before.
I would like to understand what kind of ordering issue you have faced with
the current approach. Could you please give an example/sequence and explain?

> 
> This patch removes the reserve field from request info and makes event
> crypto metadata type to structure from union to make space for response
> info.
> 
> App and drivers are updated as per metadata change.
> 
> Signed-off-by: Shijith Thotton <sthotton@marvell.com>
> Acked-by: Anoob Joseph <anoobj@marvell.com>
> ---
> v3:
> * Updated ABI section of release notes.
> 
> v2:
> * Updated deprecation notice.
> 
> v1:
> * Rebased.
> 
>  app/test/test_event_crypto_adapter.c              | 14 +++++++-------
>  doc/guides/rel_notes/deprecation.rst              |  6 ------
>  doc/guides/rel_notes/release_21_11.rst            |  2 ++
>  drivers/crypto/octeontx/otx_cryptodev_ops.c       |  8 ++++----
>  drivers/crypto/octeontx2/otx2_cryptodev_ops.c     |  4 ++--
>  .../event/octeontx2/otx2_evdev_crypto_adptr_tx.h  |  4 ++--
>  lib/eventdev/rte_event_crypto_adapter.c           |  8 ++++----
>  lib/eventdev/rte_event_crypto_adapter.h           | 15 +++++----------
>  8 files changed, 26 insertions(+), 35 deletions(-)
> 
> diff --git a/app/test/test_event_crypto_adapter.c
> b/app/test/test_event_crypto_adapter.c
> index 3ad20921e2..0d73694d3a 100644
> --- a/app/test/test_event_crypto_adapter.c
> +++ b/app/test/test_event_crypto_adapter.c
> @@ -168,7 +168,7 @@ test_op_forward_mode(uint8_t session_less)  {
>  	struct rte_crypto_sym_xform cipher_xform;
>  	struct rte_cryptodev_sym_session *sess;
> -	union rte_event_crypto_metadata m_data;
> +	struct rte_event_crypto_metadata m_data;
>  	struct rte_crypto_sym_op *sym_op;
>  	struct rte_crypto_op *op;
>  	struct rte_mbuf *m;
> @@ -368,7 +368,7 @@ test_op_new_mode(uint8_t session_less)  {
>  	struct rte_crypto_sym_xform cipher_xform;
>  	struct rte_cryptodev_sym_session *sess;
> -	union rte_event_crypto_metadata m_data;
> +	struct rte_event_crypto_metadata m_data;
>  	struct rte_crypto_sym_op *sym_op;
>  	struct rte_crypto_op *op;
>  	struct rte_mbuf *m;
> @@ -406,7 +406,7 @@ test_op_new_mode(uint8_t session_less)
>  		if (cap &
> RTE_EVENT_CRYPTO_ADAPTER_CAP_SESSION_PRIVATE_DATA) {
>  			/* Fill in private user data information */
>  			rte_memcpy(&m_data.response_info,
> &response_info,
> -				   sizeof(m_data));
> +				   sizeof(response_info));
>  			rte_cryptodev_sym_session_set_user_data(sess,
>  						&m_data, sizeof(m_data));
>  		}
> @@ -426,7 +426,7 @@ test_op_new_mode(uint8_t session_less)
>  		op->private_data_offset = len;
>  		/* Fill in private data information */
>  		rte_memcpy(&m_data.response_info, &response_info,
> -			   sizeof(m_data));
> +			   sizeof(response_info));
>  		rte_memcpy((uint8_t *)op + len, &m_data, sizeof(m_data));
>  	}
> 
> @@ -519,7 +519,7 @@ configure_cryptodev(void)
>  			DEFAULT_NUM_XFORMS *
>  			sizeof(struct rte_crypto_sym_xform) +
>  			MAXIMUM_IV_LENGTH +
> -			sizeof(union rte_event_crypto_metadata),
> +			sizeof(struct rte_event_crypto_metadata),
>  			rte_socket_id());
>  	if (params.op_mpool == NULL) {
>  		RTE_LOG(ERR, USER1, "Can't create CRYPTO_OP_POOL\n");
> @@ -549,12 +549,12 @@ configure_cryptodev(void)
>  	 * to include the session headers & private data
>  	 */
>  	session_size =
> rte_cryptodev_sym_get_private_session_size(TEST_CDEV_ID);
> -	session_size += sizeof(union rte_event_crypto_metadata);
> +	session_size += sizeof(struct rte_event_crypto_metadata);
> 
>  	params.session_mpool = rte_cryptodev_sym_session_pool_create(
>  			"CRYPTO_ADAPTER_SESSION_MP",
>  			MAX_NB_SESSIONS, 0, 0,
> -			sizeof(union rte_event_crypto_metadata),
> +			sizeof(struct rte_event_crypto_metadata),
>  			SOCKET_ID_ANY);
>  	TEST_ASSERT_NOT_NULL(params.session_mpool,
>  			"session mempool allocation failed\n"); diff --git
> a/doc/guides/rel_notes/deprecation.rst
> b/doc/guides/rel_notes/deprecation.rst
> index 76a4abfd6b..58ee95c020 100644
> --- a/doc/guides/rel_notes/deprecation.rst
> +++ b/doc/guides/rel_notes/deprecation.rst
> @@ -266,12 +266,6 @@ Deprecation Notices
>    values to the function ``rte_event_eth_rx_adapter_queue_add`` using
>    the structure ``rte_event_eth_rx_adapter_queue_add``.
> 
> -* eventdev: Reserved bytes of ``rte_event_crypto_request`` is a space
> holder
> -  for ``response_info``. Both should be decoupled for better clarity.
> -  New space for ``response_info`` can be made by changing
> -  ``rte_event_crypto_metadata`` type to structure from union.
> -  This change is targeted for DPDK 21.11.
> -
>  * metrics: The function ``rte_metrics_init`` will have a non-void return
>    in order to notify errors instead of calling ``rte_exit``.
> 
> diff --git a/doc/guides/rel_notes/release_21_11.rst
> b/doc/guides/rel_notes/release_21_11.rst
> index d707a554ef..ab76d5dd55 100644
> --- a/doc/guides/rel_notes/release_21_11.rst
> +++ b/doc/guides/rel_notes/release_21_11.rst
> @@ -100,6 +100,8 @@ ABI Changes
>     Also, make sure to start the actual text at the margin.
>     =======================================================
> 
> +* eventdev: Modified type of ``union rte_event_crypto_metadata`` to
> +struct and
> +  removed reserved bytes from ``struct rte_event_crypto_request``.
> 
>  Known Issues
>  ------------
> diff --git a/drivers/crypto/octeontx/otx_cryptodev_ops.c
> b/drivers/crypto/octeontx/otx_cryptodev_ops.c
> index eac6796cfb..c51be63146 100644
> --- a/drivers/crypto/octeontx/otx_cryptodev_ops.c
> +++ b/drivers/crypto/octeontx/otx_cryptodev_ops.c
> @@ -710,17 +710,17 @@ submit_request_to_sso(struct ssows *ws,
> uintptr_t req,
>  	ssovf_store_pair(add_work, req, ws->grps[rsp_info->queue_id]);  }
> 
> -static inline union rte_event_crypto_metadata *
> +static inline struct rte_event_crypto_metadata *
>  get_event_crypto_mdata(struct rte_crypto_op *op)  {
> -	union rte_event_crypto_metadata *ec_mdata;
> +	struct rte_event_crypto_metadata *ec_mdata;
> 
>  	if (op->sess_type == RTE_CRYPTO_OP_WITH_SESSION)
>  		ec_mdata = rte_cryptodev_sym_session_get_user_data(
>  							   op->sym->session);
>  	else if (op->sess_type == RTE_CRYPTO_OP_SESSIONLESS &&
>  		 op->private_data_offset)
> -		ec_mdata = (union rte_event_crypto_metadata *)
> +		ec_mdata = (struct rte_event_crypto_metadata *)
>  			((uint8_t *)op + op->private_data_offset);
>  	else
>  		return NULL;
> @@ -731,7 +731,7 @@ get_event_crypto_mdata(struct rte_crypto_op *op)
> uint16_t __rte_hot  otx_crypto_adapter_enqueue(void *port, struct
> rte_crypto_op *op)  {
> -	union rte_event_crypto_metadata *ec_mdata;
> +	struct rte_event_crypto_metadata *ec_mdata;
>  	struct cpt_instance *instance;
>  	struct cpt_request_info *req;
>  	struct rte_event *rsp_info;
> diff --git a/drivers/crypto/octeontx2/otx2_cryptodev_ops.c
> b/drivers/crypto/octeontx2/otx2_cryptodev_ops.c
> index 42100154cd..952d1352f4 100644
> --- a/drivers/crypto/octeontx2/otx2_cryptodev_ops.c
> +++ b/drivers/crypto/octeontx2/otx2_cryptodev_ops.c
> @@ -453,7 +453,7 @@ otx2_ca_enqueue_req(const struct otx2_cpt_qp *qp,
>  		    struct rte_crypto_op *op,
>  		    uint64_t cpt_inst_w7)
>  {
> -	union rte_event_crypto_metadata *m_data;
> +	struct rte_event_crypto_metadata *m_data;
>  	union cpt_inst_s inst;
>  	uint64_t lmt_status;
> 
> @@ -468,7 +468,7 @@ otx2_ca_enqueue_req(const struct otx2_cpt_qp *qp,
>  		}
>  	} else if (op->sess_type == RTE_CRYPTO_OP_SESSIONLESS &&
>  		   op->private_data_offset) {
> -		m_data = (union rte_event_crypto_metadata *)
> +		m_data = (struct rte_event_crypto_metadata *)
>  			 ((uint8_t *)op +
>  			  op->private_data_offset);
>  	} else {
> diff --git a/drivers/event/octeontx2/otx2_evdev_crypto_adptr_tx.h
> b/drivers/event/octeontx2/otx2_evdev_crypto_adptr_tx.h
> index ecf7eb9f56..458e8306d7 100644
> --- a/drivers/event/octeontx2/otx2_evdev_crypto_adptr_tx.h
> +++ b/drivers/event/octeontx2/otx2_evdev_crypto_adptr_tx.h
> @@ -16,7 +16,7 @@
>  static inline uint16_t
>  otx2_ca_enq(uintptr_t tag_op, const struct rte_event *ev)  {
> -	union rte_event_crypto_metadata *m_data;
> +	struct rte_event_crypto_metadata *m_data;
>  	struct rte_crypto_op *crypto_op;
>  	struct rte_cryptodev *cdev;
>  	struct otx2_cpt_qp *qp;
> @@ -37,7 +37,7 @@ otx2_ca_enq(uintptr_t tag_op, const struct rte_event
> *ev)
>  		qp_id = m_data->request_info.queue_pair_id;
>  	} else if (crypto_op->sess_type == RTE_CRYPTO_OP_SESSIONLESS
> &&
>  		   crypto_op->private_data_offset) {
> -		m_data = (union rte_event_crypto_metadata *)
> +		m_data = (struct rte_event_crypto_metadata *)
>  			 ((uint8_t *)crypto_op +
>  			  crypto_op->private_data_offset);
>  		cdev_id = m_data->request_info.cdev_id; diff --git
> a/lib/eventdev/rte_event_crypto_adapter.c
> b/lib/eventdev/rte_event_crypto_adapter.c
> index e1d38d383d..6977391ae9 100644
> --- a/lib/eventdev/rte_event_crypto_adapter.c
> +++ b/lib/eventdev/rte_event_crypto_adapter.c
> @@ -333,7 +333,7 @@ eca_enq_to_cryptodev(struct
> rte_event_crypto_adapter *adapter,
>  		 struct rte_event *ev, unsigned int cnt)  {
>  	struct rte_event_crypto_adapter_stats *stats = &adapter-
> >crypto_stats;
> -	union rte_event_crypto_metadata *m_data = NULL;
> +	struct rte_event_crypto_metadata *m_data = NULL;
>  	struct crypto_queue_pair_info *qp_info = NULL;
>  	struct rte_crypto_op *crypto_op;
>  	unsigned int i, n;
> @@ -371,7 +371,7 @@ eca_enq_to_cryptodev(struct
> rte_event_crypto_adapter *adapter,
>  			len++;
>  		} else if (crypto_op->sess_type ==
> RTE_CRYPTO_OP_SESSIONLESS &&
>  				crypto_op->private_data_offset) {
> -			m_data = (union rte_event_crypto_metadata *)
> +			m_data = (struct rte_event_crypto_metadata *)
>  				 ((uint8_t *)crypto_op +
>  					crypto_op->private_data_offset);
>  			cdev_id = m_data->request_info.cdev_id; @@ -
> 504,7 +504,7 @@ eca_ops_enqueue_burst(struct rte_event_crypto_adapter
> *adapter,
>  		  struct rte_crypto_op **ops, uint16_t num)  {
>  	struct rte_event_crypto_adapter_stats *stats = &adapter-
> >crypto_stats;
> -	union rte_event_crypto_metadata *m_data = NULL;
> +	struct rte_event_crypto_metadata *m_data = NULL;
>  	uint8_t event_dev_id = adapter->eventdev_id;
>  	uint8_t event_port_id = adapter->event_port_id;
>  	struct rte_event events[BATCH_SIZE];
> @@ -523,7 +523,7 @@ eca_ops_enqueue_burst(struct
> rte_event_crypto_adapter *adapter,
>  					ops[i]->sym->session);
>  		} else if (ops[i]->sess_type ==
> RTE_CRYPTO_OP_SESSIONLESS &&
>  				ops[i]->private_data_offset) {
> -			m_data = (union rte_event_crypto_metadata *)
> +			m_data = (struct rte_event_crypto_metadata *)
>  				 ((uint8_t *)ops[i] +
>  				  ops[i]->private_data_offset);
>  		}
> diff --git a/lib/eventdev/rte_event_crypto_adapter.h
> b/lib/eventdev/rte_event_crypto_adapter.h
> index f8c6cca87c..3c24d9d9df 100644
> --- a/lib/eventdev/rte_event_crypto_adapter.h
> +++ b/lib/eventdev/rte_event_crypto_adapter.h
> @@ -200,11 +200,6 @@ enum rte_event_crypto_adapter_mode {
>   * provide event request information to the adapter.
>   */
>  struct rte_event_crypto_request {
> -	uint8_t resv[8];
> -	/**< Overlaps with first 8 bytes of struct rte_event
> -	 * that encode the response event information. Application
> -	 * is expected to fill in struct rte_event response_info.
> -	 */
>  	uint16_t cdev_id;
>  	/**< cryptodev ID to be used */
>  	uint16_t queue_pair_id;
> @@ -223,16 +218,16 @@ struct rte_event_crypto_request {
>   * operation. If the transfer is done by SW, event response information
>   * will be used by the adapter.
>   */
> -union rte_event_crypto_metadata {
> -	struct rte_event_crypto_request request_info;
> -	/**< Request information to be filled in by application
> -	 * for RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD mode.
> -	 */
> +struct rte_event_crypto_metadata {
>  	struct rte_event response_info;
>  	/**< Response information to be filled in by application
>  	 * for RTE_EVENT_CRYPTO_ADAPTER_OP_NEW and
>  	 * RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD mode.
>  	 */
> +	struct rte_event_crypto_request request_info;
> +	/**< Request information to be filled in by application
> +	 * for RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD mode.
> +	 */
>  };
> 
>  /**
> --
> 2.25.1


^ permalink raw reply	[relevance 0%]

* Re: [dpdk-dev] [PATCH v3] eventdev: update crypto adapter metadata structures
  2021-09-07  8:53  0%   ` Gujjar, Abhinandan S
@ 2021-09-07 10:37  0%     ` Shijith Thotton
  2021-09-07 17:30  0%       ` Gujjar, Abhinandan S
  0 siblings, 1 reply; 200+ results
From: Shijith Thotton @ 2021-09-07 10:37 UTC (permalink / raw)
  To: Gujjar, Abhinandan S, dev
  Cc: Jerin Jacob Kollanukkaran, Anoob Joseph,
	Pavan Nikhilesh Bhagavatula, Akhil Goyal, Ray Kinsella,
	Ankur Dwivedi

Hi Abhinandan,

>> In crypto adapter metadata, reserved bytes in request info structure is a
>> space holder for response info. It enforces an order of operation if the
>> structures are updated using memcpy to avoid overwriting response info. It
>> is logical to move the reserved space out of request info. It also solves the
>> ordering issue mentioned before.
>I would like to understand what kind of ordering issue you have faced with
>the current approach. Could you please give an example/sequence and explain?
>

I have seen this issue with crypto adapter autotest (#n215).

Example:
rte_memcpy(&m_data.response_info, &response_info, sizeof(response_info));
rte_memcpy(&m_data.request_info, &request_info, sizeof(request_info));

Here response info is getting overwritten by request info.
Above lines can reordered to fix the issue, but can be ignored with this patch.

>>
>> This patch removes the reserve field from request info and makes event
>> crypto metadata type to structure from union to make space for response
>> info.
>>
>> App and drivers are updated as per metadata change.
>>
>> Signed-off-by: Shijith Thotton <sthotton@marvell.com>
>> Acked-by: Anoob Joseph <anoobj@marvell.com>
>> ---
>> v3:
>> * Updated ABI section of release notes.
>>
>> v2:
>> * Updated deprecation notice.
>>
>> v1:
>> * Rebased.
>>
>>  app/test/test_event_crypto_adapter.c              | 14 +++++++-------
>>  doc/guides/rel_notes/deprecation.rst              |  6 ------
>>  doc/guides/rel_notes/release_21_11.rst            |  2 ++
>>  drivers/crypto/octeontx/otx_cryptodev_ops.c       |  8 ++++----
>>  drivers/crypto/octeontx2/otx2_cryptodev_ops.c     |  4 ++--
>>  .../event/octeontx2/otx2_evdev_crypto_adptr_tx.h  |  4 ++--
>>  lib/eventdev/rte_event_crypto_adapter.c           |  8 ++++----
>>  lib/eventdev/rte_event_crypto_adapter.h           | 15 +++++----------
>>  8 files changed, 26 insertions(+), 35 deletions(-)
>>
>> diff --git a/app/test/test_event_crypto_adapter.c
>> b/app/test/test_event_crypto_adapter.c
>> index 3ad20921e2..0d73694d3a 100644
>> --- a/app/test/test_event_crypto_adapter.c
>> +++ b/app/test/test_event_crypto_adapter.c
>> @@ -168,7 +168,7 @@ test_op_forward_mode(uint8_t session_less)  {
>>  	struct rte_crypto_sym_xform cipher_xform;
>>  	struct rte_cryptodev_sym_session *sess;
>> -	union rte_event_crypto_metadata m_data;
>> +	struct rte_event_crypto_metadata m_data;
>>  	struct rte_crypto_sym_op *sym_op;
>>  	struct rte_crypto_op *op;
>>  	struct rte_mbuf *m;
>> @@ -368,7 +368,7 @@ test_op_new_mode(uint8_t session_less)  {
>>  	struct rte_crypto_sym_xform cipher_xform;
>>  	struct rte_cryptodev_sym_session *sess;
>> -	union rte_event_crypto_metadata m_data;
>> +	struct rte_event_crypto_metadata m_data;
>>  	struct rte_crypto_sym_op *sym_op;
>>  	struct rte_crypto_op *op;
>>  	struct rte_mbuf *m;
>> @@ -406,7 +406,7 @@ test_op_new_mode(uint8_t session_less)
>>  		if (cap &
>> RTE_EVENT_CRYPTO_ADAPTER_CAP_SESSION_PRIVATE_DATA) {
>>  			/* Fill in private user data information */
>>  			rte_memcpy(&m_data.response_info,
>> &response_info,
>> -				   sizeof(m_data));
>> +				   sizeof(response_info));
>>  			rte_cryptodev_sym_session_set_user_data(sess,
>>  						&m_data, sizeof(m_data));
>>  		}
>> @@ -426,7 +426,7 @@ test_op_new_mode(uint8_t session_less)
>>  		op->private_data_offset = len;
>>  		/* Fill in private data information */
>>  		rte_memcpy(&m_data.response_info, &response_info,
>> -			   sizeof(m_data));
>> +			   sizeof(response_info));
>>  		rte_memcpy((uint8_t *)op + len, &m_data, sizeof(m_data));
>>  	}
>>
>> @@ -519,7 +519,7 @@ configure_cryptodev(void)
>>  			DEFAULT_NUM_XFORMS *
>>  			sizeof(struct rte_crypto_sym_xform) +
>>  			MAXIMUM_IV_LENGTH +
>> -			sizeof(union rte_event_crypto_metadata),
>> +			sizeof(struct rte_event_crypto_metadata),
>>  			rte_socket_id());
>>  	if (params.op_mpool == NULL) {
>>  		RTE_LOG(ERR, USER1, "Can't create CRYPTO_OP_POOL\n");
>> @@ -549,12 +549,12 @@ configure_cryptodev(void)
>>  	 * to include the session headers & private data
>>  	 */
>>  	session_size =
>> rte_cryptodev_sym_get_private_session_size(TEST_CDEV_ID);
>> -	session_size += sizeof(union rte_event_crypto_metadata);
>> +	session_size += sizeof(struct rte_event_crypto_metadata);
>>
>>  	params.session_mpool = rte_cryptodev_sym_session_pool_create(
>>  			"CRYPTO_ADAPTER_SESSION_MP",
>>  			MAX_NB_SESSIONS, 0, 0,
>> -			sizeof(union rte_event_crypto_metadata),
>> +			sizeof(struct rte_event_crypto_metadata),
>>  			SOCKET_ID_ANY);
>>  	TEST_ASSERT_NOT_NULL(params.session_mpool,
>>  			"session mempool allocation failed\n"); diff --git
>> a/doc/guides/rel_notes/deprecation.rst
>> b/doc/guides/rel_notes/deprecation.rst
>> index 76a4abfd6b..58ee95c020 100644
>> --- a/doc/guides/rel_notes/deprecation.rst
>> +++ b/doc/guides/rel_notes/deprecation.rst
>> @@ -266,12 +266,6 @@ Deprecation Notices
>>    values to the function ``rte_event_eth_rx_adapter_queue_add`` using
>>    the structure ``rte_event_eth_rx_adapter_queue_add``.
>>
>> -* eventdev: Reserved bytes of ``rte_event_crypto_request`` is a space
>> holder
>> -  for ``response_info``. Both should be decoupled for better clarity.
>> -  New space for ``response_info`` can be made by changing
>> -  ``rte_event_crypto_metadata`` type to structure from union.
>> -  This change is targeted for DPDK 21.11.
>> -
>>  * metrics: The function ``rte_metrics_init`` will have a non-void return
>>    in order to notify errors instead of calling ``rte_exit``.
>>
>> diff --git a/doc/guides/rel_notes/release_21_11.rst
>> b/doc/guides/rel_notes/release_21_11.rst
>> index d707a554ef..ab76d5dd55 100644
>> --- a/doc/guides/rel_notes/release_21_11.rst
>> +++ b/doc/guides/rel_notes/release_21_11.rst
>> @@ -100,6 +100,8 @@ ABI Changes
>>     Also, make sure to start the actual text at the margin.
>>     =======================================================
>>
>> +* eventdev: Modified type of ``union rte_event_crypto_metadata`` to
>> +struct and
>> +  removed reserved bytes from ``struct rte_event_crypto_request``.
>>
>>  Known Issues
>>  ------------
>> diff --git a/drivers/crypto/octeontx/otx_cryptodev_ops.c
>> b/drivers/crypto/octeontx/otx_cryptodev_ops.c
>> index eac6796cfb..c51be63146 100644
>> --- a/drivers/crypto/octeontx/otx_cryptodev_ops.c
>> +++ b/drivers/crypto/octeontx/otx_cryptodev_ops.c
>> @@ -710,17 +710,17 @@ submit_request_to_sso(struct ssows *ws,
>> uintptr_t req,
>>  	ssovf_store_pair(add_work, req, ws->grps[rsp_info->queue_id]);  }
>>
>> -static inline union rte_event_crypto_metadata *
>> +static inline struct rte_event_crypto_metadata *
>>  get_event_crypto_mdata(struct rte_crypto_op *op)  {
>> -	union rte_event_crypto_metadata *ec_mdata;
>> +	struct rte_event_crypto_metadata *ec_mdata;
>>
>>  	if (op->sess_type == RTE_CRYPTO_OP_WITH_SESSION)
>>  		ec_mdata = rte_cryptodev_sym_session_get_user_data(
>>  							   op->sym->session);
>>  	else if (op->sess_type == RTE_CRYPTO_OP_SESSIONLESS &&
>>  		 op->private_data_offset)
>> -		ec_mdata = (union rte_event_crypto_metadata *)
>> +		ec_mdata = (struct rte_event_crypto_metadata *)
>>  			((uint8_t *)op + op->private_data_offset);
>>  	else
>>  		return NULL;
>> @@ -731,7 +731,7 @@ get_event_crypto_mdata(struct rte_crypto_op *op)
>> uint16_t __rte_hot  otx_crypto_adapter_enqueue(void *port, struct
>> rte_crypto_op *op)  {
>> -	union rte_event_crypto_metadata *ec_mdata;
>> +	struct rte_event_crypto_metadata *ec_mdata;
>>  	struct cpt_instance *instance;
>>  	struct cpt_request_info *req;
>>  	struct rte_event *rsp_info;
>> diff --git a/drivers/crypto/octeontx2/otx2_cryptodev_ops.c
>> b/drivers/crypto/octeontx2/otx2_cryptodev_ops.c
>> index 42100154cd..952d1352f4 100644
>> --- a/drivers/crypto/octeontx2/otx2_cryptodev_ops.c
>> +++ b/drivers/crypto/octeontx2/otx2_cryptodev_ops.c
>> @@ -453,7 +453,7 @@ otx2_ca_enqueue_req(const struct otx2_cpt_qp *qp,
>>  		    struct rte_crypto_op *op,
>>  		    uint64_t cpt_inst_w7)
>>  {
>> -	union rte_event_crypto_metadata *m_data;
>> +	struct rte_event_crypto_metadata *m_data;
>>  	union cpt_inst_s inst;
>>  	uint64_t lmt_status;
>>
>> @@ -468,7 +468,7 @@ otx2_ca_enqueue_req(const struct otx2_cpt_qp *qp,
>>  		}
>>  	} else if (op->sess_type == RTE_CRYPTO_OP_SESSIONLESS &&
>>  		   op->private_data_offset) {
>> -		m_data = (union rte_event_crypto_metadata *)
>> +		m_data = (struct rte_event_crypto_metadata *)
>>  			 ((uint8_t *)op +
>>  			  op->private_data_offset);
>>  	} else {
>> diff --git a/drivers/event/octeontx2/otx2_evdev_crypto_adptr_tx.h
>> b/drivers/event/octeontx2/otx2_evdev_crypto_adptr_tx.h
>> index ecf7eb9f56..458e8306d7 100644
>> --- a/drivers/event/octeontx2/otx2_evdev_crypto_adptr_tx.h
>> +++ b/drivers/event/octeontx2/otx2_evdev_crypto_adptr_tx.h
>> @@ -16,7 +16,7 @@
>>  static inline uint16_t
>>  otx2_ca_enq(uintptr_t tag_op, const struct rte_event *ev)  {
>> -	union rte_event_crypto_metadata *m_data;
>> +	struct rte_event_crypto_metadata *m_data;
>>  	struct rte_crypto_op *crypto_op;
>>  	struct rte_cryptodev *cdev;
>>  	struct otx2_cpt_qp *qp;
>> @@ -37,7 +37,7 @@ otx2_ca_enq(uintptr_t tag_op, const struct rte_event
>> *ev)
>>  		qp_id = m_data->request_info.queue_pair_id;
>>  	} else if (crypto_op->sess_type == RTE_CRYPTO_OP_SESSIONLESS
>> &&
>>  		   crypto_op->private_data_offset) {
>> -		m_data = (union rte_event_crypto_metadata *)
>> +		m_data = (struct rte_event_crypto_metadata *)
>>  			 ((uint8_t *)crypto_op +
>>  			  crypto_op->private_data_offset);
>>  		cdev_id = m_data->request_info.cdev_id; diff --git
>> a/lib/eventdev/rte_event_crypto_adapter.c
>> b/lib/eventdev/rte_event_crypto_adapter.c
>> index e1d38d383d..6977391ae9 100644
>> --- a/lib/eventdev/rte_event_crypto_adapter.c
>> +++ b/lib/eventdev/rte_event_crypto_adapter.c
>> @@ -333,7 +333,7 @@ eca_enq_to_cryptodev(struct
>> rte_event_crypto_adapter *adapter,
>>  		 struct rte_event *ev, unsigned int cnt)  {
>>  	struct rte_event_crypto_adapter_stats *stats = &adapter-
>> >crypto_stats;
>> -	union rte_event_crypto_metadata *m_data = NULL;
>> +	struct rte_event_crypto_metadata *m_data = NULL;
>>  	struct crypto_queue_pair_info *qp_info = NULL;
>>  	struct rte_crypto_op *crypto_op;
>>  	unsigned int i, n;
>> @@ -371,7 +371,7 @@ eca_enq_to_cryptodev(struct
>> rte_event_crypto_adapter *adapter,
>>  			len++;
>>  		} else if (crypto_op->sess_type ==
>> RTE_CRYPTO_OP_SESSIONLESS &&
>>  				crypto_op->private_data_offset) {
>> -			m_data = (union rte_event_crypto_metadata *)
>> +			m_data = (struct rte_event_crypto_metadata *)
>>  				 ((uint8_t *)crypto_op +
>>  					crypto_op->private_data_offset);
>>  			cdev_id = m_data->request_info.cdev_id; @@ -
>> 504,7 +504,7 @@ eca_ops_enqueue_burst(struct rte_event_crypto_adapter
>> *adapter,
>>  		  struct rte_crypto_op **ops, uint16_t num)  {
>>  	struct rte_event_crypto_adapter_stats *stats = &adapter-
>> >crypto_stats;
>> -	union rte_event_crypto_metadata *m_data = NULL;
>> +	struct rte_event_crypto_metadata *m_data = NULL;
>>  	uint8_t event_dev_id = adapter->eventdev_id;
>>  	uint8_t event_port_id = adapter->event_port_id;
>>  	struct rte_event events[BATCH_SIZE];
>> @@ -523,7 +523,7 @@ eca_ops_enqueue_burst(struct
>> rte_event_crypto_adapter *adapter,
>>  					ops[i]->sym->session);
>>  		} else if (ops[i]->sess_type ==
>> RTE_CRYPTO_OP_SESSIONLESS &&
>>  				ops[i]->private_data_offset) {
>> -			m_data = (union rte_event_crypto_metadata *)
>> +			m_data = (struct rte_event_crypto_metadata *)
>>  				 ((uint8_t *)ops[i] +
>>  				  ops[i]->private_data_offset);
>>  		}
>> diff --git a/lib/eventdev/rte_event_crypto_adapter.h
>> b/lib/eventdev/rte_event_crypto_adapter.h
>> index f8c6cca87c..3c24d9d9df 100644
>> --- a/lib/eventdev/rte_event_crypto_adapter.h
>> +++ b/lib/eventdev/rte_event_crypto_adapter.h
>> @@ -200,11 +200,6 @@ enum rte_event_crypto_adapter_mode {
>>   * provide event request information to the adapter.
>>   */
>>  struct rte_event_crypto_request {
>> -	uint8_t resv[8];
>> -	/**< Overlaps with first 8 bytes of struct rte_event
>> -	 * that encode the response event information. Application
>> -	 * is expected to fill in struct rte_event response_info.
>> -	 */
>>  	uint16_t cdev_id;
>>  	/**< cryptodev ID to be used */
>>  	uint16_t queue_pair_id;
>> @@ -223,16 +218,16 @@ struct rte_event_crypto_request {
>>   * operation. If the transfer is done by SW, event response information
>>   * will be used by the adapter.
>>   */
>> -union rte_event_crypto_metadata {
>> -	struct rte_event_crypto_request request_info;
>> -	/**< Request information to be filled in by application
>> -	 * for RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD mode.
>> -	 */
>> +struct rte_event_crypto_metadata {
>>  	struct rte_event response_info;
>>  	/**< Response information to be filled in by application
>>  	 * for RTE_EVENT_CRYPTO_ADAPTER_OP_NEW and
>>  	 * RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD mode.
>>  	 */
>> +	struct rte_event_crypto_request request_info;
>> +	/**< Request information to be filled in by application
>> +	 * for RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD mode.
>> +	 */
>>  };
>>
>>  /**
>> --
>> 2.25.1


^ permalink raw reply	[relevance 0%]

* [dpdk-dev] [PATCH v21 0/7] support dmadev
    2021-09-04 10:10  3% ` [dpdk-dev] [PATCH v20 0/7] support dmadev Chengwen Feng
@ 2021-09-07 12:56  3% ` Chengwen Feng
  2021-09-16  3:41  3% ` [dpdk-dev] [PATCH v22 0/5] " Chengwen Feng
  2 siblings, 0 replies; 200+ results
From: Chengwen Feng @ 2021-09-07 12:56 UTC (permalink / raw)
  To: thomas, ferruh.yigit, bruce.richardson, jerinj, jerinjacobk,
	andrew.rybchenko
  Cc: dev, mb, nipun.gupta, hemant.agrawal, maxime.coquelin,
	honnappa.nagarahalli, david.marchand, sburla, pkapoor,
	konstantin.ananyev, conor.walsh, kevin.laatz

This patch set contains seven patch for new add dmadev.

Chengwen Feng (7):
  dmadev: introduce DMA device library public APIs
  dmadev: introduce DMA device library internal header
  dmadev: introduce DMA device library PMD header
  dmadev: introduce DMA device library implementation
  doc: add DMA device library guide
  dma/skeleton: introduce skeleton dmadev driver
  app/test: add dmadev API test

---
v21:
* add comment for reserved fields of struct rte_dmadev.
v20:
* delete unnecessary and duplicate include header files.
* the conf_sz parameter is added to the configure and vchan-setup
  callbacks of the PMD, this is mainly used to enhance ABI
  compatibility.
* the rte_dmadev structure field is rearranged to reserve more space
  for I/O functions.
* fix some ambiguous and unnecessary comments.
* fix the potential memory leak of ut.
* redefine skeldma_init_once to skeldma_count.
* suppress rte_dmadev error output when execute ut.
v19:
* squash maintainer patch to patch #1.
v18:
* RTE_DMA_STATUS_* add BUS_READ/WRITE_ERR, PAGE_FAULT.
* rte_dmadev dataplane API add judge dev_started when debug enable.
* rte_dmadev_start/vchan_setup add judge device configured.
* rte_dmadev_dump support format capability name.
* optimized the comments of rte_dmadev.
* fix skeldma_copy always return zero when enqueue successful.
* log encapsulation macro add newline characters.
* test_dmadev_api support rte_dmadev_dump() ut.

 MAINTAINERS                            |    7 +
 app/test/meson.build                   |    4 +
 app/test/test_dmadev.c                 |   43 +
 app/test/test_dmadev_api.c             |  543 ++++++++++++
 config/rte_config.h                    |    3 +
 doc/api/doxy-api-index.md              |    1 +
 doc/api/doxy-api.conf.in               |    1 +
 doc/guides/prog_guide/dmadev.rst       |  125 +++
 doc/guides/prog_guide/img/dmadev.svg   |  283 +++++++
 doc/guides/prog_guide/index.rst        |    1 +
 doc/guides/rel_notes/release_21_11.rst |    5 +
 drivers/dma/meson.build                |   11 +
 drivers/dma/skeleton/meson.build       |    7 +
 drivers/dma/skeleton/skeleton_dmadev.c |  594 ++++++++++++++
 drivers/dma/skeleton/skeleton_dmadev.h |   61 ++
 drivers/dma/skeleton/version.map       |    3 +
 drivers/meson.build                    |    1 +
 lib/dmadev/meson.build                 |    7 +
 lib/dmadev/rte_dmadev.c                |  607 ++++++++++++++
 lib/dmadev/rte_dmadev.h                | 1047 ++++++++++++++++++++++++
 lib/dmadev/rte_dmadev_core.h           |  187 +++++
 lib/dmadev/rte_dmadev_pmd.h            |   72 ++
 lib/dmadev/version.map                 |   35 +
 lib/meson.build                        |    1 +
 24 files changed, 3649 insertions(+)
 create mode 100644 app/test/test_dmadev.c
 create mode 100644 app/test/test_dmadev_api.c
 create mode 100644 doc/guides/prog_guide/dmadev.rst
 create mode 100644 doc/guides/prog_guide/img/dmadev.svg
 create mode 100644 drivers/dma/meson.build
 create mode 100644 drivers/dma/skeleton/meson.build
 create mode 100644 drivers/dma/skeleton/skeleton_dmadev.c
 create mode 100644 drivers/dma/skeleton/skeleton_dmadev.h
 create mode 100644 drivers/dma/skeleton/version.map
 create mode 100644 lib/dmadev/meson.build
 create mode 100644 lib/dmadev/rte_dmadev.c
 create mode 100644 lib/dmadev/rte_dmadev.h
 create mode 100644 lib/dmadev/rte_dmadev_core.h
 create mode 100644 lib/dmadev/rte_dmadev_pmd.h
 create mode 100644 lib/dmadev/version.map

-- 
2.33.0


^ permalink raw reply	[relevance 3%]

* [dpdk-dev] [RFC PATCH v6 0/5] Add PIE support for HQoS library
  2021-09-07  7:33  3% ` [dpdk-dev] [RFC PATCH v5 0/5] " Liguzinski, WojciechX
  @ 2021-09-07 14:11  3%   ` Liguzinski, WojciechX
  1 sibling, 0 replies; 200+ results
From: Liguzinski, WojciechX @ 2021-09-07 14:11 UTC (permalink / raw)
  To: dev, jasvinder.singh, cristian.dumitrescu; +Cc: megha.ajmera

DPDK sched library is equipped with mechanism that secures it from the bufferbloat problem
which is a situation when excess buffers in the network cause high latency and latency 
variation. Currently, it supports RED for active queue management (which is designed 
to control the queue length but it does not control latency directly and is now being 
obsoleted). However, more advanced queue management is required to address this problem
and provide desirable quality of service to users.

This solution (RFC) proposes usage of new algorithm called "PIE" (Proportional Integral
controller Enhanced) that can effectively and directly control queuing latency to address 
the bufferbloat problem.

The implementation of mentioned functionality includes modification of existing and 
adding a new set of data structures to the library, adding PIE related APIs. 
This affects structures in public API/ABI. That is why deprecation notice is going
to be prepared and sent.

Liguzinski, WojciechX (3):
  sched: add PIE based congestion management
  example/qos_sched: add PIE support
  example/ip_pipeline: add PIE support
  doc/guides/prog_guide: added PIE
  app/test: add tests for PIE

 app/test/autotest_data.py                    |   18 +
 app/test/meson.build                         |    4 +
 app/test/test_pie.c                          | 1065 ++++++++++++++++++
 config/rte_config.h                          |    1 -
 doc/guides/prog_guide/glossary.rst           |    3 +
 doc/guides/prog_guide/qos_framework.rst      |   60 +-
 doc/guides/prog_guide/traffic_management.rst |   13 +-
 drivers/net/softnic/rte_eth_softnic_tm.c     |    6 +-
 examples/ip_pipeline/tmgr.c                  |    6 +-
 examples/qos_sched/app_thread.c              |    1 -
 examples/qos_sched/cfg_file.c                |   82 +-
 examples/qos_sched/init.c                    |    7 +-
 examples/qos_sched/profile.cfg               |  196 ++--
 lib/sched/meson.build                        |   10 +-
 lib/sched/rte_pie.c                          |   86 ++
 lib/sched/rte_pie.h                          |  398 +++++++
 lib/sched/rte_sched.c                        |  228 ++--
 lib/sched/rte_sched.h                        |   53 +-
 lib/sched/version.map                        |    3 +
 19 files changed, 2050 insertions(+), 190 deletions(-)
 create mode 100644 app/test/test_pie.c
 create mode 100644 lib/sched/rte_pie.c
 create mode 100644 lib/sched/rte_pie.h

-- 
2.25.1


^ permalink raw reply	[relevance 3%]

* Re: [dpdk-dev] [PATCH] doc: announce change in vfio dma mapping
  2021-09-06 13:43  0%                   ` Ferruh Yigit
@ 2021-09-07 15:21  0%                     ` Burakov, Anatoly
  2021-09-07 16:08  0%                       ` Ferruh Yigit
  0 siblings, 1 reply; 200+ results
From: Burakov, Anatoly @ 2021-09-07 15:21 UTC (permalink / raw)
  To: Ferruh Yigit, Ding, Xuan, Kinsella, Ray, dev
  Cc: maxime.coquelin, Xia, Chenbo, Hu, Jiayu, Richardson, Bruce,
	Thomas Monjalon

On 06-Sep-21 2:43 PM, Ferruh Yigit wrote:
> On 9/6/2021 9:51 AM, Ding, Xuan wrote:
>> Hi,
>>
>>> -----Original Message-----
>>> From: Kinsella, Ray <mdr@ashroe.eu>
>>> Sent: Friday, September 3, 2021 12:13 AM
>>> To: Yigit, Ferruh <ferruh.yigit@intel.com>; Burakov, Anatoly
>>> <anatoly.burakov@intel.com>; Ding, Xuan <xuan.ding@intel.com>;
>>> dev@dpdk.org
>>> Cc: maxime.coquelin@redhat.com; Xia, Chenbo <chenbo.xia@intel.com>; Hu,
>>> Jiayu <jiayu.hu@intel.com>; Richardson, Bruce <bruce.richardson@intel.com>;
>>> Thomas Monjalon <thomas@monjalon.net>
>>> Subject: Re: [PATCH] doc: announce change in vfio dma mapping
>>>
>>>
>>>
>>> On 02/09/2021 10:50, Ferruh Yigit wrote:
>>>> On 9/1/2021 2:25 PM, Burakov, Anatoly wrote:
>>>>> On 01-Sep-21 12:42 PM, Ferruh Yigit wrote:
>>>>>> On 9/1/2021 12:01 PM, Burakov, Anatoly wrote:
>>>>>>> On 01-Sep-21 10:56 AM, Ferruh Yigit wrote:
>>>>>>>> On 9/1/2021 2:41 AM, Ding, Xuan wrote:
>>>>>>>>> Hi Ferruh,
>>>>>>>>>
>>>>>>>>>> -----Original Message-----
>>>>>>>>>> From: Yigit, Ferruh <ferruh.yigit@intel.com>
>>>>>>>>>> Sent: Wednesday, September 1, 2021 12:01 AM
>>>>>>>>>> To: Ding, Xuan <xuan.ding@intel.com>; dev@dpdk.org; Burakov,
>>> Anatoly
>>>>>>>>>> <anatoly.burakov@intel.com>
>>>>>>>>>> Cc: maxime.coquelin@redhat.com; Xia, Chenbo
>>> <chenbo.xia@intel.com>; Hu,
>>>>>>>>>> Jiayu <jiayu.hu@intel.com>; Richardson, Bruce
>>> <bruce.richardson@intel.com>
>>>>>>>>>> Subject: Re: [PATCH] doc: announce change in vfio dma mapping
>>>>>>>>>>
>>>>>>>>>> On 8/31/2021 2:10 PM, Xuan Ding wrote:
>>>>>>>>>>> Currently, the VFIO subsystem will compact adjacent DMA regions for
>>> the
>>>>>>>>>>> purposes of saving space in the internal list of mappings. This has a
>>>>>>>>>>> side effect of compacting two separate mappings that just happen to
>>> be
>>>>>>>>>>> adjacent in memory. Since VFIO implementation on IA platforms also
>>> does
>>>>>>>>>>> not allow partial unmapping of memory mapped for DMA, the current
>>>>>>>>>> DPDK
>>>>>>>>>>> VFIO implementation will prevent unmapping of accidentally adjacent
>>>>>>>>>>> maps even though it could have been unmapped [1].
>>>>>>>>>>>
>>>>>>>>>>> The proper fix for this issue is to change the VFIO DMA mapping API to
>>>>>>>>>>> also include page size, and always map memory page-by-page.
>>>>>>>>>>>
>>>>>>>>>>> [1] https://mails.dpdk.org/archives/dev/2021-July/213493.html
>>>>>>>>>>>
>>>>>>>>>>> Signed-off-by: Xuan Ding <xuan.ding@intel.com>
>>>>>>>>>>> ---
>>>>>>>>>>>     doc/guides/rel_notes/deprecation.rst | 3 +++
>>>>>>>>>>>     1 file changed, 3 insertions(+)
>>>>>>>>>>>
>>>>>>>>>>> diff --git a/doc/guides/rel_notes/deprecation.rst
>>>>>>>>>> b/doc/guides/rel_notes/deprecation.rst
>>>>>>>>>>> index 76a4abfd6b..1234420caf 100644
>>>>>>>>>>> --- a/doc/guides/rel_notes/deprecation.rst
>>>>>>>>>>> +++ b/doc/guides/rel_notes/deprecation.rst
>>>>>>>>>>> @@ -287,3 +287,6 @@ Deprecation Notices
>>>>>>>>>>>       reserved bytes to 2 (from 3), and use 1 byte to indicate warnings
>>> and
>>>>>>>>>> other
>>>>>>>>>>>       information from the crypto/security operation. This field will be
>>>>>>>>>>> used to
>>>>>>>>>>>       communicate events such as soft expiry with IPsec in lookaside
>>> mode.
>>>>>>>>>>> +
>>>>>>>>>>> +* vfio: the functions `rte_vfio_container_dma_map` will be amended
>>> to
>>>>>>>>>>> +  include page size. This change is targeted for DPDK 22.02.
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Is this means adding a new parameter to API?
>>>>>>>>>> If so this is an ABI/API break and we can't do this change in the 22.02.
>>>>>>>>>
>>>>>>>>> Our original plan is add a new parameter in order not to use a new
>>> function
>>>>>>>>> name, so you mean, any changes to the API can only be done in the LTS
>>> version?
>>>>>>>>> If so, we can only add a new API and retire the old one in 22.11.
>>>>>>>>>
>>>>>>>>
>>>>>>>> We can add a new API anytime. Adding new parameter to an existing API
>>> can be
>>>>>>>> done on the ABI break release.
>>>>>>>
>>>>>>> So, 22.11 then?
>>>>>>>
>>>>>>
>>>>>> Yes.
>>>>>>
>>>>>>>>
>>>>>>>> You can add the new API in this release, and start using it.
>>>>>>>> And mark the old API as deprecated in this release. This lets existing
>>> binaries
>>>>>>>> to keep using it, but app needs to switch to new API for compilation.
>>>>>>>> Old API can be removed on 22.11, and you will need a deprecation notice
>>> before
>>>>>>>> 22.11 for it.
>>>>>>>>
>>>>>>>> Is above plan works for you?
>>>>>>>>
>>>>>>>
>>>>>>> We have slightly rethought our approach, and the functionality that Xuan
>>>>>>> requires does not rely on this API. They can, for all intents and purposes, be
>>>>>>> considered unrelated issues.
>>>>>>>
>>>>>>> I still think it's a good idea to update the API that way, so I would like to do
>>>>>>> that, and if we have to wait until 22.11 to fix it, I'm OK with that. Since
>>>>>>> there no longer is any urgency here, it's acceptable to wait for the next LTS
>>> to
>>>>>>> break it.
>>>>>>>
>>>>>>
>>>>>> Got it.
>>>>>>
>>>>>> As far as I understand, main motivation in techboard decision was to
>>> prevent the
>>>>>> ABI break as much as possible (main reason of decision wasn't deprecation
>>> notice
>>>>>> being late). But if the correct thing to do is to rename the API (and break the
>>>>>> ABI), I don't see the benefit to wait one more year, it is just delaying the
>>>>>> impact and adding overhead to us.
>>>>>> I am for being pragmatic and doing the change in this release if API rename
>>> is
>>>>>> better option, perhaps we can visit the issue again in techboard.
>>>>>>
>>>>>> Can you please describe why renaming API is better option, comparing to
>>> adding
>>>>>> new API with new parameter?
>>>>>
>>>>> I take it you meant "why renaming API *isn't* a better option".
>>>>>
>>>>> The problem we're solving is that the API in question does not know about
>>> page
>>>>> sizes and thus can't map segments page-by-page. I mean I /guess/ we could
>>> have
>>>>> two API's (one paged, one not paged), but then we get into all kinds of hairy
>>>>> things about the API leaking the details of underlying platform.
>>>>>
>>>>> Bottom line: i like current API function name. It's concise, it's descriptive.
>>>>> It's only missing a parameter, which i would like to add. A rename has been
>>>>> suggested (deprecate old API, add new API with a different name, and with
>>> added
>>>>> parameter), but honestly, I don't see why we have to do that because this is
>>>>> predicated upon the assumption that we *can't* break ABI at all, under any
>>>>> circumstances.
>>>>>
>>>>> Can you please explain to me what is wrong with keeping a versioned symbol?
>>>>> Like, keep the old function around to keep ABI compatibility, but break the
>>> API
>>>>> compatibility for those who target 22.02 or later? That's what symbol
>>> versioning
>>>>> is *for*, is it not?
>>>>>
>>>>
>>>> Nothing wrong with symbol versioning, indeed that is preferred way if it works
>>>> for you, I didn't get that symbol versioning is planned.
>>>>
>>>> @Ray,
>>>> Since symbol versioning is planned, ABI won't break, but API will change, can
>>>> this change be done in this release without deprecation notice?
>>>
>>> Yes - I would think so.
>>> Since we are going to the effort of using symbol versioning nothing is being
>>> depreciated as such (yet).
>>>
>>>> Later we can have a deprecation notice to remove old symbol on 22.11.
>>
>> Thanks for your explanation.
>> @Yigit, Ferruh Does it mean that we can do API change in 21.11? If so, we will
>> follow the process and target API change in this release. :)
>>
> 
> With symbol versioning, yes you can make the change in this release.
> 
> You can send another deprecation notice to remove the old symbol for 22.11, that
> can be sent anytime until 22.08 released.
> 

Hi Ferruh and others,

We have decided to switch gears somewhat :)

The original intent was to ensure that two adjacent segments can be 
freely mapped and unmapped. The easiest solution was page-by-page 
mapping, so that's where the API change idea came from.

However, due to tech board decision to not grant the exception at the 
time, we have figured out a way to avoid the API change. The API change 
is still a good idea because mapping things page-by-page is a valid use 
case that is currently not covered by the API, so the next plan was to 
do the API change in a later release as a separate issue, not related to 
original Xuan's intent.

However, we've been discussing implementation details with Xuan, and we 
arrived at a realization that what Xuan wants to implement not only does 
not *require* page size, it *cannot* be implemented with page size API 
because there's no way to know page size for that memory at the time of 
the API call. So, turns out we need both paged and page-less versions :)

This means that there are no deprecation notices now, because we will be 
adding a new API after all, but we will *not* deprecate or remove the 
old API - that one will still stay valid.

Apologies for constantly shifting ground, but in the end i think we 
arrived at the best possible solution for this problem!

-- 
Thanks,
Anatoly

^ permalink raw reply	[relevance 0%]

* Re: [dpdk-dev] [PATCH] doc: announce change in vfio dma mapping
  2021-09-07 15:21  0%                     ` Burakov, Anatoly
@ 2021-09-07 16:08  0%                       ` Ferruh Yigit
  0 siblings, 0 replies; 200+ results
From: Ferruh Yigit @ 2021-09-07 16:08 UTC (permalink / raw)
  To: Burakov, Anatoly, Ding, Xuan, Kinsella, Ray, dev
  Cc: maxime.coquelin, Xia, Chenbo, Hu, Jiayu, Richardson, Bruce,
	Thomas Monjalon

On 9/7/2021 4:21 PM, Burakov, Anatoly wrote:
> On 06-Sep-21 2:43 PM, Ferruh Yigit wrote:
>> On 9/6/2021 9:51 AM, Ding, Xuan wrote:
>>> Hi,
>>>
>>>> -----Original Message-----
>>>> From: Kinsella, Ray <mdr@ashroe.eu>
>>>> Sent: Friday, September 3, 2021 12:13 AM
>>>> To: Yigit, Ferruh <ferruh.yigit@intel.com>; Burakov, Anatoly
>>>> <anatoly.burakov@intel.com>; Ding, Xuan <xuan.ding@intel.com>;
>>>> dev@dpdk.org
>>>> Cc: maxime.coquelin@redhat.com; Xia, Chenbo <chenbo.xia@intel.com>; Hu,
>>>> Jiayu <jiayu.hu@intel.com>; Richardson, Bruce <bruce.richardson@intel.com>;
>>>> Thomas Monjalon <thomas@monjalon.net>
>>>> Subject: Re: [PATCH] doc: announce change in vfio dma mapping
>>>>
>>>>
>>>>
>>>> On 02/09/2021 10:50, Ferruh Yigit wrote:
>>>>> On 9/1/2021 2:25 PM, Burakov, Anatoly wrote:
>>>>>> On 01-Sep-21 12:42 PM, Ferruh Yigit wrote:
>>>>>>> On 9/1/2021 12:01 PM, Burakov, Anatoly wrote:
>>>>>>>> On 01-Sep-21 10:56 AM, Ferruh Yigit wrote:
>>>>>>>>> On 9/1/2021 2:41 AM, Ding, Xuan wrote:
>>>>>>>>>> Hi Ferruh,
>>>>>>>>>>
>>>>>>>>>>> -----Original Message-----
>>>>>>>>>>> From: Yigit, Ferruh <ferruh.yigit@intel.com>
>>>>>>>>>>> Sent: Wednesday, September 1, 2021 12:01 AM
>>>>>>>>>>> To: Ding, Xuan <xuan.ding@intel.com>; dev@dpdk.org; Burakov,
>>>> Anatoly
>>>>>>>>>>> <anatoly.burakov@intel.com>
>>>>>>>>>>> Cc: maxime.coquelin@redhat.com; Xia, Chenbo
>>>> <chenbo.xia@intel.com>; Hu,
>>>>>>>>>>> Jiayu <jiayu.hu@intel.com>; Richardson, Bruce
>>>> <bruce.richardson@intel.com>
>>>>>>>>>>> Subject: Re: [PATCH] doc: announce change in vfio dma mapping
>>>>>>>>>>>
>>>>>>>>>>> On 8/31/2021 2:10 PM, Xuan Ding wrote:
>>>>>>>>>>>> Currently, the VFIO subsystem will compact adjacent DMA regions for
>>>> the
>>>>>>>>>>>> purposes of saving space in the internal list of mappings. This has a
>>>>>>>>>>>> side effect of compacting two separate mappings that just happen to
>>>> be
>>>>>>>>>>>> adjacent in memory. Since VFIO implementation on IA platforms also
>>>> does
>>>>>>>>>>>> not allow partial unmapping of memory mapped for DMA, the current
>>>>>>>>>>> DPDK
>>>>>>>>>>>> VFIO implementation will prevent unmapping of accidentally adjacent
>>>>>>>>>>>> maps even though it could have been unmapped [1].
>>>>>>>>>>>>
>>>>>>>>>>>> The proper fix for this issue is to change the VFIO DMA mapping API to
>>>>>>>>>>>> also include page size, and always map memory page-by-page.
>>>>>>>>>>>>
>>>>>>>>>>>> [1] https://mails.dpdk.org/archives/dev/2021-July/213493.html
>>>>>>>>>>>>
>>>>>>>>>>>> Signed-off-by: Xuan Ding <xuan.ding@intel.com>
>>>>>>>>>>>> ---
>>>>>>>>>>>>     doc/guides/rel_notes/deprecation.rst | 3 +++
>>>>>>>>>>>>     1 file changed, 3 insertions(+)
>>>>>>>>>>>>
>>>>>>>>>>>> diff --git a/doc/guides/rel_notes/deprecation.rst
>>>>>>>>>>> b/doc/guides/rel_notes/deprecation.rst
>>>>>>>>>>>> index 76a4abfd6b..1234420caf 100644
>>>>>>>>>>>> --- a/doc/guides/rel_notes/deprecation.rst
>>>>>>>>>>>> +++ b/doc/guides/rel_notes/deprecation.rst
>>>>>>>>>>>> @@ -287,3 +287,6 @@ Deprecation Notices
>>>>>>>>>>>>       reserved bytes to 2 (from 3), and use 1 byte to indicate warnings
>>>> and
>>>>>>>>>>> other
>>>>>>>>>>>>       information from the crypto/security operation. This field
>>>>>>>>>>>> will be
>>>>>>>>>>>> used to
>>>>>>>>>>>>       communicate events such as soft expiry with IPsec in lookaside
>>>> mode.
>>>>>>>>>>>> +
>>>>>>>>>>>> +* vfio: the functions `rte_vfio_container_dma_map` will be amended
>>>> to
>>>>>>>>>>>> +  include page size. This change is targeted for DPDK 22.02.
>>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Is this means adding a new parameter to API?
>>>>>>>>>>> If so this is an ABI/API break and we can't do this change in the 22.02.
>>>>>>>>>>
>>>>>>>>>> Our original plan is add a new parameter in order not to use a new
>>>> function
>>>>>>>>>> name, so you mean, any changes to the API can only be done in the LTS
>>>> version?
>>>>>>>>>> If so, we can only add a new API and retire the old one in 22.11.
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>> We can add a new API anytime. Adding new parameter to an existing API
>>>> can be
>>>>>>>>> done on the ABI break release.
>>>>>>>>
>>>>>>>> So, 22.11 then?
>>>>>>>>
>>>>>>>
>>>>>>> Yes.
>>>>>>>
>>>>>>>>>
>>>>>>>>> You can add the new API in this release, and start using it.
>>>>>>>>> And mark the old API as deprecated in this release. This lets existing
>>>> binaries
>>>>>>>>> to keep using it, but app needs to switch to new API for compilation.
>>>>>>>>> Old API can be removed on 22.11, and you will need a deprecation notice
>>>> before
>>>>>>>>> 22.11 for it.
>>>>>>>>>
>>>>>>>>> Is above plan works for you?
>>>>>>>>>
>>>>>>>>
>>>>>>>> We have slightly rethought our approach, and the functionality that Xuan
>>>>>>>> requires does not rely on this API. They can, for all intents and
>>>>>>>> purposes, be
>>>>>>>> considered unrelated issues.
>>>>>>>>
>>>>>>>> I still think it's a good idea to update the API that way, so I would
>>>>>>>> like to do
>>>>>>>> that, and if we have to wait until 22.11 to fix it, I'm OK with that. Since
>>>>>>>> there no longer is any urgency here, it's acceptable to wait for the
>>>>>>>> next LTS
>>>> to
>>>>>>>> break it.
>>>>>>>>
>>>>>>>
>>>>>>> Got it.
>>>>>>>
>>>>>>> As far as I understand, main motivation in techboard decision was to
>>>> prevent the
>>>>>>> ABI break as much as possible (main reason of decision wasn't deprecation
>>>> notice
>>>>>>> being late). But if the correct thing to do is to rename the API (and
>>>>>>> break the
>>>>>>> ABI), I don't see the benefit to wait one more year, it is just delaying the
>>>>>>> impact and adding overhead to us.
>>>>>>> I am for being pragmatic and doing the change in this release if API rename
>>>> is
>>>>>>> better option, perhaps we can visit the issue again in techboard.
>>>>>>>
>>>>>>> Can you please describe why renaming API is better option, comparing to
>>>> adding
>>>>>>> new API with new parameter?
>>>>>>
>>>>>> I take it you meant "why renaming API *isn't* a better option".
>>>>>>
>>>>>> The problem we're solving is that the API in question does not know about
>>>> page
>>>>>> sizes and thus can't map segments page-by-page. I mean I /guess/ we could
>>>> have
>>>>>> two API's (one paged, one not paged), but then we get into all kinds of hairy
>>>>>> things about the API leaking the details of underlying platform.
>>>>>>
>>>>>> Bottom line: i like current API function name. It's concise, it's
>>>>>> descriptive.
>>>>>> It's only missing a parameter, which i would like to add. A rename has been
>>>>>> suggested (deprecate old API, add new API with a different name, and with
>>>> added
>>>>>> parameter), but honestly, I don't see why we have to do that because this is
>>>>>> predicated upon the assumption that we *can't* break ABI at all, under any
>>>>>> circumstances.
>>>>>>
>>>>>> Can you please explain to me what is wrong with keeping a versioned symbol?
>>>>>> Like, keep the old function around to keep ABI compatibility, but break the
>>>> API
>>>>>> compatibility for those who target 22.02 or later? That's what symbol
>>>> versioning
>>>>>> is *for*, is it not?
>>>>>>
>>>>>
>>>>> Nothing wrong with symbol versioning, indeed that is preferred way if it works
>>>>> for you, I didn't get that symbol versioning is planned.
>>>>>
>>>>> @Ray,
>>>>> Since symbol versioning is planned, ABI won't break, but API will change, can
>>>>> this change be done in this release without deprecation notice?
>>>>
>>>> Yes - I would think so.
>>>> Since we are going to the effort of using symbol versioning nothing is being
>>>> depreciated as such (yet).
>>>>
>>>>> Later we can have a deprecation notice to remove old symbol on 22.11.
>>>
>>> Thanks for your explanation.
>>> @Yigit, Ferruh Does it mean that we can do API change in 21.11? If so, we will
>>> follow the process and target API change in this release. :)
>>>
>>
>> With symbol versioning, yes you can make the change in this release.
>>
>> You can send another deprecation notice to remove the old symbol for 22.11, that
>> can be sent anytime until 22.08 released.
>>
> 
> Hi Ferruh and others,
> 
> We have decided to switch gears somewhat :)
> 
> The original intent was to ensure that two adjacent segments can be freely
> mapped and unmapped. The easiest solution was page-by-page mapping, so that's
> where the API change idea came from.
> 
> However, due to tech board decision to not grant the exception at the time, we
> have figured out a way to avoid the API change. The API change is still a good
> idea because mapping things page-by-page is a valid use case that is currently
> not covered by the API, so the next plan was to do the API change in a later
> release as a separate issue, not related to original Xuan's intent.
> 
> However, we've been discussing implementation details with Xuan, and we arrived
> at a realization that what Xuan wants to implement not only does not *require*
> page size, it *cannot* be implemented with page size API because there's no way
> to know page size for that memory at the time of the API call. So, turns out we
> need both paged and page-less versions :)
> 
> This means that there are no deprecation notices now, because we will be adding
> a new API after all, but we will *not* deprecate or remove the old API - that
> one will still stay valid.
> 
> Apologies for constantly shifting ground, but in the end i think we arrived at
> the best possible solution for this problem!
> 

So there won't be symbol versioning but only new API, which means no deprecation
notice is required, please update this patch's status accordingly.

Thanks for keep working on the issue to find a better solution.

^ permalink raw reply	[relevance 0%]

* [dpdk-dev] [PATCH v3 0/3] Add user specified IV with lookaside IPsec
    2021-09-06 14:58  4%   ` [dpdk-dev] [PATCH v2 1/3] security: support user specified IV Anoob Joseph
@ 2021-09-07 16:17  3%   ` Anoob Joseph
  2021-09-07 16:17  5%     ` [dpdk-dev] [PATCH v3 1/3] security: support user specified IV Anoob Joseph
  1 sibling, 1 reply; 200+ results
From: Anoob Joseph @ 2021-09-07 16:17 UTC (permalink / raw)
  To: Akhil Goyal, Declan Doherty, Fan Zhang, Konstantin Ananyev
  Cc: Anoob Joseph, Jerin Jacob, Archana Muniganti, Tejasree Kondoj,
	Hemant Agrawal, Radu Nicolau, Ciara Power, Gagandeep Singh, dev

Add support for using user provided IV with lookaside protocol (IPsec). Using
this option, application can provide IV to be used per operation. This
option can be used for knownn vector tests (which is otherwise impossible
due to random nature of IV) as well as if application wishes to use its
own random generator source.

Depends on
http://patches.dpdk.org/project/dpdk/list/?series=18642

Changes in v3:
- Moved release notes update to ABI section instead of API section

Changes in v2:
- Updated crypto/cnxk patch to handle non-aes-gcm cases
- Rebased on v3 of lookaside IPsec tests

Anoob Joseph (2):
  security: support user specified IV
  test/crypto: add outbound known vector tests

Tejasree Kondoj (1):
  crypto/cnxk: add IV in SA in lookaside IPsec debug mode

 app/test/test_cryptodev.c                         | 44 +++++++++++++++++++++++
 app/test/test_cryptodev_security_ipsec.c          | 16 ++++++++-
 doc/guides/rel_notes/release_21_11.rst            |  5 +++
 drivers/crypto/cnxk/cn10k_ipsec.c                 | 16 +++++++++
 drivers/crypto/cnxk/cn10k_ipsec.h                 |  2 ++
 drivers/crypto/cnxk/cn10k_ipsec_la_ops.h          | 44 +++++++++++++++++++++++
 drivers/crypto/cnxk/cnxk_cryptodev_capabilities.c | 29 +++++++++++++--
 drivers/crypto/cnxk/meson.build                   |  6 ++++
 lib/security/rte_security.h                       | 14 ++++++++
 9 files changed, 173 insertions(+), 3 deletions(-)

-- 
2.7.4


^ permalink raw reply	[relevance 3%]

* [dpdk-dev] [PATCH v3 1/3] security: support user specified IV
  2021-09-07 16:17  3%   ` [dpdk-dev] [PATCH v3 0/3] Add user specified IV with lookaside IPsec Anoob Joseph
@ 2021-09-07 16:17  5%     ` Anoob Joseph
  2021-09-16 11:14  0%       ` Ananyev, Konstantin
  0 siblings, 1 reply; 200+ results
From: Anoob Joseph @ 2021-09-07 16:17 UTC (permalink / raw)
  To: Akhil Goyal, Declan Doherty, Fan Zhang, Konstantin Ananyev
  Cc: Anoob Joseph, Jerin Jacob, Archana Muniganti, Tejasree Kondoj,
	Hemant Agrawal, Radu Nicolau, Ciara Power, Gagandeep Singh, dev

Enable user to provide IV to be used per security operation. This
would be used with lookaside protocol offload for comparing
against known vectors.

By default, PMD would generate IV internally and would be random.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
---
 doc/guides/rel_notes/release_21_11.rst |  5 +++++
 lib/security/rte_security.h            | 14 ++++++++++++++
 2 files changed, 19 insertions(+)

diff --git a/doc/guides/rel_notes/release_21_11.rst b/doc/guides/rel_notes/release_21_11.rst
index 411fa95..9b14c84 100644
--- a/doc/guides/rel_notes/release_21_11.rst
+++ b/doc/guides/rel_notes/release_21_11.rst
@@ -118,6 +118,11 @@ ABI Changes
    Also, make sure to start the actual text at the margin.
    =======================================================
 
+* security: add IPsec SA option to disable IV generation
+
+  * Added IPsec SA option to disable IV generation to allow known vector
+    tests as well as usage of application provided IV on supported PMDs.
+
 
 Known Issues
 ------------
diff --git a/lib/security/rte_security.h b/lib/security/rte_security.h
index 88d31de..b4b6776 100644
--- a/lib/security/rte_security.h
+++ b/lib/security/rte_security.h
@@ -181,6 +181,20 @@ struct rte_security_ipsec_sa_options {
 	 * * 0: Disable per session security statistics collection for this SA.
 	 */
 	uint32_t stats : 1;
+
+	/** Disable IV generation in PMD
+	 *
+	 * * 1: Disable IV generation in PMD. When disabled, IV provided in
+	 *      rte_crypto_op will be used by the PMD.
+	 *
+	 * * 0: Enable IV generation in PMD. When enabled, PMD generated random
+	 *      value would be used and application is not required to provide
+	 *      IV.
+	 *
+	 * Note: For inline cases, IV generation would always need to be handled
+	 * by the PMD.
+	 */
+	uint32_t iv_gen_disable : 1;
 };
 
 /** IPSec security association direction */
-- 
2.7.4


^ permalink raw reply	[relevance 5%]

* [dpdk-dev] [PATCH v2 1/6] security: add SA lifetime configuration
  @ 2021-09-07 16:32  8%   ` Anoob Joseph
  2021-09-16 11:06  0%     ` Ananyev, Konstantin
  0 siblings, 1 reply; 200+ results
From: Anoob Joseph @ 2021-09-07 16:32 UTC (permalink / raw)
  To: Akhil Goyal, Declan Doherty, Fan Zhang, Konstantin Ananyev
  Cc: Anoob Joseph, Jerin Jacob, Archana Muniganti, Tejasree Kondoj,
	Hemant Agrawal, Radu Nicolau, Ciara Power, Gagandeep Singh, dev

Add SA lifetime configuration to register soft and hard expiry limits.
Expiry can be in units of number of packets or bytes. Crypto op
status is also updated to include new field, aux_flags, which can be
used to indicate cases such as soft expiry in case of lookaside
protocol operations.

In case of soft expiry, the packets are successfully IPsec processed but
the soft expiry would indicate that SA needs to be reconfigured. For
inline protocol capable ethdev, this would result in an eth event while
for lookaside protocol capable cryptodev, this can be communicated via
`rte_crypto_op.aux_flags` field.

In case of hard expiry, the packets will not be IPsec processed and
would result in error.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
---
 .../test_cryptodev_security_ipsec_test_vectors.h   |  3 ---
 doc/guides/rel_notes/deprecation.rst               |  5 ----
 doc/guides/rel_notes/release_21_11.rst             | 13 ++++++++++
 examples/ipsec-secgw/ipsec.c                       |  2 +-
 examples/ipsec-secgw/ipsec.h                       |  2 +-
 lib/cryptodev/rte_crypto.h                         | 18 +++++++++++++-
 lib/security/rte_security.h                        | 28 ++++++++++++++++++++--
 7 files changed, 58 insertions(+), 13 deletions(-)

diff --git a/app/test/test_cryptodev_security_ipsec_test_vectors.h b/app/test/test_cryptodev_security_ipsec_test_vectors.h
index ae9cd24..38ea43d 100644
--- a/app/test/test_cryptodev_security_ipsec_test_vectors.h
+++ b/app/test/test_cryptodev_security_ipsec_test_vectors.h
@@ -98,7 +98,6 @@ struct ipsec_test_data pkt_aes_128_gcm = {
 		.proto = RTE_SECURITY_IPSEC_SA_PROTO_ESP,
 		.mode = RTE_SECURITY_IPSEC_SA_MODE_TUNNEL,
 		.tunnel.type = RTE_SECURITY_IPSEC_TUNNEL_IPV4,
-		.esn_soft_limit = 0,
 		.replay_win_sz = 0,
 	},
 
@@ -195,7 +194,6 @@ struct ipsec_test_data pkt_aes_192_gcm = {
 		.proto = RTE_SECURITY_IPSEC_SA_PROTO_ESP,
 		.mode = RTE_SECURITY_IPSEC_SA_MODE_TUNNEL,
 		.tunnel.type = RTE_SECURITY_IPSEC_TUNNEL_IPV4,
-		.esn_soft_limit = 0,
 		.replay_win_sz = 0,
 	},
 
@@ -295,7 +293,6 @@ struct ipsec_test_data pkt_aes_256_gcm = {
 		.proto = RTE_SECURITY_IPSEC_SA_PROTO_ESP,
 		.mode = RTE_SECURITY_IPSEC_SA_MODE_TUNNEL,
 		.tunnel.type = RTE_SECURITY_IPSEC_TUNNEL_IPV4,
-		.esn_soft_limit = 0,
 		.replay_win_sz = 0,
 	},
 
diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index 76a4abf..6118f06 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -282,8 +282,3 @@ Deprecation Notices
 * security: The functions ``rte_security_set_pkt_metadata`` and
   ``rte_security_get_userdata`` will be made inline functions and additional
   flags will be added in structure ``rte_security_ctx`` in DPDK 21.11.
-
-* cryptodev: The structure ``rte_crypto_op`` would be updated to reduce
-  reserved bytes to 2 (from 3), and use 1 byte to indicate warnings and other
-  information from the crypto/security operation. This field will be used to
-  communicate events such as soft expiry with IPsec in lookaside mode.
diff --git a/doc/guides/rel_notes/release_21_11.rst b/doc/guides/rel_notes/release_21_11.rst
index 9b14c84..0e3ed28 100644
--- a/doc/guides/rel_notes/release_21_11.rst
+++ b/doc/guides/rel_notes/release_21_11.rst
@@ -102,6 +102,13 @@ API Changes
    Also, make sure to start the actual text at the margin.
    =======================================================
 
+* cryptodev: use 1 reserved byte from ``rte_crypto_op`` for aux flags
+
+  * Updated the structure ``rte_crypto_op`` to reduce reserved bytes to
+  2 (from 3), and use 1 byte to indicate warnings and other information from
+  the crypto/security operation. This field will be used to communicate events
+  such as soft expiry with IPsec in lookaside mode.
+
 
 ABI Changes
 -----------
@@ -123,6 +130,12 @@ ABI Changes
   * Added IPsec SA option to disable IV generation to allow known vector
     tests as well as usage of application provided IV on supported PMDs.
 
+* security: add IPsec SA lifetime configuration
+
+  * Added IPsec SA lifetime configuration to allow applications to configure
+    soft and hard SA expiry limits. Limits can be either in units of packets or
+    bytes.
+
 
 Known Issues
 ------------
diff --git a/examples/ipsec-secgw/ipsec.c b/examples/ipsec-secgw/ipsec.c
index 5b032fe..4868294 100644
--- a/examples/ipsec-secgw/ipsec.c
+++ b/examples/ipsec-secgw/ipsec.c
@@ -49,7 +49,7 @@ set_ipsec_conf(struct ipsec_sa *sa, struct rte_security_ipsec_xform *ipsec)
 		}
 		/* TODO support for Transport */
 	}
-	ipsec->esn_soft_limit = IPSEC_OFFLOAD_ESN_SOFTLIMIT;
+	ipsec->life.packets_soft_limit = IPSEC_OFFLOAD_PKTS_SOFTLIMIT;
 	ipsec->replay_win_sz = app_sa_prm.window_size;
 	ipsec->options.esn = app_sa_prm.enable_esn;
 	ipsec->options.udp_encap = sa->udp_encap;
diff --git a/examples/ipsec-secgw/ipsec.h b/examples/ipsec-secgw/ipsec.h
index ae5058d..90c81c1 100644
--- a/examples/ipsec-secgw/ipsec.h
+++ b/examples/ipsec-secgw/ipsec.h
@@ -23,7 +23,7 @@
 
 #define MAX_DIGEST_SIZE 32 /* Bytes -- 256 bits */
 
-#define IPSEC_OFFLOAD_ESN_SOFTLIMIT 0xffffff00
+#define IPSEC_OFFLOAD_PKTS_SOFTLIMIT 0xffffff00
 
 #define IV_OFFSET		(sizeof(struct rte_crypto_op) + \
 				sizeof(struct rte_crypto_sym_op))
diff --git a/lib/cryptodev/rte_crypto.h b/lib/cryptodev/rte_crypto.h
index fd5ef3a..d602183 100644
--- a/lib/cryptodev/rte_crypto.h
+++ b/lib/cryptodev/rte_crypto.h
@@ -66,6 +66,17 @@ enum rte_crypto_op_sess_type {
 };
 
 /**
+ * Auxiliary flags to indicate additional info from the operation
+ */
+
+/**
+ * Auxiliary flags related to IPsec offload with RTE_SECURITY
+ */
+
+#define RTE_CRYPTO_OP_AUX_FLAGS_IPSEC_SOFT_EXPIRY (1 << 0)
+/**< SA soft expiry limit has been reached */
+
+/**
  * Cryptographic Operation.
  *
  * This structure contains data relating to performing cryptographic
@@ -93,7 +104,12 @@ struct rte_crypto_op {
 			 */
 			uint8_t sess_type;
 			/**< operation session type */
-			uint8_t reserved[3];
+			uint8_t aux_flags;
+			/**< Operation specific auxiliary/additional flags.
+			 * These flags carry additional information from the
+			 * operation. Processing of the same is optional.
+			 */
+			uint8_t reserved[2];
 			/**< Reserved bytes to fill 64 bits for
 			 * future additions
 			 */
diff --git a/lib/security/rte_security.h b/lib/security/rte_security.h
index b4b6776..95c169d 100644
--- a/lib/security/rte_security.h
+++ b/lib/security/rte_security.h
@@ -206,6 +206,30 @@ enum rte_security_ipsec_sa_direction {
 };
 
 /**
+ * Configure soft and hard lifetime of an IPsec SA
+ *
+ * Lifetime of an IPsec SA would specify the maximum number of packets or bytes
+ * that can be processed. IPsec operations would start failing once any hard
+ * limit is reached.
+ *
+ * Soft limits can be specified to generate notification when the SA is
+ * approaching hard limits for lifetime. For inline operations, reaching soft
+ * expiry limit would result in raising an eth event for the same. For lookaside
+ * operations, this would result in a warning returned in
+ * ``rte_crypto_op.aux_flags``.
+ */
+struct rte_security_ipsec_lifetime {
+	uint64_t packets_soft_limit;
+	/**< Soft expiry limit in number of packets */
+	uint64_t bytes_soft_limit;
+	/**< Soft expiry limit in bytes */
+	uint64_t packets_hard_limit;
+	/**< Soft expiry limit in number of packets */
+	uint64_t bytes_hard_limit;
+	/**< Soft expiry limit in bytes */
+};
+
+/**
  * IPsec security association configuration data.
  *
  * This structure contains data required to create an IPsec SA security session.
@@ -225,8 +249,8 @@ struct rte_security_ipsec_xform {
 	/**< IPsec SA Mode - transport/tunnel */
 	struct rte_security_ipsec_tunnel_param tunnel;
 	/**< Tunnel parameters, NULL for transport mode */
-	uint64_t esn_soft_limit;
-	/**< ESN for which the overflow event need to be raised */
+	struct rte_security_ipsec_lifetime life;
+	/**< IPsec SA lifetime */
 	uint32_t replay_win_sz;
 	/**< Anti replay window size to enable sequence replay attack handling.
 	 * replay checking is disabled if the window size is 0.
-- 
2.7.4


^ permalink raw reply	[relevance 8%]

* Re: [dpdk-dev] [PATCH v3] eventdev: update crypto adapter metadata structures
  2021-09-07 10:37  0%     ` Shijith Thotton
@ 2021-09-07 17:30  0%       ` Gujjar, Abhinandan S
  2021-09-08  7:42  0%         ` Shijith Thotton
  0 siblings, 1 reply; 200+ results
From: Gujjar, Abhinandan S @ 2021-09-07 17:30 UTC (permalink / raw)
  To: Shijith Thotton, dev
  Cc: Jerin Jacob Kollanukkaran, Anoob Joseph,
	Pavan Nikhilesh Bhagavatula, Akhil Goyal, Ray Kinsella,
	Ankur Dwivedi

Hi Shijith,

> -----Original Message-----
> From: Shijith Thotton <sthotton@marvell.com>
> Sent: Tuesday, September 7, 2021 4:07 PM
> To: Gujjar, Abhinandan S <abhinandan.gujjar@intel.com>; dev@dpdk.org
> Cc: Jerin Jacob Kollanukkaran <jerinj@marvell.com>; Anoob Joseph
> <anoobj@marvell.com>; Pavan Nikhilesh Bhagavatula
> <pbhagavatula@marvell.com>; Akhil Goyal <gakhil@marvell.com>; Ray
> Kinsella <mdr@ashroe.eu>; Ankur Dwivedi <adwivedi@marvell.com>
> Subject: RE: [PATCH v3] eventdev: update crypto adapter metadata
> structures
> 
> Hi Abhinandan,
> 
> >> In crypto adapter metadata, reserved bytes in request info structure
> >> is a space holder for response info. It enforces an order of
> >> operation if the structures are updated using memcpy to avoid
> >> overwriting response info. It is logical to move the reserved space
> >> out of request info. It also solves the ordering issue mentioned before.
> >I would like to understand what kind of ordering issue you have faced
> >with the current approach. Could you please give an example/sequence
> and explain?
> >
> 
> I have seen this issue with crypto adapter autotest (#n215).
> 
> Example:
> rte_memcpy(&m_data.response_info, &response_info,
> sizeof(response_info)); rte_memcpy(&m_data.request_info,
> &request_info, sizeof(request_info));
> 
> Here response info is getting overwritten by request info.
> Above lines can reordered to fix the issue, but can be ignored with this patch.
There is a reason for designing the metadata in this way.
Right now, sizeof (union rte_event_crypto_metadata) is 16 bytes.
So, the session based case needs just 16 bytes to store the data.
Whereas, for sessionless case each crypto_ops requires another 16 bytes.

By changing the struct in the following way you are doubling the memory requirement.
With the changes, for sessionless case, each crypto op requires 32 bytes of space instead of 16 bytes and the mempool will be bigger.
This will have the perf impact too!

You can just copy the individual members(cdev_id & queue_pair_id) after the response_info.
OR You have a better way?

> 
> >>
> >> This patch removes the reserve field from request info and makes
> >> event crypto metadata type to structure from union to make space for
> >> response info.
> >>
> >> App and drivers are updated as per metadata change.
> >>
> >> Signed-off-by: Shijith Thotton <sthotton@marvell.com>
> >> Acked-by: Anoob Joseph <anoobj@marvell.com>
> >> ---
> >> v3:
> >> * Updated ABI section of release notes.
> >>
> >> v2:
> >> * Updated deprecation notice.
> >>
> >> v1:
> >> * Rebased.
> >>
> >>  app/test/test_event_crypto_adapter.c              | 14 +++++++-------
> >>  doc/guides/rel_notes/deprecation.rst              |  6 ------
> >>  doc/guides/rel_notes/release_21_11.rst            |  2 ++
> >>  drivers/crypto/octeontx/otx_cryptodev_ops.c       |  8 ++++----
> >>  drivers/crypto/octeontx2/otx2_cryptodev_ops.c     |  4 ++--
> >>  .../event/octeontx2/otx2_evdev_crypto_adptr_tx.h  |  4 ++--
> >>  lib/eventdev/rte_event_crypto_adapter.c           |  8 ++++----
> >>  lib/eventdev/rte_event_crypto_adapter.h           | 15 +++++----------
> >>  8 files changed, 26 insertions(+), 35 deletions(-)
> >>
> >> diff --git a/app/test/test_event_crypto_adapter.c
> >> b/app/test/test_event_crypto_adapter.c
> >> index 3ad20921e2..0d73694d3a 100644
> >> --- a/app/test/test_event_crypto_adapter.c
> >> +++ b/app/test/test_event_crypto_adapter.c
> >> @@ -168,7 +168,7 @@ test_op_forward_mode(uint8_t session_less)  {
> >>  	struct rte_crypto_sym_xform cipher_xform;
> >>  	struct rte_cryptodev_sym_session *sess;
> >> -	union rte_event_crypto_metadata m_data;
> >> +	struct rte_event_crypto_metadata m_data;
> >>  	struct rte_crypto_sym_op *sym_op;
> >>  	struct rte_crypto_op *op;
> >>  	struct rte_mbuf *m;
> >> @@ -368,7 +368,7 @@ test_op_new_mode(uint8_t session_less)  {
> >>  	struct rte_crypto_sym_xform cipher_xform;
> >>  	struct rte_cryptodev_sym_session *sess;
> >> -	union rte_event_crypto_metadata m_data;
> >> +	struct rte_event_crypto_metadata m_data;
> >>  	struct rte_crypto_sym_op *sym_op;
> >>  	struct rte_crypto_op *op;
> >>  	struct rte_mbuf *m;
> >> @@ -406,7 +406,7 @@ test_op_new_mode(uint8_t session_less)
> >>  		if (cap &
> >> RTE_EVENT_CRYPTO_ADAPTER_CAP_SESSION_PRIVATE_DATA) {
> >>  			/* Fill in private user data information */
> >>  			rte_memcpy(&m_data.response_info,
> &response_info,
> >> -				   sizeof(m_data));
> >> +				   sizeof(response_info));
> >>  			rte_cryptodev_sym_session_set_user_data(sess,
> >>  						&m_data, sizeof(m_data));
> >>  		}
> >> @@ -426,7 +426,7 @@ test_op_new_mode(uint8_t session_less)
> >>  		op->private_data_offset = len;
> >>  		/* Fill in private data information */
> >>  		rte_memcpy(&m_data.response_info, &response_info,
> >> -			   sizeof(m_data));
> >> +			   sizeof(response_info));
> >>  		rte_memcpy((uint8_t *)op + len, &m_data, sizeof(m_data));
> >>  	}
> >>
> >> @@ -519,7 +519,7 @@ configure_cryptodev(void)
> >>  			DEFAULT_NUM_XFORMS *
> >>  			sizeof(struct rte_crypto_sym_xform) +
> >>  			MAXIMUM_IV_LENGTH +
> >> -			sizeof(union rte_event_crypto_metadata),
> >> +			sizeof(struct rte_event_crypto_metadata),
> >>  			rte_socket_id());
> >>  	if (params.op_mpool == NULL) {
> >>  		RTE_LOG(ERR, USER1, "Can't create CRYPTO_OP_POOL\n");
> @@ -549,12
> >> +549,12 @@ configure_cryptodev(void)
> >>  	 * to include the session headers & private data
> >>  	 */
> >>  	session_size =
> >> rte_cryptodev_sym_get_private_session_size(TEST_CDEV_ID);
> >> -	session_size += sizeof(union rte_event_crypto_metadata);
> >> +	session_size += sizeof(struct rte_event_crypto_metadata);
> >>
> >>  	params.session_mpool = rte_cryptodev_sym_session_pool_create(
> >>  			"CRYPTO_ADAPTER_SESSION_MP",
> >>  			MAX_NB_SESSIONS, 0, 0,
> >> -			sizeof(union rte_event_crypto_metadata),
> >> +			sizeof(struct rte_event_crypto_metadata),
> >>  			SOCKET_ID_ANY);
> >>  	TEST_ASSERT_NOT_NULL(params.session_mpool,
> >>  			"session mempool allocation failed\n"); diff --git
> >> a/doc/guides/rel_notes/deprecation.rst
> >> b/doc/guides/rel_notes/deprecation.rst
> >> index 76a4abfd6b..58ee95c020 100644
> >> --- a/doc/guides/rel_notes/deprecation.rst
> >> +++ b/doc/guides/rel_notes/deprecation.rst
> >> @@ -266,12 +266,6 @@ Deprecation Notices
> >>    values to the function ``rte_event_eth_rx_adapter_queue_add`` using
> >>    the structure ``rte_event_eth_rx_adapter_queue_add``.
> >>
> >> -* eventdev: Reserved bytes of ``rte_event_crypto_request`` is a
> >> space holder
> >> -  for ``response_info``. Both should be decoupled for better clarity.
> >> -  New space for ``response_info`` can be made by changing
> >> -  ``rte_event_crypto_metadata`` type to structure from union.
> >> -  This change is targeted for DPDK 21.11.
> >> -
> >>  * metrics: The function ``rte_metrics_init`` will have a non-void return
> >>    in order to notify errors instead of calling ``rte_exit``.
> >>
> >> diff --git a/doc/guides/rel_notes/release_21_11.rst
> >> b/doc/guides/rel_notes/release_21_11.rst
> >> index d707a554ef..ab76d5dd55 100644
> >> --- a/doc/guides/rel_notes/release_21_11.rst
> >> +++ b/doc/guides/rel_notes/release_21_11.rst
> >> @@ -100,6 +100,8 @@ ABI Changes
> >>     Also, make sure to start the actual text at the margin.
> >>
> =======================================================
> >>
> >> +* eventdev: Modified type of ``union rte_event_crypto_metadata`` to
> >> +struct and
> >> +  removed reserved bytes from ``struct rte_event_crypto_request``.
> >>
> >>  Known Issues
> >>  ------------
> >> diff --git a/drivers/crypto/octeontx/otx_cryptodev_ops.c
> >> b/drivers/crypto/octeontx/otx_cryptodev_ops.c
> >> index eac6796cfb..c51be63146 100644
> >> --- a/drivers/crypto/octeontx/otx_cryptodev_ops.c
> >> +++ b/drivers/crypto/octeontx/otx_cryptodev_ops.c
> >> @@ -710,17 +710,17 @@ submit_request_to_sso(struct ssows *ws,
> >> uintptr_t req,
> >>  	ssovf_store_pair(add_work, req, ws->grps[rsp_info->queue_id]);  }
> >>
> >> -static inline union rte_event_crypto_metadata *
> >> +static inline struct rte_event_crypto_metadata *
> >>  get_event_crypto_mdata(struct rte_crypto_op *op)  {
> >> -	union rte_event_crypto_metadata *ec_mdata;
> >> +	struct rte_event_crypto_metadata *ec_mdata;
> >>
> >>  	if (op->sess_type == RTE_CRYPTO_OP_WITH_SESSION)
> >>  		ec_mdata = rte_cryptodev_sym_session_get_user_data(
> >>  							   op->sym->session);
> >>  	else if (op->sess_type == RTE_CRYPTO_OP_SESSIONLESS &&
> >>  		 op->private_data_offset)
> >> -		ec_mdata = (union rte_event_crypto_metadata *)
> >> +		ec_mdata = (struct rte_event_crypto_metadata *)
> >>  			((uint8_t *)op + op->private_data_offset);
> >>  	else
> >>  		return NULL;
> >> @@ -731,7 +731,7 @@ get_event_crypto_mdata(struct rte_crypto_op
> *op)
> >> uint16_t __rte_hot  otx_crypto_adapter_enqueue(void *port, struct
> >> rte_crypto_op *op)  {
> >> -	union rte_event_crypto_metadata *ec_mdata;
> >> +	struct rte_event_crypto_metadata *ec_mdata;
> >>  	struct cpt_instance *instance;
> >>  	struct cpt_request_info *req;
> >>  	struct rte_event *rsp_info;
> >> diff --git a/drivers/crypto/octeontx2/otx2_cryptodev_ops.c
> >> b/drivers/crypto/octeontx2/otx2_cryptodev_ops.c
> >> index 42100154cd..952d1352f4 100644
> >> --- a/drivers/crypto/octeontx2/otx2_cryptodev_ops.c
> >> +++ b/drivers/crypto/octeontx2/otx2_cryptodev_ops.c
> >> @@ -453,7 +453,7 @@ otx2_ca_enqueue_req(const struct otx2_cpt_qp
> *qp,
> >>  		    struct rte_crypto_op *op,
> >>  		    uint64_t cpt_inst_w7)
> >>  {
> >> -	union rte_event_crypto_metadata *m_data;
> >> +	struct rte_event_crypto_metadata *m_data;
> >>  	union cpt_inst_s inst;
> >>  	uint64_t lmt_status;
> >>
> >> @@ -468,7 +468,7 @@ otx2_ca_enqueue_req(const struct otx2_cpt_qp
> *qp,
> >>  		}
> >>  	} else if (op->sess_type == RTE_CRYPTO_OP_SESSIONLESS &&
> >>  		   op->private_data_offset) {
> >> -		m_data = (union rte_event_crypto_metadata *)
> >> +		m_data = (struct rte_event_crypto_metadata *)
> >>  			 ((uint8_t *)op +
> >>  			  op->private_data_offset);
> >>  	} else {
> >> diff --git a/drivers/event/octeontx2/otx2_evdev_crypto_adptr_tx.h
> >> b/drivers/event/octeontx2/otx2_evdev_crypto_adptr_tx.h
> >> index ecf7eb9f56..458e8306d7 100644
> >> --- a/drivers/event/octeontx2/otx2_evdev_crypto_adptr_tx.h
> >> +++ b/drivers/event/octeontx2/otx2_evdev_crypto_adptr_tx.h
> >> @@ -16,7 +16,7 @@
> >>  static inline uint16_t
> >>  otx2_ca_enq(uintptr_t tag_op, const struct rte_event *ev)  {
> >> -	union rte_event_crypto_metadata *m_data;
> >> +	struct rte_event_crypto_metadata *m_data;
> >>  	struct rte_crypto_op *crypto_op;
> >>  	struct rte_cryptodev *cdev;
> >>  	struct otx2_cpt_qp *qp;
> >> @@ -37,7 +37,7 @@ otx2_ca_enq(uintptr_t tag_op, const struct
> >> rte_event
> >> *ev)
> >>  		qp_id = m_data->request_info.queue_pair_id;
> >>  	} else if (crypto_op->sess_type == RTE_CRYPTO_OP_SESSIONLESS
> &&
> >>  		   crypto_op->private_data_offset) {
> >> -		m_data = (union rte_event_crypto_metadata *)
> >> +		m_data = (struct rte_event_crypto_metadata *)
> >>  			 ((uint8_t *)crypto_op +
> >>  			  crypto_op->private_data_offset);
> >>  		cdev_id = m_data->request_info.cdev_id; diff --git
> >> a/lib/eventdev/rte_event_crypto_adapter.c
> >> b/lib/eventdev/rte_event_crypto_adapter.c
> >> index e1d38d383d..6977391ae9 100644
> >> --- a/lib/eventdev/rte_event_crypto_adapter.c
> >> +++ b/lib/eventdev/rte_event_crypto_adapter.c
> >> @@ -333,7 +333,7 @@ eca_enq_to_cryptodev(struct
> >> rte_event_crypto_adapter *adapter,
> >>  		 struct rte_event *ev, unsigned int cnt)  {
> >>  	struct rte_event_crypto_adapter_stats *stats = &adapter-
> >> >crypto_stats;
> >> -	union rte_event_crypto_metadata *m_data = NULL;
> >> +	struct rte_event_crypto_metadata *m_data = NULL;
> >>  	struct crypto_queue_pair_info *qp_info = NULL;
> >>  	struct rte_crypto_op *crypto_op;
> >>  	unsigned int i, n;
> >> @@ -371,7 +371,7 @@ eca_enq_to_cryptodev(struct
> >> rte_event_crypto_adapter *adapter,
> >>  			len++;
> >>  		} else if (crypto_op->sess_type ==
> RTE_CRYPTO_OP_SESSIONLESS &&
> >>  				crypto_op->private_data_offset) {
> >> -			m_data = (union rte_event_crypto_metadata *)
> >> +			m_data = (struct rte_event_crypto_metadata *)
> >>  				 ((uint8_t *)crypto_op +
> >>  					crypto_op->private_data_offset);
> >>  			cdev_id = m_data->request_info.cdev_id; @@ -
> >> 504,7 +504,7 @@ eca_ops_enqueue_burst(struct
> rte_event_crypto_adapter
> >> *adapter,
> >>  		  struct rte_crypto_op **ops, uint16_t num)  {
> >>  	struct rte_event_crypto_adapter_stats *stats = &adapter-
> >> >crypto_stats;
> >> -	union rte_event_crypto_metadata *m_data = NULL;
> >> +	struct rte_event_crypto_metadata *m_data = NULL;
> >>  	uint8_t event_dev_id = adapter->eventdev_id;
> >>  	uint8_t event_port_id = adapter->event_port_id;
> >>  	struct rte_event events[BATCH_SIZE]; @@ -523,7 +523,7 @@
> >> eca_ops_enqueue_burst(struct rte_event_crypto_adapter *adapter,
> >>  					ops[i]->sym->session);
> >>  		} else if (ops[i]->sess_type ==
> >> RTE_CRYPTO_OP_SESSIONLESS &&
> >>  				ops[i]->private_data_offset) {
> >> -			m_data = (union rte_event_crypto_metadata *)
> >> +			m_data = (struct rte_event_crypto_metadata *)
> >>  				 ((uint8_t *)ops[i] +
> >>  				  ops[i]->private_data_offset);
> >>  		}
> >> diff --git a/lib/eventdev/rte_event_crypto_adapter.h
> >> b/lib/eventdev/rte_event_crypto_adapter.h
> >> index f8c6cca87c..3c24d9d9df 100644
> >> --- a/lib/eventdev/rte_event_crypto_adapter.h
> >> +++ b/lib/eventdev/rte_event_crypto_adapter.h
> >> @@ -200,11 +200,6 @@ enum rte_event_crypto_adapter_mode {
> >>   * provide event request information to the adapter.
> >>   */
> >>  struct rte_event_crypto_request {
> >> -	uint8_t resv[8];
> >> -	/**< Overlaps with first 8 bytes of struct rte_event
> >> -	 * that encode the response event information. Application
> >> -	 * is expected to fill in struct rte_event response_info.
> >> -	 */
> >>  	uint16_t cdev_id;
> >>  	/**< cryptodev ID to be used */
> >>  	uint16_t queue_pair_id;
> >> @@ -223,16 +218,16 @@ struct rte_event_crypto_request {
> >>   * operation. If the transfer is done by SW, event response information
> >>   * will be used by the adapter.
> >>   */
> >> -union rte_event_crypto_metadata {
> >> -	struct rte_event_crypto_request request_info;
> >> -	/**< Request information to be filled in by application
> >> -	 * for RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD mode.
> >> -	 */
> >> +struct rte_event_crypto_metadata {
> >>  	struct rte_event response_info;
> >>  	/**< Response information to be filled in by application
> >>  	 * for RTE_EVENT_CRYPTO_ADAPTER_OP_NEW and
> >>  	 * RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD mode.
> >>  	 */
> >> +	struct rte_event_crypto_request request_info;
> >> +	/**< Request information to be filled in by application
> >> +	 * for RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD mode.
> >> +	 */
> >>  };
> >>
> >>  /**
> >> --
> >> 2.25.1


^ permalink raw reply	[relevance 0%]

* [dpdk-dev] [PATCH v3 2/4] cryptodev: change valid dev API
  @ 2021-09-07 19:00  3%   ` Akhil Goyal
  2021-09-07 19:00  2%   ` [dpdk-dev] [PATCH v3 4/4] cryptodev: expose driver interface as internal Akhil Goyal
    2 siblings, 0 replies; 200+ results
From: Akhil Goyal @ 2021-09-07 19:00 UTC (permalink / raw)
  To: dev
  Cc: anoobj, radu.nicolau, declan.doherty, hemant.agrawal, matan,
	konstantin.ananyev, thomas, roy.fan.zhang, asomalap,
	ruifeng.wang, ajit.khaparde, pablo.de.lara.guarch, fiona.trahe,
	adwivedi, michaelsh, rnagadheeraj, jianjay.zhou, Akhil Goyal

The API rte_cryptodev_pmd_is_valid_dev, can be used
by the application as well as PMD to check whether
the device is valid or not. Hence, _pmd is removed
from the API.
The applications and drivers which use this API are
also updated.

Signed-off-by: Akhil Goyal <gakhil@marvell.com>
---
 doc/guides/rel_notes/release_21_11.rst        |  4 ++
 .../net/softnic/rte_eth_softnic_cryptodev.c   |  2 +-
 examples/fips_validation/main.c               |  2 +-
 examples/ip_pipeline/cryptodev.c              |  3 +-
 lib/cryptodev/rte_cryptodev.c                 | 50 +++++++++----------
 lib/cryptodev/rte_cryptodev.h                 | 11 ++++
 lib/cryptodev/rte_cryptodev_pmd.h             | 11 ----
 lib/cryptodev/version.map                     |  2 +-
 lib/eventdev/rte_event_crypto_adapter.c       |  4 +-
 lib/eventdev/rte_eventdev.c                   |  2 +-
 lib/pipeline/rte_table_action.c               |  2 +-
 11 files changed, 48 insertions(+), 45 deletions(-)

diff --git a/doc/guides/rel_notes/release_21_11.rst b/doc/guides/rel_notes/release_21_11.rst
index 411fa9530a..e7ad50ba09 100644
--- a/doc/guides/rel_notes/release_21_11.rst
+++ b/doc/guides/rel_notes/release_21_11.rst
@@ -102,6 +102,10 @@ API Changes
    Also, make sure to start the actual text at the margin.
    =======================================================
 
+* cryptodev: The API rte_cryptodev_pmd_is_valid_dev is modified to
+  rte_cryptodev_is_valid_dev as it can be used by the application as
+  well as PMD to check whether the device is valid or not.
+
 
 ABI Changes
 -----------
diff --git a/drivers/net/softnic/rte_eth_softnic_cryptodev.c b/drivers/net/softnic/rte_eth_softnic_cryptodev.c
index a1a4ca5650..8e278801c5 100644
--- a/drivers/net/softnic/rte_eth_softnic_cryptodev.c
+++ b/drivers/net/softnic/rte_eth_softnic_cryptodev.c
@@ -82,7 +82,7 @@ softnic_cryptodev_create(struct pmd_internals *p,
 
 		dev_id = (uint32_t)status;
 	} else {
-		if (rte_cryptodev_pmd_is_valid_dev(params->dev_id) == 0)
+		if (rte_cryptodev_is_valid_dev(params->dev_id) == 0)
 			return NULL;
 
 		dev_id = params->dev_id;
diff --git a/examples/fips_validation/main.c b/examples/fips_validation/main.c
index c175fe6ac2..e892078f0e 100644
--- a/examples/fips_validation/main.c
+++ b/examples/fips_validation/main.c
@@ -196,7 +196,7 @@ parse_cryptodev_id_arg(char *arg)
 	}
 
 
-	if (!rte_cryptodev_pmd_is_valid_dev(cryptodev_id)) {
+	if (!rte_cryptodev_is_valid_dev(cryptodev_id)) {
 		RTE_LOG(ERR, USER1, "Error %i: invalid cryptodev id %s\n",
 				cryptodev_id, arg);
 		return -1;
diff --git a/examples/ip_pipeline/cryptodev.c b/examples/ip_pipeline/cryptodev.c
index b0d9f3d217..9997d97456 100644
--- a/examples/ip_pipeline/cryptodev.c
+++ b/examples/ip_pipeline/cryptodev.c
@@ -6,7 +6,6 @@
 #include <stdio.h>
 
 #include <rte_cryptodev.h>
-#include <rte_cryptodev_pmd.h>
 #include <rte_string_fns.h>
 
 #include "cryptodev.h"
@@ -74,7 +73,7 @@ cryptodev_create(const char *name, struct cryptodev_params *params)
 
 		dev_id = (uint32_t)status;
 	} else {
-		if (rte_cryptodev_pmd_is_valid_dev(params->dev_id) == 0)
+		if (rte_cryptodev_is_valid_dev(params->dev_id) == 0)
 			return NULL;
 
 		dev_id = params->dev_id;
diff --git a/lib/cryptodev/rte_cryptodev.c b/lib/cryptodev/rte_cryptodev.c
index 447aa9d519..37502b9b3c 100644
--- a/lib/cryptodev/rte_cryptodev.c
+++ b/lib/cryptodev/rte_cryptodev.c
@@ -663,7 +663,7 @@ rte_cryptodev_is_valid_device_data(uint8_t dev_id)
 }
 
 unsigned int
-rte_cryptodev_pmd_is_valid_dev(uint8_t dev_id)
+rte_cryptodev_is_valid_dev(uint8_t dev_id)
 {
 	struct rte_cryptodev *dev = NULL;
 
@@ -761,7 +761,7 @@ rte_cryptodev_socket_id(uint8_t dev_id)
 {
 	struct rte_cryptodev *dev;
 
-	if (!rte_cryptodev_pmd_is_valid_dev(dev_id))
+	if (!rte_cryptodev_is_valid_dev(dev_id))
 		return -1;
 
 	dev = rte_cryptodev_pmd_get_dev(dev_id);
@@ -1032,7 +1032,7 @@ rte_cryptodev_configure(uint8_t dev_id, struct rte_cryptodev_config *config)
 	struct rte_cryptodev *dev;
 	int diag;
 
-	if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) {
+	if (!rte_cryptodev_is_valid_dev(dev_id)) {
 		CDEV_LOG_ERR("Invalid dev_id=%" PRIu8, dev_id);
 		return -EINVAL;
 	}
@@ -1080,7 +1080,7 @@ rte_cryptodev_start(uint8_t dev_id)
 
 	CDEV_LOG_DEBUG("Start dev_id=%" PRIu8, dev_id);
 
-	if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) {
+	if (!rte_cryptodev_is_valid_dev(dev_id)) {
 		CDEV_LOG_ERR("Invalid dev_id=%" PRIu8, dev_id);
 		return -EINVAL;
 	}
@@ -1110,7 +1110,7 @@ rte_cryptodev_stop(uint8_t dev_id)
 {
 	struct rte_cryptodev *dev;
 
-	if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) {
+	if (!rte_cryptodev_is_valid_dev(dev_id)) {
 		CDEV_LOG_ERR("Invalid dev_id=%" PRIu8, dev_id);
 		return;
 	}
@@ -1136,7 +1136,7 @@ rte_cryptodev_close(uint8_t dev_id)
 	struct rte_cryptodev *dev;
 	int retval;
 
-	if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) {
+	if (!rte_cryptodev_is_valid_dev(dev_id)) {
 		CDEV_LOG_ERR("Invalid dev_id=%" PRIu8, dev_id);
 		return -1;
 	}
@@ -1176,7 +1176,7 @@ rte_cryptodev_get_qp_status(uint8_t dev_id, uint16_t queue_pair_id)
 {
 	struct rte_cryptodev *dev;
 
-	if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) {
+	if (!rte_cryptodev_is_valid_dev(dev_id)) {
 		CDEV_LOG_ERR("Invalid dev_id=%" PRIu8, dev_id);
 		return -EINVAL;
 	}
@@ -1207,7 +1207,7 @@ rte_cryptodev_queue_pair_setup(uint8_t dev_id, uint16_t queue_pair_id,
 {
 	struct rte_cryptodev *dev;
 
-	if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) {
+	if (!rte_cryptodev_is_valid_dev(dev_id)) {
 		CDEV_LOG_ERR("Invalid dev_id=%" PRIu8, dev_id);
 		return -EINVAL;
 	}
@@ -1283,7 +1283,7 @@ rte_cryptodev_add_enq_callback(uint8_t dev_id,
 		return NULL;
 	}
 
-	if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) {
+	if (!rte_cryptodev_is_valid_dev(dev_id)) {
 		CDEV_LOG_ERR("Invalid dev_id=%d", dev_id);
 		rte_errno = ENODEV;
 		return NULL;
@@ -1349,7 +1349,7 @@ rte_cryptodev_remove_enq_callback(uint8_t dev_id,
 		return -EINVAL;
 	}
 
-	if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) {
+	if (!rte_cryptodev_is_valid_dev(dev_id)) {
 		CDEV_LOG_ERR("Invalid dev_id=%d", dev_id);
 		return -ENODEV;
 	}
@@ -1418,7 +1418,7 @@ rte_cryptodev_add_deq_callback(uint8_t dev_id,
 		return NULL;
 	}
 
-	if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) {
+	if (!rte_cryptodev_is_valid_dev(dev_id)) {
 		CDEV_LOG_ERR("Invalid dev_id=%d", dev_id);
 		rte_errno = ENODEV;
 		return NULL;
@@ -1484,7 +1484,7 @@ rte_cryptodev_remove_deq_callback(uint8_t dev_id,
 		return -EINVAL;
 	}
 
-	if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) {
+	if (!rte_cryptodev_is_valid_dev(dev_id)) {
 		CDEV_LOG_ERR("Invalid dev_id=%d", dev_id);
 		return -ENODEV;
 	}
@@ -1542,7 +1542,7 @@ rte_cryptodev_stats_get(uint8_t dev_id, struct rte_cryptodev_stats *stats)
 {
 	struct rte_cryptodev *dev;
 
-	if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) {
+	if (!rte_cryptodev_is_valid_dev(dev_id)) {
 		CDEV_LOG_ERR("Invalid dev_id=%d", dev_id);
 		return -ENODEV;
 	}
@@ -1565,7 +1565,7 @@ rte_cryptodev_stats_reset(uint8_t dev_id)
 {
 	struct rte_cryptodev *dev;
 
-	if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) {
+	if (!rte_cryptodev_is_valid_dev(dev_id)) {
 		CDEV_LOG_ERR("Invalid dev_id=%" PRIu8, dev_id);
 		return;
 	}
@@ -1581,7 +1581,7 @@ rte_cryptodev_info_get(uint8_t dev_id, struct rte_cryptodev_info *dev_info)
 {
 	struct rte_cryptodev *dev;
 
-	if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) {
+	if (!rte_cryptodev_is_valid_dev(dev_id)) {
 		CDEV_LOG_ERR("Invalid dev_id=%d", dev_id);
 		return;
 	}
@@ -1608,7 +1608,7 @@ rte_cryptodev_callback_register(uint8_t dev_id,
 	if (!cb_fn)
 		return -EINVAL;
 
-	if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) {
+	if (!rte_cryptodev_is_valid_dev(dev_id)) {
 		CDEV_LOG_ERR("Invalid dev_id=%" PRIu8, dev_id);
 		return -EINVAL;
 	}
@@ -1652,7 +1652,7 @@ rte_cryptodev_callback_unregister(uint8_t dev_id,
 	if (!cb_fn)
 		return -EINVAL;
 
-	if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) {
+	if (!rte_cryptodev_is_valid_dev(dev_id)) {
 		CDEV_LOG_ERR("Invalid dev_id=%" PRIu8, dev_id);
 		return -EINVAL;
 	}
@@ -1720,7 +1720,7 @@ rte_cryptodev_sym_session_init(uint8_t dev_id,
 	uint8_t index;
 	int ret;
 
-	if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) {
+	if (!rte_cryptodev_is_valid_dev(dev_id)) {
 		CDEV_LOG_ERR("Invalid dev_id=%" PRIu8, dev_id);
 		return -EINVAL;
 	}
@@ -1765,7 +1765,7 @@ rte_cryptodev_asym_session_init(uint8_t dev_id,
 	uint8_t index;
 	int ret;
 
-	if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) {
+	if (!rte_cryptodev_is_valid_dev(dev_id)) {
 		CDEV_LOG_ERR("Invalid dev_id=%" PRIu8, dev_id);
 		return -EINVAL;
 	}
@@ -1939,7 +1939,7 @@ rte_cryptodev_sym_session_clear(uint8_t dev_id,
 	struct rte_cryptodev *dev;
 	uint8_t driver_id;
 
-	if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) {
+	if (!rte_cryptodev_is_valid_dev(dev_id)) {
 		CDEV_LOG_ERR("Invalid dev_id=%" PRIu8, dev_id);
 		return -EINVAL;
 	}
@@ -1969,7 +1969,7 @@ rte_cryptodev_asym_session_clear(uint8_t dev_id,
 {
 	struct rte_cryptodev *dev;
 
-	if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) {
+	if (!rte_cryptodev_is_valid_dev(dev_id)) {
 		CDEV_LOG_ERR("Invalid dev_id=%" PRIu8, dev_id);
 		return -EINVAL;
 	}
@@ -2079,7 +2079,7 @@ rte_cryptodev_sym_get_private_session_size(uint8_t dev_id)
 	struct rte_cryptodev *dev;
 	unsigned int priv_sess_size;
 
-	if (!rte_cryptodev_pmd_is_valid_dev(dev_id))
+	if (!rte_cryptodev_is_valid_dev(dev_id))
 		return 0;
 
 	dev = rte_cryptodev_pmd_get_dev(dev_id);
@@ -2099,7 +2099,7 @@ rte_cryptodev_asym_get_private_session_size(uint8_t dev_id)
 	unsigned int header_size = sizeof(void *) * nb_drivers;
 	unsigned int priv_sess_size;
 
-	if (!rte_cryptodev_pmd_is_valid_dev(dev_id))
+	if (!rte_cryptodev_is_valid_dev(dev_id))
 		return 0;
 
 	dev = rte_cryptodev_pmd_get_dev(dev_id);
@@ -2156,7 +2156,7 @@ rte_cryptodev_sym_cpu_crypto_process(uint8_t dev_id,
 {
 	struct rte_cryptodev *dev;
 
-	if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) {
+	if (!rte_cryptodev_is_valid_dev(dev_id)) {
 		sym_crypto_fill_status(vec, EINVAL);
 		return 0;
 	}
@@ -2179,7 +2179,7 @@ rte_cryptodev_get_raw_dp_ctx_size(uint8_t dev_id)
 	int32_t size = sizeof(struct rte_crypto_raw_dp_ctx);
 	int32_t priv_size;
 
-	if (!rte_cryptodev_pmd_is_valid_dev(dev_id))
+	if (!rte_cryptodev_is_valid_dev(dev_id))
 		return -EINVAL;
 
 	dev = rte_cryptodev_pmd_get_dev(dev_id);
diff --git a/lib/cryptodev/rte_cryptodev.h b/lib/cryptodev/rte_cryptodev.h
index 11f4e6fdbf..bb01f0f195 100644
--- a/lib/cryptodev/rte_cryptodev.h
+++ b/lib/cryptodev/rte_cryptodev.h
@@ -1368,6 +1368,17 @@ __rte_experimental
 unsigned int
 rte_cryptodev_asym_get_private_session_size(uint8_t dev_id);
 
+/**
+ * Validate if the crypto device index is valid attached crypto device.
+ *
+ * @param	dev_id	Crypto device index.
+ *
+ * @return
+ *   - If the device index is valid (1) or not (0).
+ */
+unsigned int
+rte_cryptodev_is_valid_dev(uint8_t dev_id);
+
 /**
  * Provide driver identifier.
  *
diff --git a/lib/cryptodev/rte_cryptodev_pmd.h b/lib/cryptodev/rte_cryptodev_pmd.h
index 1274436870..dd2a4940a2 100644
--- a/lib/cryptodev/rte_cryptodev_pmd.h
+++ b/lib/cryptodev/rte_cryptodev_pmd.h
@@ -94,17 +94,6 @@ rte_cryptodev_pmd_get_dev(uint8_t dev_id);
 struct rte_cryptodev *
 rte_cryptodev_pmd_get_named_dev(const char *name);
 
-/**
- * Validate if the crypto device index is valid attached crypto device.
- *
- * @param	dev_id	Crypto device index.
- *
- * @return
- *   - If the device index is valid (1) or not (0).
- */
-unsigned int
-rte_cryptodev_pmd_is_valid_dev(uint8_t dev_id);
-
 /**
  * The pool of rte_cryptodev structures.
  */
diff --git a/lib/cryptodev/version.map b/lib/cryptodev/version.map
index 979d823a7c..1a7f759c57 100644
--- a/lib/cryptodev/version.map
+++ b/lib/cryptodev/version.map
@@ -25,6 +25,7 @@ DPDK_22 {
 	rte_cryptodev_get_feature_name;
 	rte_cryptodev_get_sec_ctx;
 	rte_cryptodev_info_get;
+	rte_cryptodev_is_valid_dev;
 	rte_cryptodev_name_get;
 	rte_cryptodev_pmd_allocate;
 	rte_cryptodev_pmd_callback_process;
@@ -33,7 +34,6 @@ DPDK_22 {
 	rte_cryptodev_pmd_destroy;
 	rte_cryptodev_pmd_get_dev;
 	rte_cryptodev_pmd_get_named_dev;
-	rte_cryptodev_pmd_is_valid_dev;
 	rte_cryptodev_pmd_parse_input_args;
 	rte_cryptodev_pmd_release_device;
 	rte_cryptodev_queue_pair_count;
diff --git a/lib/eventdev/rte_event_crypto_adapter.c b/lib/eventdev/rte_event_crypto_adapter.c
index e1d38d383d..2d38389858 100644
--- a/lib/eventdev/rte_event_crypto_adapter.c
+++ b/lib/eventdev/rte_event_crypto_adapter.c
@@ -781,7 +781,7 @@ rte_event_crypto_adapter_queue_pair_add(uint8_t id,
 
 	EVENT_CRYPTO_ADAPTER_ID_VALID_OR_ERR_RET(id, -EINVAL);
 
-	if (!rte_cryptodev_pmd_is_valid_dev(cdev_id)) {
+	if (!rte_cryptodev_is_valid_dev(cdev_id)) {
 		RTE_EDEV_LOG_ERR("Invalid dev_id=%" PRIu8, cdev_id);
 		return -EINVAL;
 	}
@@ -898,7 +898,7 @@ rte_event_crypto_adapter_queue_pair_del(uint8_t id, uint8_t cdev_id,
 
 	EVENT_CRYPTO_ADAPTER_ID_VALID_OR_ERR_RET(id, -EINVAL);
 
-	if (!rte_cryptodev_pmd_is_valid_dev(cdev_id)) {
+	if (!rte_cryptodev_is_valid_dev(cdev_id)) {
 		RTE_EDEV_LOG_ERR("Invalid dev_id=%" PRIu8, cdev_id);
 		return -EINVAL;
 	}
diff --git a/lib/eventdev/rte_eventdev.c b/lib/eventdev/rte_eventdev.c
index 594dd5e759..cb0ed7b620 100644
--- a/lib/eventdev/rte_eventdev.c
+++ b/lib/eventdev/rte_eventdev.c
@@ -165,7 +165,7 @@ rte_event_crypto_adapter_caps_get(uint8_t dev_id, uint8_t cdev_id,
 	struct rte_cryptodev *cdev;
 
 	RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(dev_id, -EINVAL);
-	if (!rte_cryptodev_pmd_is_valid_dev(cdev_id))
+	if (!rte_cryptodev_is_valid_dev(cdev_id))
 		return -EINVAL;
 
 	dev = &rte_eventdevs[dev_id];
diff --git a/lib/pipeline/rte_table_action.c b/lib/pipeline/rte_table_action.c
index 98f3438774..54721ed96a 100644
--- a/lib/pipeline/rte_table_action.c
+++ b/lib/pipeline/rte_table_action.c
@@ -1732,7 +1732,7 @@ struct sym_crypto_data {
 static int
 sym_crypto_cfg_check(struct rte_table_action_sym_crypto_config *cfg)
 {
-	if (!rte_cryptodev_pmd_is_valid_dev(cfg->cryptodev_id))
+	if (!rte_cryptodev_is_valid_dev(cfg->cryptodev_id))
 		return -EINVAL;
 	if (cfg->mp_create == NULL || cfg->mp_init == NULL)
 		return -EINVAL;
-- 
2.25.1


^ permalink raw reply	[relevance 3%]

* [dpdk-dev] [PATCH v3 4/4] cryptodev: expose driver interface as internal
    2021-09-07 19:00  3%   ` [dpdk-dev] [PATCH v3 2/4] cryptodev: change valid dev API Akhil Goyal
@ 2021-09-07 19:00  2%   ` Akhil Goyal
    2 siblings, 0 replies; 200+ results
From: Akhil Goyal @ 2021-09-07 19:00 UTC (permalink / raw)
  To: dev
  Cc: anoobj, radu.nicolau, declan.doherty, hemant.agrawal, matan,
	konstantin.ananyev, thomas, roy.fan.zhang, asomalap,
	ruifeng.wang, ajit.khaparde, pablo.de.lara.guarch, fiona.trahe,
	adwivedi, michaelsh, rnagadheeraj, jianjay.zhou, Akhil Goyal

The rte_cryptodev_pmd.* files are for drivers only and should be
private to DPDK, and not installed for app use.

Signed-off-by: Akhil Goyal <gakhil@marvell.com>
Acked-by: Matan Azrad <matan@nvidia.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
---
 doc/guides/rel_notes/release_21_11.rst        |  4 +++
 drivers/crypto/aesni_gcm/aesni_gcm_pmd.c      |  2 +-
 drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c  |  2 +-
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c    |  2 +-
 .../crypto/aesni_mb/rte_aesni_mb_pmd_ops.c    |  2 +-
 drivers/crypto/armv8/rte_armv8_pmd.c          |  2 +-
 drivers/crypto/armv8/rte_armv8_pmd_ops.c      |  2 +-
 drivers/crypto/bcmfs/bcmfs_sym_pmd.c          |  2 +-
 drivers/crypto/bcmfs/bcmfs_sym_session.h      |  2 +-
 drivers/crypto/caam_jr/caam_jr.c              |  2 +-
 drivers/crypto/ccp/ccp_crypto.c               |  2 +-
 drivers/crypto/ccp/ccp_pmd_ops.c              |  2 +-
 drivers/crypto/ccp/rte_ccp_pmd.c              |  2 +-
 drivers/crypto/cnxk/cn10k_cryptodev.c         |  2 +-
 drivers/crypto/cnxk/cn10k_cryptodev_ops.c     |  2 +-
 drivers/crypto/cnxk/cn10k_cryptodev_ops.h     |  2 +-
 drivers/crypto/cnxk/cn9k_cryptodev.c          |  2 +-
 drivers/crypto/cnxk/cn9k_cryptodev_ops.c      |  2 +-
 drivers/crypto/cnxk/cn9k_cryptodev_ops.h      |  2 +-
 drivers/crypto/cnxk/cnxk_cryptodev_ops.c      |  2 +-
 drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c   |  2 +-
 drivers/crypto/dpaa_sec/dpaa_sec.c            |  2 +-
 drivers/crypto/kasumi/rte_kasumi_pmd.c        |  2 +-
 drivers/crypto/kasumi/rte_kasumi_pmd_ops.c    |  2 +-
 drivers/crypto/mlx5/mlx5_crypto.h             |  2 +-
 drivers/crypto/mvsam/rte_mrvl_pmd.c           |  2 +-
 drivers/crypto/mvsam/rte_mrvl_pmd_ops.c       |  2 +-
 drivers/crypto/nitrox/nitrox_sym.c            |  2 +-
 drivers/crypto/null/null_crypto_pmd.c         |  2 +-
 drivers/crypto/null/null_crypto_pmd_ops.c     |  2 +-
 drivers/crypto/octeontx/otx_cryptodev.c       |  2 +-
 drivers/crypto/octeontx/otx_cryptodev_ops.c   |  2 +-
 drivers/crypto/octeontx2/otx2_cryptodev.c     |  2 +-
 drivers/crypto/octeontx2/otx2_cryptodev_ops.c |  2 +-
 drivers/crypto/octeontx2/otx2_cryptodev_ops.h |  2 +-
 drivers/crypto/openssl/rte_openssl_pmd.c      |  2 +-
 drivers/crypto/openssl/rte_openssl_pmd_ops.c  |  2 +-
 drivers/crypto/qat/qat_asym.h                 |  2 +-
 drivers/crypto/qat/qat_asym_pmd.c             |  2 +-
 drivers/crypto/qat/qat_sym.h                  |  2 +-
 drivers/crypto/qat/qat_sym_hw_dp.c            |  2 +-
 drivers/crypto/qat/qat_sym_pmd.c              |  2 +-
 drivers/crypto/qat/qat_sym_session.h          |  2 +-
 .../scheduler/rte_cryptodev_scheduler.c       |  2 +-
 drivers/crypto/scheduler/scheduler_pmd.c      |  2 +-
 drivers/crypto/scheduler/scheduler_pmd_ops.c  |  2 +-
 drivers/crypto/snow3g/rte_snow3g_pmd.c        |  2 +-
 drivers/crypto/snow3g/rte_snow3g_pmd_ops.c    |  2 +-
 drivers/crypto/virtio/virtio_cryptodev.c      |  2 +-
 drivers/crypto/virtio/virtio_rxtx.c           |  2 +-
 drivers/crypto/zuc/rte_zuc_pmd.c              |  2 +-
 drivers/crypto/zuc/rte_zuc_pmd_ops.c          |  2 +-
 .../octeontx2/otx2_evdev_crypto_adptr_rx.h    |  2 +-
 .../octeontx2/otx2_evdev_crypto_adptr_tx.h    |  2 +-
 .../net/softnic/rte_eth_softnic_cryptodev.c   |  2 +-
 .../{rte_cryptodev_pmd.c => cryptodev_pmd.c}  |  2 +-
 .../{rte_cryptodev_pmd.h => cryptodev_pmd.h}  | 16 +++++++++---
 lib/cryptodev/meson.build                     | 18 ++++++++++---
 lib/cryptodev/rte_cryptodev.c                 |  2 +-
 lib/cryptodev/version.map                     | 25 +++++++++++--------
 lib/eventdev/rte_event_crypto_adapter.c       |  2 +-
 lib/eventdev/rte_eventdev.c                   |  2 +-
 lib/pipeline/rte_table_action.c               |  2 +-
 63 files changed, 105 insertions(+), 76 deletions(-)
 rename lib/cryptodev/{rte_cryptodev_pmd.c => cryptodev_pmd.c} (99%)
 rename lib/cryptodev/{rte_cryptodev_pmd.h => cryptodev_pmd.h} (98%)

diff --git a/doc/guides/rel_notes/release_21_11.rst b/doc/guides/rel_notes/release_21_11.rst
index e7ad50ba09..8785b25ff6 100644
--- a/doc/guides/rel_notes/release_21_11.rst
+++ b/doc/guides/rel_notes/release_21_11.rst
@@ -106,6 +106,10 @@ API Changes
   rte_cryptodev_is_valid_dev as it can be used by the application as
   well as PMD to check whether the device is valid or not.
 
+* cryptodev: The rte_cryptodev_pmd.* files are renamed as cryptodev_pmd.*
+  as it is for drivers only and should be private to DPDK, and not
+  installed for app use.
+
 
 ABI Changes
 -----------
diff --git a/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c b/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c
index 886e2a5aaa..330aad8157 100644
--- a/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c
+++ b/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c
@@ -5,7 +5,7 @@
 #include <rte_common.h>
 #include <rte_hexdump.h>
 #include <rte_cryptodev.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 #include <rte_bus_vdev.h>
 #include <rte_malloc.h>
 #include <rte_cpuflags.h>
diff --git a/drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c b/drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c
index 18dbc4c18c..edb7275e76 100644
--- a/drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c
+++ b/drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c
@@ -6,7 +6,7 @@
 
 #include <rte_common.h>
 #include <rte_malloc.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 
 #include "aesni_gcm_pmd_private.h"
 
diff --git a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c
index a01c826a3c..60963a8208 100644
--- a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c
+++ b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c
@@ -7,7 +7,7 @@
 #include <rte_common.h>
 #include <rte_hexdump.h>
 #include <rte_cryptodev.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 #include <rte_bus_vdev.h>
 #include <rte_malloc.h>
 #include <rte_cpuflags.h>
diff --git a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c
index fc7fdfec8e..48a8f91868 100644
--- a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c
+++ b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c
@@ -8,7 +8,7 @@
 #include <rte_common.h>
 #include <rte_malloc.h>
 #include <rte_ether.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 
 #include "aesni_mb_pmd_private.h"
 
diff --git a/drivers/crypto/armv8/rte_armv8_pmd.c b/drivers/crypto/armv8/rte_armv8_pmd.c
index c642ac350f..36a1a9bb4f 100644
--- a/drivers/crypto/armv8/rte_armv8_pmd.c
+++ b/drivers/crypto/armv8/rte_armv8_pmd.c
@@ -7,7 +7,7 @@
 #include <rte_common.h>
 #include <rte_hexdump.h>
 #include <rte_cryptodev.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 #include <rte_bus_vdev.h>
 #include <rte_malloc.h>
 #include <rte_cpuflags.h>
diff --git a/drivers/crypto/armv8/rte_armv8_pmd_ops.c b/drivers/crypto/armv8/rte_armv8_pmd_ops.c
index 01ccfb4b23..1b2749fe62 100644
--- a/drivers/crypto/armv8/rte_armv8_pmd_ops.c
+++ b/drivers/crypto/armv8/rte_armv8_pmd_ops.c
@@ -6,7 +6,7 @@
 
 #include <rte_common.h>
 #include <rte_malloc.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 
 #include "armv8_pmd_private.h"
 
diff --git a/drivers/crypto/bcmfs/bcmfs_sym_pmd.c b/drivers/crypto/bcmfs/bcmfs_sym_pmd.c
index aa7fad6d70..d1dd22823e 100644
--- a/drivers/crypto/bcmfs/bcmfs_sym_pmd.c
+++ b/drivers/crypto/bcmfs/bcmfs_sym_pmd.c
@@ -7,7 +7,7 @@
 #include <rte_dev.h>
 #include <rte_errno.h>
 #include <rte_malloc.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 
 #include "bcmfs_device.h"
 #include "bcmfs_logs.h"
diff --git a/drivers/crypto/bcmfs/bcmfs_sym_session.h b/drivers/crypto/bcmfs/bcmfs_sym_session.h
index 8240c6fc25..d40595b4bd 100644
--- a/drivers/crypto/bcmfs/bcmfs_sym_session.h
+++ b/drivers/crypto/bcmfs/bcmfs_sym_session.h
@@ -8,7 +8,7 @@
 
 #include <stdbool.h>
 #include <rte_crypto.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 
 #include "bcmfs_sym_defs.h"
 #include "bcmfs_sym_req.h"
diff --git a/drivers/crypto/caam_jr/caam_jr.c b/drivers/crypto/caam_jr/caam_jr.c
index 3fb3fe0f8a..258750afe7 100644
--- a/drivers/crypto/caam_jr/caam_jr.c
+++ b/drivers/crypto/caam_jr/caam_jr.c
@@ -9,7 +9,7 @@
 
 #include <rte_byteorder.h>
 #include <rte_common.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 #include <rte_crypto.h>
 #include <rte_cryptodev.h>
 #include <rte_bus_vdev.h>
diff --git a/drivers/crypto/ccp/ccp_crypto.c b/drivers/crypto/ccp/ccp_crypto.c
index f37d35f18f..70daed791e 100644
--- a/drivers/crypto/ccp/ccp_crypto.c
+++ b/drivers/crypto/ccp/ccp_crypto.c
@@ -20,7 +20,7 @@
 #include <rte_memory.h>
 #include <rte_spinlock.h>
 #include <rte_string_fns.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 
 #include "ccp_dev.h"
 #include "ccp_crypto.h"
diff --git a/drivers/crypto/ccp/ccp_pmd_ops.c b/drivers/crypto/ccp/ccp_pmd_ops.c
index 98f964f361..0d615d311c 100644
--- a/drivers/crypto/ccp/ccp_pmd_ops.c
+++ b/drivers/crypto/ccp/ccp_pmd_ops.c
@@ -5,7 +5,7 @@
 #include <string.h>
 
 #include <rte_common.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 #include <rte_malloc.h>
 
 #include "ccp_pmd_private.h"
diff --git a/drivers/crypto/ccp/rte_ccp_pmd.c b/drivers/crypto/ccp/rte_ccp_pmd.c
index ab9416942e..a54d81de46 100644
--- a/drivers/crypto/ccp/rte_ccp_pmd.c
+++ b/drivers/crypto/ccp/rte_ccp_pmd.c
@@ -7,7 +7,7 @@
 #include <rte_bus_vdev.h>
 #include <rte_common.h>
 #include <rte_cryptodev.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 #include <rte_pci.h>
 #include <rte_dev.h>
 #include <rte_malloc.h>
diff --git a/drivers/crypto/cnxk/cn10k_cryptodev.c b/drivers/crypto/cnxk/cn10k_cryptodev.c
index db7b5aa7c6..012eb0c051 100644
--- a/drivers/crypto/cnxk/cn10k_cryptodev.c
+++ b/drivers/crypto/cnxk/cn10k_cryptodev.c
@@ -6,7 +6,7 @@
 #include <rte_common.h>
 #include <rte_crypto.h>
 #include <rte_cryptodev.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 #include <rte_dev.h>
 #include <rte_pci.h>
 
diff --git a/drivers/crypto/cnxk/cn10k_cryptodev_ops.c b/drivers/crypto/cnxk/cn10k_cryptodev_ops.c
index cccca77f60..3a1a4a2e29 100644
--- a/drivers/crypto/cnxk/cn10k_cryptodev_ops.c
+++ b/drivers/crypto/cnxk/cn10k_cryptodev_ops.c
@@ -3,7 +3,7 @@
  */
 
 #include <rte_cryptodev.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 #include <rte_event_crypto_adapter.h>
 #include <rte_ip.h>
 
diff --git a/drivers/crypto/cnxk/cn10k_cryptodev_ops.h b/drivers/crypto/cnxk/cn10k_cryptodev_ops.h
index b03d2eee14..d7e9f87396 100644
--- a/drivers/crypto/cnxk/cn10k_cryptodev_ops.h
+++ b/drivers/crypto/cnxk/cn10k_cryptodev_ops.h
@@ -6,7 +6,7 @@
 #define _CN10K_CRYPTODEV_OPS_H_
 
 #include <rte_cryptodev.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 
 extern struct rte_cryptodev_ops cn10k_cpt_ops;
 
diff --git a/drivers/crypto/cnxk/cn9k_cryptodev.c b/drivers/crypto/cnxk/cn9k_cryptodev.c
index e60b352fac..6b8cb01a12 100644
--- a/drivers/crypto/cnxk/cn9k_cryptodev.c
+++ b/drivers/crypto/cnxk/cn9k_cryptodev.c
@@ -6,7 +6,7 @@
 #include <rte_common.h>
 #include <rte_crypto.h>
 #include <rte_cryptodev.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 #include <rte_dev.h>
 #include <rte_pci.h>
 
diff --git a/drivers/crypto/cnxk/cn9k_cryptodev_ops.c b/drivers/crypto/cnxk/cn9k_cryptodev_ops.c
index 40109acc3f..75277936b0 100644
--- a/drivers/crypto/cnxk/cn9k_cryptodev_ops.c
+++ b/drivers/crypto/cnxk/cn9k_cryptodev_ops.c
@@ -3,7 +3,7 @@
  */
 
 #include <rte_cryptodev.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 #include <rte_event_crypto_adapter.h>
 #include <rte_ip.h>
 #include <rte_vect.h>
diff --git a/drivers/crypto/cnxk/cn9k_cryptodev_ops.h b/drivers/crypto/cnxk/cn9k_cryptodev_ops.h
index 1255de33ae..309f507346 100644
--- a/drivers/crypto/cnxk/cn9k_cryptodev_ops.h
+++ b/drivers/crypto/cnxk/cn9k_cryptodev_ops.h
@@ -5,7 +5,7 @@
 #ifndef _CN9K_CRYPTODEV_OPS_H_
 #define _CN9K_CRYPTODEV_OPS_H_
 
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 
 extern struct rte_cryptodev_ops cn9k_cpt_ops;
 
diff --git a/drivers/crypto/cnxk/cnxk_cryptodev_ops.c b/drivers/crypto/cnxk/cnxk_cryptodev_ops.c
index 957c78063f..41d8fe49e1 100644
--- a/drivers/crypto/cnxk/cnxk_cryptodev_ops.c
+++ b/drivers/crypto/cnxk/cnxk_cryptodev_ops.c
@@ -3,7 +3,7 @@
  */
 
 #include <rte_cryptodev.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 #include <rte_errno.h>
 
 #include "roc_cpt.h"
diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
index 1ccead3641..bf69c61916 100644
--- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
+++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
@@ -18,7 +18,7 @@
 #include <rte_cycles.h>
 #include <rte_kvargs.h>
 #include <rte_dev.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 #include <rte_common.h>
 #include <rte_fslmc.h>
 #include <fslmc_vfio.h>
diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c
index 19d4684e24..3d53746ef1 100644
--- a/drivers/crypto/dpaa_sec/dpaa_sec.c
+++ b/drivers/crypto/dpaa_sec/dpaa_sec.c
@@ -12,7 +12,7 @@
 
 #include <rte_byteorder.h>
 #include <rte_common.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 #include <rte_crypto.h>
 #include <rte_cryptodev.h>
 #ifdef RTE_LIB_SECURITY
diff --git a/drivers/crypto/kasumi/rte_kasumi_pmd.c b/drivers/crypto/kasumi/rte_kasumi_pmd.c
index 48b7db9e9b..d6f927417a 100644
--- a/drivers/crypto/kasumi/rte_kasumi_pmd.c
+++ b/drivers/crypto/kasumi/rte_kasumi_pmd.c
@@ -5,7 +5,7 @@
 #include <rte_common.h>
 #include <rte_hexdump.h>
 #include <rte_cryptodev.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 #include <rte_bus_vdev.h>
 #include <rte_malloc.h>
 #include <rte_cpuflags.h>
diff --git a/drivers/crypto/kasumi/rte_kasumi_pmd_ops.c b/drivers/crypto/kasumi/rte_kasumi_pmd_ops.c
index 43376c1aa0..f075054807 100644
--- a/drivers/crypto/kasumi/rte_kasumi_pmd_ops.c
+++ b/drivers/crypto/kasumi/rte_kasumi_pmd_ops.c
@@ -6,7 +6,7 @@
 
 #include <rte_common.h>
 #include <rte_malloc.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 
 #include "kasumi_pmd_private.h"
 
diff --git a/drivers/crypto/mlx5/mlx5_crypto.h b/drivers/crypto/mlx5/mlx5_crypto.h
index 722acb8d19..d589e0ac3d 100644
--- a/drivers/crypto/mlx5/mlx5_crypto.h
+++ b/drivers/crypto/mlx5/mlx5_crypto.h
@@ -8,7 +8,7 @@
 #include <stdbool.h>
 
 #include <rte_cryptodev.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 
 #include <mlx5_common_utils.h>
 #include <mlx5_common_devx.h>
diff --git a/drivers/crypto/mvsam/rte_mrvl_pmd.c b/drivers/crypto/mvsam/rte_mrvl_pmd.c
index ed85bb6547..a72642a772 100644
--- a/drivers/crypto/mvsam/rte_mrvl_pmd.c
+++ b/drivers/crypto/mvsam/rte_mrvl_pmd.c
@@ -7,7 +7,7 @@
 #include <rte_common.h>
 #include <rte_hexdump.h>
 #include <rte_cryptodev.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 #include <rte_security_driver.h>
 #include <rte_bus_vdev.h>
 #include <rte_malloc.h>
diff --git a/drivers/crypto/mvsam/rte_mrvl_pmd_ops.c b/drivers/crypto/mvsam/rte_mrvl_pmd_ops.c
index fa36461276..3064b1f136 100644
--- a/drivers/crypto/mvsam/rte_mrvl_pmd_ops.c
+++ b/drivers/crypto/mvsam/rte_mrvl_pmd_ops.c
@@ -8,7 +8,7 @@
 
 #include <rte_common.h>
 #include <rte_malloc.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 #include <rte_security_driver.h>
 
 #include "mrvl_pmd_private.h"
diff --git a/drivers/crypto/nitrox/nitrox_sym.c b/drivers/crypto/nitrox/nitrox_sym.c
index 2768bdd2e1..f8b7edcd69 100644
--- a/drivers/crypto/nitrox/nitrox_sym.c
+++ b/drivers/crypto/nitrox/nitrox_sym.c
@@ -4,7 +4,7 @@
 
 #include <stdbool.h>
 
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 #include <rte_crypto.h>
 
 #include "nitrox_sym.h"
diff --git a/drivers/crypto/null/null_crypto_pmd.c b/drivers/crypto/null/null_crypto_pmd.c
index 179e5ff36d..f9935d52cc 100644
--- a/drivers/crypto/null/null_crypto_pmd.c
+++ b/drivers/crypto/null/null_crypto_pmd.c
@@ -3,7 +3,7 @@
  */
 
 #include <rte_common.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 #include <rte_bus_vdev.h>
 #include <rte_malloc.h>
 
diff --git a/drivers/crypto/null/null_crypto_pmd_ops.c b/drivers/crypto/null/null_crypto_pmd_ops.c
index d67892a1bb..a8b5a06e7f 100644
--- a/drivers/crypto/null/null_crypto_pmd_ops.c
+++ b/drivers/crypto/null/null_crypto_pmd_ops.c
@@ -6,7 +6,7 @@
 
 #include <rte_common.h>
 #include <rte_malloc.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 
 #include "null_crypto_pmd_private.h"
 
diff --git a/drivers/crypto/octeontx/otx_cryptodev.c b/drivers/crypto/octeontx/otx_cryptodev.c
index 3822c0d779..c294f86d79 100644
--- a/drivers/crypto/octeontx/otx_cryptodev.c
+++ b/drivers/crypto/octeontx/otx_cryptodev.c
@@ -5,7 +5,7 @@
 #include <rte_bus_pci.h>
 #include <rte_common.h>
 #include <rte_cryptodev.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 #include <rte_log.h>
 #include <rte_pci.h>
 
diff --git a/drivers/crypto/octeontx/otx_cryptodev_ops.c b/drivers/crypto/octeontx/otx_cryptodev_ops.c
index eac6796cfb..9b5bde53f8 100644
--- a/drivers/crypto/octeontx/otx_cryptodev_ops.c
+++ b/drivers/crypto/octeontx/otx_cryptodev_ops.c
@@ -5,7 +5,7 @@
 #include <rte_alarm.h>
 #include <rte_bus_pci.h>
 #include <rte_cryptodev.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 #include <rte_eventdev.h>
 #include <rte_event_crypto_adapter.h>
 #include <rte_errno.h>
diff --git a/drivers/crypto/octeontx2/otx2_cryptodev.c b/drivers/crypto/octeontx2/otx2_cryptodev.c
index 75fb4f9a3b..85b1f00263 100644
--- a/drivers/crypto/octeontx2/otx2_cryptodev.c
+++ b/drivers/crypto/octeontx2/otx2_cryptodev.c
@@ -6,7 +6,7 @@
 #include <rte_common.h>
 #include <rte_crypto.h>
 #include <rte_cryptodev.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 #include <rte_dev.h>
 #include <rte_errno.h>
 #include <rte_mempool.h>
diff --git a/drivers/crypto/octeontx2/otx2_cryptodev_ops.c b/drivers/crypto/octeontx2/otx2_cryptodev_ops.c
index 42100154cd..09ddbb5f34 100644
--- a/drivers/crypto/octeontx2/otx2_cryptodev_ops.c
+++ b/drivers/crypto/octeontx2/otx2_cryptodev_ops.c
@@ -4,7 +4,7 @@
 
 #include <unistd.h>
 
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 #include <rte_errno.h>
 #include <rte_ethdev.h>
 #include <rte_event_crypto_adapter.h>
diff --git a/drivers/crypto/octeontx2/otx2_cryptodev_ops.h b/drivers/crypto/octeontx2/otx2_cryptodev_ops.h
index 1970187f88..8d135909b3 100644
--- a/drivers/crypto/octeontx2/otx2_cryptodev_ops.h
+++ b/drivers/crypto/octeontx2/otx2_cryptodev_ops.h
@@ -5,7 +5,7 @@
 #ifndef _OTX2_CRYPTODEV_OPS_H_
 #define _OTX2_CRYPTODEV_OPS_H_
 
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 
 #define OTX2_CPT_MIN_HEADROOM_REQ	24
 #define OTX2_CPT_MIN_TAILROOM_REQ	8
diff --git a/drivers/crypto/openssl/rte_openssl_pmd.c b/drivers/crypto/openssl/rte_openssl_pmd.c
index 37b969b916..13c6ea8724 100644
--- a/drivers/crypto/openssl/rte_openssl_pmd.c
+++ b/drivers/crypto/openssl/rte_openssl_pmd.c
@@ -5,7 +5,7 @@
 #include <rte_common.h>
 #include <rte_hexdump.h>
 #include <rte_cryptodev.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 #include <rte_bus_vdev.h>
 #include <rte_malloc.h>
 #include <rte_cpuflags.h>
diff --git a/drivers/crypto/openssl/rte_openssl_pmd_ops.c b/drivers/crypto/openssl/rte_openssl_pmd_ops.c
index ed75877581..52715f86f8 100644
--- a/drivers/crypto/openssl/rte_openssl_pmd_ops.c
+++ b/drivers/crypto/openssl/rte_openssl_pmd_ops.c
@@ -6,7 +6,7 @@
 
 #include <rte_common.h>
 #include <rte_malloc.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 
 #include "openssl_pmd_private.h"
 #include "compat.h"
diff --git a/drivers/crypto/qat/qat_asym.h b/drivers/crypto/qat/qat_asym.h
index 2838aee76f..308b6b2e0b 100644
--- a/drivers/crypto/qat/qat_asym.h
+++ b/drivers/crypto/qat/qat_asym.h
@@ -5,7 +5,7 @@
 #ifndef _QAT_ASYM_H_
 #define _QAT_ASYM_H_
 
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 #include <rte_crypto_asym.h>
 #include "icp_qat_fw_pke.h"
 #include "qat_common.h"
diff --git a/drivers/crypto/qat/qat_asym_pmd.c b/drivers/crypto/qat/qat_asym_pmd.c
index 0c25cce09e..e91bb0d317 100644
--- a/drivers/crypto/qat/qat_asym_pmd.c
+++ b/drivers/crypto/qat/qat_asym_pmd.c
@@ -2,7 +2,7 @@
  * Copyright(c) 2019 Intel Corporation
  */
 
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 
 #include "qat_logs.h"
 
diff --git a/drivers/crypto/qat/qat_sym.h b/drivers/crypto/qat/qat_sym.h
index 20b1b53d36..e3ec7f0de4 100644
--- a/drivers/crypto/qat/qat_sym.h
+++ b/drivers/crypto/qat/qat_sym.h
@@ -5,7 +5,7 @@
 #ifndef _QAT_SYM_H_
 #define _QAT_SYM_H_
 
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 #ifdef RTE_LIB_SECURITY
 #include <rte_net_crc.h>
 #endif
diff --git a/drivers/crypto/qat/qat_sym_hw_dp.c b/drivers/crypto/qat/qat_sym_hw_dp.c
index ac9ac05363..36d11e0dc9 100644
--- a/drivers/crypto/qat/qat_sym_hw_dp.c
+++ b/drivers/crypto/qat/qat_sym_hw_dp.c
@@ -2,7 +2,7 @@
  * Copyright(c) 2020 Intel Corporation
  */
 
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 
 #include "adf_transport_access_macros.h"
 #include "icp_qat_fw.h"
diff --git a/drivers/crypto/qat/qat_sym_pmd.c b/drivers/crypto/qat/qat_sym_pmd.c
index 6868e5f001..efda921c05 100644
--- a/drivers/crypto/qat/qat_sym_pmd.c
+++ b/drivers/crypto/qat/qat_sym_pmd.c
@@ -7,7 +7,7 @@
 #include <rte_dev.h>
 #include <rte_malloc.h>
 #include <rte_pci.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 #ifdef RTE_LIB_SECURITY
 #include <rte_security_driver.h>
 #endif
diff --git a/drivers/crypto/qat/qat_sym_session.h b/drivers/crypto/qat/qat_sym_session.h
index 33b236e49b..6ebc176729 100644
--- a/drivers/crypto/qat/qat_sym_session.h
+++ b/drivers/crypto/qat/qat_sym_session.h
@@ -5,7 +5,7 @@
 #define _QAT_SYM_SESSION_H_
 
 #include <rte_crypto.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 #ifdef RTE_LIB_SECURITY
 #include <rte_security.h>
 #endif
diff --git a/drivers/crypto/scheduler/rte_cryptodev_scheduler.c b/drivers/crypto/scheduler/rte_cryptodev_scheduler.c
index 1e0b4df0ca..1e0c4fe464 100644
--- a/drivers/crypto/scheduler/rte_cryptodev_scheduler.c
+++ b/drivers/crypto/scheduler/rte_cryptodev_scheduler.c
@@ -4,7 +4,7 @@
 #include <rte_string_fns.h>
 #include <rte_reorder.h>
 #include <rte_cryptodev.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 #include <rte_malloc.h>
 
 #include "rte_cryptodev_scheduler.h"
diff --git a/drivers/crypto/scheduler/scheduler_pmd.c b/drivers/crypto/scheduler/scheduler_pmd.c
index 632197833c..560c26af50 100644
--- a/drivers/crypto/scheduler/scheduler_pmd.c
+++ b/drivers/crypto/scheduler/scheduler_pmd.c
@@ -4,7 +4,7 @@
 #include <rte_common.h>
 #include <rte_hexdump.h>
 #include <rte_cryptodev.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 #include <rte_bus_vdev.h>
 #include <rte_malloc.h>
 #include <rte_cpuflags.h>
diff --git a/drivers/crypto/scheduler/scheduler_pmd_ops.c b/drivers/crypto/scheduler/scheduler_pmd_ops.c
index cb125e8027..465b88ade8 100644
--- a/drivers/crypto/scheduler/scheduler_pmd_ops.c
+++ b/drivers/crypto/scheduler/scheduler_pmd_ops.c
@@ -7,7 +7,7 @@
 #include <rte_malloc.h>
 #include <rte_dev.h>
 #include <rte_cryptodev.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 #include <rte_reorder.h>
 
 #include "scheduler_pmd_private.h"
diff --git a/drivers/crypto/snow3g/rte_snow3g_pmd.c b/drivers/crypto/snow3g/rte_snow3g_pmd.c
index 9aab357846..8284ac0b66 100644
--- a/drivers/crypto/snow3g/rte_snow3g_pmd.c
+++ b/drivers/crypto/snow3g/rte_snow3g_pmd.c
@@ -5,7 +5,7 @@
 #include <rte_common.h>
 #include <rte_hexdump.h>
 #include <rte_cryptodev.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 #include <rte_bus_vdev.h>
 #include <rte_malloc.h>
 #include <rte_cpuflags.h>
diff --git a/drivers/crypto/snow3g/rte_snow3g_pmd_ops.c b/drivers/crypto/snow3g/rte_snow3g_pmd_ops.c
index 906a0fe60b..3f46014b7d 100644
--- a/drivers/crypto/snow3g/rte_snow3g_pmd_ops.c
+++ b/drivers/crypto/snow3g/rte_snow3g_pmd_ops.c
@@ -6,7 +6,7 @@
 
 #include <rte_common.h>
 #include <rte_malloc.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 
 #include "snow3g_pmd_private.h"
 
diff --git a/drivers/crypto/virtio/virtio_cryptodev.c b/drivers/crypto/virtio/virtio_cryptodev.c
index 4bae74a487..8faa39df4a 100644
--- a/drivers/crypto/virtio/virtio_cryptodev.c
+++ b/drivers/crypto/virtio/virtio_cryptodev.c
@@ -9,7 +9,7 @@
 #include <rte_pci.h>
 #include <rte_bus_pci.h>
 #include <rte_cryptodev.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 #include <rte_eal.h>
 
 #include "virtio_cryptodev.h"
diff --git a/drivers/crypto/virtio/virtio_rxtx.c b/drivers/crypto/virtio/virtio_rxtx.c
index e1cb4ad104..a65524a306 100644
--- a/drivers/crypto/virtio/virtio_rxtx.c
+++ b/drivers/crypto/virtio/virtio_rxtx.c
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: BSD-3-Clause
  * Copyright(c) 2018 HUAWEI TECHNOLOGIES CO., LTD.
  */
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 
 #include "virtqueue.h"
 #include "virtio_cryptodev.h"
diff --git a/drivers/crypto/zuc/rte_zuc_pmd.c b/drivers/crypto/zuc/rte_zuc_pmd.c
index 42b669f188..d4b343a7af 100644
--- a/drivers/crypto/zuc/rte_zuc_pmd.c
+++ b/drivers/crypto/zuc/rte_zuc_pmd.c
@@ -5,7 +5,7 @@
 #include <rte_common.h>
 #include <rte_hexdump.h>
 #include <rte_cryptodev.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 #include <rte_bus_vdev.h>
 #include <rte_malloc.h>
 #include <rte_cpuflags.h>
diff --git a/drivers/crypto/zuc/rte_zuc_pmd_ops.c b/drivers/crypto/zuc/rte_zuc_pmd_ops.c
index dc9dc25ef8..38642d45ab 100644
--- a/drivers/crypto/zuc/rte_zuc_pmd_ops.c
+++ b/drivers/crypto/zuc/rte_zuc_pmd_ops.c
@@ -6,7 +6,7 @@
 
 #include <rte_common.h>
 #include <rte_malloc.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 
 #include "zuc_pmd_private.h"
 
diff --git a/drivers/event/octeontx2/otx2_evdev_crypto_adptr_rx.h b/drivers/event/octeontx2/otx2_evdev_crypto_adptr_rx.h
index a543225376..b33cb7e139 100644
--- a/drivers/event/octeontx2/otx2_evdev_crypto_adptr_rx.h
+++ b/drivers/event/octeontx2/otx2_evdev_crypto_adptr_rx.h
@@ -6,7 +6,7 @@
 #define _OTX2_EVDEV_CRYPTO_ADPTR_RX_H_
 
 #include <rte_cryptodev.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 #include <rte_eventdev.h>
 
 #include "cpt_pmd_logs.h"
diff --git a/drivers/event/octeontx2/otx2_evdev_crypto_adptr_tx.h b/drivers/event/octeontx2/otx2_evdev_crypto_adptr_tx.h
index ecf7eb9f56..1fc56f903b 100644
--- a/drivers/event/octeontx2/otx2_evdev_crypto_adptr_tx.h
+++ b/drivers/event/octeontx2/otx2_evdev_crypto_adptr_tx.h
@@ -6,7 +6,7 @@
 #define _OTX2_EVDEV_CRYPTO_ADPTR_TX_H_
 
 #include <rte_cryptodev.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 #include <rte_event_crypto_adapter.h>
 #include <rte_eventdev.h>
 
diff --git a/drivers/net/softnic/rte_eth_softnic_cryptodev.c b/drivers/net/softnic/rte_eth_softnic_cryptodev.c
index 8e278801c5..9a7d006f1a 100644
--- a/drivers/net/softnic/rte_eth_softnic_cryptodev.c
+++ b/drivers/net/softnic/rte_eth_softnic_cryptodev.c
@@ -6,7 +6,7 @@
 #include <stdio.h>
 
 #include <rte_cryptodev.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 #include <rte_string_fns.h>
 
 #include "rte_eth_softnic_internals.h"
diff --git a/lib/cryptodev/rte_cryptodev_pmd.c b/lib/cryptodev/cryptodev_pmd.c
similarity index 99%
rename from lib/cryptodev/rte_cryptodev_pmd.c
rename to lib/cryptodev/cryptodev_pmd.c
index e342daabc4..71e34140cd 100644
--- a/lib/cryptodev/rte_cryptodev_pmd.c
+++ b/lib/cryptodev/cryptodev_pmd.c
@@ -5,7 +5,7 @@
 #include <rte_string_fns.h>
 #include <rte_malloc.h>
 
-#include "rte_cryptodev_pmd.h"
+#include "cryptodev_pmd.h"
 
 /**
  * Parse name from argument
diff --git a/lib/cryptodev/rte_cryptodev_pmd.h b/lib/cryptodev/cryptodev_pmd.h
similarity index 98%
rename from lib/cryptodev/rte_cryptodev_pmd.h
rename to lib/cryptodev/cryptodev_pmd.h
index dd2a4940a2..ec7bb82be8 100644
--- a/lib/cryptodev/rte_cryptodev_pmd.h
+++ b/lib/cryptodev/cryptodev_pmd.h
@@ -2,8 +2,8 @@
  * Copyright(c) 2015-2020 Intel Corporation.
  */
 
-#ifndef _RTE_CRYPTODEV_PMD_H_
-#define _RTE_CRYPTODEV_PMD_H_
+#ifndef _CRYPTODEV_PMD_H_
+#define _CRYPTODEV_PMD_H_
 
 /** @file
  * RTE Crypto PMD APIs
@@ -80,6 +80,7 @@ struct cryptodev_driver {
  * @return
  *   - The rte_cryptodev structure pointer for the given device ID.
  */
+__rte_internal
 struct rte_cryptodev *
 rte_cryptodev_pmd_get_dev(uint8_t dev_id);
 
@@ -91,6 +92,7 @@ rte_cryptodev_pmd_get_dev(uint8_t dev_id);
  * @return
  *   - The rte_cryptodev structure pointer for the given device ID.
  */
+__rte_internal
 struct rte_cryptodev *
 rte_cryptodev_pmd_get_named_dev(const char *name);
 
@@ -401,6 +403,7 @@ struct rte_cryptodev_ops {
  * @return
  *   - Slot in the rte_dev_devices array for a new device;
  */
+__rte_internal
 struct rte_cryptodev *
 rte_cryptodev_pmd_allocate(const char *name, int socket_id);
 
@@ -414,6 +417,7 @@ rte_cryptodev_pmd_allocate(const char *name, int socket_id);
  * @return
  *   - 0 on success, negative on error
  */
+__rte_internal
 extern int
 rte_cryptodev_pmd_release_device(struct rte_cryptodev *cryptodev);
 
@@ -435,6 +439,7 @@ rte_cryptodev_pmd_release_device(struct rte_cryptodev *cryptodev);
  *  - 0 on success
  *  - errno on failure
  */
+__rte_internal
 int
 rte_cryptodev_pmd_parse_input_args(
 		struct rte_cryptodev_pmd_init_params *params,
@@ -454,6 +459,7 @@ rte_cryptodev_pmd_parse_input_args(
  *  - crypto device instance on success
  *  - NULL on creation failure
  */
+__rte_internal
 struct rte_cryptodev *
 rte_cryptodev_pmd_create(const char *name,
 		struct rte_device *device,
@@ -471,6 +477,7 @@ rte_cryptodev_pmd_create(const char *name,
  *  - 0 on success
  *  - errno on failure
  */
+__rte_internal
 int
 rte_cryptodev_pmd_destroy(struct rte_cryptodev *cryptodev);
 
@@ -484,6 +491,7 @@ rte_cryptodev_pmd_destroy(struct rte_cryptodev *cryptodev);
  * @return
  *  void
  */
+__rte_internal
 void rte_cryptodev_pmd_callback_process(struct rte_cryptodev *dev,
 				enum rte_cryptodev_event_type event);
 
@@ -491,6 +499,7 @@ void rte_cryptodev_pmd_callback_process(struct rte_cryptodev *dev,
  * @internal
  * Create unique device name
  */
+__rte_internal
 int
 rte_cryptodev_pmd_create_dev_name(char *name, const char *dev_name_prefix);
 
@@ -506,6 +515,7 @@ rte_cryptodev_pmd_create_dev_name(char *name, const char *dev_name_prefix);
  * @return
  *  The driver type identifier
  */
+__rte_internal
 uint8_t rte_cryptodev_allocate_driver(struct cryptodev_driver *crypto_drv,
 		const struct rte_driver *drv);
 
@@ -555,4 +565,4 @@ set_asym_session_private_data(struct rte_cryptodev_asym_session *sess,
 }
 #endif
 
-#endif /* _RTE_CRYPTODEV_PMD_H_ */
+#endif /* _CRYPTODEV_PMD_H_ */
diff --git a/lib/cryptodev/meson.build b/lib/cryptodev/meson.build
index bec80beab3..735935df4a 100644
--- a/lib/cryptodev/meson.build
+++ b/lib/cryptodev/meson.build
@@ -1,12 +1,22 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2017-2019 Intel Corporation
 
-sources = files('rte_cryptodev.c', 'rte_cryptodev_pmd.c', 'cryptodev_trace_points.c')
-headers = files('rte_cryptodev.h',
-        'rte_cryptodev_pmd.h',
+sources = files(
+        'cryptodev_pmd.c',
+	'cryptodev_trace_points.c',
+        'rte_cryptodev.c',
+)
+headers = files(
+        'rte_cryptodev.h',
         'rte_cryptodev_trace.h',
         'rte_cryptodev_trace_fp.h',
         'rte_crypto.h',
         'rte_crypto_sym.h',
-        'rte_crypto_asym.h')
+        'rte_crypto_asym.h',
+)
+
+driver_sdk_headers += files(
+        'cryptodev_pmd.h',
+)
+
 deps += ['kvargs', 'mbuf', 'rcu']
diff --git a/lib/cryptodev/rte_cryptodev.c b/lib/cryptodev/rte_cryptodev.c
index 37502b9b3c..9fa3aff1d3 100644
--- a/lib/cryptodev/rte_cryptodev.c
+++ b/lib/cryptodev/rte_cryptodev.c
@@ -39,7 +39,7 @@
 
 #include "rte_crypto.h"
 #include "rte_cryptodev.h"
-#include "rte_cryptodev_pmd.h"
+#include "cryptodev_pmd.h"
 #include "rte_cryptodev_trace.h"
 
 static uint8_t nb_drivers;
diff --git a/lib/cryptodev/version.map b/lib/cryptodev/version.map
index 1a7f759c57..8294c9f64f 100644
--- a/lib/cryptodev/version.map
+++ b/lib/cryptodev/version.map
@@ -8,7 +8,6 @@ DPDK_22 {
 	rte_crypto_cipher_algorithm_strings;
 	rte_crypto_cipher_operation_strings;
 	rte_crypto_op_pool_create;
-	rte_cryptodev_allocate_driver;
 	rte_cryptodev_callback_register;
 	rte_cryptodev_callback_unregister;
 	rte_cryptodev_close;
@@ -27,15 +26,6 @@ DPDK_22 {
 	rte_cryptodev_info_get;
 	rte_cryptodev_is_valid_dev;
 	rte_cryptodev_name_get;
-	rte_cryptodev_pmd_allocate;
-	rte_cryptodev_pmd_callback_process;
-	rte_cryptodev_pmd_create;
-	rte_cryptodev_pmd_create_dev_name;
-	rte_cryptodev_pmd_destroy;
-	rte_cryptodev_pmd_get_dev;
-	rte_cryptodev_pmd_get_named_dev;
-	rte_cryptodev_pmd_parse_input_args;
-	rte_cryptodev_pmd_release_device;
 	rte_cryptodev_queue_pair_count;
 	rte_cryptodev_queue_pair_setup;
 	rte_cryptodev_socket_id;
@@ -117,3 +107,18 @@ EXPERIMENTAL {
 	rte_cryptodev_remove_enq_callback;
 
 };
+
+INTERNAL {
+	global:
+
+	rte_cryptodev_allocate_driver;
+	rte_cryptodev_pmd_allocate;
+	rte_cryptodev_pmd_callback_process;
+	rte_cryptodev_pmd_create;
+	rte_cryptodev_pmd_create_dev_name;
+	rte_cryptodev_pmd_destroy;
+	rte_cryptodev_pmd_get_dev;
+	rte_cryptodev_pmd_get_named_dev;
+	rte_cryptodev_pmd_parse_input_args;
+	rte_cryptodev_pmd_release_device;
+};
diff --git a/lib/eventdev/rte_event_crypto_adapter.c b/lib/eventdev/rte_event_crypto_adapter.c
index 2d38389858..ebfc8326a8 100644
--- a/lib/eventdev/rte_event_crypto_adapter.c
+++ b/lib/eventdev/rte_event_crypto_adapter.c
@@ -9,7 +9,7 @@
 #include <rte_dev.h>
 #include <rte_errno.h>
 #include <rte_cryptodev.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 #include <rte_log.h>
 #include <rte_malloc.h>
 #include <rte_service_component.h>
diff --git a/lib/eventdev/rte_eventdev.c b/lib/eventdev/rte_eventdev.c
index cb0ed7b620..e347d6dfd5 100644
--- a/lib/eventdev/rte_eventdev.c
+++ b/lib/eventdev/rte_eventdev.c
@@ -31,7 +31,7 @@
 #include <rte_errno.h>
 #include <rte_ethdev.h>
 #include <rte_cryptodev.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 #include <rte_telemetry.h>
 
 #include "rte_eventdev.h"
diff --git a/lib/pipeline/rte_table_action.c b/lib/pipeline/rte_table_action.c
index 54721ed96a..ad7904c0ee 100644
--- a/lib/pipeline/rte_table_action.c
+++ b/lib/pipeline/rte_table_action.c
@@ -16,7 +16,7 @@
 #include <rte_udp.h>
 #include <rte_vxlan.h>
 #include <rte_cryptodev.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 
 #include "rte_table_action.h"
 
-- 
2.25.1


^ permalink raw reply	[relevance 2%]

* Re: [dpdk-dev] [RFC PATCH v5 1/5] sched: add PIE based congestion management
  @ 2021-09-07 19:14  3%     ` Stephen Hemminger
  2021-09-08  8:49  3%       ` Liguzinski, WojciechX
  0 siblings, 1 reply; 200+ results
From: Stephen Hemminger @ 2021-09-07 19:14 UTC (permalink / raw)
  To: Liguzinski, WojciechX
  Cc: dev, jasvinder.singh, cristian.dumitrescu, megha.ajmera

On Tue,  7 Sep 2021 07:33:24 +0000
"Liguzinski, WojciechX" <wojciechx.liguzinski@intel.com> wrote:

> +/**
> + * @brief make a decision to drop or enqueue a packet based on probability
> + *        criteria
> + *
> + * @param pie_cfg [in] config pointer to a PIE configuration parameter structure
> + * @param pie [in, out] data pointer to PIE runtime data
> + * @param time [in] current time (measured in cpu cycles)
> + */
> +static inline void
> +__rte_experimental
> +_calc_drop_probability(const struct rte_pie_config *pie_cfg,
> +	struct rte_pie *pie, uint64_t time)

This code adds a lot of inline functions in the name of performance.
But every inline like this means the internal ABI for the implmentation
has to be exposed.

You would probably get a bigger performance bump from not using floating
point in the internal math, than the minor performance optimization from
having so many inlines.

^ permalink raw reply	[relevance 3%]

* Re: [dpdk-dev] [EXT] [PATCH] crypto/dpaa_sec: update release notes
  @ 2021-09-07 19:15  3% ` Akhil Goyal
  2021-09-08  7:02  0%   ` Hemant Agrawal
  0 siblings, 1 reply; 200+ results
From: Akhil Goyal @ 2021-09-07 19:15 UTC (permalink / raw)
  To: Hemant Agrawal; +Cc: dev

> Update the release notes in DPAAx for the changes in recent patches.
> 
> Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
> ---
>  doc/guides/rel_notes/release_21_11.rst | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/doc/guides/rel_notes/release_21_11.rst
> b/doc/guides/rel_notes/release_21_11.rst
> index 0afd21812f..c747a0fb11 100644
> --- a/doc/guides/rel_notes/release_21_11.rst
> +++ b/doc/guides/rel_notes/release_21_11.rst
> @@ -75,10 +75,14 @@ New Features
>  * **Updated NXP dpaa2_sec crypto PMD.**
> 
>    * Added raw vector datapath API support
> +  * Added PDCP short MAC-I support
> 
>  * **Updated NXP dpaa_sec crypto PMD.**
> 
>    * Added raw vector datapath API support
> +  * Added PDCP short MAC-I support
> +  * Added non-HMAC, DES, AES-XCBC and AES-CMAC algo support
> +
> 
Please send a next version for each of the series including each of the
Item separately in the release notes.
For example, DES-CBC patch will have update in release notes only for it
Subsequently for others also.
Please also remove entry from deprecation notices and subsequently update
the release notes ABI changes section done in a particular patch.

I tried splitting it, but it would also need changes in deprecation notices.
Please rebase the 3 series in following order (as for 3rd series I am waiting for review from Intel)
1. Algo support in dpaaX
2. short MAC
3. raw crypto



^ permalink raw reply	[relevance 3%]

* [dpdk-dev] [PATCH v4 2/4] cryptodev: change valid dev API
  @ 2021-09-07 19:22  3%     ` Akhil Goyal
  2021-09-08 15:16  0%       ` Akhil Goyal
  2021-09-07 19:22  2%     ` [dpdk-dev] [PATCH v4 4/4] cryptodev: expose driver interface as internal Akhil Goyal
  1 sibling, 1 reply; 200+ results
From: Akhil Goyal @ 2021-09-07 19:22 UTC (permalink / raw)
  To: dev
  Cc: anoobj, radu.nicolau, declan.doherty, hemant.agrawal, matan,
	konstantin.ananyev, thomas, roy.fan.zhang, asomalap,
	ruifeng.wang, ajit.khaparde, pablo.de.lara.guarch, fiona.trahe,
	adwivedi, michaelsh, rnagadheeraj, jianjay.zhou, Akhil Goyal

The API rte_cryptodev_pmd_is_valid_dev, can be used
by the application as well as PMD to check whether
the device is valid or not. Hence, _pmd is removed
from the API.
The applications and drivers which use this API are
also updated.

Signed-off-by: Akhil Goyal <gakhil@marvell.com>
---
 doc/guides/rel_notes/release_21_11.rst        |  4 ++
 .../net/softnic/rte_eth_softnic_cryptodev.c   |  2 +-
 examples/fips_validation/main.c               |  2 +-
 examples/ip_pipeline/cryptodev.c              |  3 +-
 lib/cryptodev/rte_cryptodev.c                 | 50 +++++++++----------
 lib/cryptodev/rte_cryptodev.h                 | 11 ++++
 lib/cryptodev/rte_cryptodev_pmd.h             | 11 ----
 lib/cryptodev/version.map                     |  2 +-
 lib/eventdev/rte_event_crypto_adapter.c       |  4 +-
 lib/eventdev/rte_eventdev.c                   |  2 +-
 lib/pipeline/rte_table_action.c               |  2 +-
 11 files changed, 48 insertions(+), 45 deletions(-)

diff --git a/doc/guides/rel_notes/release_21_11.rst b/doc/guides/rel_notes/release_21_11.rst
index 411fa9530a..e7ad50ba09 100644
--- a/doc/guides/rel_notes/release_21_11.rst
+++ b/doc/guides/rel_notes/release_21_11.rst
@@ -102,6 +102,10 @@ API Changes
    Also, make sure to start the actual text at the margin.
    =======================================================
 
+* cryptodev: The API rte_cryptodev_pmd_is_valid_dev is modified to
+  rte_cryptodev_is_valid_dev as it can be used by the application as
+  well as PMD to check whether the device is valid or not.
+
 
 ABI Changes
 -----------
diff --git a/drivers/net/softnic/rte_eth_softnic_cryptodev.c b/drivers/net/softnic/rte_eth_softnic_cryptodev.c
index a1a4ca5650..8e278801c5 100644
--- a/drivers/net/softnic/rte_eth_softnic_cryptodev.c
+++ b/drivers/net/softnic/rte_eth_softnic_cryptodev.c
@@ -82,7 +82,7 @@ softnic_cryptodev_create(struct pmd_internals *p,
 
 		dev_id = (uint32_t)status;
 	} else {
-		if (rte_cryptodev_pmd_is_valid_dev(params->dev_id) == 0)
+		if (rte_cryptodev_is_valid_dev(params->dev_id) == 0)
 			return NULL;
 
 		dev_id = params->dev_id;
diff --git a/examples/fips_validation/main.c b/examples/fips_validation/main.c
index c175fe6ac2..e892078f0e 100644
--- a/examples/fips_validation/main.c
+++ b/examples/fips_validation/main.c
@@ -196,7 +196,7 @@ parse_cryptodev_id_arg(char *arg)
 	}
 
 
-	if (!rte_cryptodev_pmd_is_valid_dev(cryptodev_id)) {
+	if (!rte_cryptodev_is_valid_dev(cryptodev_id)) {
 		RTE_LOG(ERR, USER1, "Error %i: invalid cryptodev id %s\n",
 				cryptodev_id, arg);
 		return -1;
diff --git a/examples/ip_pipeline/cryptodev.c b/examples/ip_pipeline/cryptodev.c
index b0d9f3d217..9997d97456 100644
--- a/examples/ip_pipeline/cryptodev.c
+++ b/examples/ip_pipeline/cryptodev.c
@@ -6,7 +6,6 @@
 #include <stdio.h>
 
 #include <rte_cryptodev.h>
-#include <rte_cryptodev_pmd.h>
 #include <rte_string_fns.h>
 
 #include "cryptodev.h"
@@ -74,7 +73,7 @@ cryptodev_create(const char *name, struct cryptodev_params *params)
 
 		dev_id = (uint32_t)status;
 	} else {
-		if (rte_cryptodev_pmd_is_valid_dev(params->dev_id) == 0)
+		if (rte_cryptodev_is_valid_dev(params->dev_id) == 0)
 			return NULL;
 
 		dev_id = params->dev_id;
diff --git a/lib/cryptodev/rte_cryptodev.c b/lib/cryptodev/rte_cryptodev.c
index 447aa9d519..37502b9b3c 100644
--- a/lib/cryptodev/rte_cryptodev.c
+++ b/lib/cryptodev/rte_cryptodev.c
@@ -663,7 +663,7 @@ rte_cryptodev_is_valid_device_data(uint8_t dev_id)
 }
 
 unsigned int
-rte_cryptodev_pmd_is_valid_dev(uint8_t dev_id)
+rte_cryptodev_is_valid_dev(uint8_t dev_id)
 {
 	struct rte_cryptodev *dev = NULL;
 
@@ -761,7 +761,7 @@ rte_cryptodev_socket_id(uint8_t dev_id)
 {
 	struct rte_cryptodev *dev;
 
-	if (!rte_cryptodev_pmd_is_valid_dev(dev_id))
+	if (!rte_cryptodev_is_valid_dev(dev_id))
 		return -1;
 
 	dev = rte_cryptodev_pmd_get_dev(dev_id);
@@ -1032,7 +1032,7 @@ rte_cryptodev_configure(uint8_t dev_id, struct rte_cryptodev_config *config)
 	struct rte_cryptodev *dev;
 	int diag;
 
-	if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) {
+	if (!rte_cryptodev_is_valid_dev(dev_id)) {
 		CDEV_LOG_ERR("Invalid dev_id=%" PRIu8, dev_id);
 		return -EINVAL;
 	}
@@ -1080,7 +1080,7 @@ rte_cryptodev_start(uint8_t dev_id)
 
 	CDEV_LOG_DEBUG("Start dev_id=%" PRIu8, dev_id);
 
-	if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) {
+	if (!rte_cryptodev_is_valid_dev(dev_id)) {
 		CDEV_LOG_ERR("Invalid dev_id=%" PRIu8, dev_id);
 		return -EINVAL;
 	}
@@ -1110,7 +1110,7 @@ rte_cryptodev_stop(uint8_t dev_id)
 {
 	struct rte_cryptodev *dev;
 
-	if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) {
+	if (!rte_cryptodev_is_valid_dev(dev_id)) {
 		CDEV_LOG_ERR("Invalid dev_id=%" PRIu8, dev_id);
 		return;
 	}
@@ -1136,7 +1136,7 @@ rte_cryptodev_close(uint8_t dev_id)
 	struct rte_cryptodev *dev;
 	int retval;
 
-	if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) {
+	if (!rte_cryptodev_is_valid_dev(dev_id)) {
 		CDEV_LOG_ERR("Invalid dev_id=%" PRIu8, dev_id);
 		return -1;
 	}
@@ -1176,7 +1176,7 @@ rte_cryptodev_get_qp_status(uint8_t dev_id, uint16_t queue_pair_id)
 {
 	struct rte_cryptodev *dev;
 
-	if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) {
+	if (!rte_cryptodev_is_valid_dev(dev_id)) {
 		CDEV_LOG_ERR("Invalid dev_id=%" PRIu8, dev_id);
 		return -EINVAL;
 	}
@@ -1207,7 +1207,7 @@ rte_cryptodev_queue_pair_setup(uint8_t dev_id, uint16_t queue_pair_id,
 {
 	struct rte_cryptodev *dev;
 
-	if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) {
+	if (!rte_cryptodev_is_valid_dev(dev_id)) {
 		CDEV_LOG_ERR("Invalid dev_id=%" PRIu8, dev_id);
 		return -EINVAL;
 	}
@@ -1283,7 +1283,7 @@ rte_cryptodev_add_enq_callback(uint8_t dev_id,
 		return NULL;
 	}
 
-	if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) {
+	if (!rte_cryptodev_is_valid_dev(dev_id)) {
 		CDEV_LOG_ERR("Invalid dev_id=%d", dev_id);
 		rte_errno = ENODEV;
 		return NULL;
@@ -1349,7 +1349,7 @@ rte_cryptodev_remove_enq_callback(uint8_t dev_id,
 		return -EINVAL;
 	}
 
-	if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) {
+	if (!rte_cryptodev_is_valid_dev(dev_id)) {
 		CDEV_LOG_ERR("Invalid dev_id=%d", dev_id);
 		return -ENODEV;
 	}
@@ -1418,7 +1418,7 @@ rte_cryptodev_add_deq_callback(uint8_t dev_id,
 		return NULL;
 	}
 
-	if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) {
+	if (!rte_cryptodev_is_valid_dev(dev_id)) {
 		CDEV_LOG_ERR("Invalid dev_id=%d", dev_id);
 		rte_errno = ENODEV;
 		return NULL;
@@ -1484,7 +1484,7 @@ rte_cryptodev_remove_deq_callback(uint8_t dev_id,
 		return -EINVAL;
 	}
 
-	if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) {
+	if (!rte_cryptodev_is_valid_dev(dev_id)) {
 		CDEV_LOG_ERR("Invalid dev_id=%d", dev_id);
 		return -ENODEV;
 	}
@@ -1542,7 +1542,7 @@ rte_cryptodev_stats_get(uint8_t dev_id, struct rte_cryptodev_stats *stats)
 {
 	struct rte_cryptodev *dev;
 
-	if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) {
+	if (!rte_cryptodev_is_valid_dev(dev_id)) {
 		CDEV_LOG_ERR("Invalid dev_id=%d", dev_id);
 		return -ENODEV;
 	}
@@ -1565,7 +1565,7 @@ rte_cryptodev_stats_reset(uint8_t dev_id)
 {
 	struct rte_cryptodev *dev;
 
-	if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) {
+	if (!rte_cryptodev_is_valid_dev(dev_id)) {
 		CDEV_LOG_ERR("Invalid dev_id=%" PRIu8, dev_id);
 		return;
 	}
@@ -1581,7 +1581,7 @@ rte_cryptodev_info_get(uint8_t dev_id, struct rte_cryptodev_info *dev_info)
 {
 	struct rte_cryptodev *dev;
 
-	if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) {
+	if (!rte_cryptodev_is_valid_dev(dev_id)) {
 		CDEV_LOG_ERR("Invalid dev_id=%d", dev_id);
 		return;
 	}
@@ -1608,7 +1608,7 @@ rte_cryptodev_callback_register(uint8_t dev_id,
 	if (!cb_fn)
 		return -EINVAL;
 
-	if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) {
+	if (!rte_cryptodev_is_valid_dev(dev_id)) {
 		CDEV_LOG_ERR("Invalid dev_id=%" PRIu8, dev_id);
 		return -EINVAL;
 	}
@@ -1652,7 +1652,7 @@ rte_cryptodev_callback_unregister(uint8_t dev_id,
 	if (!cb_fn)
 		return -EINVAL;
 
-	if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) {
+	if (!rte_cryptodev_is_valid_dev(dev_id)) {
 		CDEV_LOG_ERR("Invalid dev_id=%" PRIu8, dev_id);
 		return -EINVAL;
 	}
@@ -1720,7 +1720,7 @@ rte_cryptodev_sym_session_init(uint8_t dev_id,
 	uint8_t index;
 	int ret;
 
-	if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) {
+	if (!rte_cryptodev_is_valid_dev(dev_id)) {
 		CDEV_LOG_ERR("Invalid dev_id=%" PRIu8, dev_id);
 		return -EINVAL;
 	}
@@ -1765,7 +1765,7 @@ rte_cryptodev_asym_session_init(uint8_t dev_id,
 	uint8_t index;
 	int ret;
 
-	if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) {
+	if (!rte_cryptodev_is_valid_dev(dev_id)) {
 		CDEV_LOG_ERR("Invalid dev_id=%" PRIu8, dev_id);
 		return -EINVAL;
 	}
@@ -1939,7 +1939,7 @@ rte_cryptodev_sym_session_clear(uint8_t dev_id,
 	struct rte_cryptodev *dev;
 	uint8_t driver_id;
 
-	if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) {
+	if (!rte_cryptodev_is_valid_dev(dev_id)) {
 		CDEV_LOG_ERR("Invalid dev_id=%" PRIu8, dev_id);
 		return -EINVAL;
 	}
@@ -1969,7 +1969,7 @@ rte_cryptodev_asym_session_clear(uint8_t dev_id,
 {
 	struct rte_cryptodev *dev;
 
-	if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) {
+	if (!rte_cryptodev_is_valid_dev(dev_id)) {
 		CDEV_LOG_ERR("Invalid dev_id=%" PRIu8, dev_id);
 		return -EINVAL;
 	}
@@ -2079,7 +2079,7 @@ rte_cryptodev_sym_get_private_session_size(uint8_t dev_id)
 	struct rte_cryptodev *dev;
 	unsigned int priv_sess_size;
 
-	if (!rte_cryptodev_pmd_is_valid_dev(dev_id))
+	if (!rte_cryptodev_is_valid_dev(dev_id))
 		return 0;
 
 	dev = rte_cryptodev_pmd_get_dev(dev_id);
@@ -2099,7 +2099,7 @@ rte_cryptodev_asym_get_private_session_size(uint8_t dev_id)
 	unsigned int header_size = sizeof(void *) * nb_drivers;
 	unsigned int priv_sess_size;
 
-	if (!rte_cryptodev_pmd_is_valid_dev(dev_id))
+	if (!rte_cryptodev_is_valid_dev(dev_id))
 		return 0;
 
 	dev = rte_cryptodev_pmd_get_dev(dev_id);
@@ -2156,7 +2156,7 @@ rte_cryptodev_sym_cpu_crypto_process(uint8_t dev_id,
 {
 	struct rte_cryptodev *dev;
 
-	if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) {
+	if (!rte_cryptodev_is_valid_dev(dev_id)) {
 		sym_crypto_fill_status(vec, EINVAL);
 		return 0;
 	}
@@ -2179,7 +2179,7 @@ rte_cryptodev_get_raw_dp_ctx_size(uint8_t dev_id)
 	int32_t size = sizeof(struct rte_crypto_raw_dp_ctx);
 	int32_t priv_size;
 
-	if (!rte_cryptodev_pmd_is_valid_dev(dev_id))
+	if (!rte_cryptodev_is_valid_dev(dev_id))
 		return -EINVAL;
 
 	dev = rte_cryptodev_pmd_get_dev(dev_id);
diff --git a/lib/cryptodev/rte_cryptodev.h b/lib/cryptodev/rte_cryptodev.h
index 11f4e6fdbf..bb01f0f195 100644
--- a/lib/cryptodev/rte_cryptodev.h
+++ b/lib/cryptodev/rte_cryptodev.h
@@ -1368,6 +1368,17 @@ __rte_experimental
 unsigned int
 rte_cryptodev_asym_get_private_session_size(uint8_t dev_id);
 
+/**
+ * Validate if the crypto device index is valid attached crypto device.
+ *
+ * @param	dev_id	Crypto device index.
+ *
+ * @return
+ *   - If the device index is valid (1) or not (0).
+ */
+unsigned int
+rte_cryptodev_is_valid_dev(uint8_t dev_id);
+
 /**
  * Provide driver identifier.
  *
diff --git a/lib/cryptodev/rte_cryptodev_pmd.h b/lib/cryptodev/rte_cryptodev_pmd.h
index 1274436870..dd2a4940a2 100644
--- a/lib/cryptodev/rte_cryptodev_pmd.h
+++ b/lib/cryptodev/rte_cryptodev_pmd.h
@@ -94,17 +94,6 @@ rte_cryptodev_pmd_get_dev(uint8_t dev_id);
 struct rte_cryptodev *
 rte_cryptodev_pmd_get_named_dev(const char *name);
 
-/**
- * Validate if the crypto device index is valid attached crypto device.
- *
- * @param	dev_id	Crypto device index.
- *
- * @return
- *   - If the device index is valid (1) or not (0).
- */
-unsigned int
-rte_cryptodev_pmd_is_valid_dev(uint8_t dev_id);
-
 /**
  * The pool of rte_cryptodev structures.
  */
diff --git a/lib/cryptodev/version.map b/lib/cryptodev/version.map
index 979d823a7c..1a7f759c57 100644
--- a/lib/cryptodev/version.map
+++ b/lib/cryptodev/version.map
@@ -25,6 +25,7 @@ DPDK_22 {
 	rte_cryptodev_get_feature_name;
 	rte_cryptodev_get_sec_ctx;
 	rte_cryptodev_info_get;
+	rte_cryptodev_is_valid_dev;
 	rte_cryptodev_name_get;
 	rte_cryptodev_pmd_allocate;
 	rte_cryptodev_pmd_callback_process;
@@ -33,7 +34,6 @@ DPDK_22 {
 	rte_cryptodev_pmd_destroy;
 	rte_cryptodev_pmd_get_dev;
 	rte_cryptodev_pmd_get_named_dev;
-	rte_cryptodev_pmd_is_valid_dev;
 	rte_cryptodev_pmd_parse_input_args;
 	rte_cryptodev_pmd_release_device;
 	rte_cryptodev_queue_pair_count;
diff --git a/lib/eventdev/rte_event_crypto_adapter.c b/lib/eventdev/rte_event_crypto_adapter.c
index e1d38d383d..2d38389858 100644
--- a/lib/eventdev/rte_event_crypto_adapter.c
+++ b/lib/eventdev/rte_event_crypto_adapter.c
@@ -781,7 +781,7 @@ rte_event_crypto_adapter_queue_pair_add(uint8_t id,
 
 	EVENT_CRYPTO_ADAPTER_ID_VALID_OR_ERR_RET(id, -EINVAL);
 
-	if (!rte_cryptodev_pmd_is_valid_dev(cdev_id)) {
+	if (!rte_cryptodev_is_valid_dev(cdev_id)) {
 		RTE_EDEV_LOG_ERR("Invalid dev_id=%" PRIu8, cdev_id);
 		return -EINVAL;
 	}
@@ -898,7 +898,7 @@ rte_event_crypto_adapter_queue_pair_del(uint8_t id, uint8_t cdev_id,
 
 	EVENT_CRYPTO_ADAPTER_ID_VALID_OR_ERR_RET(id, -EINVAL);
 
-	if (!rte_cryptodev_pmd_is_valid_dev(cdev_id)) {
+	if (!rte_cryptodev_is_valid_dev(cdev_id)) {
 		RTE_EDEV_LOG_ERR("Invalid dev_id=%" PRIu8, cdev_id);
 		return -EINVAL;
 	}
diff --git a/lib/eventdev/rte_eventdev.c b/lib/eventdev/rte_eventdev.c
index 594dd5e759..cb0ed7b620 100644
--- a/lib/eventdev/rte_eventdev.c
+++ b/lib/eventdev/rte_eventdev.c
@@ -165,7 +165,7 @@ rte_event_crypto_adapter_caps_get(uint8_t dev_id, uint8_t cdev_id,
 	struct rte_cryptodev *cdev;
 
 	RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(dev_id, -EINVAL);
-	if (!rte_cryptodev_pmd_is_valid_dev(cdev_id))
+	if (!rte_cryptodev_is_valid_dev(cdev_id))
 		return -EINVAL;
 
 	dev = &rte_eventdevs[dev_id];
diff --git a/lib/pipeline/rte_table_action.c b/lib/pipeline/rte_table_action.c
index 98f3438774..54721ed96a 100644
--- a/lib/pipeline/rte_table_action.c
+++ b/lib/pipeline/rte_table_action.c
@@ -1732,7 +1732,7 @@ struct sym_crypto_data {
 static int
 sym_crypto_cfg_check(struct rte_table_action_sym_crypto_config *cfg)
 {
-	if (!rte_cryptodev_pmd_is_valid_dev(cfg->cryptodev_id))
+	if (!rte_cryptodev_is_valid_dev(cfg->cryptodev_id))
 		return -EINVAL;
 	if (cfg->mp_create == NULL || cfg->mp_init == NULL)
 		return -EINVAL;
-- 
2.25.1


^ permalink raw reply	[relevance 3%]

* [dpdk-dev] [PATCH v4 4/4] cryptodev: expose driver interface as internal
    2021-09-07 19:22  3%     ` [dpdk-dev] [PATCH v4 2/4] cryptodev: change valid dev API Akhil Goyal
@ 2021-09-07 19:22  2%     ` Akhil Goyal
  1 sibling, 0 replies; 200+ results
From: Akhil Goyal @ 2021-09-07 19:22 UTC (permalink / raw)
  To: dev
  Cc: anoobj, radu.nicolau, declan.doherty, hemant.agrawal, matan,
	konstantin.ananyev, thomas, roy.fan.zhang, asomalap,
	ruifeng.wang, ajit.khaparde, pablo.de.lara.guarch, fiona.trahe,
	adwivedi, michaelsh, rnagadheeraj, jianjay.zhou, Akhil Goyal

The rte_cryptodev_pmd.* files are for drivers only and should be
private to DPDK, and not installed for app use.

Signed-off-by: Akhil Goyal <gakhil@marvell.com>
Acked-by: Matan Azrad <matan@nvidia.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
---
 doc/guides/rel_notes/deprecation.rst          |  3 ---
 doc/guides/rel_notes/release_21_11.rst        |  4 +++
 drivers/crypto/aesni_gcm/aesni_gcm_pmd.c      |  2 +-
 drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c  |  2 +-
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c    |  2 +-
 .../crypto/aesni_mb/rte_aesni_mb_pmd_ops.c    |  2 +-
 drivers/crypto/armv8/rte_armv8_pmd.c          |  2 +-
 drivers/crypto/armv8/rte_armv8_pmd_ops.c      |  2 +-
 drivers/crypto/bcmfs/bcmfs_sym_pmd.c          |  2 +-
 drivers/crypto/bcmfs/bcmfs_sym_session.h      |  2 +-
 drivers/crypto/caam_jr/caam_jr.c              |  2 +-
 drivers/crypto/ccp/ccp_crypto.c               |  2 +-
 drivers/crypto/ccp/ccp_pmd_ops.c              |  2 +-
 drivers/crypto/ccp/rte_ccp_pmd.c              |  2 +-
 drivers/crypto/cnxk/cn10k_cryptodev.c         |  2 +-
 drivers/crypto/cnxk/cn10k_cryptodev_ops.c     |  2 +-
 drivers/crypto/cnxk/cn10k_cryptodev_ops.h     |  2 +-
 drivers/crypto/cnxk/cn9k_cryptodev.c          |  2 +-
 drivers/crypto/cnxk/cn9k_cryptodev_ops.c      |  2 +-
 drivers/crypto/cnxk/cn9k_cryptodev_ops.h      |  2 +-
 drivers/crypto/cnxk/cnxk_cryptodev_ops.c      |  2 +-
 drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c   |  2 +-
 drivers/crypto/dpaa_sec/dpaa_sec.c            |  2 +-
 drivers/crypto/kasumi/rte_kasumi_pmd.c        |  2 +-
 drivers/crypto/kasumi/rte_kasumi_pmd_ops.c    |  2 +-
 drivers/crypto/mlx5/mlx5_crypto.h             |  2 +-
 drivers/crypto/mvsam/rte_mrvl_pmd.c           |  2 +-
 drivers/crypto/mvsam/rte_mrvl_pmd_ops.c       |  2 +-
 drivers/crypto/nitrox/nitrox_sym.c            |  2 +-
 drivers/crypto/null/null_crypto_pmd.c         |  2 +-
 drivers/crypto/null/null_crypto_pmd_ops.c     |  2 +-
 drivers/crypto/octeontx/otx_cryptodev.c       |  2 +-
 drivers/crypto/octeontx/otx_cryptodev_ops.c   |  2 +-
 drivers/crypto/octeontx2/otx2_cryptodev.c     |  2 +-
 drivers/crypto/octeontx2/otx2_cryptodev_ops.c |  2 +-
 drivers/crypto/octeontx2/otx2_cryptodev_ops.h |  2 +-
 drivers/crypto/openssl/rte_openssl_pmd.c      |  2 +-
 drivers/crypto/openssl/rte_openssl_pmd_ops.c  |  2 +-
 drivers/crypto/qat/qat_asym.h                 |  2 +-
 drivers/crypto/qat/qat_asym_pmd.c             |  2 +-
 drivers/crypto/qat/qat_sym.h                  |  2 +-
 drivers/crypto/qat/qat_sym_hw_dp.c            |  2 +-
 drivers/crypto/qat/qat_sym_pmd.c              |  2 +-
 drivers/crypto/qat/qat_sym_session.h          |  2 +-
 .../scheduler/rte_cryptodev_scheduler.c       |  2 +-
 drivers/crypto/scheduler/scheduler_pmd.c      |  2 +-
 drivers/crypto/scheduler/scheduler_pmd_ops.c  |  2 +-
 drivers/crypto/snow3g/rte_snow3g_pmd.c        |  2 +-
 drivers/crypto/snow3g/rte_snow3g_pmd_ops.c    |  2 +-
 drivers/crypto/virtio/virtio_cryptodev.c      |  2 +-
 drivers/crypto/virtio/virtio_rxtx.c           |  2 +-
 drivers/crypto/zuc/rte_zuc_pmd.c              |  2 +-
 drivers/crypto/zuc/rte_zuc_pmd_ops.c          |  2 +-
 .../octeontx2/otx2_evdev_crypto_adptr_rx.h    |  2 +-
 .../octeontx2/otx2_evdev_crypto_adptr_tx.h    |  2 +-
 .../net/softnic/rte_eth_softnic_cryptodev.c   |  2 +-
 .../{rte_cryptodev_pmd.c => cryptodev_pmd.c}  |  2 +-
 .../{rte_cryptodev_pmd.h => cryptodev_pmd.h}  | 16 +++++++++---
 lib/cryptodev/meson.build                     | 18 ++++++++++---
 lib/cryptodev/rte_cryptodev.c                 |  2 +-
 lib/cryptodev/version.map                     | 25 +++++++++++--------
 lib/eventdev/rte_event_crypto_adapter.c       |  2 +-
 lib/eventdev/rte_eventdev.c                   |  2 +-
 lib/pipeline/rte_table_action.c               |  2 +-
 64 files changed, 105 insertions(+), 79 deletions(-)
 rename lib/cryptodev/{rte_cryptodev_pmd.c => cryptodev_pmd.c} (99%)
 rename lib/cryptodev/{rte_cryptodev_pmd.h => cryptodev_pmd.h} (98%)

diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index 76a4abfd6b..59445a6f42 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -223,9 +223,6 @@ Deprecation Notices
   session and the private data of session. An opaque pointer can be exposed
   directly to application which can be attached to the ``rte_crypto_op``.
 
-* cryptodev: The interface between library and drivers will be marked
-  as internal in DPDK 21.11.
-
 * security: Hide structure ``rte_security_session`` and expose an opaque
   pointer for the private data to the application which can be attached
   to the packet while enqueuing.
diff --git a/doc/guides/rel_notes/release_21_11.rst b/doc/guides/rel_notes/release_21_11.rst
index e7ad50ba09..8785b25ff6 100644
--- a/doc/guides/rel_notes/release_21_11.rst
+++ b/doc/guides/rel_notes/release_21_11.rst
@@ -106,6 +106,10 @@ API Changes
   rte_cryptodev_is_valid_dev as it can be used by the application as
   well as PMD to check whether the device is valid or not.
 
+* cryptodev: The rte_cryptodev_pmd.* files are renamed as cryptodev_pmd.*
+  as it is for drivers only and should be private to DPDK, and not
+  installed for app use.
+
 
 ABI Changes
 -----------
diff --git a/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c b/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c
index 886e2a5aaa..330aad8157 100644
--- a/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c
+++ b/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c
@@ -5,7 +5,7 @@
 #include <rte_common.h>
 #include <rte_hexdump.h>
 #include <rte_cryptodev.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 #include <rte_bus_vdev.h>
 #include <rte_malloc.h>
 #include <rte_cpuflags.h>
diff --git a/drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c b/drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c
index 18dbc4c18c..edb7275e76 100644
--- a/drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c
+++ b/drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c
@@ -6,7 +6,7 @@
 
 #include <rte_common.h>
 #include <rte_malloc.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 
 #include "aesni_gcm_pmd_private.h"
 
diff --git a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c
index a01c826a3c..60963a8208 100644
--- a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c
+++ b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c
@@ -7,7 +7,7 @@
 #include <rte_common.h>
 #include <rte_hexdump.h>
 #include <rte_cryptodev.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 #include <rte_bus_vdev.h>
 #include <rte_malloc.h>
 #include <rte_cpuflags.h>
diff --git a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c
index fc7fdfec8e..48a8f91868 100644
--- a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c
+++ b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c
@@ -8,7 +8,7 @@
 #include <rte_common.h>
 #include <rte_malloc.h>
 #include <rte_ether.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 
 #include "aesni_mb_pmd_private.h"
 
diff --git a/drivers/crypto/armv8/rte_armv8_pmd.c b/drivers/crypto/armv8/rte_armv8_pmd.c
index c642ac350f..36a1a9bb4f 100644
--- a/drivers/crypto/armv8/rte_armv8_pmd.c
+++ b/drivers/crypto/armv8/rte_armv8_pmd.c
@@ -7,7 +7,7 @@
 #include <rte_common.h>
 #include <rte_hexdump.h>
 #include <rte_cryptodev.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 #include <rte_bus_vdev.h>
 #include <rte_malloc.h>
 #include <rte_cpuflags.h>
diff --git a/drivers/crypto/armv8/rte_armv8_pmd_ops.c b/drivers/crypto/armv8/rte_armv8_pmd_ops.c
index 01ccfb4b23..1b2749fe62 100644
--- a/drivers/crypto/armv8/rte_armv8_pmd_ops.c
+++ b/drivers/crypto/armv8/rte_armv8_pmd_ops.c
@@ -6,7 +6,7 @@
 
 #include <rte_common.h>
 #include <rte_malloc.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 
 #include "armv8_pmd_private.h"
 
diff --git a/drivers/crypto/bcmfs/bcmfs_sym_pmd.c b/drivers/crypto/bcmfs/bcmfs_sym_pmd.c
index aa7fad6d70..d1dd22823e 100644
--- a/drivers/crypto/bcmfs/bcmfs_sym_pmd.c
+++ b/drivers/crypto/bcmfs/bcmfs_sym_pmd.c
@@ -7,7 +7,7 @@
 #include <rte_dev.h>
 #include <rte_errno.h>
 #include <rte_malloc.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 
 #include "bcmfs_device.h"
 #include "bcmfs_logs.h"
diff --git a/drivers/crypto/bcmfs/bcmfs_sym_session.h b/drivers/crypto/bcmfs/bcmfs_sym_session.h
index 8240c6fc25..d40595b4bd 100644
--- a/drivers/crypto/bcmfs/bcmfs_sym_session.h
+++ b/drivers/crypto/bcmfs/bcmfs_sym_session.h
@@ -8,7 +8,7 @@
 
 #include <stdbool.h>
 #include <rte_crypto.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 
 #include "bcmfs_sym_defs.h"
 #include "bcmfs_sym_req.h"
diff --git a/drivers/crypto/caam_jr/caam_jr.c b/drivers/crypto/caam_jr/caam_jr.c
index 3fb3fe0f8a..258750afe7 100644
--- a/drivers/crypto/caam_jr/caam_jr.c
+++ b/drivers/crypto/caam_jr/caam_jr.c
@@ -9,7 +9,7 @@
 
 #include <rte_byteorder.h>
 #include <rte_common.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 #include <rte_crypto.h>
 #include <rte_cryptodev.h>
 #include <rte_bus_vdev.h>
diff --git a/drivers/crypto/ccp/ccp_crypto.c b/drivers/crypto/ccp/ccp_crypto.c
index f37d35f18f..70daed791e 100644
--- a/drivers/crypto/ccp/ccp_crypto.c
+++ b/drivers/crypto/ccp/ccp_crypto.c
@@ -20,7 +20,7 @@
 #include <rte_memory.h>
 #include <rte_spinlock.h>
 #include <rte_string_fns.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 
 #include "ccp_dev.h"
 #include "ccp_crypto.h"
diff --git a/drivers/crypto/ccp/ccp_pmd_ops.c b/drivers/crypto/ccp/ccp_pmd_ops.c
index 98f964f361..0d615d311c 100644
--- a/drivers/crypto/ccp/ccp_pmd_ops.c
+++ b/drivers/crypto/ccp/ccp_pmd_ops.c
@@ -5,7 +5,7 @@
 #include <string.h>
 
 #include <rte_common.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 #include <rte_malloc.h>
 
 #include "ccp_pmd_private.h"
diff --git a/drivers/crypto/ccp/rte_ccp_pmd.c b/drivers/crypto/ccp/rte_ccp_pmd.c
index ab9416942e..a54d81de46 100644
--- a/drivers/crypto/ccp/rte_ccp_pmd.c
+++ b/drivers/crypto/ccp/rte_ccp_pmd.c
@@ -7,7 +7,7 @@
 #include <rte_bus_vdev.h>
 #include <rte_common.h>
 #include <rte_cryptodev.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 #include <rte_pci.h>
 #include <rte_dev.h>
 #include <rte_malloc.h>
diff --git a/drivers/crypto/cnxk/cn10k_cryptodev.c b/drivers/crypto/cnxk/cn10k_cryptodev.c
index db7b5aa7c6..012eb0c051 100644
--- a/drivers/crypto/cnxk/cn10k_cryptodev.c
+++ b/drivers/crypto/cnxk/cn10k_cryptodev.c
@@ -6,7 +6,7 @@
 #include <rte_common.h>
 #include <rte_crypto.h>
 #include <rte_cryptodev.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 #include <rte_dev.h>
 #include <rte_pci.h>
 
diff --git a/drivers/crypto/cnxk/cn10k_cryptodev_ops.c b/drivers/crypto/cnxk/cn10k_cryptodev_ops.c
index cccca77f60..3a1a4a2e29 100644
--- a/drivers/crypto/cnxk/cn10k_cryptodev_ops.c
+++ b/drivers/crypto/cnxk/cn10k_cryptodev_ops.c
@@ -3,7 +3,7 @@
  */
 
 #include <rte_cryptodev.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 #include <rte_event_crypto_adapter.h>
 #include <rte_ip.h>
 
diff --git a/drivers/crypto/cnxk/cn10k_cryptodev_ops.h b/drivers/crypto/cnxk/cn10k_cryptodev_ops.h
index b03d2eee14..d7e9f87396 100644
--- a/drivers/crypto/cnxk/cn10k_cryptodev_ops.h
+++ b/drivers/crypto/cnxk/cn10k_cryptodev_ops.h
@@ -6,7 +6,7 @@
 #define _CN10K_CRYPTODEV_OPS_H_
 
 #include <rte_cryptodev.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 
 extern struct rte_cryptodev_ops cn10k_cpt_ops;
 
diff --git a/drivers/crypto/cnxk/cn9k_cryptodev.c b/drivers/crypto/cnxk/cn9k_cryptodev.c
index e60b352fac..6b8cb01a12 100644
--- a/drivers/crypto/cnxk/cn9k_cryptodev.c
+++ b/drivers/crypto/cnxk/cn9k_cryptodev.c
@@ -6,7 +6,7 @@
 #include <rte_common.h>
 #include <rte_crypto.h>
 #include <rte_cryptodev.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 #include <rte_dev.h>
 #include <rte_pci.h>
 
diff --git a/drivers/crypto/cnxk/cn9k_cryptodev_ops.c b/drivers/crypto/cnxk/cn9k_cryptodev_ops.c
index 40109acc3f..75277936b0 100644
--- a/drivers/crypto/cnxk/cn9k_cryptodev_ops.c
+++ b/drivers/crypto/cnxk/cn9k_cryptodev_ops.c
@@ -3,7 +3,7 @@
  */
 
 #include <rte_cryptodev.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 #include <rte_event_crypto_adapter.h>
 #include <rte_ip.h>
 #include <rte_vect.h>
diff --git a/drivers/crypto/cnxk/cn9k_cryptodev_ops.h b/drivers/crypto/cnxk/cn9k_cryptodev_ops.h
index 1255de33ae..309f507346 100644
--- a/drivers/crypto/cnxk/cn9k_cryptodev_ops.h
+++ b/drivers/crypto/cnxk/cn9k_cryptodev_ops.h
@@ -5,7 +5,7 @@
 #ifndef _CN9K_CRYPTODEV_OPS_H_
 #define _CN9K_CRYPTODEV_OPS_H_
 
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 
 extern struct rte_cryptodev_ops cn9k_cpt_ops;
 
diff --git a/drivers/crypto/cnxk/cnxk_cryptodev_ops.c b/drivers/crypto/cnxk/cnxk_cryptodev_ops.c
index 957c78063f..41d8fe49e1 100644
--- a/drivers/crypto/cnxk/cnxk_cryptodev_ops.c
+++ b/drivers/crypto/cnxk/cnxk_cryptodev_ops.c
@@ -3,7 +3,7 @@
  */
 
 #include <rte_cryptodev.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 #include <rte_errno.h>
 
 #include "roc_cpt.h"
diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
index 1ccead3641..bf69c61916 100644
--- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
+++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
@@ -18,7 +18,7 @@
 #include <rte_cycles.h>
 #include <rte_kvargs.h>
 #include <rte_dev.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 #include <rte_common.h>
 #include <rte_fslmc.h>
 #include <fslmc_vfio.h>
diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c
index 19d4684e24..3d53746ef1 100644
--- a/drivers/crypto/dpaa_sec/dpaa_sec.c
+++ b/drivers/crypto/dpaa_sec/dpaa_sec.c
@@ -12,7 +12,7 @@
 
 #include <rte_byteorder.h>
 #include <rte_common.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 #include <rte_crypto.h>
 #include <rte_cryptodev.h>
 #ifdef RTE_LIB_SECURITY
diff --git a/drivers/crypto/kasumi/rte_kasumi_pmd.c b/drivers/crypto/kasumi/rte_kasumi_pmd.c
index 48b7db9e9b..d6f927417a 100644
--- a/drivers/crypto/kasumi/rte_kasumi_pmd.c
+++ b/drivers/crypto/kasumi/rte_kasumi_pmd.c
@@ -5,7 +5,7 @@
 #include <rte_common.h>
 #include <rte_hexdump.h>
 #include <rte_cryptodev.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 #include <rte_bus_vdev.h>
 #include <rte_malloc.h>
 #include <rte_cpuflags.h>
diff --git a/drivers/crypto/kasumi/rte_kasumi_pmd_ops.c b/drivers/crypto/kasumi/rte_kasumi_pmd_ops.c
index 43376c1aa0..f075054807 100644
--- a/drivers/crypto/kasumi/rte_kasumi_pmd_ops.c
+++ b/drivers/crypto/kasumi/rte_kasumi_pmd_ops.c
@@ -6,7 +6,7 @@
 
 #include <rte_common.h>
 #include <rte_malloc.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 
 #include "kasumi_pmd_private.h"
 
diff --git a/drivers/crypto/mlx5/mlx5_crypto.h b/drivers/crypto/mlx5/mlx5_crypto.h
index 722acb8d19..d589e0ac3d 100644
--- a/drivers/crypto/mlx5/mlx5_crypto.h
+++ b/drivers/crypto/mlx5/mlx5_crypto.h
@@ -8,7 +8,7 @@
 #include <stdbool.h>
 
 #include <rte_cryptodev.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 
 #include <mlx5_common_utils.h>
 #include <mlx5_common_devx.h>
diff --git a/drivers/crypto/mvsam/rte_mrvl_pmd.c b/drivers/crypto/mvsam/rte_mrvl_pmd.c
index ed85bb6547..a72642a772 100644
--- a/drivers/crypto/mvsam/rte_mrvl_pmd.c
+++ b/drivers/crypto/mvsam/rte_mrvl_pmd.c
@@ -7,7 +7,7 @@
 #include <rte_common.h>
 #include <rte_hexdump.h>
 #include <rte_cryptodev.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 #include <rte_security_driver.h>
 #include <rte_bus_vdev.h>
 #include <rte_malloc.h>
diff --git a/drivers/crypto/mvsam/rte_mrvl_pmd_ops.c b/drivers/crypto/mvsam/rte_mrvl_pmd_ops.c
index fa36461276..3064b1f136 100644
--- a/drivers/crypto/mvsam/rte_mrvl_pmd_ops.c
+++ b/drivers/crypto/mvsam/rte_mrvl_pmd_ops.c
@@ -8,7 +8,7 @@
 
 #include <rte_common.h>
 #include <rte_malloc.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 #include <rte_security_driver.h>
 
 #include "mrvl_pmd_private.h"
diff --git a/drivers/crypto/nitrox/nitrox_sym.c b/drivers/crypto/nitrox/nitrox_sym.c
index 2768bdd2e1..f8b7edcd69 100644
--- a/drivers/crypto/nitrox/nitrox_sym.c
+++ b/drivers/crypto/nitrox/nitrox_sym.c
@@ -4,7 +4,7 @@
 
 #include <stdbool.h>
 
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 #include <rte_crypto.h>
 
 #include "nitrox_sym.h"
diff --git a/drivers/crypto/null/null_crypto_pmd.c b/drivers/crypto/null/null_crypto_pmd.c
index 179e5ff36d..f9935d52cc 100644
--- a/drivers/crypto/null/null_crypto_pmd.c
+++ b/drivers/crypto/null/null_crypto_pmd.c
@@ -3,7 +3,7 @@
  */
 
 #include <rte_common.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 #include <rte_bus_vdev.h>
 #include <rte_malloc.h>
 
diff --git a/drivers/crypto/null/null_crypto_pmd_ops.c b/drivers/crypto/null/null_crypto_pmd_ops.c
index d67892a1bb..a8b5a06e7f 100644
--- a/drivers/crypto/null/null_crypto_pmd_ops.c
+++ b/drivers/crypto/null/null_crypto_pmd_ops.c
@@ -6,7 +6,7 @@
 
 #include <rte_common.h>
 #include <rte_malloc.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 
 #include "null_crypto_pmd_private.h"
 
diff --git a/drivers/crypto/octeontx/otx_cryptodev.c b/drivers/crypto/octeontx/otx_cryptodev.c
index 3822c0d779..c294f86d79 100644
--- a/drivers/crypto/octeontx/otx_cryptodev.c
+++ b/drivers/crypto/octeontx/otx_cryptodev.c
@@ -5,7 +5,7 @@
 #include <rte_bus_pci.h>
 #include <rte_common.h>
 #include <rte_cryptodev.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 #include <rte_log.h>
 #include <rte_pci.h>
 
diff --git a/drivers/crypto/octeontx/otx_cryptodev_ops.c b/drivers/crypto/octeontx/otx_cryptodev_ops.c
index eac6796cfb..9b5bde53f8 100644
--- a/drivers/crypto/octeontx/otx_cryptodev_ops.c
+++ b/drivers/crypto/octeontx/otx_cryptodev_ops.c
@@ -5,7 +5,7 @@
 #include <rte_alarm.h>
 #include <rte_bus_pci.h>
 #include <rte_cryptodev.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 #include <rte_eventdev.h>
 #include <rte_event_crypto_adapter.h>
 #include <rte_errno.h>
diff --git a/drivers/crypto/octeontx2/otx2_cryptodev.c b/drivers/crypto/octeontx2/otx2_cryptodev.c
index 75fb4f9a3b..85b1f00263 100644
--- a/drivers/crypto/octeontx2/otx2_cryptodev.c
+++ b/drivers/crypto/octeontx2/otx2_cryptodev.c
@@ -6,7 +6,7 @@
 #include <rte_common.h>
 #include <rte_crypto.h>
 #include <rte_cryptodev.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 #include <rte_dev.h>
 #include <rte_errno.h>
 #include <rte_mempool.h>
diff --git a/drivers/crypto/octeontx2/otx2_cryptodev_ops.c b/drivers/crypto/octeontx2/otx2_cryptodev_ops.c
index 42100154cd..09ddbb5f34 100644
--- a/drivers/crypto/octeontx2/otx2_cryptodev_ops.c
+++ b/drivers/crypto/octeontx2/otx2_cryptodev_ops.c
@@ -4,7 +4,7 @@
 
 #include <unistd.h>
 
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 #include <rte_errno.h>
 #include <rte_ethdev.h>
 #include <rte_event_crypto_adapter.h>
diff --git a/drivers/crypto/octeontx2/otx2_cryptodev_ops.h b/drivers/crypto/octeontx2/otx2_cryptodev_ops.h
index 1970187f88..8d135909b3 100644
--- a/drivers/crypto/octeontx2/otx2_cryptodev_ops.h
+++ b/drivers/crypto/octeontx2/otx2_cryptodev_ops.h
@@ -5,7 +5,7 @@
 #ifndef _OTX2_CRYPTODEV_OPS_H_
 #define _OTX2_CRYPTODEV_OPS_H_
 
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 
 #define OTX2_CPT_MIN_HEADROOM_REQ	24
 #define OTX2_CPT_MIN_TAILROOM_REQ	8
diff --git a/drivers/crypto/openssl/rte_openssl_pmd.c b/drivers/crypto/openssl/rte_openssl_pmd.c
index 37b969b916..13c6ea8724 100644
--- a/drivers/crypto/openssl/rte_openssl_pmd.c
+++ b/drivers/crypto/openssl/rte_openssl_pmd.c
@@ -5,7 +5,7 @@
 #include <rte_common.h>
 #include <rte_hexdump.h>
 #include <rte_cryptodev.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 #include <rte_bus_vdev.h>
 #include <rte_malloc.h>
 #include <rte_cpuflags.h>
diff --git a/drivers/crypto/openssl/rte_openssl_pmd_ops.c b/drivers/crypto/openssl/rte_openssl_pmd_ops.c
index ed75877581..52715f86f8 100644
--- a/drivers/crypto/openssl/rte_openssl_pmd_ops.c
+++ b/drivers/crypto/openssl/rte_openssl_pmd_ops.c
@@ -6,7 +6,7 @@
 
 #include <rte_common.h>
 #include <rte_malloc.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 
 #include "openssl_pmd_private.h"
 #include "compat.h"
diff --git a/drivers/crypto/qat/qat_asym.h b/drivers/crypto/qat/qat_asym.h
index 2838aee76f..308b6b2e0b 100644
--- a/drivers/crypto/qat/qat_asym.h
+++ b/drivers/crypto/qat/qat_asym.h
@@ -5,7 +5,7 @@
 #ifndef _QAT_ASYM_H_
 #define _QAT_ASYM_H_
 
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 #include <rte_crypto_asym.h>
 #include "icp_qat_fw_pke.h"
 #include "qat_common.h"
diff --git a/drivers/crypto/qat/qat_asym_pmd.c b/drivers/crypto/qat/qat_asym_pmd.c
index 0c25cce09e..e91bb0d317 100644
--- a/drivers/crypto/qat/qat_asym_pmd.c
+++ b/drivers/crypto/qat/qat_asym_pmd.c
@@ -2,7 +2,7 @@
  * Copyright(c) 2019 Intel Corporation
  */
 
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 
 #include "qat_logs.h"
 
diff --git a/drivers/crypto/qat/qat_sym.h b/drivers/crypto/qat/qat_sym.h
index 20b1b53d36..e3ec7f0de4 100644
--- a/drivers/crypto/qat/qat_sym.h
+++ b/drivers/crypto/qat/qat_sym.h
@@ -5,7 +5,7 @@
 #ifndef _QAT_SYM_H_
 #define _QAT_SYM_H_
 
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 #ifdef RTE_LIB_SECURITY
 #include <rte_net_crc.h>
 #endif
diff --git a/drivers/crypto/qat/qat_sym_hw_dp.c b/drivers/crypto/qat/qat_sym_hw_dp.c
index ac9ac05363..36d11e0dc9 100644
--- a/drivers/crypto/qat/qat_sym_hw_dp.c
+++ b/drivers/crypto/qat/qat_sym_hw_dp.c
@@ -2,7 +2,7 @@
  * Copyright(c) 2020 Intel Corporation
  */
 
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 
 #include "adf_transport_access_macros.h"
 #include "icp_qat_fw.h"
diff --git a/drivers/crypto/qat/qat_sym_pmd.c b/drivers/crypto/qat/qat_sym_pmd.c
index 6868e5f001..efda921c05 100644
--- a/drivers/crypto/qat/qat_sym_pmd.c
+++ b/drivers/crypto/qat/qat_sym_pmd.c
@@ -7,7 +7,7 @@
 #include <rte_dev.h>
 #include <rte_malloc.h>
 #include <rte_pci.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 #ifdef RTE_LIB_SECURITY
 #include <rte_security_driver.h>
 #endif
diff --git a/drivers/crypto/qat/qat_sym_session.h b/drivers/crypto/qat/qat_sym_session.h
index 33b236e49b..6ebc176729 100644
--- a/drivers/crypto/qat/qat_sym_session.h
+++ b/drivers/crypto/qat/qat_sym_session.h
@@ -5,7 +5,7 @@
 #define _QAT_SYM_SESSION_H_
 
 #include <rte_crypto.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 #ifdef RTE_LIB_SECURITY
 #include <rte_security.h>
 #endif
diff --git a/drivers/crypto/scheduler/rte_cryptodev_scheduler.c b/drivers/crypto/scheduler/rte_cryptodev_scheduler.c
index 1e0b4df0ca..1e0c4fe464 100644
--- a/drivers/crypto/scheduler/rte_cryptodev_scheduler.c
+++ b/drivers/crypto/scheduler/rte_cryptodev_scheduler.c
@@ -4,7 +4,7 @@
 #include <rte_string_fns.h>
 #include <rte_reorder.h>
 #include <rte_cryptodev.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 #include <rte_malloc.h>
 
 #include "rte_cryptodev_scheduler.h"
diff --git a/drivers/crypto/scheduler/scheduler_pmd.c b/drivers/crypto/scheduler/scheduler_pmd.c
index 632197833c..560c26af50 100644
--- a/drivers/crypto/scheduler/scheduler_pmd.c
+++ b/drivers/crypto/scheduler/scheduler_pmd.c
@@ -4,7 +4,7 @@
 #include <rte_common.h>
 #include <rte_hexdump.h>
 #include <rte_cryptodev.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 #include <rte_bus_vdev.h>
 #include <rte_malloc.h>
 #include <rte_cpuflags.h>
diff --git a/drivers/crypto/scheduler/scheduler_pmd_ops.c b/drivers/crypto/scheduler/scheduler_pmd_ops.c
index cb125e8027..465b88ade8 100644
--- a/drivers/crypto/scheduler/scheduler_pmd_ops.c
+++ b/drivers/crypto/scheduler/scheduler_pmd_ops.c
@@ -7,7 +7,7 @@
 #include <rte_malloc.h>
 #include <rte_dev.h>
 #include <rte_cryptodev.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 #include <rte_reorder.h>
 
 #include "scheduler_pmd_private.h"
diff --git a/drivers/crypto/snow3g/rte_snow3g_pmd.c b/drivers/crypto/snow3g/rte_snow3g_pmd.c
index 9aab357846..8284ac0b66 100644
--- a/drivers/crypto/snow3g/rte_snow3g_pmd.c
+++ b/drivers/crypto/snow3g/rte_snow3g_pmd.c
@@ -5,7 +5,7 @@
 #include <rte_common.h>
 #include <rte_hexdump.h>
 #include <rte_cryptodev.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 #include <rte_bus_vdev.h>
 #include <rte_malloc.h>
 #include <rte_cpuflags.h>
diff --git a/drivers/crypto/snow3g/rte_snow3g_pmd_ops.c b/drivers/crypto/snow3g/rte_snow3g_pmd_ops.c
index 906a0fe60b..3f46014b7d 100644
--- a/drivers/crypto/snow3g/rte_snow3g_pmd_ops.c
+++ b/drivers/crypto/snow3g/rte_snow3g_pmd_ops.c
@@ -6,7 +6,7 @@
 
 #include <rte_common.h>
 #include <rte_malloc.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 
 #include "snow3g_pmd_private.h"
 
diff --git a/drivers/crypto/virtio/virtio_cryptodev.c b/drivers/crypto/virtio/virtio_cryptodev.c
index 4bae74a487..8faa39df4a 100644
--- a/drivers/crypto/virtio/virtio_cryptodev.c
+++ b/drivers/crypto/virtio/virtio_cryptodev.c
@@ -9,7 +9,7 @@
 #include <rte_pci.h>
 #include <rte_bus_pci.h>
 #include <rte_cryptodev.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 #include <rte_eal.h>
 
 #include "virtio_cryptodev.h"
diff --git a/drivers/crypto/virtio/virtio_rxtx.c b/drivers/crypto/virtio/virtio_rxtx.c
index e1cb4ad104..a65524a306 100644
--- a/drivers/crypto/virtio/virtio_rxtx.c
+++ b/drivers/crypto/virtio/virtio_rxtx.c
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: BSD-3-Clause
  * Copyright(c) 2018 HUAWEI TECHNOLOGIES CO., LTD.
  */
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 
 #include "virtqueue.h"
 #include "virtio_cryptodev.h"
diff --git a/drivers/crypto/zuc/rte_zuc_pmd.c b/drivers/crypto/zuc/rte_zuc_pmd.c
index 42b669f188..d4b343a7af 100644
--- a/drivers/crypto/zuc/rte_zuc_pmd.c
+++ b/drivers/crypto/zuc/rte_zuc_pmd.c
@@ -5,7 +5,7 @@
 #include <rte_common.h>
 #include <rte_hexdump.h>
 #include <rte_cryptodev.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 #include <rte_bus_vdev.h>
 #include <rte_malloc.h>
 #include <rte_cpuflags.h>
diff --git a/drivers/crypto/zuc/rte_zuc_pmd_ops.c b/drivers/crypto/zuc/rte_zuc_pmd_ops.c
index dc9dc25ef8..38642d45ab 100644
--- a/drivers/crypto/zuc/rte_zuc_pmd_ops.c
+++ b/drivers/crypto/zuc/rte_zuc_pmd_ops.c
@@ -6,7 +6,7 @@
 
 #include <rte_common.h>
 #include <rte_malloc.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 
 #include "zuc_pmd_private.h"
 
diff --git a/drivers/event/octeontx2/otx2_evdev_crypto_adptr_rx.h b/drivers/event/octeontx2/otx2_evdev_crypto_adptr_rx.h
index a543225376..b33cb7e139 100644
--- a/drivers/event/octeontx2/otx2_evdev_crypto_adptr_rx.h
+++ b/drivers/event/octeontx2/otx2_evdev_crypto_adptr_rx.h
@@ -6,7 +6,7 @@
 #define _OTX2_EVDEV_CRYPTO_ADPTR_RX_H_
 
 #include <rte_cryptodev.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 #include <rte_eventdev.h>
 
 #include "cpt_pmd_logs.h"
diff --git a/drivers/event/octeontx2/otx2_evdev_crypto_adptr_tx.h b/drivers/event/octeontx2/otx2_evdev_crypto_adptr_tx.h
index ecf7eb9f56..1fc56f903b 100644
--- a/drivers/event/octeontx2/otx2_evdev_crypto_adptr_tx.h
+++ b/drivers/event/octeontx2/otx2_evdev_crypto_adptr_tx.h
@@ -6,7 +6,7 @@
 #define _OTX2_EVDEV_CRYPTO_ADPTR_TX_H_
 
 #include <rte_cryptodev.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 #include <rte_event_crypto_adapter.h>
 #include <rte_eventdev.h>
 
diff --git a/drivers/net/softnic/rte_eth_softnic_cryptodev.c b/drivers/net/softnic/rte_eth_softnic_cryptodev.c
index 8e278801c5..9a7d006f1a 100644
--- a/drivers/net/softnic/rte_eth_softnic_cryptodev.c
+++ b/drivers/net/softnic/rte_eth_softnic_cryptodev.c
@@ -6,7 +6,7 @@
 #include <stdio.h>
 
 #include <rte_cryptodev.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 #include <rte_string_fns.h>
 
 #include "rte_eth_softnic_internals.h"
diff --git a/lib/cryptodev/rte_cryptodev_pmd.c b/lib/cryptodev/cryptodev_pmd.c
similarity index 99%
rename from lib/cryptodev/rte_cryptodev_pmd.c
rename to lib/cryptodev/cryptodev_pmd.c
index e342daabc4..71e34140cd 100644
--- a/lib/cryptodev/rte_cryptodev_pmd.c
+++ b/lib/cryptodev/cryptodev_pmd.c
@@ -5,7 +5,7 @@
 #include <rte_string_fns.h>
 #include <rte_malloc.h>
 
-#include "rte_cryptodev_pmd.h"
+#include "cryptodev_pmd.h"
 
 /**
  * Parse name from argument
diff --git a/lib/cryptodev/rte_cryptodev_pmd.h b/lib/cryptodev/cryptodev_pmd.h
similarity index 98%
rename from lib/cryptodev/rte_cryptodev_pmd.h
rename to lib/cryptodev/cryptodev_pmd.h
index dd2a4940a2..ec7bb82be8 100644
--- a/lib/cryptodev/rte_cryptodev_pmd.h
+++ b/lib/cryptodev/cryptodev_pmd.h
@@ -2,8 +2,8 @@
  * Copyright(c) 2015-2020 Intel Corporation.
  */
 
-#ifndef _RTE_CRYPTODEV_PMD_H_
-#define _RTE_CRYPTODEV_PMD_H_
+#ifndef _CRYPTODEV_PMD_H_
+#define _CRYPTODEV_PMD_H_
 
 /** @file
  * RTE Crypto PMD APIs
@@ -80,6 +80,7 @@ struct cryptodev_driver {
  * @return
  *   - The rte_cryptodev structure pointer for the given device ID.
  */
+__rte_internal
 struct rte_cryptodev *
 rte_cryptodev_pmd_get_dev(uint8_t dev_id);
 
@@ -91,6 +92,7 @@ rte_cryptodev_pmd_get_dev(uint8_t dev_id);
  * @return
  *   - The rte_cryptodev structure pointer for the given device ID.
  */
+__rte_internal
 struct rte_cryptodev *
 rte_cryptodev_pmd_get_named_dev(const char *name);
 
@@ -401,6 +403,7 @@ struct rte_cryptodev_ops {
  * @return
  *   - Slot in the rte_dev_devices array for a new device;
  */
+__rte_internal
 struct rte_cryptodev *
 rte_cryptodev_pmd_allocate(const char *name, int socket_id);
 
@@ -414,6 +417,7 @@ rte_cryptodev_pmd_allocate(const char *name, int socket_id);
  * @return
  *   - 0 on success, negative on error
  */
+__rte_internal
 extern int
 rte_cryptodev_pmd_release_device(struct rte_cryptodev *cryptodev);
 
@@ -435,6 +439,7 @@ rte_cryptodev_pmd_release_device(struct rte_cryptodev *cryptodev);
  *  - 0 on success
  *  - errno on failure
  */
+__rte_internal
 int
 rte_cryptodev_pmd_parse_input_args(
 		struct rte_cryptodev_pmd_init_params *params,
@@ -454,6 +459,7 @@ rte_cryptodev_pmd_parse_input_args(
  *  - crypto device instance on success
  *  - NULL on creation failure
  */
+__rte_internal
 struct rte_cryptodev *
 rte_cryptodev_pmd_create(const char *name,
 		struct rte_device *device,
@@ -471,6 +477,7 @@ rte_cryptodev_pmd_create(const char *name,
  *  - 0 on success
  *  - errno on failure
  */
+__rte_internal
 int
 rte_cryptodev_pmd_destroy(struct rte_cryptodev *cryptodev);
 
@@ -484,6 +491,7 @@ rte_cryptodev_pmd_destroy(struct rte_cryptodev *cryptodev);
  * @return
  *  void
  */
+__rte_internal
 void rte_cryptodev_pmd_callback_process(struct rte_cryptodev *dev,
 				enum rte_cryptodev_event_type event);
 
@@ -491,6 +499,7 @@ void rte_cryptodev_pmd_callback_process(struct rte_cryptodev *dev,
  * @internal
  * Create unique device name
  */
+__rte_internal
 int
 rte_cryptodev_pmd_create_dev_name(char *name, const char *dev_name_prefix);
 
@@ -506,6 +515,7 @@ rte_cryptodev_pmd_create_dev_name(char *name, const char *dev_name_prefix);
  * @return
  *  The driver type identifier
  */
+__rte_internal
 uint8_t rte_cryptodev_allocate_driver(struct cryptodev_driver *crypto_drv,
 		const struct rte_driver *drv);
 
@@ -555,4 +565,4 @@ set_asym_session_private_data(struct rte_cryptodev_asym_session *sess,
 }
 #endif
 
-#endif /* _RTE_CRYPTODEV_PMD_H_ */
+#endif /* _CRYPTODEV_PMD_H_ */
diff --git a/lib/cryptodev/meson.build b/lib/cryptodev/meson.build
index bec80beab3..735935df4a 100644
--- a/lib/cryptodev/meson.build
+++ b/lib/cryptodev/meson.build
@@ -1,12 +1,22 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2017-2019 Intel Corporation
 
-sources = files('rte_cryptodev.c', 'rte_cryptodev_pmd.c', 'cryptodev_trace_points.c')
-headers = files('rte_cryptodev.h',
-        'rte_cryptodev_pmd.h',
+sources = files(
+        'cryptodev_pmd.c',
+	'cryptodev_trace_points.c',
+        'rte_cryptodev.c',
+)
+headers = files(
+        'rte_cryptodev.h',
         'rte_cryptodev_trace.h',
         'rte_cryptodev_trace_fp.h',
         'rte_crypto.h',
         'rte_crypto_sym.h',
-        'rte_crypto_asym.h')
+        'rte_crypto_asym.h',
+)
+
+driver_sdk_headers += files(
+        'cryptodev_pmd.h',
+)
+
 deps += ['kvargs', 'mbuf', 'rcu']
diff --git a/lib/cryptodev/rte_cryptodev.c b/lib/cryptodev/rte_cryptodev.c
index 37502b9b3c..9fa3aff1d3 100644
--- a/lib/cryptodev/rte_cryptodev.c
+++ b/lib/cryptodev/rte_cryptodev.c
@@ -39,7 +39,7 @@
 
 #include "rte_crypto.h"
 #include "rte_cryptodev.h"
-#include "rte_cryptodev_pmd.h"
+#include "cryptodev_pmd.h"
 #include "rte_cryptodev_trace.h"
 
 static uint8_t nb_drivers;
diff --git a/lib/cryptodev/version.map b/lib/cryptodev/version.map
index 1a7f759c57..8294c9f64f 100644
--- a/lib/cryptodev/version.map
+++ b/lib/cryptodev/version.map
@@ -8,7 +8,6 @@ DPDK_22 {
 	rte_crypto_cipher_algorithm_strings;
 	rte_crypto_cipher_operation_strings;
 	rte_crypto_op_pool_create;
-	rte_cryptodev_allocate_driver;
 	rte_cryptodev_callback_register;
 	rte_cryptodev_callback_unregister;
 	rte_cryptodev_close;
@@ -27,15 +26,6 @@ DPDK_22 {
 	rte_cryptodev_info_get;
 	rte_cryptodev_is_valid_dev;
 	rte_cryptodev_name_get;
-	rte_cryptodev_pmd_allocate;
-	rte_cryptodev_pmd_callback_process;
-	rte_cryptodev_pmd_create;
-	rte_cryptodev_pmd_create_dev_name;
-	rte_cryptodev_pmd_destroy;
-	rte_cryptodev_pmd_get_dev;
-	rte_cryptodev_pmd_get_named_dev;
-	rte_cryptodev_pmd_parse_input_args;
-	rte_cryptodev_pmd_release_device;
 	rte_cryptodev_queue_pair_count;
 	rte_cryptodev_queue_pair_setup;
 	rte_cryptodev_socket_id;
@@ -117,3 +107,18 @@ EXPERIMENTAL {
 	rte_cryptodev_remove_enq_callback;
 
 };
+
+INTERNAL {
+	global:
+
+	rte_cryptodev_allocate_driver;
+	rte_cryptodev_pmd_allocate;
+	rte_cryptodev_pmd_callback_process;
+	rte_cryptodev_pmd_create;
+	rte_cryptodev_pmd_create_dev_name;
+	rte_cryptodev_pmd_destroy;
+	rte_cryptodev_pmd_get_dev;
+	rte_cryptodev_pmd_get_named_dev;
+	rte_cryptodev_pmd_parse_input_args;
+	rte_cryptodev_pmd_release_device;
+};
diff --git a/lib/eventdev/rte_event_crypto_adapter.c b/lib/eventdev/rte_event_crypto_adapter.c
index 2d38389858..ebfc8326a8 100644
--- a/lib/eventdev/rte_event_crypto_adapter.c
+++ b/lib/eventdev/rte_event_crypto_adapter.c
@@ -9,7 +9,7 @@
 #include <rte_dev.h>
 #include <rte_errno.h>
 #include <rte_cryptodev.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 #include <rte_log.h>
 #include <rte_malloc.h>
 #include <rte_service_component.h>
diff --git a/lib/eventdev/rte_eventdev.c b/lib/eventdev/rte_eventdev.c
index cb0ed7b620..e347d6dfd5 100644
--- a/lib/eventdev/rte_eventdev.c
+++ b/lib/eventdev/rte_eventdev.c
@@ -31,7 +31,7 @@
 #include <rte_errno.h>
 #include <rte_ethdev.h>
 #include <rte_cryptodev.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 #include <rte_telemetry.h>
 
 #include "rte_eventdev.h"
diff --git a/lib/pipeline/rte_table_action.c b/lib/pipeline/rte_table_action.c
index 54721ed96a..ad7904c0ee 100644
--- a/lib/pipeline/rte_table_action.c
+++ b/lib/pipeline/rte_table_action.c
@@ -16,7 +16,7 @@
 #include <rte_udp.h>
 #include <rte_vxlan.h>
 #include <rte_cryptodev.h>
-#include <rte_cryptodev_pmd.h>
+#include <cryptodev_pmd.h>
 
 #include "rte_table_action.h"
 
-- 
2.25.1


^ permalink raw reply	[relevance 2%]

* Re: [dpdk-dev] [EXT] Re: [RFC 11/15] eventdev: reserve fields in timer object
  2021-09-01  6:48  0%     ` [dpdk-dev] [EXT] " Pavan Nikhilesh Bhagavatula
@ 2021-09-07 21:02  0%       ` Carrillo, Erik G
  0 siblings, 0 replies; 200+ results
From: Carrillo, Erik G @ 2021-09-07 21:02 UTC (permalink / raw)
  To: Pavan Nikhilesh Bhagavatula, Stephen Hemminger
  Cc: Jerin Jacob Kollanukkaran, Ananyev, Konstantin, dev



> -----Original Message-----
> From: Pavan Nikhilesh Bhagavatula <pbhagavatula@marvell.com>
> Sent: Wednesday, September 1, 2021 1:48 AM
> To: Stephen Hemminger <stephen@networkplumber.org>; Carrillo, Erik G
> <erik.g.carrillo@intel.com>
> Cc: Jerin Jacob Kollanukkaran <jerinj@marvell.com>; Ananyev, Konstantin
> <konstantin.ananyev@intel.com>; dev@dpdk.org
> Subject: RE: [EXT] Re: [dpdk-dev] [RFC 11/15] eventdev: reserve fields in
> timer object
> 
> >On Tue, 24 Aug 2021 01:10:15 +0530
> ><pbhagavatula@marvell.com> wrote:
> >
> >> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
> >>
> >> Reserve fields in rte_event_timer data structure to address future
> >> use cases.
> >> Also, remove volatile from rte_event_timer.
> >>
> >> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
> >
> >Reserve fields are not a good idea. They don't solve future API/ABI
> >problems.
> >
> >The issue is that you need to zero them and check they are zero
> >otherwise they can't safely be used later.  This happened with the
> >Linux kernel system calls where in several cases a flag field was added
> >for future.
> >The problem is that old programs would work with any garbage in the
> >flag field, and therefore the flag could not be extended.
> 
> The change is in rte_event_timer which is a fastpath object similar to
> rte_mbuf.
> I think fast path objects don't have the above mentioned caveat.
> 
> >
> >A better way to make structures internal opaque objects that can be
> >resized.  Why is rte_event_timer_adapter exposed in API?
> 
> rte_event_timer_adapter has similar API semantics of  rte_mempool, the
> objects of the adapter are rte_event_timer objects which have information
> of the timer state.
> 
> Erik,
> 
> I think we should move the fields in current rte_event_timer structure
> around, currently we have
> 
> struct rte_event_timer {
> 	struct rte_event ev;
> 	volatile enum rte_event_timer_state state;
>               x-------x 4 byte hole x---------x
> 	uint64_t timeout_ticks;
> 	uint64_t impl_opaque[2];
> 	uint8_t user_meta[0];
> } __rte_cache_aligned;
> 
> Move to
> 
> struct rte_event_timer {
> 	struct rte_event ev;
> 	uint64_t timeout_ticks;
> 	uint64_t impl_opaque[2];
> 	uint64_t rsvd;
> 	enum rte_event_timer_state state;
> 	uint8_t user_meta[0];
> } __rte_cache_aligned;
> 
> Since its cache aligned, the size doesn't change.
> 
> Thoughts?
> 

I'm not seeing any problem with rearranging the members.   However, you originally had " uint64_t rsvd[2];"  and above, it's just one variable.  Did you mean to make it an array?

The following also appears to have no holes:

$ pahole -C rte_event_timer eventdev_rte_event_timer_adapter.c.o 
struct rte_event_timer {
	struct rte_event           ev;                   /*     0    16 */
	uint64_t                   timeout_ticks;        /*    16     8 */
	uint64_t                   impl_opaque[2];       /*    24    16 */
	uint64_t                   rsvd[2];              /*    40    16 */
	enum rte_event_timer_state state;                /*    56     4 */
	uint8_t                    user_meta[];          /*    60     0 */

	/* size: 64, cachelines: 1, members: 6 */
	/* padding: 4 */
} __attribute__((__aligned__(64)));

Thanks,
Erik

> Thanks,
> Pavan.


^ permalink raw reply	[relevance 0%]

* [dpdk-dev] [PATCH v3 1/6] bbdev: add capability for CRC16 check
  @ 2021-09-08  1:15  4% ` Nicolas Chautru
  2021-09-12 12:35  0%   ` Tom Rix
  0 siblings, 1 reply; 200+ results
From: Nicolas Chautru @ 2021-09-08  1:15 UTC (permalink / raw)
  To: dev, gakhil
  Cc: thomas, trix, hemant.agrawal, mingshan.zhang, arun.joshi,
	Nicolas Chautru

Adding a missing operation when CRC16
is being used for TB CRC check.

Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
---
 app/test-bbdev/test_bbdev_vector.c     |  2 ++
 doc/guides/prog_guide/bbdev.rst        |  3 +++
 doc/guides/rel_notes/release_21_11.rst |  1 +
 lib/bbdev/rte_bbdev_op.h               | 34 ++++++++++++++++++----------------
 4 files changed, 24 insertions(+), 16 deletions(-)

diff --git a/app/test-bbdev/test_bbdev_vector.c b/app/test-bbdev/test_bbdev_vector.c
index 614dbd1..8d796b1 100644
--- a/app/test-bbdev/test_bbdev_vector.c
+++ b/app/test-bbdev/test_bbdev_vector.c
@@ -167,6 +167,8 @@
 		*op_flag_value = RTE_BBDEV_LDPC_CRC_TYPE_24B_CHECK;
 	else if (!strcmp(token, "RTE_BBDEV_LDPC_CRC_TYPE_24B_DROP"))
 		*op_flag_value = RTE_BBDEV_LDPC_CRC_TYPE_24B_DROP;
+	else if (!strcmp(token, "RTE_BBDEV_LDPC_CRC_TYPE_16_CHECK"))
+		*op_flag_value = RTE_BBDEV_LDPC_CRC_TYPE_16_CHECK;
 	else if (!strcmp(token, "RTE_BBDEV_LDPC_DEINTERLEAVER_BYPASS"))
 		*op_flag_value = RTE_BBDEV_LDPC_DEINTERLEAVER_BYPASS;
 	else if (!strcmp(token, "RTE_BBDEV_LDPC_HQ_COMBINE_IN_ENABLE"))
diff --git a/doc/guides/prog_guide/bbdev.rst b/doc/guides/prog_guide/bbdev.rst
index 9619280..8bd7cba 100644
--- a/doc/guides/prog_guide/bbdev.rst
+++ b/doc/guides/prog_guide/bbdev.rst
@@ -891,6 +891,9 @@ given below.
 |RTE_BBDEV_LDPC_CRC_TYPE_24B_DROP                                    |
 | Set to drop the last CRC bits decoding output                      |
 +--------------------------------------------------------------------+
+|RTE_BBDEV_LDPC_CRC_TYPE_16_CHECK                                    |
+| Set for code block CRC-16 checking                                 |
++--------------------------------------------------------------------+
 |RTE_BBDEV_LDPC_DEINTERLEAVER_BYPASS                                 |
 | Set for bit-level de-interleaver bypass on input stream            |
 +--------------------------------------------------------------------+
diff --git a/doc/guides/rel_notes/release_21_11.rst b/doc/guides/rel_notes/release_21_11.rst
index d707a55..69dd518 100644
--- a/doc/guides/rel_notes/release_21_11.rst
+++ b/doc/guides/rel_notes/release_21_11.rst
@@ -84,6 +84,7 @@ API Changes
    Also, make sure to start the actual text at the margin.
    =======================================================
 
+* bbdev: Added capability related to more comprehensive CRC options.
 
 ABI Changes
 -----------
diff --git a/lib/bbdev/rte_bbdev_op.h b/lib/bbdev/rte_bbdev_op.h
index f946842..7c44ddd 100644
--- a/lib/bbdev/rte_bbdev_op.h
+++ b/lib/bbdev/rte_bbdev_op.h
@@ -142,51 +142,53 @@ enum rte_bbdev_op_ldpcdec_flag_bitmasks {
 	RTE_BBDEV_LDPC_CRC_TYPE_24B_CHECK = (1ULL << 1),
 	/** Set to drop the last CRC bits decoding output */
 	RTE_BBDEV_LDPC_CRC_TYPE_24B_DROP = (1ULL << 2),
+	/** Set for transport block CRC-16 checking */
+	RTE_BBDEV_LDPC_CRC_TYPE_16_CHECK = (1ULL << 3),
 	/** Set for bit-level de-interleaver bypass on Rx stream. */
-	RTE_BBDEV_LDPC_DEINTERLEAVER_BYPASS = (1ULL << 3),
+	RTE_BBDEV_LDPC_DEINTERLEAVER_BYPASS = (1ULL << 4),
 	/** Set for HARQ combined input stream enable. */
-	RTE_BBDEV_LDPC_HQ_COMBINE_IN_ENABLE = (1ULL << 4),
+	RTE_BBDEV_LDPC_HQ_COMBINE_IN_ENABLE = (1ULL << 5),
 	/** Set for HARQ combined output stream enable. */
-	RTE_BBDEV_LDPC_HQ_COMBINE_OUT_ENABLE = (1ULL << 5),
+	RTE_BBDEV_LDPC_HQ_COMBINE_OUT_ENABLE = (1ULL << 6),
 	/** Set for LDPC decoder bypass.
 	 *  RTE_BBDEV_LDPC_HQ_COMBINE_OUT_ENABLE must be set.
 	 */
-	RTE_BBDEV_LDPC_DECODE_BYPASS = (1ULL << 6),
+	RTE_BBDEV_LDPC_DECODE_BYPASS = (1ULL << 7),
 	/** Set for soft-output stream enable */
-	RTE_BBDEV_LDPC_SOFT_OUT_ENABLE = (1ULL << 7),
+	RTE_BBDEV_LDPC_SOFT_OUT_ENABLE = (1ULL << 8),
 	/** Set for Rate-Matching bypass on soft-out stream. */
-	RTE_BBDEV_LDPC_SOFT_OUT_RM_BYPASS = (1ULL << 8),
+	RTE_BBDEV_LDPC_SOFT_OUT_RM_BYPASS = (1ULL << 9),
 	/** Set for bit-level de-interleaver bypass on soft-output stream. */
-	RTE_BBDEV_LDPC_SOFT_OUT_DEINTERLEAVER_BYPASS = (1ULL << 9),
+	RTE_BBDEV_LDPC_SOFT_OUT_DEINTERLEAVER_BYPASS = (1ULL << 10),
 	/** Set for iteration stopping on successful decode condition
 	 *  i.e. a successful syndrome check.
 	 */
-	RTE_BBDEV_LDPC_ITERATION_STOP_ENABLE = (1ULL << 10),
+	RTE_BBDEV_LDPC_ITERATION_STOP_ENABLE = (1ULL << 11),
 	/** Set if a device supports decoder dequeue interrupts. */
-	RTE_BBDEV_LDPC_DEC_INTERRUPTS = (1ULL << 11),
+	RTE_BBDEV_LDPC_DEC_INTERRUPTS = (1ULL << 12),
 	/** Set if a device supports scatter-gather functionality. */
-	RTE_BBDEV_LDPC_DEC_SCATTER_GATHER = (1ULL << 12),
+	RTE_BBDEV_LDPC_DEC_SCATTER_GATHER = (1ULL << 13),
 	/** Set if a device supports input/output HARQ compression. */
-	RTE_BBDEV_LDPC_HARQ_6BIT_COMPRESSION = (1ULL << 13),
+	RTE_BBDEV_LDPC_HARQ_6BIT_COMPRESSION = (1ULL << 14),
 	/** Set if a device supports input LLR compression. */
-	RTE_BBDEV_LDPC_LLR_COMPRESSION = (1ULL << 14),
+	RTE_BBDEV_LDPC_LLR_COMPRESSION = (1ULL << 15),
 	/** Set if a device supports HARQ input from
 	 *  device's internal memory.
 	 */
-	RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_IN_ENABLE = (1ULL << 15),
+	RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_IN_ENABLE = (1ULL << 16),
 	/** Set if a device supports HARQ output to
 	 *  device's internal memory.
 	 */
-	RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_OUT_ENABLE = (1ULL << 16),
+	RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_OUT_ENABLE = (1ULL << 17),
 	/** Set if a device supports loop-back access to
 	 *  HARQ internal memory. Intended for troubleshooting.
 	 */
-	RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_LOOPBACK = (1ULL << 17),
+	RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_LOOPBACK = (1ULL << 18),
 	/** Set if a device includes LLR filler bits in the circular buffer
 	 *  for HARQ memory. If not set, it is assumed the filler bits are not
 	 *  in HARQ memory and handled directly by the LDPC decoder.
 	 */
-	RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_FILLERS = (1ULL << 18)
+	RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_FILLERS = (1ULL << 19)
 };
 
 /** Flags for LDPC encoder operation and capability structure */
-- 
1.8.3.1


^ permalink raw reply	[relevance 4%]

* [dpdk-dev] [PATCH] net: promote make rarp packet API as stable
@ 2021-09-08 10:59  3% Xiao Wang
  2021-09-08  4:52  0% ` Stephen Hemminger
                   ` (2 more replies)
  0 siblings, 3 replies; 200+ results
From: Xiao Wang @ 2021-09-08 10:59 UTC (permalink / raw)
  To: olivier.matz; +Cc: dev, Xiao Wang

rte_net_make_rarp_packet was introduced in version v18.02, there was no
change in this public API since then, and it's still being used by vhost
lib and virtio driver, so promote it as stable ABI.

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
---
 lib/net/rte_arp.h   | 4 ----
 lib/net/version.map | 2 +-
 2 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/lib/net/rte_arp.h b/lib/net/rte_arp.h
index feb0eb3e49..076c8ab314 100644
--- a/lib/net/rte_arp.h
+++ b/lib/net/rte_arp.h
@@ -50,9 +50,6 @@ struct rte_arp_hdr {
 } __rte_packed __rte_aligned(2);
 
 /**
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice
- *
  * Make a RARP packet based on MAC addr.
  *
  * @param mpool
@@ -63,7 +60,6 @@ struct rte_arp_hdr {
  * @return
  *   - RARP packet pointer on success, or NULL on error
  */
-__rte_experimental
 struct rte_mbuf *
 rte_net_make_rarp_packet(struct rte_mempool *mpool,
 		const struct rte_ether_addr *mac);
diff --git a/lib/net/version.map b/lib/net/version.map
index 355b7c25b4..7584018d58 100644
--- a/lib/net/version.map
+++ b/lib/net/version.map
@@ -6,6 +6,7 @@ DPDK_22 {
 	rte_net_crc_calc;
 	rte_net_crc_set_alg;
 	rte_net_get_ptype;
+	rte_net_make_rarp_packet;
 
 	local: *;
 };
@@ -13,7 +14,6 @@ DPDK_22 {
 EXPERIMENTAL {
 	global:
 
-	rte_net_make_rarp_packet;
 	rte_net_skip_ip6_ext;
 	rte_ether_unformat_addr;
 };
-- 
2.15.1


^ permalink raw reply	[relevance 3%]

* [dpdk-dev] [PATCH v3 5/8] pdump: support pcapng and filtering
  @ 2021-09-08  4:50  1%   ` Stephen Hemminger
  2021-09-08  4:50  1%   ` [dpdk-dev] [PATCH v3 7/8] doc: changes for new pcapng and dumpcap Stephen Hemminger
  1 sibling, 0 replies; 200+ results
From: Stephen Hemminger @ 2021-09-08  4:50 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

This enhances the DPDK pdump library to support new
pcapng format and filtering via BPF.

The internal client/server protocol is changed to support
two versions: the original pdump basic version and a
new pcapng version.

The internal version number (not part of exposed API or ABI)
is intentionally increased to cause any attempt to try
mismatched primary/secondary process to fail.

Add new API to do allow filtering of captured packets with
DPDK BPF (eBPF) filter program. It keeps statistics
on packets captured, filtered, and missed (because ring was full).

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/meson.build       |   4 +-
 lib/pdump/meson.build |   2 +-
 lib/pdump/rte_pdump.c | 437 ++++++++++++++++++++++++++++++------------
 lib/pdump/rte_pdump.h | 110 ++++++++++-
 lib/pdump/version.map |   8 +
 5 files changed, 435 insertions(+), 126 deletions(-)

diff --git a/lib/meson.build b/lib/meson.build
index 51bf9c2d11f0..4b01949fe715 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -26,6 +26,7 @@ libraries = [
         'timer',   # eventdev depends on this
         'acl',
         'bbdev',
+        'bpf',
         'bitratestats',
         'cfgfile',
         'compressdev',
@@ -43,7 +44,6 @@ libraries = [
         'member',
         'pcapng',
         'power',
-        'pdump',
         'rawdev',
         'regexdev',
         'rib',
@@ -55,10 +55,10 @@ libraries = [
         'ipsec', # ipsec lib depends on net, crypto and security
         'fib', #fib lib depends on rib
         'port', # pkt framework libs which use other libs from above
+	'pdump', # pdump lib depends on bpf pcapng
         'table',
         'pipeline',
         'flow_classify', # flow_classify lib depends on pkt framework table lib
-        'bpf',
         'graph',
         'node',
 ]
diff --git a/lib/pdump/meson.build b/lib/pdump/meson.build
index 3a95eabde6a6..51ceb2afdec5 100644
--- a/lib/pdump/meson.build
+++ b/lib/pdump/meson.build
@@ -3,4 +3,4 @@
 
 sources = files('rte_pdump.c')
 headers = files('rte_pdump.h')
-deps += ['ethdev']
+deps += ['ethdev', 'bpf', 'pcapng']
diff --git a/lib/pdump/rte_pdump.c b/lib/pdump/rte_pdump.c
index 382217bc1564..9cb31d6b5008 100644
--- a/lib/pdump/rte_pdump.c
+++ b/lib/pdump/rte_pdump.c
@@ -7,8 +7,10 @@
 #include <rte_ethdev.h>
 #include <rte_lcore.h>
 #include <rte_log.h>
+#include <rte_memzone.h>
 #include <rte_errno.h>
 #include <rte_string_fns.h>
+#include <rte_pcapng.h>
 
 #include "rte_pdump.h"
 
@@ -27,30 +29,26 @@ enum pdump_operation {
 	ENABLE = 2
 };
 
+/*
+ * Note: version numbers intentionally start at 3
+ * in order to catch any application built with older out
+ * version of DPDK using incompatible client request format.
+ */
 enum pdump_version {
-	V1 = 1
+	PDUMP_CLIENT_LEGACY = 3,
+	PDUMP_CLIENT_PCAPNG = 4,
 };
 
 struct pdump_request {
 	uint16_t ver;
 	uint16_t op;
-	uint32_t flags;
-	union pdump_data {
-		struct enable_v1 {
-			char device[RTE_DEV_NAME_MAX_LEN];
-			uint16_t queue;
-			struct rte_ring *ring;
-			struct rte_mempool *mp;
-			void *filter;
-		} en_v1;
-		struct disable_v1 {
-			char device[RTE_DEV_NAME_MAX_LEN];
-			uint16_t queue;
-			struct rte_ring *ring;
-			struct rte_mempool *mp;
-			void *filter;
-		} dis_v1;
-	} data;
+	uint16_t flags;
+	uint16_t queue;
+	struct rte_ring *ring;
+	struct rte_mempool *mp;
+	const struct rte_bpf_prm *prm;
+	uint32_t snaplen;
+	char device[RTE_DEV_NAME_MAX_LEN];
 };
 
 struct pdump_response {
@@ -63,80 +61,140 @@ static struct pdump_rxtx_cbs {
 	struct rte_ring *ring;
 	struct rte_mempool *mp;
 	const struct rte_eth_rxtx_callback *cb;
-	void *filter;
+	const struct rte_bpf *filter;
+	enum pdump_version ver;
+	uint32_t snaplen;
 } rx_cbs[RTE_MAX_ETHPORTS][RTE_MAX_QUEUES_PER_PORT],
 tx_cbs[RTE_MAX_ETHPORTS][RTE_MAX_QUEUES_PER_PORT];
 
-
-static inline void
-pdump_copy(struct rte_mbuf **pkts, uint16_t nb_pkts, void *user_params)
+static const char *MZ_RTE_PDUMP_STATS = "rte_pdump_stats";
+
+/* Shared memory between primary and secondary processes. */
+static struct {
+	struct rte_pdump_stats rx[RTE_MAX_ETHPORTS][RTE_MAX_QUEUES_PER_PORT];
+	struct rte_pdump_stats tx[RTE_MAX_ETHPORTS][RTE_MAX_QUEUES_PER_PORT];
+} *pdump_stats;
+
+/* Create a clone of mbuf to be placed into ring. */
+static void
+pdump_copy(uint16_t port_id, uint16_t queue,
+	   enum rte_pcapng_direction direction,
+	   struct rte_mbuf **pkts, uint16_t nb_pkts,
+	   const struct pdump_rxtx_cbs *cbs,
+	   struct rte_pdump_stats *stats)
 {
 	unsigned int i;
 	int ring_enq;
 	uint16_t d_pkts = 0;
 	struct rte_mbuf *dup_bufs[nb_pkts];
-	struct pdump_rxtx_cbs *cbs;
+	uint64_t ts;
 	struct rte_ring *ring;
 	struct rte_mempool *mp;
 	struct rte_mbuf *p;
+	uint64_t rcs[nb_pkts];
+
+	if (cbs->filter &&
+	    rte_bpf_exec_burst(cbs->filter, (void **)pkts, rcs, nb_pkts) == 0) {
+		/* All packets were filtered out */
+		__atomic_fetch_add(&stats->filtered, nb_pkts,
+				   __ATOMIC_RELAXED);
+		return;
+	}
 
-	cbs  = user_params;
+	ts = rte_get_tsc_cycles();
 	ring = cbs->ring;
 	mp = cbs->mp;
 	for (i = 0; i < nb_pkts; i++) {
-		p = rte_pktmbuf_copy(pkts[i], mp, 0, UINT32_MAX);
-		if (p)
+		/*
+		 * Similar behavior to rte_bpf_eth callback.
+		 * if BPF program returns zero value for a given packet,
+		 * then it will be ignored.
+		 */
+		if (cbs->filter && rcs[i] == 0) {
+			__atomic_fetch_add(&stats->filtered,
+					   1, __ATOMIC_RELAXED);
+			continue;
+		}
+
+		/*
+		 * If using pcapng then want to wrap packets
+		 * otherwise a simple copy.
+		 */
+		if (cbs->ver == PDUMP_CLIENT_PCAPNG)
+			p = rte_pcapng_copy(port_id, queue,
+					    pkts[i], mp, cbs->snaplen,
+					    ts, direction);
+		else
+			p = rte_pktmbuf_copy(pkts[i], mp, 0, cbs->snaplen);
+
+		if (unlikely(p == NULL))
+			__atomic_fetch_add(&stats->nombuf, 1, __ATOMIC_RELAXED);
+		else
 			dup_bufs[d_pkts++] = p;
 	}
 
+	__atomic_fetch_add(&stats->accepted, d_pkts, __ATOMIC_RELAXED);
+
 	ring_enq = rte_ring_enqueue_burst(ring, (void *)dup_bufs, d_pkts, NULL);
 	if (unlikely(ring_enq < d_pkts)) {
 		unsigned int drops = d_pkts - ring_enq;
 
-		PDUMP_LOG(DEBUG,
-			"only %d of packets enqueued to ring\n", ring_enq);
+		__atomic_fetch_add(&stats->ringfull, drops, __ATOMIC_RELAXED);
 		rte_pktmbuf_free_bulk(&dup_bufs[ring_enq], drops);
 	}
 }
 
 static uint16_t
-pdump_rx(uint16_t port __rte_unused, uint16_t qidx __rte_unused,
+pdump_rx(uint16_t port, uint16_t queue,
 	struct rte_mbuf **pkts, uint16_t nb_pkts,
-	uint16_t max_pkts __rte_unused,
-	void *user_params)
+	uint16_t max_pkts __rte_unused, void *user_params)
 {
-	pdump_copy(pkts, nb_pkts, user_params);
+	const struct pdump_rxtx_cbs *cbs = user_params;
+	struct rte_pdump_stats *stats = &pdump_stats->rx[port][queue];
+
+	pdump_copy(port, queue, RTE_PCAPNG_DIRECTION_IN,
+		   pkts, nb_pkts, cbs, stats);
 	return nb_pkts;
 }
 
 static uint16_t
-pdump_tx(uint16_t port __rte_unused, uint16_t qidx __rte_unused,
+pdump_tx(uint16_t port, uint16_t queue,
 		struct rte_mbuf **pkts, uint16_t nb_pkts, void *user_params)
 {
-	pdump_copy(pkts, nb_pkts, user_params);
+	const struct pdump_rxtx_cbs *cbs = user_params;
+	struct rte_pdump_stats *stats = &pdump_stats->tx[port][queue];
+
+	pdump_copy(port, queue, RTE_PCAPNG_DIRECTION_OUT,
+		   pkts, nb_pkts, cbs, stats);
 	return nb_pkts;
 }
 
 static int
-pdump_register_rx_callbacks(uint16_t end_q, uint16_t port, uint16_t queue,
-				struct rte_ring *ring, struct rte_mempool *mp,
-				uint16_t operation)
+pdump_register_rx_callbacks(enum pdump_version ver,
+			    uint16_t end_q, uint16_t port, uint16_t queue,
+			    struct rte_ring *ring, struct rte_mempool *mp,
+			    struct rte_bpf *filter,
+			    uint16_t operation, uint32_t snaplen)
 {
 	uint16_t qid;
-	struct pdump_rxtx_cbs *cbs = NULL;
 
 	qid = (queue == RTE_PDUMP_ALL_QUEUES) ? 0 : queue;
 	for (; qid < end_q; qid++) {
-		cbs = &rx_cbs[port][qid];
-		if (cbs && operation == ENABLE) {
+		struct pdump_rxtx_cbs *cbs = &rx_cbs[port][qid];
+
+		if (operation == ENABLE) {
 			if (cbs->cb) {
 				PDUMP_LOG(ERR,
 					"rx callback for port=%d queue=%d, already exists\n",
 					port, qid);
 				return -EEXIST;
 			}
+			cbs->ver = ver;
 			cbs->ring = ring;
 			cbs->mp = mp;
+			cbs->snaplen = snaplen;
+			cbs->filter = filter;
+
 			cbs->cb = rte_eth_add_first_rx_callback(port, qid,
 								pdump_rx, cbs);
 			if (cbs->cb == NULL) {
@@ -145,8 +203,7 @@ pdump_register_rx_callbacks(uint16_t end_q, uint16_t port, uint16_t queue,
 					rte_errno);
 				return rte_errno;
 			}
-		}
-		if (cbs && operation == DISABLE) {
+		} else if (operation == DISABLE) {
 			int ret;
 
 			if (cbs->cb == NULL) {
@@ -170,26 +227,32 @@ pdump_register_rx_callbacks(uint16_t end_q, uint16_t port, uint16_t queue,
 }
 
 static int
-pdump_register_tx_callbacks(uint16_t end_q, uint16_t port, uint16_t queue,
-				struct rte_ring *ring, struct rte_mempool *mp,
-				uint16_t operation)
+pdump_register_tx_callbacks(enum pdump_version ver,
+			    uint16_t end_q, uint16_t port, uint16_t queue,
+			    struct rte_ring *ring, struct rte_mempool *mp,
+			    struct rte_bpf *filter,
+			    uint16_t operation, uint32_t snaplen)
 {
 
 	uint16_t qid;
-	struct pdump_rxtx_cbs *cbs = NULL;
 
 	qid = (queue == RTE_PDUMP_ALL_QUEUES) ? 0 : queue;
 	for (; qid < end_q; qid++) {
-		cbs = &tx_cbs[port][qid];
-		if (cbs && operation == ENABLE) {
+		struct pdump_rxtx_cbs *cbs = &tx_cbs[port][qid];
+
+		if (operation == ENABLE) {
 			if (cbs->cb) {
 				PDUMP_LOG(ERR,
 					"tx callback for port=%d queue=%d, already exists\n",
 					port, qid);
 				return -EEXIST;
 			}
+			cbs->ver = ver;
 			cbs->ring = ring;
 			cbs->mp = mp;
+			cbs->snaplen = snaplen;
+			cbs->filter = filter;
+
 			cbs->cb = rte_eth_add_tx_callback(port, qid, pdump_tx,
 								cbs);
 			if (cbs->cb == NULL) {
@@ -198,8 +261,7 @@ pdump_register_tx_callbacks(uint16_t end_q, uint16_t port, uint16_t queue,
 					rte_errno);
 				return rte_errno;
 			}
-		}
-		if (cbs && operation == DISABLE) {
+		} else if (operation == DISABLE) {
 			int ret;
 
 			if (cbs->cb == NULL) {
@@ -228,37 +290,47 @@ set_pdump_rxtx_cbs(const struct pdump_request *p)
 	uint16_t nb_rx_q = 0, nb_tx_q = 0, end_q, queue;
 	uint16_t port;
 	int ret = 0;
+	struct rte_bpf *filter = NULL;
 	uint32_t flags;
 	uint16_t operation;
 	struct rte_ring *ring;
 	struct rte_mempool *mp;
 
-	flags = p->flags;
-	operation = p->op;
-	if (operation == ENABLE) {
-		ret = rte_eth_dev_get_port_by_name(p->data.en_v1.device,
-				&port);
-		if (ret < 0) {
+	if (!(p->ver == PDUMP_CLIENT_LEGACY ||
+	      p->ver == PDUMP_CLIENT_PCAPNG)) {
+		PDUMP_LOG(ERR,
+			  "incorrect client version %u\n", p->ver);
+		return -EINVAL;
+	}
+
+	if (p->prm) {
+		if (p->prm->prog_arg.type != RTE_BPF_ARG_PTR_MBUF) {
 			PDUMP_LOG(ERR,
-				"failed to get port id for device id=%s\n",
-				p->data.en_v1.device);
+				  "invalid BPF program type: %u\n",
+				  p->prm->prog_arg.type);
 			return -EINVAL;
 		}
-		queue = p->data.en_v1.queue;
-		ring = p->data.en_v1.ring;
-		mp = p->data.en_v1.mp;
-	} else {
-		ret = rte_eth_dev_get_port_by_name(p->data.dis_v1.device,
-				&port);
-		if (ret < 0) {
-			PDUMP_LOG(ERR,
-				"failed to get port id for device id=%s\n",
-				p->data.dis_v1.device);
-			return -EINVAL;
+
+		filter = rte_bpf_load(p->prm);
+		if (filter == NULL) {
+			PDUMP_LOG(ERR, "cannot load BPF filter: %s\n",
+				  rte_strerror(rte_errno));
+			return -rte_errno;
 		}
-		queue = p->data.dis_v1.queue;
-		ring = p->data.dis_v1.ring;
-		mp = p->data.dis_v1.mp;
+	}
+
+	flags = p->flags;
+	operation = p->op;
+	queue = p->queue;
+	ring = p->ring;
+	mp = p->mp;
+
+	ret = rte_eth_dev_get_port_by_name(p->device, &port);
+	if (ret < 0) {
+		PDUMP_LOG(ERR,
+			  "failed to get port id for device id=%s\n",
+			  p->device);
+		return -EINVAL;
 	}
 
 	/* validation if packet capture is for all queues */
@@ -296,8 +368,9 @@ set_pdump_rxtx_cbs(const struct pdump_request *p)
 	/* register RX callback */
 	if (flags & RTE_PDUMP_FLAG_RX) {
 		end_q = (queue == RTE_PDUMP_ALL_QUEUES) ? nb_rx_q : queue + 1;
-		ret = pdump_register_rx_callbacks(end_q, port, queue, ring, mp,
-							operation);
+		ret = pdump_register_rx_callbacks(p->ver, end_q, port, queue,
+						  ring, mp, filter,
+						  operation, p->snaplen);
 		if (ret < 0)
 			return ret;
 	}
@@ -305,8 +378,9 @@ set_pdump_rxtx_cbs(const struct pdump_request *p)
 	/* register TX callback */
 	if (flags & RTE_PDUMP_FLAG_TX) {
 		end_q = (queue == RTE_PDUMP_ALL_QUEUES) ? nb_tx_q : queue + 1;
-		ret = pdump_register_tx_callbacks(end_q, port, queue, ring, mp,
-							operation);
+		ret = pdump_register_tx_callbacks(p->ver, end_q, port, queue,
+						  ring, mp, filter,
+						  operation, p->snaplen);
 		if (ret < 0)
 			return ret;
 	}
@@ -347,8 +421,18 @@ pdump_server(const struct rte_mp_msg *mp_msg, const void *peer)
 int
 rte_pdump_init(void)
 {
+	const struct rte_memzone *mz;
 	int ret;
 
+	mz = rte_memzone_reserve(MZ_RTE_PDUMP_STATS, sizeof(*pdump_stats),
+				 rte_socket_id(), 0);
+	if (mz == NULL) {
+		PDUMP_LOG(ERR, "cannot allocate pdump statistics\n");
+		rte_errno = ENOMEM;
+		return -1;
+	}
+	pdump_stats = mz->addr;
+
 	ret = rte_mp_action_register(PDUMP_MP, pdump_server);
 	if (ret && rte_errno != ENOTSUP)
 		return -1;
@@ -392,14 +476,21 @@ pdump_validate_ring_mp(struct rte_ring *ring, struct rte_mempool *mp)
 static int
 pdump_validate_flags(uint32_t flags)
 {
-	if (flags != RTE_PDUMP_FLAG_RX && flags != RTE_PDUMP_FLAG_TX &&
-		flags != RTE_PDUMP_FLAG_RXTX) {
+	if ((flags & RTE_PDUMP_FLAG_RXTX) == 0) {
 		PDUMP_LOG(ERR,
 			"invalid flags, should be either rx/tx/rxtx\n");
 		rte_errno = EINVAL;
 		return -1;
 	}
 
+	/* mask off the flags we know about */
+	if (flags & ~(RTE_PDUMP_FLAG_RXTX | RTE_PDUMP_FLAG_PCAPNG)) {
+		PDUMP_LOG(ERR,
+			  "unknown flags: %#x\n", flags);
+		rte_errno = ENOTSUP;
+		return -1;
+	}
+
 	return 0;
 }
 
@@ -426,12 +517,12 @@ pdump_validate_port(uint16_t port, char *name)
 }
 
 static int
-pdump_prepare_client_request(char *device, uint16_t queue,
-				uint32_t flags,
-				uint16_t operation,
-				struct rte_ring *ring,
-				struct rte_mempool *mp,
-				void *filter)
+pdump_prepare_client_request(const char *device, uint16_t queue,
+			     uint32_t flags, uint32_t snaplen,
+			     uint16_t operation,
+			     struct rte_ring *ring,
+			     struct rte_mempool *mp,
+			     const struct rte_bpf_prm *prm)
 {
 	int ret = -1;
 	struct rte_mp_msg mp_req, *mp_rep;
@@ -440,23 +531,23 @@ pdump_prepare_client_request(char *device, uint16_t queue,
 	struct pdump_request *req = (struct pdump_request *)mp_req.param;
 	struct pdump_response *resp;
 
-	req->ver = 1;
-	req->flags = flags;
+	memset(req, 0, sizeof(*req));
+	if (flags & RTE_PDUMP_FLAG_PCAPNG)
+		req->ver = PDUMP_CLIENT_PCAPNG;
+	else
+		req->ver = PDUMP_CLIENT_LEGACY;
+
+	req->flags = flags & RTE_PDUMP_FLAG_RXTX;
 	req->op = operation;
+	req->queue = queue;
+	strlcpy(req->device, device, sizeof(req->device));
+
 	if ((operation & ENABLE) != 0) {
-		strlcpy(req->data.en_v1.device, device,
-			sizeof(req->data.en_v1.device));
-		req->data.en_v1.queue = queue;
-		req->data.en_v1.ring = ring;
-		req->data.en_v1.mp = mp;
-		req->data.en_v1.filter = filter;
-	} else {
-		strlcpy(req->data.dis_v1.device, device,
-			sizeof(req->data.dis_v1.device));
-		req->data.dis_v1.queue = queue;
-		req->data.dis_v1.ring = NULL;
-		req->data.dis_v1.mp = NULL;
-		req->data.dis_v1.filter = NULL;
+		req->queue = queue;
+		req->ring = ring;
+		req->mp = mp;
+		req->prm = prm;
+		req->snaplen = snaplen;
 	}
 
 	strlcpy(mp_req.name, PDUMP_MP, RTE_MP_MAX_NAME_LEN);
@@ -477,11 +568,17 @@ pdump_prepare_client_request(char *device, uint16_t queue,
 	return ret;
 }
 
-int
-rte_pdump_enable(uint16_t port, uint16_t queue, uint32_t flags,
-			struct rte_ring *ring,
-			struct rte_mempool *mp,
-			void *filter)
+/*
+ * There are two versions of this function, because although original API
+ * left place holder for future filter, it never checked the value.
+ * Therefore the API can't depend on application passing a non
+ * bogus value.
+ */
+static int
+pdump_enable(uint16_t port, uint16_t queue,
+	     uint32_t flags, uint32_t snaplen,
+	     struct rte_ring *ring, struct rte_mempool *mp,
+	     const struct rte_bpf_prm *prm)
 {
 	int ret;
 	char name[RTE_DEV_NAME_MAX_LEN];
@@ -496,20 +593,42 @@ rte_pdump_enable(uint16_t port, uint16_t queue, uint32_t flags,
 	if (ret < 0)
 		return ret;
 
-	ret = pdump_prepare_client_request(name, queue, flags,
-						ENABLE, ring, mp, filter);
+	if (snaplen == 0)
+		snaplen = UINT32_MAX;
 
-	return ret;
+	return pdump_prepare_client_request(name, queue, flags, snaplen,
+					    ENABLE, ring, mp, prm);
 }
 
 int
-rte_pdump_enable_by_deviceid(char *device_id, uint16_t queue,
-				uint32_t flags,
-				struct rte_ring *ring,
-				struct rte_mempool *mp,
-				void *filter)
+rte_pdump_enable(uint16_t port, uint16_t queue, uint32_t flags,
+		 struct rte_ring *ring,
+		 struct rte_mempool *mp,
+		 void *filter __rte_unused)
 {
-	int ret = 0;
+	return pdump_enable(port, queue, flags, 0,
+			    ring, mp, NULL);
+}
+
+int
+rte_pdump_enable_bpf(uint16_t port, uint16_t queue,
+		     uint32_t flags, uint32_t snaplen,
+		     struct rte_ring *ring,
+		     struct rte_mempool *mp,
+		     const struct rte_bpf_prm *prm)
+{
+	return pdump_enable(port, queue, flags, snaplen,
+			    ring, mp, prm);
+}
+
+static int
+pdump_enable_by_deviceid(const char *device_id, uint16_t queue,
+			 uint32_t flags, uint32_t snaplen,
+			 struct rte_ring *ring,
+			 struct rte_mempool *mp,
+			 const struct rte_bpf_prm *prm)
+{
+	int ret;
 
 	ret = pdump_validate_ring_mp(ring, mp);
 	if (ret < 0)
@@ -518,10 +637,30 @@ rte_pdump_enable_by_deviceid(char *device_id, uint16_t queue,
 	if (ret < 0)
 		return ret;
 
-	ret = pdump_prepare_client_request(device_id, queue, flags,
-						ENABLE, ring, mp, filter);
+	return pdump_prepare_client_request(device_id, queue, flags, snaplen,
+					    ENABLE, ring, mp, prm);
+}
 
-	return ret;
+int
+rte_pdump_enable_by_deviceid(char *device_id, uint16_t queue,
+			     uint32_t flags,
+			     struct rte_ring *ring,
+			     struct rte_mempool *mp,
+			     void *filter __rte_unused)
+{
+	return pdump_enable_by_deviceid(device_id, queue, flags, 0,
+					ring, mp, NULL);
+}
+
+int
+rte_pdump_enable_bpf_by_deviceid(const char *device_id, uint16_t queue,
+				 uint32_t flags, uint32_t snaplen,
+				 struct rte_ring *ring,
+				 struct rte_mempool *mp,
+				 const struct rte_bpf_prm *prm)
+{
+	return pdump_enable_by_deviceid(device_id, queue, flags, snaplen,
+					ring, mp, prm);
 }
 
 int
@@ -537,8 +676,8 @@ rte_pdump_disable(uint16_t port, uint16_t queue, uint32_t flags)
 	if (ret < 0)
 		return ret;
 
-	ret = pdump_prepare_client_request(name, queue, flags,
-						DISABLE, NULL, NULL, NULL);
+	ret = pdump_prepare_client_request(name, queue, flags, 0,
+					   DISABLE, NULL, NULL, NULL);
 
 	return ret;
 }
@@ -553,8 +692,66 @@ rte_pdump_disable_by_deviceid(char *device_id, uint16_t queue,
 	if (ret < 0)
 		return ret;
 
-	ret = pdump_prepare_client_request(device_id, queue, flags,
-						DISABLE, NULL, NULL, NULL);
+	ret = pdump_prepare_client_request(device_id, queue, flags, 0,
+					   DISABLE, NULL, NULL, NULL);
 
 	return ret;
 }
+
+static void
+pdump_sum_stats(uint16_t port, uint16_t nq,
+		const struct rte_pdump_stats stats[RTE_MAX_ETHPORTS][RTE_MAX_QUEUES_PER_PORT],
+		struct rte_pdump_stats *total)
+{
+	uint64_t *sum = (uint64_t *)total;
+	unsigned int i;
+	uint64_t val;
+	uint16_t qid;
+
+	for (qid = 0; qid < nq; qid++) {
+		const uint64_t *perq = (const uint64_t *)&stats[port][qid];
+
+		for (i = 0; i < sizeof(*total) / sizeof(uint64_t); i++) {
+			val = __atomic_load_n(&perq[i], __ATOMIC_RELAXED);
+			sum[i] += val;
+		}
+	}
+}
+
+int
+rte_pdump_stats(uint16_t port, struct rte_pdump_stats *stats)
+{
+	struct rte_eth_dev_info dev_info;
+	const struct rte_memzone *mz;
+	int ret;
+
+	memset(stats, 0, sizeof(*stats));
+	ret = rte_eth_dev_info_get(port, &dev_info);
+	if (ret != 0) {
+		PDUMP_LOG(ERR,
+			  "Error during getting device (port %u) info: %s\n",
+			  port, strerror(-ret));
+		return ret;
+	}
+
+	if (pdump_stats == NULL) {
+		if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
+			PDUMP_LOG(ERR,
+				  "pdump not initialized\n");
+			rte_errno = EINVAL;
+			return -1;
+		}
+
+		mz = rte_memzone_lookup(MZ_RTE_PDUMP_STATS);
+		if (mz == NULL) {
+			PDUMP_LOG(ERR, "can not find pdump stats\n");
+			rte_errno = EINVAL;
+			return -1;
+		}
+		pdump_stats = mz->addr;
+	}
+
+	pdump_sum_stats(port, dev_info.nb_rx_queues, pdump_stats->rx, stats);
+	pdump_sum_stats(port, dev_info.nb_tx_queues, pdump_stats->tx, stats);
+	return 0;
+}
diff --git a/lib/pdump/rte_pdump.h b/lib/pdump/rte_pdump.h
index 6b00fc17aeb2..e2fbd78c6273 100644
--- a/lib/pdump/rte_pdump.h
+++ b/lib/pdump/rte_pdump.h
@@ -15,6 +15,7 @@
 #include <stdint.h>
 #include <rte_mempool.h>
 #include <rte_ring.h>
+#include <rte_bpf.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -26,7 +27,9 @@ enum {
 	RTE_PDUMP_FLAG_RX = 1,  /* receive direction */
 	RTE_PDUMP_FLAG_TX = 2,  /* transmit direction */
 	/* both receive and transmit directions */
-	RTE_PDUMP_FLAG_RXTX = (RTE_PDUMP_FLAG_RX|RTE_PDUMP_FLAG_TX)
+	RTE_PDUMP_FLAG_RXTX = (RTE_PDUMP_FLAG_RX|RTE_PDUMP_FLAG_TX),
+
+	RTE_PDUMP_FLAG_PCAPNG = 4, /* format for pcapng */
 };
 
 /**
@@ -68,7 +71,7 @@ rte_pdump_uninit(void);
  * @param mp
  *  mempool on to which original packets will be mirrored or duplicated.
  * @param filter
- *  place holder for packet filtering.
+ *  Unused should be NULL.
  *
  * @return
  *    0 on success, -1 on error, rte_errno is set accordingly.
@@ -80,6 +83,41 @@ rte_pdump_enable(uint16_t port, uint16_t queue, uint32_t flags,
 		struct rte_mempool *mp,
 		void *filter);
 
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
+ *
+ * Enables packet capturing on given port and queue with filtering.
+ *
+ * @param port_id
+ *  The Ethernet port on which packet capturing should be enabled.
+ * @param queue
+ *  The queue on the Ethernet port which packet capturing
+ *  should be enabled. Pass UINT16_MAX to enable packet capturing on all
+ *  queues of a given port.
+ * @param flags
+ *  Pdump library flags that specify direction and packet format.
+ * @param snaplen
+ *  The upper limit on bytes to copy.
+ *  Passing UINT32_MAX means capture all the possible data.
+ * @param ring
+ *  The ring on which captured packets will be enqueued for user.
+ * @param mp
+ *  The mempool on to which original packets will be mirrored or duplicated.
+ * @param prm
+ *  Use BPF program to run to filter packes (can be NULL)
+ *
+ * @return
+ *    0 on success, -1 on error, rte_errno is set accordingly.
+ */
+__rte_experimental
+int
+rte_pdump_enable_bpf(uint16_t port_id, uint16_t queue,
+		     uint32_t flags, uint32_t snaplen,
+		     struct rte_ring *ring,
+		     struct rte_mempool *mp,
+		     const struct rte_bpf_prm *prm);
+
 /**
  * Disables packet capturing on given port and queue.
  *
@@ -118,7 +156,7 @@ rte_pdump_disable(uint16_t port, uint16_t queue, uint32_t flags);
  * @param mp
  *  mempool on to which original packets will be mirrored or duplicated.
  * @param filter
- *  place holder for packet filtering.
+ *  unused should be NULL
  *
  * @return
  *    0 on success, -1 on error, rte_errno is set accordingly.
@@ -131,6 +169,43 @@ rte_pdump_enable_by_deviceid(char *device_id, uint16_t queue,
 				struct rte_mempool *mp,
 				void *filter);
 
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
+ *
+ * Enables packet capturing on given device id and queue with filtering.
+ * device_id can be name or pci address of device.
+ *
+ * @param device_id
+ *  device id on which packet capturing should be enabled.
+ * @param queue
+ *  The queue on the Ethernet port which packet capturing
+ *  should be enabled. Pass UINT16_MAX to enable packet capturing on all
+ *  queues of a given port.
+ * @param flags
+ *  Pdump library flags that specify direction and packet format.
+ * @param snaplen
+ *  The upper limit on bytes to copy.
+ *  Passing UINT32_MAX means capture all the possible data.
+ * @param ring
+ *  The ring on which captured packets will be enqueued for user.
+ * @param mp
+ *  The mempool on to which original packets will be mirrored or duplicated.
+ * @param filter
+ *  Use BPF program to run to filter packes (can be NULL)
+ *
+ * @return
+ *    0 on success, -1 on error, rte_errno is set accordingly.
+ */
+__rte_experimental
+int
+rte_pdump_enable_bpf_by_deviceid(const char *device_id, uint16_t queue,
+				 uint32_t flags, uint32_t snaplen,
+				 struct rte_ring *ring,
+				 struct rte_mempool *mp,
+				 const struct rte_bpf_prm *prm);
+
+
 /**
  * Disables packet capturing on given device_id and queue.
  * device_id can be name or pci address of device.
@@ -153,6 +228,35 @@ int
 rte_pdump_disable_by_deviceid(char *device_id, uint16_t queue,
 				uint32_t flags);
 
+
+/**
+ * A structure used to retrieve statistics from packet capture.
+ * The statistics are sum of both receive and transmit queues.
+ */
+struct rte_pdump_stats {
+	uint64_t accepted; /**< Number of packets accepted by filter. */
+	uint64_t filtered; /**< Number of packets rejected by filter. */
+	uint64_t nombuf;   /**< Number of mbuf allocation failures. */
+	uint64_t ringfull; /**< Number of missed packets due to ring full. */
+
+	uint64_t reserved[4]; /**< Reserved and pad to cache line */
+};
+
+/**
+ * Retrieve the packet capture statistics for a queue.
+ *
+ * @param port_id
+ *   The port identifier of the Ethernet device.
+ * @param stats
+ *   A pointer to structure of type *rte_pdump_stats* to be filled in.
+ * @return
+ *   Zero if successful. -1 on error and rte_errno is set.
+ */
+__rte_experimental
+int
+rte_pdump_stats(uint16_t port_id, struct rte_pdump_stats *stats);
+
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/lib/pdump/version.map b/lib/pdump/version.map
index f0a9d12c9a9e..ce5502d9cdf4 100644
--- a/lib/pdump/version.map
+++ b/lib/pdump/version.map
@@ -10,3 +10,11 @@ DPDK_22 {
 
 	local: *;
 };
+
+EXPERIMENTAL {
+	global:
+
+	rte_pdump_enable_bpf;
+	rte_pdump_enable_bpf_by_deviceid;
+	rte_pdump_stats;
+};
-- 
2.30.2


^ permalink raw reply	[relevance 1%]

* [dpdk-dev] [PATCH v3 7/8] doc: changes for new pcapng and dumpcap
    2021-09-08  4:50  1%   ` [dpdk-dev] [PATCH v3 5/8] pdump: support pcapng and filtering Stephen Hemminger
@ 2021-09-08  4:50  1%   ` Stephen Hemminger
  1 sibling, 0 replies; 200+ results
From: Stephen Hemminger @ 2021-09-08  4:50 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

Describe the new packet capture library and utilities

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 doc/api/doxy-api-index.md                     |  1 +
 doc/api/doxy-api.conf.in                      |  1 +
 .../howto/img/packet_capture_framework.svg    | 96 +++++++++----------
 doc/guides/howto/packet_capture_framework.rst | 67 ++++++-------
 doc/guides/prog_guide/index.rst               |  1 +
 doc/guides/prog_guide/pcapng_lib.rst          | 24 +++++
 doc/guides/prog_guide/pdump_lib.rst           | 28 ++++--
 doc/guides/rel_notes/release_21_11.rst        | 10 ++
 doc/guides/tools/dumpcap.rst                  | 86 +++++++++++++++++
 doc/guides/tools/index.rst                    |  1 +
 10 files changed, 228 insertions(+), 87 deletions(-)
 create mode 100644 doc/guides/prog_guide/pcapng_lib.rst
 create mode 100644 doc/guides/tools/dumpcap.rst

diff --git a/doc/api/doxy-api-index.md b/doc/api/doxy-api-index.md
index 1992107a0356..ee07394d1c78 100644
--- a/doc/api/doxy-api-index.md
+++ b/doc/api/doxy-api-index.md
@@ -223,3 +223,4 @@ The public API headers are grouped by topics:
   [experimental APIs]  (@ref rte_compat.h),
   [ABI versioning]     (@ref rte_function_versioning.h),
   [version]            (@ref rte_version.h)
+  [pcapng]             (@ref rte_pcapng.h)
diff --git a/doc/api/doxy-api.conf.in b/doc/api/doxy-api.conf.in
index 325a0195c6ab..aba17799a9a1 100644
--- a/doc/api/doxy-api.conf.in
+++ b/doc/api/doxy-api.conf.in
@@ -58,6 +58,7 @@ INPUT                   = @TOPDIR@/doc/api/doxy-api-index.md \
                           @TOPDIR@/lib/metrics \
                           @TOPDIR@/lib/node \
                           @TOPDIR@/lib/net \
+                          @TOPDIR@/lib/pcapng \
                           @TOPDIR@/lib/pci \
                           @TOPDIR@/lib/pdump \
                           @TOPDIR@/lib/pipeline \
diff --git a/doc/guides/howto/img/packet_capture_framework.svg b/doc/guides/howto/img/packet_capture_framework.svg
index a76baf71fdee..1c2646a81096 100644
--- a/doc/guides/howto/img/packet_capture_framework.svg
+++ b/doc/guides/howto/img/packet_capture_framework.svg
@@ -1,6 +1,4 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
 <svg
    xmlns:osb="http://www.openswatchbook.org/uri/2009/osb"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
@@ -16,8 +14,8 @@
    viewBox="0 0 425.19685 283.46457"
    id="svg2"
    version="1.1"
-   inkscape:version="0.91 r13725"
-   sodipodi:docname="drawing-pcap.svg">
+   inkscape:version="1.0.2 (e86c870879, 2021-01-15)"
+   sodipodi:docname="packet_capture_framework.svg">
   <defs
      id="defs4">
     <marker
@@ -228,7 +226,7 @@
        x2="487.64606"
        y2="258.38232"
        gradientUnits="userSpaceOnUse"
-       gradientTransform="translate(-84.916417,744.90779)" />
+       gradientTransform="matrix(1.1457977,0,0,0.99944907,-151.97019,745.05014)" />
     <linearGradient
        inkscape:collect="always"
        xlink:href="#linearGradient5784"
@@ -277,17 +275,18 @@
      borderopacity="1.0"
      inkscape:pageopacity="0.0"
      inkscape:pageshadow="2"
-     inkscape:zoom="0.57434918"
-     inkscape:cx="215.17857"
-     inkscape:cy="285.26445"
+     inkscape:zoom="1"
+     inkscape:cx="226.77165"
+     inkscape:cy="78.124511"
      inkscape:document-units="px"
      inkscape:current-layer="layer1"
      showgrid="false"
-     inkscape:window-width="1874"
-     inkscape:window-height="971"
-     inkscape:window-x="2"
-     inkscape:window-y="24"
-     inkscape:window-maximized="0" />
+     inkscape:window-width="2560"
+     inkscape:window-height="1414"
+     inkscape:window-x="0"
+     inkscape:window-y="0"
+     inkscape:window-maximized="1"
+     inkscape:document-rotation="0" />
   <metadata
      id="metadata7">
     <rdf:RDF>
@@ -296,7 +295,7 @@
         <dc:format>image/svg+xml</dc:format>
         <dc:type
            rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
-        <dc:title></dc:title>
+        <dc:title />
       </cc:Work>
     </rdf:RDF>
   </metadata>
@@ -321,15 +320,15 @@
        y="790.82452" />
     <text
        xml:space="preserve"
-       style="font-style:normal;font-weight:normal;font-size:12.5px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
        x="61.050636"
        y="807.3205"
-       id="text4152"
-       sodipodi:linespacing="125%"><tspan
+       id="text4152"><tspan
          sodipodi:role="line"
          id="tspan4154"
          x="61.050636"
-         y="807.3205">DPDK Primary Application</tspan></text>
+         y="807.3205"
+         style="font-size:12.5px;line-height:1.25">DPDK Primary Application</tspan></text>
     <rect
        style="fill:#000000;fill-opacity:0;stroke:#257cdc;stroke-width:2;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
        id="rect4156-6"
@@ -339,19 +338,20 @@
        y="827.01843" />
     <text
        xml:space="preserve"
-       style="font-style:normal;font-weight:normal;font-size:12.5px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
        x="350.68585"
        y="841.16058"
-       id="text4189"
-       sodipodi:linespacing="125%"><tspan
+       id="text4189"><tspan
          sodipodi:role="line"
          id="tspan4191"
          x="350.68585"
-         y="841.16058">dpdk-pdump</tspan><tspan
+         y="841.16058"
+         style="font-size:12.5px;line-height:1.25">dpdk-dumpcap</tspan><tspan
          sodipodi:role="line"
          x="350.68585"
          y="856.78558"
-         id="tspan4193">tool</tspan></text>
+         id="tspan4193"
+         style="font-size:12.5px;line-height:1.25">tool</tspan></text>
     <rect
        style="fill:#000000;fill-opacity:0;stroke:#257cdc;stroke-width:2;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
        id="rect4156-6-4"
@@ -361,15 +361,15 @@
        y="891.16315" />
     <text
        xml:space="preserve"
-       style="font-style:normal;font-weight:normal;font-size:12.5px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
        x="352.70612"
        y="905.3053"
-       id="text4189-1"
-       sodipodi:linespacing="125%"><tspan
+       id="text4189-1"><tspan
          sodipodi:role="line"
          x="352.70612"
          y="905.3053"
-         id="tspan4193-3">PCAP PMD</tspan></text>
+         id="tspan4193-3"
+         style="font-size:12.5px;line-height:1.25">librte_pcapng</tspan></text>
     <rect
        style="fill:url(#linearGradient5745);fill-opacity:1;stroke:#257cdc;stroke-width:2;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
        id="rect4156-6-6"
@@ -379,15 +379,15 @@
        y="923.9931" />
     <text
        xml:space="preserve"
-       style="font-style:normal;font-weight:normal;font-size:12.5px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
        x="136.02846"
        y="938.13525"
-       id="text4189-0"
-       sodipodi:linespacing="125%"><tspan
+       id="text4189-0"><tspan
          sodipodi:role="line"
          x="136.02846"
          y="938.13525"
-         id="tspan4193-6">dpdk_port0</tspan></text>
+         id="tspan4193-6"
+         style="font-size:12.5px;line-height:1.25">dpdk_port0</tspan></text>
     <rect
        style="fill:#000000;fill-opacity:0;stroke:#257cdc;stroke-width:2;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
        id="rect4156-6-5"
@@ -397,33 +397,33 @@
        y="824.99817" />
     <text
        xml:space="preserve"
-       style="font-style:normal;font-weight:normal;font-size:12.5px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
        x="137.54369"
        y="839.14026"
-       id="text4189-4"
-       sodipodi:linespacing="125%"><tspan
+       id="text4189-4"><tspan
          sodipodi:role="line"
          x="137.54369"
          y="839.14026"
-         id="tspan4193-2">librte_pdump</tspan></text>
+         id="tspan4193-2"
+         style="font-size:12.5px;line-height:1.25">librte_pdump</tspan></text>
     <rect
-       style="fill:url(#linearGradient5788);fill-opacity:1;stroke:#257cdc;stroke-width:1;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       style="fill:url(#linearGradient5788);fill-opacity:1;stroke:#257cdc;stroke-width:1.07013;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
        id="rect4156-6-4-5"
-       width="94.449265"
-       height="35.355339"
-       x="307.7804"
-       y="985.61243" />
+       width="108.21974"
+       height="35.335861"
+       x="297.9809"
+       y="985.62219" />
     <text
        xml:space="preserve"
-       style="font-style:normal;font-weight:normal;font-size:12.5px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
        x="352.70618"
        y="999.75458"
-       id="text4189-1-8"
-       sodipodi:linespacing="125%"><tspan
+       id="text4189-1-8"><tspan
          sodipodi:role="line"
          x="352.70618"
          y="999.75458"
-         id="tspan4193-3-2">capture.pcap</tspan></text>
+         id="tspan4193-3-2"
+         style="font-size:12.5px;line-height:1.25">capture.pcapng</tspan></text>
     <rect
        style="fill:url(#linearGradient5788-1);fill-opacity:1;stroke:#257cdc;stroke-width:1.12555885;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
        id="rect4156-6-4-5-1"
@@ -433,15 +433,15 @@
        y="983.14984" />
     <text
        xml:space="preserve"
-       style="font-style:normal;font-weight:normal;font-size:12.5px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
        x="136.53352"
        y="1002.785"
-       id="text4189-1-8-4"
-       sodipodi:linespacing="125%"><tspan
+       id="text4189-1-8-4"><tspan
          sodipodi:role="line"
          x="136.53352"
          y="1002.785"
-         id="tspan4193-3-2-7">Traffic Generator</tspan></text>
+         id="tspan4193-3-2-7"
+         style="font-size:12.5px;line-height:1.25">Traffic Generator</tspan></text>
     <path
        style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#marker7331)"
        d="m 351.46948,927.02357 c 0,57.5787 0,57.5787 0,57.5787"
diff --git a/doc/guides/howto/packet_capture_framework.rst b/doc/guides/howto/packet_capture_framework.rst
index c31bac52340e..78baa609a021 100644
--- a/doc/guides/howto/packet_capture_framework.rst
+++ b/doc/guides/howto/packet_capture_framework.rst
@@ -1,18 +1,19 @@
 ..  SPDX-License-Identifier: BSD-3-Clause
     Copyright(c) 2017 Intel Corporation.
 
-DPDK pdump Library and pdump Tool
-=================================
+DPDK packet capture libraries and tools
+=======================================
 
 This document describes how the Data Plane Development Kit (DPDK) Packet
 Capture Framework is used for capturing packets on DPDK ports. It is intended
 for users of DPDK who want to know more about the Packet Capture feature and
 for those who want to monitor traffic on DPDK-controlled devices.
 
-The DPDK packet capture framework was introduced in DPDK v16.07. The DPDK
-packet capture framework consists of the DPDK pdump library and DPDK pdump
-tool.
-
+The DPDK packet capture framework was introduced in DPDK v16.07 and
+enhanced in 21.1. The DPDK packet capture framework consists of the
+libraries for collecting packets ``librte_pdump`` and writing packets
+to a file ``librte_pcapng``. There are two sample applications:
+``dpdk-dumpcap`` and older ``dpdk-pdump``.
 
 Introduction
 ------------
@@ -22,43 +23,46 @@ allow users to initialize the packet capture framework and to enable or
 disable packet capture. The library works on a multi process communication model and its
 usage is recommended for debugging purposes.
 
-The :ref:`dpdk-pdump <pdump_tool>` tool is developed based on the
-``librte_pdump`` library.  It runs as a DPDK secondary process and is capable
-of enabling or disabling packet capture on DPDK ports. The ``dpdk-pdump`` tool
-provides command-line options with which users can request enabling or
-disabling of the packet capture on DPDK ports.
+The :ref:`librte_pcapng <pcapng_library>` library provides the APIs to format
+packets and write them to a file in Pcapng format.
+
+
+The :ref:`dpdk-dumpcap <dumpcap_tool>` is a tool that captures packets in
+like Wireshark dumpcap does for Linux. It runs as a DPDK secondary process and
+captures packets from one or more interfaces and writes them to a file
+in Pcapng format.  The ``dpdk-dumpcap`` tool is designed to take
+most of the same options as the Wireshark ``dumpcap`` command.
 
-The application which initializes the packet capture framework will be a primary process
-and the application that enables or disables the packet capture will
-be a secondary process. The primary process sends the Rx and Tx packets from the DPDK ports
-to the secondary process.
+Without any options it will use the packet capture framework to
+capture traffic from the first available DPDK port.
 
 In DPDK the ``testpmd`` application can be used to initialize the packet
-capture framework and acts as a server, and the ``dpdk-pdump`` tool acts as a
+capture framework and acts as a server, and the ``dpdk-dumpcap`` tool acts as a
 client. To view Rx or Tx packets of ``testpmd``, the application should be
-launched first, and then the ``dpdk-pdump`` tool. Packets from ``testpmd``
-will be sent to the tool, which then sends them on to the Pcap PMD device and
-that device writes them to the Pcap file or to an external interface depending
-on the command-line option used.
+launched first, and then the ``dpdk-dumpcap`` tool. Packets from ``testpmd``
+will be sent to the tool, and then to the Pcapng file.
 
 Some things to note:
 
-* The ``dpdk-pdump`` tool can only be used in conjunction with a primary
+* All tools using ``librte_pdump`` can only be used in conjunction with a primary
   application which has the packet capture framework initialized already. In
   dpdk, only ``testpmd`` is modified to initialize packet capture framework,
-  other applications remain untouched. So, if the ``dpdk-pdump`` tool has to
+  other applications remain untouched. So, if the ``dpdk-dumpcap`` tool has to
   be used with any application other than the testpmd, the user needs to
   explicitly modify that application to call the packet capture framework
   initialization code. Refer to the ``app/test-pmd/testpmd.c`` code and look
   for ``pdump`` keyword to see how this is done.
 
-* The ``dpdk-pdump`` tool depends on the libpcap based PMD.
+* The ``dpdk-pdump`` tool is an older tool created as demonstration of ``librte_pdump``
+  library. The ``dpdk-pdump`` tool provides more limited functionality and
+  and depends on the Pcap PMD. It is retained only for compatibility reasons;
+  users should use ``dpdk-dumpcap`` instead.
 
 
 Test Environment
 ----------------
 
-The overview of using the Packet Capture Framework and the ``dpdk-pdump`` tool
+The overview of using the Packet Capture Framework and the ``dpdk-dumpcap`` utility
 for packet capturing on the DPDK port in
 :numref:`figure_packet_capture_framework`.
 
@@ -66,13 +70,13 @@ for packet capturing on the DPDK port in
 
 .. figure:: img/packet_capture_framework.*
 
-   Packet capturing on a DPDK port using the dpdk-pdump tool.
+   Packet capturing on a DPDK port using the dpdk-dumpcap utility.
 
 
 Running the Application
 -----------------------
 
-The following steps demonstrate how to run the ``dpdk-pdump`` tool to capture
+The following steps demonstrate how to run the ``dpdk-dumpcap`` tool to capture
 Rx side packets on dpdk_port0 in :numref:`figure_packet_capture_framework` and
 inspect them using ``tcpdump``.
 
@@ -80,16 +84,15 @@ inspect them using ``tcpdump``.
 
      sudo <build_dir>/app/dpdk-testpmd -c 0xf0 -n 4 -- -i --port-topology=chained
 
-#. Launch the pdump tool as follows::
+#. Launch the dpdk-dump as follows::
 
-     sudo <build_dir>/app/dpdk-pdump -- \
-          --pdump 'port=0,queue=*,rx-dev=/tmp/capture.pcap'
+     sudo <build_dir>/app/dpdk-dumpcap -w /tmp/capture.pcapng
 
 #. Send traffic to dpdk_port0 from traffic generator.
-   Inspect packets captured in the file capture.pcap using a tool
-   that can interpret Pcap files, for example tcpdump::
+   Inspect packets captured in the file capture.pcap using a tool such as
+   tcpdump or tshark that can interpret Pcapng files::
 
-     $tcpdump -nr /tmp/capture.pcap
+     $ tcpdump -nr /tmp/capture.pcapng
      reading from file /tmp/capture.pcap, link-type EN10MB (Ethernet)
      11:11:36.891404 IP 4.4.4.4.whois++ > 3.3.3.3.whois++: UDP, length 18
      11:11:36.891442 IP 4.4.4.4.whois++ > 3.3.3.3.whois++: UDP, length 18
diff --git a/doc/guides/prog_guide/index.rst b/doc/guides/prog_guide/index.rst
index 2dce507f46a3..b440c77c2ba1 100644
--- a/doc/guides/prog_guide/index.rst
+++ b/doc/guides/prog_guide/index.rst
@@ -43,6 +43,7 @@ Programmer's Guide
     ip_fragment_reassembly_lib
     generic_receive_offload_lib
     generic_segmentation_offload_lib
+    pcapng_lib
     pdump_lib
     multi_proc_support
     kernel_nic_interface
diff --git a/doc/guides/prog_guide/pcapng_lib.rst b/doc/guides/prog_guide/pcapng_lib.rst
new file mode 100644
index 000000000000..36379b530a57
--- /dev/null
+++ b/doc/guides/prog_guide/pcapng_lib.rst
@@ -0,0 +1,24 @@
+..  SPDX-License-Identifier: BSD-3-Clause
+    Copyright(c) 2016 Intel Corporation.
+
+.. _pcapng_library:
+
+Packet Capture File Writer
+==========================
+
+Pcapng is a library for creating files in Pcapng file format.
+The Pcapng file format is the default capture file format for modern
+network capture processing tools. It can be read by wireshark and tcpdump.
+
+Usage
+-----
+
+Before the library can be used the function ``rte_pcapng_init``
+should be called once to initialize timestamp computation.
+
+
+References
+----------
+* Draft RFC https://www.ietf.org/id/draft-tuexen-opsawg-pcapng-03.html
+
+* Project repository  https://github.com/pcapng/pcapng/
diff --git a/doc/guides/prog_guide/pdump_lib.rst b/doc/guides/prog_guide/pdump_lib.rst
index 62c0b015b2fe..9af91415e5ea 100644
--- a/doc/guides/prog_guide/pdump_lib.rst
+++ b/doc/guides/prog_guide/pdump_lib.rst
@@ -3,10 +3,10 @@
 
 .. _pdump_library:
 
-The librte_pdump Library
-========================
+The Packet Capture Library
+==========================
 
-The ``librte_pdump`` library provides a framework for packet capturing in DPDK.
+The DPDK ``pdump`` library provides a framework for packet capturing in DPDK.
 The library does the complete copy of the Rx and Tx mbufs to a new mempool and
 hence it slows down the performance of the applications, so it is recommended
 to use this library for debugging purposes.
@@ -23,11 +23,19 @@ or disable the packet capture, and to uninitialize it.
 
 * ``rte_pdump_enable()``:
   This API enables the packet capture on a given port and queue.
-  Note: The filter option in the API is a place holder for future enhancements.
+
+* ``rte_pdump_enable_bpf()``
+  This API enables the packet capture on a given port and queue.
+  It also allows setting an optional filter using DPDK BPF interpreter and
+  setting the captured packet length.
 
 * ``rte_pdump_enable_by_deviceid()``:
   This API enables the packet capture on a given device id (``vdev name or pci address``) and queue.
-  Note: The filter option in the API is a place holder for future enhancements.
+
+* ``rte_pdump_enable_bpf_by_deviceid()``
+  This API enables the packet capture on a given device id (``vdev name or pci address``) and queue.
+  It also allows seating an optional filter using DPDK BPF interpreter and
+  setting the captured packet length.
 
 * ``rte_pdump_disable()``:
   This API disables the packet capture on a given port and queue.
@@ -61,6 +69,12 @@ and enables the packet capture by registering the Ethernet RX and TX callbacks f
 and queue combinations. Then the primary process will mirror the packets to the new mempool and enqueue them to
 the rte_ring that secondary process have passed to these APIs.
 
+The packet ring supports one of two formats. The default format enqueues copies of the original packets
+into the rte_ring. If the ``RTE_PDUMP_FLAG_PCAPNG`` is set the mbuf data is extended with header and trailer
+to match the format of Pcapng enhanced packet block. The enhanced packet block has meta-data such as the
+timestamp, port and queue the packet was captured on. It is up to the application consuming the
+packets from the ring to select the format desired.
+
 The library APIs ``rte_pdump_disable()`` and ``rte_pdump_disable_by_deviceid()`` disables the packet capture.
 For the calls to these APIs from secondary process, the library creates the "pdump disable" request and sends
 the request to the primary process over the multi process channel. The primary process takes this request and
@@ -74,5 +88,5 @@ function.
 Use Case: Packet Capturing
 --------------------------
 
-The DPDK ``app/pdump`` tool is developed based on this library to capture packets in DPDK.
-Users can use this as an example to develop their own packet capturing tools.
+The DPDK ``app/dpdk-dumpcap`` utility uses this library
+to capture packets in DPDK.
diff --git a/doc/guides/rel_notes/release_21_11.rst b/doc/guides/rel_notes/release_21_11.rst
index 675b5738348b..ee24cbfdb99d 100644
--- a/doc/guides/rel_notes/release_21_11.rst
+++ b/doc/guides/rel_notes/release_21_11.rst
@@ -62,6 +62,16 @@ New Features
   * Added bus-level parsing of the devargs syntax.
   * Kept compatibility with the legacy syntax as parsing fallback.
 
+* **Enhance Packet capture.**
+
+  * New dpdk-dumpcap program that has most of the features of the
+    wireshark dumpcap utility including capture of multiple interfaces,
+    stopping after number of bytes, packets.
+  * New library for writing pcapng packet capture files.
+  * Enhancement to the pdump library to support:
+    * Packet filter with BPF.
+    * Pcapng format with timestamps and meta-data.
+    * Fixes packet capture with stripped VLAN tags.
 
 Removed Items
 -------------
diff --git a/doc/guides/tools/dumpcap.rst b/doc/guides/tools/dumpcap.rst
new file mode 100644
index 000000000000..664ea0c79802
--- /dev/null
+++ b/doc/guides/tools/dumpcap.rst
@@ -0,0 +1,86 @@
+..  SPDX-License-Identifier: BSD-3-Clause
+    Copyright(c) 2020 Microsoft Corporation.
+
+.. _dumpcap_tool:
+
+dpdk-dumpcap Application
+========================
+
+The ``dpdk-dumpcap`` tool is a Data Plane Development Kit (DPDK)
+network traffic dump tool.  The interface is similar to  the dumpcap tool in Wireshark.
+It runs as a secondary DPDK process and lets you capture packets that are
+coming into and out of a DPDK primary process.
+The ``dpdk-dumpcap`` writes files in Pcapng packet format using
+capture file format is pcapng.
+
+Without any options set it will use DPDK to capture traffic from the first
+available DPDK interface and write the received raw packet data, along
+with timestamps into a pcapng file.
+
+If the ``-w`` option is not specified, ``dpdk-dumpcap`` writes to a newly
+create file with a name chosen based on interface name and timestamp.
+If ``-w`` option is specified, then that file is used.
+
+   .. Note::
+      * The ``dpdk-dumpcap`` tool can only be used in conjunction with a primary
+        application which has the packet capture framework initialized already.
+        In dpdk, only the ``testpmd`` is modified to initialize packet capture
+        framework, other applications remain untouched. So, if the ``dpdk-dumpcap``
+        tool has to be used with any application other than the testpmd, user
+        needs to explicitly modify that application to call packet capture
+        framework initialization code. Refer ``app/test-pmd/testpmd.c``
+        code to see how this is done.
+
+      * The ``dpdk-dumpcap`` tool runs as a DPDK secondary process. It exits when
+        the primary application exits.
+
+
+Running the Application
+-----------------------
+
+To list interfaces available for capture use ``--list-interfaces``.
+
+To filter packets in style of *tshark* use the ``-f`` flag.
+
+To capture on multiple interfaces at once, use multiple ``-I`` flags.
+
+Example
+-------
+
+.. code-block:: console
+
+   # ./<build_dir>/app/dpdk-dumpcap --list-interfaces
+   0. 000:00:03.0
+   1. 000:00:03.1
+
+   # ./<build_dir>/app/dpdk-dumpcap -I 0000:00:03.0 -c 6 -w /tmp/sample.pcapng
+   Packets captured: 6
+   Packets received/dropped on interface '0000:00:03.0' 6/0
+
+   # ./<build_dir>/app/dpdk-dumpcap -f 'tcp port 80'
+   Packets captured: 6
+   Packets received/dropped on interface '0000:00:03.0' 10/8
+
+
+Limitations
+-----------
+The following option of Wireshark ``dumpcap`` is not yet implemented:
+
+   * ``-b|--ring-buffer`` -- more complex file management.
+
+The following options do not make sense in the context of DPDK.
+
+   * ``-C <byte_limit>`` -- its a kernel thing
+
+   * ``-t`` -- use a thread per interface
+
+   * Timestamp type.
+
+   * Link data types. Only EN10MB (Ethernet) is supported.
+
+   * Wireless related options:  ``-I|--monitor-mode`` and  ``-k <freq>``
+
+
+.. Note::
+   * The options to ``dpdk-dumpcap`` are like the Wireshark dumpcap program and
+     are not the same as ``dpdk-pdump`` and other DPDK applications.
diff --git a/doc/guides/tools/index.rst b/doc/guides/tools/index.rst
index 93dde4148e90..b71c12b8f2dd 100644
--- a/doc/guides/tools/index.rst
+++ b/doc/guides/tools/index.rst
@@ -8,6 +8,7 @@ DPDK Tools User Guides
     :maxdepth: 2
     :numbered:
 
+    dumpcap
     proc_info
     pdump
     pmdinfo
-- 
2.30.2


^ permalink raw reply	[relevance 1%]

* Re: [dpdk-dev] [PATCH] net: promote make rarp packet API as stable
  2021-09-08 10:59  3% [dpdk-dev] [PATCH] net: promote make rarp packet API as stable Xiao Wang
@ 2021-09-08  4:52  0% ` Stephen Hemminger
  2021-09-08  5:07  0% ` Xia, Chenbo
  2021-09-16 11:38  0% ` Olivier Matz
  2 siblings, 0 replies; 200+ results
From: Stephen Hemminger @ 2021-09-08  4:52 UTC (permalink / raw)
  To: Xiao Wang; +Cc: olivier.matz, dev

On Wed,  8 Sep 2021 18:59:15 +0800
Xiao Wang <xiao.w.wang@intel.com> wrote:

> rte_net_make_rarp_packet was introduced in version v18.02, there was no
> change in this public API since then, and it's still being used by vhost
> lib and virtio driver, so promote it as stable ABI.
> 
> Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>

Acked-by: Stephen Hemminger <stephen@networkplumber.org>

^ permalink raw reply	[relevance 0%]

* Re: [dpdk-dev] [PATCH] net: promote make rarp packet API as stable
  2021-09-08 10:59  3% [dpdk-dev] [PATCH] net: promote make rarp packet API as stable Xiao Wang
  2021-09-08  4:52  0% ` Stephen Hemminger
@ 2021-09-08  5:07  0% ` Xia, Chenbo
  2021-09-16 11:38  0% ` Olivier Matz
  2 siblings, 0 replies; 200+ results
From: Xia, Chenbo @ 2021-09-08  5:07 UTC (permalink / raw)
  To: Wang, Xiao W, olivier.matz; +Cc: dev

> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Xiao Wang
> Sent: Wednesday, September 8, 2021 6:59 PM
> To: olivier.matz@6wind.com
> Cc: dev@dpdk.org; Wang, Xiao W <xiao.w.wang@intel.com>
> Subject: [dpdk-dev] [PATCH] net: promote make rarp packet API as stable
> 
> rte_net_make_rarp_packet was introduced in version v18.02, there was no
> change in this public API since then, and it's still being used by vhost
> lib and virtio driver, so promote it as stable ABI.
> 
> Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
> ---
>  lib/net/rte_arp.h   | 4 ----
>  lib/net/version.map | 2 +-
>  2 files changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/lib/net/rte_arp.h b/lib/net/rte_arp.h
> index feb0eb3e49..076c8ab314 100644
> --- a/lib/net/rte_arp.h
> +++ b/lib/net/rte_arp.h
> @@ -50,9 +50,6 @@ struct rte_arp_hdr {
>  } __rte_packed __rte_aligned(2);
> 
>  /**
> - * @warning
> - * @b EXPERIMENTAL: this API may change without prior notice
> - *
>   * Make a RARP packet based on MAC addr.
>   *
>   * @param mpool
> @@ -63,7 +60,6 @@ struct rte_arp_hdr {
>   * @return
>   *   - RARP packet pointer on success, or NULL on error
>   */
> -__rte_experimental
>  struct rte_mbuf *
>  rte_net_make_rarp_packet(struct rte_mempool *mpool,
>  		const struct rte_ether_addr *mac);
> diff --git a/lib/net/version.map b/lib/net/version.map
> index 355b7c25b4..7584018d58 100644
> --- a/lib/net/version.map
> +++ b/lib/net/version.map
> @@ -6,6 +6,7 @@ DPDK_22 {
>  	rte_net_crc_calc;
>  	rte_net_crc_set_alg;
>  	rte_net_get_ptype;
> +	rte_net_make_rarp_packet;
> 
>  	local: *;
>  };
> @@ -13,7 +14,6 @@ DPDK_22 {
>  EXPERIMENTAL {
>  	global:
> 
> -	rte_net_make_rarp_packet;
>  	rte_net_skip_ip6_ext;
>  	rte_ether_unformat_addr;
>  };
> --
> 2.15.1

Acked-by: Chenbo Xia <chenbo.xia@intel.com>

^ permalink raw reply	[relevance 0%]

* Re: [dpdk-dev] [EXT] [PATCH] crypto/dpaa_sec: update release notes
  2021-09-07 19:15  3% ` [dpdk-dev] [EXT] " Akhil Goyal
@ 2021-09-08  7:02  0%   ` Hemant Agrawal
  0 siblings, 0 replies; 200+ results
From: Hemant Agrawal @ 2021-09-08  7:02 UTC (permalink / raw)
  To: Akhil Goyal, Hemant Agrawal; +Cc: dev


On 9/8/2021 12:45 AM, Akhil Goyal wrote:
>> Update the release notes in DPAAx for the changes in recent patches.
>>
>> Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
>> ---
>>   doc/guides/rel_notes/release_21_11.rst | 4 ++++
>>   1 file changed, 4 insertions(+)
>>
>> diff --git a/doc/guides/rel_notes/release_21_11.rst
>> b/doc/guides/rel_notes/release_21_11.rst
>> index 0afd21812f..c747a0fb11 100644
>> --- a/doc/guides/rel_notes/release_21_11.rst
>> +++ b/doc/guides/rel_notes/release_21_11.rst
>> @@ -75,10 +75,14 @@ New Features
>>   * **Updated NXP dpaa2_sec crypto PMD.**
>>
>>     * Added raw vector datapath API support
>> +  * Added PDCP short MAC-I support
>>
>>   * **Updated NXP dpaa_sec crypto PMD.**
>>
>>     * Added raw vector datapath API support
>> +  * Added PDCP short MAC-I support
>> +  * Added non-HMAC, DES, AES-XCBC and AES-CMAC algo support
>> +
>>
> Please send a next version for each of the series including each of the
> Item separately in the release notes.
> For example, DES-CBC patch will have update in release notes only for it
> Subsequently for others also.
> Please also remove entry from deprecation notices and subsequently update
> the release notes ABI changes section done in a particular patch.
>
> I tried splitting it, but it would also need changes in deprecation notices.
> Please rebase the 3 series in following order (as for 3rd series I am waiting for review from Intel)
> 1. Algo support in dpaaX
> 2. short MAC
> 3. raw crypto
ok
>

^ permalink raw reply	[relevance 0%]

* [dpdk-dev] [PATCH 1/3] security: add option to configure tunnel header verification
  @ 2021-09-08  8:21  5% ` Tejasree Kondoj
  2021-09-08  7:46  0%   ` Hemant Agrawal
  2021-09-08 10:42  3%   ` Akhil Goyal
  0 siblings, 2 replies; 200+ results
From: Tejasree Kondoj @ 2021-09-08  8:21 UTC (permalink / raw)
  To: Akhil Goyal, Radu Nicolau, Declan Doherty
  Cc: Tejasree Kondoj, Anoob Joseph, Ankur Dwivedi, Jerin Jacob,
	Konstantin Ananyev, Ciara Power, Hemant Agrawal, Gagandeep Singh,
	Fan Zhang, Archana Muniganti, dev

Add option to indicate whether outer header verification
need to be done as part of inbound IPsec processing.

With inline IPsec processing, SA lookup would be happening
in the Rx path of rte_ethdev. When rte_flow is configured to
support more than one SA, SPI would be used to lookup SA.
In such cases, additional verification would be required to
ensure duplicate SPIs are not getting processed in the inline path.

For lookaside cases, the same option can be used by application
to offload tunnel verification to the PMD.

These verifications would help in averting possible DoS attacks.

Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
---
 doc/guides/rel_notes/release_21_11.rst |  5 +++++
 lib/security/rte_security.h            | 17 +++++++++++++++++
 2 files changed, 22 insertions(+)

diff --git a/doc/guides/rel_notes/release_21_11.rst b/doc/guides/rel_notes/release_21_11.rst
index 0e3ed28378..b0606cb542 100644
--- a/doc/guides/rel_notes/release_21_11.rst
+++ b/doc/guides/rel_notes/release_21_11.rst
@@ -136,6 +136,11 @@ ABI Changes
     soft and hard SA expiry limits. Limits can be either in units of packets or
     bytes.
 
+* security: add IPsec SA option to configure tunnel header verification
+
+  * Added SA option to indicate whether outer header verification need to be
+    done as part of inbound IPsec processing.
+
 
 Known Issues
 ------------
diff --git a/lib/security/rte_security.h b/lib/security/rte_security.h
index 95c169d6cf..2a61cad885 100644
--- a/lib/security/rte_security.h
+++ b/lib/security/rte_security.h
@@ -55,6 +55,14 @@ enum rte_security_ipsec_tunnel_type {
 	/**< Outer header is IPv6 */
 };
 
+/**
+ * IPSEC tunnel header verification mode
+ *
+ * Controls how outer IP header is verified in inbound.
+ */
+#define RTE_SECURITY_IPSEC_TUNNEL_VERIFY_DST_ADDR     0x1
+#define RTE_SECURITY_IPSEC_TUNNEL_VERIFY_SRC_DST_ADDR 0x2
+
 /**
  * Security context for crypto/eth devices
  *
@@ -195,6 +203,15 @@ struct rte_security_ipsec_sa_options {
 	 * by the PMD.
 	 */
 	uint32_t iv_gen_disable : 1;
+
+	/** Verify tunnel header in inbound
+	 * * ``RTE_SECURITY_IPSEC_TUNNEL_VERIFY_DST_ADDR``: Verify destination
+	 *   IP address.
+	 *
+	 * * ``RTE_SECURITY_IPSEC_TUNNEL_VERIFY_SRC_DST_ADDR``: Verify both
+	 *   source and destination IP addresses.
+	 */
+	uint32_t tunnel_hdr_verify : 2;
 };
 
 /** IPSec security association direction */
-- 
2.27.0


^ permalink raw reply	[relevance 5%]

* [dpdk-dev] [PATCH 1/3] security: add option to configure UDP ports verification
  @ 2021-09-08  8:25  5% ` Tejasree Kondoj
  2021-09-08  7:42  0%   ` Hemant Agrawal
  0 siblings, 1 reply; 200+ results
From: Tejasree Kondoj @ 2021-09-08  8:25 UTC (permalink / raw)
  To: Akhil Goyal, Radu Nicolau, Declan Doherty
  Cc: Tejasree Kondoj, Anoob Joseph, Ankur Dwivedi, Jerin Jacob,
	Konstantin Ananyev, Ciara Power, Hemant Agrawal, Gagandeep Singh,
	Fan Zhang, Archana Muniganti, dev

Add option to indicate whether UDP encapsulation ports
verification need to be done as part of inbound
IPsec processing.

Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
---
 doc/guides/rel_notes/release_21_11.rst | 5 +++++
 lib/security/rte_security.h            | 7 +++++++
 2 files changed, 12 insertions(+)

diff --git a/doc/guides/rel_notes/release_21_11.rst b/doc/guides/rel_notes/release_21_11.rst
index b0606cb542..afeba0105b 100644
--- a/doc/guides/rel_notes/release_21_11.rst
+++ b/doc/guides/rel_notes/release_21_11.rst
@@ -141,6 +141,11 @@ ABI Changes
   * Added SA option to indicate whether outer header verification need to be
     done as part of inbound IPsec processing.
 
+* security: add IPsec SA option to configure UDP ports verification
+
+  * Added SA option to indicate whether UDP ports verification need to be
+    done as part of inbound IPsec processing.
+
 
 Known Issues
 ------------
diff --git a/lib/security/rte_security.h b/lib/security/rte_security.h
index 2a61cad885..18b0f02c44 100644
--- a/lib/security/rte_security.h
+++ b/lib/security/rte_security.h
@@ -139,6 +139,13 @@ struct rte_security_ipsec_sa_options {
 	 */
 	uint32_t udp_encap : 1;
 
+	/** Verify UDP encapsulation ports in inbound
+	 *
+	 * * 1: Match UDP source and destination ports
+	 * * 0: Do not match UDP ports
+	 */
+	uint32_t udp_ports_verify : 1;
+
 	/** Copy DSCP bits
 	 *
 	 * * 1: Copy IPv4 or IPv6 DSCP bits from inner IP header to
-- 
2.27.0


^ permalink raw reply	[relevance 5%]

* Re: [dpdk-dev] [PATCH 1/3] security: add option to configure UDP ports verification
  2021-09-08  8:25  5% ` [dpdk-dev] [PATCH 1/3] security: " Tejasree Kondoj
@ 2021-09-08  7:42  0%   ` Hemant Agrawal
  0 siblings, 0 replies; 200+ results
From: Hemant Agrawal @ 2021-09-08  7:42 UTC (permalink / raw)
  To: Tejasree Kondoj, Akhil Goyal, Radu Nicolau, Declan Doherty
  Cc: Anoob Joseph, Ankur Dwivedi, Jerin Jacob, Konstantin Ananyev,
	Ciara Power, Hemant Agrawal, Gagandeep Singh, Fan Zhang,
	Archana Muniganti, dev


On 9/8/2021 1:55 PM, Tejasree Kondoj wrote:
> Add option to indicate whether UDP encapsulation ports
> verification need to be done as part of inbound
> IPsec processing.
>
> Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>

Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>


> ---
>   doc/guides/rel_notes/release_21_11.rst | 5 +++++
>   lib/security/rte_security.h            | 7 +++++++
>   2 files changed, 12 insertions(+)
>
> diff --git a/doc/guides/rel_notes/release_21_11.rst b/doc/guides/rel_notes/release_21_11.rst
> index b0606cb542..afeba0105b 100644
> --- a/doc/guides/rel_notes/release_21_11.rst
> +++ b/doc/guides/rel_notes/release_21_11.rst
> @@ -141,6 +141,11 @@ ABI Changes
>     * Added SA option to indicate whether outer header verification need to be
>       done as part of inbound IPsec processing.
>   
> +* security: add IPsec SA option to configure UDP ports verification
> +
> +  * Added SA option to indicate whether UDP ports verification need to be
> +    done as part of inbound IPsec processing.
> +
>   
>   Known Issues
>   ------------
> diff --git a/lib/security/rte_security.h b/lib/security/rte_security.h
> index 2a61cad885..18b0f02c44 100644
> --- a/lib/security/rte_security.h
> +++ b/lib/security/rte_security.h
> @@ -139,6 +139,13 @@ struct rte_security_ipsec_sa_options {
>   	 */
>   	uint32_t udp_encap : 1;
>   
> +	/** Verify UDP encapsulation ports in inbound
> +	 *
> +	 * * 1: Match UDP source and destination ports
> +	 * * 0: Do not match UDP ports
> +	 */
> +	uint32_t udp_ports_verify : 1;
> +
>   	/** Copy DSCP bits
>   	 *
>   	 * * 1: Copy IPv4 or IPv6 DSCP bits from inner IP header to

^ permalink raw reply	[relevance 0%]

* Re: [dpdk-dev] [PATCH v3] eventdev: update crypto adapter metadata structures
  2021-09-07 17:30  0%       ` Gujjar, Abhinandan S
@ 2021-09-08  7:42  0%         ` Shijith Thotton
  2021-09-08  7:53  0%           ` Gujjar, Abhinandan S
  0 siblings, 1 reply; 200+ results
From: Shijith Thotton @ 2021-09-08  7:42 UTC (permalink / raw)
  To: Gujjar, Abhinandan S, dev
  Cc: Jerin Jacob Kollanukkaran, Anoob Joseph,
	Pavan Nikhilesh Bhagavatula, Akhil Goyal, Ray Kinsella,
	Ankur Dwivedi

>>
>> >> In crypto adapter metadata, reserved bytes in request info structure
>> >> is a space holder for response info. It enforces an order of
>> >> operation if the structures are updated using memcpy to avoid
>> >> overwriting response info. It is logical to move the reserved space
>> >> out of request info. It also solves the ordering issue mentioned before.
>> >I would like to understand what kind of ordering issue you have faced
>> >with the current approach. Could you please give an example/sequence
>> and explain?
>> >
>>
>> I have seen this issue with crypto adapter autotest (#n215).
>>
>> Example:
>> rte_memcpy(&m_data.response_info, &response_info,
>> sizeof(response_info)); rte_memcpy(&m_data.request_info,
>> &request_info, sizeof(request_info));
>>
>> Here response info is getting overwritten by request info.
>> Above lines can reordered to fix the issue, but can be ignored with this patch.
>There is a reason for designing the metadata in this way.
>Right now, sizeof (union rte_event_crypto_metadata) is 16 bytes.
>So, the session based case needs just 16 bytes to store the data.
>Whereas, for sessionless case each crypto_ops requires another 16 bytes.
>
>By changing the struct in the following way you are doubling the memory
>requirement.
>With the changes, for sessionless case, each crypto op requires 32 bytes of space
>instead of 16 bytes and the mempool will be bigger.
>This will have the perf impact too!
>
>You can just copy the individual members(cdev_id & queue_pair_id) after the
>response_info.
>OR You have a better way?
>
 
I missed the second word of event structure. It adds an extra 8 bytes, which is not required.
Let me know, what you think of below change to metadata structure.

struct rte_event_crypto_metadata {
	uint64_t response_info; // 8 bytes
	struct rte_event_crypto_request request_info; // 8 bytes
};

Total structure size is 16 bytes.

Response info can be set like below in test app:
	m_data.response_info = response_info.event;

The main aim of this patch is to decouple response info from request info.

>>
>> >>
>> >> This patch removes the reserve field from request info and makes
>> >> event crypto metadata type to structure from union to make space for
>> >> response info.
>> >>
>> >> App and drivers are updated as per metadata change.
>> >>
>> >> Signed-off-by: Shijith Thotton <sthotton@marvell.com>
>> >> Acked-by: Anoob Joseph <anoobj@marvell.com>
>> >> ---
>> >> v3:
>> >> * Updated ABI section of release notes.
>> >>
>> >> v2:
>> >> * Updated deprecation notice.
>> >>
>> >> v1:
>> >> * Rebased.
>> >>
>> >>  app/test/test_event_crypto_adapter.c              | 14 +++++++-------
>> >>  doc/guides/rel_notes/deprecation.rst              |  6 ------
>> >>  doc/guides/rel_notes/release_21_11.rst            |  2 ++
>> >>  drivers/crypto/octeontx/otx_cryptodev_ops.c       |  8 ++++----
>> >>  drivers/crypto/octeontx2/otx2_cryptodev_ops.c     |  4 ++--
>> >>  .../event/octeontx2/otx2_evdev_crypto_adptr_tx.h  |  4 ++--
>> >>  lib/eventdev/rte_event_crypto_adapter.c           |  8 ++++----
>> >>  lib/eventdev/rte_event_crypto_adapter.h           | 15 +++++----------
>> >>  8 files changed, 26 insertions(+), 35 deletions(-)
>> >>
>> >> diff --git a/app/test/test_event_crypto_adapter.c
>> >> b/app/test/test_event_crypto_adapter.c
>> >> index 3ad20921e2..0d73694d3a 100644
>> >> --- a/app/test/test_event_crypto_adapter.c
>> >> +++ b/app/test/test_event_crypto_adapter.c
>> >> @@ -168,7 +168,7 @@ test_op_forward_mode(uint8_t session_less)  {
>> >>  	struct rte_crypto_sym_xform cipher_xform;
>> >>  	struct rte_cryptodev_sym_session *sess;
>> >> -	union rte_event_crypto_metadata m_data;
>> >> +	struct rte_event_crypto_metadata m_data;
>> >>  	struct rte_crypto_sym_op *sym_op;
>> >>  	struct rte_crypto_op *op;
>> >>  	struct rte_mbuf *m;
>> >> @@ -368,7 +368,7 @@ test_op_new_mode(uint8_t session_less)  {
>> >>  	struct rte_crypto_sym_xform cipher_xform;
>> >>  	struct rte_cryptodev_sym_session *sess;
>> >> -	union rte_event_crypto_metadata m_data;
>> >> +	struct rte_event_crypto_metadata m_data;
>> >>  	struct rte_crypto_sym_op *sym_op;
>> >>  	struct rte_crypto_op *op;
>> >>  	struct rte_mbuf *m;
>> >> @@ -406,7 +406,7 @@ test_op_new_mode(uint8_t session_less)
>> >>  		if (cap &
>> >> RTE_EVENT_CRYPTO_ADAPTER_CAP_SESSION_PRIVATE_DATA) {
>> >>  			/* Fill in private user data information */
>> >>  			rte_memcpy(&m_data.response_info,
>> &response_info,
>> >> -				   sizeof(m_data));
>> >> +				   sizeof(response_info));
>> >>  			rte_cryptodev_sym_session_set_user_data(sess,
>> >>  						&m_data, sizeof(m_data));
>> >>  		}
>> >> @@ -426,7 +426,7 @@ test_op_new_mode(uint8_t session_less)
>> >>  		op->private_data_offset = len;
>> >>  		/* Fill in private data information */
>> >>  		rte_memcpy(&m_data.response_info, &response_info,
>> >> -			   sizeof(m_data));
>> >> +			   sizeof(response_info));
>> >>  		rte_memcpy((uint8_t *)op + len, &m_data, sizeof(m_data));
>> >>  	}
>> >>
>> >> @@ -519,7 +519,7 @@ configure_cryptodev(void)
>> >>  			DEFAULT_NUM_XFORMS *
>> >>  			sizeof(struct rte_crypto_sym_xform) +
>> >>  			MAXIMUM_IV_LENGTH +
>> >> -			sizeof(union rte_event_crypto_metadata),
>> >> +			sizeof(struct rte_event_crypto_metadata),
>> >>  			rte_socket_id());
>> >>  	if (params.op_mpool == NULL) {
>> >>  		RTE_LOG(ERR, USER1, "Can't create CRYPTO_OP_POOL\n");
>> @@ -549,12
>> >> +549,12 @@ configure_cryptodev(void)
>> >>  	 * to include the session headers & private data
>> >>  	 */
>> >>  	session_size =
>> >> rte_cryptodev_sym_get_private_session_size(TEST_CDEV_ID);
>> >> -	session_size += sizeof(union rte_event_crypto_metadata);
>> >> +	session_size += sizeof(struct rte_event_crypto_metadata);
>> >>
>> >>  	params.session_mpool = rte_cryptodev_sym_session_pool_create(
>> >>  			"CRYPTO_ADAPTER_SESSION_MP",
>> >>  			MAX_NB_SESSIONS, 0, 0,
>> >> -			sizeof(union rte_event_crypto_metadata),
>> >> +			sizeof(struct rte_event_crypto_metadata),
>> >>  			SOCKET_ID_ANY);
>> >>  	TEST_ASSERT_NOT_NULL(params.session_mpool,
>> >>  			"session mempool allocation failed\n"); diff --git
>> >> a/doc/guides/rel_notes/deprecation.rst
>> >> b/doc/guides/rel_notes/deprecation.rst
>> >> index 76a4abfd6b..58ee95c020 100644
>> >> --- a/doc/guides/rel_notes/deprecation.rst
>> >> +++ b/doc/guides/rel_notes/deprecation.rst
>> >> @@ -266,12 +266,6 @@ Deprecation Notices
>> >>    values to the function ``rte_event_eth_rx_adapter_queue_add`` using
>> >>    the structure ``rte_event_eth_rx_adapter_queue_add``.
>> >>
>> >> -* eventdev: Reserved bytes of ``rte_event_crypto_request`` is a
>> >> space holder
>> >> -  for ``response_info``. Both should be decoupled for better clarity.
>> >> -  New space for ``response_info`` can be made by changing
>> >> -  ``rte_event_crypto_metadata`` type to structure from union.
>> >> -  This change is targeted for DPDK 21.11.
>> >> -
>> >>  * metrics: The function ``rte_metrics_init`` will have a non-void return
>> >>    in order to notify errors instead of calling ``rte_exit``.
>> >>
>> >> diff --git a/doc/guides/rel_notes/release_21_11.rst
>> >> b/doc/guides/rel_notes/release_21_11.rst
>> >> index d707a554ef..ab76d5dd55 100644
>> >> --- a/doc/guides/rel_notes/release_21_11.rst
>> >> +++ b/doc/guides/rel_notes/release_21_11.rst
>> >> @@ -100,6 +100,8 @@ ABI Changes
>> >>     Also, make sure to start the actual text at the margin.
>> >>
>> =======================================================
>> >>
>> >> +* eventdev: Modified type of ``union rte_event_crypto_metadata`` to
>> >> +struct and
>> >> +  removed reserved bytes from ``struct rte_event_crypto_request``.
>> >>
>> >>  Known Issues
>> >>  ------------
>> >> diff --git a/drivers/crypto/octeontx/otx_cryptodev_ops.c
>> >> b/drivers/crypto/octeontx/otx_cryptodev_ops.c
>> >> index eac6796cfb..c51be63146 100644
>> >> --- a/drivers/crypto/octeontx/otx_cryptodev_ops.c
>> >> +++ b/drivers/crypto/octeontx/otx_cryptodev_ops.c
>> >> @@ -710,17 +710,17 @@ submit_request_to_sso(struct ssows *ws,
>> >> uintptr_t req,
>> >>  	ssovf_store_pair(add_work, req, ws->grps[rsp_info->queue_id]);  }
>> >>
>> >> -static inline union rte_event_crypto_metadata *
>> >> +static inline struct rte_event_crypto_metadata *
>> >>  get_event_crypto_mdata(struct rte_crypto_op *op)  {
>> >> -	union rte_event_crypto_metadata *ec_mdata;
>> >> +	struct rte_event_crypto_metadata *ec_mdata;
>> >>
>> >>  	if (op->sess_type == RTE_CRYPTO_OP_WITH_SESSION)
>> >>  		ec_mdata = rte_cryptodev_sym_session_get_user_data(
>> >>  							   op->sym->session);
>> >>  	else if (op->sess_type == RTE_CRYPTO_OP_SESSIONLESS &&
>> >>  		 op->private_data_offset)
>> >> -		ec_mdata = (union rte_event_crypto_metadata *)
>> >> +		ec_mdata = (struct rte_event_crypto_metadata *)
>> >>  			((uint8_t *)op + op->private_data_offset);
>> >>  	else
>> >>  		return NULL;
>> >> @@ -731,7 +731,7 @@ get_event_crypto_mdata(struct rte_crypto_op
>> *op)
>> >> uint16_t __rte_hot  otx_crypto_adapter_enqueue(void *port, struct
>> >> rte_crypto_op *op)  {
>> >> -	union rte_event_crypto_metadata *ec_mdata;
>> >> +	struct rte_event_crypto_metadata *ec_mdata;
>> >>  	struct cpt_instance *instance;
>> >>  	struct cpt_request_info *req;
>> >>  	struct rte_event *rsp_info;
>> >> diff --git a/drivers/crypto/octeontx2/otx2_cryptodev_ops.c
>> >> b/drivers/crypto/octeontx2/otx2_cryptodev_ops.c
>> >> index 42100154cd..952d1352f4 100644
>> >> --- a/drivers/crypto/octeontx2/otx2_cryptodev_ops.c
>> >> +++ b/drivers/crypto/octeontx2/otx2_cryptodev_ops.c
>> >> @@ -453,7 +453,7 @@ otx2_ca_enqueue_req(const struct otx2_cpt_qp
>> *qp,
>> >>  		    struct rte_crypto_op *op,
>> >>  		    uint64_t cpt_inst_w7)
>> >>  {
>> >> -	union rte_event_crypto_metadata *m_data;
>> >> +	struct rte_event_crypto_metadata *m_data;
>> >>  	union cpt_inst_s inst;
>> >>  	uint64_t lmt_status;
>> >>
>> >> @@ -468,7 +468,7 @@ otx2_ca_enqueue_req(const struct otx2_cpt_qp
>> *qp,
>> >>  		}
>> >>  	} else if (op->sess_type == RTE_CRYPTO_OP_SESSIONLESS &&
>> >>  		   op->private_data_offset) {
>> >> -		m_data = (union rte_event_crypto_metadata *)
>> >> +		m_data = (struct rte_event_crypto_metadata *)
>> >>  			 ((uint8_t *)op +
>> >>  			  op->private_data_offset);
>> >>  	} else {
>> >> diff --git a/drivers/event/octeontx2/otx2_evdev_crypto_adptr_tx.h
>> >> b/drivers/event/octeontx2/otx2_evdev_crypto_adptr_tx.h
>> >> index ecf7eb9f56..458e8306d7 100644
>> >> --- a/drivers/event/octeontx2/otx2_evdev_crypto_adptr_tx.h
>> >> +++ b/drivers/event/octeontx2/otx2_evdev_crypto_adptr_tx.h
>> >> @@ -16,7 +16,7 @@
>> >>  static inline uint16_t
>> >>  otx2_ca_enq(uintptr_t tag_op, const struct rte_event *ev)  {
>> >> -	union rte_event_crypto_metadata *m_data;
>> >> +	struct rte_event_crypto_metadata *m_data;
>> >>  	struct rte_crypto_op *crypto_op;
>> >>  	struct rte_cryptodev *cdev;
>> >>  	struct otx2_cpt_qp *qp;
>> >> @@ -37,7 +37,7 @@ otx2_ca_enq(uintptr_t tag_op, const struct
>> >> rte_event
>> >> *ev)
>> >>  		qp_id = m_data->request_info.queue_pair_id;
>> >>  	} else if (crypto_op->sess_type == RTE_CRYPTO_OP_SESSIONLESS
>> &&
>> >>  		   crypto_op->private_data_offset) {
>> >> -		m_data = (union rte_event_crypto_metadata *)
>> >> +		m_data = (struct rte_event_crypto_metadata *)
>> >>  			 ((uint8_t *)crypto_op +
>> >>  			  crypto_op->private_data_offset);
>> >>  		cdev_id = m_data->request_info.cdev_id; diff --git
>> >> a/lib/eventdev/rte_event_crypto_adapter.c
>> >> b/lib/eventdev/rte_event_crypto_adapter.c
>> >> index e1d38d383d..6977391ae9 100644
>> >> --- a/lib/eventdev/rte_event_crypto_adapter.c
>> >> +++ b/lib/eventdev/rte_event_crypto_adapter.c
>> >> @@ -333,7 +333,7 @@ eca_enq_to_cryptodev(struct
>> >> rte_event_crypto_adapter *adapter,
>> >>  		 struct rte_event *ev, unsigned int cnt)  {
>> >>  	struct rte_event_crypto_adapter_stats *stats = &adapter-
>> >> >crypto_stats;
>> >> -	union rte_event_crypto_metadata *m_data = NULL;
>> >> +	struct rte_event_crypto_metadata *m_data = NULL;
>> >>  	struct crypto_queue_pair_info *qp_info = NULL;
>> >>  	struct rte_crypto_op *crypto_op;
>> >>  	unsigned int i, n;
>> >> @@ -371,7 +371,7 @@ eca_enq_to_cryptodev(struct
>> >> rte_event_crypto_adapter *adapter,
>> >>  			len++;
>> >>  		} else if (crypto_op->sess_type ==
>> RTE_CRYPTO_OP_SESSIONLESS &&
>> >>  				crypto_op->private_data_offset) {
>> >> -			m_data = (union rte_event_crypto_metadata *)
>> >> +			m_data = (struct rte_event_crypto_metadata *)
>> >>  				 ((uint8_t *)crypto_op +
>> >>  					crypto_op->private_data_offset);
>> >>  			cdev_id = m_data->request_info.cdev_id; @@ -
>> >> 504,7 +504,7 @@ eca_ops_enqueue_burst(struct
>> rte_event_crypto_adapter
>> >> *adapter,
>> >>  		  struct rte_crypto_op **ops, uint16_t num)  {
>> >>  	struct rte_event_crypto_adapter_stats *stats = &adapter-
>> >> >crypto_stats;
>> >> -	union rte_event_crypto_metadata *m_data = NULL;
>> >> +	struct rte_event_crypto_metadata *m_data = NULL;
>> >>  	uint8_t event_dev_id = adapter->eventdev_id;
>> >>  	uint8_t event_port_id = adapter->event_port_id;
>> >>  	struct rte_event events[BATCH_SIZE]; @@ -523,7 +523,7 @@
>> >> eca_ops_enqueue_burst(struct rte_event_crypto_adapter *adapter,
>> >>  					ops[i]->sym->session);
>> >>  		} else if (ops[i]->sess_type ==
>> >> RTE_CRYPTO_OP_SESSIONLESS &&
>> >>  				ops[i]->private_data_offset) {
>> >> -			m_data = (union rte_event_crypto_metadata *)
>> >> +			m_data = (struct rte_event_crypto_metadata *)
>> >>  				 ((uint8_t *)ops[i] +
>> >>  				  ops[i]->private_data_offset);
>> >>  		}
>> >> diff --git a/lib/eventdev/rte_event_crypto_adapter.h
>> >> b/lib/eventdev/rte_event_crypto_adapter.h
>> >> index f8c6cca87c..3c24d9d9df 100644
>> >> --- a/lib/eventdev/rte_event_crypto_adapter.h
>> >> +++ b/lib/eventdev/rte_event_crypto_adapter.h
>> >> @@ -200,11 +200,6 @@ enum rte_event_crypto_adapter_mode {
>> >>   * provide event request information to the adapter.
>> >>   */
>> >>  struct rte_event_crypto_request {
>> >> -	uint8_t resv[8];
>> >> -	/**< Overlaps with first 8 bytes of struct rte_event
>> >> -	 * that encode the response event information. Application
>> >> -	 * is expected to fill in struct rte_event response_info.
>> >> -	 */
>> >>  	uint16_t cdev_id;
>> >>  	/**< cryptodev ID to be used */
>> >>  	uint16_t queue_pair_id;
>> >> @@ -223,16 +218,16 @@ struct rte_event_crypto_request {
>> >>   * operation. If the transfer is done by SW, event response information
>> >>   * will be used by the adapter.
>> >>   */
>> >> -union rte_event_crypto_metadata {
>> >> -	struct rte_event_crypto_request request_info;
>> >> -	/**< Request information to be filled in by application
>> >> -	 * for RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD mode.
>> >> -	 */
>> >> +struct rte_event_crypto_metadata {
>> >>  	struct rte_event response_info;
>> >>  	/**< Response information to be filled in by application
>> >>  	 * for RTE_EVENT_CRYPTO_ADAPTER_OP_NEW and
>> >>  	 * RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD mode.
>> >>  	 */
>> >> +	struct rte_event_crypto_request request_info;
>> >> +	/**< Request information to be filled in by application
>> >> +	 * for RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD mode.
>> >> +	 */
>> >>  };
>> >>
>> >>  /**
>> >> --
>> >> 2.25.1


^ permalink raw reply	[relevance 0%]

* Re: [dpdk-dev] [PATCH 1/3] security: add option to configure tunnel header verification
  2021-09-08  8:21  5% ` [dpdk-dev] [PATCH 1/3] security: " Tejasree Kondoj
@ 2021-09-08  7:46  0%   ` Hemant Agrawal
  2021-09-08 10:42  3%   ` Akhil Goyal
  1 sibling, 0 replies; 200+ results
From: Hemant Agrawal @ 2021-09-08  7:46 UTC (permalink / raw)
  To: dev


On 9/8/2021 1:51 PM, Tejasree Kondoj wrote:
> Add option to indicate whether outer header verification
> need to be done as part of inbound IPsec processing.
>
> With inline IPsec processing, SA lookup would be happening
> in the Rx path of rte_ethdev. When rte_flow is configured to
> support more than one SA, SPI would be used to lookup SA.
> In such cases, additional verification would be required to
> ensure duplicate SPIs are not getting processed in the inline path.
>
> For lookaside cases, the same option can be used by application
> to offload tunnel verification to the PMD.
>
> These verifications would help in averting possible DoS attacks.
>
> Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
> ---
>   doc/guides/rel_notes/release_21_11.rst |  5 +++++
>   lib/security/rte_security.h            | 17 +++++++++++++++++
>   2 files changed, 22 insertions(+)
>
> diff --git a/doc/guides/rel_notes/release_21_11.rst b/doc/guides/rel_notes/release_21_11.rst
> index 0e3ed28378..b0606cb542 100644
> --- a/doc/guides/rel_notes/release_21_11.rst
> +++ b/doc/guides/rel_notes/release_21_11.rst
> @@ -136,6 +136,11 @@ ABI Changes
>       soft and hard SA expiry limits. Limits can be either in units of packets or
>       bytes.
>   
> +* security: add IPsec SA option to configure tunnel header verification
> +
> +  * Added SA option to indicate whether outer header verification need to be
> +    done as part of inbound IPsec processing.
> +
>   
>   Known Issues
>   ------------
> diff --git a/lib/security/rte_security.h b/lib/security/rte_security.h
> index 95c169d6cf..2a61cad885 100644
> --- a/lib/security/rte_security.h
> +++ b/lib/security/rte_security.h
> @@ -55,6 +55,14 @@ enum rte_security_ipsec_tunnel_type {
>   	/**< Outer header is IPv6 */
>   };
>   
> +/**
> + * IPSEC tunnel header verification mode
> + *
> + * Controls how outer IP header is verified in inbound.
> + */
> +#define RTE_SECURITY_IPSEC_TUNNEL_VERIFY_DST_ADDR     0x1
> +#define RTE_SECURITY_IPSEC_TUNNEL_VERIFY_SRC_DST_ADDR 0x2
> +
>   /**
>    * Security context for crypto/eth devices
>    *
> @@ -195,6 +203,15 @@ struct rte_security_ipsec_sa_options {
>   	 * by the PMD.
>   	 */
>   	uint32_t iv_gen_disable : 1;
> +
> +	/** Verify tunnel header in inbound
> +	 * * ``RTE_SECURITY_IPSEC_TUNNEL_VERIFY_DST_ADDR``: Verify destination
> +	 *   IP address.
> +	 *
> +	 * * ``RTE_SECURITY_IPSEC_TUNNEL_VERIFY_SRC_DST_ADDR``: Verify both
> +	 *   source and destination IP addresses.
> +	 */
> +	uint32_t tunnel_hdr_verify : 2;
>   };
>   
>   /** IPSec security association direction */
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>

^ permalink raw reply	[relevance 0%]

* Re: [dpdk-dev] [PATCH v3] eventdev: update crypto adapter metadata structures
  2021-09-08  7:42  0%         ` Shijith Thotton
@ 2021-09-08  7:53  0%           ` Gujjar, Abhinandan S
  2021-09-14  4:36  0%             ` Shijith Thotton
  0 siblings, 1 reply; 200+ results
From: Gujjar, Abhinandan S @ 2021-09-08  7:53 UTC (permalink / raw)
  To: Shijith Thotton, dev
  Cc: Jerin Jacob Kollanukkaran, Anoob Joseph,
	Pavan Nikhilesh Bhagavatula, Akhil Goyal, Ray Kinsella,
	Ankur Dwivedi

Hi Shijith,

> -----Original Message-----
> From: Shijith Thotton <sthotton@marvell.com>
> Sent: Wednesday, September 8, 2021 1:13 PM
> To: Gujjar, Abhinandan S <abhinandan.gujjar@intel.com>; dev@dpdk.org
> Cc: Jerin Jacob Kollanukkaran <jerinj@marvell.com>; Anoob Joseph
> <anoobj@marvell.com>; Pavan Nikhilesh Bhagavatula
> <pbhagavatula@marvell.com>; Akhil Goyal <gakhil@marvell.com>; Ray
> Kinsella <mdr@ashroe.eu>; Ankur Dwivedi <adwivedi@marvell.com>
> Subject: RE: [PATCH v3] eventdev: update crypto adapter metadata
> structures
> 
> >>
> >> >> In crypto adapter metadata, reserved bytes in request info
> >> >> structure is a space holder for response info. It enforces an
> >> >> order of operation if the structures are updated using memcpy to
> >> >> avoid overwriting response info. It is logical to move the
> >> >> reserved space out of request info. It also solves the ordering issue
> mentioned before.
> >> >I would like to understand what kind of ordering issue you have
> >> >faced with the current approach. Could you please give an
> >> >example/sequence
> >> and explain?
> >> >
> >>
> >> I have seen this issue with crypto adapter autotest (#n215).
> >>
> >> Example:
> >> rte_memcpy(&m_data.response_info, &response_info,
> >> sizeof(response_info)); rte_memcpy(&m_data.request_info,
> >> &request_info, sizeof(request_info));
> >>
> >> Here response info is getting overwritten by request info.
> >> Above lines can reordered to fix the issue, but can be ignored with this
> patch.
> >There is a reason for designing the metadata in this way.
> >Right now, sizeof (union rte_event_crypto_metadata) is 16 bytes.
> >So, the session based case needs just 16 bytes to store the data.
> >Whereas, for sessionless case each crypto_ops requires another 16 bytes.
> >
> >By changing the struct in the following way you are doubling the memory
> >requirement.
> >With the changes, for sessionless case, each crypto op requires 32
> >bytes of space instead of 16 bytes and the mempool will be bigger.
> >This will have the perf impact too!
> >
> >You can just copy the individual members(cdev_id & queue_pair_id) after
> >the response_info.
> >OR You have a better way?
> >
> 
> I missed the second word of event structure. It adds an extra 8 bytes, which
> is not required.
I guess you meant not adding, it is overlapping with request information.
> Let me know, what you think of below change to metadata structure.
> 
> struct rte_event_crypto_metadata {
> 	uint64_t response_info; // 8 bytes
With this, it lags clarity saying it is an event information.
> 	struct rte_event_crypto_request request_info; // 8 bytes };
> 
> Total structure size is 16 bytes.
> 
> Response info can be set like below in test app:
> 	m_data.response_info = response_info.event;
> 
> The main aim of this patch is to decouple response info from request info.
The decoupling was required as it was doing memcpy.
If you copy the individual members of request info(after response), you don't require it.
> 
> >>
> >> >>
> >> >> This patch removes the reserve field from request info and makes
> >> >> event crypto metadata type to structure from union to make space
> >> >> for response info.
> >> >>
> >> >> App and drivers are updated as per metadata change.
> >> >>
> >> >> Signed-off-by: Shijith Thotton <sthotton@marvell.com>
> >> >> Acked-by: Anoob Joseph <anoobj@marvell.com>
> >> >> ---
> >> >> v3:
> >> >> * Updated ABI section of release notes.
> >> >>
> >> >> v2:
> >> >> * Updated deprecation notice.
> >> >>
> >> >> v1:
> >> >> * Rebased.
> >> >>
> >> >>  app/test/test_event_crypto_adapter.c              | 14 +++++++-------
> >> >>  doc/guides/rel_notes/deprecation.rst              |  6 ------
> >> >>  doc/guides/rel_notes/release_21_11.rst            |  2 ++
> >> >>  drivers/crypto/octeontx/otx_cryptodev_ops.c       |  8 ++++----
> >> >>  drivers/crypto/octeontx2/otx2_cryptodev_ops.c     |  4 ++--
> >> >>  .../event/octeontx2/otx2_evdev_crypto_adptr_tx.h  |  4 ++--
> >> >>  lib/eventdev/rte_event_crypto_adapter.c           |  8 ++++----
> >> >>  lib/eventdev/rte_event_crypto_adapter.h           | 15 +++++----------
> >> >>  8 files changed, 26 insertions(+), 35 deletions(-)
> >> >>
> >> >> diff --git a/app/test/test_event_crypto_adapter.c
> >> >> b/app/test/test_event_crypto_adapter.c
> >> >> index 3ad20921e2..0d73694d3a 100644
> >> >> --- a/app/test/test_event_crypto_adapter.c
> >> >> +++ b/app/test/test_event_crypto_adapter.c
> >> >> @@ -168,7 +168,7 @@ test_op_forward_mode(uint8_t session_less)
> {
> >> >>  	struct rte_crypto_sym_xform cipher_xform;
> >> >>  	struct rte_cryptodev_sym_session *sess;
> >> >> -	union rte_event_crypto_metadata m_data;
> >> >> +	struct rte_event_crypto_metadata m_data;
> >> >>  	struct rte_crypto_sym_op *sym_op;
> >> >>  	struct rte_crypto_op *op;
> >> >>  	struct rte_mbuf *m;
> >> >> @@ -368,7 +368,7 @@ test_op_new_mode(uint8_t session_less)  {
> >> >>  	struct rte_crypto_sym_xform cipher_xform;
> >> >>  	struct rte_cryptodev_sym_session *sess;
> >> >> -	union rte_event_crypto_metadata m_data;
> >> >> +	struct rte_event_crypto_metadata m_data;
> >> >>  	struct rte_crypto_sym_op *sym_op;
> >> >>  	struct rte_crypto_op *op;
> >> >>  	struct rte_mbuf *m;
> >> >> @@ -406,7 +406,7 @@ test_op_new_mode(uint8_t session_less)
> >> >>  		if (cap &
> >> >> RTE_EVENT_CRYPTO_ADAPTER_CAP_SESSION_PRIVATE_DATA) {
> >> >>  			/* Fill in private user data information */
> >> >>  			rte_memcpy(&m_data.response_info,
> >> &response_info,
> >> >> -				   sizeof(m_data));
> >> >> +				   sizeof(response_info));
> >> >>  			rte_cryptodev_sym_session_set_user_data(sess,
> >> >>  						&m_data, sizeof(m_data));
> >> >>  		}
> >> >> @@ -426,7 +426,7 @@ test_op_new_mode(uint8_t session_less)
> >> >>  		op->private_data_offset = len;
> >> >>  		/* Fill in private data information */
> >> >>  		rte_memcpy(&m_data.response_info, &response_info,
> >> >> -			   sizeof(m_data));
> >> >> +			   sizeof(response_info));
> >> >>  		rte_memcpy((uint8_t *)op + len, &m_data, sizeof(m_data));
> >> >>  	}
> >> >>
> >> >> @@ -519,7 +519,7 @@ configure_cryptodev(void)
> >> >>  			DEFAULT_NUM_XFORMS *
> >> >>  			sizeof(struct rte_crypto_sym_xform) +
> >> >>  			MAXIMUM_IV_LENGTH +
> >> >> -			sizeof(union rte_event_crypto_metadata),
> >> >> +			sizeof(struct rte_event_crypto_metadata),
> >> >>  			rte_socket_id());
> >> >>  	if (params.op_mpool == NULL) {
> >> >>  		RTE_LOG(ERR, USER1, "Can't create CRYPTO_OP_POOL\n");
> >> @@ -549,12
> >> >> +549,12 @@ configure_cryptodev(void)
> >> >>  	 * to include the session headers & private data
> >> >>  	 */
> >> >>  	session_size =
> >> >> rte_cryptodev_sym_get_private_session_size(TEST_CDEV_ID);
> >> >> -	session_size += sizeof(union rte_event_crypto_metadata);
> >> >> +	session_size += sizeof(struct rte_event_crypto_metadata);
> >> >>
> >> >>  	params.session_mpool = rte_cryptodev_sym_session_pool_create(
> >> >>  			"CRYPTO_ADAPTER_SESSION_MP",
> >> >>  			MAX_NB_SESSIONS, 0, 0,
> >> >> -			sizeof(union rte_event_crypto_metadata),
> >> >> +			sizeof(struct rte_event_crypto_metadata),
> >> >>  			SOCKET_ID_ANY);
> >> >>  	TEST_ASSERT_NOT_NULL(params.session_mpool,
> >> >>  			"session mempool allocation failed\n"); diff --git
> >> >> a/doc/guides/rel_notes/deprecation.rst
> >> >> b/doc/guides/rel_notes/deprecation.rst
> >> >> index 76a4abfd6b..58ee95c020 100644
> >> >> --- a/doc/guides/rel_notes/deprecation.rst
> >> >> +++ b/doc/guides/rel_notes/deprecation.rst
> >> >> @@ -266,12 +266,6 @@ Deprecation Notices
> >> >>    values to the function ``rte_event_eth_rx_adapter_queue_add``
> using
> >> >>    the structure ``rte_event_eth_rx_adapter_queue_add``.
> >> >>
> >> >> -* eventdev: Reserved bytes of ``rte_event_crypto_request`` is a
> >> >> space holder
> >> >> -  for ``response_info``. Both should be decoupled for better clarity.
> >> >> -  New space for ``response_info`` can be made by changing
> >> >> -  ``rte_event_crypto_metadata`` type to structure from union.
> >> >> -  This change is targeted for DPDK 21.11.
> >> >> -
> >> >>  * metrics: The function ``rte_metrics_init`` will have a non-void return
> >> >>    in order to notify errors instead of calling ``rte_exit``.
> >> >>
> >> >> diff --git a/doc/guides/rel_notes/release_21_11.rst
> >> >> b/doc/guides/rel_notes/release_21_11.rst
> >> >> index d707a554ef..ab76d5dd55 100644
> >> >> --- a/doc/guides/rel_notes/release_21_11.rst
> >> >> +++ b/doc/guides/rel_notes/release_21_11.rst
> >> >> @@ -100,6 +100,8 @@ ABI Changes
> >> >>     Also, make sure to start the actual text at the margin.
> >> >>
> >> =======================================================
> >> >>
> >> >> +* eventdev: Modified type of ``union rte_event_crypto_metadata``
> >> >> +to struct and
> >> >> +  removed reserved bytes from ``struct rte_event_crypto_request``.
> >> >>
> >> >>  Known Issues
> >> >>  ------------
> >> >> diff --git a/drivers/crypto/octeontx/otx_cryptodev_ops.c
> >> >> b/drivers/crypto/octeontx/otx_cryptodev_ops.c
> >> >> index eac6796cfb..c51be63146 100644
> >> >> --- a/drivers/crypto/octeontx/otx_cryptodev_ops.c
> >> >> +++ b/drivers/crypto/octeontx/otx_cryptodev_ops.c
> >> >> @@ -710,17 +710,17 @@ submit_request_to_sso(struct ssows *ws,
> >> >> uintptr_t req,
> >> >>  	ssovf_store_pair(add_work, req, ws->grps[rsp_info->queue_id]);
> >> >> }
> >> >>
> >> >> -static inline union rte_event_crypto_metadata *
> >> >> +static inline struct rte_event_crypto_metadata *
> >> >>  get_event_crypto_mdata(struct rte_crypto_op *op)  {
> >> >> -	union rte_event_crypto_metadata *ec_mdata;
> >> >> +	struct rte_event_crypto_metadata *ec_mdata;
> >> >>
> >> >>  	if (op->sess_type == RTE_CRYPTO_OP_WITH_SESSION)
> >> >>  		ec_mdata = rte_cryptodev_sym_session_get_user_data(
> >> >>  							   op->sym->session);
> >> >>  	else if (op->sess_type == RTE_CRYPTO_OP_SESSIONLESS &&
> >> >>  		 op->private_data_offset)
> >> >> -		ec_mdata = (union rte_event_crypto_metadata *)
> >> >> +		ec_mdata = (struct rte_event_crypto_metadata *)
> >> >>  			((uint8_t *)op + op->private_data_offset);
> >> >>  	else
> >> >>  		return NULL;
> >> >> @@ -731,7 +731,7 @@ get_event_crypto_mdata(struct rte_crypto_op
> >> *op)
> >> >> uint16_t __rte_hot  otx_crypto_adapter_enqueue(void *port, struct
> >> >> rte_crypto_op *op)  {
> >> >> -	union rte_event_crypto_metadata *ec_mdata;
> >> >> +	struct rte_event_crypto_metadata *ec_mdata;
> >> >>  	struct cpt_instance *instance;
> >> >>  	struct cpt_request_info *req;
> >> >>  	struct rte_event *rsp_info;
> >> >> diff --git a/drivers/crypto/octeontx2/otx2_cryptodev_ops.c
> >> >> b/drivers/crypto/octeontx2/otx2_cryptodev_ops.c
> >> >> index 42100154cd..952d1352f4 100644
> >> >> --- a/drivers/crypto/octeontx2/otx2_cryptodev_ops.c
> >> >> +++ b/drivers/crypto/octeontx2/otx2_cryptodev_ops.c
> >> >> @@ -453,7 +453,7 @@ otx2_ca_enqueue_req(const struct
> otx2_cpt_qp
> >> *qp,
> >> >>  		    struct rte_crypto_op *op,
> >> >>  		    uint64_t cpt_inst_w7)
> >> >>  {
> >> >> -	union rte_event_crypto_metadata *m_data;
> >> >> +	struct rte_event_crypto_metadata *m_data;
> >> >>  	union cpt_inst_s inst;
> >> >>  	uint64_t lmt_status;
> >> >>
> >> >> @@ -468,7 +468,7 @@ otx2_ca_enqueue_req(const struct
> otx2_cpt_qp
> >> *qp,
> >> >>  		}
> >> >>  	} else if (op->sess_type == RTE_CRYPTO_OP_SESSIONLESS &&
> >> >>  		   op->private_data_offset) {
> >> >> -		m_data = (union rte_event_crypto_metadata *)
> >> >> +		m_data = (struct rte_event_crypto_metadata *)
> >> >>  			 ((uint8_t *)op +
> >> >>  			  op->private_data_offset);
> >> >>  	} else {
> >> >> diff --git a/drivers/event/octeontx2/otx2_evdev_crypto_adptr_tx.h
> >> >> b/drivers/event/octeontx2/otx2_evdev_crypto_adptr_tx.h
> >> >> index ecf7eb9f56..458e8306d7 100644
> >> >> --- a/drivers/event/octeontx2/otx2_evdev_crypto_adptr_tx.h
> >> >> +++ b/drivers/event/octeontx2/otx2_evdev_crypto_adptr_tx.h
> >> >> @@ -16,7 +16,7 @@
> >> >>  static inline uint16_t
> >> >>  otx2_ca_enq(uintptr_t tag_op, const struct rte_event *ev)  {
> >> >> -	union rte_event_crypto_metadata *m_data;
> >> >> +	struct rte_event_crypto_metadata *m_data;
> >> >>  	struct rte_crypto_op *crypto_op;
> >> >>  	struct rte_cryptodev *cdev;
> >> >>  	struct otx2_cpt_qp *qp;
> >> >> @@ -37,7 +37,7 @@ otx2_ca_enq(uintptr_t tag_op, const struct
> >> >> rte_event
> >> >> *ev)
> >> >>  		qp_id = m_data->request_info.queue_pair_id;
> >> >>  	} else if (crypto_op->sess_type == RTE_CRYPTO_OP_SESSIONLESS
> >> &&
> >> >>  		   crypto_op->private_data_offset) {
> >> >> -		m_data = (union rte_event_crypto_metadata *)
> >> >> +		m_data = (struct rte_event_crypto_metadata *)
> >> >>  			 ((uint8_t *)crypto_op +
> >> >>  			  crypto_op->private_data_offset);
> >> >>  		cdev_id = m_data->request_info.cdev_id; diff --git
> >> >> a/lib/eventdev/rte_event_crypto_adapter.c
> >> >> b/lib/eventdev/rte_event_crypto_adapter.c
> >> >> index e1d38d383d..6977391ae9 100644
> >> >> --- a/lib/eventdev/rte_event_crypto_adapter.c
> >> >> +++ b/lib/eventdev/rte_event_crypto_adapter.c
> >> >> @@ -333,7 +333,7 @@ eca_enq_to_cryptodev(struct
> >> >> rte_event_crypto_adapter *adapter,
> >> >>  		 struct rte_event *ev, unsigned int cnt)  {
> >> >>  	struct rte_event_crypto_adapter_stats *stats = &adapter-
> >> >> >crypto_stats;
> >> >> -	union rte_event_crypto_metadata *m_data = NULL;
> >> >> +	struct rte_event_crypto_metadata *m_data = NULL;
> >> >>  	struct crypto_queue_pair_info *qp_info = NULL;
> >> >>  	struct rte_crypto_op *crypto_op;
> >> >>  	unsigned int i, n;
> >> >> @@ -371,7 +371,7 @@ eca_enq_to_cryptodev(struct
> >> >> rte_event_crypto_adapter *adapter,
> >> >>  			len++;
> >> >>  		} else if (crypto_op->sess_type ==
> >> RTE_CRYPTO_OP_SESSIONLESS &&
> >> >>  				crypto_op->private_data_offset) {
> >> >> -			m_data = (union rte_event_crypto_metadata *)
> >> >> +			m_data = (struct rte_event_crypto_metadata *)
> >> >>  				 ((uint8_t *)crypto_op +
> >> >>  					crypto_op->private_data_offset);
> >> >>  			cdev_id = m_data->request_info.cdev_id; @@ -
> >> >> 504,7 +504,7 @@ eca_ops_enqueue_burst(struct
> >> rte_event_crypto_adapter
> >> >> *adapter,
> >> >>  		  struct rte_crypto_op **ops, uint16_t num)  {
> >> >>  	struct rte_event_crypto_adapter_stats *stats = &adapter-
> >> >> >crypto_stats;
> >> >> -	union rte_event_crypto_metadata *m_data = NULL;
> >> >> +	struct rte_event_crypto_metadata *m_data = NULL;
> >> >>  	uint8_t event_dev_id = adapter->eventdev_id;
> >> >>  	uint8_t event_port_id = adapter->event_port_id;
> >> >>  	struct rte_event events[BATCH_SIZE]; @@ -523,7 +523,7 @@
> >> >> eca_ops_enqueue_burst(struct rte_event_crypto_adapter *adapter,
> >> >>  					ops[i]->sym->session);
> >> >>  		} else if (ops[i]->sess_type ==
> RTE_CRYPTO_OP_SESSIONLESS &&
> >> >>  				ops[i]->private_data_offset) {
> >> >> -			m_data = (union rte_event_crypto_metadata *)
> >> >> +			m_data = (struct rte_event_crypto_metadata *)
> >> >>  				 ((uint8_t *)ops[i] +
> >> >>  				  ops[i]->private_data_offset);
> >> >>  		}
> >> >> diff --git a/lib/eventdev/rte_event_crypto_adapter.h
> >> >> b/lib/eventdev/rte_event_crypto_adapter.h
> >> >> index f8c6cca87c..3c24d9d9df 100644
> >> >> --- a/lib/eventdev/rte_event_crypto_adapter.h
> >> >> +++ b/lib/eventdev/rte_event_crypto_adapter.h
> >> >> @@ -200,11 +200,6 @@ enum rte_event_crypto_adapter_mode {
> >> >>   * provide event request information to the adapter.
> >> >>   */
> >> >>  struct rte_event_crypto_request {
> >> >> -	uint8_t resv[8];
> >> >> -	/**< Overlaps with first 8 bytes of struct rte_event
> >> >> -	 * that encode the response event information. Application
> >> >> -	 * is expected to fill in struct rte_event response_info.
> >> >> -	 */
> >> >>  	uint16_t cdev_id;
> >> >>  	/**< cryptodev ID to be used */
> >> >>  	uint16_t queue_pair_id;
> >> >> @@ -223,16 +218,16 @@ struct rte_event_crypto_request {
> >> >>   * operation. If the transfer is done by SW, event response
> information
> >> >>   * will be used by the adapter.
> >> >>   */
> >> >> -union rte_event_crypto_metadata {
> >> >> -	struct rte_event_crypto_request request_info;
> >> >> -	/**< Request information to be filled in by application
> >> >> -	 * for RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD mode.
> >> >> -	 */
> >> >> +struct rte_event_crypto_metadata {
> >> >>  	struct rte_event response_info;
> >> >>  	/**< Response information to be filled in by application
> >> >>  	 * for RTE_EVENT_CRYPTO_ADAPTER_OP_NEW and
> >> >>  	 * RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD mode.
> >> >>  	 */
> >> >> +	struct rte_event_crypto_request request_info;
> >> >> +	/**< Request information to be filled in by application
> >> >> +	 * for RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD mode.
> >> >> +	 */
> >> >>  };
> >> >>
> >> >>  /**
> >> >> --
> >> >> 2.25.1


^ permalink raw reply	[relevance 0%]

* Re: [dpdk-dev] [RFC PATCH v5 1/5] sched: add PIE based congestion management
  2021-09-07 19:14  3%     ` Stephen Hemminger
@ 2021-09-08  8:49  3%       ` Liguzinski, WojciechX
  0 siblings, 0 replies; 200+ results
From: Liguzinski, WojciechX @ 2021-09-08  8:49 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: dev, Singh, Jasvinder, Dumitrescu, Cristian, Ajmera, Megha

Thanks Stephen,

I will do my best to apply your comments.

Best Regards,
Wojciech Liguzinski

-----Original Message-----
From: Stephen Hemminger <stephen@networkplumber.org> 
Sent: Tuesday, September 7, 2021 9:15 PM
To: Liguzinski, WojciechX <wojciechx.liguzinski@intel.com>
Cc: dev@dpdk.org; Singh, Jasvinder <jasvinder.singh@intel.com>; Dumitrescu, Cristian <cristian.dumitrescu@intel.com>; Ajmera, Megha <megha.ajmera@intel.com>
Subject: Re: [dpdk-dev] [RFC PATCH v5 1/5] sched: add PIE based congestion management

On Tue,  7 Sep 2021 07:33:24 +0000
"Liguzinski, WojciechX" <wojciechx.liguzinski@intel.com> wrote:

> +/**
> + * @brief make a decision to drop or enqueue a packet based on probability
> + *        criteria
> + *
> + * @param pie_cfg [in] config pointer to a PIE configuration 
> +parameter structure
> + * @param pie [in, out] data pointer to PIE runtime data
> + * @param time [in] current time (measured in cpu cycles)  */ static 
> +inline void __rte_experimental _calc_drop_probability(const struct 
> +rte_pie_config *pie_cfg,
> +	struct rte_pie *pie, uint64_t time)

This code adds a lot of inline functions in the name of performance.
But every inline like this means the internal ABI for the implmentation has to be exposed.

You would probably get a bigger performance bump from not using floating point in the internal math, than the minor performance optimization from having so many inlines.

^ permalink raw reply	[relevance 3%]

* Re: [dpdk-dev] [EXT] Re: [PATCH] RFC: ethdev: add reassembly offload
  2021-09-07  8:47  4% ` Ferruh Yigit
@ 2021-09-08 10:29  0%   ` Anoob Joseph
  2021-09-13  6:56  0%     ` Xu, Rosen
  0 siblings, 1 reply; 200+ results
From: Anoob Joseph @ 2021-09-08 10:29 UTC (permalink / raw)
  To: Ferruh Yigit, Xu, Rosen, Andrew Rybchenko
  Cc: radu.nicolau, declan.doherty, hemant.agrawal, matan,
	konstantin.ananyev, thomas, Ankur Dwivedi, andrew.rybchenko,
	Akhil Goyal, dev

Hi Ferruh, Rosen, Andrew,

Please see inline.

Thanks,
Anoob

> Subject: [EXT] Re: [PATCH] RFC: ethdev: add reassembly offload
> 
> External Email
> 
> ----------------------------------------------------------------------
> On 8/23/2021 11:02 AM, Akhil Goyal wrote:
> > Reassembly is a costly operation if it is done in software, however,
> > if it is offloaded to HW, it can considerably save application cycles.
> > The operation becomes even more costlier if IP fragmants are
> > encrypted.
> >
> > To resolve above two issues, a new offload
> DEV_RX_OFFLOAD_REASSEMBLY
> > is introduced in ethdev for devices which can attempt reassembly of
> > packets in hardware.
> > rte_eth_dev_info is added with the reassembly capabilities which a
> > device can support.
> > Now, if IP fragments are encrypted, reassembly can also be attempted
> > while doing inline IPsec processing.
> > This is controlled by a flag in rte_security_ipsec_sa_options to
> > enable reassembly of encrypted IP fragments in the inline path.
> >
> > The resulting reassembled packet would be a typical segmented mbuf in
> > case of success.
> >
> > And if reassembly of fragments is failed or is incomplete (if
> > fragments do not come before the reass_timeout), the mbuf is updated
> > with an ol_flag PKT_RX_REASSEMBLY_INCOMPLETE and mbuf is returned
> as
> > is. Now application may decide the fate of the packet to wait more for
> > fragments to come or drop.
> >
> > Signed-off-by: Akhil Goyal <gakhil@marvell.com>
> > ---
> >  lib/ethdev/rte_ethdev.c     |  1 +
> >  lib/ethdev/rte_ethdev.h     | 18 +++++++++++++++++-
> >  lib/mbuf/rte_mbuf_core.h    |  3 ++-
> >  lib/security/rte_security.h | 10 ++++++++++
> >  4 files changed, 30 insertions(+), 2 deletions(-)
> >
> > diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c index
> > 9d95cd11e1..1ab3a093cf 100644
> > --- a/lib/ethdev/rte_ethdev.c
> > +++ b/lib/ethdev/rte_ethdev.c
> > @@ -119,6 +119,7 @@ static const struct {
> >  	RTE_RX_OFFLOAD_BIT2STR(VLAN_FILTER),
> >  	RTE_RX_OFFLOAD_BIT2STR(VLAN_EXTEND),
> >  	RTE_RX_OFFLOAD_BIT2STR(JUMBO_FRAME),
> > +	RTE_RX_OFFLOAD_BIT2STR(REASSEMBLY),
> >  	RTE_RX_OFFLOAD_BIT2STR(SCATTER),
> >  	RTE_RX_OFFLOAD_BIT2STR(TIMESTAMP),
> >  	RTE_RX_OFFLOAD_BIT2STR(SECURITY),
> > diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h index
> > d2b27c351f..e89a4dc1eb 100644
> > --- a/lib/ethdev/rte_ethdev.h
> > +++ b/lib/ethdev/rte_ethdev.h
> > @@ -1360,6 +1360,7 @@ struct rte_eth_conf {
> >  #define DEV_RX_OFFLOAD_VLAN_FILTER	0x00000200
> >  #define DEV_RX_OFFLOAD_VLAN_EXTEND	0x00000400
> >  #define DEV_RX_OFFLOAD_JUMBO_FRAME	0x00000800
> > +#define DEV_RX_OFFLOAD_REASSEMBLY	0x00001000
> 
> previous '0x00001000' was 'DEV_RX_OFFLOAD_CRC_STRIP', it has been long
> that offload has been removed, but not sure if it cause any problem to re-
> use it.
> 
> >  #define DEV_RX_OFFLOAD_SCATTER		0x00002000
> >  /**
> >   * Timestamp is set by the driver in
> RTE_MBUF_DYNFIELD_TIMESTAMP_NAME
> > @@ -1477,6 +1478,20 @@ struct rte_eth_dev_portconf {
> >   */
> >  #define RTE_ETH_DEV_SWITCH_DOMAIN_ID_INVALID
> 	(UINT16_MAX)
> >
> > +/**
> > + * Reassembly capabilities that a device can support.
> > + * The device which can support reassembly offload should set
> > + * DEV_RX_OFFLOAD_REASSEMBLY
> > + */
> > +struct rte_eth_reass_capa {
> > +	/** Maximum time in ns that a fragment can wait for further
> fragments */
> > +	uint64_t reass_timeout;
> > +	/** Maximum number of fragments that device can reassemble */
> > +	uint16_t max_frags;
> > +	/** Reserved for future capabilities */
> > +	uint16_t reserved[3];
> > +};
> > +
> 
> I wonder if there is any other hardware around supports reassembly offload,
> it would be good to get more feedback on the capabilities list.
> 
> >  /**
> >   * Ethernet device associated switch information
> >   */
> > @@ -1582,8 +1597,9 @@ struct rte_eth_dev_info {
> >  	 * embedded managed interconnect/switch.
> >  	 */
> >  	struct rte_eth_switch_info switch_info;
> > +	/* Reassembly capabilities of a device for reassembly offload */
> > +	struct rte_eth_reass_capa reass_capa;
> >
> > -	uint64_t reserved_64s[2]; /**< Reserved for future fields */
> 
> Reserved fields were added to be able to update the struct without breaking
> the ABI, so that a critical change doesn't have to wait until next ABI break
> release.
> Since this is ABI break release, we can keep the reserved field and add the
> new struct. Or this can be an opportunity to get rid of the reserved field.
> 
> Personally I have no objection to get rid of the reserved field, but better to
> agree on this explicitly.
> 
> >  	void *reserved_ptrs[2];   /**< Reserved for future fields */
> >  };
> >
> > diff --git a/lib/mbuf/rte_mbuf_core.h b/lib/mbuf/rte_mbuf_core.h index
> > bb38d7f581..cea25c87f7 100644
> > --- a/lib/mbuf/rte_mbuf_core.h
> > +++ b/lib/mbuf/rte_mbuf_core.h
> > @@ -200,10 +200,11 @@ extern "C" {
> >  #define PKT_RX_OUTER_L4_CKSUM_BAD	(1ULL << 21)
> >  #define PKT_RX_OUTER_L4_CKSUM_GOOD	(1ULL << 22)
> >  #define PKT_RX_OUTER_L4_CKSUM_INVALID	((1ULL << 21) | (1ULL
> << 22))
> > +#define PKT_RX_REASSEMBLY_INCOMPLETE	(1ULL << 23)
> >
> 
> Similar comment with Andrew's, what is the expectation from application if
> this flag exists? Can we drop it to simplify the logic in the application?

[Anoob] There can be few cases where hardware/NIC attempts inline reassembly but it fails to complete it

1. Number of fragments is larger than what is supported by the hardware
2. Hardware reassembly resources are exhausted (due to limited reassembly contexts etc)
3. Reassembly errors such as overlapping fragments
4. Wait time exhausted (or reassembly timeout)

In such cases, application would be required to retrieve the original fragments so that it can attempt reassembly in software. The incomplete flag is useful for 2 purposes basically,
1. Application would need to retrieve the time the fragment has already spend in hardware reassembly so that software reassembly attempt can compensate for it. Otherwise, reassembly timeout across hardware + software will not be accurate
2. Retrieve original fragments. With this proposal, an incomplete reassembly would result in a chained mbuf but the segments need not be consecutive. To explain bit more,

Suppose we have a packet that is fragmented into 3 fragments, and fragment 3 & fragment 1 arrives in that order. Fragment 2 didn't arrive and hardware ultimately pushes it. In that case, application would be receiving a chained/segmented mbuf with fragment 1 & fragment 3 chained.

Now, this chained mbuf can't be treated like a regular chained mbuf. Each fragment would have its IP hdr and there are fragments missing in between. The only thing application is expected to do is, retrieve fragments, push it to s/w reassembly.
 
> 
> >  /* add new RX flags here, don't forget to update PKT_FIRST_FREE */
> >
> > -#define PKT_FIRST_FREE (1ULL << 23)
> > +#define PKT_FIRST_FREE (1ULL << 24)
> >  #define PKT_LAST_FREE (1ULL << 40)
> >
> >  /* add new TX flags here, don't forget to update PKT_LAST_FREE  */
> > diff --git a/lib/security/rte_security.h b/lib/security/rte_security.h
> > index 88d31de0a6..364eeb5cd4 100644
> > --- a/lib/security/rte_security.h
> > +++ b/lib/security/rte_security.h
> > @@ -181,6 +181,16 @@ struct rte_security_ipsec_sa_options {
> >  	 * * 0: Disable per session security statistics collection for this SA.
> >  	 */
> >  	uint32_t stats : 1;
> > +
> > +	/** Enable reassembly on incoming packets.
> > +	 *
> > +	 * * 1: Enable driver to try reassembly of encrypted IP packets for
> > +	 *      this SA, if supported by the driver. This feature will work
> > +	 *      only if rx_offload DEV_RX_OFFLOAD_REASSEMBLY is set in
> > +	 *      inline ethernet device.
> > +	 * * 0: Disable reassembly of packets (default).
> > +	 */
> > +	uint32_t reass_en : 1;
> >  };
> >
> >  /** IPSec security association direction */
> >


^ permalink raw reply	[relevance 0%]

* Re: [dpdk-dev] [PATCH 1/3] security: add option to configure tunnel header verification
  2021-09-08  8:21  5% ` [dpdk-dev] [PATCH 1/3] security: " Tejasree Kondoj
  2021-09-08  7:46  0%   ` Hemant Agrawal
@ 2021-09-08 10:42  3%   ` Akhil Goyal
  1 sibling, 0 replies; 200+ results
From: Akhil Goyal @ 2021-09-08 10:42 UTC (permalink / raw)
  To: Tejasree Kondoj, Radu Nicolau, Declan Doherty
  Cc: Tejasree Kondoj, Anoob Joseph, Ankur Dwivedi,
	Jerin Jacob Kollanukkaran, Konstantin Ananyev, Ciara Power,
	Hemant Agrawal, Gagandeep Singh, Fan Zhang, Archana Muniganti,
	dev

> Add option to indicate whether outer header verification
> need to be done as part of inbound IPsec processing.
> 
> With inline IPsec processing, SA lookup would be happening
> in the Rx path of rte_ethdev. When rte_flow is configured to
> support more than one SA, SPI would be used to lookup SA.
> In such cases, additional verification would be required to
> ensure duplicate SPIs are not getting processed in the inline path.
> 
> For lookaside cases, the same option can be used by application
> to offload tunnel verification to the PMD.
> 
> These verifications would help in averting possible DoS attacks.
> 
> Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
> ---
>  doc/guides/rel_notes/release_21_11.rst |  5 +++++

Deprecation notice should also be removed for this feature addition/
ABI breakage.

Other than that
Acked-by: Akhil Goyal <gakhil@marvell.com>

>  lib/security/rte_security.h            | 17 +++++++++++++++++
>  2 files changed, 22 insertions(+)
> 
> diff --git a/doc/guides/rel_notes/release_21_11.rst
> b/doc/guides/rel_notes/release_21_11.rst
> index 0e3ed28378..b0606cb542 100644
> --- a/doc/guides/rel_notes/release_21_11.rst
> +++ b/doc/guides/rel_notes/release_21_11.rst
> @@ -136,6 +136,11 @@ ABI Changes
>      soft and hard SA expiry limits. Limits can be either in units of packets or
>      bytes.
> 
> +* security: add IPsec SA option to configure tunnel header verification
> +
> +  * Added SA option to indicate whether outer header verification need to
> be
> +    done as part of inbound IPsec processing.
> +
> 
>  Known Issues
>  ------------
> diff --git a/lib/security/rte_security.h b/lib/security/rte_security.h
> index 95c169d6cf..2a61cad885 100644
> --- a/lib/security/rte_security.h
> +++ b/lib/security/rte_security.h
> @@ -55,6 +55,14 @@ enum rte_security_ipsec_tunnel_type {
>  	/**< Outer header is IPv6 */
>  };
> 
> +/**
> + * IPSEC tunnel header verification mode
> + *
> + * Controls how outer IP header is verified in inbound.
> + */
> +#define RTE_SECURITY_IPSEC_TUNNEL_VERIFY_DST_ADDR     0x1
> +#define RTE_SECURITY_IPSEC_TUNNEL_VERIFY_SRC_DST_ADDR 0x2
> +
>  /**
>   * Security context for crypto/eth devices
>   *
> @@ -195,6 +203,15 @@ struct rte_security_ipsec_sa_options {
>  	 * by the PMD.
>  	 */
>  	uint32_t iv_gen_disable : 1;
> +
> +	/** Verify tunnel header in inbound
> +	 * * ``RTE_SECURITY_IPSEC_TUNNEL_VERIFY_DST_ADDR``: Verify
> destination
> +	 *   IP address.
> +	 *
> +	 * * ``RTE_SECURITY_IPSEC_TUNNEL_VERIFY_SRC_DST_ADDR``: Verify
> both
> +	 *   source and destination IP addresses.
> +	 */
> +	uint32_t tunnel_hdr_verify : 2;
>  };
> 
>  /** IPSec security association direction */
> --
> 2.27.0


^ permalink raw reply	[relevance 3%]

* Re: [dpdk-dev] [RFC 04/15] eventdev: move inline APIs into separate structure
  @ 2021-09-08 12:03  0%   ` Kinsella, Ray
  0 siblings, 0 replies; 200+ results
From: Kinsella, Ray @ 2021-09-08 12:03 UTC (permalink / raw)
  To: pbhagavatula, jerinj; +Cc: konstantin.ananyev, dev



On 23/08/2021 20:40, pbhagavatula@marvell.com wrote:
> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
> 
> Move fastpath inline function pointers from rte_eventdev into a
> separate structure accessed via a flat array.
> The intension is to make rte_eventdev and related structures private
> to avoid future API/ABI breakages.`
> 
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
> ---
>  lib/eventdev/eventdev_pmd.h      |  10 ++++
>  lib/eventdev/eventdev_private.c  | 100 +++++++++++++++++++++++++++++++
>  lib/eventdev/meson.build         |   1 +
>  lib/eventdev/rte_eventdev.c      |  25 +++++++-
>  lib/eventdev/rte_eventdev_core.h |  44 ++++++++++++++
>  lib/eventdev/version.map         |   4 ++
>  6 files changed, 183 insertions(+), 1 deletion(-)
>  create mode 100644 lib/eventdev/eventdev_private.c
> 

I will deferred to others on the wisdom of exposing rte_eventdev_api.

Acked-by: Ray Kinsella <mdr@ashroe.eu>

^ permalink raw reply	[relevance 0%]

* Re: [dpdk-dev] [PATCH] fib: promote experimental API's to stable
  @ 2021-09-08 13:57  3%   ` Medvedkin, Vladimir
  2021-09-08 15:10  0%     ` Stephen Hemminger
  0 siblings, 1 reply; 200+ results
From: Medvedkin, Vladimir @ 2021-09-08 13:57 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: dev, konstantin.ananyev

Hi Stephen,

On 07/09/2021 02:34, Stephen Hemminger wrote:
> On Mon,  6 Sep 2021 17:01:15 +0100
> Vladimir Medvedkin <vladimir.medvedkin@intel.com> wrote:
> 
>> diff --git a/lib/fib/version.map b/lib/fib/version.map
>> index be975ea..af76add 100644
>> --- a/lib/fib/version.map
>> +++ b/lib/fib/version.map
>> @@ -1,4 +1,4 @@
>> -EXPERIMENTAL {
>> +DPDK_22 {
>>   	global:
>>   
>>   	rte_fib_add;
>> -- 
> 
> I think you should add to existing version number
> \

Could you please clarify what did you mean? There was no existing stable 
API section in the fib's version.map and current ABI version is DPDK_22.

-- 
Regards,
Vladimir

^ permalink raw reply	[relevance 3%]

* Re: [dpdk-dev] [PATCH] fib: promote experimental API's to stable
  2021-09-08 13:57  3%   ` Medvedkin, Vladimir
@ 2021-09-08 15:10  0%     ` Stephen Hemminger
  0 siblings, 0 replies; 200+ results
From: Stephen Hemminger @ 2021-09-08 15:10 UTC (permalink / raw)
  To: Medvedkin, Vladimir; +Cc: dev, konstantin.ananyev

On Wed, 8 Sep 2021 15:57:54 +0200
"Medvedkin, Vladimir" <vladimir.medvedkin@intel.com> wrote:

> Hi Stephen,
> 
> On 07/09/2021 02:34, Stephen Hemminger wrote:
> > On Mon,  6 Sep 2021 17:01:15 +0100
> > Vladimir Medvedkin <vladimir.medvedkin@intel.com> wrote:
> >   
> >> diff --git a/lib/fib/version.map b/lib/fib/version.map
> >> index be975ea..af76add 100644
> >> --- a/lib/fib/version.map
> >> +++ b/lib/fib/version.map
> >> @@ -1,4 +1,4 @@
> >> -EXPERIMENTAL {
> >> +DPDK_22 {
> >>   	global:
> >>   
> >>   	rte_fib_add;
> >> --   
> > 
> > I think you should add to existing version number
> > \  
> 
> Could you please clarify what did you mean? There was no existing stable 
> API section in the fib's version.map and current ABI version is DPDK_22.
> 

Ok, I missed that. Was looking at so many other files where
version was DPDK_20.

^ permalink raw reply	[relevance 0%]

* [dpdk-dev] [PATCH v11 0/3] devtools: scripts to count and track symbols
      2021-09-03 13:23  3% ` [dpdk-dev] [PATCH v11 " Ray Kinsella
@ 2021-09-08 15:12  3% ` Ray Kinsella
  2021-09-08 15:12  5%   ` [dpdk-dev] [PATCH v11 1/3] devtools: script to track symbols over releases Ray Kinsella
                     ` (2 more replies)
  2021-09-08 15:13  3% ` [dpdk-dev] [PATCH v12 0/4] devtools: scripts to count and track symbols Ray Kinsella
  2021-09-09 13:48  3% ` [dpdk-dev] [PATCH v13 0/4] devtools: scripts to count and track symbols Ray Kinsella
  4 siblings, 3 replies; 200+ results
From: Ray Kinsella @ 2021-09-08 15:12 UTC (permalink / raw)
  To: dev
  Cc: bruce.richardson, stephen, ferruh.yigit, thomas, ktraynor, mdr,
	aconole, roy.fan.zhang, arkadiuszx.kusztal, gakhil

Scripts to count and track the lifecycle of DPDK symbols.

The symbol-tool script reports on the growth of symbols over releases
and list expired symbols. The notify-symbol-maintainers script
consumes the input from symbol-tool and generates email notifications
of expired symbols.

v2: reworked to fix pylint errors
v3: sent with the correct in-reply-to
v4: fix typos picked up by the CI
v5: fix terminal_size & directory args
v6: added list-expired, to list expired experimental symbols
v7: fix typo in comments
v8: added tool to notify maintainers of expired symbols
v9: removed hardcoded emails addressed and script names
v10: added ability to identify and notify the original contributors
v11: addressed feedback from Aaron Conole, including PEP8 errors.

Ray Kinsella (3):
  devtools: script to track symbols over releases
  devtools: script to send notifications of expired symbols
  maintainers: add new abi scripts

 MAINTAINERS                           |   2 +
 devtools/notify-symbol-maintainers.py | 302 +++++++++++++++
 devtools/symbol-tool.py               | 505 ++++++++++++++++++++++++++
 3 files changed, 809 insertions(+)
 create mode 100755 devtools/notify-symbol-maintainers.py
 create mode 100755 devtools/symbol-tool.py

-- 
2.26.2


^ permalink raw reply	[relevance 3%]

* [dpdk-dev] [PATCH v11 1/3] devtools: script to track symbols over releases
  2021-09-08 15:12  3% ` [dpdk-dev] [PATCH v11 0/3] devtools: scripts to count and track symbols Ray Kinsella
@ 2021-09-08 15:12  5%   ` Ray Kinsella
  2021-09-08 15:12  5%   ` [dpdk-dev] [PATCH v11 2/3] devtools: script to send notifications of expired symbols Ray Kinsella
  2021-09-08 15:12 17%   ` [dpdk-dev] [PATCH v11 3/3] maintainers: add new abi scripts Ray Kinsella
  2 siblings, 0 replies; 200+ results
From: Ray Kinsella @ 2021-09-08 15:12 UTC (permalink / raw)
  To: dev
  Cc: bruce.richardson, stephen, ferruh.yigit, thomas, ktraynor, mdr,
	aconole, roy.fan.zhang, arkadiuszx.kusztal, gakhil

This script tracks the growth of stable and experimental symbols
over releases since v19.11. The script has the ability to
count the added symbols between two dpdk releases, and to
list experimental symbols present in two dpdk releases
(expired symbols).

example usages:

Count symbols added since v19.11
$ devtools/symbol-tool.py count-symbols

Count symbols added since v20.11
$ devtools/symbol-tool.py count-symbols --releases v20.11,v21.05

List experimental symbols present in v20.11 and v21.05
$ devtools/symbol-tool.py list-expired --releases v20.11,v21.05

List experimental symbols in libraries only, present since v19.11
$ devtools/symbol-tool.py list-expired --directory lib

Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
---
 devtools/symbol-tool.py | 505 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 505 insertions(+)
 create mode 100755 devtools/symbol-tool.py

diff --git a/devtools/symbol-tool.py b/devtools/symbol-tool.py
new file mode 100755
index 0000000000..a0b81c1b90
--- /dev/null
+++ b/devtools/symbol-tool.py
@@ -0,0 +1,505 @@
+#!/usr/bin/env python3
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2021 Intel Corporation
+# pylint: disable=invalid-name
+'''Tool to count or list symbols in each DPDK release'''
+from pathlib import Path
+import sys
+import os
+import subprocess
+import argparse
+from argparse import RawTextHelpFormatter
+import re
+import datetime
+try:
+    from parsley import makeGrammar
+except ImportError:
+    print('This script uses the package Parsley to parse C Mapfiles.\n'
+          'This can be installed with \"pip install parsley".')
+    sys.exit()
+
+DESCRIPTION = '''
+This script tracks the growth of stable and experimental symbols
+over releases since v19.11. The script has the ability to
+count the added symbols between two dpdk releases, and to
+list experimental symbols present in two dpdk releases
+(expired symbols), including the name & email of the original contributor.
+
+example usages:
+
+Count symbols added since v19.11
+$ {s} count-symbols
+
+Count symbols added since v20.11
+$ {s} count-symbols --releases v20.11,v21.05
+
+List experimental symbols present in v20.11 and v21.05
+$ {s} list-expired --releases v20.11,v21.05
+
+List experimental symbols in libraries only, present since v19.11
+$ {s} list-expired --directory lib
+'''
+
+MAP_GRAMMAR = r"""
+
+ws = (' ' | '\r' | '\n' | '\t')*
+
+ABI_VER = ({})
+DPDK_VER = ('DPDK_' ABI_VER)
+ABI_NAME = ('INTERNAL' | 'EXPERIMENTAL' | DPDK_VER)
+comment = '#' (~'\n' anything)+ '\n'
+symbol = (~(';' | '}}' | '#') anything )+:c ';' -> ''.join(c)
+global = 'global:'
+local = 'local: *;'
+symbols = comment* symbol:s ws comment* -> s
+
+abi = (abi_section+):m -> dict(m)
+abi_section = (ws ABI_NAME:e ws '{{' ws global* (~local ws symbols)*:s ws local* ws '}}' ws DPDK_VER* ';' ws) -> (e,s)
+"""  # noqa: E501
+
+
+def get_abi_versions():
+    '''Returns a string of possible dpdk abi versions'''
+
+    year = datetime.date.today().year - 2000
+    tags = " |".join(['\'{}\''.format(i)
+                     for i in reversed(range(21, year + 1))])
+    tags = tags + ' | \'20.0.1\' | \'20.0\' | \'20\''
+
+    return tags
+
+
+def get_dpdk_releases():
+    '''Returns a list of dpdk release tags names  since v19.11'''
+
+    year = datetime.date.today().year - 2000
+    year_range = "|".join("{}".format(i) for i in range(19, year + 1))
+    pattern = re.compile(r'^\"v(' + year_range + r')\.\d{2}\"$')
+
+    cmd = ['git', 'for-each-ref', '--sort=taggerdate', '--format', '"%(tag)"']
+    try:
+        result = subprocess.run(cmd,
+                                stdout=subprocess.PIPE,
+                                stderr=subprocess.PIPE,
+                                check=True)
+    except subprocess.CalledProcessError:
+        print("Failed to interogate git for release tags")
+        sys.exit()
+
+    tags = result.stdout.decode('utf-8').split('\n')
+
+    # find the non-rcs between now and v19.11
+    tags = [tag.replace('\"', '')
+            for tag in reversed(tags)
+            if pattern.match(tag)][:-3]
+
+    return tags
+
+
+def fix_directory_name(path):
+    '''Prepend librte to the source directory name'''
+    mapfilepath1 = str(path.parent.name)
+    mapfilepath2 = str(path.parents[1])
+    mapfilepath = mapfilepath2 + '/librte_' + mapfilepath1
+
+    return mapfilepath
+
+
+def directory_renamed(path, rel):
+    '''Fix removal of the librte_ from the directory names'''
+
+    mapfilepath = fix_directory_name(path)
+    tagfile = '{}:{}/{}'.format(rel, mapfilepath,  path.name)
+
+    try:
+        result = subprocess.run(['git', 'show', tagfile],
+                                stdout=subprocess.PIPE,
+                                stderr=subprocess.PIPE,
+                                check=True)
+    except subprocess.CalledProcessError:
+        result = None
+
+    return result
+
+
+def mapfile_renamed(path, rel):
+    '''Fix renaming of the map file'''
+    newfile = None
+
+    result = subprocess.run(['git', 'ls-tree',
+                             rel, str(path.parent) + '/'],
+                            stdout=subprocess.PIPE,
+                            stderr=subprocess.PIPE,
+                            check=True)
+    dentries = result.stdout.decode('utf-8')
+    dentries = dentries.split('\n')
+
+    # filter entries looking for the map file
+    dentries = [dentry for dentry in dentries if dentry.endswith('.map')]
+    if len(dentries) > 1 or len(dentries) == 0:
+        return None
+
+    dparts = dentries[0].split('/')
+    newfile = dparts[len(dparts) - 1]
+
+    if newfile is not None:
+        tagfile = '{}:{}/{}'.format(rel, path.parent, newfile)
+
+        try:
+            result = subprocess.run(['git', 'show', tagfile],
+                                    stdout=subprocess.PIPE,
+                                    stderr=subprocess.PIPE,
+                                    check=True)
+        except subprocess.CalledProcessError:
+            result = None
+
+    else:
+        result = None
+
+    return result
+
+
+def mapfile_and_directory_renamed(path, rel):
+    '''Fix renaming of the map file & the source directory'''
+    mapfilepath = Path("{}/{}".format(fix_directory_name(path), path.name))
+
+    return mapfile_renamed(mapfilepath, rel)
+
+
+FIX_STRATEGIES = [directory_renamed,
+                  mapfile_renamed,
+                  mapfile_and_directory_renamed]
+
+
+def get_symbols(map_parser, release, mapfile_path):
+    '''Count the symbols for a given release and mapfile'''
+    abi_sections = {}
+
+    tagfile = '{}:{}'.format(release, mapfile_path)
+    try:
+        result = subprocess.run(['git', 'show', tagfile],
+                                stdout=subprocess.PIPE,
+                                stderr=subprocess.PIPE,
+                                check=True)
+    except subprocess.CalledProcessError:
+        result = None
+
+    for fix_strategy in FIX_STRATEGIES:
+        if result is not None:
+            break
+        result = fix_strategy(mapfile_path, release)
+
+    if result is not None:
+        mapfile = result.stdout.decode('utf-8')
+        abi_sections = map_parser(mapfile).abi()
+
+    return abi_sections
+
+
+def get_terminal_rows():
+    '''Find the number of rows in the terminal'''
+
+    try:
+        return os.get_terminal_size().lines
+    except IOError:
+        return 0
+
+
+class SymbolOwner():
+    '''Find the symbols original contributors name and email'''
+    symbol_regex = {}
+    blame_regex = {'name': r'author\s(.*)',
+                   'email': r'author-mail\s<(.*)>'}
+
+    def __init__(self, libpath, symbol):
+        self.libpath = libpath
+        self.symbol = symbol
+
+        # find variable definitions in C files, and functions in headers.
+        self.symbol_regex = \
+            {'*.c':  r'^(?!extern).*' + self.symbol + '[^()]*;',
+             '*.h': r'__rte_experimental(?:.*\n){0,2}.*' + self.symbol}
+
+    def find_symbol_location(self):
+        '''Find where the symbol is definited in the source'''
+        for key in self.symbol_regex:
+            for path in Path(self.libpath).rglob(key):
+                file_text = open(path).read()
+
+                # find where the symbol is defined, either preceeded by
+                # rte_experimental tag (functions)
+                # or followed by a ; (variables)
+
+                exp = self.symbol_regex[key]
+                pattern = re.compile(exp, re.MULTILINE)
+                search = pattern.search(file_text)
+
+                if search is not None:
+                    symbol_pos = search.span()[1]
+                    symbol_line = file_text.count('\n', 0, symbol_pos) + 1
+
+                    return [str(path), symbol_line]
+        return None
+
+    def find_symbol_owner(self):
+        '''Find the symbols original contributors name and email'''
+        owners = {}
+        location = self.find_symbol_location()
+
+        if location is None:
+            return None
+
+        line = '-L {},{}'.format(location[1], location[1])
+        # git blame -p(orcelain) -L(ine) path
+        args = ['-p', line, location[0]]
+
+        try:
+            result = subprocess.run(['git', 'blame'] + args,
+                                    stdout=subprocess.PIPE,
+                                    stderr=subprocess.PIPE,
+                                    check=True)
+        except subprocess.CalledProcessError:
+            return None
+
+        blame = result.stdout.decode('utf-8')
+        for key in self.blame_regex:
+            pattern = re.compile(self.blame_regex[key], re.MULTILINE)
+            match = pattern.search(blame)
+
+            owners[key] = match.groups()[0]
+
+        return owners
+
+
+class SymbolCountOutput():
+    '''Format the output to supported formats'''
+    output_fmt = ""
+    column_fmt = ""
+
+    def __init__(self, format_output, dpdk_releases):
+        self.OUTPUT_FORMATS[format_output](self, dpdk_releases)
+        self.column_titles = ['mapfile'] + dpdk_releases
+
+        self.terminal_rows = get_terminal_rows()
+        self.row = 0
+
+    def set_terminal_output(self, dpdk_rel):
+        '''Set the output format to Tabbed Separated Values'''
+
+        self.output_fmt = '{:<50}' + \
+            ''.join(['{:<6}{:<6}'] * (len(dpdk_rel)))
+        self.column_fmt = '{:50}' + \
+            ''.join(['{:<12}'] * (len(dpdk_rel)))
+
+    def set_csv_output(self, dpdk_rel):
+        '''Set the output format to Comma Separated Values'''
+
+        self.output_fmt = '{},' + \
+            ','.join(['{},{}'] * (len(dpdk_rel)))
+        self.column_fmt = '{},' + \
+            ','.join(['{},'] * (len(dpdk_rel)))
+
+    def print_columns(self):
+        '''Print column rows with release names'''
+        print(self.column_fmt.format(*self.column_titles))
+        self.row += 1
+
+    def print_row(self, mapfile, symbols):
+        '''Print row of symbol values'''
+        mapfile = str(mapfile)
+        print(self.output_fmt.format(*([mapfile] + symbols)))
+        self.row += 1
+
+        if((self.terminal_rows > 0) and
+           ((self.row % self.terminal_rows) == 0)):
+            self.print_columns()
+
+    OUTPUT_FORMATS = {None: set_terminal_output,
+                      'terminal': set_terminal_output,
+                      'csv': set_csv_output}
+
+
+class ListExpiredOutput():
+    '''Format the output to supported formats'''
+    output_fmt = ""
+    column_fmt = ""
+
+    def __init__(self, format_output, dpdk_releases):
+        self.terminal = True
+        self.OUTPUT_FORMATS[format_output](self, dpdk_releases)
+        self.column_titles = ['mapfile'] + \
+            ['expired (' + ','.join(dpdk_releases) + ')'] + \
+            ['contributor name', 'contributor email']
+
+    def set_terminal_output(self, _):
+        '''Set the output format to Tabbed Separated Values'''
+
+        self.output_fmt = '{:<50}{:<50}{:<25}{:<25}'
+        self.column_fmt = '{:50}{:50}{:25}{:25}'
+
+    def set_csv_output(self, _):
+        '''Set the output format to Comma Separated Values'''
+
+        self.output_fmt = '{},{},{},{}'
+        self.column_fmt = '{},{},{},{}'
+        self.terminal = False
+
+    def print_columns(self):
+        '''Print column rows with release names'''
+        print(self.column_fmt.format(*self.column_titles))
+
+    def print_row(self, mapfile, symbols, owner):
+        '''Print row of symbol values'''
+
+        for symbol in symbols:
+            mapfile = str(mapfile)
+            name = owner[symbol]['name'] \
+                if owner[symbol] is not None else ''
+            email = owner[symbol]['email'] \
+                if owner[symbol] is not None else ''
+
+            print(self.output_fmt.format(mapfile, symbol, name, email))
+            if self.terminal:
+                mapfile = ''
+
+    OUTPUT_FORMATS = {None: set_terminal_output,
+                      'terminal': set_terminal_output,
+                      'csv': set_csv_output}
+
+
+class CountSymbolsAction:
+    ''' Logic to count symbols added since a give release '''
+    IGNORE_SECTIONS = ['EXPERIMENTAL', 'INTERNAL']
+
+    def __init__(self, mapfile_path, mapfile_parser, format_output):
+        self.path = mapfile_path
+        self.parser = mapfile_parser
+        self.format_output = format_output
+        self.symbols_count = []
+
+    def add_mapfile(self, release):
+        ''' add a version mapfile '''
+        symbol_count = experimental_count = 0
+
+        symbols = get_symbols(self.parser, release, self.path)
+
+        # which versions are present, and we care about
+        abi_vers = [abi_ver
+                    for abi_ver in symbols
+                    if abi_ver not in self.IGNORE_SECTIONS]
+
+        for abi_ver in abi_vers:
+            symbol_count += len(symbols[abi_ver])
+
+        # count experimental symbols
+        if 'EXPERIMENTAL' in symbols.keys():
+            experimental_count = len(symbols['EXPERIMENTAL'])
+
+        self.symbols_count += [symbol_count, experimental_count]
+
+    def __del__(self):
+        self.format_output.print_row(self.path.parent, self.symbols_count)
+
+
+class ListExpiredAction:
+    ''' Logic to list expired symbols between two releases '''
+
+    def __init__(self, mapfile_path, mapfile_parser, format_output):
+        self.path = mapfile_path
+        self.parser = mapfile_parser
+        self.format_output = format_output
+        self.experimental_symbols = []
+
+    def add_mapfile(self, release):
+        ''' add a version mapfile '''
+        symbols = get_symbols(self.parser, release, self.path)
+
+        if 'EXPERIMENTAL' in symbols.keys():
+            experimental = [exp.strip() for exp in symbols['EXPERIMENTAL']]
+
+            self.experimental_symbols.append(experimental)
+
+    def __del__(self):
+        if len(self.experimental_symbols) != 2:
+            return
+
+        tmp = self.experimental_symbols
+        # find symbols present in both dpdk releases
+        intersect_syms = [sym for sym in tmp[0] if sym in tmp[1]]
+
+        # check for empty set
+        if intersect_syms == []:
+            return
+
+        sym_owner = {}
+        for sym in intersect_syms:
+            sym_owner[sym] = \
+                SymbolOwner(self.path.parent, sym).find_symbol_owner()
+
+        self.format_output.print_row(self.path.parent,
+                                     intersect_syms,
+                                     sym_owner)
+
+
+SRC_DIRECTORIES = 'drivers,lib'
+
+ACTIONS = {None: CountSymbolsAction,
+           'count-symbols': CountSymbolsAction,
+           'list-expired': ListExpiredAction}
+
+ACTION_OUTPUT = {None: SymbolCountOutput,
+                 'count-symbols': SymbolCountOutput,
+                 'list-expired': ListExpiredOutput}
+
+
+def main():
+    '''Main entry point'''
+
+    dpdk_releases = get_dpdk_releases()
+
+    parser = \
+        argparse.ArgumentParser(description=DESCRIPTION.format(s=__file__),
+                                formatter_class=RawTextHelpFormatter)
+
+    parser.add_argument('mode', choices=['count-symbols', 'list-expired'])
+    parser.add_argument('--format-output', choices=['terminal', 'csv'],
+                        default='terminal')
+    parser.add_argument('--directory', choices=SRC_DIRECTORIES.split(','),
+                        default=SRC_DIRECTORIES)
+    parser.add_argument('--releases',
+                        help='2 x comma separated release tags e.g. \''
+                        + ','.join([dpdk_releases[0], dpdk_releases[-1]])
+                        + '\'')
+    args = parser.parse_args()
+
+    if args.releases is not None:
+        dpdk_releases = args.releases.split(',')
+
+    if args.mode == 'list-expired':
+        if len(dpdk_releases) < 2:
+            sys.exit('Please specify two releases to compare '
+                     'in \'list-expired\' mode.')
+        dpdk_releases = [dpdk_releases[0],
+                         dpdk_releases[len(dpdk_releases) - 1]]
+
+    action = ACTIONS[args.mode]
+    format_output = ACTION_OUTPUT[args.mode](args.format_output, dpdk_releases)
+
+    map_grammar = MAP_GRAMMAR.format(get_abi_versions())
+    map_parser = makeGrammar(map_grammar, {})
+
+    format_output.print_columns()
+
+    for src_dir in args.directory.split(','):
+        for path in Path(src_dir).rglob('*.map'):
+            release_action = action(path, map_parser, format_output)
+
+            for release in dpdk_releases:
+                release_action.add_mapfile(release)
+
+            # all the magic happens in the destructor
+            del release_action
+
+
+if __name__ == '__main__':
+    main()
-- 
2.26.2


^ permalink raw reply	[relevance 5%]

* [dpdk-dev] [PATCH v11 2/3] devtools: script to send notifications of expired symbols
  2021-09-08 15:12  3% ` [dpdk-dev] [PATCH v11 0/3] devtools: scripts to count and track symbols Ray Kinsella
  2021-09-08 15:12  5%   ` [dpdk-dev] [PATCH v11 1/3] devtools: script to track symbols over releases Ray Kinsella
@ 2021-09-08 15:12  5%   ` Ray Kinsella
  2021-09-08 15:12 17%   ` [dpdk-dev] [PATCH v11 3/3] maintainers: add new abi scripts Ray Kinsella
  2 siblings, 0 replies; 200+ results
From: Ray Kinsella @ 2021-09-08 15:12 UTC (permalink / raw)
  To: dev
  Cc: bruce.richardson, stephen, ferruh.yigit, thomas, ktraynor, mdr,
	aconole, roy.fan.zhang, arkadiuszx.kusztal, gakhil

Use this script with the output of the DPDK symbol tool, to notify
maintainers of expired symbols by email. You need to define the environment
variable DPDK_GETMAINTAINER_PATH for this tool to work.

Use terminal output to review the emails before sending.
e.g.
$ devtools/symbol-tool.py list-expired --format-output csv \
| DPDK_GETMAINTAINER_PATH=<somewhere>/get_maintainer.pl \
devtools/notify_expired_symbols.py --format-output terminal

Then use email output to send the emails to the maintainers.
e.g.
$ devtools/symbol-tool.py list-expired --format-output csv \
| DPDK_GETMAINTAINER_PATH=<somewhere>/get_maintainer.pl \
devtools/notify_expired_symbols.py --format-output email \
--smtp-server <server> --sender <someone@somewhere.com> \
--password <password> --cc <someone@somewhere.com>

Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
---
 devtools/notify-symbol-maintainers.py | 302 ++++++++++++++++++++++++++
 1 file changed, 302 insertions(+)
 create mode 100755 devtools/notify-symbol-maintainers.py

diff --git a/devtools/notify-symbol-maintainers.py b/devtools/notify-symbol-maintainers.py
new file mode 100755
index 0000000000..edf330f88b
--- /dev/null
+++ b/devtools/notify-symbol-maintainers.py
@@ -0,0 +1,302 @@
+#!/usr/bin/env python3
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2021 Intel Corporation
+# pylint: disable=invalid-name
+'''Tool to notify maintainers of expired symbols'''
+import os
+import smtplib
+import ssl
+import sys
+import subprocess
+import argparse
+from argparse import RawTextHelpFormatter
+import time
+from email.message import EmailMessage
+from pathlib import Path
+
+DESCRIPTION = '''
+Use this script with the output of the DPDK symbol tool, to notify maintainers
+and contributors of expired symbols by email. You need to define the environment
+variable DPDK_GETMAINTAINER_PATH for this tool to work.
+
+Use terminal output to review the emails before sending.
+e.g.
+$ devtools/symbol-tool.py list-expired --format-output csv \\
+| DPDK_GETMAINTAINER_PATH=<somewhere>/get_maintainer.pl \\
+{s} --format-output terminal
+
+Then use email output to send the emails to the maintainers.
+e.g.
+$ devtools/symbol-tool.py list-expired --format-output csv \\
+| DPDK_GETMAINTAINER_PATH=<somewhere>/get_maintainer.pl \\
+{s} --format-output email \\
+--smtp-server <server> --sender <someone@somewhere.com> --password <password> \\
+--cc <someone@somewhere.com>
+'''  # noqa: E501
+
+EMAIL_TEMPLATE = '''Hi there,
+
+Please note the symbols listed below have expired. In line with the DPDK ABI
+policy, they should be scheduled for removal, in the next DPDK release.
+
+For more information, please see the DPDK ABI Policy, section 3.5.3.
+https://doc.dpdk.org/guides/contributing/abi_policy.html
+
+Thanks,
+
+The DPDK Symbol Bot
+
+'''  # noqa: E501
+
+ABI_POLICY = 'doc/guides/contributing/abi_policy.rst'
+DPDK_GMP_ENV_VAR = 'DPDK_GETMAINTAINER_PATH'
+MAINTAINERS = 'MAINTAINERS'
+get_maintainer = ['devtools/get-maintainer.sh',
+                  '--email', '-f']
+
+
+class EnvironException(Exception):
+    '''Subclass exception for Pylint\'s happiness.'''
+
+
+def _die_on_exception(e):
+    '''Print an exception, and quit'''
+
+    print('Fatal Error: ' + str(e))
+    sys.exit()
+
+
+def _check_get_maintainers_env():
+    '''Check get maintainers scripts are setup'''
+
+    if not Path(get_maintainer[0]).is_file():
+        raise EnvironException('Cannot locate DPDK\'s get maintainers script, '
+                               ' usually at $' + get_maintainer[0] + '.')
+
+    if DPDK_GMP_ENV_VAR not in os.environ:
+        raise EnvironException(DPDK_GMP_ENV_VAR + ' is not defined.')
+
+    if not Path(os.environ[DPDK_GMP_ENV_VAR]).is_file():
+        raise EnvironException('Cannot locate get maintainers script, usually'
+                               ' at ' + DPDK_GMP_ENV_VAR + '.')
+
+
+def _get_maintainers(libpath):
+    '''Get the maintainers for given library'''
+
+    try:
+        _check_get_maintainers_env()
+    except EnvironException as e:
+        _die_on_exception(e)
+
+    try:
+        cmd = get_maintainer + [libpath]
+        result = subprocess.run(cmd,
+                                stdout=subprocess.PIPE,
+                                stderr=subprocess.PIPE,
+                                check=True)
+    except subprocess.CalledProcessError as e:
+        _die_on_exception(e)
+
+    if result is None:
+        return None
+
+    email = result.stdout.decode('utf-8')
+    if email == '':
+        return None
+
+    email = list(filter(None, email.split('\n')))
+    return email
+
+
+default_maintainers = _get_maintainers(ABI_POLICY) + \
+    _get_maintainers(MAINTAINERS)
+
+
+def get_maintainers(libpath):
+    '''Get the maintainers for given library'''
+    maintainers = _get_maintainers(libpath)
+
+    if maintainers is None:
+        maintainers = default_maintainers
+
+    return maintainers
+
+
+def get_message(library, symbols, config):
+    '''Build email message from symbols, config and maintainers'''
+    contributors = {}
+    message = {}
+    maintainers = get_maintainers(library)
+
+    if maintainers != default_maintainers:
+        message['CC'] = default_maintainers.copy()
+
+    if 'CC' in config:
+        message.setdefault('CC', []).append(config['CC'])
+
+    message['Subject'] = 'Expired symbols in {}\n'.format(library)
+
+    body = EMAIL_TEMPLATE
+    body += '{:<50}{:<25}{:<25}\n'.format('Symbol', 'Contributor', 'Email')
+    for sym in symbols:
+        body += ('{:<50}{:<25}{:<25}\n'.format(sym,
+                                               symbols[sym]['name'],
+                                               symbols[sym]['email']))
+        email = symbols[sym]['email']
+        contributors[email] = ''
+
+    contributors = list(contributors.keys())
+
+    message['To'] = maintainers + contributors
+    message['Body'] = body
+
+    return message
+
+
+class OutputEmail():
+    '''Format the output for email'''
+
+    def __init__(self, config):
+        self.config = config
+
+        self.terminal = OutputTerminal(config)
+        context = ssl.create_default_context()
+
+        # Try to log in to server and send email
+        try:
+            self.server = smtplib.SMTP(config['smtp_server'], 587)
+            self.server.starttls(context=context)  # Secure the connection
+            self.server.login(config['sender'], config['password'])
+        except EnvironException as e:
+            _die_on_exception(e)
+
+    def message(self, message):
+        '''send email'''
+        self.terminal.message(message)
+
+        msg = EmailMessage()
+        msg.set_content(message.pop('Body'))
+
+        for key in message.keys():
+            msg[key] = message[key]
+
+        msg['From'] = self.config['sender']
+        msg['Reply-To'] = 'no-reply@dpdk.org'
+
+        self.server.send_message(msg)
+
+        time.sleep(1)
+
+    def __del__(self):
+        self.server.quit()
+
+
+class OutputTerminal():  # pylint: disable=too-few-public-methods
+    '''Format the output for the terminal'''
+
+    def __init__(self, config):
+        self.config = config
+
+    def message(self, message):
+        '''Print email to terminal'''
+
+        terminal = 'To:' + ', '.join(message['To']) + '\n'
+        if 'sender' in self.config.keys():
+            terminal += 'From:' + self.config['sender'] + '\n'
+
+        terminal += 'Reply-To:' + 'no-reply@dpdk.org' + '\n'
+
+        if 'CC' in message:
+            terminal += 'CC:' + ', '.join(message['CC']) + '\n'
+
+        terminal += 'Subject:' + message['Subject'] + '\n'
+        terminal += 'Body:' + message['Body'] + '\n'
+
+        print(terminal)
+        print('-' * 80)
+
+
+def parse_config(args):
+    '''put the command line args in the right places'''
+    config = {}
+    error_msg = None
+
+    outputs = {
+        None: OutputTerminal,
+        'terminal': OutputTerminal,
+        'email': OutputEmail
+    }
+
+    if args.format_output == 'email':
+        if args.smtp_server is None:
+            error_msg = 'SMTP server'
+        else:
+            config['smtp_server'] = args.smtp_server
+
+        if args.sender is None:
+            error_msg = 'sender'
+        else:
+            config['sender'] = args.sender
+
+        if args.password is None:
+            error_msg = 'password'
+        else:
+            config['password'] = args.password
+
+    if args.cc is not None:
+        config['CC'] = args.cc
+
+    if error_msg is not None:
+        print('Please specify a {} for email output'.format(error_msg))
+        return None
+
+    config['output'] = outputs[args.format_output]
+    return config
+
+
+def main():
+    '''Main entry point'''
+    parser = \
+        argparse.ArgumentParser(description=DESCRIPTION.format(s=__file__),
+                                formatter_class=RawTextHelpFormatter)
+    parser.add_argument('--format-output',
+                        choices=['terminal', 'email'],
+                        default='terminal')
+    parser.add_argument('--smtp-server')
+    parser.add_argument('--password')
+    parser.add_argument('--sender')
+    parser.add_argument('--cc')
+
+    args = parser.parse_args()
+    config = parse_config(args)
+    if config is None:
+        return
+
+    symbols = {}
+    lastlib = library = ''
+
+    output = config['output'](config)
+
+    for line in sys.stdin:
+        line = line.rstrip('\n')
+
+        if line.find('mapfile') >= 0:
+            continue
+        library, symbol, name, email = line.split(',')
+
+        if library != lastlib:
+            message = get_message(lastlib, symbols, config)
+            output.message(message)
+            symbols = {}
+
+        lastlib = library
+        symbols[symbol] = {'name': name, 'email': email}
+
+    # print the last library
+    message = get_message(lastlib, symbols, config)
+    output.message(message)
+
+
+if __name__ == '__main__':
+    main()
-- 
2.26.2


^ permalink raw reply	[relevance 5%]

* [dpdk-dev] [PATCH v11 3/3] maintainers: add new abi scripts
  2021-09-08 15:12  3% ` [dpdk-dev] [PATCH v11 0/3] devtools: scripts to count and track symbols Ray Kinsella
  2021-09-08 15:12  5%   ` [dpdk-dev] [PATCH v11 1/3] devtools: script to track symbols over releases Ray Kinsella
  2021-09-08 15:12  5%   ` [dpdk-dev] [PATCH v11 2/3] devtools: script to send notifications of expired symbols Ray Kinsella
@ 2021-09-08 15:12 17%   ` Ray Kinsella
  2 siblings, 0 replies; 200+ results
From: Ray Kinsella @ 2021-09-08 15:12 UTC (permalink / raw)
  To: dev
  Cc: bruce.richardson, stephen, ferruh.yigit, thomas, ktraynor, mdr,
	aconole, roy.fan.zhang, arkadiuszx.kusztal, gakhil

Add new abi management scripts to the MAINTAINERS file.

Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
---
 MAINTAINERS | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 266f5ac1da..ff8245271f 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -129,6 +129,8 @@ F: devtools/gen-abi.sh
 F: devtools/libabigail.abignore
 F: devtools/update-abi.sh
 F: devtools/update_version_map_abi.py
+F: devtools/notify-symbol-maintainers.py
+F: devtools/symbol-tool.py
 F: buildtools/check-symbols.sh
 F: buildtools/map-list-symbol.sh
 F: drivers/*/*/*.map
-- 
2.26.2


^ permalink raw reply	[relevance 17%]

* [dpdk-dev] [PATCH v12 0/4] devtools: scripts to count and track symbols
                     ` (2 preceding siblings ...)
  2021-09-08 15:12  3% ` [dpdk-dev] [PATCH v11 0/3] devtools: scripts to count and track symbols Ray Kinsella
@ 2021-09-08 15:13  3% ` Ray Kinsella
  2021-09-08 15:13  5%   ` [dpdk-dev] [PATCH v12 1/4] devtools: script to track symbols over releases Ray Kinsella
                     ` (2 more replies)
  2021-09-09 13:48  3% ` [dpdk-dev] [PATCH v13 0/4] devtools: scripts to count and track symbols Ray Kinsella
  4 siblings, 3 replies; 200+ results
From: Ray Kinsella @ 2021-09-08 15:13 UTC (permalink / raw)
  To: dev
  Cc: bruce.richardson, stephen, ferruh.yigit, thomas, ktraynor, mdr,
	aconole, roy.fan.zhang, arkadiuszx.kusztal, gakhil

Scripts to count and track the lifecycle of DPDK symbols.

The symbol-tool script reports on the growth of symbols over releases
and list expired symbols. The notify-symbol-maintainers script
consumes the input from symbol-tool and generates email notifications
of expired symbols.

v2: reworked to fix pylint errors
v3: sent with the correct in-reply-to
v4: fix typos picked up by the CI
v5: fix terminal_size & directory args
v6: added list-expired, to list expired experimental symbols
v7: fix typo in comments
v8: added tool to notify maintainers of expired symbols
v9: removed hardcoded emails addressed and script names
v10: added ability to identify and notify the original contributors
v11: addressed feedback from Aaron Conole, including PEP8 errors.
v12: added symbol-tool ignore functionality, to ignore specific symbols.

Ray Kinsella (4):
  devtools: script to track symbols over releases
  devtools: script to send notifications of expired symbols
  maintainers: add new abi scripts
  devtools: add asym crypto to symbol-tool ignore

 MAINTAINERS                           |   2 +
 devtools/notify-symbol-maintainers.py | 302 ++++++++++++++
 devtools/symbol-tool.py               | 566 ++++++++++++++++++++++++++
 devtools/symboltool.ignore            |   3 +
 4 files changed, 873 insertions(+)
 create mode 100755 devtools/notify-symbol-maintainers.py
 create mode 100755 devtools/symbol-tool.py
 create mode 100644 devtools/symboltool.ignore

-- 
2.26.2


^ permalink raw reply	[relevance 3%]

* [dpdk-dev] [PATCH v12 1/4] devtools: script to track symbols over releases
  2021-09-08 15:13  3% ` [dpdk-dev] [PATCH v12 0/4] devtools: scripts to count and track symbols Ray Kinsella
@ 2021-09-08 15:13  5%   ` Ray Kinsella
  2021-09-08 15:13  5%   ` [dpdk-dev] [PATCH v12 2/4] devtools: script to send notifications of expired symbols Ray Kinsella
  2021-09-08 15:13 17%   ` [dpdk-dev] [PATCH v12 3/4] maintainers: add new abi scripts Ray Kinsella
  2 siblings, 0 replies; 200+ results
From: Ray Kinsella @ 2021-09-08 15:13 UTC (permalink / raw)
  To: dev
  Cc: bruce.richardson, stephen, ferruh.yigit, thomas, ktraynor, mdr,
	aconole, roy.fan.zhang, arkadiuszx.kusztal, gakhil

This script tracks the growth of stable and experimental symbols
over releases since v19.11. The script has the ability to
count the added symbols between two dpdk releases, and to
list experimental symbols present in two dpdk releases
(expired symbols).

example usages:

Count symbols added since v19.11
$ devtools/symbol-tool.py count-symbols

Count symbols added since v20.11
$ devtools/symbol-tool.py count-symbols --releases v20.11,v21.05

List experimental symbols present in v20.11 and v21.05
$ devtools/symbol-tool.py list-expired --releases v20.11,v21.05

List experimental symbols in libraries only, present since v19.11
$ devtools/symbol-tool.py list-expired --directory lib

Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
---
 devtools/symbol-tool.py | 566 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 566 insertions(+)
 create mode 100755 devtools/symbol-tool.py

diff --git a/devtools/symbol-tool.py b/devtools/symbol-tool.py
new file mode 100755
index 0000000000..a71ab59539
--- /dev/null
+++ b/devtools/symbol-tool.py
@@ -0,0 +1,566 @@
+#!/usr/bin/env python3
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2021 Intel Corporation
+# pylint: disable=invalid-name
+'''Tool to count or list symbols in each DPDK release'''
+from pathlib import Path
+import sys
+import os
+import subprocess
+import argparse
+from argparse import RawTextHelpFormatter
+import re
+import datetime
+try:
+    from parsley import makeGrammar
+except ImportError:
+    print('This script uses the package Parsley to parse C Mapfiles.\n'
+          'This can be installed with \"pip install parsley".')
+    sys.exit()
+
+DESCRIPTION = '''
+This script tracks the growth of stable and experimental symbols
+over releases since v19.11. The script has the ability to
+count the added symbols between two dpdk releases, and to
+list experimental symbols present in two dpdk releases
+(expired symbols), including the name & email of the original contributor.
+
+example usages:
+
+Count symbols added since v19.11
+$ {s} count-symbols
+
+Count symbols added since v20.11
+$ {s} count-symbols --releases v20.11,v21.05
+
+List experimental symbols present in v20.11 and v21.05
+$ {s} list-expired --releases v20.11,v21.05
+
+List experimental symbols in libraries only, present since v19.11
+$ {s} list-expired --directory lib
+'''
+
+MAP_GRAMMAR = r"""
+
+ws = (' ' | '\r' | '\n' | '\t')*
+
+ABI_VER = ({})
+DPDK_VER = ('DPDK_' ABI_VER)
+ABI_NAME = ('INTERNAL' | 'EXPERIMENTAL' | DPDK_VER)
+comment = '#' (~'\n' anything)+ '\n'
+symbol = (~(';' | '}}' | '#') anything )+:c ';' -> ''.join(c)
+global = 'global:'
+local = 'local: *;'
+symbols = comment* symbol:s ws comment* -> s
+
+abi = (abi_section+):m -> dict(m)
+abi_section = (ws ABI_NAME:e ws '{{' ws global* (~local ws symbols)*:s ws local* ws '}}' ws DPDK_VER* ';' ws) -> (e,s)
+"""  # noqa: E501
+
+
+class EnvironException(Exception):
+    '''Subclass exception for Pylint\'s happiness.'''
+
+
+def get_abi_versions():
+    '''Returns a string of possible dpdk abi versions'''
+
+    year = datetime.date.today().year - 2000
+    tags = " |".join(['\'{}\''.format(i)
+                     for i in reversed(range(21, year + 1))])
+    tags = tags + ' | \'20.0.1\' | \'20.0\' | \'20\''
+
+    return tags
+
+
+def get_dpdk_releases():
+    '''Returns a list of dpdk release tags names  since v19.11'''
+
+    year = datetime.date.today().year - 2000
+    year_range = "|".join("{}".format(i) for i in range(19, year + 1))
+    pattern = re.compile(r'^\"v(' + year_range + r')\.\d{2}\"$')
+
+    cmd = ['git', 'for-each-ref', '--sort=taggerdate', '--format', '"%(tag)"']
+    try:
+        result = subprocess.run(cmd,
+                                stdout=subprocess.PIPE,
+                                stderr=subprocess.PIPE,
+                                check=True)
+    except subprocess.CalledProcessError:
+        print("Failed to interogate git for release tags")
+        sys.exit()
+
+    tags = result.stdout.decode('utf-8').split('\n')
+
+    # find the non-rcs between now and v19.11
+    tags = [tag.replace('\"', '')
+            for tag in reversed(tags)
+            if pattern.match(tag)][:-3]
+
+    return tags
+
+
+def fix_directory_name(path):
+    '''Prepend librte to the source directory name'''
+    mapfilepath1 = str(path.parent.name)
+    mapfilepath2 = str(path.parents[1])
+    mapfilepath = mapfilepath2 + '/librte_' + mapfilepath1
+
+    return mapfilepath
+
+
+def directory_renamed(path, rel):
+    '''Fix removal of the librte_ from the directory names'''
+
+    mapfilepath = fix_directory_name(path)
+    tagfile = '{}:{}/{}'.format(rel, mapfilepath,  path.name)
+
+    try:
+        result = subprocess.run(['git', 'show', tagfile],
+                                stdout=subprocess.PIPE,
+                                stderr=subprocess.PIPE,
+                                check=True)
+    except subprocess.CalledProcessError:
+        result = None
+
+    return result
+
+
+def mapfile_renamed(path, rel):
+    '''Fix renaming of the map file'''
+    newfile = None
+
+    result = subprocess.run(['git', 'ls-tree',
+                             rel, str(path.parent) + '/'],
+                            stdout=subprocess.PIPE,
+                            stderr=subprocess.PIPE,
+                            check=True)
+    dentries = result.stdout.decode('utf-8')
+    dentries = dentries.split('\n')
+
+    # filter entries looking for the map file
+    dentries = [dentry for dentry in dentries if dentry.endswith('.map')]
+    if len(dentries) > 1 or len(dentries) == 0:
+        return None
+
+    dparts = dentries[0].split('/')
+    newfile = dparts[len(dparts) - 1]
+
+    if newfile is not None:
+        tagfile = '{}:{}/{}'.format(rel, path.parent, newfile)
+
+        try:
+            result = subprocess.run(['git', 'show', tagfile],
+                                    stdout=subprocess.PIPE,
+                                    stderr=subprocess.PIPE,
+                                    check=True)
+        except subprocess.CalledProcessError:
+            result = None
+
+    else:
+        result = None
+
+    return result
+
+
+def mapfile_and_directory_renamed(path, rel):
+    '''Fix renaming of the map file & the source directory'''
+    mapfilepath = Path("{}/{}".format(fix_directory_name(path), path.name))
+
+    return mapfile_renamed(mapfilepath, rel)
+
+
+FIX_STRATEGIES = [directory_renamed,
+                  mapfile_renamed,
+                  mapfile_and_directory_renamed]
+
+
+def get_symbols(map_parser, release, mapfile_path):
+    '''Count the symbols for a given release and mapfile'''
+    abi_sections = {}
+
+    tagfile = '{}:{}'.format(release, mapfile_path)
+    try:
+        result = subprocess.run(['git', 'show', tagfile],
+                                stdout=subprocess.PIPE,
+                                stderr=subprocess.PIPE,
+                                check=True)
+    except subprocess.CalledProcessError:
+        result = None
+
+    for fix_strategy in FIX_STRATEGIES:
+        if result is not None:
+            break
+        result = fix_strategy(mapfile_path, release)
+
+    if result is not None:
+        mapfile = result.stdout.decode('utf-8')
+        abi_sections = map_parser(mapfile).abi()
+
+    return abi_sections
+
+
+def get_terminal_rows():
+    '''Find the number of rows in the terminal'''
+
+    try:
+        return os.get_terminal_size().lines
+    except IOError:
+        return 0
+
+
+class IgnoredSymbols():  # pylint: disable=too-few-public-methods
+    '''Symbols which are to be be ignored for some period'''
+
+    SYMBOL_TOOL_IGNORE = 'devtools/symboltool.ignore'
+    ignore_regex = []
+    __initialized = False
+
+    @staticmethod
+    def initialize():
+        '''intialize once'''
+
+        if IgnoredSymbols.__initialized:
+            return
+        IgnoredSymbols.__initialized = True
+
+        if 'DPDK_SYMBOL_TOOL_IGNORE' in os.environ:
+            IgnoredSymbols.SYMBOL_TOOL_IGNORE = \
+                os.environ['DPDK_SYMBOL_TOOL_IGNORE']
+
+            # if the user specifies an ignore file, we can't find then error.
+            if not Path(IgnoredSymbols.SYMBOL_TOOL_IGNORE).is_file():
+                raise EnvironException('Cannot locate {}\'s '
+                                       'ignore file'.format(__file__))
+
+        # if we cannot find the default ignore file, then continue
+        if not Path(IgnoredSymbols.SYMBOL_TOOL_IGNORE).is_file():
+            return
+
+        lines = open(Path(IgnoredSymbols.SYMBOL_TOOL_IGNORE)).readlines()
+        for line in lines:
+
+            line = line.strip()
+
+            # ignore comments and whitespace
+            if line.startswith(';') or len(line) == 0:
+                continue
+
+            IgnoredSymbols.ignore_regex.append(re.compile(line))
+
+    def __init__(self):
+        self.initialize()
+
+    def check_ignore(self, symbol):
+        '''Check symbol against the ignore regexes'''
+
+        for exp in self.ignore_regex:
+            if exp.search(symbol) is not None:
+                return True
+
+        return False
+
+
+class SymbolOwner():
+    '''Find the symbols original contributors name and email'''
+    symbol_regex = {}
+    blame_regex = {'name': r'author\s(.*)',
+                   'email': r'author-mail\s<(.*)>'}
+
+    def __init__(self, libpath, symbol):
+        self.libpath = libpath
+        self.symbol = symbol
+
+        # find variable definitions in C files, and functions in headers.
+        self.symbol_regex = \
+            {'*.c':  r'^(?!extern).*' + self.symbol + '[^()]*;',
+             '*.h': r'__rte_experimental(?:.*\n){0,2}.*' + self.symbol}
+
+    def find_symbol_location(self):
+        '''Find where the symbol is definited in the source'''
+        for key in self.symbol_regex:
+            for path in Path(self.libpath).rglob(key):
+                file_text = open(path).read()
+
+                # find where the symbol is defined, either preceded by
+                # rte_experimental tag (functions)
+                # or followed by a ; (variables)
+
+                exp = self.symbol_regex[key]
+                pattern = re.compile(exp, re.MULTILINE)
+                search = pattern.search(file_text)
+
+                if search is not None:
+                    symbol_pos = search.span()[1]
+                    symbol_line = file_text.count('\n', 0, symbol_pos) + 1
+
+                    return [str(path), symbol_line]
+        return None
+
+    def find_symbol_owner(self):
+        '''Find the symbols original contributors name and email'''
+        owners = {}
+        location = self.find_symbol_location()
+
+        if location is None:
+            return None
+
+        line = '-L {},{}'.format(location[1], location[1])
+        # git blame -p(orcelain) -L(ine) path
+        args = ['-p', line, location[0]]
+
+        try:
+            result = subprocess.run(['git', 'blame'] + args,
+                                    stdout=subprocess.PIPE,
+                                    stderr=subprocess.PIPE,
+                                    check=True)
+        except subprocess.CalledProcessError:
+            return None
+
+        blame = result.stdout.decode('utf-8')
+        for key in self.blame_regex:
+            pattern = re.compile(self.blame_regex[key], re.MULTILINE)
+            match = pattern.search(blame)
+
+            owners[key] = match.groups()[0]
+
+        return owners
+
+
+class SymbolCountOutput():
+    '''Format the output to supported formats'''
+    output_fmt = ""
+    column_fmt = ""
+
+    def __init__(self, format_output, dpdk_releases):
+        self.OUTPUT_FORMATS[format_output](self, dpdk_releases)
+        self.column_titles = ['mapfile'] + dpdk_releases
+
+        self.terminal_rows = get_terminal_rows()
+        self.row = 0
+
+    def set_terminal_output(self, dpdk_rel):
+        '''Set the output format to Tabbed Separated Values'''
+
+        self.output_fmt = '{:<50}' + \
+            ''.join(['{:<6}{:<6}'] * (len(dpdk_rel)))
+        self.column_fmt = '{:50}' + \
+            ''.join(['{:<12}'] * (len(dpdk_rel)))
+
+    def set_csv_output(self, dpdk_rel):
+        '''Set the output format to Comma Separated Values'''
+
+        self.output_fmt = '{},' + \
+            ','.join(['{},{}'] * (len(dpdk_rel)))
+        self.column_fmt = '{},' + \
+            ','.join(['{},'] * (len(dpdk_rel)))
+
+    def print_columns(self):
+        '''Print column rows with release names'''
+        print(self.column_fmt.format(*self.column_titles))
+        self.row += 1
+
+    def print_row(self, mapfile, symbols):
+        '''Print row of symbol values'''
+        mapfile = str(mapfile)
+        print(self.output_fmt.format(*([mapfile] + symbols)))
+        self.row += 1
+
+        if((self.terminal_rows > 0) and
+           ((self.row % self.terminal_rows) == 0)):
+            self.print_columns()
+
+    OUTPUT_FORMATS = {None: set_terminal_output,
+                      'terminal': set_terminal_output,
+                      'csv': set_csv_output}
+
+
+class ListExpiredOutput():
+    '''Format the output to supported formats'''
+    output_fmt = ""
+    column_fmt = ""
+
+    def __init__(self, format_output, dpdk_releases):
+        self.terminal = True
+        self.OUTPUT_FORMATS[format_output](self, dpdk_releases)
+        self.column_titles = ['mapfile'] + \
+            ['expired (' + ','.join(dpdk_releases) + ')'] + \
+            ['contributor name', 'contributor email']
+
+    def set_terminal_output(self, _):
+        '''Set the output format to Tabbed Separated Values'''
+
+        self.output_fmt = '{:<50}{:<50}{:<25}{:<25}'
+        self.column_fmt = '{:50}{:50}{:25}{:25}'
+
+    def set_csv_output(self, _):
+        '''Set the output format to Comma Separated Values'''
+
+        self.output_fmt = '{},{},{},{}'
+        self.column_fmt = '{},{},{},{}'
+        self.terminal = False
+
+    def print_columns(self):
+        '''Print column rows with release names'''
+        print(self.column_fmt.format(*self.column_titles))
+
+    def print_row(self, mapfile, symbols, owner):
+        '''Print row of symbol values'''
+
+        for symbol in symbols:
+            mapfile = str(mapfile)
+            name = owner[symbol]['name'] \
+                if owner[symbol] is not None else ''
+            email = owner[symbol]['email'] \
+                if owner[symbol] is not None else ''
+
+            print(self.output_fmt.format(mapfile, symbol, name, email))
+            if self.terminal:
+                mapfile = ''
+
+    OUTPUT_FORMATS = {None: set_terminal_output,
+                      'terminal': set_terminal_output,
+                      'csv': set_csv_output}
+
+
+class CountSymbolsAction:
+    ''' Logic to count symbols added since a give release '''
+    IGNORE_SECTIONS = ['EXPERIMENTAL', 'INTERNAL']
+
+    def __init__(self, mapfile_path, mapfile_parser, format_output):
+        self.path = mapfile_path
+        self.parser = mapfile_parser
+        self.format_output = format_output
+        self.symbols_count = []
+
+    def add_mapfile(self, release):
+        ''' add a version mapfile '''
+        symbol_count = experimental_count = 0
+
+        symbols = get_symbols(self.parser, release, self.path)
+
+        # which versions are present, and we care about
+        abi_vers = [abi_ver
+                    for abi_ver in symbols
+                    if abi_ver not in self.IGNORE_SECTIONS]
+
+        for abi_ver in abi_vers:
+            symbol_count += len(symbols[abi_ver])
+
+        # count experimental symbols
+        if 'EXPERIMENTAL' in symbols.keys():
+            experimental_count = len(symbols['EXPERIMENTAL'])
+
+        self.symbols_count += [symbol_count, experimental_count]
+
+    def __del__(self):
+        self.format_output.print_row(self.path.parent, self.symbols_count)
+
+
+class ListExpiredAction:
+    ''' Logic to list expired symbols between two releases '''
+
+    def __init__(self, mapfile_path, mapfile_parser, format_output):
+        self.path = mapfile_path
+        self.parser = mapfile_parser
+        self.format_output = format_output
+        self.experimental_symbols = []
+        self.ignored_symbols = IgnoredSymbols()
+
+    def add_mapfile(self, release):
+        ''' add a version mapfile '''
+        symbols = get_symbols(self.parser, release, self.path)
+
+        if 'EXPERIMENTAL' in symbols.keys():
+            experimental = [exp.strip() for exp in symbols['EXPERIMENTAL']]
+
+            self.experimental_symbols.append(experimental)
+
+    def __del__(self):
+        if len(self.experimental_symbols) != 2:
+            return
+
+        tmp = self.experimental_symbols
+        # find symbols present in both dpdk releases
+        intersect_syms = [sym for sym in tmp[0] if sym in tmp[1]]
+
+        # remove ignored symbols
+        intersect_syms = [sym for sym in intersect_syms if not
+                          self.ignored_symbols.check_ignore(sym)]
+
+        # check for empty set
+        if intersect_syms == []:
+            return
+
+        sym_owner = {}
+        for sym in intersect_syms:
+            sym_owner[sym] = \
+                SymbolOwner(self.path.parent, sym).find_symbol_owner()
+
+        self.format_output.print_row(self.path.parent,
+                                     intersect_syms,
+                                     sym_owner)
+
+
+SRC_DIRECTORIES = 'drivers,lib'
+
+ACTIONS = {None: CountSymbolsAction,
+           'count-symbols': CountSymbolsAction,
+           'list-expired': ListExpiredAction}
+
+ACTION_OUTPUT = {None: SymbolCountOutput,
+                 'count-symbols': SymbolCountOutput,
+                 'list-expired': ListExpiredOutput}
+
+
+def main():
+    '''Main entry point'''
+
+    dpdk_releases = get_dpdk_releases()
+
+    parser = \
+        argparse.ArgumentParser(description=DESCRIPTION.format(s=__file__),
+                                formatter_class=RawTextHelpFormatter)
+
+    parser.add_argument('mode', choices=['count-symbols', 'list-expired'])
+    parser.add_argument('--format-output', choices=['terminal', 'csv'],
+                        default='terminal')
+    parser.add_argument('--directory', choices=SRC_DIRECTORIES.split(','),
+                        default=SRC_DIRECTORIES)
+    parser.add_argument('--releases',
+                        help='2 x comma separated release tags e.g. \''
+                        + ','.join([dpdk_releases[0], dpdk_releases[-1]])
+                        + '\'')
+    args = parser.parse_args()
+
+    if args.releases is not None:
+        dpdk_releases = args.releases.split(',')
+
+    if args.mode == 'list-expired':
+        if len(dpdk_releases) < 2:
+            sys.exit('Please specify two releases to compare '
+                     'in \'list-expired\' mode.')
+        dpdk_releases = [dpdk_releases[0],
+                         dpdk_releases[len(dpdk_releases) - 1]]
+
+    action = ACTIONS[args.mode]
+    format_output = ACTION_OUTPUT[args.mode](args.format_output, dpdk_releases)
+
+    map_grammar = MAP_GRAMMAR.format(get_abi_versions())
+    map_parser = makeGrammar(map_grammar, {})
+
+    format_output.print_columns()
+
+    for src_dir in args.directory.split(','):
+        for path in Path(src_dir).rglob('*.map'):
+            release_action = action(path, map_parser, format_output)
+
+            for release in dpdk_releases:
+                release_action.add_mapfile(release)
+
+            # all the magic happens in the destructor
+            del release_action
+
+
+if __name__ == '__main__':
+    main()
-- 
2.26.2


^ permalink raw reply	[relevance 5%]

* [dpdk-dev] [PATCH v12 2/4] devtools: script to send notifications of expired symbols
  2021-09-08 15:13  3% ` [dpdk-dev] [PATCH v12 0/4] devtools: scripts to count and track symbols Ray Kinsella
  2021-09-08 15:13  5%   ` [dpdk-dev] [PATCH v12 1/4] devtools: script to track symbols over releases Ray Kinsella
@ 2021-09-08 15:13  5%   ` Ray Kinsella
  2021-09-08 15:13 17%   ` [dpdk-dev] [PATCH v12 3/4] maintainers: add new abi scripts Ray Kinsella
  2 siblings, 0 replies; 200+ results
From: Ray Kinsella @ 2021-09-08 15:13 UTC (permalink / raw)
  To: dev
  Cc: bruce.richardson, stephen, ferruh.yigit, thomas, ktraynor, mdr,
	aconole, roy.fan.zhang, arkadiuszx.kusztal, gakhil

Use this script with the output of the DPDK symbol tool, to notify
maintainers of expired symbols by email. You need to define the environment
variable DPDK_GETMAINTAINER_PATH for this tool to work.

Use terminal output to review the emails before sending.
e.g.
$ devtools/symbol-tool.py list-expired --format-output csv \
| DPDK_GETMAINTAINER_PATH=<somewhere>/get_maintainer.pl \
devtools/notify_expired_symbols.py --format-output terminal

Then use email output to send the emails to the maintainers.
e.g.
$ devtools/symbol-tool.py list-expired --format-output csv \
| DPDK_GETMAINTAINER_PATH=<somewhere>/get_maintainer.pl \
devtools/notify_expired_symbols.py --format-output email \
--smtp-server <server> --sender <someone@somewhere.com> \
--password <password> --cc <someone@somewhere.com>

Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
---
 devtools/notify-symbol-maintainers.py | 302 ++++++++++++++++++++++++++
 1 file changed, 302 insertions(+)
 create mode 100755 devtools/notify-symbol-maintainers.py

diff --git a/devtools/notify-symbol-maintainers.py b/devtools/notify-symbol-maintainers.py
new file mode 100755
index 0000000000..edf330f88b
--- /dev/null
+++ b/devtools/notify-symbol-maintainers.py
@@ -0,0 +1,302 @@
+#!/usr/bin/env python3
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2021 Intel Corporation
+# pylint: disable=invalid-name
+'''Tool to notify maintainers of expired symbols'''
+import os
+import smtplib
+import ssl
+import sys
+import subprocess
+import argparse
+from argparse import RawTextHelpFormatter
+import time
+from email.message import EmailMessage
+from pathlib import Path
+
+DESCRIPTION = '''
+Use this script with the output of the DPDK symbol tool, to notify maintainers
+and contributors of expired symbols by email. You need to define the environment
+variable DPDK_GETMAINTAINER_PATH for this tool to work.
+
+Use terminal output to review the emails before sending.
+e.g.
+$ devtools/symbol-tool.py list-expired --format-output csv \\
+| DPDK_GETMAINTAINER_PATH=<somewhere>/get_maintainer.pl \\
+{s} --format-output terminal
+
+Then use email output to send the emails to the maintainers.
+e.g.
+$ devtools/symbol-tool.py list-expired --format-output csv \\
+| DPDK_GETMAINTAINER_PATH=<somewhere>/get_maintainer.pl \\
+{s} --format-output email \\
+--smtp-server <server> --sender <someone@somewhere.com> --password <password> \\
+--cc <someone@somewhere.com>
+'''  # noqa: E501
+
+EMAIL_TEMPLATE = '''Hi there,
+
+Please note the symbols listed below have expired. In line with the DPDK ABI
+policy, they should be scheduled for removal, in the next DPDK release.
+
+For more information, please see the DPDK ABI Policy, section 3.5.3.
+https://doc.dpdk.org/guides/contributing/abi_policy.html
+
+Thanks,
+
+The DPDK Symbol Bot
+
+'''  # noqa: E501
+
+ABI_POLICY = 'doc/guides/contributing/abi_policy.rst'
+DPDK_GMP_ENV_VAR = 'DPDK_GETMAINTAINER_PATH'
+MAINTAINERS = 'MAINTAINERS'
+get_maintainer = ['devtools/get-maintainer.sh',
+                  '--email', '-f']
+
+
+class EnvironException(Exception):
+    '''Subclass exception for Pylint\'s happiness.'''
+
+
+def _die_on_exception(e):
+    '''Print an exception, and quit'''
+
+    print('Fatal Error: ' + str(e))
+    sys.exit()
+
+
+def _check_get_maintainers_env():
+    '''Check get maintainers scripts are setup'''
+
+    if not Path(get_maintainer[0]).is_file():
+        raise EnvironException('Cannot locate DPDK\'s get maintainers script, '
+                               ' usually at $' + get_maintainer[0] + '.')
+
+    if DPDK_GMP_ENV_VAR not in os.environ:
+        raise EnvironException(DPDK_GMP_ENV_VAR + ' is not defined.')
+
+    if not Path(os.environ[DPDK_GMP_ENV_VAR]).is_file():
+        raise EnvironException('Cannot locate get maintainers script, usually'
+                               ' at ' + DPDK_GMP_ENV_VAR + '.')
+
+
+def _get_maintainers(libpath):
+    '''Get the maintainers for given library'''
+
+    try:
+        _check_get_maintainers_env()
+    except EnvironException as e:
+        _die_on_exception(e)
+
+    try:
+        cmd = get_maintainer + [libpath]
+        result = subprocess.run(cmd,
+                                stdout=subprocess.PIPE,
+                                stderr=subprocess.PIPE,
+                                check=True)
+    except subprocess.CalledProcessError as e:
+        _die_on_exception(e)
+
+    if result is None:
+        return None
+
+    email = result.stdout.decode('utf-8')
+    if email == '':
+        return None
+
+    email = list(filter(None, email.split('\n')))
+    return email
+
+
+default_maintainers = _get_maintainers(ABI_POLICY) + \
+    _get_maintainers(MAINTAINERS)
+
+
+def get_maintainers(libpath):
+    '''Get the maintainers for given library'''
+    maintainers = _get_maintainers(libpath)
+
+    if maintainers is None:
+        maintainers = default_maintainers
+
+    return maintainers
+
+
+def get_message(library, symbols, config):
+    '''Build email message from symbols, config and maintainers'''
+    contributors = {}
+    message = {}
+    maintainers = get_maintainers(library)
+
+    if maintainers != default_maintainers:
+        message['CC'] = default_maintainers.copy()
+
+    if 'CC' in config:
+        message.setdefault('CC', []).append(config['CC'])
+
+    message['Subject'] = 'Expired symbols in {}\n'.format(library)
+
+    body = EMAIL_TEMPLATE
+    body += '{:<50}{:<25}{:<25}\n'.format('Symbol', 'Contributor', 'Email')
+    for sym in symbols:
+        body += ('{:<50}{:<25}{:<25}\n'.format(sym,
+                                               symbols[sym]['name'],
+                                               symbols[sym]['email']))
+        email = symbols[sym]['email']
+        contributors[email] = ''
+
+    contributors = list(contributors.keys())
+
+    message['To'] = maintainers + contributors
+    message['Body'] = body
+
+    return message
+
+
+class OutputEmail():
+    '''Format the output for email'''
+
+    def __init__(self, config):
+        self.config = config
+
+        self.terminal = OutputTerminal(config)
+        context = ssl.create_default_context()
+
+        # Try to log in to server and send email
+        try:
+            self.server = smtplib.SMTP(config['smtp_server'], 587)
+            self.server.starttls(context=context)  # Secure the connection
+            self.server.login(config['sender'], config['password'])
+        except EnvironException as e:
+            _die_on_exception(e)
+
+    def message(self, message):
+        '''send email'''
+        self.terminal.message(message)
+
+        msg = EmailMessage()
+        msg.set_content(message.pop('Body'))
+
+        for key in message.keys():
+            msg[key] = message[key]
+
+        msg['From'] = self.config['sender']
+        msg['Reply-To'] = 'no-reply@dpdk.org'
+
+        self.server.send_message(msg)
+
+        time.sleep(1)
+
+    def __del__(self):
+        self.server.quit()
+
+
+class OutputTerminal():  # pylint: disable=too-few-public-methods
+    '''Format the output for the terminal'''
+
+    def __init__(self, config):
+        self.config = config
+
+    def message(self, message):
+        '''Print email to terminal'''
+
+        terminal = 'To:' + ', '.join(message['To']) + '\n'
+        if 'sender' in self.config.keys():
+            terminal += 'From:' + self.config['sender'] + '\n'
+
+        terminal += 'Reply-To:' + 'no-reply@dpdk.org' + '\n'
+
+        if 'CC' in message:
+            terminal += 'CC:' + ', '.join(message['CC']) + '\n'
+
+        terminal += 'Subject:' + message['Subject'] + '\n'
+        terminal += 'Body:' + message['Body'] + '\n'
+
+        print(terminal)
+        print('-' * 80)
+
+
+def parse_config(args):
+    '''put the command line args in the right places'''
+    config = {}
+    error_msg = None
+
+    outputs = {
+        None: OutputTerminal,
+        'terminal': OutputTerminal,
+        'email': OutputEmail
+    }
+
+    if args.format_output == 'email':
+        if args.smtp_server is None:
+            error_msg = 'SMTP server'
+        else:
+            config['smtp_server'] = args.smtp_server
+
+        if args.sender is None:
+            error_msg = 'sender'
+        else:
+            config['sender'] = args.sender
+
+        if args.password is None:
+            error_msg = 'password'
+        else:
+            config['password'] = args.password
+
+    if args.cc is not None:
+        config['CC'] = args.cc
+
+    if error_msg is not None:
+        print('Please specify a {} for email output'.format(error_msg))
+        return None
+
+    config['output'] = outputs[args.format_output]
+    return config
+
+
+def main():
+    '''Main entry point'''
+    parser = \
+        argparse.ArgumentParser(description=DESCRIPTION.format(s=__file__),
+                                formatter_class=RawTextHelpFormatter)
+    parser.add_argument('--format-output',
+                        choices=['terminal', 'email'],
+                        default='terminal')
+    parser.add_argument('--smtp-server')
+    parser.add_argument('--password')
+    parser.add_argument('--sender')
+    parser.add_argument('--cc')
+
+    args = parser.parse_args()
+    config = parse_config(args)
+    if config is None:
+        return
+
+    symbols = {}
+    lastlib = library = ''
+
+    output = config['output'](config)
+
+    for line in sys.stdin:
+        line = line.rstrip('\n')
+
+        if line.find('mapfile') >= 0:
+            continue
+        library, symbol, name, email = line.split(',')
+
+        if library != lastlib:
+            message = get_message(lastlib, symbols, config)
+            output.message(message)
+            symbols = {}
+
+        lastlib = library
+        symbols[symbol] = {'name': name, 'email': email}
+
+    # print the last library
+    message = get_message(lastlib, symbols, config)
+    output.message(message)
+
+
+if __name__ == '__main__':
+    main()
-- 
2.26.2


^ permalink raw reply	[relevance 5%]

* [dpdk-dev] [PATCH v12 3/4] maintainers: add new abi scripts
  2021-09-08 15:13  3% ` [dpdk-dev] [PATCH v12 0/4] devtools: scripts to count and track symbols Ray Kinsella
  2021-09-08 15:13  5%   ` [dpdk-dev] [PATCH v12 1/4] devtools: script to track symbols over releases Ray Kinsella
  2021-09-08 15:13  5%   ` [dpdk-dev] [PATCH v12 2/4] devtools: script to send notifications of expired symbols Ray Kinsella
@ 2021-09-08 15:13 17%   ` Ray Kinsella
  2 siblings, 0 replies; 200+ results
From: Ray Kinsella @ 2021-09-08 15:13 UTC (permalink / raw)
  To: dev
  Cc: bruce.richardson, stephen, ferruh.yigit, thomas, ktraynor, mdr,
	aconole, roy.fan.zhang, arkadiuszx.kusztal, gakhil

Add new abi management scripts to the MAINTAINERS file.

Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
---
 MAINTAINERS | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 266f5ac1da..ff8245271f 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -129,6 +129,8 @@ F: devtools/gen-abi.sh
 F: devtools/libabigail.abignore
 F: devtools/update-abi.sh
 F: devtools/update_version_map_abi.py
+F: devtools/notify-symbol-maintainers.py
+F: devtools/symbol-tool.py
 F: buildtools/check-symbols.sh
 F: buildtools/map-list-symbol.sh
 F: drivers/*/*/*.map
-- 
2.26.2


^ permalink raw reply	[relevance 17%]

* Re: [dpdk-dev] [PATCH v4 2/4] cryptodev: change valid dev API
  2021-09-07 19:22  3%     ` [dpdk-dev] [PATCH v4 2/4] cryptodev: change valid dev API Akhil Goyal
@ 2021-09-08 15:16  0%       ` Akhil Goyal
  0 siblings, 0 replies; 200+ results
From: Akhil Goyal @ 2021-09-08 15:16 UTC (permalink / raw)
  To: Akhil Goyal, dev, Ray Kinsella, techboard
  Cc: Anoob Joseph, radu.nicolau, declan.doherty, hemant.agrawal,
	matan, konstantin.ananyev, thomas, roy.fan.zhang, asomalap,
	ruifeng.wang, ajit.khaparde, pablo.de.lara.guarch, fiona.trahe,
	Ankur Dwivedi, Michael Shamis, Nagadheeraj Rottela, jianjay.zhou

> Subject: [PATCH v4 2/4] cryptodev: change valid dev API
> 
> The API rte_cryptodev_pmd_is_valid_dev, can be used
> by the application as well as PMD to check whether
> the device is valid or not. Hence, _pmd is removed
> from the API.
> The applications and drivers which use this API are
> also updated.
> 
> Signed-off-by: Akhil Goyal <gakhil@marvell.com>

This patch is merged on dpdk-next-crypto.
As discussed in DPDK techboard meeting, adding Ray and Techboard to
take a better look so that changes(if any) can be made before merging to main.

> ---
>  doc/guides/rel_notes/release_21_11.rst        |  4 ++
>  .../net/softnic/rte_eth_softnic_cryptodev.c   |  2 +-
>  examples/fips_validation/main.c               |  2 +-
>  examples/ip_pipeline/cryptodev.c              |  3 +-
>  lib/cryptodev/rte_cryptodev.c                 | 50 +++++++++----------
>  lib/cryptodev/rte_cryptodev.h                 | 11 ++++
>  lib/cryptodev/rte_cryptodev_pmd.h             | 11 ----
>  lib/cryptodev/version.map                     |  2 +-
>  lib/eventdev/rte_event_crypto_adapter.c       |  4 +-
>  lib/eventdev/rte_eventdev.c                   |  2 +-
>  lib/pipeline/rte_table_action.c               |  2 +-
>  11 files changed, 48 insertions(+), 45 deletions(-)
> 
> diff --git a/doc/guides/rel_notes/release_21_11.rst
> b/doc/guides/rel_notes/release_21_11.rst
> index 411fa9530a..e7ad50ba09 100644
> --- a/doc/guides/rel_notes/release_21_11.rst
> +++ b/doc/guides/rel_notes/release_21_11.rst
> @@ -102,6 +102,10 @@ API Changes
>     Also, make sure to start the actual text at the margin.
>     =======================================================
> 
> +* cryptodev: The API rte_cryptodev_pmd_is_valid_dev is modified to
> +  rte_cryptodev_is_valid_dev as it can be used by the application as
> +  well as PMD to check whether the device is valid or not.
> +
> 
>  ABI Changes
>  -----------
> diff --git a/drivers/net/softnic/rte_eth_softnic_cryptodev.c
> b/drivers/net/softnic/rte_eth_softnic_cryptodev.c
> index a1a4ca5650..8e278801c5 100644
> --- a/drivers/net/softnic/rte_eth_softnic_cryptodev.c
> +++ b/drivers/net/softnic/rte_eth_softnic_cryptodev.c
> @@ -82,7 +82,7 @@ softnic_cryptodev_create(struct pmd_internals *p,
> 
>  		dev_id = (uint32_t)status;
>  	} else {
> -		if (rte_cryptodev_pmd_is_valid_dev(params->dev_id) == 0)
> +		if (rte_cryptodev_is_valid_dev(params->dev_id) == 0)
>  			return NULL;
> 
>  		dev_id = params->dev_id;
> diff --git a/examples/fips_validation/main.c
> b/examples/fips_validation/main.c
> index c175fe6ac2..e892078f0e 100644
> --- a/examples/fips_validation/main.c
> +++ b/examples/fips_validation/main.c
> @@ -196,7 +196,7 @@ parse_cryptodev_id_arg(char *arg)
>  	}
> 
> 
> -	if (!rte_cryptodev_pmd_is_valid_dev(cryptodev_id)) {
> +	if (!rte_cryptodev_is_valid_dev(cryptodev_id)) {
>  		RTE_LOG(ERR, USER1, "Error %i: invalid cryptodev id %s\n",
>  				cryptodev_id, arg);
>  		return -1;
> diff --git a/examples/ip_pipeline/cryptodev.c
> b/examples/ip_pipeline/cryptodev.c
> index b0d9f3d217..9997d97456 100644
> --- a/examples/ip_pipeline/cryptodev.c
> +++ b/examples/ip_pipeline/cryptodev.c
> @@ -6,7 +6,6 @@
>  #include <stdio.h>
> 
>  #include <rte_cryptodev.h>
> -#include <rte_cryptodev_pmd.h>
>  #include <rte_string_fns.h>
> 
>  #include "cryptodev.h"
> @@ -74,7 +73,7 @@ cryptodev_create(const char *name, struct
> cryptodev_params *params)
> 
>  		dev_id = (uint32_t)status;
>  	} else {
> -		if (rte_cryptodev_pmd_is_valid_dev(params->dev_id) == 0)
> +		if (rte_cryptodev_is_valid_dev(params->dev_id) == 0)
>  			return NULL;
> 
>  		dev_id = params->dev_id;
> diff --git a/lib/cryptodev/rte_cryptodev.c b/lib/cryptodev/rte_cryptodev.c
> index 447aa9d519..37502b9b3c 100644
> --- a/lib/cryptodev/rte_cryptodev.c
> +++ b/lib/cryptodev/rte_cryptodev.c
> @@ -663,7 +663,7 @@ rte_cryptodev_is_valid_device_data(uint8_t dev_id)
>  }
> 
>  unsigned int
> -rte_cryptodev_pmd_is_valid_dev(uint8_t dev_id)
> +rte_cryptodev_is_valid_dev(uint8_t dev_id)
>  {
>  	struct rte_cryptodev *dev = NULL;
> 
> @@ -761,7 +761,7 @@ rte_cryptodev_socket_id(uint8_t dev_id)
>  {
>  	struct rte_cryptodev *dev;
> 
> -	if (!rte_cryptodev_pmd_is_valid_dev(dev_id))
> +	if (!rte_cryptodev_is_valid_dev(dev_id))
>  		return -1;
> 
>  	dev = rte_cryptodev_pmd_get_dev(dev_id);
> @@ -1032,7 +1032,7 @@ rte_cryptodev_configure(uint8_t dev_id, struct
> rte_cryptodev_config *config)
>  	struct rte_cryptodev *dev;
>  	int diag;
> 
> -	if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) {
> +	if (!rte_cryptodev_is_valid_dev(dev_id)) {
>  		CDEV_LOG_ERR("Invalid dev_id=%" PRIu8, dev_id);
>  		return -EINVAL;
>  	}
> @@ -1080,7 +1080,7 @@ rte_cryptodev_start(uint8_t dev_id)
> 
>  	CDEV_LOG_DEBUG("Start dev_id=%" PRIu8, dev_id);
> 
> -	if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) {
> +	if (!rte_cryptodev_is_valid_dev(dev_id)) {
>  		CDEV_LOG_ERR("Invalid dev_id=%" PRIu8, dev_id);
>  		return -EINVAL;
>  	}
> @@ -1110,7 +1110,7 @@ rte_cryptodev_stop(uint8_t dev_id)
>  {
>  	struct rte_cryptodev *dev;
> 
> -	if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) {
> +	if (!rte_cryptodev_is_valid_dev(dev_id)) {
>  		CDEV_LOG_ERR("Invalid dev_id=%" PRIu8, dev_id);
>  		return;
>  	}
> @@ -1136,7 +1136,7 @@ rte_cryptodev_close(uint8_t dev_id)
>  	struct rte_cryptodev *dev;
>  	int retval;
> 
> -	if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) {
> +	if (!rte_cryptodev_is_valid_dev(dev_id)) {
>  		CDEV_LOG_ERR("Invalid dev_id=%" PRIu8, dev_id);
>  		return -1;
>  	}
> @@ -1176,7 +1176,7 @@ rte_cryptodev_get_qp_status(uint8_t dev_id,
> uint16_t queue_pair_id)
>  {
>  	struct rte_cryptodev *dev;
> 
> -	if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) {
> +	if (!rte_cryptodev_is_valid_dev(dev_id)) {
>  		CDEV_LOG_ERR("Invalid dev_id=%" PRIu8, dev_id);
>  		return -EINVAL;
>  	}
> @@ -1207,7 +1207,7 @@ rte_cryptodev_queue_pair_setup(uint8_t dev_id,
> uint16_t queue_pair_id,
>  {
>  	struct rte_cryptodev *dev;
> 
> -	if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) {
> +	if (!rte_cryptodev_is_valid_dev(dev_id)) {
>  		CDEV_LOG_ERR("Invalid dev_id=%" PRIu8, dev_id);
>  		return -EINVAL;
>  	}
> @@ -1283,7 +1283,7 @@ rte_cryptodev_add_enq_callback(uint8_t dev_id,
>  		return NULL;
>  	}
> 
> -	if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) {
> +	if (!rte_cryptodev_is_valid_dev(dev_id)) {
>  		CDEV_LOG_ERR("Invalid dev_id=%d", dev_id);
>  		rte_errno = ENODEV;
>  		return NULL;
> @@ -1349,7 +1349,7 @@ rte_cryptodev_remove_enq_callback(uint8_t
> dev_id,
>  		return -EINVAL;
>  	}
> 
> -	if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) {
> +	if (!rte_cryptodev_is_valid_dev(dev_id)) {
>  		CDEV_LOG_ERR("Invalid dev_id=%d", dev_id);
>  		return -ENODEV;
>  	}
> @@ -1418,7 +1418,7 @@ rte_cryptodev_add_deq_callback(uint8_t dev_id,
>  		return NULL;
>  	}
> 
> -	if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) {
> +	if (!rte_cryptodev_is_valid_dev(dev_id)) {
>  		CDEV_LOG_ERR("Invalid dev_id=%d", dev_id);
>  		rte_errno = ENODEV;
>  		return NULL;
> @@ -1484,7 +1484,7 @@ rte_cryptodev_remove_deq_callback(uint8_t
> dev_id,
>  		return -EINVAL;
>  	}
> 
> -	if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) {
> +	if (!rte_cryptodev_is_valid_dev(dev_id)) {
>  		CDEV_LOG_ERR("Invalid dev_id=%d", dev_id);
>  		return -ENODEV;
>  	}
> @@ -1542,7 +1542,7 @@ rte_cryptodev_stats_get(uint8_t dev_id, struct
> rte_cryptodev_stats *stats)
>  {
>  	struct rte_cryptodev *dev;
> 
> -	if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) {
> +	if (!rte_cryptodev_is_valid_dev(dev_id)) {
>  		CDEV_LOG_ERR("Invalid dev_id=%d", dev_id);
>  		return -ENODEV;
>  	}
> @@ -1565,7 +1565,7 @@ rte_cryptodev_stats_reset(uint8_t dev_id)
>  {
>  	struct rte_cryptodev *dev;
> 
> -	if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) {
> +	if (!rte_cryptodev_is_valid_dev(dev_id)) {
>  		CDEV_LOG_ERR("Invalid dev_id=%" PRIu8, dev_id);
>  		return;
>  	}
> @@ -1581,7 +1581,7 @@ rte_cryptodev_info_get(uint8_t dev_id, struct
> rte_cryptodev_info *dev_info)
>  {
>  	struct rte_cryptodev *dev;
> 
> -	if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) {
> +	if (!rte_cryptodev_is_valid_dev(dev_id)) {
>  		CDEV_LOG_ERR("Invalid dev_id=%d", dev_id);
>  		return;
>  	}
> @@ -1608,7 +1608,7 @@ rte_cryptodev_callback_register(uint8_t dev_id,
>  	if (!cb_fn)
>  		return -EINVAL;
> 
> -	if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) {
> +	if (!rte_cryptodev_is_valid_dev(dev_id)) {
>  		CDEV_LOG_ERR("Invalid dev_id=%" PRIu8, dev_id);
>  		return -EINVAL;
>  	}
> @@ -1652,7 +1652,7 @@ rte_cryptodev_callback_unregister(uint8_t dev_id,
>  	if (!cb_fn)
>  		return -EINVAL;
> 
> -	if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) {
> +	if (!rte_cryptodev_is_valid_dev(dev_id)) {
>  		CDEV_LOG_ERR("Invalid dev_id=%" PRIu8, dev_id);
>  		return -EINVAL;
>  	}
> @@ -1720,7 +1720,7 @@ rte_cryptodev_sym_session_init(uint8_t dev_id,
>  	uint8_t index;
>  	int ret;
> 
> -	if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) {
> +	if (!rte_cryptodev_is_valid_dev(dev_id)) {
>  		CDEV_LOG_ERR("Invalid dev_id=%" PRIu8, dev_id);
>  		return -EINVAL;
>  	}
> @@ -1765,7 +1765,7 @@ rte_cryptodev_asym_session_init(uint8_t dev_id,
>  	uint8_t index;
>  	int ret;
> 
> -	if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) {
> +	if (!rte_cryptodev_is_valid_dev(dev_id)) {
>  		CDEV_LOG_ERR("Invalid dev_id=%" PRIu8, dev_id);
>  		return -EINVAL;
>  	}
> @@ -1939,7 +1939,7 @@ rte_cryptodev_sym_session_clear(uint8_t dev_id,
>  	struct rte_cryptodev *dev;
>  	uint8_t driver_id;
> 
> -	if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) {
> +	if (!rte_cryptodev_is_valid_dev(dev_id)) {
>  		CDEV_LOG_ERR("Invalid dev_id=%" PRIu8, dev_id);
>  		return -EINVAL;
>  	}
> @@ -1969,7 +1969,7 @@ rte_cryptodev_asym_session_clear(uint8_t dev_id,
>  {
>  	struct rte_cryptodev *dev;
> 
> -	if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) {
> +	if (!rte_cryptodev_is_valid_dev(dev_id)) {
>  		CDEV_LOG_ERR("Invalid dev_id=%" PRIu8, dev_id);
>  		return -EINVAL;
>  	}
> @@ -2079,7 +2079,7 @@
> rte_cryptodev_sym_get_private_session_size(uint8_t dev_id)
>  	struct rte_cryptodev *dev;
>  	unsigned int priv_sess_size;
> 
> -	if (!rte_cryptodev_pmd_is_valid_dev(dev_id))
> +	if (!rte_cryptodev_is_valid_dev(dev_id))
>  		return 0;
> 
>  	dev = rte_cryptodev_pmd_get_dev(dev_id);
> @@ -2099,7 +2099,7 @@
> rte_cryptodev_asym_get_private_session_size(uint8_t dev_id)
>  	unsigned int header_size = sizeof(void *) * nb_drivers;
>  	unsigned int priv_sess_size;
> 
> -	if (!rte_cryptodev_pmd_is_valid_dev(dev_id))
> +	if (!rte_cryptodev_is_valid_dev(dev_id))
>  		return 0;
> 
>  	dev = rte_cryptodev_pmd_get_dev(dev_id);
> @@ -2156,7 +2156,7 @@ rte_cryptodev_sym_cpu_crypto_process(uint8_t
> dev_id,
>  {
>  	struct rte_cryptodev *dev;
> 
> -	if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) {
> +	if (!rte_cryptodev_is_valid_dev(dev_id)) {
>  		sym_crypto_fill_status(vec, EINVAL);
>  		return 0;
>  	}
> @@ -2179,7 +2179,7 @@ rte_cryptodev_get_raw_dp_ctx_size(uint8_t
> dev_id)
>  	int32_t size = sizeof(struct rte_crypto_raw_dp_ctx);
>  	int32_t priv_size;
> 
> -	if (!rte_cryptodev_pmd_is_valid_dev(dev_id))
> +	if (!rte_cryptodev_is_valid_dev(dev_id))
>  		return -EINVAL;
> 
>  	dev = rte_cryptodev_pmd_get_dev(dev_id);
> diff --git a/lib/cryptodev/rte_cryptodev.h b/lib/cryptodev/rte_cryptodev.h
> index 11f4e6fdbf..bb01f0f195 100644
> --- a/lib/cryptodev/rte_cryptodev.h
> +++ b/lib/cryptodev/rte_cryptodev.h
> @@ -1368,6 +1368,17 @@ __rte_experimental
>  unsigned int
>  rte_cryptodev_asym_get_private_session_size(uint8_t dev_id);
> 
> +/**
> + * Validate if the crypto device index is valid attached crypto device.
> + *
> + * @param	dev_id	Crypto device index.
> + *
> + * @return
> + *   - If the device index is valid (1) or not (0).
> + */
> +unsigned int
> +rte_cryptodev_is_valid_dev(uint8_t dev_id);
> +
>  /**
>   * Provide driver identifier.
>   *
> diff --git a/lib/cryptodev/rte_cryptodev_pmd.h
> b/lib/cryptodev/rte_cryptodev_pmd.h
> index 1274436870..dd2a4940a2 100644
> --- a/lib/cryptodev/rte_cryptodev_pmd.h
> +++ b/lib/cryptodev/rte_cryptodev_pmd.h
> @@ -94,17 +94,6 @@ rte_cryptodev_pmd_get_dev(uint8_t dev_id);
>  struct rte_cryptodev *
>  rte_cryptodev_pmd_get_named_dev(const char *name);
> 
> -/**
> - * Validate if the crypto device index is valid attached crypto device.
> - *
> - * @param	dev_id	Crypto device index.
> - *
> - * @return
> - *   - If the device index is valid (1) or not (0).
> - */
> -unsigned int
> -rte_cryptodev_pmd_is_valid_dev(uint8_t dev_id);
> -
>  /**
>   * The pool of rte_cryptodev structures.
>   */
> diff --git a/lib/cryptodev/version.map b/lib/cryptodev/version.map
> index 979d823a7c..1a7f759c57 100644
> --- a/lib/cryptodev/version.map
> +++ b/lib/cryptodev/version.map
> @@ -25,6 +25,7 @@ DPDK_22 {
>  	rte_cryptodev_get_feature_name;
>  	rte_cryptodev_get_sec_ctx;
>  	rte_cryptodev_info_get;
> +	rte_cryptodev_is_valid_dev;
>  	rte_cryptodev_name_get;
>  	rte_cryptodev_pmd_allocate;
>  	rte_cryptodev_pmd_callback_process;
> @@ -33,7 +34,6 @@ DPDK_22 {
>  	rte_cryptodev_pmd_destroy;
>  	rte_cryptodev_pmd_get_dev;
>  	rte_cryptodev_pmd_get_named_dev;
> -	rte_cryptodev_pmd_is_valid_dev;
>  	rte_cryptodev_pmd_parse_input_args;
>  	rte_cryptodev_pmd_release_device;
>  	rte_cryptodev_queue_pair_count;
> diff --git a/lib/eventdev/rte_event_crypto_adapter.c
> b/lib/eventdev/rte_event_crypto_adapter.c
> index e1d38d383d..2d38389858 100644
> --- a/lib/eventdev/rte_event_crypto_adapter.c
> +++ b/lib/eventdev/rte_event_crypto_adapter.c
> @@ -781,7 +781,7 @@ rte_event_crypto_adapter_queue_pair_add(uint8_t
> id,
> 
>  	EVENT_CRYPTO_ADAPTER_ID_VALID_OR_ERR_RET(id, -EINVAL);
> 
> -	if (!rte_cryptodev_pmd_is_valid_dev(cdev_id)) {
> +	if (!rte_cryptodev_is_valid_dev(cdev_id)) {
>  		RTE_EDEV_LOG_ERR("Invalid dev_id=%" PRIu8, cdev_id);
>  		return -EINVAL;
>  	}
> @@ -898,7 +898,7 @@ rte_event_crypto_adapter_queue_pair_del(uint8_t
> id, uint8_t cdev_id,
> 
>  	EVENT_CRYPTO_ADAPTER_ID_VALID_OR_ERR_RET(id, -EINVAL);
> 
> -	if (!rte_cryptodev_pmd_is_valid_dev(cdev_id)) {
> +	if (!rte_cryptodev_is_valid_dev(cdev_id)) {
>  		RTE_EDEV_LOG_ERR("Invalid dev_id=%" PRIu8, cdev_id);
>  		return -EINVAL;
>  	}
> diff --git a/lib/eventdev/rte_eventdev.c b/lib/eventdev/rte_eventdev.c
> index 594dd5e759..cb0ed7b620 100644
> --- a/lib/eventdev/rte_eventdev.c
> +++ b/lib/eventdev/rte_eventdev.c
> @@ -165,7 +165,7 @@ rte_event_crypto_adapter_caps_get(uint8_t dev_id,
> uint8_t cdev_id,
>  	struct rte_cryptodev *cdev;
> 
>  	RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(dev_id, -EINVAL);
> -	if (!rte_cryptodev_pmd_is_valid_dev(cdev_id))
> +	if (!rte_cryptodev_is_valid_dev(cdev_id))
>  		return -EINVAL;
> 
>  	dev = &rte_eventdevs[dev_id];
> diff --git a/lib/pipeline/rte_table_action.c b/lib/pipeline/rte_table_action.c
> index 98f3438774..54721ed96a 100644
> --- a/lib/pipeline/rte_table_action.c
> +++ b/lib/pipeline/rte_table_action.c
> @@ -1732,7 +1732,7 @@ struct sym_crypto_data {
>  static int
>  sym_crypto_cfg_check(struct rte_table_action_sym_crypto_config *cfg)
>  {
> -	if (!rte_cryptodev_pmd_is_valid_dev(cfg->cryptodev_id))
> +	if (!rte_cryptodev_is_valid_dev(cfg->cryptodev_id))
>  		return -EINVAL;
>  	if (cfg->mp_create == NULL || cfg->mp_init == NULL)
>  		return -EINVAL;
> --
> 2.25.1


^ permalink raw reply	[relevance 0%]

* [dpdk-dev] [PATCH v4 5/8] pdump: support pcapng and filtering
  @ 2021-09-08 17:16  1%   ` Stephen Hemminger
  2021-09-08 17:16  1%   ` [dpdk-dev] [PATCH v4 7/8] doc: changes for new pcapng and dumpcap Stephen Hemminger
  1 sibling, 0 replies; 200+ results
From: Stephen Hemminger @ 2021-09-08 17:16 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

This enhances the DPDK pdump library to support new
pcapng format and filtering via BPF.

The internal client/server protocol is changed to support
two versions: the original pdump basic version and a
new pcapng version.

The internal version number (not part of exposed API or ABI)
is intentionally increased to cause any attempt to try
mismatched primary/secondary process to fail.

Add new API to do allow filtering of captured packets with
DPDK BPF (eBPF) filter program. It keeps statistics
on packets captured, filtered, and missed (because ring was full).

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/meson.build       |   4 +-
 lib/pdump/meson.build |   2 +-
 lib/pdump/rte_pdump.c | 437 ++++++++++++++++++++++++++++++------------
 lib/pdump/rte_pdump.h | 110 ++++++++++-
 lib/pdump/version.map |   8 +
 5 files changed, 435 insertions(+), 126 deletions(-)

diff --git a/lib/meson.build b/lib/meson.build
index 51bf9c2d11f0..4b01949fe715 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -26,6 +26,7 @@ libraries = [
         'timer',   # eventdev depends on this
         'acl',
         'bbdev',
+        'bpf',
         'bitratestats',
         'cfgfile',
         'compressdev',
@@ -43,7 +44,6 @@ libraries = [
         'member',
         'pcapng',
         'power',
-        'pdump',
         'rawdev',
         'regexdev',
         'rib',
@@ -55,10 +55,10 @@ libraries = [
         'ipsec', # ipsec lib depends on net, crypto and security
         'fib', #fib lib depends on rib
         'port', # pkt framework libs which use other libs from above
+	'pdump', # pdump lib depends on bpf pcapng
         'table',
         'pipeline',
         'flow_classify', # flow_classify lib depends on pkt framework table lib
-        'bpf',
         'graph',
         'node',
 ]
diff --git a/lib/pdump/meson.build b/lib/pdump/meson.build
index 3a95eabde6a6..51ceb2afdec5 100644
--- a/lib/pdump/meson.build
+++ b/lib/pdump/meson.build
@@ -3,4 +3,4 @@
 
 sources = files('rte_pdump.c')
 headers = files('rte_pdump.h')
-deps += ['ethdev']
+deps += ['ethdev', 'bpf', 'pcapng']
diff --git a/lib/pdump/rte_pdump.c b/lib/pdump/rte_pdump.c
index 382217bc1564..9cb31d6b5008 100644
--- a/lib/pdump/rte_pdump.c
+++ b/lib/pdump/rte_pdump.c
@@ -7,8 +7,10 @@
 #include <rte_ethdev.h>
 #include <rte_lcore.h>
 #include <rte_log.h>
+#include <rte_memzone.h>
 #include <rte_errno.h>
 #include <rte_string_fns.h>
+#include <rte_pcapng.h>
 
 #include "rte_pdump.h"
 
@@ -27,30 +29,26 @@ enum pdump_operation {
 	ENABLE = 2
 };
 
+/*
+ * Note: version numbers intentionally start at 3
+ * in order to catch any application built with older out
+ * version of DPDK using incompatible client request format.
+ */
 enum pdump_version {
-	V1 = 1
+	PDUMP_CLIENT_LEGACY = 3,
+	PDUMP_CLIENT_PCAPNG = 4,
 };
 
 struct pdump_request {
 	uint16_t ver;
 	uint16_t op;
-	uint32_t flags;
-	union pdump_data {
-		struct enable_v1 {
-			char device[RTE_DEV_NAME_MAX_LEN];
-			uint16_t queue;
-			struct rte_ring *ring;
-			struct rte_mempool *mp;
-			void *filter;
-		} en_v1;
-		struct disable_v1 {
-			char device[RTE_DEV_NAME_MAX_LEN];
-			uint16_t queue;
-			struct rte_ring *ring;
-			struct rte_mempool *mp;
-			void *filter;
-		} dis_v1;
-	} data;
+	uint16_t flags;
+	uint16_t queue;
+	struct rte_ring *ring;
+	struct rte_mempool *mp;
+	const struct rte_bpf_prm *prm;
+	uint32_t snaplen;
+	char device[RTE_DEV_NAME_MAX_LEN];
 };
 
 struct pdump_response {
@@ -63,80 +61,140 @@ static struct pdump_rxtx_cbs {
 	struct rte_ring *ring;
 	struct rte_mempool *mp;
 	const struct rte_eth_rxtx_callback *cb;
-	void *filter;
+	const struct rte_bpf *filter;
+	enum pdump_version ver;
+	uint32_t snaplen;
 } rx_cbs[RTE_MAX_ETHPORTS][RTE_MAX_QUEUES_PER_PORT],
 tx_cbs[RTE_MAX_ETHPORTS][RTE_MAX_QUEUES_PER_PORT];
 
-
-static inline void
-pdump_copy(struct rte_mbuf **pkts, uint16_t nb_pkts, void *user_params)
+static const char *MZ_RTE_PDUMP_STATS = "rte_pdump_stats";
+
+/* Shared memory between primary and secondary processes. */
+static struct {
+	struct rte_pdump_stats rx[RTE_MAX_ETHPORTS][RTE_MAX_QUEUES_PER_PORT];
+	struct rte_pdump_stats tx[RTE_MAX_ETHPORTS][RTE_MAX_QUEUES_PER_PORT];
+} *pdump_stats;
+
+/* Create a clone of mbuf to be placed into ring. */
+static void
+pdump_copy(uint16_t port_id, uint16_t queue,
+	   enum rte_pcapng_direction direction,
+	   struct rte_mbuf **pkts, uint16_t nb_pkts,
+	   const struct pdump_rxtx_cbs *cbs,
+	   struct rte_pdump_stats *stats)
 {
 	unsigned int i;
 	int ring_enq;
 	uint16_t d_pkts = 0;
 	struct rte_mbuf *dup_bufs[nb_pkts];
-	struct pdump_rxtx_cbs *cbs;
+	uint64_t ts;
 	struct rte_ring *ring;
 	struct rte_mempool *mp;
 	struct rte_mbuf *p;
+	uint64_t rcs[nb_pkts];
+
+	if (cbs->filter &&
+	    rte_bpf_exec_burst(cbs->filter, (void **)pkts, rcs, nb_pkts) == 0) {
+		/* All packets were filtered out */
+		__atomic_fetch_add(&stats->filtered, nb_pkts,
+				   __ATOMIC_RELAXED);
+		return;
+	}
 
-	cbs  = user_params;
+	ts = rte_get_tsc_cycles();
 	ring = cbs->ring;
 	mp = cbs->mp;
 	for (i = 0; i < nb_pkts; i++) {
-		p = rte_pktmbuf_copy(pkts[i], mp, 0, UINT32_MAX);
-		if (p)
+		/*
+		 * Similar behavior to rte_bpf_eth callback.
+		 * if BPF program returns zero value for a given packet,
+		 * then it will be ignored.
+		 */
+		if (cbs->filter && rcs[i] == 0) {
+			__atomic_fetch_add(&stats->filtered,
+					   1, __ATOMIC_RELAXED);
+			continue;
+		}
+
+		/*
+		 * If using pcapng then want to wrap packets
+		 * otherwise a simple copy.
+		 */
+		if (cbs->ver == PDUMP_CLIENT_PCAPNG)
+			p = rte_pcapng_copy(port_id, queue,
+					    pkts[i], mp, cbs->snaplen,
+					    ts, direction);
+		else
+			p = rte_pktmbuf_copy(pkts[i], mp, 0, cbs->snaplen);
+
+		if (unlikely(p == NULL))
+			__atomic_fetch_add(&stats->nombuf, 1, __ATOMIC_RELAXED);
+		else
 			dup_bufs[d_pkts++] = p;
 	}
 
+	__atomic_fetch_add(&stats->accepted, d_pkts, __ATOMIC_RELAXED);
+
 	ring_enq = rte_ring_enqueue_burst(ring, (void *)dup_bufs, d_pkts, NULL);
 	if (unlikely(ring_enq < d_pkts)) {
 		unsigned int drops = d_pkts - ring_enq;
 
-		PDUMP_LOG(DEBUG,
-			"only %d of packets enqueued to ring\n", ring_enq);
+		__atomic_fetch_add(&stats->ringfull, drops, __ATOMIC_RELAXED);
 		rte_pktmbuf_free_bulk(&dup_bufs[ring_enq], drops);
 	}
 }
 
 static uint16_t
-pdump_rx(uint16_t port __rte_unused, uint16_t qidx __rte_unused,
+pdump_rx(uint16_t port, uint16_t queue,
 	struct rte_mbuf **pkts, uint16_t nb_pkts,
-	uint16_t max_pkts __rte_unused,
-	void *user_params)
+	uint16_t max_pkts __rte_unused, void *user_params)
 {
-	pdump_copy(pkts, nb_pkts, user_params);
+	const struct pdump_rxtx_cbs *cbs = user_params;
+	struct rte_pdump_stats *stats = &pdump_stats->rx[port][queue];
+
+	pdump_copy(port, queue, RTE_PCAPNG_DIRECTION_IN,
+		   pkts, nb_pkts, cbs, stats);
 	return nb_pkts;
 }
 
 static uint16_t
-pdump_tx(uint16_t port __rte_unused, uint16_t qidx __rte_unused,
+pdump_tx(uint16_t port, uint16_t queue,
 		struct rte_mbuf **pkts, uint16_t nb_pkts, void *user_params)
 {
-	pdump_copy(pkts, nb_pkts, user_params);
+	const struct pdump_rxtx_cbs *cbs = user_params;
+	struct rte_pdump_stats *stats = &pdump_stats->tx[port][queue];
+
+	pdump_copy(port, queue, RTE_PCAPNG_DIRECTION_OUT,
+		   pkts, nb_pkts, cbs, stats);
 	return nb_pkts;
 }
 
 static int
-pdump_register_rx_callbacks(uint16_t end_q, uint16_t port, uint16_t queue,
-				struct rte_ring *ring, struct rte_mempool *mp,
-				uint16_t operation)
+pdump_register_rx_callbacks(enum pdump_version ver,
+			    uint16_t end_q, uint16_t port, uint16_t queue,
+			    struct rte_ring *ring, struct rte_mempool *mp,
+			    struct rte_bpf *filter,
+			    uint16_t operation, uint32_t snaplen)
 {
 	uint16_t qid;
-	struct pdump_rxtx_cbs *cbs = NULL;
 
 	qid = (queue == RTE_PDUMP_ALL_QUEUES) ? 0 : queue;
 	for (; qid < end_q; qid++) {
-		cbs = &rx_cbs[port][qid];
-		if (cbs && operation == ENABLE) {
+		struct pdump_rxtx_cbs *cbs = &rx_cbs[port][qid];
+
+		if (operation == ENABLE) {
 			if (cbs->cb) {
 				PDUMP_LOG(ERR,
 					"rx callback for port=%d queue=%d, already exists\n",
 					port, qid);
 				return -EEXIST;
 			}
+			cbs->ver = ver;
 			cbs->ring = ring;
 			cbs->mp = mp;
+			cbs->snaplen = snaplen;
+			cbs->filter = filter;
+
 			cbs->cb = rte_eth_add_first_rx_callback(port, qid,
 								pdump_rx, cbs);
 			if (cbs->cb == NULL) {
@@ -145,8 +203,7 @@ pdump_register_rx_callbacks(uint16_t end_q, uint16_t port, uint16_t queue,
 					rte_errno);
 				return rte_errno;
 			}
-		}
-		if (cbs && operation == DISABLE) {
+		} else if (operation == DISABLE) {
 			int ret;
 
 			if (cbs->cb == NULL) {
@@ -170,26 +227,32 @@ pdump_register_rx_callbacks(uint16_t end_q, uint16_t port, uint16_t queue,
 }
 
 static int
-pdump_register_tx_callbacks(uint16_t end_q, uint16_t port, uint16_t queue,
-				struct rte_ring *ring, struct rte_mempool *mp,
-				uint16_t operation)
+pdump_register_tx_callbacks(enum pdump_version ver,
+			    uint16_t end_q, uint16_t port, uint16_t queue,
+			    struct rte_ring *ring, struct rte_mempool *mp,
+			    struct rte_bpf *filter,
+			    uint16_t operation, uint32_t snaplen)
 {
 
 	uint16_t qid;
-	struct pdump_rxtx_cbs *cbs = NULL;
 
 	qid = (queue == RTE_PDUMP_ALL_QUEUES) ? 0 : queue;
 	for (; qid < end_q; qid++) {
-		cbs = &tx_cbs[port][qid];
-		if (cbs && operation == ENABLE) {
+		struct pdump_rxtx_cbs *cbs = &tx_cbs[port][qid];
+
+		if (operation == ENABLE) {
 			if (cbs->cb) {
 				PDUMP_LOG(ERR,
 					"tx callback for port=%d queue=%d, already exists\n",
 					port, qid);
 				return -EEXIST;
 			}
+			cbs->ver = ver;
 			cbs->ring = ring;
 			cbs->mp = mp;
+			cbs->snaplen = snaplen;
+			cbs->filter = filter;
+
 			cbs->cb = rte_eth_add_tx_callback(port, qid, pdump_tx,
 								cbs);
 			if (cbs->cb == NULL) {
@@ -198,8 +261,7 @@ pdump_register_tx_callbacks(uint16_t end_q, uint16_t port, uint16_t queue,
 					rte_errno);
 				return rte_errno;
 			}
-		}
-		if (cbs && operation == DISABLE) {
+		} else if (operation == DISABLE) {
 			int ret;
 
 			if (cbs->cb == NULL) {
@@ -228,37 +290,47 @@ set_pdump_rxtx_cbs(const struct pdump_request *p)
 	uint16_t nb_rx_q = 0, nb_tx_q = 0, end_q, queue;
 	uint16_t port;
 	int ret = 0;
+	struct rte_bpf *filter = NULL;
 	uint32_t flags;
 	uint16_t operation;
 	struct rte_ring *ring;
 	struct rte_mempool *mp;
 
-	flags = p->flags;
-	operation = p->op;
-	if (operation == ENABLE) {
-		ret = rte_eth_dev_get_port_by_name(p->data.en_v1.device,
-				&port);
-		if (ret < 0) {
+	if (!(p->ver == PDUMP_CLIENT_LEGACY ||
+	      p->ver == PDUMP_CLIENT_PCAPNG)) {
+		PDUMP_LOG(ERR,
+			  "incorrect client version %u\n", p->ver);
+		return -EINVAL;
+	}
+
+	if (p->prm) {
+		if (p->prm->prog_arg.type != RTE_BPF_ARG_PTR_MBUF) {
 			PDUMP_LOG(ERR,
-				"failed to get port id for device id=%s\n",
-				p->data.en_v1.device);
+				  "invalid BPF program type: %u\n",
+				  p->prm->prog_arg.type);
 			return -EINVAL;
 		}
-		queue = p->data.en_v1.queue;
-		ring = p->data.en_v1.ring;
-		mp = p->data.en_v1.mp;
-	} else {
-		ret = rte_eth_dev_get_port_by_name(p->data.dis_v1.device,
-				&port);
-		if (ret < 0) {
-			PDUMP_LOG(ERR,
-				"failed to get port id for device id=%s\n",
-				p->data.dis_v1.device);
-			return -EINVAL;
+
+		filter = rte_bpf_load(p->prm);
+		if (filter == NULL) {
+			PDUMP_LOG(ERR, "cannot load BPF filter: %s\n",
+				  rte_strerror(rte_errno));
+			return -rte_errno;
 		}
-		queue = p->data.dis_v1.queue;
-		ring = p->data.dis_v1.ring;
-		mp = p->data.dis_v1.mp;
+	}
+
+	flags = p->flags;
+	operation = p->op;
+	queue = p->queue;
+	ring = p->ring;
+	mp = p->mp;
+
+	ret = rte_eth_dev_get_port_by_name(p->device, &port);
+	if (ret < 0) {
+		PDUMP_LOG(ERR,
+			  "failed to get port id for device id=%s\n",
+			  p->device);
+		return -EINVAL;
 	}
 
 	/* validation if packet capture is for all queues */
@@ -296,8 +368,9 @@ set_pdump_rxtx_cbs(const struct pdump_request *p)
 	/* register RX callback */
 	if (flags & RTE_PDUMP_FLAG_RX) {
 		end_q = (queue == RTE_PDUMP_ALL_QUEUES) ? nb_rx_q : queue + 1;
-		ret = pdump_register_rx_callbacks(end_q, port, queue, ring, mp,
-							operation);
+		ret = pdump_register_rx_callbacks(p->ver, end_q, port, queue,
+						  ring, mp, filter,
+						  operation, p->snaplen);
 		if (ret < 0)
 			return ret;
 	}
@@ -305,8 +378,9 @@ set_pdump_rxtx_cbs(const struct pdump_request *p)
 	/* register TX callback */
 	if (flags & RTE_PDUMP_FLAG_TX) {
 		end_q = (queue == RTE_PDUMP_ALL_QUEUES) ? nb_tx_q : queue + 1;
-		ret = pdump_register_tx_callbacks(end_q, port, queue, ring, mp,
-							operation);
+		ret = pdump_register_tx_callbacks(p->ver, end_q, port, queue,
+						  ring, mp, filter,
+						  operation, p->snaplen);
 		if (ret < 0)
 			return ret;
 	}
@@ -347,8 +421,18 @@ pdump_server(const struct rte_mp_msg *mp_msg, const void *peer)
 int
 rte_pdump_init(void)
 {
+	const struct rte_memzone *mz;
 	int ret;
 
+	mz = rte_memzone_reserve(MZ_RTE_PDUMP_STATS, sizeof(*pdump_stats),
+				 rte_socket_id(), 0);
+	if (mz == NULL) {
+		PDUMP_LOG(ERR, "cannot allocate pdump statistics\n");
+		rte_errno = ENOMEM;
+		return -1;
+	}
+	pdump_stats = mz->addr;
+
 	ret = rte_mp_action_register(PDUMP_MP, pdump_server);
 	if (ret && rte_errno != ENOTSUP)
 		return -1;
@@ -392,14 +476,21 @@ pdump_validate_ring_mp(struct rte_ring *ring, struct rte_mempool *mp)
 static int
 pdump_validate_flags(uint32_t flags)
 {
-	if (flags != RTE_PDUMP_FLAG_RX && flags != RTE_PDUMP_FLAG_TX &&
-		flags != RTE_PDUMP_FLAG_RXTX) {
+	if ((flags & RTE_PDUMP_FLAG_RXTX) == 0) {
 		PDUMP_LOG(ERR,
 			"invalid flags, should be either rx/tx/rxtx\n");
 		rte_errno = EINVAL;
 		return -1;
 	}
 
+	/* mask off the flags we know about */
+	if (flags & ~(RTE_PDUMP_FLAG_RXTX | RTE_PDUMP_FLAG_PCAPNG)) {
+		PDUMP_LOG(ERR,
+			  "unknown flags: %#x\n", flags);
+		rte_errno = ENOTSUP;
+		return -1;
+	}
+
 	return 0;
 }
 
@@ -426,12 +517,12 @@ pdump_validate_port(uint16_t port, char *name)
 }
 
 static int
-pdump_prepare_client_request(char *device, uint16_t queue,
-				uint32_t flags,
-				uint16_t operation,
-				struct rte_ring *ring,
-				struct rte_mempool *mp,
-				void *filter)
+pdump_prepare_client_request(const char *device, uint16_t queue,
+			     uint32_t flags, uint32_t snaplen,
+			     uint16_t operation,
+			     struct rte_ring *ring,
+			     struct rte_mempool *mp,
+			     const struct rte_bpf_prm *prm)
 {
 	int ret = -1;
 	struct rte_mp_msg mp_req, *mp_rep;
@@ -440,23 +531,23 @@ pdump_prepare_client_request(char *device, uint16_t queue,
 	struct pdump_request *req = (struct pdump_request *)mp_req.param;
 	struct pdump_response *resp;
 
-	req->ver = 1;
-	req->flags = flags;
+	memset(req, 0, sizeof(*req));
+	if (flags & RTE_PDUMP_FLAG_PCAPNG)
+		req->ver = PDUMP_CLIENT_PCAPNG;
+	else
+		req->ver = PDUMP_CLIENT_LEGACY;
+
+	req->flags = flags & RTE_PDUMP_FLAG_RXTX;
 	req->op = operation;
+	req->queue = queue;
+	strlcpy(req->device, device, sizeof(req->device));
+
 	if ((operation & ENABLE) != 0) {
-		strlcpy(req->data.en_v1.device, device,
-			sizeof(req->data.en_v1.device));
-		req->data.en_v1.queue = queue;
-		req->data.en_v1.ring = ring;
-		req->data.en_v1.mp = mp;
-		req->data.en_v1.filter = filter;
-	} else {
-		strlcpy(req->data.dis_v1.device, device,
-			sizeof(req->data.dis_v1.device));
-		req->data.dis_v1.queue = queue;
-		req->data.dis_v1.ring = NULL;
-		req->data.dis_v1.mp = NULL;
-		req->data.dis_v1.filter = NULL;
+		req->queue = queue;
+		req->ring = ring;
+		req->mp = mp;
+		req->prm = prm;
+		req->snaplen = snaplen;
 	}
 
 	strlcpy(mp_req.name, PDUMP_MP, RTE_MP_MAX_NAME_LEN);
@@ -477,11 +568,17 @@ pdump_prepare_client_request(char *device, uint16_t queue,
 	return ret;
 }
 
-int
-rte_pdump_enable(uint16_t port, uint16_t queue, uint32_t flags,
-			struct rte_ring *ring,
-			struct rte_mempool *mp,
-			void *filter)
+/*
+ * There are two versions of this function, because although original API
+ * left place holder for future filter, it never checked the value.
+ * Therefore the API can't depend on application passing a non
+ * bogus value.
+ */
+static int
+pdump_enable(uint16_t port, uint16_t queue,
+	     uint32_t flags, uint32_t snaplen,
+	     struct rte_ring *ring, struct rte_mempool *mp,
+	     const struct rte_bpf_prm *prm)
 {
 	int ret;
 	char name[RTE_DEV_NAME_MAX_LEN];
@@ -496,20 +593,42 @@ rte_pdump_enable(uint16_t port, uint16_t queue, uint32_t flags,
 	if (ret < 0)
 		return ret;
 
-	ret = pdump_prepare_client_request(name, queue, flags,
-						ENABLE, ring, mp, filter);
+	if (snaplen == 0)
+		snaplen = UINT32_MAX;
 
-	return ret;
+	return pdump_prepare_client_request(name, queue, flags, snaplen,
+					    ENABLE, ring, mp, prm);
 }
 
 int
-rte_pdump_enable_by_deviceid(char *device_id, uint16_t queue,
-				uint32_t flags,
-				struct rte_ring *ring,
-				struct rte_mempool *mp,
-				void *filter)
+rte_pdump_enable(uint16_t port, uint16_t queue, uint32_t flags,
+		 struct rte_ring *ring,
+		 struct rte_mempool *mp,
+		 void *filter __rte_unused)
 {
-	int ret = 0;
+	return pdump_enable(port, queue, flags, 0,
+			    ring, mp, NULL);
+}
+
+int
+rte_pdump_enable_bpf(uint16_t port, uint16_t queue,
+		     uint32_t flags, uint32_t snaplen,
+		     struct rte_ring *ring,
+		     struct rte_mempool *mp,
+		     const struct rte_bpf_prm *prm)
+{
+	return pdump_enable(port, queue, flags, snaplen,
+			    ring, mp, prm);
+}
+
+static int
+pdump_enable_by_deviceid(const char *device_id, uint16_t queue,
+			 uint32_t flags, uint32_t snaplen,
+			 struct rte_ring *ring,
+			 struct rte_mempool *mp,
+			 const struct rte_bpf_prm *prm)
+{
+	int ret;
 
 	ret = pdump_validate_ring_mp(ring, mp);
 	if (ret < 0)
@@ -518,10 +637,30 @@ rte_pdump_enable_by_deviceid(char *device_id, uint16_t queue,
 	if (ret < 0)
 		return ret;
 
-	ret = pdump_prepare_client_request(device_id, queue, flags,
-						ENABLE, ring, mp, filter);
+	return pdump_prepare_client_request(device_id, queue, flags, snaplen,
+					    ENABLE, ring, mp, prm);
+}
 
-	return ret;
+int
+rte_pdump_enable_by_deviceid(char *device_id, uint16_t queue,
+			     uint32_t flags,
+			     struct rte_ring *ring,
+			     struct rte_mempool *mp,
+			     void *filter __rte_unused)
+{
+	return pdump_enable_by_deviceid(device_id, queue, flags, 0,
+					ring, mp, NULL);
+}
+
+int
+rte_pdump_enable_bpf_by_deviceid(const char *device_id, uint16_t queue,
+				 uint32_t flags, uint32_t snaplen,
+				 struct rte_ring *ring,
+				 struct rte_mempool *mp,
+				 const struct rte_bpf_prm *prm)
+{
+	return pdump_enable_by_deviceid(device_id, queue, flags, snaplen,
+					ring, mp, prm);
 }
 
 int
@@ -537,8 +676,8 @@ rte_pdump_disable(uint16_t port, uint16_t queue, uint32_t flags)
 	if (ret < 0)
 		return ret;
 
-	ret = pdump_prepare_client_request(name, queue, flags,
-						DISABLE, NULL, NULL, NULL);
+	ret = pdump_prepare_client_request(name, queue, flags, 0,
+					   DISABLE, NULL, NULL, NULL);
 
 	return ret;
 }
@@ -553,8 +692,66 @@ rte_pdump_disable_by_deviceid(char *device_id, uint16_t queue,
 	if (ret < 0)
 		return ret;
 
-	ret = pdump_prepare_client_request(device_id, queue, flags,
-						DISABLE, NULL, NULL, NULL);
+	ret = pdump_prepare_client_request(device_id, queue, flags, 0,
+					   DISABLE, NULL, NULL, NULL);
 
 	return ret;
 }
+
+static void
+pdump_sum_stats(uint16_t port, uint16_t nq,
+		const struct rte_pdump_stats stats[RTE_MAX_ETHPORTS][RTE_MAX_QUEUES_PER_PORT],
+		struct rte_pdump_stats *total)
+{
+	uint64_t *sum = (uint64_t *)total;
+	unsigned int i;
+	uint64_t val;
+	uint16_t qid;
+
+	for (qid = 0; qid < nq; qid++) {
+		const uint64_t *perq = (const uint64_t *)&stats[port][qid];
+
+		for (i = 0; i < sizeof(*total) / sizeof(uint64_t); i++) {
+			val = __atomic_load_n(&perq[i], __ATOMIC_RELAXED);
+			sum[i] += val;
+		}
+	}
+}
+
+int
+rte_pdump_stats(uint16_t port, struct rte_pdump_stats *stats)
+{
+	struct rte_eth_dev_info dev_info;
+	const struct rte_memzone *mz;
+	int ret;
+
+	memset(stats, 0, sizeof(*stats));
+	ret = rte_eth_dev_info_get(port, &dev_info);
+	if (ret != 0) {
+		PDUMP_LOG(ERR,
+			  "Error during getting device (port %u) info: %s\n",
+			  port, strerror(-ret));
+		return ret;
+	}
+
+	if (pdump_stats == NULL) {
+		if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
+			PDUMP_LOG(ERR,
+				  "pdump not initialized\n");
+			rte_errno = EINVAL;
+			return -1;
+		}
+
+		mz = rte_memzone_lookup(MZ_RTE_PDUMP_STATS);
+		if (mz == NULL) {
+			PDUMP_LOG(ERR, "can not find pdump stats\n");
+			rte_errno = EINVAL;
+			return -1;
+		}
+		pdump_stats = mz->addr;
+	}
+
+	pdump_sum_stats(port, dev_info.nb_rx_queues, pdump_stats->rx, stats);
+	pdump_sum_stats(port, dev_info.nb_tx_queues, pdump_stats->tx, stats);
+	return 0;
+}
diff --git a/lib/pdump/rte_pdump.h b/lib/pdump/rte_pdump.h
index 6b00fc17aeb2..e2fbd78c6273 100644
--- a/lib/pdump/rte_pdump.h
+++ b/lib/pdump/rte_pdump.h
@@ -15,6 +15,7 @@
 #include <stdint.h>
 #include <rte_mempool.h>
 #include <rte_ring.h>
+#include <rte_bpf.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -26,7 +27,9 @@ enum {
 	RTE_PDUMP_FLAG_RX = 1,  /* receive direction */
 	RTE_PDUMP_FLAG_TX = 2,  /* transmit direction */
 	/* both receive and transmit directions */
-	RTE_PDUMP_FLAG_RXTX = (RTE_PDUMP_FLAG_RX|RTE_PDUMP_FLAG_TX)
+	RTE_PDUMP_FLAG_RXTX = (RTE_PDUMP_FLAG_RX|RTE_PDUMP_FLAG_TX),
+
+	RTE_PDUMP_FLAG_PCAPNG = 4, /* format for pcapng */
 };
 
 /**
@@ -68,7 +71,7 @@ rte_pdump_uninit(void);
  * @param mp
  *  mempool on to which original packets will be mirrored or duplicated.
  * @param filter
- *  place holder for packet filtering.
+ *  Unused should be NULL.
  *
  * @return
  *    0 on success, -1 on error, rte_errno is set accordingly.
@@ -80,6 +83,41 @@ rte_pdump_enable(uint16_t port, uint16_t queue, uint32_t flags,
 		struct rte_mempool *mp,
 		void *filter);
 
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
+ *
+ * Enables packet capturing on given port and queue with filtering.
+ *
+ * @param port_id
+ *  The Ethernet port on which packet capturing should be enabled.
+ * @param queue
+ *  The queue on the Ethernet port which packet capturing
+ *  should be enabled. Pass UINT16_MAX to enable packet capturing on all
+ *  queues of a given port.
+ * @param flags
+ *  Pdump library flags that specify direction and packet format.
+ * @param snaplen
+ *  The upper limit on bytes to copy.
+ *  Passing UINT32_MAX means capture all the possible data.
+ * @param ring
+ *  The ring on which captured packets will be enqueued for user.
+ * @param mp
+ *  The mempool on to which original packets will be mirrored or duplicated.
+ * @param prm
+ *  Use BPF program to run to filter packes (can be NULL)
+ *
+ * @return
+ *    0 on success, -1 on error, rte_errno is set accordingly.
+ */
+__rte_experimental
+int
+rte_pdump_enable_bpf(uint16_t port_id, uint16_t queue,
+		     uint32_t flags, uint32_t snaplen,
+		     struct rte_ring *ring,
+		     struct rte_mempool *mp,
+		     const struct rte_bpf_prm *prm);
+
 /**
  * Disables packet capturing on given port and queue.
  *
@@ -118,7 +156,7 @@ rte_pdump_disable(uint16_t port, uint16_t queue, uint32_t flags);
  * @param mp
  *  mempool on to which original packets will be mirrored or duplicated.
  * @param filter
- *  place holder for packet filtering.
+ *  unused should be NULL
  *
  * @return
  *    0 on success, -1 on error, rte_errno is set accordingly.
@@ -131,6 +169,43 @@ rte_pdump_enable_by_deviceid(char *device_id, uint16_t queue,
 				struct rte_mempool *mp,
 				void *filter);
 
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
+ *
+ * Enables packet capturing on given device id and queue with filtering.
+ * device_id can be name or pci address of device.
+ *
+ * @param device_id
+ *  device id on which packet capturing should be enabled.
+ * @param queue
+ *  The queue on the Ethernet port which packet capturing
+ *  should be enabled. Pass UINT16_MAX to enable packet capturing on all
+ *  queues of a given port.
+ * @param flags
+ *  Pdump library flags that specify direction and packet format.
+ * @param snaplen
+ *  The upper limit on bytes to copy.
+ *  Passing UINT32_MAX means capture all the possible data.
+ * @param ring
+ *  The ring on which captured packets will be enqueued for user.
+ * @param mp
+ *  The mempool on to which original packets will be mirrored or duplicated.
+ * @param filter
+ *  Use BPF program to run to filter packes (can be NULL)
+ *
+ * @return
+ *    0 on success, -1 on error, rte_errno is set accordingly.
+ */
+__rte_experimental
+int
+rte_pdump_enable_bpf_by_deviceid(const char *device_id, uint16_t queue,
+				 uint32_t flags, uint32_t snaplen,
+				 struct rte_ring *ring,
+				 struct rte_mempool *mp,
+				 const struct rte_bpf_prm *prm);
+
+
 /**
  * Disables packet capturing on given device_id and queue.
  * device_id can be name or pci address of device.
@@ -153,6 +228,35 @@ int
 rte_pdump_disable_by_deviceid(char *device_id, uint16_t queue,
 				uint32_t flags);
 
+
+/**
+ * A structure used to retrieve statistics from packet capture.
+ * The statistics are sum of both receive and transmit queues.
+ */
+struct rte_pdump_stats {
+	uint64_t accepted; /**< Number of packets accepted by filter. */
+	uint64_t filtered; /**< Number of packets rejected by filter. */
+	uint64_t nombuf;   /**< Number of mbuf allocation failures. */
+	uint64_t ringfull; /**< Number of missed packets due to ring full. */
+
+	uint64_t reserved[4]; /**< Reserved and pad to cache line */
+};
+
+/**
+ * Retrieve the packet capture statistics for a queue.
+ *
+ * @param port_id
+ *   The port identifier of the Ethernet device.
+ * @param stats
+ *   A pointer to structure of type *rte_pdump_stats* to be filled in.
+ * @return
+ *   Zero if successful. -1 on error and rte_errno is set.
+ */
+__rte_experimental
+int
+rte_pdump_stats(uint16_t port_id, struct rte_pdump_stats *stats);
+
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/lib/pdump/version.map b/lib/pdump/version.map
index f0a9d12c9a9e..ce5502d9cdf4 100644
--- a/lib/pdump/version.map
+++ b/lib/pdump/version.map
@@ -10,3 +10,11 @@ DPDK_22 {
 
 	local: *;
 };
+
+EXPERIMENTAL {
+	global:
+
+	rte_pdump_enable_bpf;
+	rte_pdump_enable_bpf_by_deviceid;
+	rte_pdump_stats;
+};
-- 
2.30.2


^ permalink raw reply	[relevance 1%]

* [dpdk-dev] [PATCH v4 7/8] doc: changes for new pcapng and dumpcap
    2021-09-08 17:16  1%   ` [dpdk-dev] [PATCH v4 5/8] pdump: support pcapng and filtering Stephen Hemminger
@ 2021-09-08 17:16  1%   ` Stephen Hemminger
  1 sibling, 0 replies; 200+ results
From: Stephen Hemminger @ 2021-09-08 17:16 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

Describe the new packet capture library and utilities

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 doc/api/doxy-api-index.md                     |  1 +
 doc/api/doxy-api.conf.in                      |  1 +
 .../howto/img/packet_capture_framework.svg    | 96 +++++++++----------
 doc/guides/howto/packet_capture_framework.rst | 67 ++++++-------
 doc/guides/prog_guide/index.rst               |  1 +
 doc/guides/prog_guide/pcapng_lib.rst          | 24 +++++
 doc/guides/prog_guide/pdump_lib.rst           | 28 ++++--
 doc/guides/rel_notes/release_21_11.rst        | 10 ++
 doc/guides/tools/dumpcap.rst                  | 86 +++++++++++++++++
 doc/guides/tools/index.rst                    |  1 +
 10 files changed, 228 insertions(+), 87 deletions(-)
 create mode 100644 doc/guides/prog_guide/pcapng_lib.rst
 create mode 100644 doc/guides/tools/dumpcap.rst

diff --git a/doc/api/doxy-api-index.md b/doc/api/doxy-api-index.md
index 1992107a0356..ee07394d1c78 100644
--- a/doc/api/doxy-api-index.md
+++ b/doc/api/doxy-api-index.md
@@ -223,3 +223,4 @@ The public API headers are grouped by topics:
   [experimental APIs]  (@ref rte_compat.h),
   [ABI versioning]     (@ref rte_function_versioning.h),
   [version]            (@ref rte_version.h)
+  [pcapng]             (@ref rte_pcapng.h)
diff --git a/doc/api/doxy-api.conf.in b/doc/api/doxy-api.conf.in
index 325a0195c6ab..aba17799a9a1 100644
--- a/doc/api/doxy-api.conf.in
+++ b/doc/api/doxy-api.conf.in
@@ -58,6 +58,7 @@ INPUT                   = @TOPDIR@/doc/api/doxy-api-index.md \
                           @TOPDIR@/lib/metrics \
                           @TOPDIR@/lib/node \
                           @TOPDIR@/lib/net \
+                          @TOPDIR@/lib/pcapng \
                           @TOPDIR@/lib/pci \
                           @TOPDIR@/lib/pdump \
                           @TOPDIR@/lib/pipeline \
diff --git a/doc/guides/howto/img/packet_capture_framework.svg b/doc/guides/howto/img/packet_capture_framework.svg
index a76baf71fdee..1c2646a81096 100644
--- a/doc/guides/howto/img/packet_capture_framework.svg
+++ b/doc/guides/howto/img/packet_capture_framework.svg
@@ -1,6 +1,4 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
 <svg
    xmlns:osb="http://www.openswatchbook.org/uri/2009/osb"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
@@ -16,8 +14,8 @@
    viewBox="0 0 425.19685 283.46457"
    id="svg2"
    version="1.1"
-   inkscape:version="0.91 r13725"
-   sodipodi:docname="drawing-pcap.svg">
+   inkscape:version="1.0.2 (e86c870879, 2021-01-15)"
+   sodipodi:docname="packet_capture_framework.svg">
   <defs
      id="defs4">
     <marker
@@ -228,7 +226,7 @@
        x2="487.64606"
        y2="258.38232"
        gradientUnits="userSpaceOnUse"
-       gradientTransform="translate(-84.916417,744.90779)" />
+       gradientTransform="matrix(1.1457977,0,0,0.99944907,-151.97019,745.05014)" />
     <linearGradient
        inkscape:collect="always"
        xlink:href="#linearGradient5784"
@@ -277,17 +275,18 @@
      borderopacity="1.0"
      inkscape:pageopacity="0.0"
      inkscape:pageshadow="2"
-     inkscape:zoom="0.57434918"
-     inkscape:cx="215.17857"
-     inkscape:cy="285.26445"
+     inkscape:zoom="1"
+     inkscape:cx="226.77165"
+     inkscape:cy="78.124511"
      inkscape:document-units="px"
      inkscape:current-layer="layer1"
      showgrid="false"
-     inkscape:window-width="1874"
-     inkscape:window-height="971"
-     inkscape:window-x="2"
-     inkscape:window-y="24"
-     inkscape:window-maximized="0" />
+     inkscape:window-width="2560"
+     inkscape:window-height="1414"
+     inkscape:window-x="0"
+     inkscape:window-y="0"
+     inkscape:window-maximized="1"
+     inkscape:document-rotation="0" />
   <metadata
      id="metadata7">
     <rdf:RDF>
@@ -296,7 +295,7 @@
         <dc:format>image/svg+xml</dc:format>
         <dc:type
            rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
-        <dc:title></dc:title>
+        <dc:title />
       </cc:Work>
     </rdf:RDF>
   </metadata>
@@ -321,15 +320,15 @@
        y="790.82452" />
     <text
        xml:space="preserve"
-       style="font-style:normal;font-weight:normal;font-size:12.5px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
        x="61.050636"
        y="807.3205"
-       id="text4152"
-       sodipodi:linespacing="125%"><tspan
+       id="text4152"><tspan
          sodipodi:role="line"
          id="tspan4154"
          x="61.050636"
-         y="807.3205">DPDK Primary Application</tspan></text>
+         y="807.3205"
+         style="font-size:12.5px;line-height:1.25">DPDK Primary Application</tspan></text>
     <rect
        style="fill:#000000;fill-opacity:0;stroke:#257cdc;stroke-width:2;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
        id="rect4156-6"
@@ -339,19 +338,20 @@
        y="827.01843" />
     <text
        xml:space="preserve"
-       style="font-style:normal;font-weight:normal;font-size:12.5px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
        x="350.68585"
        y="841.16058"
-       id="text4189"
-       sodipodi:linespacing="125%"><tspan
+       id="text4189"><tspan
          sodipodi:role="line"
          id="tspan4191"
          x="350.68585"
-         y="841.16058">dpdk-pdump</tspan><tspan
+         y="841.16058"
+         style="font-size:12.5px;line-height:1.25">dpdk-dumpcap</tspan><tspan
          sodipodi:role="line"
          x="350.68585"
          y="856.78558"
-         id="tspan4193">tool</tspan></text>
+         id="tspan4193"
+         style="font-size:12.5px;line-height:1.25">tool</tspan></text>
     <rect
        style="fill:#000000;fill-opacity:0;stroke:#257cdc;stroke-width:2;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
        id="rect4156-6-4"
@@ -361,15 +361,15 @@
        y="891.16315" />
     <text
        xml:space="preserve"
-       style="font-style:normal;font-weight:normal;font-size:12.5px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
        x="352.70612"
        y="905.3053"
-       id="text4189-1"
-       sodipodi:linespacing="125%"><tspan
+       id="text4189-1"><tspan
          sodipodi:role="line"
          x="352.70612"
          y="905.3053"
-         id="tspan4193-3">PCAP PMD</tspan></text>
+         id="tspan4193-3"
+         style="font-size:12.5px;line-height:1.25">librte_pcapng</tspan></text>
     <rect
        style="fill:url(#linearGradient5745);fill-opacity:1;stroke:#257cdc;stroke-width:2;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
        id="rect4156-6-6"
@@ -379,15 +379,15 @@
        y="923.9931" />
     <text
        xml:space="preserve"
-       style="font-style:normal;font-weight:normal;font-size:12.5px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
        x="136.02846"
        y="938.13525"
-       id="text4189-0"
-       sodipodi:linespacing="125%"><tspan
+       id="text4189-0"><tspan
          sodipodi:role="line"
          x="136.02846"
          y="938.13525"
-         id="tspan4193-6">dpdk_port0</tspan></text>
+         id="tspan4193-6"
+         style="font-size:12.5px;line-height:1.25">dpdk_port0</tspan></text>
     <rect
        style="fill:#000000;fill-opacity:0;stroke:#257cdc;stroke-width:2;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
        id="rect4156-6-5"
@@ -397,33 +397,33 @@
        y="824.99817" />
     <text
        xml:space="preserve"
-       style="font-style:normal;font-weight:normal;font-size:12.5px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
        x="137.54369"
        y="839.14026"
-       id="text4189-4"
-       sodipodi:linespacing="125%"><tspan
+       id="text4189-4"><tspan
          sodipodi:role="line"
          x="137.54369"
          y="839.14026"
-         id="tspan4193-2">librte_pdump</tspan></text>
+         id="tspan4193-2"
+         style="font-size:12.5px;line-height:1.25">librte_pdump</tspan></text>
     <rect
-       style="fill:url(#linearGradient5788);fill-opacity:1;stroke:#257cdc;stroke-width:1;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       style="fill:url(#linearGradient5788);fill-opacity:1;stroke:#257cdc;stroke-width:1.07013;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
        id="rect4156-6-4-5"
-       width="94.449265"
-       height="35.355339"
-       x="307.7804"
-       y="985.61243" />
+       width="108.21974"
+       height="35.335861"
+       x="297.9809"
+       y="985.62219" />
     <text
        xml:space="preserve"
-       style="font-style:normal;font-weight:normal;font-size:12.5px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
        x="352.70618"
        y="999.75458"
-       id="text4189-1-8"
-       sodipodi:linespacing="125%"><tspan
+       id="text4189-1-8"><tspan
          sodipodi:role="line"
          x="352.70618"
          y="999.75458"
-         id="tspan4193-3-2">capture.pcap</tspan></text>
+         id="tspan4193-3-2"
+         style="font-size:12.5px;line-height:1.25">capture.pcapng</tspan></text>
     <rect
        style="fill:url(#linearGradient5788-1);fill-opacity:1;stroke:#257cdc;stroke-width:1.12555885;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
        id="rect4156-6-4-5-1"
@@ -433,15 +433,15 @@
        y="983.14984" />
     <text
        xml:space="preserve"
-       style="font-style:normal;font-weight:normal;font-size:12.5px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
        x="136.53352"
        y="1002.785"
-       id="text4189-1-8-4"
-       sodipodi:linespacing="125%"><tspan
+       id="text4189-1-8-4"><tspan
          sodipodi:role="line"
          x="136.53352"
          y="1002.785"
-         id="tspan4193-3-2-7">Traffic Generator</tspan></text>
+         id="tspan4193-3-2-7"
+         style="font-size:12.5px;line-height:1.25">Traffic Generator</tspan></text>
     <path
        style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#marker7331)"
        d="m 351.46948,927.02357 c 0,57.5787 0,57.5787 0,57.5787"
diff --git a/doc/guides/howto/packet_capture_framework.rst b/doc/guides/howto/packet_capture_framework.rst
index c31bac52340e..78baa609a021 100644
--- a/doc/guides/howto/packet_capture_framework.rst
+++ b/doc/guides/howto/packet_capture_framework.rst
@@ -1,18 +1,19 @@
 ..  SPDX-License-Identifier: BSD-3-Clause
     Copyright(c) 2017 Intel Corporation.
 
-DPDK pdump Library and pdump Tool
-=================================
+DPDK packet capture libraries and tools
+=======================================
 
 This document describes how the Data Plane Development Kit (DPDK) Packet
 Capture Framework is used for capturing packets on DPDK ports. It is intended
 for users of DPDK who want to know more about the Packet Capture feature and
 for those who want to monitor traffic on DPDK-controlled devices.
 
-The DPDK packet capture framework was introduced in DPDK v16.07. The DPDK
-packet capture framework consists of the DPDK pdump library and DPDK pdump
-tool.
-
+The DPDK packet capture framework was introduced in DPDK v16.07 and
+enhanced in 21.1. The DPDK packet capture framework consists of the
+libraries for collecting packets ``librte_pdump`` and writing packets
+to a file ``librte_pcapng``. There are two sample applications:
+``dpdk-dumpcap`` and older ``dpdk-pdump``.
 
 Introduction
 ------------
@@ -22,43 +23,46 @@ allow users to initialize the packet capture framework and to enable or
 disable packet capture. The library works on a multi process communication model and its
 usage is recommended for debugging purposes.
 
-The :ref:`dpdk-pdump <pdump_tool>` tool is developed based on the
-``librte_pdump`` library.  It runs as a DPDK secondary process and is capable
-of enabling or disabling packet capture on DPDK ports. The ``dpdk-pdump`` tool
-provides command-line options with which users can request enabling or
-disabling of the packet capture on DPDK ports.
+The :ref:`librte_pcapng <pcapng_library>` library provides the APIs to format
+packets and write them to a file in Pcapng format.
+
+
+The :ref:`dpdk-dumpcap <dumpcap_tool>` is a tool that captures packets in
+like Wireshark dumpcap does for Linux. It runs as a DPDK secondary process and
+captures packets from one or more interfaces and writes them to a file
+in Pcapng format.  The ``dpdk-dumpcap`` tool is designed to take
+most of the same options as the Wireshark ``dumpcap`` command.
 
-The application which initializes the packet capture framework will be a primary process
-and the application that enables or disables the packet capture will
-be a secondary process. The primary process sends the Rx and Tx packets from the DPDK ports
-to the secondary process.
+Without any options it will use the packet capture framework to
+capture traffic from the first available DPDK port.
 
 In DPDK the ``testpmd`` application can be used to initialize the packet
-capture framework and acts as a server, and the ``dpdk-pdump`` tool acts as a
+capture framework and acts as a server, and the ``dpdk-dumpcap`` tool acts as a
 client. To view Rx or Tx packets of ``testpmd``, the application should be
-launched first, and then the ``dpdk-pdump`` tool. Packets from ``testpmd``
-will be sent to the tool, which then sends them on to the Pcap PMD device and
-that device writes them to the Pcap file or to an external interface depending
-on the command-line option used.
+launched first, and then the ``dpdk-dumpcap`` tool. Packets from ``testpmd``
+will be sent to the tool, and then to the Pcapng file.
 
 Some things to note:
 
-* The ``dpdk-pdump`` tool can only be used in conjunction with a primary
+* All tools using ``librte_pdump`` can only be used in conjunction with a primary
   application which has the packet capture framework initialized already. In
   dpdk, only ``testpmd`` is modified to initialize packet capture framework,
-  other applications remain untouched. So, if the ``dpdk-pdump`` tool has to
+  other applications remain untouched. So, if the ``dpdk-dumpcap`` tool has to
   be used with any application other than the testpmd, the user needs to
   explicitly modify that application to call the packet capture framework
   initialization code. Refer to the ``app/test-pmd/testpmd.c`` code and look
   for ``pdump`` keyword to see how this is done.
 
-* The ``dpdk-pdump`` tool depends on the libpcap based PMD.
+* The ``dpdk-pdump`` tool is an older tool created as demonstration of ``librte_pdump``
+  library. The ``dpdk-pdump`` tool provides more limited functionality and
+  and depends on the Pcap PMD. It is retained only for compatibility reasons;
+  users should use ``dpdk-dumpcap`` instead.
 
 
 Test Environment
 ----------------
 
-The overview of using the Packet Capture Framework and the ``dpdk-pdump`` tool
+The overview of using the Packet Capture Framework and the ``dpdk-dumpcap`` utility
 for packet capturing on the DPDK port in
 :numref:`figure_packet_capture_framework`.
 
@@ -66,13 +70,13 @@ for packet capturing on the DPDK port in
 
 .. figure:: img/packet_capture_framework.*
 
-   Packet capturing on a DPDK port using the dpdk-pdump tool.
+   Packet capturing on a DPDK port using the dpdk-dumpcap utility.
 
 
 Running the Application
 -----------------------
 
-The following steps demonstrate how to run the ``dpdk-pdump`` tool to capture
+The following steps demonstrate how to run the ``dpdk-dumpcap`` tool to capture
 Rx side packets on dpdk_port0 in :numref:`figure_packet_capture_framework` and
 inspect them using ``tcpdump``.
 
@@ -80,16 +84,15 @@ inspect them using ``tcpdump``.
 
      sudo <build_dir>/app/dpdk-testpmd -c 0xf0 -n 4 -- -i --port-topology=chained
 
-#. Launch the pdump tool as follows::
+#. Launch the dpdk-dump as follows::
 
-     sudo <build_dir>/app/dpdk-pdump -- \
-          --pdump 'port=0,queue=*,rx-dev=/tmp/capture.pcap'
+     sudo <build_dir>/app/dpdk-dumpcap -w /tmp/capture.pcapng
 
 #. Send traffic to dpdk_port0 from traffic generator.
-   Inspect packets captured in the file capture.pcap using a tool
-   that can interpret Pcap files, for example tcpdump::
+   Inspect packets captured in the file capture.pcap using a tool such as
+   tcpdump or tshark that can interpret Pcapng files::
 
-     $tcpdump -nr /tmp/capture.pcap
+     $ tcpdump -nr /tmp/capture.pcapng
      reading from file /tmp/capture.pcap, link-type EN10MB (Ethernet)
      11:11:36.891404 IP 4.4.4.4.whois++ > 3.3.3.3.whois++: UDP, length 18
      11:11:36.891442 IP 4.4.4.4.whois++ > 3.3.3.3.whois++: UDP, length 18
diff --git a/doc/guides/prog_guide/index.rst b/doc/guides/prog_guide/index.rst
index 2dce507f46a3..b440c77c2ba1 100644
--- a/doc/guides/prog_guide/index.rst
+++ b/doc/guides/prog_guide/index.rst
@@ -43,6 +43,7 @@ Programmer's Guide
     ip_fragment_reassembly_lib
     generic_receive_offload_lib
     generic_segmentation_offload_lib
+    pcapng_lib
     pdump_lib
     multi_proc_support
     kernel_nic_interface
diff --git a/doc/guides/prog_guide/pcapng_lib.rst b/doc/guides/prog_guide/pcapng_lib.rst
new file mode 100644
index 000000000000..36379b530a57
--- /dev/null
+++ b/doc/guides/prog_guide/pcapng_lib.rst
@@ -0,0 +1,24 @@
+..  SPDX-License-Identifier: BSD-3-Clause
+    Copyright(c) 2016 Intel Corporation.
+
+.. _pcapng_library:
+
+Packet Capture File Writer
+==========================
+
+Pcapng is a library for creating files in Pcapng file format.
+The Pcapng file format is the default capture file format for modern
+network capture processing tools. It can be read by wireshark and tcpdump.
+
+Usage
+-----
+
+Before the library can be used the function ``rte_pcapng_init``
+should be called once to initialize timestamp computation.
+
+
+References
+----------
+* Draft RFC https://www.ietf.org/id/draft-tuexen-opsawg-pcapng-03.html
+
+* Project repository  https://github.com/pcapng/pcapng/
diff --git a/doc/guides/prog_guide/pdump_lib.rst b/doc/guides/prog_guide/pdump_lib.rst
index 62c0b015b2fe..9af91415e5ea 100644
--- a/doc/guides/prog_guide/pdump_lib.rst
+++ b/doc/guides/prog_guide/pdump_lib.rst
@@ -3,10 +3,10 @@
 
 .. _pdump_library:
 
-The librte_pdump Library
-========================
+The Packet Capture Library
+==========================
 
-The ``librte_pdump`` library provides a framework for packet capturing in DPDK.
+The DPDK ``pdump`` library provides a framework for packet capturing in DPDK.
 The library does the complete copy of the Rx and Tx mbufs to a new mempool and
 hence it slows down the performance of the applications, so it is recommended
 to use this library for debugging purposes.
@@ -23,11 +23,19 @@ or disable the packet capture, and to uninitialize it.
 
 * ``rte_pdump_enable()``:
   This API enables the packet capture on a given port and queue.
-  Note: The filter option in the API is a place holder for future enhancements.
+
+* ``rte_pdump_enable_bpf()``
+  This API enables the packet capture on a given port and queue.
+  It also allows setting an optional filter using DPDK BPF interpreter and
+  setting the captured packet length.
 
 * ``rte_pdump_enable_by_deviceid()``:
   This API enables the packet capture on a given device id (``vdev name or pci address``) and queue.
-  Note: The filter option in the API is a place holder for future enhancements.
+
+* ``rte_pdump_enable_bpf_by_deviceid()``
+  This API enables the packet capture on a given device id (``vdev name or pci address``) and queue.
+  It also allows seating an optional filter using DPDK BPF interpreter and
+  setting the captured packet length.
 
 * ``rte_pdump_disable()``:
   This API disables the packet capture on a given port and queue.
@@ -61,6 +69,12 @@ and enables the packet capture by registering the Ethernet RX and TX callbacks f
 and queue combinations. Then the primary process will mirror the packets to the new mempool and enqueue them to
 the rte_ring that secondary process have passed to these APIs.
 
+The packet ring supports one of two formats. The default format enqueues copies of the original packets
+into the rte_ring. If the ``RTE_PDUMP_FLAG_PCAPNG`` is set the mbuf data is extended with header and trailer
+to match the format of Pcapng enhanced packet block. The enhanced packet block has meta-data such as the
+timestamp, port and queue the packet was captured on. It is up to the application consuming the
+packets from the ring to select the format desired.
+
 The library APIs ``rte_pdump_disable()`` and ``rte_pdump_disable_by_deviceid()`` disables the packet capture.
 For the calls to these APIs from secondary process, the library creates the "pdump disable" request and sends
 the request to the primary process over the multi process channel. The primary process takes this request and
@@ -74,5 +88,5 @@ function.
 Use Case: Packet Capturing
 --------------------------
 
-The DPDK ``app/pdump`` tool is developed based on this library to capture packets in DPDK.
-Users can use this as an example to develop their own packet capturing tools.
+The DPDK ``app/dpdk-dumpcap`` utility uses this library
+to capture packets in DPDK.
diff --git a/doc/guides/rel_notes/release_21_11.rst b/doc/guides/rel_notes/release_21_11.rst
index 675b5738348b..ee24cbfdb99d 100644
--- a/doc/guides/rel_notes/release_21_11.rst
+++ b/doc/guides/rel_notes/release_21_11.rst
@@ -62,6 +62,16 @@ New Features
   * Added bus-level parsing of the devargs syntax.
   * Kept compatibility with the legacy syntax as parsing fallback.
 
+* **Enhance Packet capture.**
+
+  * New dpdk-dumpcap program that has most of the features of the
+    wireshark dumpcap utility including capture of multiple interfaces,
+    stopping after number of bytes, packets.
+  * New library for writing pcapng packet capture files.
+  * Enhancement to the pdump library to support:
+    * Packet filter with BPF.
+    * Pcapng format with timestamps and meta-data.
+    * Fixes packet capture with stripped VLAN tags.
 
 Removed Items
 -------------
diff --git a/doc/guides/tools/dumpcap.rst b/doc/guides/tools/dumpcap.rst
new file mode 100644
index 000000000000..664ea0c79802
--- /dev/null
+++ b/doc/guides/tools/dumpcap.rst
@@ -0,0 +1,86 @@
+..  SPDX-License-Identifier: BSD-3-Clause
+    Copyright(c) 2020 Microsoft Corporation.
+
+.. _dumpcap_tool:
+
+dpdk-dumpcap Application
+========================
+
+The ``dpdk-dumpcap`` tool is a Data Plane Development Kit (DPDK)
+network traffic dump tool.  The interface is similar to  the dumpcap tool in Wireshark.
+It runs as a secondary DPDK process and lets you capture packets that are
+coming into and out of a DPDK primary process.
+The ``dpdk-dumpcap`` writes files in Pcapng packet format using
+capture file format is pcapng.
+
+Without any options set it will use DPDK to capture traffic from the first
+available DPDK interface and write the received raw packet data, along
+with timestamps into a pcapng file.
+
+If the ``-w`` option is not specified, ``dpdk-dumpcap`` writes to a newly
+create file with a name chosen based on interface name and timestamp.
+If ``-w`` option is specified, then that file is used.
+
+   .. Note::
+      * The ``dpdk-dumpcap`` tool can only be used in conjunction with a primary
+        application which has the packet capture framework initialized already.
+        In dpdk, only the ``testpmd`` is modified to initialize packet capture
+        framework, other applications remain untouched. So, if the ``dpdk-dumpcap``
+        tool has to be used with any application other than the testpmd, user
+        needs to explicitly modify that application to call packet capture
+        framework initialization code. Refer ``app/test-pmd/testpmd.c``
+        code to see how this is done.
+
+      * The ``dpdk-dumpcap`` tool runs as a DPDK secondary process. It exits when
+        the primary application exits.
+
+
+Running the Application
+-----------------------
+
+To list interfaces available for capture use ``--list-interfaces``.
+
+To filter packets in style of *tshark* use the ``-f`` flag.
+
+To capture on multiple interfaces at once, use multiple ``-I`` flags.
+
+Example
+-------
+
+.. code-block:: console
+
+   # ./<build_dir>/app/dpdk-dumpcap --list-interfaces
+   0. 000:00:03.0
+   1. 000:00:03.1
+
+   # ./<build_dir>/app/dpdk-dumpcap -I 0000:00:03.0 -c 6 -w /tmp/sample.pcapng
+   Packets captured: 6
+   Packets received/dropped on interface '0000:00:03.0' 6/0
+
+   # ./<build_dir>/app/dpdk-dumpcap -f 'tcp port 80'
+   Packets captured: 6
+   Packets received/dropped on interface '0000:00:03.0' 10/8
+
+
+Limitations
+-----------
+The following option of Wireshark ``dumpcap`` is not yet implemented:
+
+   * ``-b|--ring-buffer`` -- more complex file management.
+
+The following options do not make sense in the context of DPDK.
+
+   * ``-C <byte_limit>`` -- its a kernel thing
+
+   * ``-t`` -- use a thread per interface
+
+   * Timestamp type.
+
+   * Link data types. Only EN10MB (Ethernet) is supported.
+
+   * Wireless related options:  ``-I|--monitor-mode`` and  ``-k <freq>``
+
+
+.. Note::
+   * The options to ``dpdk-dumpcap`` are like the Wireshark dumpcap program and
+     are not the same as ``dpdk-pdump`` and other DPDK applications.
diff --git a/doc/guides/tools/index.rst b/doc/guides/tools/index.rst
index 93dde4148e90..b71c12b8f2dd 100644
--- a/doc/guides/tools/index.rst
+++ b/doc/guides/tools/index.rst
@@ -8,6 +8,7 @@ DPDK Tools User Guides
     :maxdepth: 2
     :numbered:
 
+    dumpcap
     proc_info
     pdump
     pmdinfo
-- 
2.30.2


^ permalink raw reply	[relevance 1%]

* [dpdk-dev] [PATCH v5 6/9] pdump: support pcapng and filtering
  @ 2021-09-08 21:50  1%   ` Stephen Hemminger
  2021-09-08 21:50  1%   ` [dpdk-dev] [PATCH v5 8/9] doc: changes for new pcapng and dumpcap Stephen Hemminger
  1 sibling, 0 replies; 200+ results
From: Stephen Hemminger @ 2021-09-08 21:50 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

This enhances the DPDK pdump library to support new
pcapng format and filtering via BPF.

The internal client/server protocol is changed to support
two versions: the original pdump basic version and a
new pcapng version.

The internal version number (not part of exposed API or ABI)
is intentionally increased to cause any attempt to try
mismatched primary/secondary process to fail.

Add new API to do allow filtering of captured packets with
DPDK BPF (eBPF) filter program. It keeps statistics
on packets captured, filtered, and missed (because ring was full).

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/meson.build       |   4 +-
 lib/pdump/meson.build |   2 +-
 lib/pdump/rte_pdump.c | 437 ++++++++++++++++++++++++++++++------------
 lib/pdump/rte_pdump.h | 110 ++++++++++-
 lib/pdump/version.map |   8 +
 5 files changed, 435 insertions(+), 126 deletions(-)

diff --git a/lib/meson.build b/lib/meson.build
index ba88e9eabc58..aacc33a0f0c0 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -26,6 +26,7 @@ libraries = [
         'timer',   # eventdev depends on this
         'acl',
         'bbdev',
+        'bpf',
         'bitratestats',
         'cfgfile',
         'compressdev',
@@ -43,7 +44,6 @@ libraries = [
         'member',
         'pcapng',
         'power',
-        'pdump',
         'rawdev',
         'regexdev',
         'rib',
@@ -55,10 +55,10 @@ libraries = [
         'ipsec', # ipsec lib depends on net, crypto and security
         'fib', #fib lib depends on rib
         'port', # pkt framework libs which use other libs from above
+	'pdump', # pdump lib depends on bpf pcapng
         'table',
         'pipeline',
         'flow_classify', # flow_classify lib depends on pkt framework table lib
-        'bpf',
         'graph',
         'node',
 ]
diff --git a/lib/pdump/meson.build b/lib/pdump/meson.build
index 3a95eabde6a6..51ceb2afdec5 100644
--- a/lib/pdump/meson.build
+++ b/lib/pdump/meson.build
@@ -3,4 +3,4 @@
 
 sources = files('rte_pdump.c')
 headers = files('rte_pdump.h')
-deps += ['ethdev']
+deps += ['ethdev', 'bpf', 'pcapng']
diff --git a/lib/pdump/rte_pdump.c b/lib/pdump/rte_pdump.c
index 382217bc1564..f2047ad9f001 100644
--- a/lib/pdump/rte_pdump.c
+++ b/lib/pdump/rte_pdump.c
@@ -7,8 +7,10 @@
 #include <rte_ethdev.h>
 #include <rte_lcore.h>
 #include <rte_log.h>
+#include <rte_memzone.h>
 #include <rte_errno.h>
 #include <rte_string_fns.h>
+#include <rte_pcapng.h>
 
 #include "rte_pdump.h"
 
@@ -27,30 +29,26 @@ enum pdump_operation {
 	ENABLE = 2
 };
 
+/*
+ * Note: version numbers intentionally start at 3
+ * in order to catch any application built with older out
+ * version of DPDK using incompatible client request format.
+ */
 enum pdump_version {
-	V1 = 1
+	PDUMP_CLIENT_LEGACY = 3,
+	PDUMP_CLIENT_PCAPNG = 4,
 };
 
 struct pdump_request {
 	uint16_t ver;
 	uint16_t op;
-	uint32_t flags;
-	union pdump_data {
-		struct enable_v1 {
-			char device[RTE_DEV_NAME_MAX_LEN];
-			uint16_t queue;
-			struct rte_ring *ring;
-			struct rte_mempool *mp;
-			void *filter;
-		} en_v1;
-		struct disable_v1 {
-			char device[RTE_DEV_NAME_MAX_LEN];
-			uint16_t queue;
-			struct rte_ring *ring;
-			struct rte_mempool *mp;
-			void *filter;
-		} dis_v1;
-	} data;
+	uint16_t flags;
+	uint16_t queue;
+	struct rte_ring *ring;
+	struct rte_mempool *mp;
+	const struct rte_bpf_prm *prm;
+	uint32_t snaplen;
+	char device[RTE_DEV_NAME_MAX_LEN];
 };
 
 struct pdump_response {
@@ -63,80 +61,140 @@ static struct pdump_rxtx_cbs {
 	struct rte_ring *ring;
 	struct rte_mempool *mp;
 	const struct rte_eth_rxtx_callback *cb;
-	void *filter;
+	const struct rte_bpf *filter;
+	enum pdump_version ver;
+	uint32_t snaplen;
 } rx_cbs[RTE_MAX_ETHPORTS][RTE_MAX_QUEUES_PER_PORT],
 tx_cbs[RTE_MAX_ETHPORTS][RTE_MAX_QUEUES_PER_PORT];
 
-
-static inline void
-pdump_copy(struct rte_mbuf **pkts, uint16_t nb_pkts, void *user_params)
+static const char *MZ_RTE_PDUMP_STATS = "rte_pdump_stats";
+
+/* Shared memory between primary and secondary processes. */
+static struct {
+	struct rte_pdump_stats rx[RTE_MAX_ETHPORTS][RTE_MAX_QUEUES_PER_PORT];
+	struct rte_pdump_stats tx[RTE_MAX_ETHPORTS][RTE_MAX_QUEUES_PER_PORT];
+} *pdump_stats;
+
+/* Create a clone of mbuf to be placed into ring. */
+static void
+pdump_copy(uint16_t port_id, uint16_t queue,
+	   enum rte_pcapng_direction direction,
+	   struct rte_mbuf **pkts, uint16_t nb_pkts,
+	   const struct pdump_rxtx_cbs *cbs,
+	   struct rte_pdump_stats *stats)
 {
 	unsigned int i;
 	int ring_enq;
 	uint16_t d_pkts = 0;
 	struct rte_mbuf *dup_bufs[nb_pkts];
-	struct pdump_rxtx_cbs *cbs;
+	uint64_t ts;
 	struct rte_ring *ring;
 	struct rte_mempool *mp;
 	struct rte_mbuf *p;
+	uint64_t rcs[nb_pkts];
+
+	if (cbs->filter &&
+	    rte_bpf_exec_burst(cbs->filter, (void **)pkts, rcs, nb_pkts) == 0) {
+		/* All packets were filtered out */
+		__atomic_fetch_add(&stats->filtered, nb_pkts,
+				   __ATOMIC_RELAXED);
+		return;
+	}
 
-	cbs  = user_params;
+	ts = rte_get_tsc_cycles();
 	ring = cbs->ring;
 	mp = cbs->mp;
 	for (i = 0; i < nb_pkts; i++) {
-		p = rte_pktmbuf_copy(pkts[i], mp, 0, UINT32_MAX);
-		if (p)
+		/*
+		 * Similar behavior to rte_bpf_eth callback.
+		 * if BPF program returns zero value for a given packet,
+		 * then it will be ignored.
+		 */
+		if (cbs->filter && rcs[i] == 0) {
+			__atomic_fetch_add(&stats->filtered,
+					   1, __ATOMIC_RELAXED);
+			continue;
+		}
+
+		/*
+		 * If using pcapng then want to wrap packets
+		 * otherwise a simple copy.
+		 */
+		if (cbs->ver == PDUMP_CLIENT_PCAPNG)
+			p = rte_pcapng_copy(port_id, queue,
+					    pkts[i], mp, cbs->snaplen,
+					    ts, direction);
+		else
+			p = rte_pktmbuf_copy(pkts[i], mp, 0, cbs->snaplen);
+
+		if (unlikely(p == NULL))
+			__atomic_fetch_add(&stats->nombuf, 1, __ATOMIC_RELAXED);
+		else
 			dup_bufs[d_pkts++] = p;
 	}
 
+	__atomic_fetch_add(&stats->accepted, d_pkts, __ATOMIC_RELAXED);
+
 	ring_enq = rte_ring_enqueue_burst(ring, (void *)dup_bufs, d_pkts, NULL);
 	if (unlikely(ring_enq < d_pkts)) {
 		unsigned int drops = d_pkts - ring_enq;
 
-		PDUMP_LOG(DEBUG,
-			"only %d of packets enqueued to ring\n", ring_enq);
+		__atomic_fetch_add(&stats->ringfull, drops, __ATOMIC_RELAXED);
 		rte_pktmbuf_free_bulk(&dup_bufs[ring_enq], drops);
 	}
 }
 
 static uint16_t
-pdump_rx(uint16_t port __rte_unused, uint16_t qidx __rte_unused,
+pdump_rx(uint16_t port, uint16_t queue,
 	struct rte_mbuf **pkts, uint16_t nb_pkts,
-	uint16_t max_pkts __rte_unused,
-	void *user_params)
+	uint16_t max_pkts __rte_unused, void *user_params)
 {
-	pdump_copy(pkts, nb_pkts, user_params);
+	const struct pdump_rxtx_cbs *cbs = user_params;
+	struct rte_pdump_stats *stats = &pdump_stats->rx[port][queue];
+
+	pdump_copy(port, queue, RTE_PCAPNG_DIRECTION_IN,
+		   pkts, nb_pkts, cbs, stats);
 	return nb_pkts;
 }
 
 static uint16_t
-pdump_tx(uint16_t port __rte_unused, uint16_t qidx __rte_unused,
+pdump_tx(uint16_t port, uint16_t queue,
 		struct rte_mbuf **pkts, uint16_t nb_pkts, void *user_params)
 {
-	pdump_copy(pkts, nb_pkts, user_params);
+	const struct pdump_rxtx_cbs *cbs = user_params;
+	struct rte_pdump_stats *stats = &pdump_stats->tx[port][queue];
+
+	pdump_copy(port, queue, RTE_PCAPNG_DIRECTION_OUT,
+		   pkts, nb_pkts, cbs, stats);
 	return nb_pkts;
 }
 
 static int
-pdump_register_rx_callbacks(uint16_t end_q, uint16_t port, uint16_t queue,
-				struct rte_ring *ring, struct rte_mempool *mp,
-				uint16_t operation)
+pdump_register_rx_callbacks(enum pdump_version ver,
+			    uint16_t end_q, uint16_t port, uint16_t queue,
+			    struct rte_ring *ring, struct rte_mempool *mp,
+			    struct rte_bpf *filter,
+			    uint16_t operation, uint32_t snaplen)
 {
 	uint16_t qid;
-	struct pdump_rxtx_cbs *cbs = NULL;
 
 	qid = (queue == RTE_PDUMP_ALL_QUEUES) ? 0 : queue;
 	for (; qid < end_q; qid++) {
-		cbs = &rx_cbs[port][qid];
-		if (cbs && operation == ENABLE) {
+		struct pdump_rxtx_cbs *cbs = &rx_cbs[port][qid];
+
+		if (operation == ENABLE) {
 			if (cbs->cb) {
 				PDUMP_LOG(ERR,
 					"rx callback for port=%d queue=%d, already exists\n",
 					port, qid);
 				return -EEXIST;
 			}
+			cbs->ver = ver;
 			cbs->ring = ring;
 			cbs->mp = mp;
+			cbs->snaplen = snaplen;
+			cbs->filter = filter;
+
 			cbs->cb = rte_eth_add_first_rx_callback(port, qid,
 								pdump_rx, cbs);
 			if (cbs->cb == NULL) {
@@ -145,8 +203,7 @@ pdump_register_rx_callbacks(uint16_t end_q, uint16_t port, uint16_t queue,
 					rte_errno);
 				return rte_errno;
 			}
-		}
-		if (cbs && operation == DISABLE) {
+		} else if (operation == DISABLE) {
 			int ret;
 
 			if (cbs->cb == NULL) {
@@ -170,26 +227,32 @@ pdump_register_rx_callbacks(uint16_t end_q, uint16_t port, uint16_t queue,
 }
 
 static int
-pdump_register_tx_callbacks(uint16_t end_q, uint16_t port, uint16_t queue,
-				struct rte_ring *ring, struct rte_mempool *mp,
-				uint16_t operation)
+pdump_register_tx_callbacks(enum pdump_version ver,
+			    uint16_t end_q, uint16_t port, uint16_t queue,
+			    struct rte_ring *ring, struct rte_mempool *mp,
+			    struct rte_bpf *filter,
+			    uint16_t operation, uint32_t snaplen)
 {
 
 	uint16_t qid;
-	struct pdump_rxtx_cbs *cbs = NULL;
 
 	qid = (queue == RTE_PDUMP_ALL_QUEUES) ? 0 : queue;
 	for (; qid < end_q; qid++) {
-		cbs = &tx_cbs[port][qid];
-		if (cbs && operation == ENABLE) {
+		struct pdump_rxtx_cbs *cbs = &tx_cbs[port][qid];
+
+		if (operation == ENABLE) {
 			if (cbs->cb) {
 				PDUMP_LOG(ERR,
 					"tx callback for port=%d queue=%d, already exists\n",
 					port, qid);
 				return -EEXIST;
 			}
+			cbs->ver = ver;
 			cbs->ring = ring;
 			cbs->mp = mp;
+			cbs->snaplen = snaplen;
+			cbs->filter = filter;
+
 			cbs->cb = rte_eth_add_tx_callback(port, qid, pdump_tx,
 								cbs);
 			if (cbs->cb == NULL) {
@@ -198,8 +261,7 @@ pdump_register_tx_callbacks(uint16_t end_q, uint16_t port, uint16_t queue,
 					rte_errno);
 				return rte_errno;
 			}
-		}
-		if (cbs && operation == DISABLE) {
+		} else if (operation == DISABLE) {
 			int ret;
 
 			if (cbs->cb == NULL) {
@@ -228,37 +290,47 @@ set_pdump_rxtx_cbs(const struct pdump_request *p)
 	uint16_t nb_rx_q = 0, nb_tx_q = 0, end_q, queue;
 	uint16_t port;
 	int ret = 0;
+	struct rte_bpf *filter = NULL;
 	uint32_t flags;
 	uint16_t operation;
 	struct rte_ring *ring;
 	struct rte_mempool *mp;
 
-	flags = p->flags;
-	operation = p->op;
-	if (operation == ENABLE) {
-		ret = rte_eth_dev_get_port_by_name(p->data.en_v1.device,
-				&port);
-		if (ret < 0) {
+	if (!(p->ver == PDUMP_CLIENT_LEGACY ||
+	      p->ver == PDUMP_CLIENT_PCAPNG)) {
+		PDUMP_LOG(ERR,
+			  "incorrect client version %u\n", p->ver);
+		return -EINVAL;
+	}
+
+	if (p->prm) {
+		if (p->prm->prog_arg.type != RTE_BPF_ARG_PTR_MBUF) {
 			PDUMP_LOG(ERR,
-				"failed to get port id for device id=%s\n",
-				p->data.en_v1.device);
+				  "invalid BPF program type: %u\n",
+				  p->prm->prog_arg.type);
 			return -EINVAL;
 		}
-		queue = p->data.en_v1.queue;
-		ring = p->data.en_v1.ring;
-		mp = p->data.en_v1.mp;
-	} else {
-		ret = rte_eth_dev_get_port_by_name(p->data.dis_v1.device,
-				&port);
-		if (ret < 0) {
-			PDUMP_LOG(ERR,
-				"failed to get port id for device id=%s\n",
-				p->data.dis_v1.device);
-			return -EINVAL;
+
+		filter = rte_bpf_load(p->prm);
+		if (filter == NULL) {
+			PDUMP_LOG(ERR, "cannot load BPF filter: %s\n",
+				  rte_strerror(rte_errno));
+			return -rte_errno;
 		}
-		queue = p->data.dis_v1.queue;
-		ring = p->data.dis_v1.ring;
-		mp = p->data.dis_v1.mp;
+	}
+
+	flags = p->flags;
+	operation = p->op;
+	queue = p->queue;
+	ring = p->ring;
+	mp = p->mp;
+
+	ret = rte_eth_dev_get_port_by_name(p->device, &port);
+	if (ret < 0) {
+		PDUMP_LOG(ERR,
+			  "failed to get port id for device id=%s\n",
+			  p->device);
+		return -EINVAL;
 	}
 
 	/* validation if packet capture is for all queues */
@@ -296,8 +368,9 @@ set_pdump_rxtx_cbs(const struct pdump_request *p)
 	/* register RX callback */
 	if (flags & RTE_PDUMP_FLAG_RX) {
 		end_q = (queue == RTE_PDUMP_ALL_QUEUES) ? nb_rx_q : queue + 1;
-		ret = pdump_register_rx_callbacks(end_q, port, queue, ring, mp,
-							operation);
+		ret = pdump_register_rx_callbacks(p->ver, end_q, port, queue,
+						  ring, mp, filter,
+						  operation, p->snaplen);
 		if (ret < 0)
 			return ret;
 	}
@@ -305,8 +378,9 @@ set_pdump_rxtx_cbs(const struct pdump_request *p)
 	/* register TX callback */
 	if (flags & RTE_PDUMP_FLAG_TX) {
 		end_q = (queue == RTE_PDUMP_ALL_QUEUES) ? nb_tx_q : queue + 1;
-		ret = pdump_register_tx_callbacks(end_q, port, queue, ring, mp,
-							operation);
+		ret = pdump_register_tx_callbacks(p->ver, end_q, port, queue,
+						  ring, mp, filter,
+						  operation, p->snaplen);
 		if (ret < 0)
 			return ret;
 	}
@@ -347,8 +421,18 @@ pdump_server(const struct rte_mp_msg *mp_msg, const void *peer)
 int
 rte_pdump_init(void)
 {
+	const struct rte_memzone *mz;
 	int ret;
 
+	mz = rte_memzone_reserve(MZ_RTE_PDUMP_STATS, sizeof(*pdump_stats),
+				 rte_socket_id(), 0);
+	if (mz == NULL) {
+		PDUMP_LOG(ERR, "cannot allocate pdump statistics\n");
+		rte_errno = ENOMEM;
+		return -1;
+	}
+	pdump_stats = mz->addr;
+
 	ret = rte_mp_action_register(PDUMP_MP, pdump_server);
 	if (ret && rte_errno != ENOTSUP)
 		return -1;
@@ -392,14 +476,21 @@ pdump_validate_ring_mp(struct rte_ring *ring, struct rte_mempool *mp)
 static int
 pdump_validate_flags(uint32_t flags)
 {
-	if (flags != RTE_PDUMP_FLAG_RX && flags != RTE_PDUMP_FLAG_TX &&
-		flags != RTE_PDUMP_FLAG_RXTX) {
+	if ((flags & RTE_PDUMP_FLAG_RXTX) == 0) {
 		PDUMP_LOG(ERR,
 			"invalid flags, should be either rx/tx/rxtx\n");
 		rte_errno = EINVAL;
 		return -1;
 	}
 
+	/* mask off the flags we know about */
+	if (flags & ~(RTE_PDUMP_FLAG_RXTX | RTE_PDUMP_FLAG_PCAPNG)) {
+		PDUMP_LOG(ERR,
+			  "unknown flags: %#x\n", flags);
+		rte_errno = ENOTSUP;
+		return -1;
+	}
+
 	return 0;
 }
 
@@ -426,12 +517,12 @@ pdump_validate_port(uint16_t port, char *name)
 }
 
 static int
-pdump_prepare_client_request(char *device, uint16_t queue,
-				uint32_t flags,
-				uint16_t operation,
-				struct rte_ring *ring,
-				struct rte_mempool *mp,
-				void *filter)
+pdump_prepare_client_request(const char *device, uint16_t queue,
+			     uint32_t flags, uint32_t snaplen,
+			     uint16_t operation,
+			     struct rte_ring *ring,
+			     struct rte_mempool *mp,
+			     const struct rte_bpf_prm *prm)
 {
 	int ret = -1;
 	struct rte_mp_msg mp_req, *mp_rep;
@@ -440,23 +531,23 @@ pdump_prepare_client_request(char *device, uint16_t queue,
 	struct pdump_request *req = (struct pdump_request *)mp_req.param;
 	struct pdump_response *resp;
 
-	req->ver = 1;
-	req->flags = flags;
+	memset(req, 0, sizeof(*req));
+	if (flags & RTE_PDUMP_FLAG_PCAPNG)
+		req->ver = PDUMP_CLIENT_PCAPNG;
+	else
+		req->ver = PDUMP_CLIENT_LEGACY;
+
+	req->flags = flags & RTE_PDUMP_FLAG_RXTX;
 	req->op = operation;
+	req->queue = queue;
+	strlcpy(req->device, device, sizeof(req->device));
+
 	if ((operation & ENABLE) != 0) {
-		strlcpy(req->data.en_v1.device, device,
-			sizeof(req->data.en_v1.device));
-		req->data.en_v1.queue = queue;
-		req->data.en_v1.ring = ring;
-		req->data.en_v1.mp = mp;
-		req->data.en_v1.filter = filter;
-	} else {
-		strlcpy(req->data.dis_v1.device, device,
-			sizeof(req->data.dis_v1.device));
-		req->data.dis_v1.queue = queue;
-		req->data.dis_v1.ring = NULL;
-		req->data.dis_v1.mp = NULL;
-		req->data.dis_v1.filter = NULL;
+		req->queue = queue;
+		req->ring = ring;
+		req->mp = mp;
+		req->prm = prm;
+		req->snaplen = snaplen;
 	}
 
 	strlcpy(mp_req.name, PDUMP_MP, RTE_MP_MAX_NAME_LEN);
@@ -477,11 +568,17 @@ pdump_prepare_client_request(char *device, uint16_t queue,
 	return ret;
 }
 
-int
-rte_pdump_enable(uint16_t port, uint16_t queue, uint32_t flags,
-			struct rte_ring *ring,
-			struct rte_mempool *mp,
-			void *filter)
+/*
+ * There are two versions of this function, because although original API
+ * left place holder for future filter, it never checked the value.
+ * Therefore the API can't depend on application passing a non
+ * bogus value.
+ */
+static int
+pdump_enable(uint16_t port, uint16_t queue,
+	     uint32_t flags, uint32_t snaplen,
+	     struct rte_ring *ring, struct rte_mempool *mp,
+	     const struct rte_bpf_prm *prm)
 {
 	int ret;
 	char name[RTE_DEV_NAME_MAX_LEN];
@@ -496,20 +593,42 @@ rte_pdump_enable(uint16_t port, uint16_t queue, uint32_t flags,
 	if (ret < 0)
 		return ret;
 
-	ret = pdump_prepare_client_request(name, queue, flags,
-						ENABLE, ring, mp, filter);
+	if (snaplen == 0)
+		snaplen = UINT32_MAX;
 
-	return ret;
+	return pdump_prepare_client_request(name, queue, flags, snaplen,
+					    ENABLE, ring, mp, prm);
 }
 
 int
-rte_pdump_enable_by_deviceid(char *device_id, uint16_t queue,
-				uint32_t flags,
-				struct rte_ring *ring,
-				struct rte_mempool *mp,
-				void *filter)
+rte_pdump_enable(uint16_t port, uint16_t queue, uint32_t flags,
+		 struct rte_ring *ring,
+		 struct rte_mempool *mp,
+		 void *filter __rte_unused)
 {
-	int ret = 0;
+	return pdump_enable(port, queue, flags, 0,
+			    ring, mp, NULL);
+}
+
+int
+rte_pdump_enable_bpf(uint16_t port, uint16_t queue,
+		     uint32_t flags, uint32_t snaplen,
+		     struct rte_ring *ring,
+		     struct rte_mempool *mp,
+		     const struct rte_bpf_prm *prm)
+{
+	return pdump_enable(port, queue, flags, snaplen,
+			    ring, mp, prm);
+}
+
+static int
+pdump_enable_by_deviceid(const char *device_id, uint16_t queue,
+			 uint32_t flags, uint32_t snaplen,
+			 struct rte_ring *ring,
+			 struct rte_mempool *mp,
+			 const struct rte_bpf_prm *prm)
+{
+	int ret;
 
 	ret = pdump_validate_ring_mp(ring, mp);
 	if (ret < 0)
@@ -518,10 +637,30 @@ rte_pdump_enable_by_deviceid(char *device_id, uint16_t queue,
 	if (ret < 0)
 		return ret;
 
-	ret = pdump_prepare_client_request(device_id, queue, flags,
-						ENABLE, ring, mp, filter);
+	return pdump_prepare_client_request(device_id, queue, flags, snaplen,
+					    ENABLE, ring, mp, prm);
+}
 
-	return ret;
+int
+rte_pdump_enable_by_deviceid(char *device_id, uint16_t queue,
+			     uint32_t flags,
+			     struct rte_ring *ring,
+			     struct rte_mempool *mp,
+			     void *filter __rte_unused)
+{
+	return pdump_enable_by_deviceid(device_id, queue, flags, 0,
+					ring, mp, NULL);
+}
+
+int
+rte_pdump_enable_bpf_by_deviceid(const char *device_id, uint16_t queue,
+				 uint32_t flags, uint32_t snaplen,
+				 struct rte_ring *ring,
+				 struct rte_mempool *mp,
+				 const struct rte_bpf_prm *prm)
+{
+	return pdump_enable_by_deviceid(device_id, queue, flags, snaplen,
+					ring, mp, prm);
 }
 
 int
@@ -537,8 +676,8 @@ rte_pdump_disable(uint16_t port, uint16_t queue, uint32_t flags)
 	if (ret < 0)
 		return ret;
 
-	ret = pdump_prepare_client_request(name, queue, flags,
-						DISABLE, NULL, NULL, NULL);
+	ret = pdump_prepare_client_request(name, queue, flags, 0,
+					   DISABLE, NULL, NULL, NULL);
 
 	return ret;
 }
@@ -553,8 +692,66 @@ rte_pdump_disable_by_deviceid(char *device_id, uint16_t queue,
 	if (ret < 0)
 		return ret;
 
-	ret = pdump_prepare_client_request(device_id, queue, flags,
-						DISABLE, NULL, NULL, NULL);
+	ret = pdump_prepare_client_request(device_id, queue, flags, 0,
+					   DISABLE, NULL, NULL, NULL);
 
 	return ret;
 }
+
+static void
+pdump_sum_stats(uint16_t port, uint16_t nq,
+		struct rte_pdump_stats stats[RTE_MAX_ETHPORTS][RTE_MAX_QUEUES_PER_PORT],
+		struct rte_pdump_stats *total)
+{
+	uint64_t *sum = (uint64_t *)total;
+	unsigned int i;
+	uint64_t val;
+	uint16_t qid;
+
+	for (qid = 0; qid < nq; qid++) {
+		const uint64_t *perq = (const uint64_t *)&stats[port][qid];
+
+		for (i = 0; i < sizeof(*total) / sizeof(uint64_t); i++) {
+			val = __atomic_load_n(&perq[i], __ATOMIC_RELAXED);
+			sum[i] += val;
+		}
+	}
+}
+
+int
+rte_pdump_stats(uint16_t port, struct rte_pdump_stats *stats)
+{
+	struct rte_eth_dev_info dev_info;
+	const struct rte_memzone *mz;
+	int ret;
+
+	memset(stats, 0, sizeof(*stats));
+	ret = rte_eth_dev_info_get(port, &dev_info);
+	if (ret != 0) {
+		PDUMP_LOG(ERR,
+			  "Error during getting device (port %u) info: %s\n",
+			  port, strerror(-ret));
+		return ret;
+	}
+
+	if (pdump_stats == NULL) {
+		if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
+			PDUMP_LOG(ERR,
+				  "pdump not initialized\n");
+			rte_errno = EINVAL;
+			return -1;
+		}
+
+		mz = rte_memzone_lookup(MZ_RTE_PDUMP_STATS);
+		if (mz == NULL) {
+			PDUMP_LOG(ERR, "can not find pdump stats\n");
+			rte_errno = EINVAL;
+			return -1;
+		}
+		pdump_stats = mz->addr;
+	}
+
+	pdump_sum_stats(port, dev_info.nb_rx_queues, pdump_stats->rx, stats);
+	pdump_sum_stats(port, dev_info.nb_tx_queues, pdump_stats->tx, stats);
+	return 0;
+}
diff --git a/lib/pdump/rte_pdump.h b/lib/pdump/rte_pdump.h
index 6b00fc17aeb2..be3fd14c4bd3 100644
--- a/lib/pdump/rte_pdump.h
+++ b/lib/pdump/rte_pdump.h
@@ -15,6 +15,7 @@
 #include <stdint.h>
 #include <rte_mempool.h>
 #include <rte_ring.h>
+#include <rte_bpf.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -26,7 +27,9 @@ enum {
 	RTE_PDUMP_FLAG_RX = 1,  /* receive direction */
 	RTE_PDUMP_FLAG_TX = 2,  /* transmit direction */
 	/* both receive and transmit directions */
-	RTE_PDUMP_FLAG_RXTX = (RTE_PDUMP_FLAG_RX|RTE_PDUMP_FLAG_TX)
+	RTE_PDUMP_FLAG_RXTX = (RTE_PDUMP_FLAG_RX|RTE_PDUMP_FLAG_TX),
+
+	RTE_PDUMP_FLAG_PCAPNG = 4, /* format for pcapng */
 };
 
 /**
@@ -68,7 +71,7 @@ rte_pdump_uninit(void);
  * @param mp
  *  mempool on to which original packets will be mirrored or duplicated.
  * @param filter
- *  place holder for packet filtering.
+ *  Unused should be NULL.
  *
  * @return
  *    0 on success, -1 on error, rte_errno is set accordingly.
@@ -80,6 +83,41 @@ rte_pdump_enable(uint16_t port, uint16_t queue, uint32_t flags,
 		struct rte_mempool *mp,
 		void *filter);
 
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
+ *
+ * Enables packet capturing on given port and queue with filtering.
+ *
+ * @param port_id
+ *  The Ethernet port on which packet capturing should be enabled.
+ * @param queue
+ *  The queue on the Ethernet port which packet capturing
+ *  should be enabled. Pass UINT16_MAX to enable packet capturing on all
+ *  queues of a given port.
+ * @param flags
+ *  Pdump library flags that specify direction and packet format.
+ * @param snaplen
+ *  The upper limit on bytes to copy.
+ *  Passing UINT32_MAX means capture all the possible data.
+ * @param ring
+ *  The ring on which captured packets will be enqueued for user.
+ * @param mp
+ *  The mempool on to which original packets will be mirrored or duplicated.
+ * @param prm
+ *  Use BPF program to run to filter packes (can be NULL)
+ *
+ * @return
+ *    0 on success, -1 on error, rte_errno is set accordingly.
+ */
+__rte_experimental
+int
+rte_pdump_enable_bpf(uint16_t port_id, uint16_t queue,
+		     uint32_t flags, uint32_t snaplen,
+		     struct rte_ring *ring,
+		     struct rte_mempool *mp,
+		     const struct rte_bpf_prm *prm);
+
 /**
  * Disables packet capturing on given port and queue.
  *
@@ -118,7 +156,7 @@ rte_pdump_disable(uint16_t port, uint16_t queue, uint32_t flags);
  * @param mp
  *  mempool on to which original packets will be mirrored or duplicated.
  * @param filter
- *  place holder for packet filtering.
+ *  unused should be NULL
  *
  * @return
  *    0 on success, -1 on error, rte_errno is set accordingly.
@@ -131,6 +169,43 @@ rte_pdump_enable_by_deviceid(char *device_id, uint16_t queue,
 				struct rte_mempool *mp,
 				void *filter);
 
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
+ *
+ * Enables packet capturing on given device id and queue with filtering.
+ * device_id can be name or pci address of device.
+ *
+ * @param device_id
+ *  device id on which packet capturing should be enabled.
+ * @param queue
+ *  The queue on the Ethernet port which packet capturing
+ *  should be enabled. Pass UINT16_MAX to enable packet capturing on all
+ *  queues of a given port.
+ * @param flags
+ *  Pdump library flags that specify direction and packet format.
+ * @param snaplen
+ *  The upper limit on bytes to copy.
+ *  Passing UINT32_MAX means capture all the possible data.
+ * @param ring
+ *  The ring on which captured packets will be enqueued for user.
+ * @param mp
+ *  The mempool on to which original packets will be mirrored or duplicated.
+ * @param filter
+ *  Use BPF program to run to filter packes (can be NULL)
+ *
+ * @return
+ *    0 on success, -1 on error, rte_errno is set accordingly.
+ */
+__rte_experimental
+int
+rte_pdump_enable_bpf_by_deviceid(const char *device_id, uint16_t queue,
+				 uint32_t flags, uint32_t snaplen,
+				 struct rte_ring *ring,
+				 struct rte_mempool *mp,
+				 const struct rte_bpf_prm *filter);
+
+
 /**
  * Disables packet capturing on given device_id and queue.
  * device_id can be name or pci address of device.
@@ -153,6 +228,35 @@ int
 rte_pdump_disable_by_deviceid(char *device_id, uint16_t queue,
 				uint32_t flags);
 
+
+/**
+ * A structure used to retrieve statistics from packet capture.
+ * The statistics are sum of both receive and transmit queues.
+ */
+struct rte_pdump_stats {
+	uint64_t accepted; /**< Number of packets accepted by filter. */
+	uint64_t filtered; /**< Number of packets rejected by filter. */
+	uint64_t nombuf;   /**< Number of mbuf allocation failures. */
+	uint64_t ringfull; /**< Number of missed packets due to ring full. */
+
+	uint64_t reserved[4]; /**< Reserved and pad to cache line */
+};
+
+/**
+ * Retrieve the packet capture statistics for a queue.
+ *
+ * @param port_id
+ *   The port identifier of the Ethernet device.
+ * @param stats
+ *   A pointer to structure of type *rte_pdump_stats* to be filled in.
+ * @return
+ *   Zero if successful. -1 on error and rte_errno is set.
+ */
+__rte_experimental
+int
+rte_pdump_stats(uint16_t port_id, struct rte_pdump_stats *stats);
+
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/lib/pdump/version.map b/lib/pdump/version.map
index f0a9d12c9a9e..ce5502d9cdf4 100644
--- a/lib/pdump/version.map
+++ b/lib/pdump/version.map
@@ -10,3 +10,11 @@ DPDK_22 {
 
 	local: *;
 };
+
+EXPERIMENTAL {
+	global:
+
+	rte_pdump_enable_bpf;
+	rte_pdump_enable_bpf_by_deviceid;
+	rte_pdump_stats;
+};
-- 
2.30.2


^ permalink raw reply	[relevance 1%]

* [dpdk-dev] [PATCH v5 8/9] doc: changes for new pcapng and dumpcap
    2021-09-08 21:50  1%   ` [dpdk-dev] [PATCH v5 6/9] pdump: support pcapng and filtering Stephen Hemminger
@ 2021-09-08 21:50  1%   ` Stephen Hemminger
  1 sibling, 0 replies; 200+ results
From: Stephen Hemminger @ 2021-09-08 21:50 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

Describe the new packet capture library and utilities

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 doc/api/doxy-api-index.md                     |  1 +
 doc/api/doxy-api.conf.in                      |  1 +
 .../howto/img/packet_capture_framework.svg    | 96 +++++++++----------
 doc/guides/howto/packet_capture_framework.rst | 67 ++++++-------
 doc/guides/prog_guide/index.rst               |  1 +
 doc/guides/prog_guide/pcapng_lib.rst          | 24 +++++
 doc/guides/prog_guide/pdump_lib.rst           | 28 ++++--
 doc/guides/rel_notes/release_21_11.rst        | 10 ++
 doc/guides/tools/dumpcap.rst                  | 86 +++++++++++++++++
 doc/guides/tools/index.rst                    |  1 +
 10 files changed, 228 insertions(+), 87 deletions(-)
 create mode 100644 doc/guides/prog_guide/pcapng_lib.rst
 create mode 100644 doc/guides/tools/dumpcap.rst

diff --git a/doc/api/doxy-api-index.md b/doc/api/doxy-api-index.md
index 1992107a0356..ee07394d1c78 100644
--- a/doc/api/doxy-api-index.md
+++ b/doc/api/doxy-api-index.md
@@ -223,3 +223,4 @@ The public API headers are grouped by topics:
   [experimental APIs]  (@ref rte_compat.h),
   [ABI versioning]     (@ref rte_function_versioning.h),
   [version]            (@ref rte_version.h)
+  [pcapng]             (@ref rte_pcapng.h)
diff --git a/doc/api/doxy-api.conf.in b/doc/api/doxy-api.conf.in
index 325a0195c6ab..aba17799a9a1 100644
--- a/doc/api/doxy-api.conf.in
+++ b/doc/api/doxy-api.conf.in
@@ -58,6 +58,7 @@ INPUT                   = @TOPDIR@/doc/api/doxy-api-index.md \
                           @TOPDIR@/lib/metrics \
                           @TOPDIR@/lib/node \
                           @TOPDIR@/lib/net \
+                          @TOPDIR@/lib/pcapng \
                           @TOPDIR@/lib/pci \
                           @TOPDIR@/lib/pdump \
                           @TOPDIR@/lib/pipeline \
diff --git a/doc/guides/howto/img/packet_capture_framework.svg b/doc/guides/howto/img/packet_capture_framework.svg
index a76baf71fdee..1c2646a81096 100644
--- a/doc/guides/howto/img/packet_capture_framework.svg
+++ b/doc/guides/howto/img/packet_capture_framework.svg
@@ -1,6 +1,4 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
 <svg
    xmlns:osb="http://www.openswatchbook.org/uri/2009/osb"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
@@ -16,8 +14,8 @@
    viewBox="0 0 425.19685 283.46457"
    id="svg2"
    version="1.1"
-   inkscape:version="0.91 r13725"
-   sodipodi:docname="drawing-pcap.svg">
+   inkscape:version="1.0.2 (e86c870879, 2021-01-15)"
+   sodipodi:docname="packet_capture_framework.svg">
   <defs
      id="defs4">
     <marker
@@ -228,7 +226,7 @@
        x2="487.64606"
        y2="258.38232"
        gradientUnits="userSpaceOnUse"
-       gradientTransform="translate(-84.916417,744.90779)" />
+       gradientTransform="matrix(1.1457977,0,0,0.99944907,-151.97019,745.05014)" />
     <linearGradient
        inkscape:collect="always"
        xlink:href="#linearGradient5784"
@@ -277,17 +275,18 @@
      borderopacity="1.0"
      inkscape:pageopacity="0.0"
      inkscape:pageshadow="2"
-     inkscape:zoom="0.57434918"
-     inkscape:cx="215.17857"
-     inkscape:cy="285.26445"
+     inkscape:zoom="1"
+     inkscape:cx="226.77165"
+     inkscape:cy="78.124511"
      inkscape:document-units="px"
      inkscape:current-layer="layer1"
      showgrid="false"
-     inkscape:window-width="1874"
-     inkscape:window-height="971"
-     inkscape:window-x="2"
-     inkscape:window-y="24"
-     inkscape:window-maximized="0" />
+     inkscape:window-width="2560"
+     inkscape:window-height="1414"
+     inkscape:window-x="0"
+     inkscape:window-y="0"
+     inkscape:window-maximized="1"
+     inkscape:document-rotation="0" />
   <metadata
      id="metadata7">
     <rdf:RDF>
@@ -296,7 +295,7 @@
         <dc:format>image/svg+xml</dc:format>
         <dc:type
            rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
-        <dc:title></dc:title>
+        <dc:title />
       </cc:Work>
     </rdf:RDF>
   </metadata>
@@ -321,15 +320,15 @@
        y="790.82452" />
     <text
        xml:space="preserve"
-       style="font-style:normal;font-weight:normal;font-size:12.5px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
        x="61.050636"
        y="807.3205"
-       id="text4152"
-       sodipodi:linespacing="125%"><tspan
+       id="text4152"><tspan
          sodipodi:role="line"
          id="tspan4154"
          x="61.050636"
-         y="807.3205">DPDK Primary Application</tspan></text>
+         y="807.3205"
+         style="font-size:12.5px;line-height:1.25">DPDK Primary Application</tspan></text>
     <rect
        style="fill:#000000;fill-opacity:0;stroke:#257cdc;stroke-width:2;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
        id="rect4156-6"
@@ -339,19 +338,20 @@
        y="827.01843" />
     <text
        xml:space="preserve"
-       style="font-style:normal;font-weight:normal;font-size:12.5px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
        x="350.68585"
        y="841.16058"
-       id="text4189"
-       sodipodi:linespacing="125%"><tspan
+       id="text4189"><tspan
          sodipodi:role="line"
          id="tspan4191"
          x="350.68585"
-         y="841.16058">dpdk-pdump</tspan><tspan
+         y="841.16058"
+         style="font-size:12.5px;line-height:1.25">dpdk-dumpcap</tspan><tspan
          sodipodi:role="line"
          x="350.68585"
          y="856.78558"
-         id="tspan4193">tool</tspan></text>
+         id="tspan4193"
+         style="font-size:12.5px;line-height:1.25">tool</tspan></text>
     <rect
        style="fill:#000000;fill-opacity:0;stroke:#257cdc;stroke-width:2;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
        id="rect4156-6-4"
@@ -361,15 +361,15 @@
        y="891.16315" />
     <text
        xml:space="preserve"
-       style="font-style:normal;font-weight:normal;font-size:12.5px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
        x="352.70612"
        y="905.3053"
-       id="text4189-1"
-       sodipodi:linespacing="125%"><tspan
+       id="text4189-1"><tspan
          sodipodi:role="line"
          x="352.70612"
          y="905.3053"
-         id="tspan4193-3">PCAP PMD</tspan></text>
+         id="tspan4193-3"
+         style="font-size:12.5px;line-height:1.25">librte_pcapng</tspan></text>
     <rect
        style="fill:url(#linearGradient5745);fill-opacity:1;stroke:#257cdc;stroke-width:2;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
        id="rect4156-6-6"
@@ -379,15 +379,15 @@
        y="923.9931" />
     <text
        xml:space="preserve"
-       style="font-style:normal;font-weight:normal;font-size:12.5px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
        x="136.02846"
        y="938.13525"
-       id="text4189-0"
-       sodipodi:linespacing="125%"><tspan
+       id="text4189-0"><tspan
          sodipodi:role="line"
          x="136.02846"
          y="938.13525"
-         id="tspan4193-6">dpdk_port0</tspan></text>
+         id="tspan4193-6"
+         style="font-size:12.5px;line-height:1.25">dpdk_port0</tspan></text>
     <rect
        style="fill:#000000;fill-opacity:0;stroke:#257cdc;stroke-width:2;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
        id="rect4156-6-5"
@@ -397,33 +397,33 @@
        y="824.99817" />
     <text
        xml:space="preserve"
-       style="font-style:normal;font-weight:normal;font-size:12.5px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
        x="137.54369"
        y="839.14026"
-       id="text4189-4"
-       sodipodi:linespacing="125%"><tspan
+       id="text4189-4"><tspan
          sodipodi:role="line"
          x="137.54369"
          y="839.14026"
-         id="tspan4193-2">librte_pdump</tspan></text>
+         id="tspan4193-2"
+         style="font-size:12.5px;line-height:1.25">librte_pdump</tspan></text>
     <rect
-       style="fill:url(#linearGradient5788);fill-opacity:1;stroke:#257cdc;stroke-width:1;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       style="fill:url(#linearGradient5788);fill-opacity:1;stroke:#257cdc;stroke-width:1.07013;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
        id="rect4156-6-4-5"
-       width="94.449265"
-       height="35.355339"
-       x="307.7804"
-       y="985.61243" />
+       width="108.21974"
+       height="35.335861"
+       x="297.9809"
+       y="985.62219" />
     <text
        xml:space="preserve"
-       style="font-style:normal;font-weight:normal;font-size:12.5px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
        x="352.70618"
        y="999.75458"
-       id="text4189-1-8"
-       sodipodi:linespacing="125%"><tspan
+       id="text4189-1-8"><tspan
          sodipodi:role="line"
          x="352.70618"
          y="999.75458"
-         id="tspan4193-3-2">capture.pcap</tspan></text>
+         id="tspan4193-3-2"
+         style="font-size:12.5px;line-height:1.25">capture.pcapng</tspan></text>
     <rect
        style="fill:url(#linearGradient5788-1);fill-opacity:1;stroke:#257cdc;stroke-width:1.12555885;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
        id="rect4156-6-4-5-1"
@@ -433,15 +433,15 @@
        y="983.14984" />
     <text
        xml:space="preserve"
-       style="font-style:normal;font-weight:normal;font-size:12.5px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
        x="136.53352"
        y="1002.785"
-       id="text4189-1-8-4"
-       sodipodi:linespacing="125%"><tspan
+       id="text4189-1-8-4"><tspan
          sodipodi:role="line"
          x="136.53352"
          y="1002.785"
-         id="tspan4193-3-2-7">Traffic Generator</tspan></text>
+         id="tspan4193-3-2-7"
+         style="font-size:12.5px;line-height:1.25">Traffic Generator</tspan></text>
     <path
        style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#marker7331)"
        d="m 351.46948,927.02357 c 0,57.5787 0,57.5787 0,57.5787"
diff --git a/doc/guides/howto/packet_capture_framework.rst b/doc/guides/howto/packet_capture_framework.rst
index c31bac52340e..78baa609a021 100644
--- a/doc/guides/howto/packet_capture_framework.rst
+++ b/doc/guides/howto/packet_capture_framework.rst
@@ -1,18 +1,19 @@
 ..  SPDX-License-Identifier: BSD-3-Clause
     Copyright(c) 2017 Intel Corporation.
 
-DPDK pdump Library and pdump Tool
-=================================
+DPDK packet capture libraries and tools
+=======================================
 
 This document describes how the Data Plane Development Kit (DPDK) Packet
 Capture Framework is used for capturing packets on DPDK ports. It is intended
 for users of DPDK who want to know more about the Packet Capture feature and
 for those who want to monitor traffic on DPDK-controlled devices.
 
-The DPDK packet capture framework was introduced in DPDK v16.07. The DPDK
-packet capture framework consists of the DPDK pdump library and DPDK pdump
-tool.
-
+The DPDK packet capture framework was introduced in DPDK v16.07 and
+enhanced in 21.1. The DPDK packet capture framework consists of the
+libraries for collecting packets ``librte_pdump`` and writing packets
+to a file ``librte_pcapng``. There are two sample applications:
+``dpdk-dumpcap`` and older ``dpdk-pdump``.
 
 Introduction
 ------------
@@ -22,43 +23,46 @@ allow users to initialize the packet capture framework and to enable or
 disable packet capture. The library works on a multi process communication model and its
 usage is recommended for debugging purposes.
 
-The :ref:`dpdk-pdump <pdump_tool>` tool is developed based on the
-``librte_pdump`` library.  It runs as a DPDK secondary process and is capable
-of enabling or disabling packet capture on DPDK ports. The ``dpdk-pdump`` tool
-provides command-line options with which users can request enabling or
-disabling of the packet capture on DPDK ports.
+The :ref:`librte_pcapng <pcapng_library>` library provides the APIs to format
+packets and write them to a file in Pcapng format.
+
+
+The :ref:`dpdk-dumpcap <dumpcap_tool>` is a tool that captures packets in
+like Wireshark dumpcap does for Linux. It runs as a DPDK secondary process and
+captures packets from one or more interfaces and writes them to a file
+in Pcapng format.  The ``dpdk-dumpcap`` tool is designed to take
+most of the same options as the Wireshark ``dumpcap`` command.
 
-The application which initializes the packet capture framework will be a primary process
-and the application that enables or disables the packet capture will
-be a secondary process. The primary process sends the Rx and Tx packets from the DPDK ports
-to the secondary process.
+Without any options it will use the packet capture framework to
+capture traffic from the first available DPDK port.
 
 In DPDK the ``testpmd`` application can be used to initialize the packet
-capture framework and acts as a server, and the ``dpdk-pdump`` tool acts as a
+capture framework and acts as a server, and the ``dpdk-dumpcap`` tool acts as a
 client. To view Rx or Tx packets of ``testpmd``, the application should be
-launched first, and then the ``dpdk-pdump`` tool. Packets from ``testpmd``
-will be sent to the tool, which then sends them on to the Pcap PMD device and
-that device writes them to the Pcap file or to an external interface depending
-on the command-line option used.
+launched first, and then the ``dpdk-dumpcap`` tool. Packets from ``testpmd``
+will be sent to the tool, and then to the Pcapng file.
 
 Some things to note:
 
-* The ``dpdk-pdump`` tool can only be used in conjunction with a primary
+* All tools using ``librte_pdump`` can only be used in conjunction with a primary
   application which has the packet capture framework initialized already. In
   dpdk, only ``testpmd`` is modified to initialize packet capture framework,
-  other applications remain untouched. So, if the ``dpdk-pdump`` tool has to
+  other applications remain untouched. So, if the ``dpdk-dumpcap`` tool has to
   be used with any application other than the testpmd, the user needs to
   explicitly modify that application to call the packet capture framework
   initialization code. Refer to the ``app/test-pmd/testpmd.c`` code and look
   for ``pdump`` keyword to see how this is done.
 
-* The ``dpdk-pdump`` tool depends on the libpcap based PMD.
+* The ``dpdk-pdump`` tool is an older tool created as demonstration of ``librte_pdump``
+  library. The ``dpdk-pdump`` tool provides more limited functionality and
+  and depends on the Pcap PMD. It is retained only for compatibility reasons;
+  users should use ``dpdk-dumpcap`` instead.
 
 
 Test Environment
 ----------------
 
-The overview of using the Packet Capture Framework and the ``dpdk-pdump`` tool
+The overview of using the Packet Capture Framework and the ``dpdk-dumpcap`` utility
 for packet capturing on the DPDK port in
 :numref:`figure_packet_capture_framework`.
 
@@ -66,13 +70,13 @@ for packet capturing on the DPDK port in
 
 .. figure:: img/packet_capture_framework.*
 
-   Packet capturing on a DPDK port using the dpdk-pdump tool.
+   Packet capturing on a DPDK port using the dpdk-dumpcap utility.
 
 
 Running the Application
 -----------------------
 
-The following steps demonstrate how to run the ``dpdk-pdump`` tool to capture
+The following steps demonstrate how to run the ``dpdk-dumpcap`` tool to capture
 Rx side packets on dpdk_port0 in :numref:`figure_packet_capture_framework` and
 inspect them using ``tcpdump``.
 
@@ -80,16 +84,15 @@ inspect them using ``tcpdump``.
 
      sudo <build_dir>/app/dpdk-testpmd -c 0xf0 -n 4 -- -i --port-topology=chained
 
-#. Launch the pdump tool as follows::
+#. Launch the dpdk-dump as follows::
 
-     sudo <build_dir>/app/dpdk-pdump -- \
-          --pdump 'port=0,queue=*,rx-dev=/tmp/capture.pcap'
+     sudo <build_dir>/app/dpdk-dumpcap -w /tmp/capture.pcapng
 
 #. Send traffic to dpdk_port0 from traffic generator.
-   Inspect packets captured in the file capture.pcap using a tool
-   that can interpret Pcap files, for example tcpdump::
+   Inspect packets captured in the file capture.pcap using a tool such as
+   tcpdump or tshark that can interpret Pcapng files::
 
-     $tcpdump -nr /tmp/capture.pcap
+     $ tcpdump -nr /tmp/capture.pcapng
      reading from file /tmp/capture.pcap, link-type EN10MB (Ethernet)
      11:11:36.891404 IP 4.4.4.4.whois++ > 3.3.3.3.whois++: UDP, length 18
      11:11:36.891442 IP 4.4.4.4.whois++ > 3.3.3.3.whois++: UDP, length 18
diff --git a/doc/guides/prog_guide/index.rst b/doc/guides/prog_guide/index.rst
index 2dce507f46a3..b440c77c2ba1 100644
--- a/doc/guides/prog_guide/index.rst
+++ b/doc/guides/prog_guide/index.rst
@@ -43,6 +43,7 @@ Programmer's Guide
     ip_fragment_reassembly_lib
     generic_receive_offload_lib
     generic_segmentation_offload_lib
+    pcapng_lib
     pdump_lib
     multi_proc_support
     kernel_nic_interface
diff --git a/doc/guides/prog_guide/pcapng_lib.rst b/doc/guides/prog_guide/pcapng_lib.rst
new file mode 100644
index 000000000000..36379b530a57
--- /dev/null
+++ b/doc/guides/prog_guide/pcapng_lib.rst
@@ -0,0 +1,24 @@
+..  SPDX-License-Identifier: BSD-3-Clause
+    Copyright(c) 2016 Intel Corporation.
+
+.. _pcapng_library:
+
+Packet Capture File Writer
+==========================
+
+Pcapng is a library for creating files in Pcapng file format.
+The Pcapng file format is the default capture file format for modern
+network capture processing tools. It can be read by wireshark and tcpdump.
+
+Usage
+-----
+
+Before the library can be used the function ``rte_pcapng_init``
+should be called once to initialize timestamp computation.
+
+
+References
+----------
+* Draft RFC https://www.ietf.org/id/draft-tuexen-opsawg-pcapng-03.html
+
+* Project repository  https://github.com/pcapng/pcapng/
diff --git a/doc/guides/prog_guide/pdump_lib.rst b/doc/guides/prog_guide/pdump_lib.rst
index 62c0b015b2fe..9af91415e5ea 100644
--- a/doc/guides/prog_guide/pdump_lib.rst
+++ b/doc/guides/prog_guide/pdump_lib.rst
@@ -3,10 +3,10 @@
 
 .. _pdump_library:
 
-The librte_pdump Library
-========================
+The Packet Capture Library
+==========================
 
-The ``librte_pdump`` library provides a framework for packet capturing in DPDK.
+The DPDK ``pdump`` library provides a framework for packet capturing in DPDK.
 The library does the complete copy of the Rx and Tx mbufs to a new mempool and
 hence it slows down the performance of the applications, so it is recommended
 to use this library for debugging purposes.
@@ -23,11 +23,19 @@ or disable the packet capture, and to uninitialize it.
 
 * ``rte_pdump_enable()``:
   This API enables the packet capture on a given port and queue.
-  Note: The filter option in the API is a place holder for future enhancements.
+
+* ``rte_pdump_enable_bpf()``
+  This API enables the packet capture on a given port and queue.
+  It also allows setting an optional filter using DPDK BPF interpreter and
+  setting the captured packet length.
 
 * ``rte_pdump_enable_by_deviceid()``:
   This API enables the packet capture on a given device id (``vdev name or pci address``) and queue.
-  Note: The filter option in the API is a place holder for future enhancements.
+
+* ``rte_pdump_enable_bpf_by_deviceid()``
+  This API enables the packet capture on a given device id (``vdev name or pci address``) and queue.
+  It also allows seating an optional filter using DPDK BPF interpreter and
+  setting the captured packet length.
 
 * ``rte_pdump_disable()``:
   This API disables the packet capture on a given port and queue.
@@ -61,6 +69,12 @@ and enables the packet capture by registering the Ethernet RX and TX callbacks f
 and queue combinations. Then the primary process will mirror the packets to the new mempool and enqueue them to
 the rte_ring that secondary process have passed to these APIs.
 
+The packet ring supports one of two formats. The default format enqueues copies of the original packets
+into the rte_ring. If the ``RTE_PDUMP_FLAG_PCAPNG`` is set the mbuf data is extended with header and trailer
+to match the format of Pcapng enhanced packet block. The enhanced packet block has meta-data such as the
+timestamp, port and queue the packet was captured on. It is up to the application consuming the
+packets from the ring to select the format desired.
+
 The library APIs ``rte_pdump_disable()`` and ``rte_pdump_disable_by_deviceid()`` disables the packet capture.
 For the calls to these APIs from secondary process, the library creates the "pdump disable" request and sends
 the request to the primary process over the multi process channel. The primary process takes this request and
@@ -74,5 +88,5 @@ function.
 Use Case: Packet Capturing
 --------------------------
 
-The DPDK ``app/pdump`` tool is developed based on this library to capture packets in DPDK.
-Users can use this as an example to develop their own packet capturing tools.
+The DPDK ``app/dpdk-dumpcap`` utility uses this library
+to capture packets in DPDK.
diff --git a/doc/guides/rel_notes/release_21_11.rst b/doc/guides/rel_notes/release_21_11.rst
index 675b5738348b..ee24cbfdb99d 100644
--- a/doc/guides/rel_notes/release_21_11.rst
+++ b/doc/guides/rel_notes/release_21_11.rst
@@ -62,6 +62,16 @@ New Features
   * Added bus-level parsing of the devargs syntax.
   * Kept compatibility with the legacy syntax as parsing fallback.
 
+* **Enhance Packet capture.**
+
+  * New dpdk-dumpcap program that has most of the features of the
+    wireshark dumpcap utility including capture of multiple interfaces,
+    stopping after number of bytes, packets.
+  * New library for writing pcapng packet capture files.
+  * Enhancement to the pdump library to support:
+    * Packet filter with BPF.
+    * Pcapng format with timestamps and meta-data.
+    * Fixes packet capture with stripped VLAN tags.
 
 Removed Items
 -------------
diff --git a/doc/guides/tools/dumpcap.rst b/doc/guides/tools/dumpcap.rst
new file mode 100644
index 000000000000..664ea0c79802
--- /dev/null
+++ b/doc/guides/tools/dumpcap.rst
@@ -0,0 +1,86 @@
+..  SPDX-License-Identifier: BSD-3-Clause
+    Copyright(c) 2020 Microsoft Corporation.
+
+.. _dumpcap_tool:
+
+dpdk-dumpcap Application
+========================
+
+The ``dpdk-dumpcap`` tool is a Data Plane Development Kit (DPDK)
+network traffic dump tool.  The interface is similar to  the dumpcap tool in Wireshark.
+It runs as a secondary DPDK process and lets you capture packets that are
+coming into and out of a DPDK primary process.
+The ``dpdk-dumpcap`` writes files in Pcapng packet format using
+capture file format is pcapng.
+
+Without any options set it will use DPDK to capture traffic from the first
+available DPDK interface and write the received raw packet data, along
+with timestamps into a pcapng file.
+
+If the ``-w`` option is not specified, ``dpdk-dumpcap`` writes to a newly
+create file with a name chosen based on interface name and timestamp.
+If ``-w`` option is specified, then that file is used.
+
+   .. Note::
+      * The ``dpdk-dumpcap`` tool can only be used in conjunction with a primary
+        application which has the packet capture framework initialized already.
+        In dpdk, only the ``testpmd`` is modified to initialize packet capture
+        framework, other applications remain untouched. So, if the ``dpdk-dumpcap``
+        tool has to be used with any application other than the testpmd, user
+        needs to explicitly modify that application to call packet capture
+        framework initialization code. Refer ``app/test-pmd/testpmd.c``
+        code to see how this is done.
+
+      * The ``dpdk-dumpcap`` tool runs as a DPDK secondary process. It exits when
+        the primary application exits.
+
+
+Running the Application
+-----------------------
+
+To list interfaces available for capture use ``--list-interfaces``.
+
+To filter packets in style of *tshark* use the ``-f`` flag.
+
+To capture on multiple interfaces at once, use multiple ``-I`` flags.
+
+Example
+-------
+
+.. code-block:: console
+
+   # ./<build_dir>/app/dpdk-dumpcap --list-interfaces
+   0. 000:00:03.0
+   1. 000:00:03.1
+
+   # ./<build_dir>/app/dpdk-dumpcap -I 0000:00:03.0 -c 6 -w /tmp/sample.pcapng
+   Packets captured: 6
+   Packets received/dropped on interface '0000:00:03.0' 6/0
+
+   # ./<build_dir>/app/dpdk-dumpcap -f 'tcp port 80'
+   Packets captured: 6
+   Packets received/dropped on interface '0000:00:03.0' 10/8
+
+
+Limitations
+-----------
+The following option of Wireshark ``dumpcap`` is not yet implemented:
+
+   * ``-b|--ring-buffer`` -- more complex file management.
+
+The following options do not make sense in the context of DPDK.
+
+   * ``-C <byte_limit>`` -- its a kernel thing
+
+   * ``-t`` -- use a thread per interface
+
+   * Timestamp type.
+
+   * Link data types. Only EN10MB (Ethernet) is supported.
+
+   * Wireless related options:  ``-I|--monitor-mode`` and  ``-k <freq>``
+
+
+.. Note::
+   * The options to ``dpdk-dumpcap`` are like the Wireshark dumpcap program and
+     are not the same as ``dpdk-pdump`` and other DPDK applications.
diff --git a/doc/guides/tools/index.rst b/doc/guides/tools/index.rst
index 93dde4148e90..b71c12b8f2dd 100644
--- a/doc/guides/tools/index.rst
+++ b/doc/guides/tools/index.rst
@@ -8,6 +8,7 @@ DPDK Tools User Guides
     :maxdepth: 2
     :numbered:
 
+    dumpcap
     proc_info
     pdump
     pmdinfo
-- 
2.30.2


^ permalink raw reply	[relevance 1%]

* [dpdk-dev] [PATCH 0/2] eventdev: add port usage hints
@ 2021-09-09 12:54  3% Harry van Haaren
  0 siblings, 0 replies; 200+ results
From: Harry van Haaren @ 2021-09-09 12:54 UTC (permalink / raw)
  To: dev; +Cc: pravin.pathak, timothy.mcdaniel, Harry van Haaren

These 2 patches are a suggestion to add a hint to the
struct rte_event_port_conf.event_port_cfg.

The usage of these hints is to allow an application to
identify/communicate to the PMD what ports will primarily
serve what purpose.

E.g, some ports are "mainly producers" in that they are
usually polling Ethdev RXQs (or other event sources..)
and enqueue the resulting events to the eventdev instance.
Similarly there are usages for "worker" (mainly forwards
events) and "consumer" (mainly consumes events without re-enq).

Note that these flags are *hints* only, and *functionally*
any combination of (NEW/FWD/RELEASE) is still allowed by
any port. The reason to add these is to allow a PMD to allocate
internal resource more efficiently.

Note that this implementation does not change the ABI,
as it gives a purpose to existing bits in an existing field.

Regards, -Harry


Harry van Haaren (2):
  lib/eventdev: add usage hints to port configure API
  examples/eventdev_pipeline: use port config hints

 .../pipeline_worker_generic.c                 |  2 ++
 .../eventdev_pipeline/pipeline_worker_tx.c    |  2 ++
 lib/eventdev/rte_eventdev.h                   | 23 +++++++++++++++++++
 3 files changed, 27 insertions(+)

-- 
2.30.2


^ permalink raw reply	[relevance 3%]

* [dpdk-dev] [PATCH v13 0/4] devtools: scripts to count and track symbols
                     ` (3 preceding siblings ...)
  2021-09-08 15:13  3% ` [dpdk-dev] [PATCH v12 0/4] devtools: scripts to count and track symbols Ray Kinsella
@ 2021-09-09 13:48  3% ` Ray Kinsella
  2021-09-09 13:48  5%   ` [dpdk-dev] [PATCH v13 1/4] devtools: script to track symbols over releases Ray Kinsella
                     ` (2 more replies)
  4 siblings, 3 replies; 200+ results
From: Ray Kinsella @ 2021-09-09 13:48 UTC (permalink / raw)
  To: dev
  Cc: bruce.richardson, stephen, ferruh.yigit, thomas, ktraynor, mdr,
	aconole, roy.fan.zhang, arkadiuszx.kusztal, gakhil

Scripts to count and track the lifecycle of DPDK symbols.

The symbol-tool script reports on the growth of symbols over releases
and list expired symbols. The notify-symbol-maintainers script
consumes the input from symbol-tool and generates email notifications
of expired symbols.

v2: reworked to fix pylint errors
v3: sent with the correct in-reply-to
v4: fix typos picked up by the CI
v5: fix terminal_size & directory args
v6: added list-expired, to list expired experimental symbols
v7: fix typo in comments
v8: added tool to notify maintainers of expired symbols
v9: removed hardcoded emails addressed and script names
v10: added ability to identify and notify the original contributors
v11: addressed feedback from Aaron Conole, including PEP8 errors.
v12: added symbol-tool ignore functionality, to ignore specific symbols
v13: renamed symboltool.abignore, typos, added ack from Akhil Goyal

Ray Kinsella (4):
  devtools: script to track symbols over releases
  devtools: script to send notifications of expired symbols
  maintainers: add new abi scripts
  devtools: add asym crypto to symbol-tool ignore

 MAINTAINERS                           |   3 +
 devtools/notify-symbol-maintainers.py | 302 ++++++++++++++
 devtools/symbol-tool.py               | 566 ++++++++++++++++++++++++++
 devtools/symboltool.abignore          |   3 +
 4 files changed, 874 insertions(+)
 create mode 100755 devtools/notify-symbol-maintainers.py
 create mode 100755 devtools/symbol-tool.py
 create mode 100644 devtools/symboltool.abignore

-- 
2.26.2


^ permalink raw reply	[relevance 3%]

* [dpdk-dev] [PATCH v13 1/4] devtools: script to track symbols over releases
  2021-09-09 13:48  3% ` [dpdk-dev] [PATCH v13 0/4] devtools: scripts to count and track symbols Ray Kinsella
@ 2021-09-09 13:48  5%   ` Ray Kinsella
  2021-09-09 13:48  5%   ` [dpdk-dev] [PATCH v13 2/4] devtools: script to send notifications of expired symbols Ray Kinsella
  2021-09-09 13:48 19%   ` [dpdk-dev] [PATCH v13 3/4] maintainers: add new abi scripts Ray Kinsella
  2 siblings, 0 replies; 200+ results
From: Ray Kinsella @ 2021-09-09 13:48 UTC (permalink / raw)
  To: dev
  Cc: bruce.richardson, stephen, ferruh.yigit, thomas, ktraynor, mdr,
	aconole, roy.fan.zhang, arkadiuszx.kusztal, gakhil

This script tracks the growth of stable and experimental symbols
over releases since v19.11. The script has the ability to
count the added symbols between two dpdk releases, and to
list experimental symbols present in two dpdk releases
(expired symbols).

example usages:

Count symbols added since v19.11
$ devtools/symbol-tool.py count-symbols

Count symbols added since v20.11
$ devtools/symbol-tool.py count-symbols --releases v20.11,v21.05

List experimental symbols present in v20.11 and v21.05
$ devtools/symbol-tool.py list-expired --releases v20.11,v21.05

List experimental symbols in libraries only, present since v19.11
$ devtools/symbol-tool.py list-expired --directory lib

Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
---
 devtools/symbol-tool.py | 566 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 566 insertions(+)
 create mode 100755 devtools/symbol-tool.py

diff --git a/devtools/symbol-tool.py b/devtools/symbol-tool.py
new file mode 100755
index 0000000000..a77d8b2442
--- /dev/null
+++ b/devtools/symbol-tool.py
@@ -0,0 +1,566 @@
+#!/usr/bin/env python3
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2021 Intel Corporation
+# pylint: disable=invalid-name
+'''Tool to count or list symbols in each DPDK release'''
+from pathlib import Path
+import sys
+import os
+import subprocess
+import argparse
+from argparse import RawTextHelpFormatter
+import re
+import datetime
+try:
+    from parsley import makeGrammar
+except ImportError:
+    print('This script uses the package Parsley to parse C Mapfiles.\n'
+          'This can be installed with \"pip install parsley".')
+    sys.exit()
+
+DESCRIPTION = '''
+This script tracks the growth of stable and experimental symbols
+over releases since v19.11. The script has the ability to
+count the added symbols between two dpdk releases, and to
+list experimental symbols present in two dpdk releases
+(expired symbols), including the name & email of the original contributor.
+
+example usages:
+
+Count symbols added since v19.11
+$ {s} count-symbols
+
+Count symbols added since v20.11
+$ {s} count-symbols --releases v20.11,v21.05
+
+List experimental symbols present in v20.11 and v21.05
+$ {s} list-expired --releases v20.11,v21.05
+
+List experimental symbols in libraries only, present since v19.11
+$ {s} list-expired --directory lib
+'''
+
+MAP_GRAMMAR = r"""
+
+ws = (' ' | '\r' | '\n' | '\t')*
+
+ABI_VER = ({})
+DPDK_VER = ('DPDK_' ABI_VER)
+ABI_NAME = ('INTERNAL' | 'EXPERIMENTAL' | DPDK_VER)
+comment = '#' (~'\n' anything)+ '\n'
+symbol = (~(';' | '}}' | '#') anything )+:c ';' -> ''.join(c)
+global = 'global:'
+local = 'local: *;'
+symbols = comment* symbol:s ws comment* -> s
+
+abi = (abi_section+):m -> dict(m)
+abi_section = (ws ABI_NAME:e ws '{{' ws global* (~local ws symbols)*:s ws local* ws '}}' ws DPDK_VER* ';' ws) -> (e,s)
+"""  # noqa: E501
+
+
+class EnvironException(Exception):
+    '''Subclass exception for Pylint\'s happiness.'''
+
+
+def get_abi_versions():
+    '''Returns a string of possible dpdk abi versions'''
+
+    year = datetime.date.today().year - 2000
+    tags = " |".join(['\'{}\''.format(i)
+                     for i in reversed(range(21, year + 1))])
+    tags = tags + ' | \'20.0.1\' | \'20.0\' | \'20\''
+
+    return tags
+
+
+def get_dpdk_releases():
+    '''Returns a list of dpdk release tags names  since v19.11'''
+
+    year = datetime.date.today().year - 2000
+    year_range = "|".join("{}".format(i) for i in range(19, year + 1))
+    pattern = re.compile(r'^\"v(' + year_range + r')\.\d{2}\"$')
+
+    cmd = ['git', 'for-each-ref', '--sort=taggerdate', '--format', '"%(tag)"']
+    try:
+        result = subprocess.run(cmd,
+                                stdout=subprocess.PIPE,
+                                stderr=subprocess.PIPE,
+                                check=True)
+    except subprocess.CalledProcessError:
+        print("Failed to interogate git for release tags")
+        sys.exit()
+
+    tags = result.stdout.decode('utf-8').split('\n')
+
+    # find the non-rcs between now and v19.11
+    tags = [tag.replace('\"', '')
+            for tag in reversed(tags)
+            if pattern.match(tag)][:-3]
+
+    return tags
+
+
+def fix_directory_name(path):
+    '''Prepend librte to the source directory name'''
+    mapfilepath1 = str(path.parent.name)
+    mapfilepath2 = str(path.parents[1])
+    mapfilepath = mapfilepath2 + '/librte_' + mapfilepath1
+
+    return mapfilepath
+
+
+def directory_renamed(path, rel):
+    '''Fix removal of the librte_ from the directory names'''
+
+    mapfilepath = fix_directory_name(path)
+    tagfile = '{}:{}/{}'.format(rel, mapfilepath,  path.name)
+
+    try:
+        result = subprocess.run(['git', 'show', tagfile],
+                                stdout=subprocess.PIPE,
+                                stderr=subprocess.PIPE,
+                                check=True)
+    except subprocess.CalledProcessError:
+        result = None
+
+    return result
+
+
+def mapfile_renamed(path, rel):
+    '''Fix renaming of the map file'''
+    newfile = None
+
+    result = subprocess.run(['git', 'ls-tree',
+                             rel, str(path.parent) + '/'],
+                            stdout=subprocess.PIPE,
+                            stderr=subprocess.PIPE,
+                            check=True)
+    dentries = result.stdout.decode('utf-8')
+    dentries = dentries.split('\n')
+
+    # filter entries looking for the map file
+    dentries = [dentry for dentry in dentries if dentry.endswith('.map')]
+    if len(dentries) > 1 or len(dentries) == 0:
+        return None
+
+    dparts = dentries[0].split('/')
+    newfile = dparts[len(dparts) - 1]
+
+    if newfile is not None:
+        tagfile = '{}:{}/{}'.format(rel, path.parent, newfile)
+
+        try:
+            result = subprocess.run(['git', 'show', tagfile],
+                                    stdout=subprocess.PIPE,
+                                    stderr=subprocess.PIPE,
+                                    check=True)
+        except subprocess.CalledProcessError:
+            result = None
+
+    else:
+        result = None
+
+    return result
+
+
+def mapfile_and_directory_renamed(path, rel):
+    '''Fix renaming of the map file & the source directory'''
+    mapfilepath = Path("{}/{}".format(fix_directory_name(path), path.name))
+
+    return mapfile_renamed(mapfilepath, rel)
+
+
+FIX_STRATEGIES = [directory_renamed,
+                  mapfile_renamed,
+                  mapfile_and_directory_renamed]
+
+
+def get_symbols(map_parser, release, mapfile_path):
+    '''Count the symbols for a given release and mapfile'''
+    abi_sections = {}
+
+    tagfile = '{}:{}'.format(release, mapfile_path)
+    try:
+        result = subprocess.run(['git', 'show', tagfile],
+                                stdout=subprocess.PIPE,
+                                stderr=subprocess.PIPE,
+                                check=True)
+    except subprocess.CalledProcessError:
+        result = None
+
+    for fix_strategy in FIX_STRATEGIES:
+        if result is not None:
+            break
+        result = fix_strategy(mapfile_path, release)
+
+    if result is not None:
+        mapfile = result.stdout.decode('utf-8')
+        abi_sections = map_parser(mapfile).abi()
+
+    return abi_sections
+
+
+def get_terminal_rows():
+    '''Find the number of rows in the terminal'''
+
+    try:
+        return os.get_terminal_size().lines
+    except IOError:
+        return 0
+
+
+class IgnoredSymbols():  # pylint: disable=too-few-public-methods
+    '''Symbols which are to be ignored for some period'''
+
+    SYMBOL_TOOL_IGNORE = 'devtools/symboltool.abignore'
+    ignore_regex = []
+    __initialized = False
+
+    @staticmethod
+    def initialize():
+        '''initialize once'''
+
+        if IgnoredSymbols.__initialized:
+            return
+        IgnoredSymbols.__initialized = True
+
+        if 'DPDK_SYMBOL_TOOL_IGNORE' in os.environ:
+            IgnoredSymbols.SYMBOL_TOOL_IGNORE = \
+                os.environ['DPDK_SYMBOL_TOOL_IGNORE']
+
+            # if the user specifies an ignore file, we can't find then error.
+            if not Path(IgnoredSymbols.SYMBOL_TOOL_IGNORE).is_file():
+                raise EnvironException('Cannot locate {}\'s '
+                                       'ignore file'.format(__file__))
+
+        # if we cannot find the default ignore file, then continue
+        if not Path(IgnoredSymbols.SYMBOL_TOOL_IGNORE).is_file():
+            return
+
+        lines = open(Path(IgnoredSymbols.SYMBOL_TOOL_IGNORE)).readlines()
+        for line in lines:
+
+            line = line.strip()
+
+            # ignore comments and whitespace
+            if line.startswith(';') or len(line) == 0:
+                continue
+
+            IgnoredSymbols.ignore_regex.append(re.compile(line))
+
+    def __init__(self):
+        self.initialize()
+
+    def check_ignore(self, symbol):
+        '''Check symbol against the ignore regexes'''
+
+        for exp in self.ignore_regex:
+            if exp.search(symbol) is not None:
+                return True
+
+        return False
+
+
+class SymbolOwner():
+    '''Find the symbols original contributors name and email'''
+    symbol_regex = {}
+    blame_regex = {'name': r'author\s(.*)',
+                   'email': r'author-mail\s<(.*)>'}
+
+    def __init__(self, libpath, symbol):
+        self.libpath = libpath
+        self.symbol = symbol
+
+        # find variable definitions in C files, and functions in headers.
+        self.symbol_regex = \
+            {'*.c':  r'^(?!extern).*' + self.symbol + '[^()]*;',
+             '*.h': r'__rte_experimental(?:.*\n){0,2}.*' + self.symbol}
+
+    def find_symbol_location(self):
+        '''Find where the symbol is definited in the source'''
+        for key in self.symbol_regex:
+            for path in Path(self.libpath).rglob(key):
+                file_text = open(path).read()
+
+                # find where the symbol is defined, either preceded by
+                # rte_experimental tag (functions)
+                # or followed by a ; (variables)
+
+                exp = self.symbol_regex[key]
+                pattern = re.compile(exp, re.MULTILINE)
+                search = pattern.search(file_text)
+
+                if search is not None:
+                    symbol_pos = search.span()[1]
+                    symbol_line = file_text.count('\n', 0, symbol_pos) + 1
+
+                    return [str(path), symbol_line]
+        return None
+
+    def find_symbol_owner(self):
+        '''Find the symbols original contributors name and email'''
+        owners = {}
+        location = self.find_symbol_location()
+
+        if location is None:
+            return None
+
+        line = '-L {},{}'.format(location[1], location[1])
+        # git blame -p(orcelain) -L(ine) path
+        args = ['-p', line, location[0]]
+
+        try:
+            result = subprocess.run(['git', 'blame'] + args,
+                                    stdout=subprocess.PIPE,
+                                    stderr=subprocess.PIPE,
+                                    check=True)
+        except subprocess.CalledProcessError:
+            return None
+
+        blame = result.stdout.decode('utf-8')
+        for key in self.blame_regex:
+            pattern = re.compile(self.blame_regex[key], re.MULTILINE)
+            match = pattern.search(blame)
+
+            owners[key] = match.groups()[0]
+
+        return owners
+
+
+class SymbolCountOutput():
+    '''Format the output to supported formats'''
+    output_fmt = ""
+    column_fmt = ""
+
+    def __init__(self, format_output, dpdk_releases):
+        self.OUTPUT_FORMATS[format_output](self, dpdk_releases)
+        self.column_titles = ['mapfile'] + dpdk_releases
+
+        self.terminal_rows = get_terminal_rows()
+        self.row = 0
+
+    def set_terminal_output(self, dpdk_rel):
+        '''Set the output format to Tabbed Separated Values'''
+
+        self.output_fmt = '{:<50}' + \
+            ''.join(['{:<6}{:<6}'] * (len(dpdk_rel)))
+        self.column_fmt = '{:50}' + \
+            ''.join(['{:<12}'] * (len(dpdk_rel)))
+
+    def set_csv_output(self, dpdk_rel):
+        '''Set the output format to Comma Separated Values'''
+
+        self.output_fmt = '{},' + \
+            ','.join(['{},{}'] * (len(dpdk_rel)))
+        self.column_fmt = '{},' + \
+            ','.join(['{},'] * (len(dpdk_rel)))
+
+    def print_columns(self):
+        '''Print column rows with release names'''
+        print(self.column_fmt.format(*self.column_titles))
+        self.row += 1
+
+    def print_row(self, mapfile, symbols):
+        '''Print row of symbol values'''
+        mapfile = str(mapfile)
+        print(self.output_fmt.format(*([mapfile] + symbols)))
+        self.row += 1
+
+        if((self.terminal_rows > 0) and
+           ((self.row % self.terminal_rows) == 0)):
+            self.print_columns()
+
+    OUTPUT_FORMATS = {None: set_terminal_output,
+                      'terminal': set_terminal_output,
+                      'csv': set_csv_output}
+
+
+class ListExpiredOutput():
+    '''Format the output to supported formats'''
+    output_fmt = ""
+    column_fmt = ""
+
+    def __init__(self, format_output, dpdk_releases):
+        self.terminal = True
+        self.OUTPUT_FORMATS[format_output](self, dpdk_releases)
+        self.column_titles = ['mapfile'] + \
+            ['expired (' + ','.join(dpdk_releases) + ')'] + \
+            ['contributor name', 'contributor email']
+
+    def set_terminal_output(self, _):
+        '''Set the output format to Tabbed Separated Values'''
+
+        self.output_fmt = '{:<50}{:<50}{:<25}{:<25}'
+        self.column_fmt = '{:50}{:50}{:25}{:25}'
+
+    def set_csv_output(self, _):
+        '''Set the output format to Comma Separated Values'''
+
+        self.output_fmt = '{},{},{},{}'
+        self.column_fmt = '{},{},{},{}'
+        self.terminal = False
+
+    def print_columns(self):
+        '''Print column rows with release names'''
+        print(self.column_fmt.format(*self.column_titles))
+
+    def print_row(self, mapfile, symbols, owner):
+        '''Print row of symbol values'''
+
+        for symbol in symbols:
+            mapfile = str(mapfile)
+            name = owner[symbol]['name'] \
+                if owner[symbol] is not None else ''
+            email = owner[symbol]['email'] \
+                if owner[symbol] is not None else ''
+
+            print(self.output_fmt.format(mapfile, symbol, name, email))
+            if self.terminal:
+                mapfile = ''
+
+    OUTPUT_FORMATS = {None: set_terminal_output,
+                      'terminal': set_terminal_output,
+                      'csv': set_csv_output}
+
+
+class CountSymbolsAction:
+    ''' Logic to count symbols added since a give release '''
+    IGNORE_SECTIONS = ['EXPERIMENTAL', 'INTERNAL']
+
+    def __init__(self, mapfile_path, mapfile_parser, format_output):
+        self.path = mapfile_path
+        self.parser = mapfile_parser
+        self.format_output = format_output
+        self.symbols_count = []
+
+    def add_mapfile(self, release):
+        ''' add a version mapfile '''
+        symbol_count = experimental_count = 0
+
+        symbols = get_symbols(self.parser, release, self.path)
+
+        # which versions are present, and we care about
+        abi_vers = [abi_ver
+                    for abi_ver in symbols
+                    if abi_ver not in self.IGNORE_SECTIONS]
+
+        for abi_ver in abi_vers:
+            symbol_count += len(symbols[abi_ver])
+
+        # count experimental symbols
+        if 'EXPERIMENTAL' in symbols.keys():
+            experimental_count = len(symbols['EXPERIMENTAL'])
+
+        self.symbols_count += [symbol_count, experimental_count]
+
+    def __del__(self):
+        self.format_output.print_row(self.path.parent, self.symbols_count)
+
+
+class ListExpiredAction:
+    ''' Logic to list expired symbols between two releases '''
+
+    def __init__(self, mapfile_path, mapfile_parser, format_output):
+        self.path = mapfile_path
+        self.parser = mapfile_parser
+        self.format_output = format_output
+        self.experimental_symbols = []
+        self.ignored_symbols = IgnoredSymbols()
+
+    def add_mapfile(self, release):
+        ''' add a version mapfile '''
+        symbols = get_symbols(self.parser, release, self.path)
+
+        if 'EXPERIMENTAL' in symbols.keys():
+            experimental = [exp.strip() for exp in symbols['EXPERIMENTAL']]
+
+            self.experimental_symbols.append(experimental)
+
+    def __del__(self):
+        if len(self.experimental_symbols) != 2:
+            return
+
+        tmp = self.experimental_symbols
+        # find symbols present in both dpdk releases
+        intersect_syms = [sym for sym in tmp[0] if sym in tmp[1]]
+
+        # remove ignored symbols
+        intersect_syms = [sym for sym in intersect_syms if not
+                          self.ignored_symbols.check_ignore(sym)]
+
+        # check for empty set
+        if intersect_syms == []:
+            return
+
+        sym_owner = {}
+        for sym in intersect_syms:
+            sym_owner[sym] = \
+                SymbolOwner(self.path.parent, sym).find_symbol_owner()
+
+        self.format_output.print_row(self.path.parent,
+                                     intersect_syms,
+                                     sym_owner)
+
+
+SRC_DIRECTORIES = 'drivers,lib'
+
+ACTIONS = {None: CountSymbolsAction,
+           'count-symbols': CountSymbolsAction,
+           'list-expired': ListExpiredAction}
+
+ACTION_OUTPUT = {None: SymbolCountOutput,
+                 'count-symbols': SymbolCountOutput,
+                 'list-expired': ListExpiredOutput}
+
+
+def main():
+    '''Main entry point'''
+
+    dpdk_releases = get_dpdk_releases()
+
+    parser = \
+        argparse.ArgumentParser(description=DESCRIPTION.format(s=__file__),
+                                formatter_class=RawTextHelpFormatter)
+
+    parser.add_argument('mode', choices=['count-symbols', 'list-expired'])
+    parser.add_argument('--format-output', choices=['terminal', 'csv'],
+                        default='terminal')
+    parser.add_argument('--directory', choices=SRC_DIRECTORIES.split(','),
+                        default=SRC_DIRECTORIES)
+    parser.add_argument('--releases',
+                        help='2 x comma separated release tags e.g. \''
+                        + ','.join([dpdk_releases[0], dpdk_releases[-1]])
+                        + '\'')
+    args = parser.parse_args()
+
+    if args.releases is not None:
+        dpdk_releases = args.releases.split(',')
+
+    if args.mode == 'list-expired':
+        if len(dpdk_releases) < 2:
+            sys.exit('Please specify two releases to compare '
+                     'in \'list-expired\' mode.')
+        dpdk_releases = [dpdk_releases[0],
+                         dpdk_releases[len(dpdk_releases) - 1]]
+
+    action = ACTIONS[args.mode]
+    format_output = ACTION_OUTPUT[args.mode](args.format_output, dpdk_releases)
+
+    map_grammar = MAP_GRAMMAR.format(get_abi_versions())
+    map_parser = makeGrammar(map_grammar, {})
+
+    format_output.print_columns()
+
+    for src_dir in args.directory.split(','):
+        for path in Path(src_dir).rglob('*.map'):
+            release_action = action(path, map_parser, format_output)
+
+            for release in dpdk_releases:
+                release_action.add_mapfile(release)
+
+            # all the magic happens in the destructor
+            del release_action
+
+
+if __name__ == '__main__':
+    main()
-- 
2.26.2


^ permalink raw reply	[relevance 5%]

* [dpdk-dev] [PATCH v13 2/4] devtools: script to send notifications of expired symbols
  2021-09-09 13:48  3% ` [dpdk-dev] [PATCH v13 0/4] devtools: scripts to count and track symbols Ray Kinsella
  2021-09-09 13:48  5%   ` [dpdk-dev] [PATCH v13 1/4] devtools: script to track symbols over releases Ray Kinsella
@ 2021-09-09 13:48  5%   ` Ray Kinsella
  2021-09-09 13:48 19%   ` [dpdk-dev] [PATCH v13 3/4] maintainers: add new abi scripts Ray Kinsella
  2 siblings, 0 replies; 200+ results
From: Ray Kinsella @ 2021-09-09 13:48 UTC (permalink / raw)
  To: dev
  Cc: bruce.richardson, stephen, ferruh.yigit, thomas, ktraynor, mdr,
	aconole, roy.fan.zhang, arkadiuszx.kusztal, gakhil

Use this script with the output of the DPDK symbol tool, to notify
maintainers of expired symbols by email. You need to define the environment
variable DPDK_GETMAINTAINER_PATH for this tool to work.

Use terminal output to review the emails before sending.
e.g.
$ devtools/symbol-tool.py list-expired --format-output csv \
| DPDK_GETMAINTAINER_PATH=<somewhere>/get_maintainer.pl \
devtools/notify_expired_symbols.py --format-output terminal

Then use email output to send the emails to the maintainers.
e.g.
$ devtools/symbol-tool.py list-expired --format-output csv \
| DPDK_GETMAINTAINER_PATH=<somewhere>/get_maintainer.pl \
devtools/notify_expired_symbols.py --format-output email \
--smtp-server <server> --sender <someone@somewhere.com> \
--password <password> --cc <someone@somewhere.com>

Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
---
 devtools/notify-symbol-maintainers.py | 302 ++++++++++++++++++++++++++
 1 file changed, 302 insertions(+)
 create mode 100755 devtools/notify-symbol-maintainers.py

diff --git a/devtools/notify-symbol-maintainers.py b/devtools/notify-symbol-maintainers.py
new file mode 100755
index 0000000000..edf330f88b
--- /dev/null
+++ b/devtools/notify-symbol-maintainers.py
@@ -0,0 +1,302 @@
+#!/usr/bin/env python3
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2021 Intel Corporation
+# pylint: disable=invalid-name
+'''Tool to notify maintainers of expired symbols'''
+import os
+import smtplib
+import ssl
+import sys
+import subprocess
+import argparse
+from argparse import RawTextHelpFormatter
+import time
+from email.message import EmailMessage
+from pathlib import Path
+
+DESCRIPTION = '''
+Use this script with the output of the DPDK symbol tool, to notify maintainers
+and contributors of expired symbols by email. You need to define the environment
+variable DPDK_GETMAINTAINER_PATH for this tool to work.
+
+Use terminal output to review the emails before sending.
+e.g.
+$ devtools/symbol-tool.py list-expired --format-output csv \\
+| DPDK_GETMAINTAINER_PATH=<somewhere>/get_maintainer.pl \\
+{s} --format-output terminal
+
+Then use email output to send the emails to the maintainers.
+e.g.
+$ devtools/symbol-tool.py list-expired --format-output csv \\
+| DPDK_GETMAINTAINER_PATH=<somewhere>/get_maintainer.pl \\
+{s} --format-output email \\
+--smtp-server <server> --sender <someone@somewhere.com> --password <password> \\
+--cc <someone@somewhere.com>
+'''  # noqa: E501
+
+EMAIL_TEMPLATE = '''Hi there,
+
+Please note the symbols listed below have expired. In line with the DPDK ABI
+policy, they should be scheduled for removal, in the next DPDK release.
+
+For more information, please see the DPDK ABI Policy, section 3.5.3.
+https://doc.dpdk.org/guides/contributing/abi_policy.html
+
+Thanks,
+
+The DPDK Symbol Bot
+
+'''  # noqa: E501
+
+ABI_POLICY = 'doc/guides/contributing/abi_policy.rst'
+DPDK_GMP_ENV_VAR = 'DPDK_GETMAINTAINER_PATH'
+MAINTAINERS = 'MAINTAINERS'
+get_maintainer = ['devtools/get-maintainer.sh',
+                  '--email', '-f']
+
+
+class EnvironException(Exception):
+    '''Subclass exception for Pylint\'s happiness.'''
+
+
+def _die_on_exception(e):
+    '''Print an exception, and quit'''
+
+    print('Fatal Error: ' + str(e))
+    sys.exit()
+
+
+def _check_get_maintainers_env():
+    '''Check get maintainers scripts are setup'''
+
+    if not Path(get_maintainer[0]).is_file():
+        raise EnvironException('Cannot locate DPDK\'s get maintainers script, '
+                               ' usually at $' + get_maintainer[0] + '.')
+
+    if DPDK_GMP_ENV_VAR not in os.environ:
+        raise EnvironException(DPDK_GMP_ENV_VAR + ' is not defined.')
+
+    if not Path(os.environ[DPDK_GMP_ENV_VAR]).is_file():
+        raise EnvironException('Cannot locate get maintainers script, usually'
+                               ' at ' + DPDK_GMP_ENV_VAR + '.')
+
+
+def _get_maintainers(libpath):
+    '''Get the maintainers for given library'''
+
+    try:
+        _check_get_maintainers_env()
+    except EnvironException as e:
+        _die_on_exception(e)
+
+    try:
+        cmd = get_maintainer + [libpath]
+        result = subprocess.run(cmd,
+                                stdout=subprocess.PIPE,
+                                stderr=subprocess.PIPE,
+                                check=True)
+    except subprocess.CalledProcessError as e:
+        _die_on_exception(e)
+
+    if result is None:
+        return None
+
+    email = result.stdout.decode('utf-8')
+    if email == '':
+        return None
+
+    email = list(filter(None, email.split('\n')))
+    return email
+
+
+default_maintainers = _get_maintainers(ABI_POLICY) + \
+    _get_maintainers(MAINTAINERS)
+
+
+def get_maintainers(libpath):
+    '''Get the maintainers for given library'''
+    maintainers = _get_maintainers(libpath)
+
+    if maintainers is None:
+        maintainers = default_maintainers
+
+    return maintainers
+
+
+def get_message(library, symbols, config):
+    '''Build email message from symbols, config and maintainers'''
+    contributors = {}
+    message = {}
+    maintainers = get_maintainers(library)
+
+    if maintainers != default_maintainers:
+        message['CC'] = default_maintainers.copy()
+
+    if 'CC' in config:
+        message.setdefault('CC', []).append(config['CC'])
+
+    message['Subject'] = 'Expired symbols in {}\n'.format(library)
+
+    body = EMAIL_TEMPLATE
+    body += '{:<50}{:<25}{:<25}\n'.format('Symbol', 'Contributor', 'Email')
+    for sym in symbols:
+        body += ('{:<50}{:<25}{:<25}\n'.format(sym,
+                                               symbols[sym]['name'],
+                                               symbols[sym]['email']))
+        email = symbols[sym]['email']
+        contributors[email] = ''
+
+    contributors = list(contributors.keys())
+
+    message['To'] = maintainers + contributors
+    message['Body'] = body
+
+    return message
+
+
+class OutputEmail():
+    '''Format the output for email'''
+
+    def __init__(self, config):
+        self.config = config
+
+        self.terminal = OutputTerminal(config)
+        context = ssl.create_default_context()
+
+        # Try to log in to server and send email
+        try:
+            self.server = smtplib.SMTP(config['smtp_server'], 587)
+            self.server.starttls(context=context)  # Secure the connection
+            self.server.login(config['sender'], config['password'])
+        except EnvironException as e:
+            _die_on_exception(e)
+
+    def message(self, message):
+        '''send email'''
+        self.terminal.message(message)
+
+        msg = EmailMessage()
+        msg.set_content(message.pop('Body'))
+
+        for key in message.keys():
+            msg[key] = message[key]
+
+        msg['From'] = self.config['sender']
+        msg['Reply-To'] = 'no-reply@dpdk.org'
+
+        self.server.send_message(msg)
+
+        time.sleep(1)
+
+    def __del__(self):
+        self.server.quit()
+
+
+class OutputTerminal():  # pylint: disable=too-few-public-methods
+    '''Format the output for the terminal'''
+
+    def __init__(self, config):
+        self.config = config
+
+    def message(self, message):
+        '''Print email to terminal'''
+
+        terminal = 'To:' + ', '.join(message['To']) + '\n'
+        if 'sender' in self.config.keys():
+            terminal += 'From:' + self.config['sender'] + '\n'
+
+        terminal += 'Reply-To:' + 'no-reply@dpdk.org' + '\n'
+
+        if 'CC' in message:
+            terminal += 'CC:' + ', '.join(message['CC']) + '\n'
+
+        terminal += 'Subject:' + message['Subject'] + '\n'
+        terminal += 'Body:' + message['Body'] + '\n'
+
+        print(terminal)
+        print('-' * 80)
+
+
+def parse_config(args):
+    '''put the command line args in the right places'''
+    config = {}
+    error_msg = None
+
+    outputs = {
+        None: OutputTerminal,
+        'terminal': OutputTerminal,
+        'email': OutputEmail
+    }
+
+    if args.format_output == 'email':
+        if args.smtp_server is None:
+            error_msg = 'SMTP server'
+        else:
+            config['smtp_server'] = args.smtp_server
+
+        if args.sender is None:
+            error_msg = 'sender'
+        else:
+            config['sender'] = args.sender
+
+        if args.password is None:
+            error_msg = 'password'
+        else:
+            config['password'] = args.password
+
+    if args.cc is not None:
+        config['CC'] = args.cc
+
+    if error_msg is not None:
+        print('Please specify a {} for email output'.format(error_msg))
+        return None
+
+    config['output'] = outputs[args.format_output]
+    return config
+
+
+def main():
+    '''Main entry point'''
+    parser = \
+        argparse.ArgumentParser(description=DESCRIPTION.format(s=__file__),
+                                formatter_class=RawTextHelpFormatter)
+    parser.add_argument('--format-output',
+                        choices=['terminal', 'email'],
+                        default='terminal')
+    parser.add_argument('--smtp-server')
+    parser.add_argument('--password')
+    parser.add_argument('--sender')
+    parser.add_argument('--cc')
+
+    args = parser.parse_args()
+    config = parse_config(args)
+    if config is None:
+        return
+
+    symbols = {}
+    lastlib = library = ''
+
+    output = config['output'](config)
+
+    for line in sys.stdin:
+        line = line.rstrip('\n')
+
+        if line.find('mapfile') >= 0:
+            continue
+        library, symbol, name, email = line.split(',')
+
+        if library != lastlib:
+            message = get_message(lastlib, symbols, config)
+            output.message(message)
+            symbols = {}
+
+        lastlib = library
+        symbols[symbol] = {'name': name, 'email': email}
+
+    # print the last library
+    message = get_message(lastlib, symbols, config)
+    output.message(message)
+
+
+if __name__ == '__main__':
+    main()
-- 
2.26.2


^ permalink raw reply	[relevance 5%]

* [dpdk-dev] [PATCH v13 3/4] maintainers: add new abi scripts
  2021-09-09 13:48  3% ` [dpdk-dev] [PATCH v13 0/4] devtools: scripts to count and track symbols Ray Kinsella
  2021-09-09 13:48  5%   ` [dpdk-dev] [PATCH v13 1/4] devtools: script to track symbols over releases Ray Kinsella
  2021-09-09 13:48  5%   ` [dpdk-dev] [PATCH v13 2/4] devtools: script to send notifications of expired symbols Ray Kinsella
@ 2021-09-09 13:48 19%   ` Ray Kinsella
  2 siblings, 0 replies; 200+ results
From: Ray Kinsella @ 2021-09-09 13:48 UTC (permalink / raw)
  To: dev
  Cc: bruce.richardson, stephen, ferruh.yigit, thomas, ktraynor, mdr,
	aconole, roy.fan.zhang, arkadiuszx.kusztal, gakhil

Add new abi management scripts to the MAINTAINERS file.

Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
---
 MAINTAINERS | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 266f5ac1da..ae38af1b85 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -127,8 +127,11 @@ F: devtools/check-abi-version.sh
 F: devtools/check-symbol-change.sh
 F: devtools/gen-abi.sh
 F: devtools/libabigail.abignore
+F: devtools/symboltool.abignore
 F: devtools/update-abi.sh
 F: devtools/update_version_map_abi.py
+F: devtools/notify-symbol-maintainers.py
+F: devtools/symbol-tool.py
 F: buildtools/check-symbols.sh
 F: buildtools/map-list-symbol.sh
 F: drivers/*/*/*.map
-- 
2.26.2


^ permalink raw reply	[relevance 19%]

* [dpdk-dev] [PATCH 08/18] eal: fix typos in comments
  @ 2021-09-09 17:56  4% ` Stephen Hemminger
      2 siblings, 0 replies; 200+ results
From: Stephen Hemminger @ 2021-09-09 17:56 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

Minor spelling errors.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/eal/include/rte_function_versioning.h | 2 +-
 lib/eal/windows/include/fnmatch.h         | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/eal/include/rte_function_versioning.h b/lib/eal/include/rte_function_versioning.h
index 746a1e19923e..eb6dd2bc1727 100644
--- a/lib/eal/include/rte_function_versioning.h
+++ b/lib/eal/include/rte_function_versioning.h
@@ -15,7 +15,7 @@
 
 /*
  * Provides backwards compatibility when updating exported functions.
- * When a symol is exported from a library to provide an API, it also provides a
+ * When a symbol is exported from a library to provide an API, it also provides a
  * calling convention (ABI) that is embodied in its name, return type,
  * arguments, etc.  On occasion that function may need to change to accommodate
  * new functionality, behavior, etc.  When that occurs, it is desirable to
diff --git a/lib/eal/windows/include/fnmatch.h b/lib/eal/windows/include/fnmatch.h
index 142753c3568d..c272f65ccdc3 100644
--- a/lib/eal/windows/include/fnmatch.h
+++ b/lib/eal/windows/include/fnmatch.h
@@ -30,7 +30,7 @@ extern "C" {
  * with the given regular expression pattern.
  *
  * @param pattern
- *	regular expression notation decribing the pattern to match
+ *	regular expression notation describing the pattern to match
  *
  * @param string
  *	source string to searcg for the pattern
-- 
2.30.2


^ permalink raw reply	[relevance 4%]

* [dpdk-dev] [PATCH v2 08/18] eal: fix typos in comments
  @ 2021-09-09 18:10  4%   ` Stephen Hemminger
  0 siblings, 0 replies; 200+ results
From: Stephen Hemminger @ 2021-09-09 18:10 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

Minor spelling errors.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/eal/include/rte_function_versioning.h | 2 +-
 lib/eal/windows/include/fnmatch.h         | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/eal/include/rte_function_versioning.h b/lib/eal/include/rte_function_versioning.h
index 746a1e19923e..eb6dd2bc1727 100644
--- a/lib/eal/include/rte_function_versioning.h
+++ b/lib/eal/include/rte_function_versioning.h
@@ -15,7 +15,7 @@
 
 /*
  * Provides backwards compatibility when updating exported functions.
- * When a symol is exported from a library to provide an API, it also provides a
+ * When a symbol is exported from a library to provide an API, it also provides a
  * calling convention (ABI) that is embodied in its name, return type,
  * arguments, etc.  On occasion that function may need to change to accommodate
  * new functionality, behavior, etc.  When that occurs, it is desirable to
diff --git a/lib/eal/windows/include/fnmatch.h b/lib/eal/windows/include/fnmatch.h
index 142753c3568d..c272f65ccdc3 100644
--- a/lib/eal/windows/include/fnmatch.h
+++ b/lib/eal/windows/include/fnmatch.h
@@ -30,7 +30,7 @@ extern "C" {
  * with the given regular expression pattern.
  *
  * @param pattern
- *	regular expression notation decribing the pattern to match
+ *	regular expression notation describing the pattern to match
  *
  * @param string
  *	source string to searcg for the pattern
-- 
2.30.2


^ permalink raw reply	[relevance 4%]

* [dpdk-dev] [PATCH v6 07/10] pdump: support pcapng and filtering
  @ 2021-09-09 23:33  1%   ` Stephen Hemminger
  2021-09-09 23:33  1%   ` [dpdk-dev] [PATCH v6 09/10] doc: changes for new pcapng and dumpcap Stephen Hemminger
  1 sibling, 0 replies; 200+ results
From: Stephen Hemminger @ 2021-09-09 23:33 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

This enhances the DPDK pdump library to support new
pcapng format and filtering via BPF.

The internal client/server protocol is changed to support
two versions: the original pdump basic version and a
new pcapng version.

The internal version number (not part of exposed API or ABI)
is intentionally increased to cause any attempt to try
mismatched primary/secondary process to fail.

Add new API to do allow filtering of captured packets with
DPDK BPF (eBPF) filter program. It keeps statistics
on packets captured, filtered, and missed (because ring was full).

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/meson.build       |   4 +-
 lib/pdump/meson.build |   2 +-
 lib/pdump/rte_pdump.c | 437 ++++++++++++++++++++++++++++++------------
 lib/pdump/rte_pdump.h | 110 ++++++++++-
 lib/pdump/version.map |   8 +
 5 files changed, 435 insertions(+), 126 deletions(-)

diff --git a/lib/meson.build b/lib/meson.build
index ba88e9eabc58..1da521ea6185 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -26,6 +26,7 @@ libraries = [
         'timer',   # eventdev depends on this
         'acl',
         'bbdev',
+        'bpf',
         'bitratestats',
         'cfgfile',
         'compressdev',
@@ -43,7 +44,6 @@ libraries = [
         'member',
         'pcapng',
         'power',
-        'pdump',
         'rawdev',
         'regexdev',
         'rib',
@@ -55,10 +55,10 @@ libraries = [
         'ipsec', # ipsec lib depends on net, crypto and security
         'fib', #fib lib depends on rib
         'port', # pkt framework libs which use other libs from above
+        'pdump', # pdump lib depends on bpf pcapng
         'table',
         'pipeline',
         'flow_classify', # flow_classify lib depends on pkt framework table lib
-        'bpf',
         'graph',
         'node',
 ]
diff --git a/lib/pdump/meson.build b/lib/pdump/meson.build
index 3a95eabde6a6..51ceb2afdec5 100644
--- a/lib/pdump/meson.build
+++ b/lib/pdump/meson.build
@@ -3,4 +3,4 @@
 
 sources = files('rte_pdump.c')
 headers = files('rte_pdump.h')
-deps += ['ethdev']
+deps += ['ethdev', 'bpf', 'pcapng']
diff --git a/lib/pdump/rte_pdump.c b/lib/pdump/rte_pdump.c
index 382217bc1564..f2047ad9f001 100644
--- a/lib/pdump/rte_pdump.c
+++ b/lib/pdump/rte_pdump.c
@@ -7,8 +7,10 @@
 #include <rte_ethdev.h>
 #include <rte_lcore.h>
 #include <rte_log.h>
+#include <rte_memzone.h>
 #include <rte_errno.h>
 #include <rte_string_fns.h>
+#include <rte_pcapng.h>
 
 #include "rte_pdump.h"
 
@@ -27,30 +29,26 @@ enum pdump_operation {
 	ENABLE = 2
 };
 
+/*
+ * Note: version numbers intentionally start at 3
+ * in order to catch any application built with older out
+ * version of DPDK using incompatible client request format.
+ */
 enum pdump_version {
-	V1 = 1
+	PDUMP_CLIENT_LEGACY = 3,
+	PDUMP_CLIENT_PCAPNG = 4,
 };
 
 struct pdump_request {
 	uint16_t ver;
 	uint16_t op;
-	uint32_t flags;
-	union pdump_data {
-		struct enable_v1 {
-			char device[RTE_DEV_NAME_MAX_LEN];
-			uint16_t queue;
-			struct rte_ring *ring;
-			struct rte_mempool *mp;
-			void *filter;
-		} en_v1;
-		struct disable_v1 {
-			char device[RTE_DEV_NAME_MAX_LEN];
-			uint16_t queue;
-			struct rte_ring *ring;
-			struct rte_mempool *mp;
-			void *filter;
-		} dis_v1;
-	} data;
+	uint16_t flags;
+	uint16_t queue;
+	struct rte_ring *ring;
+	struct rte_mempool *mp;
+	const struct rte_bpf_prm *prm;
+	uint32_t snaplen;
+	char device[RTE_DEV_NAME_MAX_LEN];
 };
 
 struct pdump_response {
@@ -63,80 +61,140 @@ static struct pdump_rxtx_cbs {
 	struct rte_ring *ring;
 	struct rte_mempool *mp;
 	const struct rte_eth_rxtx_callback *cb;
-	void *filter;
+	const struct rte_bpf *filter;
+	enum pdump_version ver;
+	uint32_t snaplen;
 } rx_cbs[RTE_MAX_ETHPORTS][RTE_MAX_QUEUES_PER_PORT],
 tx_cbs[RTE_MAX_ETHPORTS][RTE_MAX_QUEUES_PER_PORT];
 
-
-static inline void
-pdump_copy(struct rte_mbuf **pkts, uint16_t nb_pkts, void *user_params)
+static const char *MZ_RTE_PDUMP_STATS = "rte_pdump_stats";
+
+/* Shared memory between primary and secondary processes. */
+static struct {
+	struct rte_pdump_stats rx[RTE_MAX_ETHPORTS][RTE_MAX_QUEUES_PER_PORT];
+	struct rte_pdump_stats tx[RTE_MAX_ETHPORTS][RTE_MAX_QUEUES_PER_PORT];
+} *pdump_stats;
+
+/* Create a clone of mbuf to be placed into ring. */
+static void
+pdump_copy(uint16_t port_id, uint16_t queue,
+	   enum rte_pcapng_direction direction,
+	   struct rte_mbuf **pkts, uint16_t nb_pkts,
+	   const struct pdump_rxtx_cbs *cbs,
+	   struct rte_pdump_stats *stats)
 {
 	unsigned int i;
 	int ring_enq;
 	uint16_t d_pkts = 0;
 	struct rte_mbuf *dup_bufs[nb_pkts];
-	struct pdump_rxtx_cbs *cbs;
+	uint64_t ts;
 	struct rte_ring *ring;
 	struct rte_mempool *mp;
 	struct rte_mbuf *p;
+	uint64_t rcs[nb_pkts];
+
+	if (cbs->filter &&
+	    rte_bpf_exec_burst(cbs->filter, (void **)pkts, rcs, nb_pkts) == 0) {
+		/* All packets were filtered out */
+		__atomic_fetch_add(&stats->filtered, nb_pkts,
+				   __ATOMIC_RELAXED);
+		return;
+	}
 
-	cbs  = user_params;
+	ts = rte_get_tsc_cycles();
 	ring = cbs->ring;
 	mp = cbs->mp;
 	for (i = 0; i < nb_pkts; i++) {
-		p = rte_pktmbuf_copy(pkts[i], mp, 0, UINT32_MAX);
-		if (p)
+		/*
+		 * Similar behavior to rte_bpf_eth callback.
+		 * if BPF program returns zero value for a given packet,
+		 * then it will be ignored.
+		 */
+		if (cbs->filter && rcs[i] == 0) {
+			__atomic_fetch_add(&stats->filtered,
+					   1, __ATOMIC_RELAXED);
+			continue;
+		}
+
+		/*
+		 * If using pcapng then want to wrap packets
+		 * otherwise a simple copy.
+		 */
+		if (cbs->ver == PDUMP_CLIENT_PCAPNG)
+			p = rte_pcapng_copy(port_id, queue,
+					    pkts[i], mp, cbs->snaplen,
+					    ts, direction);
+		else
+			p = rte_pktmbuf_copy(pkts[i], mp, 0, cbs->snaplen);
+
+		if (unlikely(p == NULL))
+			__atomic_fetch_add(&stats->nombuf, 1, __ATOMIC_RELAXED);
+		else
 			dup_bufs[d_pkts++] = p;
 	}
 
+	__atomic_fetch_add(&stats->accepted, d_pkts, __ATOMIC_RELAXED);
+
 	ring_enq = rte_ring_enqueue_burst(ring, (void *)dup_bufs, d_pkts, NULL);
 	if (unlikely(ring_enq < d_pkts)) {
 		unsigned int drops = d_pkts - ring_enq;
 
-		PDUMP_LOG(DEBUG,
-			"only %d of packets enqueued to ring\n", ring_enq);
+		__atomic_fetch_add(&stats->ringfull, drops, __ATOMIC_RELAXED);
 		rte_pktmbuf_free_bulk(&dup_bufs[ring_enq], drops);
 	}
 }
 
 static uint16_t
-pdump_rx(uint16_t port __rte_unused, uint16_t qidx __rte_unused,
+pdump_rx(uint16_t port, uint16_t queue,
 	struct rte_mbuf **pkts, uint16_t nb_pkts,
-	uint16_t max_pkts __rte_unused,
-	void *user_params)
+	uint16_t max_pkts __rte_unused, void *user_params)
 {
-	pdump_copy(pkts, nb_pkts, user_params);
+	const struct pdump_rxtx_cbs *cbs = user_params;
+	struct rte_pdump_stats *stats = &pdump_stats->rx[port][queue];
+
+	pdump_copy(port, queue, RTE_PCAPNG_DIRECTION_IN,
+		   pkts, nb_pkts, cbs, stats);
 	return nb_pkts;
 }
 
 static uint16_t
-pdump_tx(uint16_t port __rte_unused, uint16_t qidx __rte_unused,
+pdump_tx(uint16_t port, uint16_t queue,
 		struct rte_mbuf **pkts, uint16_t nb_pkts, void *user_params)
 {
-	pdump_copy(pkts, nb_pkts, user_params);
+	const struct pdump_rxtx_cbs *cbs = user_params;
+	struct rte_pdump_stats *stats = &pdump_stats->tx[port][queue];
+
+	pdump_copy(port, queue, RTE_PCAPNG_DIRECTION_OUT,
+		   pkts, nb_pkts, cbs, stats);
 	return nb_pkts;
 }
 
 static int
-pdump_register_rx_callbacks(uint16_t end_q, uint16_t port, uint16_t queue,
-				struct rte_ring *ring, struct rte_mempool *mp,
-				uint16_t operation)
+pdump_register_rx_callbacks(enum pdump_version ver,
+			    uint16_t end_q, uint16_t port, uint16_t queue,
+			    struct rte_ring *ring, struct rte_mempool *mp,
+			    struct rte_bpf *filter,
+			    uint16_t operation, uint32_t snaplen)
 {
 	uint16_t qid;
-	struct pdump_rxtx_cbs *cbs = NULL;
 
 	qid = (queue == RTE_PDUMP_ALL_QUEUES) ? 0 : queue;
 	for (; qid < end_q; qid++) {
-		cbs = &rx_cbs[port][qid];
-		if (cbs && operation == ENABLE) {
+		struct pdump_rxtx_cbs *cbs = &rx_cbs[port][qid];
+
+		if (operation == ENABLE) {
 			if (cbs->cb) {
 				PDUMP_LOG(ERR,
 					"rx callback for port=%d queue=%d, already exists\n",
 					port, qid);
 				return -EEXIST;
 			}
+			cbs->ver = ver;
 			cbs->ring = ring;
 			cbs->mp = mp;
+			cbs->snaplen = snaplen;
+			cbs->filter = filter;
+
 			cbs->cb = rte_eth_add_first_rx_callback(port, qid,
 								pdump_rx, cbs);
 			if (cbs->cb == NULL) {
@@ -145,8 +203,7 @@ pdump_register_rx_callbacks(uint16_t end_q, uint16_t port, uint16_t queue,
 					rte_errno);
 				return rte_errno;
 			}
-		}
-		if (cbs && operation == DISABLE) {
+		} else if (operation == DISABLE) {
 			int ret;
 
 			if (cbs->cb == NULL) {
@@ -170,26 +227,32 @@ pdump_register_rx_callbacks(uint16_t end_q, uint16_t port, uint16_t queue,
 }
 
 static int
-pdump_register_tx_callbacks(uint16_t end_q, uint16_t port, uint16_t queue,
-				struct rte_ring *ring, struct rte_mempool *mp,
-				uint16_t operation)
+pdump_register_tx_callbacks(enum pdump_version ver,
+			    uint16_t end_q, uint16_t port, uint16_t queue,
+			    struct rte_ring *ring, struct rte_mempool *mp,
+			    struct rte_bpf *filter,
+			    uint16_t operation, uint32_t snaplen)
 {
 
 	uint16_t qid;
-	struct pdump_rxtx_cbs *cbs = NULL;
 
 	qid = (queue == RTE_PDUMP_ALL_QUEUES) ? 0 : queue;
 	for (; qid < end_q; qid++) {
-		cbs = &tx_cbs[port][qid];
-		if (cbs && operation == ENABLE) {
+		struct pdump_rxtx_cbs *cbs = &tx_cbs[port][qid];
+
+		if (operation == ENABLE) {
 			if (cbs->cb) {
 				PDUMP_LOG(ERR,
 					"tx callback for port=%d queue=%d, already exists\n",
 					port, qid);
 				return -EEXIST;
 			}
+			cbs->ver = ver;
 			cbs->ring = ring;
 			cbs->mp = mp;
+			cbs->snaplen = snaplen;
+			cbs->filter = filter;
+
 			cbs->cb = rte_eth_add_tx_callback(port, qid, pdump_tx,
 								cbs);
 			if (cbs->cb == NULL) {
@@ -198,8 +261,7 @@ pdump_register_tx_callbacks(uint16_t end_q, uint16_t port, uint16_t queue,
 					rte_errno);
 				return rte_errno;
 			}
-		}
-		if (cbs && operation == DISABLE) {
+		} else if (operation == DISABLE) {
 			int ret;
 
 			if (cbs->cb == NULL) {
@@ -228,37 +290,47 @@ set_pdump_rxtx_cbs(const struct pdump_request *p)
 	uint16_t nb_rx_q = 0, nb_tx_q = 0, end_q, queue;
 	uint16_t port;
 	int ret = 0;
+	struct rte_bpf *filter = NULL;
 	uint32_t flags;
 	uint16_t operation;
 	struct rte_ring *ring;
 	struct rte_mempool *mp;
 
-	flags = p->flags;
-	operation = p->op;
-	if (operation == ENABLE) {
-		ret = rte_eth_dev_get_port_by_name(p->data.en_v1.device,
-				&port);
-		if (ret < 0) {
+	if (!(p->ver == PDUMP_CLIENT_LEGACY ||
+	      p->ver == PDUMP_CLIENT_PCAPNG)) {
+		PDUMP_LOG(ERR,
+			  "incorrect client version %u\n", p->ver);
+		return -EINVAL;
+	}
+
+	if (p->prm) {
+		if (p->prm->prog_arg.type != RTE_BPF_ARG_PTR_MBUF) {
 			PDUMP_LOG(ERR,
-				"failed to get port id for device id=%s\n",
-				p->data.en_v1.device);
+				  "invalid BPF program type: %u\n",
+				  p->prm->prog_arg.type);
 			return -EINVAL;
 		}
-		queue = p->data.en_v1.queue;
-		ring = p->data.en_v1.ring;
-		mp = p->data.en_v1.mp;
-	} else {
-		ret = rte_eth_dev_get_port_by_name(p->data.dis_v1.device,
-				&port);
-		if (ret < 0) {
-			PDUMP_LOG(ERR,
-				"failed to get port id for device id=%s\n",
-				p->data.dis_v1.device);
-			return -EINVAL;
+
+		filter = rte_bpf_load(p->prm);
+		if (filter == NULL) {
+			PDUMP_LOG(ERR, "cannot load BPF filter: %s\n",
+				  rte_strerror(rte_errno));
+			return -rte_errno;
 		}
-		queue = p->data.dis_v1.queue;
-		ring = p->data.dis_v1.ring;
-		mp = p->data.dis_v1.mp;
+	}
+
+	flags = p->flags;
+	operation = p->op;
+	queue = p->queue;
+	ring = p->ring;
+	mp = p->mp;
+
+	ret = rte_eth_dev_get_port_by_name(p->device, &port);
+	if (ret < 0) {
+		PDUMP_LOG(ERR,
+			  "failed to get port id for device id=%s\n",
+			  p->device);
+		return -EINVAL;
 	}
 
 	/* validation if packet capture is for all queues */
@@ -296,8 +368,9 @@ set_pdump_rxtx_cbs(const struct pdump_request *p)
 	/* register RX callback */
 	if (flags & RTE_PDUMP_FLAG_RX) {
 		end_q = (queue == RTE_PDUMP_ALL_QUEUES) ? nb_rx_q : queue + 1;
-		ret = pdump_register_rx_callbacks(end_q, port, queue, ring, mp,
-							operation);
+		ret = pdump_register_rx_callbacks(p->ver, end_q, port, queue,
+						  ring, mp, filter,
+						  operation, p->snaplen);
 		if (ret < 0)
 			return ret;
 	}
@@ -305,8 +378,9 @@ set_pdump_rxtx_cbs(const struct pdump_request *p)
 	/* register TX callback */
 	if (flags & RTE_PDUMP_FLAG_TX) {
 		end_q = (queue == RTE_PDUMP_ALL_QUEUES) ? nb_tx_q : queue + 1;
-		ret = pdump_register_tx_callbacks(end_q, port, queue, ring, mp,
-							operation);
+		ret = pdump_register_tx_callbacks(p->ver, end_q, port, queue,
+						  ring, mp, filter,
+						  operation, p->snaplen);
 		if (ret < 0)
 			return ret;
 	}
@@ -347,8 +421,18 @@ pdump_server(const struct rte_mp_msg *mp_msg, const void *peer)
 int
 rte_pdump_init(void)
 {
+	const struct rte_memzone *mz;
 	int ret;
 
+	mz = rte_memzone_reserve(MZ_RTE_PDUMP_STATS, sizeof(*pdump_stats),
+				 rte_socket_id(), 0);
+	if (mz == NULL) {
+		PDUMP_LOG(ERR, "cannot allocate pdump statistics\n");
+		rte_errno = ENOMEM;
+		return -1;
+	}
+	pdump_stats = mz->addr;
+
 	ret = rte_mp_action_register(PDUMP_MP, pdump_server);
 	if (ret && rte_errno != ENOTSUP)
 		return -1;
@@ -392,14 +476,21 @@ pdump_validate_ring_mp(struct rte_ring *ring, struct rte_mempool *mp)
 static int
 pdump_validate_flags(uint32_t flags)
 {
-	if (flags != RTE_PDUMP_FLAG_RX && flags != RTE_PDUMP_FLAG_TX &&
-		flags != RTE_PDUMP_FLAG_RXTX) {
+	if ((flags & RTE_PDUMP_FLAG_RXTX) == 0) {
 		PDUMP_LOG(ERR,
 			"invalid flags, should be either rx/tx/rxtx\n");
 		rte_errno = EINVAL;
 		return -1;
 	}
 
+	/* mask off the flags we know about */
+	if (flags & ~(RTE_PDUMP_FLAG_RXTX | RTE_PDUMP_FLAG_PCAPNG)) {
+		PDUMP_LOG(ERR,
+			  "unknown flags: %#x\n", flags);
+		rte_errno = ENOTSUP;
+		return -1;
+	}
+
 	return 0;
 }
 
@@ -426,12 +517,12 @@ pdump_validate_port(uint16_t port, char *name)
 }
 
 static int
-pdump_prepare_client_request(char *device, uint16_t queue,
-				uint32_t flags,
-				uint16_t operation,
-				struct rte_ring *ring,
-				struct rte_mempool *mp,
-				void *filter)
+pdump_prepare_client_request(const char *device, uint16_t queue,
+			     uint32_t flags, uint32_t snaplen,
+			     uint16_t operation,
+			     struct rte_ring *ring,
+			     struct rte_mempool *mp,
+			     const struct rte_bpf_prm *prm)
 {
 	int ret = -1;
 	struct rte_mp_msg mp_req, *mp_rep;
@@ -440,23 +531,23 @@ pdump_prepare_client_request(char *device, uint16_t queue,
 	struct pdump_request *req = (struct pdump_request *)mp_req.param;
 	struct pdump_response *resp;
 
-	req->ver = 1;
-	req->flags = flags;
+	memset(req, 0, sizeof(*req));
+	if (flags & RTE_PDUMP_FLAG_PCAPNG)
+		req->ver = PDUMP_CLIENT_PCAPNG;
+	else
+		req->ver = PDUMP_CLIENT_LEGACY;
+
+	req->flags = flags & RTE_PDUMP_FLAG_RXTX;
 	req->op = operation;
+	req->queue = queue;
+	strlcpy(req->device, device, sizeof(req->device));
+
 	if ((operation & ENABLE) != 0) {
-		strlcpy(req->data.en_v1.device, device,
-			sizeof(req->data.en_v1.device));
-		req->data.en_v1.queue = queue;
-		req->data.en_v1.ring = ring;
-		req->data.en_v1.mp = mp;
-		req->data.en_v1.filter = filter;
-	} else {
-		strlcpy(req->data.dis_v1.device, device,
-			sizeof(req->data.dis_v1.device));
-		req->data.dis_v1.queue = queue;
-		req->data.dis_v1.ring = NULL;
-		req->data.dis_v1.mp = NULL;
-		req->data.dis_v1.filter = NULL;
+		req->queue = queue;
+		req->ring = ring;
+		req->mp = mp;
+		req->prm = prm;
+		req->snaplen = snaplen;
 	}
 
 	strlcpy(mp_req.name, PDUMP_MP, RTE_MP_MAX_NAME_LEN);
@@ -477,11 +568,17 @@ pdump_prepare_client_request(char *device, uint16_t queue,
 	return ret;
 }
 
-int
-rte_pdump_enable(uint16_t port, uint16_t queue, uint32_t flags,
-			struct rte_ring *ring,
-			struct rte_mempool *mp,
-			void *filter)
+/*
+ * There are two versions of this function, because although original API
+ * left place holder for future filter, it never checked the value.
+ * Therefore the API can't depend on application passing a non
+ * bogus value.
+ */
+static int
+pdump_enable(uint16_t port, uint16_t queue,
+	     uint32_t flags, uint32_t snaplen,
+	     struct rte_ring *ring, struct rte_mempool *mp,
+	     const struct rte_bpf_prm *prm)
 {
 	int ret;
 	char name[RTE_DEV_NAME_MAX_LEN];
@@ -496,20 +593,42 @@ rte_pdump_enable(uint16_t port, uint16_t queue, uint32_t flags,
 	if (ret < 0)
 		return ret;
 
-	ret = pdump_prepare_client_request(name, queue, flags,
-						ENABLE, ring, mp, filter);
+	if (snaplen == 0)
+		snaplen = UINT32_MAX;
 
-	return ret;
+	return pdump_prepare_client_request(name, queue, flags, snaplen,
+					    ENABLE, ring, mp, prm);
 }
 
 int
-rte_pdump_enable_by_deviceid(char *device_id, uint16_t queue,
-				uint32_t flags,
-				struct rte_ring *ring,
-				struct rte_mempool *mp,
-				void *filter)
+rte_pdump_enable(uint16_t port, uint16_t queue, uint32_t flags,
+		 struct rte_ring *ring,
+		 struct rte_mempool *mp,
+		 void *filter __rte_unused)
 {
-	int ret = 0;
+	return pdump_enable(port, queue, flags, 0,
+			    ring, mp, NULL);
+}
+
+int
+rte_pdump_enable_bpf(uint16_t port, uint16_t queue,
+		     uint32_t flags, uint32_t snaplen,
+		     struct rte_ring *ring,
+		     struct rte_mempool *mp,
+		     const struct rte_bpf_prm *prm)
+{
+	return pdump_enable(port, queue, flags, snaplen,
+			    ring, mp, prm);
+}
+
+static int
+pdump_enable_by_deviceid(const char *device_id, uint16_t queue,
+			 uint32_t flags, uint32_t snaplen,
+			 struct rte_ring *ring,
+			 struct rte_mempool *mp,
+			 const struct rte_bpf_prm *prm)
+{
+	int ret;
 
 	ret = pdump_validate_ring_mp(ring, mp);
 	if (ret < 0)
@@ -518,10 +637,30 @@ rte_pdump_enable_by_deviceid(char *device_id, uint16_t queue,
 	if (ret < 0)
 		return ret;
 
-	ret = pdump_prepare_client_request(device_id, queue, flags,
-						ENABLE, ring, mp, filter);
+	return pdump_prepare_client_request(device_id, queue, flags, snaplen,
+					    ENABLE, ring, mp, prm);
+}
 
-	return ret;
+int
+rte_pdump_enable_by_deviceid(char *device_id, uint16_t queue,
+			     uint32_t flags,
+			     struct rte_ring *ring,
+			     struct rte_mempool *mp,
+			     void *filter __rte_unused)
+{
+	return pdump_enable_by_deviceid(device_id, queue, flags, 0,
+					ring, mp, NULL);
+}
+
+int
+rte_pdump_enable_bpf_by_deviceid(const char *device_id, uint16_t queue,
+				 uint32_t flags, uint32_t snaplen,
+				 struct rte_ring *ring,
+				 struct rte_mempool *mp,
+				 const struct rte_bpf_prm *prm)
+{
+	return pdump_enable_by_deviceid(device_id, queue, flags, snaplen,
+					ring, mp, prm);
 }
 
 int
@@ -537,8 +676,8 @@ rte_pdump_disable(uint16_t port, uint16_t queue, uint32_t flags)
 	if (ret < 0)
 		return ret;
 
-	ret = pdump_prepare_client_request(name, queue, flags,
-						DISABLE, NULL, NULL, NULL);
+	ret = pdump_prepare_client_request(name, queue, flags, 0,
+					   DISABLE, NULL, NULL, NULL);
 
 	return ret;
 }
@@ -553,8 +692,66 @@ rte_pdump_disable_by_deviceid(char *device_id, uint16_t queue,
 	if (ret < 0)
 		return ret;
 
-	ret = pdump_prepare_client_request(device_id, queue, flags,
-						DISABLE, NULL, NULL, NULL);
+	ret = pdump_prepare_client_request(device_id, queue, flags, 0,
+					   DISABLE, NULL, NULL, NULL);
 
 	return ret;
 }
+
+static void
+pdump_sum_stats(uint16_t port, uint16_t nq,
+		struct rte_pdump_stats stats[RTE_MAX_ETHPORTS][RTE_MAX_QUEUES_PER_PORT],
+		struct rte_pdump_stats *total)
+{
+	uint64_t *sum = (uint64_t *)total;
+	unsigned int i;
+	uint64_t val;
+	uint16_t qid;
+
+	for (qid = 0; qid < nq; qid++) {
+		const uint64_t *perq = (const uint64_t *)&stats[port][qid];
+
+		for (i = 0; i < sizeof(*total) / sizeof(uint64_t); i++) {
+			val = __atomic_load_n(&perq[i], __ATOMIC_RELAXED);
+			sum[i] += val;
+		}
+	}
+}
+
+int
+rte_pdump_stats(uint16_t port, struct rte_pdump_stats *stats)
+{
+	struct rte_eth_dev_info dev_info;
+	const struct rte_memzone *mz;
+	int ret;
+
+	memset(stats, 0, sizeof(*stats));
+	ret = rte_eth_dev_info_get(port, &dev_info);
+	if (ret != 0) {
+		PDUMP_LOG(ERR,
+			  "Error during getting device (port %u) info: %s\n",
+			  port, strerror(-ret));
+		return ret;
+	}
+
+	if (pdump_stats == NULL) {
+		if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
+			PDUMP_LOG(ERR,
+				  "pdump not initialized\n");
+			rte_errno = EINVAL;
+			return -1;
+		}
+
+		mz = rte_memzone_lookup(MZ_RTE_PDUMP_STATS);
+		if (mz == NULL) {
+			PDUMP_LOG(ERR, "can not find pdump stats\n");
+			rte_errno = EINVAL;
+			return -1;
+		}
+		pdump_stats = mz->addr;
+	}
+
+	pdump_sum_stats(port, dev_info.nb_rx_queues, pdump_stats->rx, stats);
+	pdump_sum_stats(port, dev_info.nb_tx_queues, pdump_stats->tx, stats);
+	return 0;
+}
diff --git a/lib/pdump/rte_pdump.h b/lib/pdump/rte_pdump.h
index 6b00fc17aeb2..be3fd14c4bd3 100644
--- a/lib/pdump/rte_pdump.h
+++ b/lib/pdump/rte_pdump.h
@@ -15,6 +15,7 @@
 #include <stdint.h>
 #include <rte_mempool.h>
 #include <rte_ring.h>
+#include <rte_bpf.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -26,7 +27,9 @@ enum {
 	RTE_PDUMP_FLAG_RX = 1,  /* receive direction */
 	RTE_PDUMP_FLAG_TX = 2,  /* transmit direction */
 	/* both receive and transmit directions */
-	RTE_PDUMP_FLAG_RXTX = (RTE_PDUMP_FLAG_RX|RTE_PDUMP_FLAG_TX)
+	RTE_PDUMP_FLAG_RXTX = (RTE_PDUMP_FLAG_RX|RTE_PDUMP_FLAG_TX),
+
+	RTE_PDUMP_FLAG_PCAPNG = 4, /* format for pcapng */
 };
 
 /**
@@ -68,7 +71,7 @@ rte_pdump_uninit(void);
  * @param mp
  *  mempool on to which original packets will be mirrored or duplicated.
  * @param filter
- *  place holder for packet filtering.
+ *  Unused should be NULL.
  *
  * @return
  *    0 on success, -1 on error, rte_errno is set accordingly.
@@ -80,6 +83,41 @@ rte_pdump_enable(uint16_t port, uint16_t queue, uint32_t flags,
 		struct rte_mempool *mp,
 		void *filter);
 
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
+ *
+ * Enables packet capturing on given port and queue with filtering.
+ *
+ * @param port_id
+ *  The Ethernet port on which packet capturing should be enabled.
+ * @param queue
+ *  The queue on the Ethernet port which packet capturing
+ *  should be enabled. Pass UINT16_MAX to enable packet capturing on all
+ *  queues of a given port.
+ * @param flags
+ *  Pdump library flags that specify direction and packet format.
+ * @param snaplen
+ *  The upper limit on bytes to copy.
+ *  Passing UINT32_MAX means capture all the possible data.
+ * @param ring
+ *  The ring on which captured packets will be enqueued for user.
+ * @param mp
+ *  The mempool on to which original packets will be mirrored or duplicated.
+ * @param prm
+ *  Use BPF program to run to filter packes (can be NULL)
+ *
+ * @return
+ *    0 on success, -1 on error, rte_errno is set accordingly.
+ */
+__rte_experimental
+int
+rte_pdump_enable_bpf(uint16_t port_id, uint16_t queue,
+		     uint32_t flags, uint32_t snaplen,
+		     struct rte_ring *ring,
+		     struct rte_mempool *mp,
+		     const struct rte_bpf_prm *prm);
+
 /**
  * Disables packet capturing on given port and queue.
  *
@@ -118,7 +156,7 @@ rte_pdump_disable(uint16_t port, uint16_t queue, uint32_t flags);
  * @param mp
  *  mempool on to which original packets will be mirrored or duplicated.
  * @param filter
- *  place holder for packet filtering.
+ *  unused should be NULL
  *
  * @return
  *    0 on success, -1 on error, rte_errno is set accordingly.
@@ -131,6 +169,43 @@ rte_pdump_enable_by_deviceid(char *device_id, uint16_t queue,
 				struct rte_mempool *mp,
 				void *filter);
 
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
+ *
+ * Enables packet capturing on given device id and queue with filtering.
+ * device_id can be name or pci address of device.
+ *
+ * @param device_id
+ *  device id on which packet capturing should be enabled.
+ * @param queue
+ *  The queue on the Ethernet port which packet capturing
+ *  should be enabled. Pass UINT16_MAX to enable packet capturing on all
+ *  queues of a given port.
+ * @param flags
+ *  Pdump library flags that specify direction and packet format.
+ * @param snaplen
+ *  The upper limit on bytes to copy.
+ *  Passing UINT32_MAX means capture all the possible data.
+ * @param ring
+ *  The ring on which captured packets will be enqueued for user.
+ * @param mp
+ *  The mempool on to which original packets will be mirrored or duplicated.
+ * @param filter
+ *  Use BPF program to run to filter packes (can be NULL)
+ *
+ * @return
+ *    0 on success, -1 on error, rte_errno is set accordingly.
+ */
+__rte_experimental
+int
+rte_pdump_enable_bpf_by_deviceid(const char *device_id, uint16_t queue,
+				 uint32_t flags, uint32_t snaplen,
+				 struct rte_ring *ring,
+				 struct rte_mempool *mp,
+				 const struct rte_bpf_prm *filter);
+
+
 /**
  * Disables packet capturing on given device_id and queue.
  * device_id can be name or pci address of device.
@@ -153,6 +228,35 @@ int
 rte_pdump_disable_by_deviceid(char *device_id, uint16_t queue,
 				uint32_t flags);
 
+
+/**
+ * A structure used to retrieve statistics from packet capture.
+ * The statistics are sum of both receive and transmit queues.
+ */
+struct rte_pdump_stats {
+	uint64_t accepted; /**< Number of packets accepted by filter. */
+	uint64_t filtered; /**< Number of packets rejected by filter. */
+	uint64_t nombuf;   /**< Number of mbuf allocation failures. */
+	uint64_t ringfull; /**< Number of missed packets due to ring full. */
+
+	uint64_t reserved[4]; /**< Reserved and pad to cache line */
+};
+
+/**
+ * Retrieve the packet capture statistics for a queue.
+ *
+ * @param port_id
+ *   The port identifier of the Ethernet device.
+ * @param stats
+ *   A pointer to structure of type *rte_pdump_stats* to be filled in.
+ * @return
+ *   Zero if successful. -1 on error and rte_errno is set.
+ */
+__rte_experimental
+int
+rte_pdump_stats(uint16_t port_id, struct rte_pdump_stats *stats);
+
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/lib/pdump/version.map b/lib/pdump/version.map
index f0a9d12c9a9e..ce5502d9cdf4 100644
--- a/lib/pdump/version.map
+++ b/lib/pdump/version.map
@@ -10,3 +10,11 @@ DPDK_22 {
 
 	local: *;
 };
+
+EXPERIMENTAL {
+	global:
+
+	rte_pdump_enable_bpf;
+	rte_pdump_enable_bpf_by_deviceid;
+	rte_pdump_stats;
+};
-- 
2.30.2


^ permalink raw reply	[relevance 1%]

* [dpdk-dev] [PATCH v6 09/10] doc: changes for new pcapng and dumpcap
    2021-09-09 23:33  1%   ` [dpdk-dev] [PATCH v6 07/10] pdump: support pcapng and filtering Stephen Hemminger
@ 2021-09-09 23:33  1%   ` Stephen Hemminger
  1 sibling, 0 replies; 200+ results
From: Stephen Hemminger @ 2021-09-09 23:33 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

Describe the new packet capture library and utilities

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 doc/api/doxy-api-index.md                     |  1 +
 doc/api/doxy-api.conf.in                      |  1 +
 .../howto/img/packet_capture_framework.svg    | 96 +++++++++----------
 doc/guides/howto/packet_capture_framework.rst | 67 ++++++-------
 doc/guides/prog_guide/index.rst               |  1 +
 doc/guides/prog_guide/pcapng_lib.rst          | 24 +++++
 doc/guides/prog_guide/pdump_lib.rst           | 28 ++++--
 doc/guides/rel_notes/release_21_11.rst        | 10 ++
 doc/guides/tools/dumpcap.rst                  | 86 +++++++++++++++++
 doc/guides/tools/index.rst                    |  1 +
 10 files changed, 228 insertions(+), 87 deletions(-)
 create mode 100644 doc/guides/prog_guide/pcapng_lib.rst
 create mode 100644 doc/guides/tools/dumpcap.rst

diff --git a/doc/api/doxy-api-index.md b/doc/api/doxy-api-index.md
index 1992107a0356..ee07394d1c78 100644
--- a/doc/api/doxy-api-index.md
+++ b/doc/api/doxy-api-index.md
@@ -223,3 +223,4 @@ The public API headers are grouped by topics:
   [experimental APIs]  (@ref rte_compat.h),
   [ABI versioning]     (@ref rte_function_versioning.h),
   [version]            (@ref rte_version.h)
+  [pcapng]             (@ref rte_pcapng.h)
diff --git a/doc/api/doxy-api.conf.in b/doc/api/doxy-api.conf.in
index 325a0195c6ab..aba17799a9a1 100644
--- a/doc/api/doxy-api.conf.in
+++ b/doc/api/doxy-api.conf.in
@@ -58,6 +58,7 @@ INPUT                   = @TOPDIR@/doc/api/doxy-api-index.md \
                           @TOPDIR@/lib/metrics \
                           @TOPDIR@/lib/node \
                           @TOPDIR@/lib/net \
+                          @TOPDIR@/lib/pcapng \
                           @TOPDIR@/lib/pci \
                           @TOPDIR@/lib/pdump \
                           @TOPDIR@/lib/pipeline \
diff --git a/doc/guides/howto/img/packet_capture_framework.svg b/doc/guides/howto/img/packet_capture_framework.svg
index a76baf71fdee..1c2646a81096 100644
--- a/doc/guides/howto/img/packet_capture_framework.svg
+++ b/doc/guides/howto/img/packet_capture_framework.svg
@@ -1,6 +1,4 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
 <svg
    xmlns:osb="http://www.openswatchbook.org/uri/2009/osb"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
@@ -16,8 +14,8 @@
    viewBox="0 0 425.19685 283.46457"
    id="svg2"
    version="1.1"
-   inkscape:version="0.91 r13725"
-   sodipodi:docname="drawing-pcap.svg">
+   inkscape:version="1.0.2 (e86c870879, 2021-01-15)"
+   sodipodi:docname="packet_capture_framework.svg">
   <defs
      id="defs4">
     <marker
@@ -228,7 +226,7 @@
        x2="487.64606"
        y2="258.38232"
        gradientUnits="userSpaceOnUse"
-       gradientTransform="translate(-84.916417,744.90779)" />
+       gradientTransform="matrix(1.1457977,0,0,0.99944907,-151.97019,745.05014)" />
     <linearGradient
        inkscape:collect="always"
        xlink:href="#linearGradient5784"
@@ -277,17 +275,18 @@
      borderopacity="1.0"
      inkscape:pageopacity="0.0"
      inkscape:pageshadow="2"
-     inkscape:zoom="0.57434918"
-     inkscape:cx="215.17857"
-     inkscape:cy="285.26445"
+     inkscape:zoom="1"
+     inkscape:cx="226.77165"
+     inkscape:cy="78.124511"
      inkscape:document-units="px"
      inkscape:current-layer="layer1"
      showgrid="false"
-     inkscape:window-width="1874"
-     inkscape:window-height="971"
-     inkscape:window-x="2"
-     inkscape:window-y="24"
-     inkscape:window-maximized="0" />
+     inkscape:window-width="2560"
+     inkscape:window-height="1414"
+     inkscape:window-x="0"
+     inkscape:window-y="0"
+     inkscape:window-maximized="1"
+     inkscape:document-rotation="0" />
   <metadata
      id="metadata7">
     <rdf:RDF>
@@ -296,7 +295,7 @@
         <dc:format>image/svg+xml</dc:format>
         <dc:type
            rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
-        <dc:title></dc:title>
+        <dc:title />
       </cc:Work>
     </rdf:RDF>
   </metadata>
@@ -321,15 +320,15 @@
        y="790.82452" />
     <text
        xml:space="preserve"
-       style="font-style:normal;font-weight:normal;font-size:12.5px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
        x="61.050636"
        y="807.3205"
-       id="text4152"
-       sodipodi:linespacing="125%"><tspan
+       id="text4152"><tspan
          sodipodi:role="line"
          id="tspan4154"
          x="61.050636"
-         y="807.3205">DPDK Primary Application</tspan></text>
+         y="807.3205"
+         style="font-size:12.5px;line-height:1.25">DPDK Primary Application</tspan></text>
     <rect
        style="fill:#000000;fill-opacity:0;stroke:#257cdc;stroke-width:2;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
        id="rect4156-6"
@@ -339,19 +338,20 @@
        y="827.01843" />
     <text
        xml:space="preserve"
-       style="font-style:normal;font-weight:normal;font-size:12.5px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
        x="350.68585"
        y="841.16058"
-       id="text4189"
-       sodipodi:linespacing="125%"><tspan
+       id="text4189"><tspan
          sodipodi:role="line"
          id="tspan4191"
          x="350.68585"
-         y="841.16058">dpdk-pdump</tspan><tspan
+         y="841.16058"
+         style="font-size:12.5px;line-height:1.25">dpdk-dumpcap</tspan><tspan
          sodipodi:role="line"
          x="350.68585"
          y="856.78558"
-         id="tspan4193">tool</tspan></text>
+         id="tspan4193"
+         style="font-size:12.5px;line-height:1.25">tool</tspan></text>
     <rect
        style="fill:#000000;fill-opacity:0;stroke:#257cdc;stroke-width:2;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
        id="rect4156-6-4"
@@ -361,15 +361,15 @@
        y="891.16315" />
     <text
        xml:space="preserve"
-       style="font-style:normal;font-weight:normal;font-size:12.5px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
        x="352.70612"
        y="905.3053"
-       id="text4189-1"
-       sodipodi:linespacing="125%"><tspan
+       id="text4189-1"><tspan
          sodipodi:role="line"
          x="352.70612"
          y="905.3053"
-         id="tspan4193-3">PCAP PMD</tspan></text>
+         id="tspan4193-3"
+         style="font-size:12.5px;line-height:1.25">librte_pcapng</tspan></text>
     <rect
        style="fill:url(#linearGradient5745);fill-opacity:1;stroke:#257cdc;stroke-width:2;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
        id="rect4156-6-6"
@@ -379,15 +379,15 @@
        y="923.9931" />
     <text
        xml:space="preserve"
-       style="font-style:normal;font-weight:normal;font-size:12.5px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
        x="136.02846"
        y="938.13525"
-       id="text4189-0"
-       sodipodi:linespacing="125%"><tspan
+       id="text4189-0"><tspan
          sodipodi:role="line"
          x="136.02846"
          y="938.13525"
-         id="tspan4193-6">dpdk_port0</tspan></text>
+         id="tspan4193-6"
+         style="font-size:12.5px;line-height:1.25">dpdk_port0</tspan></text>
     <rect
        style="fill:#000000;fill-opacity:0;stroke:#257cdc;stroke-width:2;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
        id="rect4156-6-5"
@@ -397,33 +397,33 @@
        y="824.99817" />
     <text
        xml:space="preserve"
-       style="font-style:normal;font-weight:normal;font-size:12.5px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
        x="137.54369"
        y="839.14026"
-       id="text4189-4"
-       sodipodi:linespacing="125%"><tspan
+       id="text4189-4"><tspan
          sodipodi:role="line"
          x="137.54369"
          y="839.14026"
-         id="tspan4193-2">librte_pdump</tspan></text>
+         id="tspan4193-2"
+         style="font-size:12.5px;line-height:1.25">librte_pdump</tspan></text>
     <rect
-       style="fill:url(#linearGradient5788);fill-opacity:1;stroke:#257cdc;stroke-width:1;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       style="fill:url(#linearGradient5788);fill-opacity:1;stroke:#257cdc;stroke-width:1.07013;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
        id="rect4156-6-4-5"
-       width="94.449265"
-       height="35.355339"
-       x="307.7804"
-       y="985.61243" />
+       width="108.21974"
+       height="35.335861"
+       x="297.9809"
+       y="985.62219" />
     <text
        xml:space="preserve"
-       style="font-style:normal;font-weight:normal;font-size:12.5px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
        x="352.70618"
        y="999.75458"
-       id="text4189-1-8"
-       sodipodi:linespacing="125%"><tspan
+       id="text4189-1-8"><tspan
          sodipodi:role="line"
          x="352.70618"
          y="999.75458"
-         id="tspan4193-3-2">capture.pcap</tspan></text>
+         id="tspan4193-3-2"
+         style="font-size:12.5px;line-height:1.25">capture.pcapng</tspan></text>
     <rect
        style="fill:url(#linearGradient5788-1);fill-opacity:1;stroke:#257cdc;stroke-width:1.12555885;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
        id="rect4156-6-4-5-1"
@@ -433,15 +433,15 @@
        y="983.14984" />
     <text
        xml:space="preserve"
-       style="font-style:normal;font-weight:normal;font-size:12.5px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
        x="136.53352"
        y="1002.785"
-       id="text4189-1-8-4"
-       sodipodi:linespacing="125%"><tspan
+       id="text4189-1-8-4"><tspan
          sodipodi:role="line"
          x="136.53352"
          y="1002.785"
-         id="tspan4193-3-2-7">Traffic Generator</tspan></text>
+         id="tspan4193-3-2-7"
+         style="font-size:12.5px;line-height:1.25">Traffic Generator</tspan></text>
     <path
        style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#marker7331)"
        d="m 351.46948,927.02357 c 0,57.5787 0,57.5787 0,57.5787"
diff --git a/doc/guides/howto/packet_capture_framework.rst b/doc/guides/howto/packet_capture_framework.rst
index c31bac52340e..78baa609a021 100644
--- a/doc/guides/howto/packet_capture_framework.rst
+++ b/doc/guides/howto/packet_capture_framework.rst
@@ -1,18 +1,19 @@
 ..  SPDX-License-Identifier: BSD-3-Clause
     Copyright(c) 2017 Intel Corporation.
 
-DPDK pdump Library and pdump Tool
-=================================
+DPDK packet capture libraries and tools
+=======================================
 
 This document describes how the Data Plane Development Kit (DPDK) Packet
 Capture Framework is used for capturing packets on DPDK ports. It is intended
 for users of DPDK who want to know more about the Packet Capture feature and
 for those who want to monitor traffic on DPDK-controlled devices.
 
-The DPDK packet capture framework was introduced in DPDK v16.07. The DPDK
-packet capture framework consists of the DPDK pdump library and DPDK pdump
-tool.
-
+The DPDK packet capture framework was introduced in DPDK v16.07 and
+enhanced in 21.1. The DPDK packet capture framework consists of the
+libraries for collecting packets ``librte_pdump`` and writing packets
+to a file ``librte_pcapng``. There are two sample applications:
+``dpdk-dumpcap`` and older ``dpdk-pdump``.
 
 Introduction
 ------------
@@ -22,43 +23,46 @@ allow users to initialize the packet capture framework and to enable or
 disable packet capture. The library works on a multi process communication model and its
 usage is recommended for debugging purposes.
 
-The :ref:`dpdk-pdump <pdump_tool>` tool is developed based on the
-``librte_pdump`` library.  It runs as a DPDK secondary process and is capable
-of enabling or disabling packet capture on DPDK ports. The ``dpdk-pdump`` tool
-provides command-line options with which users can request enabling or
-disabling of the packet capture on DPDK ports.
+The :ref:`librte_pcapng <pcapng_library>` library provides the APIs to format
+packets and write them to a file in Pcapng format.
+
+
+The :ref:`dpdk-dumpcap <dumpcap_tool>` is a tool that captures packets in
+like Wireshark dumpcap does for Linux. It runs as a DPDK secondary process and
+captures packets from one or more interfaces and writes them to a file
+in Pcapng format.  The ``dpdk-dumpcap`` tool is designed to take
+most of the same options as the Wireshark ``dumpcap`` command.
 
-The application which initializes the packet capture framework will be a primary process
-and the application that enables or disables the packet capture will
-be a secondary process. The primary process sends the Rx and Tx packets from the DPDK ports
-to the secondary process.
+Without any options it will use the packet capture framework to
+capture traffic from the first available DPDK port.
 
 In DPDK the ``testpmd`` application can be used to initialize the packet
-capture framework and acts as a server, and the ``dpdk-pdump`` tool acts as a
+capture framework and acts as a server, and the ``dpdk-dumpcap`` tool acts as a
 client. To view Rx or Tx packets of ``testpmd``, the application should be
-launched first, and then the ``dpdk-pdump`` tool. Packets from ``testpmd``
-will be sent to the tool, which then sends them on to the Pcap PMD device and
-that device writes them to the Pcap file or to an external interface depending
-on the command-line option used.
+launched first, and then the ``dpdk-dumpcap`` tool. Packets from ``testpmd``
+will be sent to the tool, and then to the Pcapng file.
 
 Some things to note:
 
-* The ``dpdk-pdump`` tool can only be used in conjunction with a primary
+* All tools using ``librte_pdump`` can only be used in conjunction with a primary
   application which has the packet capture framework initialized already. In
   dpdk, only ``testpmd`` is modified to initialize packet capture framework,
-  other applications remain untouched. So, if the ``dpdk-pdump`` tool has to
+  other applications remain untouched. So, if the ``dpdk-dumpcap`` tool has to
   be used with any application other than the testpmd, the user needs to
   explicitly modify that application to call the packet capture framework
   initialization code. Refer to the ``app/test-pmd/testpmd.c`` code and look
   for ``pdump`` keyword to see how this is done.
 
-* The ``dpdk-pdump`` tool depends on the libpcap based PMD.
+* The ``dpdk-pdump`` tool is an older tool created as demonstration of ``librte_pdump``
+  library. The ``dpdk-pdump`` tool provides more limited functionality and
+  and depends on the Pcap PMD. It is retained only for compatibility reasons;
+  users should use ``dpdk-dumpcap`` instead.
 
 
 Test Environment
 ----------------
 
-The overview of using the Packet Capture Framework and the ``dpdk-pdump`` tool
+The overview of using the Packet Capture Framework and the ``dpdk-dumpcap`` utility
 for packet capturing on the DPDK port in
 :numref:`figure_packet_capture_framework`.
 
@@ -66,13 +70,13 @@ for packet capturing on the DPDK port in
 
 .. figure:: img/packet_capture_framework.*
 
-   Packet capturing on a DPDK port using the dpdk-pdump tool.
+   Packet capturing on a DPDK port using the dpdk-dumpcap utility.
 
 
 Running the Application
 -----------------------
 
-The following steps demonstrate how to run the ``dpdk-pdump`` tool to capture
+The following steps demonstrate how to run the ``dpdk-dumpcap`` tool to capture
 Rx side packets on dpdk_port0 in :numref:`figure_packet_capture_framework` and
 inspect them using ``tcpdump``.
 
@@ -80,16 +84,15 @@ inspect them using ``tcpdump``.
 
      sudo <build_dir>/app/dpdk-testpmd -c 0xf0 -n 4 -- -i --port-topology=chained
 
-#. Launch the pdump tool as follows::
+#. Launch the dpdk-dump as follows::
 
-     sudo <build_dir>/app/dpdk-pdump -- \
-          --pdump 'port=0,queue=*,rx-dev=/tmp/capture.pcap'
+     sudo <build_dir>/app/dpdk-dumpcap -w /tmp/capture.pcapng
 
 #. Send traffic to dpdk_port0 from traffic generator.
-   Inspect packets captured in the file capture.pcap using a tool
-   that can interpret Pcap files, for example tcpdump::
+   Inspect packets captured in the file capture.pcap using a tool such as
+   tcpdump or tshark that can interpret Pcapng files::
 
-     $tcpdump -nr /tmp/capture.pcap
+     $ tcpdump -nr /tmp/capture.pcapng
      reading from file /tmp/capture.pcap, link-type EN10MB (Ethernet)
      11:11:36.891404 IP 4.4.4.4.whois++ > 3.3.3.3.whois++: UDP, length 18
      11:11:36.891442 IP 4.4.4.4.whois++ > 3.3.3.3.whois++: UDP, length 18
diff --git a/doc/guides/prog_guide/index.rst b/doc/guides/prog_guide/index.rst
index 2dce507f46a3..b440c77c2ba1 100644
--- a/doc/guides/prog_guide/index.rst
+++ b/doc/guides/prog_guide/index.rst
@@ -43,6 +43,7 @@ Programmer's Guide
     ip_fragment_reassembly_lib
     generic_receive_offload_lib
     generic_segmentation_offload_lib
+    pcapng_lib
     pdump_lib
     multi_proc_support
     kernel_nic_interface
diff --git a/doc/guides/prog_guide/pcapng_lib.rst b/doc/guides/prog_guide/pcapng_lib.rst
new file mode 100644
index 000000000000..36379b530a57
--- /dev/null
+++ b/doc/guides/prog_guide/pcapng_lib.rst
@@ -0,0 +1,24 @@
+..  SPDX-License-Identifier: BSD-3-Clause
+    Copyright(c) 2016 Intel Corporation.
+
+.. _pcapng_library:
+
+Packet Capture File Writer
+==========================
+
+Pcapng is a library for creating files in Pcapng file format.
+The Pcapng file format is the default capture file format for modern
+network capture processing tools. It can be read by wireshark and tcpdump.
+
+Usage
+-----
+
+Before the library can be used the function ``rte_pcapng_init``
+should be called once to initialize timestamp computation.
+
+
+References
+----------
+* Draft RFC https://www.ietf.org/id/draft-tuexen-opsawg-pcapng-03.html
+
+* Project repository  https://github.com/pcapng/pcapng/
diff --git a/doc/guides/prog_guide/pdump_lib.rst b/doc/guides/prog_guide/pdump_lib.rst
index 62c0b015b2fe..9af91415e5ea 100644
--- a/doc/guides/prog_guide/pdump_lib.rst
+++ b/doc/guides/prog_guide/pdump_lib.rst
@@ -3,10 +3,10 @@
 
 .. _pdump_library:
 
-The librte_pdump Library
-========================
+The Packet Capture Library
+==========================
 
-The ``librte_pdump`` library provides a framework for packet capturing in DPDK.
+The DPDK ``pdump`` library provides a framework for packet capturing in DPDK.
 The library does the complete copy of the Rx and Tx mbufs to a new mempool and
 hence it slows down the performance of the applications, so it is recommended
 to use this library for debugging purposes.
@@ -23,11 +23,19 @@ or disable the packet capture, and to uninitialize it.
 
 * ``rte_pdump_enable()``:
   This API enables the packet capture on a given port and queue.
-  Note: The filter option in the API is a place holder for future enhancements.
+
+* ``rte_pdump_enable_bpf()``
+  This API enables the packet capture on a given port and queue.
+  It also allows setting an optional filter using DPDK BPF interpreter and
+  setting the captured packet length.
 
 * ``rte_pdump_enable_by_deviceid()``:
   This API enables the packet capture on a given device id (``vdev name or pci address``) and queue.
-  Note: The filter option in the API is a place holder for future enhancements.
+
+* ``rte_pdump_enable_bpf_by_deviceid()``
+  This API enables the packet capture on a given device id (``vdev name or pci address``) and queue.
+  It also allows seating an optional filter using DPDK BPF interpreter and
+  setting the captured packet length.
 
 * ``rte_pdump_disable()``:
   This API disables the packet capture on a given port and queue.
@@ -61,6 +69,12 @@ and enables the packet capture by registering the Ethernet RX and TX callbacks f
 and queue combinations. Then the primary process will mirror the packets to the new mempool and enqueue them to
 the rte_ring that secondary process have passed to these APIs.
 
+The packet ring supports one of two formats. The default format enqueues copies of the original packets
+into the rte_ring. If the ``RTE_PDUMP_FLAG_PCAPNG`` is set the mbuf data is extended with header and trailer
+to match the format of Pcapng enhanced packet block. The enhanced packet block has meta-data such as the
+timestamp, port and queue the packet was captured on. It is up to the application consuming the
+packets from the ring to select the format desired.
+
 The library APIs ``rte_pdump_disable()`` and ``rte_pdump_disable_by_deviceid()`` disables the packet capture.
 For the calls to these APIs from secondary process, the library creates the "pdump disable" request and sends
 the request to the primary process over the multi process channel. The primary process takes this request and
@@ -74,5 +88,5 @@ function.
 Use Case: Packet Capturing
 --------------------------
 
-The DPDK ``app/pdump`` tool is developed based on this library to capture packets in DPDK.
-Users can use this as an example to develop their own packet capturing tools.
+The DPDK ``app/dpdk-dumpcap`` utility uses this library
+to capture packets in DPDK.
diff --git a/doc/guides/rel_notes/release_21_11.rst b/doc/guides/rel_notes/release_21_11.rst
index 675b5738348b..ee24cbfdb99d 100644
--- a/doc/guides/rel_notes/release_21_11.rst
+++ b/doc/guides/rel_notes/release_21_11.rst
@@ -62,6 +62,16 @@ New Features
   * Added bus-level parsing of the devargs syntax.
   * Kept compatibility with the legacy syntax as parsing fallback.
 
+* **Enhance Packet capture.**
+
+  * New dpdk-dumpcap program that has most of the features of the
+    wireshark dumpcap utility including capture of multiple interfaces,
+    stopping after number of bytes, packets.
+  * New library for writing pcapng packet capture files.
+  * Enhancement to the pdump library to support:
+    * Packet filter with BPF.
+    * Pcapng format with timestamps and meta-data.
+    * Fixes packet capture with stripped VLAN tags.
 
 Removed Items
 -------------
diff --git a/doc/guides/tools/dumpcap.rst b/doc/guides/tools/dumpcap.rst
new file mode 100644
index 000000000000..664ea0c79802
--- /dev/null
+++ b/doc/guides/tools/dumpcap.rst
@@ -0,0 +1,86 @@
+..  SPDX-License-Identifier: BSD-3-Clause
+    Copyright(c) 2020 Microsoft Corporation.
+
+.. _dumpcap_tool:
+
+dpdk-dumpcap Application
+========================
+
+The ``dpdk-dumpcap`` tool is a Data Plane Development Kit (DPDK)
+network traffic dump tool.  The interface is similar to  the dumpcap tool in Wireshark.
+It runs as a secondary DPDK process and lets you capture packets that are
+coming into and out of a DPDK primary process.
+The ``dpdk-dumpcap`` writes files in Pcapng packet format using
+capture file format is pcapng.
+
+Without any options set it will use DPDK to capture traffic from the first
+available DPDK interface and write the received raw packet data, along
+with timestamps into a pcapng file.
+
+If the ``-w`` option is not specified, ``dpdk-dumpcap`` writes to a newly
+create file with a name chosen based on interface name and timestamp.
+If ``-w`` option is specified, then that file is used.
+
+   .. Note::
+      * The ``dpdk-dumpcap`` tool can only be used in conjunction with a primary
+        application which has the packet capture framework initialized already.
+        In dpdk, only the ``testpmd`` is modified to initialize packet capture
+        framework, other applications remain untouched. So, if the ``dpdk-dumpcap``
+        tool has to be used with any application other than the testpmd, user
+        needs to explicitly modify that application to call packet capture
+        framework initialization code. Refer ``app/test-pmd/testpmd.c``
+        code to see how this is done.
+
+      * The ``dpdk-dumpcap`` tool runs as a DPDK secondary process. It exits when
+        the primary application exits.
+
+
+Running the Application
+-----------------------
+
+To list interfaces available for capture use ``--list-interfaces``.
+
+To filter packets in style of *tshark* use the ``-f`` flag.
+
+To capture on multiple interfaces at once, use multiple ``-I`` flags.
+
+Example
+-------
+
+.. code-block:: console
+
+   # ./<build_dir>/app/dpdk-dumpcap --list-interfaces
+   0. 000:00:03.0
+   1. 000:00:03.1
+
+   # ./<build_dir>/app/dpdk-dumpcap -I 0000:00:03.0 -c 6 -w /tmp/sample.pcapng
+   Packets captured: 6
+   Packets received/dropped on interface '0000:00:03.0' 6/0
+
+   # ./<build_dir>/app/dpdk-dumpcap -f 'tcp port 80'
+   Packets captured: 6
+   Packets received/dropped on interface '0000:00:03.0' 10/8
+
+
+Limitations
+-----------
+The following option of Wireshark ``dumpcap`` is not yet implemented:
+
+   * ``-b|--ring-buffer`` -- more complex file management.
+
+The following options do not make sense in the context of DPDK.
+
+   * ``-C <byte_limit>`` -- its a kernel thing
+
+   * ``-t`` -- use a thread per interface
+
+   * Timestamp type.
+
+   * Link data types. Only EN10MB (Ethernet) is supported.
+
+   * Wireless related options:  ``-I|--monitor-mode`` and  ``-k <freq>``
+
+
+.. Note::
+   * The options to ``dpdk-dumpcap`` are like the Wireshark dumpcap program and
+     are not the same as ``dpdk-pdump`` and other DPDK applications.
diff --git a/doc/guides/tools/index.rst b/doc/guides/tools/index.rst
index 93dde4148e90..b71c12b8f2dd 100644
--- a/doc/guides/tools/index.rst
+++ b/doc/guides/tools/index.rst
@@ -8,6 +8,7 @@ DPDK Tools User Guides
     :maxdepth: 2
     :numbered:
 
+    dumpcap
     proc_info
     pdump
     pmdinfo
-- 
2.30.2


^ permalink raw reply	[relevance 1%]

* Re: [dpdk-dev] [PATCH v2 4/6] eal: update rte_eal_wait_lcore definition
  @ 2021-09-09 23:37  3%     ` Honnappa Nagarahalli
  0 siblings, 0 replies; 200+ results
From: Honnappa Nagarahalli @ 2021-09-09 23:37 UTC (permalink / raw)
  To: Honnappa Nagarahalli, dev, konstantin.ananyev, david.marchand,
	Feifei Wang, techboard
  Cc: Ruifeng Wang, nd, Feifei Wang (Arm Technology China), nd

+ Techboard.

This is the API (not ABI as I mentioned) compatibility breakage that I mentioned during the last Techboard meeting.

The removal of the FINISHED state itself was announced. This is a change related to that. However, the specific API change was not called out in the deprecation notice.


> -----Original Message-----
> From: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
> Sent: Thursday, September 9, 2021 6:13 PM
> To: dev@dpdk.org; Honnappa Nagarahalli
> <Honnappa.Nagarahalli@arm.com>; konstantin.ananyev@intel.com;
> david.marchand@redhat.com; Feifei Wang <Feifei.Wang2@arm.com>
> Cc: Ruifeng Wang <Ruifeng.Wang@arm.com>; nd <nd@arm.com>; Feifei
> Wang (Arm Technology China) <Feifei.Wang@arm.com>
> Subject: [PATCH v2 4/6] eal: update rte_eal_wait_lcore definition
> 
> Since the FINISHED state is removed, the API rte_eal_wait_lcore is updated to
> always return the status of the last function that ran in the worker core.
> 
> Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
> Reviewed-by: Feifei Wang <feifei.wang@arm.com>
> ---
>  lib/eal/common/eal_common_launch.c |  6 ++----
>  lib/eal/include/rte_launch.h       | 12 +++++-------
>  2 files changed, 7 insertions(+), 11 deletions(-)
> 
> diff --git a/lib/eal/common/eal_common_launch.c
> b/lib/eal/common/eal_common_launch.c
> index 78fd940267..4bc842417a 100644
> --- a/lib/eal/common/eal_common_launch.c
> +++ b/lib/eal/common/eal_common_launch.c
> @@ -23,10 +23,8 @@
>  int
>  rte_eal_wait_lcore(unsigned worker_id)
>  {
> -	if (lcore_config[worker_id].state == WAIT)
> -		return 0;
> -
> -	while (lcore_config[worker_id].state != WAIT)
> +	while (__atomic_load_n(&lcore_config[worker_id].state,
> +					__ATOMIC_ACQUIRE) != WAIT)
>  		rte_pause();
> 
>  	rte_rmb();
> diff --git a/lib/eal/include/rte_launch.h b/lib/eal/include/rte_launch.h index
> ed0bb4762a..f2d386e6e2 100644
> --- a/lib/eal/include/rte_launch.h
> +++ b/lib/eal/include/rte_launch.h
> @@ -119,18 +119,16 @@ enum rte_lcore_state_t
> rte_eal_get_lcore_state(unsigned int worker_id);
>   *
>   * To be executed on the MAIN lcore only.
>   *
> - * If the worker lcore identified by the worker_id is in a FINISHED state,
> - * switch to the WAIT state. If the lcore is in RUNNING state, wait until
> - * the lcore finishes its job and moves to the FINISHED state.
> + * If the lcore identified by the worker_id is in RUNNING state, wait
> + until
> + * the lcore finishes its job and moves to the WAIT state.
>   *
>   * @param worker_id
>   *   The identifier of the lcore.
>   * @return
> - *   - 0: If the lcore identified by the worker_id is in a WAIT state.
> + *   - 0: If the remote launch function was never called on the lcore
> + *     identified by the worker_id.
>   *   - The value that was returned by the previous remote launch
> - *     function call if the lcore identified by the worker_id was in a
> - *     FINISHED or RUNNING state. In this case, it changes the state
> - *     of the lcore to WAIT.
> + *     function call.
>   */
>  int rte_eal_wait_lcore(unsigned worker_id);
> 
> --
> 2.25.1


^ permalink raw reply	[relevance 3%]

* [dpdk-dev] [PATCH 7/8] kni: replace unused variable definition with reserved bytes
  @ 2021-09-10  2:24  3% ` Chenbo Xia
  2021-09-10  2:24  2% ` [dpdk-dev] [PATCH 8/8] bus/pci: remove ABIs in PCI bus Chenbo Xia
  1 sibling, 0 replies; 200+ results
From: Chenbo Xia @ 2021-09-10  2:24 UTC (permalink / raw)
  To: dev; +Cc: Ferruh Yigit

PCI ID and address in structure rte_kni_conf are never used. And in
order not to break ABI, replace these variables with reserved bytes.

Signed-off-by: Chenbo Xia <chenbo.xia@intel.com>
---
 lib/kni/rte_kni.h | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/lib/kni/rte_kni.h b/lib/kni/rte_kni.h
index b0eaf46104..2281abbf6a 100644
--- a/lib/kni/rte_kni.h
+++ b/lib/kni/rte_kni.h
@@ -17,7 +17,6 @@
  * and burst transmit packets to KNI interfaces.
  */
 
-#include <rte_pci.h>
 #include <rte_memory.h>
 #include <rte_mempool.h>
 #include <rte_ether.h>
@@ -66,8 +65,7 @@ struct rte_kni_conf {
 	uint32_t core_id;   /* Core ID to bind kernel thread on */
 	uint16_t group_id;  /* Group ID */
 	unsigned mbuf_size; /* mbuf size */
-	struct rte_pci_addr addr; /* depreciated */
-	struct rte_pci_id id; /* depreciated */
+	uint8_t rsvd[20];
 
 	__extension__
 	uint8_t force_bind : 1; /* Flag to bind kernel thread */
-- 
2.17.1


^ permalink raw reply	[relevance 3%]

* [dpdk-dev] [PATCH 8/8] bus/pci: remove ABIs in PCI bus
    2021-09-10  2:24  3% ` [dpdk-dev] [PATCH 7/8] kni: replace unused variable definition with reserved bytes Chenbo Xia
@ 2021-09-10  2:24  2% ` Chenbo Xia
  2021-09-13 12:06  0%   ` Kinsella, Ray
  2021-09-14  8:15  0%   ` Xu, Rosen
  1 sibling, 2 replies; 200+ results
From: Chenbo Xia @ 2021-09-10  2:24 UTC (permalink / raw)
  To: dev
  Cc: Nicolas Chautru, Ferruh Yigit, Anatoly Burakov, Ray Kinsella,
	Nithin Dabilpuram, Kiran Kumar K, Sunil Kumar Kori, Satha Rao,
	Matan Azrad, Shahaf Shuler, Viacheslav Ovsiienko, Jerin Jacob,
	Anoob Joseph, Fiona Trahe, John Griffin, Deepak Kumar Jain,
	Andrew Rybchenko, Ashish Gupta, Somalapuram Amaranath,
	Ankur Dwivedi, Tejasree Kondoj, Nagadheeraj Rottela,
	Srikanth Jampala, Jay Zhou, Timothy McDaniel, Pavan Nikhilesh,
	Ashwin Sekhar T K, Harman Kalra, Shepard Siegel, Ed Czeck,
	John Miller, Steven Webster, Matt Peters, Rasesh Mody,
	Shahed Shaikh, Ajit Khaparde, Somnath Kotur, Chas Williams,
	Min Hu (Connor),
	Rahul Lakkireddy, Haiyue Wang, Marcin Wojtas, Michal Krawczyk,
	Shai Brandes, Evgeny Schemeilin, Igor Chauskin, John Daley,
	Hyong Youb Kim, Ziyang Xuan, Xiaoyun Wang, Guoyang Zhou,
	Yisen Zhuang, Lijun Ou, Beilei Xing, Andrew Boyer, Rosen Xu,
	Stephen Hemminger, Long Li, Devendra Singh Rawat, Maciej Czekaj,
	Jiawen Wu, Jian Wang, Maxime Coquelin, Yong Wang, Jakub Palider,
	Tomasz Duszynski, Tianfei zhang, Bruce Richardson, Xiaoyun Li,
	Jingjing Wu, Radha Mohan Chintakuntla, Veerasenareddy Burru,
	Ori Kam, Xiao Wang, Thomas Monjalon

As announced in the deprecation note, most of ABIs in PCI bus are
removed in this patch. Only the function rte_pci_dump is still ABI
and experimental APIs are kept for future promotion.

This patch creates a new file named pci_driver.h and moves most of
the content in original rte_bus_pci.h to it. After that, pci_driver.h
is considered the interface for drivers and rte_bus_pci.h for
applications. pci_driver.h is defined as driver_sdk_headers so that
out-of-tree drivers can use it.

Then this patch replaces the including of rte_bus_pci.h with pci_driver.h
in all related drivers.

Signed-off-by: Chenbo Xia <chenbo.xia@intel.com>
---
 app/test/virtual_pmd.c                        |   2 +-
 doc/guides/rel_notes/release_21_11.rst        |   2 +
 drivers/baseband/acc100/rte_acc100_pmd.c      |   2 +-
 .../fpga_5gnr_fec/rte_fpga_5gnr_fec.c         |   2 +-
 drivers/baseband/fpga_lte_fec/fpga_lte_fec.c  |   2 +-
 drivers/bus/pci/bsd/pci.c                     |   1 -
 drivers/bus/pci/linux/pci.c                   |   1 -
 drivers/bus/pci/linux/pci_uio.c               |   1 -
 drivers/bus/pci/linux/pci_vfio.c              |   1 -
 drivers/bus/pci/meson.build                   |   4 +
 drivers/bus/pci/pci_common_uio.c              |   1 -
 drivers/bus/pci/pci_driver.h                  | 402 ++++++++++++++++++
 drivers/bus/pci/pci_params.c                  |   1 -
 drivers/bus/pci/private.h                     |   3 +-
 drivers/bus/pci/rte_bus_pci.h                 | 375 +---------------
 drivers/bus/pci/version.map                   |  32 +-
 drivers/common/cnxk/roc_platform.h            |   2 +-
 drivers/common/mlx5/linux/mlx5_common_verbs.c |   2 +-
 drivers/common/mlx5/mlx5_common_pci.c         |   2 +-
 drivers/common/octeontx2/otx2_dev.h           |   2 +-
 drivers/common/octeontx2/otx2_sec_idev.c      |   2 +-
 drivers/common/qat/qat_device.h               |   2 +-
 drivers/common/qat/qat_qp.c                   |   2 +-
 drivers/common/sfc_efx/sfc_efx.h              |   2 +-
 drivers/compress/mlx5/mlx5_compress.c         |   2 +-
 drivers/compress/octeontx/otx_zip.h           |   2 +-
 drivers/compress/qat/qat_comp.c               |   2 +-
 drivers/crypto/ccp/ccp_dev.h                  |   2 +-
 drivers/crypto/ccp/ccp_pci.h                  |   2 +-
 drivers/crypto/ccp/rte_ccp_pmd.c              |   2 +-
 drivers/crypto/cnxk/cn10k_cryptodev.c         |   2 +-
 drivers/crypto/cnxk/cn9k_cryptodev.c          |   2 +-
 drivers/crypto/mlx5/mlx5_crypto.c             |   2 +-
 drivers/crypto/nitrox/nitrox_device.h         |   2 +-
 drivers/crypto/octeontx/otx_cryptodev.c       |   2 +-
 drivers/crypto/octeontx/otx_cryptodev_ops.c   |   2 +-
 drivers/crypto/octeontx2/otx2_cryptodev.c     |   2 +-
 drivers/crypto/qat/qat_sym.c                  |   2 +-
 drivers/crypto/qat/qat_sym_pmd.c              |   2 +-
 drivers/crypto/virtio/virtio_cryptodev.c      |   2 +-
 drivers/crypto/virtio/virtio_pci.h            |   2 +-
 drivers/event/dlb2/pf/dlb2_main.h             |   2 +-
 drivers/event/dlb2/pf/dlb2_pf.c               |   2 +-
 drivers/event/octeontx/ssovf_probe.c          |   2 +-
 drivers/event/octeontx/timvf_probe.c          |   2 +-
 drivers/event/octeontx2/otx2_evdev.c          |   2 +-
 drivers/mempool/cnxk/cnxk_mempool.c           |   2 +-
 drivers/mempool/octeontx/octeontx_fpavf.c     |   2 +-
 drivers/mempool/octeontx2/otx2_mempool.c      |   2 +-
 drivers/mempool/octeontx2/otx2_mempool.h      |   2 +-
 drivers/mempool/octeontx2/otx2_mempool_irq.c  |   2 +-
 drivers/meson.build                           |   4 +
 drivers/net/ark/ark_ethdev.c                  |   2 +-
 drivers/net/avp/avp_ethdev.c                  |   2 +-
 drivers/net/bnx2x/bnx2x.h                     |   2 +-
 drivers/net/bnxt/bnxt.h                       |   2 +-
 drivers/net/bonding/rte_eth_bond_args.c       |   2 +-
 drivers/net/cxgbe/base/adapter.h              |   2 +-
 drivers/net/cxgbe/cxgbe_ethdev.c              |   2 +-
 drivers/net/e1000/em_ethdev.c                 |   2 +-
 drivers/net/e1000/em_rxtx.c                   |   2 +-
 drivers/net/e1000/igb_ethdev.c                |   2 +-
 drivers/net/e1000/igb_pf.c                    |   2 +-
 drivers/net/ena/ena_ethdev.h                  |   2 +-
 drivers/net/enic/base/vnic_dev.h              |   2 +-
 drivers/net/enic/enic_ethdev.c                |   2 +-
 drivers/net/enic/enic_main.c                  |   2 +-
 drivers/net/enic/enic_vf_representor.c        |   2 +-
 drivers/net/hinic/base/hinic_pmd_hwdev.c      |   2 +-
 drivers/net/hinic/base/hinic_pmd_hwif.c       |   2 +-
 drivers/net/hinic/base/hinic_pmd_nicio.c      |   2 +-
 drivers/net/hinic/hinic_pmd_ethdev.c          |   2 +-
 drivers/net/hns3/hns3_ethdev.c                |   2 +-
 drivers/net/hns3/hns3_rxtx.c                  |   2 +-
 drivers/net/i40e/i40e_ethdev.c                |   2 +-
 drivers/net/i40e/i40e_ethdev_vf.c             |   2 +-
 drivers/net/i40e/i40e_vf_representor.c        |   2 +-
 drivers/net/igc/igc_ethdev.c                  |   2 +-
 drivers/net/ionic/ionic.h                     |   2 +-
 drivers/net/ionic/ionic_ethdev.c              |   2 +-
 drivers/net/ipn3ke/ipn3ke_ethdev.c            |   2 +-
 drivers/net/ipn3ke/ipn3ke_representor.c       |   2 +-
 drivers/net/ipn3ke/ipn3ke_tm.c                |   2 +-
 drivers/net/ixgbe/ixgbe_ethdev.c              |   2 +-
 drivers/net/ixgbe/ixgbe_ethdev.h              |   2 +-
 drivers/net/mlx4/mlx4_ethdev.c                |   2 +-
 drivers/net/mlx5/linux/mlx5_ethdev_os.c       |   2 +-
 drivers/net/mlx5/linux/mlx5_os.c              |   2 +-
 drivers/net/mlx5/mlx5.c                       |   2 +-
 drivers/net/mlx5/mlx5_ethdev.c                |   2 +-
 drivers/net/mlx5/mlx5_txq.c                   |   2 +-
 drivers/net/netvsc/hn_vf.c                    |   2 +-
 drivers/net/octeontx/base/octeontx_pkivf.c    |   2 +-
 drivers/net/octeontx/base/octeontx_pkovf.c    |   2 +-
 drivers/net/octeontx2/otx2_ethdev_irq.c       |   2 +-
 drivers/net/qede/base/bcm_osal.h              |   2 +-
 drivers/net/sfc/sfc.h                         |   2 +-
 drivers/net/sfc/sfc_ethdev.c                  |   2 +-
 drivers/net/sfc/sfc_sriov.c                   |   2 +-
 drivers/net/thunderx/nicvf_ethdev.c           |   2 +-
 drivers/net/txgbe/txgbe_ethdev.h              |   2 +-
 drivers/net/txgbe/txgbe_flow.c                |   2 +-
 drivers/net/txgbe/txgbe_pf.c                  |   2 +-
 drivers/net/virtio/virtio_pci.h               |   2 +-
 drivers/net/virtio/virtio_pci_ethdev.c        |   2 +-
 drivers/net/vmxnet3/vmxnet3_ethdev.c          |   2 +-
 drivers/raw/cnxk_bphy/cnxk_bphy.c             |   2 +-
 drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c         |   2 +-
 drivers/raw/cnxk_bphy/cnxk_bphy_irq.c         |   2 +-
 drivers/raw/cnxk_bphy/cnxk_bphy_irq.h         |   2 +-
 drivers/raw/ifpga/ifpga_rawdev.c              |   2 +-
 drivers/raw/ifpga/rte_pmd_ifpga.c             |   2 +-
 drivers/raw/ioat/idxd_pci.c                   |   2 +-
 drivers/raw/ioat/ioat_rawdev.c                |   2 +-
 drivers/raw/ntb/ntb.c                         |   2 +-
 drivers/raw/ntb/ntb_hw_intel.c                |   2 +-
 drivers/raw/octeontx2_dma/otx2_dpi_rawdev.c   |   2 +-
 drivers/raw/octeontx2_ep/otx2_ep_enqdeq.c     |   2 +-
 drivers/raw/octeontx2_ep/otx2_ep_rawdev.c     |   2 +-
 drivers/regex/mlx5/mlx5_regex.c               |   2 +-
 drivers/regex/mlx5/mlx5_regex_fastpath.c      |   2 +-
 drivers/vdpa/ifc/base/ifcvf_osdep.h           |   2 +-
 drivers/vdpa/ifc/ifcvf_vdpa.c                 |   2 +-
 drivers/vdpa/mlx5/mlx5_vdpa.c                 |   2 +-
 lib/ethdev/ethdev_pci.h                       |   2 +-
 lib/eventdev/eventdev_pmd_pci.h               |   2 +-
 126 files changed, 546 insertions(+), 508 deletions(-)
 create mode 100644 drivers/bus/pci/pci_driver.h

diff --git a/app/test/virtual_pmd.c b/app/test/virtual_pmd.c
index 7036f401ed..555f2969ab 100644
--- a/app/test/virtual_pmd.c
+++ b/app/test/virtual_pmd.c
@@ -6,7 +6,7 @@
 #include <rte_ethdev.h>
 #include <ethdev_driver.h>
 #include <rte_pci.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_malloc.h>
 #include <rte_memcpy.h>
 #include <rte_memory.h>
diff --git a/doc/guides/rel_notes/release_21_11.rst b/doc/guides/rel_notes/release_21_11.rst
index 1c9abb74ec..8c24eb3235 100644
--- a/doc/guides/rel_notes/release_21_11.rst
+++ b/doc/guides/rel_notes/release_21_11.rst
@@ -112,6 +112,8 @@ ABI Changes
    Also, make sure to start the actual text at the margin.
    =======================================================
 
+* pci: Removed all ABIs defined in rte_bus_pci.h except the function
+  ``rte_pci_dump()``.
 
 Known Issues
 ------------
diff --git a/drivers/baseband/acc100/rte_acc100_pmd.c b/drivers/baseband/acc100/rte_acc100_pmd.c
index 68ba523ea9..72734784c9 100644
--- a/drivers/baseband/acc100/rte_acc100_pmd.c
+++ b/drivers/baseband/acc100/rte_acc100_pmd.c
@@ -14,7 +14,7 @@
 #include <rte_branch_prediction.h>
 #include <rte_hexdump.h>
 #include <rte_pci.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #ifdef RTE_BBDEV_OFFLOAD_COST
 #include <rte_cycles.h>
 #endif
diff --git a/drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c b/drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c
index 6485cc824a..31cb7e5605 100644
--- a/drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c
+++ b/drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c
@@ -11,7 +11,7 @@
 #include <rte_mempool.h>
 #include <rte_errno.h>
 #include <rte_pci.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_byteorder.h>
 #ifdef RTE_BBDEV_OFFLOAD_COST
 #include <rte_cycles.h>
diff --git a/drivers/baseband/fpga_lte_fec/fpga_lte_fec.c b/drivers/baseband/fpga_lte_fec/fpga_lte_fec.c
index 350c4248eb..0dc1417dde 100644
--- a/drivers/baseband/fpga_lte_fec/fpga_lte_fec.c
+++ b/drivers/baseband/fpga_lte_fec/fpga_lte_fec.c
@@ -11,7 +11,7 @@
 #include <rte_mempool.h>
 #include <rte_errno.h>
 #include <rte_pci.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_byteorder.h>
 #ifdef RTE_BBDEV_OFFLOAD_COST
 #include <rte_cycles.h>
diff --git a/drivers/bus/pci/bsd/pci.c b/drivers/bus/pci/bsd/pci.c
index d189bff311..b7d3a8df33 100644
--- a/drivers/bus/pci/bsd/pci.c
+++ b/drivers/bus/pci/bsd/pci.c
@@ -28,7 +28,6 @@
 #include <rte_interrupts.h>
 #include <rte_log.h>
 #include <rte_pci.h>
-#include <rte_bus_pci.h>
 #include <rte_common.h>
 #include <rte_launch.h>
 #include <rte_memory.h>
diff --git a/drivers/bus/pci/linux/pci.c b/drivers/bus/pci/linux/pci.c
index 4d261b55ee..8f91e0233c 100644
--- a/drivers/bus/pci/linux/pci.c
+++ b/drivers/bus/pci/linux/pci.c
@@ -8,7 +8,6 @@
 #include <rte_log.h>
 #include <rte_bus.h>
 #include <rte_pci.h>
-#include <rte_bus_pci.h>
 #include <rte_malloc.h>
 #include <rte_devargs.h>
 #include <rte_memcpy.h>
diff --git a/drivers/bus/pci/linux/pci_uio.c b/drivers/bus/pci/linux/pci_uio.c
index 39ebeac2a0..de028e4874 100644
--- a/drivers/bus/pci/linux/pci_uio.c
+++ b/drivers/bus/pci/linux/pci_uio.c
@@ -19,7 +19,6 @@
 #include <rte_string_fns.h>
 #include <rte_log.h>
 #include <rte_pci.h>
-#include <rte_bus_pci.h>
 #include <rte_common.h>
 #include <rte_malloc.h>
 
diff --git a/drivers/bus/pci/linux/pci_vfio.c b/drivers/bus/pci/linux/pci_vfio.c
index a024269140..2ccd0fa101 100644
--- a/drivers/bus/pci/linux/pci_vfio.c
+++ b/drivers/bus/pci/linux/pci_vfio.c
@@ -13,7 +13,6 @@
 
 #include <rte_log.h>
 #include <rte_pci.h>
-#include <rte_bus_pci.h>
 #include <rte_eal_paging.h>
 #include <rte_malloc.h>
 #include <rte_vfio.h>
diff --git a/drivers/bus/pci/meson.build b/drivers/bus/pci/meson.build
index 81c7e94c00..33c09e2622 100644
--- a/drivers/bus/pci/meson.build
+++ b/drivers/bus/pci/meson.build
@@ -29,4 +29,8 @@ if is_windows
     includes += include_directories('windows')
 endif
 
+driver_sdk_headers += files(
+        'pci_driver.h',
+)
+
 deps += ['kvargs']
diff --git a/drivers/bus/pci/pci_common_uio.c b/drivers/bus/pci/pci_common_uio.c
index 318f9a1d55..00ef86c1dd 100644
--- a/drivers/bus/pci/pci_common_uio.c
+++ b/drivers/bus/pci/pci_common_uio.c
@@ -11,7 +11,6 @@
 
 #include <rte_eal.h>
 #include <rte_pci.h>
-#include <rte_bus_pci.h>
 #include <rte_tailq.h>
 #include <rte_log.h>
 #include <rte_malloc.h>
diff --git a/drivers/bus/pci/pci_driver.h b/drivers/bus/pci/pci_driver.h
new file mode 100644
index 0000000000..7a913d54c5
--- /dev/null
+++ b/drivers/bus/pci/pci_driver.h
@@ -0,0 +1,402 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2010-2015 Intel Corporation.
+ * Copyright 2013-2014 6WIND S.A.
+ */
+
+#ifndef _PCI_DRIVER_H_
+#define _PCI_DRIVER_H_
+
+/**
+ * @file
+ * PCI device & driver interface
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <limits.h>
+#include <errno.h>
+#include <sys/queue.h>
+#include <stdint.h>
+#include <inttypes.h>
+
+#include <rte_debug.h>
+#include <rte_interrupts.h>
+#include <rte_dev.h>
+#include <rte_bus.h>
+#include <rte_pci.h>
+
+/** Pathname of PCI devices directory. */
+__rte_internal
+const char *rte_pci_get_sysfs_path(void);
+
+/* Forward declarations */
+struct rte_pci_device;
+struct rte_pci_driver;
+
+/** List of PCI devices */
+TAILQ_HEAD(rte_pci_device_list, rte_pci_device);
+/** List of PCI drivers */
+TAILQ_HEAD(rte_pci_driver_list, rte_pci_driver);
+
+/* PCI Bus iterators */
+#define FOREACH_DEVICE_ON_PCIBUS(p)	\
+		TAILQ_FOREACH(p, &(rte_pci_bus.device_list), next)
+
+#define FOREACH_DRIVER_ON_PCIBUS(p)	\
+		TAILQ_FOREACH(p, &(rte_pci_bus.driver_list), next)
+
+struct rte_devargs;
+
+enum rte_pci_kernel_driver {
+	RTE_PCI_KDRV_UNKNOWN = 0,  /* may be misc UIO or bifurcated driver */
+	RTE_PCI_KDRV_IGB_UIO,      /* igb_uio for Linux */
+	RTE_PCI_KDRV_VFIO,         /* VFIO for Linux */
+	RTE_PCI_KDRV_UIO_GENERIC,  /* uio_pci_generic for Linux */
+	RTE_PCI_KDRV_NIC_UIO,      /* nic_uio for FreeBSD */
+	RTE_PCI_KDRV_NONE,         /* no attached driver */
+	RTE_PCI_KDRV_NET_UIO,      /* NetUIO for Windows */
+};
+
+/**
+ * A structure describing a PCI device.
+ */
+struct rte_pci_device {
+	TAILQ_ENTRY(rte_pci_device) next;   /**< Next probed PCI device. */
+	struct rte_device device;           /**< Inherit core device */
+	struct rte_pci_addr addr;           /**< PCI location. */
+	struct rte_pci_id id;               /**< PCI ID. */
+	struct rte_mem_resource mem_resource[PCI_MAX_RESOURCE];
+					    /**< PCI Memory Resource */
+	struct rte_intr_handle intr_handle; /**< Interrupt handle */
+	struct rte_pci_driver *driver;      /**< PCI driver used in probing */
+	uint16_t max_vfs;                   /**< sriov enable if not zero */
+	enum rte_pci_kernel_driver kdrv;    /**< Kernel driver passthrough */
+	char name[PCI_PRI_STR_SIZE+1];      /**< PCI location (ASCII) */
+	struct rte_intr_handle vfio_req_intr_handle;
+				/**< Handler of VFIO request interrupt */
+};
+
+/**
+ * @internal
+ * Helper macro for drivers that need to convert to struct rte_pci_device.
+ */
+#define RTE_DEV_TO_PCI(ptr) container_of(ptr, struct rte_pci_device, device)
+
+#define RTE_DEV_TO_PCI_CONST(ptr) \
+	container_of(ptr, const struct rte_pci_device, device)
+
+#define RTE_ETH_DEV_TO_PCI(eth_dev)	RTE_DEV_TO_PCI((eth_dev)->device)
+
+#ifdef __cplusplus
+/** C++ macro used to help building up tables of device IDs */
+#define RTE_PCI_DEVICE(vend, dev) \
+	RTE_CLASS_ANY_ID,         \
+	(vend),                   \
+	(dev),                    \
+	RTE_PCI_ANY_ID,           \
+	RTE_PCI_ANY_ID
+#else
+/** Macro used to help building up tables of device IDs */
+#define RTE_PCI_DEVICE(vend, dev)          \
+	.class_id = RTE_CLASS_ANY_ID,      \
+	.vendor_id = (vend),               \
+	.device_id = (dev),                \
+	.subsystem_vendor_id = RTE_PCI_ANY_ID, \
+	.subsystem_device_id = RTE_PCI_ANY_ID
+#endif
+
+/**
+ * Initialisation function for the driver called during PCI probing.
+ */
+typedef int (rte_pci_probe_t)(struct rte_pci_driver *, struct rte_pci_device *);
+
+/**
+ * Uninitialisation function for the driver called during hotplugging.
+ */
+typedef int (rte_pci_remove_t)(struct rte_pci_device *);
+
+/**
+ * Driver-specific DMA mapping. After a successful call the device
+ * will be able to read/write from/to this segment.
+ *
+ * @param dev
+ *   Pointer to the PCI device.
+ * @param addr
+ *   Starting virtual address of memory to be mapped.
+ * @param iova
+ *   Starting IOVA address of memory to be mapped.
+ * @param len
+ *   Length of memory segment being mapped.
+ * @return
+ *   - 0 On success.
+ *   - Negative value and rte_errno is set otherwise.
+ */
+typedef int (pci_dma_map_t)(struct rte_pci_device *dev, void *addr,
+			    uint64_t iova, size_t len);
+
+/**
+ * Driver-specific DMA un-mapping. After a successful call the device
+ * will not be able to read/write from/to this segment.
+ *
+ * @param dev
+ *   Pointer to the PCI device.
+ * @param addr
+ *   Starting virtual address of memory to be unmapped.
+ * @param iova
+ *   Starting IOVA address of memory to be unmapped.
+ * @param len
+ *   Length of memory segment being unmapped.
+ * @return
+ *   - 0 On success.
+ *   - Negative value and rte_errno is set otherwise.
+ */
+typedef int (pci_dma_unmap_t)(struct rte_pci_device *dev, void *addr,
+			      uint64_t iova, size_t len);
+
+/**
+ * A structure describing a PCI driver.
+ */
+struct rte_pci_driver {
+	TAILQ_ENTRY(rte_pci_driver) next;  /**< Next in list. */
+	struct rte_driver driver;          /**< Inherit core driver. */
+	struct rte_pci_bus *bus;           /**< PCI bus reference. */
+	rte_pci_probe_t *probe;            /**< Device probe function. */
+	rte_pci_remove_t *remove;          /**< Device remove function. */
+	pci_dma_map_t *dma_map;		   /**< device dma map function. */
+	pci_dma_unmap_t *dma_unmap;	   /**< device dma unmap function. */
+	const struct rte_pci_id *id_table; /**< ID table, NULL terminated. */
+	uint32_t drv_flags;                /**< Flags RTE_PCI_DRV_*. */
+};
+
+/**
+ * Structure describing the PCI bus
+ */
+struct rte_pci_bus {
+	struct rte_bus bus;               /**< Inherit the generic class */
+	struct rte_pci_device_list device_list;  /**< List of PCI devices */
+	struct rte_pci_driver_list driver_list;  /**< List of PCI drivers */
+};
+
+/** Device needs PCI BAR mapping (done with either IGB_UIO or VFIO) */
+#define RTE_PCI_DRV_NEED_MAPPING 0x0001
+/** Device needs PCI BAR mapping with enabled write combining (wc) */
+#define RTE_PCI_DRV_WC_ACTIVATE 0x0002
+/** Device already probed can be probed again to check for new ports. */
+#define RTE_PCI_DRV_PROBE_AGAIN 0x0004
+/** Device driver supports link state interrupt */
+#define RTE_PCI_DRV_INTR_LSC	0x0008
+/** Device driver supports device removal interrupt */
+#define RTE_PCI_DRV_INTR_RMV 0x0010
+/** Device driver needs to keep mapped resources if unsupported dev detected */
+#define RTE_PCI_DRV_KEEP_MAPPED_RES 0x0020
+/** Device driver needs IOVA as VA and cannot work with IOVA as PA */
+#define RTE_PCI_DRV_NEED_IOVA_AS_VA 0x0040
+
+/**
+ * Map the PCI device resources in user space virtual memory address
+ *
+ * Note that driver should not call this function when flag
+ * RTE_PCI_DRV_NEED_MAPPING is set, as EAL will do that for
+ * you when it's on.
+ *
+ * @param dev
+ *   A pointer to a rte_pci_device structure describing the device
+ *   to use
+ *
+ * @return
+ *   0 on success, negative on error and positive if no driver
+ *   is found for the device.
+ */
+__rte_internal
+int rte_pci_map_device(struct rte_pci_device *dev);
+
+/**
+ * Unmap this device
+ *
+ * @param dev
+ *   A pointer to a rte_pci_device structure describing the device
+ *   to use
+ */
+__rte_internal
+void rte_pci_unmap_device(struct rte_pci_device *dev);
+
+/**
+ * Find device's extended PCI capability.
+ *
+ *  @param dev
+ *    A pointer to rte_pci_device structure.
+ *
+ *  @param cap
+ *    Extended capability to be found, which can be any from
+ *    RTE_PCI_EXT_CAP_ID_*, defined in librte_pci.
+ *
+ *  @return
+ *  > 0: The offset of the next matching extended capability structure
+ *       within the device's PCI configuration space.
+ *  < 0: An error in PCI config space read.
+ *  = 0: Device does not support it.
+ */
+__rte_internal
+off_t rte_pci_find_ext_capability(struct rte_pci_device *dev, uint32_t cap);
+
+/**
+ * Enables/Disables Bus Master for device's PCI command register.
+ *
+ *  @param dev
+ *    A pointer to rte_pci_device structure.
+ *  @param enable
+ *    Enable or disable Bus Master.
+ *
+ *  @return
+ *  0 on success, -1 on error in PCI config space read/write.
+ */
+__rte_internal
+int rte_pci_set_bus_master(struct rte_pci_device *dev, bool enable);
+
+/**
+ * Register a PCI driver.
+ *
+ * @param driver
+ *   A pointer to a rte_pci_driver structure describing the driver
+ *   to be registered.
+ */
+__rte_internal
+void rte_pci_register(struct rte_pci_driver *driver);
+
+/** Helper for PCI device registration from driver (eth, crypto) instance */
+#define RTE_PMD_REGISTER_PCI(nm, pci_drv) \
+RTE_INIT(pciinitfn_ ##nm) \
+{\
+	(pci_drv).driver.name = RTE_STR(nm);\
+	rte_pci_register(&pci_drv); \
+} \
+RTE_PMD_EXPORT_NAME(nm, __COUNTER__)
+
+/**
+ * Unregister a PCI driver.
+ *
+ * @param driver
+ *   A pointer to a rte_pci_driver structure describing the driver
+ *   to be unregistered.
+ */
+__rte_internal
+void rte_pci_unregister(struct rte_pci_driver *driver);
+
+/**
+ * Read PCI config space.
+ *
+ * @param device
+ *   A pointer to a rte_pci_device structure describing the device
+ *   to use
+ * @param buf
+ *   A data buffer where the bytes should be read into
+ * @param len
+ *   The length of the data buffer.
+ * @param offset
+ *   The offset into PCI config space
+ * @return
+ *  Number of bytes read on success, negative on error.
+ */
+__rte_internal
+int rte_pci_read_config(const struct rte_pci_device *device,
+		void *buf, size_t len, off_t offset);
+
+/**
+ * Write PCI config space.
+ *
+ * @param device
+ *   A pointer to a rte_pci_device structure describing the device
+ *   to use
+ * @param buf
+ *   A data buffer containing the bytes should be written
+ * @param len
+ *   The length of the data buffer.
+ * @param offset
+ *   The offset into PCI config space
+ */
+__rte_internal
+int rte_pci_write_config(const struct rte_pci_device *device,
+		const void *buf, size_t len, off_t offset);
+
+/**
+ * A structure used to access io resources for a pci device.
+ * rte_pci_ioport is arch, os, driver specific, and should not be used outside
+ * of pci ioport api.
+ */
+struct rte_pci_ioport {
+	struct rte_pci_device *dev;
+	uint64_t base;
+	uint64_t len; /* only filled for memory mapped ports */
+};
+
+/**
+ * Initialize a rte_pci_ioport object for a pci device io resource.
+ *
+ * This object is then used to gain access to those io resources (see below).
+ *
+ * @param dev
+ *   A pointer to a rte_pci_device structure describing the device
+ *   to use.
+ * @param bar
+ *   Index of the io pci resource we want to access.
+ * @param p
+ *   The rte_pci_ioport object to be initialized.
+ * @return
+ *  0 on success, negative on error.
+ */
+__rte_internal
+int rte_pci_ioport_map(struct rte_pci_device *dev, int bar,
+		struct rte_pci_ioport *p);
+
+/**
+ * Release any resources used in a rte_pci_ioport object.
+ *
+ * @param p
+ *   The rte_pci_ioport object to be uninitialized.
+ * @return
+ *  0 on success, negative on error.
+ */
+__rte_internal
+int rte_pci_ioport_unmap(struct rte_pci_ioport *p);
+
+/**
+ * Read from a io pci resource.
+ *
+ * @param p
+ *   The rte_pci_ioport object from which we want to read.
+ * @param data
+ *   A data buffer where the bytes should be read into
+ * @param len
+ *   The length of the data buffer.
+ * @param offset
+ *   The offset into the pci io resource.
+ */
+__rte_internal
+void rte_pci_ioport_read(struct rte_pci_ioport *p,
+		void *data, size_t len, off_t offset);
+
+/**
+ * Write to a io pci resource.
+ *
+ * @param p
+ *   The rte_pci_ioport object to which we want to write.
+ * @param data
+ *   A data buffer where the bytes should be read into
+ * @param len
+ *   The length of the data buffer.
+ * @param offset
+ *   The offset into the pci io resource.
+ */
+__rte_internal
+void rte_pci_ioport_write(struct rte_pci_ioport *p,
+		const void *data, size_t len, off_t offset);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _PCI_DRIVER_H_ */
diff --git a/drivers/bus/pci/pci_params.c b/drivers/bus/pci/pci_params.c
index 691b5ea018..3f4f94cc72 100644
--- a/drivers/bus/pci/pci_params.c
+++ b/drivers/bus/pci/pci_params.c
@@ -3,7 +3,6 @@
  */
 
 #include <rte_bus.h>
-#include <rte_bus_pci.h>
 #include <rte_dev.h>
 #include <rte_errno.h>
 #include <rte_kvargs.h>
diff --git a/drivers/bus/pci/private.h b/drivers/bus/pci/private.h
index 0fbef8e1d8..dd42baf516 100644
--- a/drivers/bus/pci/private.h
+++ b/drivers/bus/pci/private.h
@@ -8,10 +8,11 @@
 #include <stdbool.h>
 #include <stdio.h>
 
-#include <rte_bus_pci.h>
 #include <rte_os_shim.h>
 #include <rte_pci.h>
 
+#include "pci_driver.h"
+
 extern struct rte_pci_bus rte_pci_bus;
 
 struct rte_pci_driver;
diff --git a/drivers/bus/pci/rte_bus_pci.h b/drivers/bus/pci/rte_bus_pci.h
index 21d9dd4289..2fb35801f8 100644
--- a/drivers/bus/pci/rte_bus_pci.h
+++ b/drivers/bus/pci/rte_bus_pci.h
@@ -1,225 +1,17 @@
 /* SPDX-License-Identifier: BSD-3-Clause
- * Copyright(c) 2010-2015 Intel Corporation.
- * Copyright 2013-2014 6WIND S.A.
+ * Copyright(c) 2021 Intel Corporation.
  */
 
 #ifndef _RTE_BUS_PCI_H_
 #define _RTE_BUS_PCI_H_
 
-/**
- * @file
- * PCI device & driver interface
- */
-
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <limits.h>
-#include <errno.h>
-#include <sys/queue.h>
 #include <stdint.h>
-#include <inttypes.h>
-
-#include <rte_debug.h>
-#include <rte_interrupts.h>
-#include <rte_dev.h>
-#include <rte_bus.h>
-#include <rte_pci.h>
-
-/** Pathname of PCI devices directory. */
-const char *rte_pci_get_sysfs_path(void);
-
-/* Forward declarations */
-struct rte_pci_device;
-struct rte_pci_driver;
-
-/** List of PCI devices */
-TAILQ_HEAD(rte_pci_device_list, rte_pci_device);
-/** List of PCI drivers */
-TAILQ_HEAD(rte_pci_driver_list, rte_pci_driver);
-
-/* PCI Bus iterators */
-#define FOREACH_DEVICE_ON_PCIBUS(p)	\
-		TAILQ_FOREACH(p, &(rte_pci_bus.device_list), next)
 
-#define FOREACH_DRIVER_ON_PCIBUS(p)	\
-		TAILQ_FOREACH(p, &(rte_pci_bus.driver_list), next)
-
-struct rte_devargs;
-
-enum rte_pci_kernel_driver {
-	RTE_PCI_KDRV_UNKNOWN = 0,  /* may be misc UIO or bifurcated driver */
-	RTE_PCI_KDRV_IGB_UIO,      /* igb_uio for Linux */
-	RTE_PCI_KDRV_VFIO,         /* VFIO for Linux */
-	RTE_PCI_KDRV_UIO_GENERIC,  /* uio_pci_generic for Linux */
-	RTE_PCI_KDRV_NIC_UIO,      /* nic_uio for FreeBSD */
-	RTE_PCI_KDRV_NONE,         /* no attached driver */
-	RTE_PCI_KDRV_NET_UIO,      /* NetUIO for Windows */
-};
-
-/**
- * A structure describing a PCI device.
- */
-struct rte_pci_device {
-	TAILQ_ENTRY(rte_pci_device) next;   /**< Next probed PCI device. */
-	struct rte_device device;           /**< Inherit core device */
-	struct rte_pci_addr addr;           /**< PCI location. */
-	struct rte_pci_id id;               /**< PCI ID. */
-	struct rte_mem_resource mem_resource[PCI_MAX_RESOURCE];
-					    /**< PCI Memory Resource */
-	struct rte_intr_handle intr_handle; /**< Interrupt handle */
-	struct rte_pci_driver *driver;      /**< PCI driver used in probing */
-	uint16_t max_vfs;                   /**< sriov enable if not zero */
-	enum rte_pci_kernel_driver kdrv;    /**< Kernel driver passthrough */
-	char name[PCI_PRI_STR_SIZE+1];      /**< PCI location (ASCII) */
-	struct rte_intr_handle vfio_req_intr_handle;
-				/**< Handler of VFIO request interrupt */
-};
-
-/**
- * @internal
- * Helper macro for drivers that need to convert to struct rte_pci_device.
- */
-#define RTE_DEV_TO_PCI(ptr) container_of(ptr, struct rte_pci_device, device)
-
-#define RTE_DEV_TO_PCI_CONST(ptr) \
-	container_of(ptr, const struct rte_pci_device, device)
-
-#define RTE_ETH_DEV_TO_PCI(eth_dev)	RTE_DEV_TO_PCI((eth_dev)->device)
-
-#ifdef __cplusplus
-/** C++ macro used to help building up tables of device IDs */
-#define RTE_PCI_DEVICE(vend, dev) \
-	RTE_CLASS_ANY_ID,         \
-	(vend),                   \
-	(dev),                    \
-	RTE_PCI_ANY_ID,           \
-	RTE_PCI_ANY_ID
-#else
-/** Macro used to help building up tables of device IDs */
-#define RTE_PCI_DEVICE(vend, dev)          \
-	.class_id = RTE_CLASS_ANY_ID,      \
-	.vendor_id = (vend),               \
-	.device_id = (dev),                \
-	.subsystem_vendor_id = RTE_PCI_ANY_ID, \
-	.subsystem_device_id = RTE_PCI_ANY_ID
-#endif
-
-/**
- * Initialisation function for the driver called during PCI probing.
- */
-typedef int (rte_pci_probe_t)(struct rte_pci_driver *, struct rte_pci_device *);
-
-/**
- * Uninitialisation function for the driver called during hotplugging.
- */
-typedef int (rte_pci_remove_t)(struct rte_pci_device *);
-
-/**
- * Driver-specific DMA mapping. After a successful call the device
- * will be able to read/write from/to this segment.
- *
- * @param dev
- *   Pointer to the PCI device.
- * @param addr
- *   Starting virtual address of memory to be mapped.
- * @param iova
- *   Starting IOVA address of memory to be mapped.
- * @param len
- *   Length of memory segment being mapped.
- * @return
- *   - 0 On success.
- *   - Negative value and rte_errno is set otherwise.
- */
-typedef int (pci_dma_map_t)(struct rte_pci_device *dev, void *addr,
-			    uint64_t iova, size_t len);
-
-/**
- * Driver-specific DMA un-mapping. After a successful call the device
- * will not be able to read/write from/to this segment.
- *
- * @param dev
- *   Pointer to the PCI device.
- * @param addr
- *   Starting virtual address of memory to be unmapped.
- * @param iova
- *   Starting IOVA address of memory to be unmapped.
- * @param len
- *   Length of memory segment being unmapped.
- * @return
- *   - 0 On success.
- *   - Negative value and rte_errno is set otherwise.
- */
-typedef int (pci_dma_unmap_t)(struct rte_pci_device *dev, void *addr,
-			      uint64_t iova, size_t len);
-
-/**
- * A structure describing a PCI driver.
- */
-struct rte_pci_driver {
-	TAILQ_ENTRY(rte_pci_driver) next;  /**< Next in list. */
-	struct rte_driver driver;          /**< Inherit core driver. */
-	struct rte_pci_bus *bus;           /**< PCI bus reference. */
-	rte_pci_probe_t *probe;            /**< Device probe function. */
-	rte_pci_remove_t *remove;          /**< Device remove function. */
-	pci_dma_map_t *dma_map;		   /**< device dma map function. */
-	pci_dma_unmap_t *dma_unmap;	   /**< device dma unmap function. */
-	const struct rte_pci_id *id_table; /**< ID table, NULL terminated. */
-	uint32_t drv_flags;                /**< Flags RTE_PCI_DRV_*. */
-};
-
-/**
- * Structure describing the PCI bus
- */
-struct rte_pci_bus {
-	struct rte_bus bus;               /**< Inherit the generic class */
-	struct rte_pci_device_list device_list;  /**< List of PCI devices */
-	struct rte_pci_driver_list driver_list;  /**< List of PCI drivers */
-};
-
-/** Device needs PCI BAR mapping (done with either IGB_UIO or VFIO) */
-#define RTE_PCI_DRV_NEED_MAPPING 0x0001
-/** Device needs PCI BAR mapping with enabled write combining (wc) */
-#define RTE_PCI_DRV_WC_ACTIVATE 0x0002
-/** Device already probed can be probed again to check for new ports. */
-#define RTE_PCI_DRV_PROBE_AGAIN 0x0004
-/** Device driver supports link state interrupt */
-#define RTE_PCI_DRV_INTR_LSC	0x0008
-/** Device driver supports device removal interrupt */
-#define RTE_PCI_DRV_INTR_RMV 0x0010
-/** Device driver needs to keep mapped resources if unsupported dev detected */
-#define RTE_PCI_DRV_KEEP_MAPPED_RES 0x0020
-/** Device driver needs IOVA as VA and cannot work with IOVA as PA */
-#define RTE_PCI_DRV_NEED_IOVA_AS_VA 0x0040
-
-/**
- * Map the PCI device resources in user space virtual memory address
- *
- * Note that driver should not call this function when flag
- * RTE_PCI_DRV_NEED_MAPPING is set, as EAL will do that for
- * you when it's on.
- *
- * @param dev
- *   A pointer to a rte_pci_device structure describing the device
- *   to use
- *
- * @return
- *   0 on success, negative on error and positive if no driver
- *   is found for the device.
- */
-int rte_pci_map_device(struct rte_pci_device *dev);
-
-/**
- * Unmap this device
- *
- * @param dev
- *   A pointer to a rte_pci_device structure describing the device
- *   to use
- */
-void rte_pci_unmap_device(struct rte_pci_device *dev);
+#include <rte_compat.h>
 
 /**
  * Dump the content of the PCI bus.
@@ -229,169 +21,6 @@ void rte_pci_unmap_device(struct rte_pci_device *dev);
  */
 void rte_pci_dump(FILE *f);
 
-/**
- * Find device's extended PCI capability.
- *
- *  @param dev
- *    A pointer to rte_pci_device structure.
- *
- *  @param cap
- *    Extended capability to be found, which can be any from
- *    RTE_PCI_EXT_CAP_ID_*, defined in librte_pci.
- *
- *  @return
- *  > 0: The offset of the next matching extended capability structure
- *       within the device's PCI configuration space.
- *  < 0: An error in PCI config space read.
- *  = 0: Device does not support it.
- */
-__rte_experimental
-off_t rte_pci_find_ext_capability(struct rte_pci_device *dev, uint32_t cap);
-
-/**
- * Enables/Disables Bus Master for device's PCI command register.
- *
- *  @param dev
- *    A pointer to rte_pci_device structure.
- *  @param enable
- *    Enable or disable Bus Master.
- *
- *  @return
- *  0 on success, -1 on error in PCI config space read/write.
- */
-__rte_experimental
-int rte_pci_set_bus_master(struct rte_pci_device *dev, bool enable);
-
-/**
- * Register a PCI driver.
- *
- * @param driver
- *   A pointer to a rte_pci_driver structure describing the driver
- *   to be registered.
- */
-void rte_pci_register(struct rte_pci_driver *driver);
-
-/** Helper for PCI device registration from driver (eth, crypto) instance */
-#define RTE_PMD_REGISTER_PCI(nm, pci_drv) \
-RTE_INIT(pciinitfn_ ##nm) \
-{\
-	(pci_drv).driver.name = RTE_STR(nm);\
-	rte_pci_register(&pci_drv); \
-} \
-RTE_PMD_EXPORT_NAME(nm, __COUNTER__)
-
-/**
- * Unregister a PCI driver.
- *
- * @param driver
- *   A pointer to a rte_pci_driver structure describing the driver
- *   to be unregistered.
- */
-void rte_pci_unregister(struct rte_pci_driver *driver);
-
-/**
- * Read PCI config space.
- *
- * @param device
- *   A pointer to a rte_pci_device structure describing the device
- *   to use
- * @param buf
- *   A data buffer where the bytes should be read into
- * @param len
- *   The length of the data buffer.
- * @param offset
- *   The offset into PCI config space
- * @return
- *  Number of bytes read on success, negative on error.
- */
-int rte_pci_read_config(const struct rte_pci_device *device,
-		void *buf, size_t len, off_t offset);
-
-/**
- * Write PCI config space.
- *
- * @param device
- *   A pointer to a rte_pci_device structure describing the device
- *   to use
- * @param buf
- *   A data buffer containing the bytes should be written
- * @param len
- *   The length of the data buffer.
- * @param offset
- *   The offset into PCI config space
- */
-int rte_pci_write_config(const struct rte_pci_device *device,
-		const void *buf, size_t len, off_t offset);
-
-/**
- * A structure used to access io resources for a pci device.
- * rte_pci_ioport is arch, os, driver specific, and should not be used outside
- * of pci ioport api.
- */
-struct rte_pci_ioport {
-	struct rte_pci_device *dev;
-	uint64_t base;
-	uint64_t len; /* only filled for memory mapped ports */
-};
-
-/**
- * Initialize a rte_pci_ioport object for a pci device io resource.
- *
- * This object is then used to gain access to those io resources (see below).
- *
- * @param dev
- *   A pointer to a rte_pci_device structure describing the device
- *   to use.
- * @param bar
- *   Index of the io pci resource we want to access.
- * @param p
- *   The rte_pci_ioport object to be initialized.
- * @return
- *  0 on success, negative on error.
- */
-int rte_pci_ioport_map(struct rte_pci_device *dev, int bar,
-		struct rte_pci_ioport *p);
-
-/**
- * Release any resources used in a rte_pci_ioport object.
- *
- * @param p
- *   The rte_pci_ioport object to be uninitialized.
- * @return
- *  0 on success, negative on error.
- */
-int rte_pci_ioport_unmap(struct rte_pci_ioport *p);
-
-/**
- * Read from a io pci resource.
- *
- * @param p
- *   The rte_pci_ioport object from which we want to read.
- * @param data
- *   A data buffer where the bytes should be read into
- * @param len
- *   The length of the data buffer.
- * @param offset
- *   The offset into the pci io resource.
- */
-void rte_pci_ioport_read(struct rte_pci_ioport *p,
-		void *data, size_t len, off_t offset);
-
-/**
- * Write to a io pci resource.
- *
- * @param p
- *   The rte_pci_ioport object to which we want to write.
- * @param data
- *   A data buffer where the bytes should be read into
- * @param len
- *   The length of the data buffer.
- * @param offset
- *   The offset into the pci io resource.
- */
-void rte_pci_ioport_write(struct rte_pci_ioport *p,
-		const void *data, size_t len, off_t offset);
-
 /**
  * Read 4 bytes from PCI memory resource.
  *
diff --git a/drivers/bus/pci/version.map b/drivers/bus/pci/version.map
index 01ec836559..73cf881778 100644
--- a/drivers/bus/pci/version.map
+++ b/drivers/bus/pci/version.map
@@ -2,6 +2,22 @@ DPDK_22 {
 	global:
 
 	rte_pci_dump;
+
+	local: *;
+};
+
+EXPERIMENTAL {
+	global:
+
+	# added in 21.11
+	rte_pci_mem_rd32;
+	rte_pci_mem_wr32;
+};
+
+INTERNAL {
+	global:
+
+	rte_pci_find_ext_capability;
 	rte_pci_get_sysfs_path;
 	rte_pci_ioport_map;
 	rte_pci_ioport_read;
@@ -10,22 +26,8 @@ DPDK_22 {
 	rte_pci_map_device;
 	rte_pci_read_config;
 	rte_pci_register;
+	rte_pci_set_bus_master;
 	rte_pci_unmap_device;
 	rte_pci_unregister;
 	rte_pci_write_config;
-
-	local: *;
-};
-
-EXPERIMENTAL {
-	global:
-
-	rte_pci_find_ext_capability;
-
-	# added in 21.08
-	rte_pci_set_bus_master;
-
-	# added in 21.11
-	rte_pci_mem_rd32;
-	rte_pci_mem_wr32;
 };
diff --git a/drivers/common/cnxk/roc_platform.h b/drivers/common/cnxk/roc_platform.h
index 285b24b82d..fa8a6ef0af 100644
--- a/drivers/common/cnxk/roc_platform.h
+++ b/drivers/common/cnxk/roc_platform.h
@@ -7,7 +7,7 @@
 
 #include <rte_alarm.h>
 #include <rte_bitmap.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_byteorder.h>
 #include <rte_common.h>
 #include <rte_cycles.h>
diff --git a/drivers/common/mlx5/linux/mlx5_common_verbs.c b/drivers/common/mlx5/linux/mlx5_common_verbs.c
index 9080bd3e87..65d795643b 100644
--- a/drivers/common/mlx5/linux/mlx5_common_verbs.c
+++ b/drivers/common/mlx5/linux/mlx5_common_verbs.c
@@ -11,7 +11,7 @@
 #include <inttypes.h>
 
 #include <rte_errno.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_bus_auxiliary.h>
 
 #include "mlx5_common_utils.h"
diff --git a/drivers/common/mlx5/mlx5_common_pci.c b/drivers/common/mlx5/mlx5_common_pci.c
index 8b38091d87..eaa9a0fff5 100644
--- a/drivers/common/mlx5/mlx5_common_pci.c
+++ b/drivers/common/mlx5/mlx5_common_pci.c
@@ -9,7 +9,7 @@
 #include <rte_errno.h>
 #include <rte_class.h>
 #include <rte_pci.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 
 #include "mlx5_common_log.h"
 #include "mlx5_common_private.h"
diff --git a/drivers/common/octeontx2/otx2_dev.h b/drivers/common/octeontx2/otx2_dev.h
index d5b2b0d9af..1f36f24cb0 100644
--- a/drivers/common/octeontx2/otx2_dev.h
+++ b/drivers/common/octeontx2/otx2_dev.h
@@ -5,7 +5,7 @@
 #ifndef _OTX2_DEV_H
 #define _OTX2_DEV_H
 
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 
 #include "otx2_common.h"
 #include "otx2_irq.h"
diff --git a/drivers/common/octeontx2/otx2_sec_idev.c b/drivers/common/octeontx2/otx2_sec_idev.c
index 6e9643c383..a73c27c970 100644
--- a/drivers/common/octeontx2/otx2_sec_idev.c
+++ b/drivers/common/octeontx2/otx2_sec_idev.c
@@ -3,7 +3,7 @@
  */
 
 #include <rte_atomic.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_ethdev.h>
 #include <rte_spinlock.h>
 
diff --git a/drivers/common/qat/qat_device.h b/drivers/common/qat/qat_device.h
index 228c057d1e..8d18365bae 100644
--- a/drivers/common/qat/qat_device.h
+++ b/drivers/common/qat/qat_device.h
@@ -4,7 +4,7 @@
 #ifndef _QAT_DEVICE_H_
 #define _QAT_DEVICE_H_
 
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 
 #include "qat_common.h"
 #include "qat_logs.h"
diff --git a/drivers/common/qat/qat_qp.c b/drivers/common/qat/qat_qp.c
index 026ea5ee01..a964231d2c 100644
--- a/drivers/common/qat/qat_qp.c
+++ b/drivers/common/qat/qat_qp.c
@@ -8,7 +8,7 @@
 #include <rte_malloc.h>
 #include <rte_memzone.h>
 #include <rte_pci.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_atomic.h>
 #include <rte_prefetch.h>
 
diff --git a/drivers/common/sfc_efx/sfc_efx.h b/drivers/common/sfc_efx/sfc_efx.h
index c16eca60f3..9829ed0e96 100644
--- a/drivers/common/sfc_efx/sfc_efx.h
+++ b/drivers/common/sfc_efx/sfc_efx.h
@@ -10,7 +10,7 @@
 #ifndef _SFC_EFX_H_
 #define _SFC_EFX_H_
 
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 
 #include "efx.h"
 #include "efsys.h"
diff --git a/drivers/compress/mlx5/mlx5_compress.c b/drivers/compress/mlx5/mlx5_compress.c
index 883e720ec1..e8112935c3 100644
--- a/drivers/compress/mlx5/mlx5_compress.c
+++ b/drivers/compress/mlx5/mlx5_compress.c
@@ -5,7 +5,7 @@
 #include <rte_malloc.h>
 #include <rte_log.h>
 #include <rte_errno.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_spinlock.h>
 #include <rte_comp.h>
 #include <rte_compressdev.h>
diff --git a/drivers/compress/octeontx/otx_zip.h b/drivers/compress/octeontx/otx_zip.h
index e43f7f5c3e..56136ce734 100644
--- a/drivers/compress/octeontx/otx_zip.h
+++ b/drivers/compress/octeontx/otx_zip.h
@@ -7,7 +7,7 @@
 
 #include <unistd.h>
 
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_comp.h>
 #include <rte_compressdev.h>
 #include <rte_compressdev_pmd.h>
diff --git a/drivers/compress/qat/qat_comp.c b/drivers/compress/qat/qat_comp.c
index 7ac25a3b4c..6fa82ad9a8 100644
--- a/drivers/compress/qat/qat_comp.c
+++ b/drivers/compress/qat/qat_comp.c
@@ -6,7 +6,7 @@
 #include <rte_mbuf.h>
 #include <rte_hexdump.h>
 #include <rte_comp.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_byteorder.h>
 #include <rte_memcpy.h>
 #include <rte_common.h>
diff --git a/drivers/crypto/ccp/ccp_dev.h b/drivers/crypto/ccp/ccp_dev.h
index ca5145c278..eb8cd94716 100644
--- a/drivers/crypto/ccp/ccp_dev.h
+++ b/drivers/crypto/ccp/ccp_dev.h
@@ -10,7 +10,7 @@
 #include <stdint.h>
 #include <string.h>
 
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_atomic.h>
 #include <rte_byteorder.h>
 #include <rte_io.h>
diff --git a/drivers/crypto/ccp/ccp_pci.h b/drivers/crypto/ccp/ccp_pci.h
index 7ed3bac406..c8ba9f8789 100644
--- a/drivers/crypto/ccp/ccp_pci.h
+++ b/drivers/crypto/ccp/ccp_pci.h
@@ -7,7 +7,7 @@
 
 #include <stdint.h>
 
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 
 #define SYSFS_PCI_DEVICES "/sys/bus/pci/devices"
 #define PROC_MODULES "/proc/modules"
diff --git a/drivers/crypto/ccp/rte_ccp_pmd.c b/drivers/crypto/ccp/rte_ccp_pmd.c
index ab9416942e..8f5351511e 100644
--- a/drivers/crypto/ccp/rte_ccp_pmd.c
+++ b/drivers/crypto/ccp/rte_ccp_pmd.c
@@ -3,7 +3,7 @@
  */
 
 #include <rte_string_fns.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_bus_vdev.h>
 #include <rte_common.h>
 #include <rte_cryptodev.h>
diff --git a/drivers/crypto/cnxk/cn10k_cryptodev.c b/drivers/crypto/cnxk/cn10k_cryptodev.c
index db7b5aa7c6..ed96f98e51 100644
--- a/drivers/crypto/cnxk/cn10k_cryptodev.c
+++ b/drivers/crypto/cnxk/cn10k_cryptodev.c
@@ -2,7 +2,7 @@
  * Copyright(C) 2021 Marvell.
  */
 
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_common.h>
 #include <rte_crypto.h>
 #include <rte_cryptodev.h>
diff --git a/drivers/crypto/cnxk/cn9k_cryptodev.c b/drivers/crypto/cnxk/cn9k_cryptodev.c
index 9ff2383d98..017febefa9 100644
--- a/drivers/crypto/cnxk/cn9k_cryptodev.c
+++ b/drivers/crypto/cnxk/cn9k_cryptodev.c
@@ -2,7 +2,7 @@
  * Copyright(C) 2021 Marvell.
  */
 
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_common.h>
 #include <rte_crypto.h>
 #include <rte_cryptodev.h>
diff --git a/drivers/crypto/mlx5/mlx5_crypto.c b/drivers/crypto/mlx5/mlx5_crypto.c
index b3d5200ca3..6518ed0c19 100644
--- a/drivers/crypto/mlx5/mlx5_crypto.c
+++ b/drivers/crypto/mlx5/mlx5_crypto.c
@@ -6,7 +6,7 @@
 #include <rte_mempool.h>
 #include <rte_errno.h>
 #include <rte_log.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_memory.h>
 
 #include <mlx5_glue.h>
diff --git a/drivers/crypto/nitrox/nitrox_device.h b/drivers/crypto/nitrox/nitrox_device.h
index 6b8095f42b..91b15d9913 100644
--- a/drivers/crypto/nitrox/nitrox_device.h
+++ b/drivers/crypto/nitrox/nitrox_device.h
@@ -5,7 +5,7 @@
 #ifndef _NITROX_DEVICE_H_
 #define _NITROX_DEVICE_H_
 
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_cryptodev.h>
 
 struct nitrox_sym_device;
diff --git a/drivers/crypto/octeontx/otx_cryptodev.c b/drivers/crypto/octeontx/otx_cryptodev.c
index 3822c0d779..0b86757fc1 100644
--- a/drivers/crypto/octeontx/otx_cryptodev.c
+++ b/drivers/crypto/octeontx/otx_cryptodev.c
@@ -2,7 +2,7 @@
  * Copyright(c) 2018 Cavium, Inc
  */
 
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_common.h>
 #include <rte_cryptodev.h>
 #include <rte_cryptodev_pmd.h>
diff --git a/drivers/crypto/octeontx/otx_cryptodev_ops.c b/drivers/crypto/octeontx/otx_cryptodev_ops.c
index eac6796cfb..212388da96 100644
--- a/drivers/crypto/octeontx/otx_cryptodev_ops.c
+++ b/drivers/crypto/octeontx/otx_cryptodev_ops.c
@@ -3,7 +3,7 @@
  */
 
 #include <rte_alarm.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_cryptodev.h>
 #include <rte_cryptodev_pmd.h>
 #include <rte_eventdev.h>
diff --git a/drivers/crypto/octeontx2/otx2_cryptodev.c b/drivers/crypto/octeontx2/otx2_cryptodev.c
index 75fb4f9a3b..d0451e25b4 100644
--- a/drivers/crypto/octeontx2/otx2_cryptodev.c
+++ b/drivers/crypto/octeontx2/otx2_cryptodev.c
@@ -2,7 +2,7 @@
  * Copyright (C) 2019 Marvell International Ltd.
  */
 
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_common.h>
 #include <rte_crypto.h>
 #include <rte_cryptodev.h>
diff --git a/drivers/crypto/qat/qat_sym.c b/drivers/crypto/qat/qat_sym.c
index 93b257522b..574e3d577d 100644
--- a/drivers/crypto/qat/qat_sym.c
+++ b/drivers/crypto/qat/qat_sym.c
@@ -7,7 +7,7 @@
 #include <rte_mempool.h>
 #include <rte_mbuf.h>
 #include <rte_crypto_sym.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_byteorder.h>
 
 #include "qat_sym.h"
diff --git a/drivers/crypto/qat/qat_sym_pmd.c b/drivers/crypto/qat/qat_sym_pmd.c
index 6868e5f001..76c58346d1 100644
--- a/drivers/crypto/qat/qat_sym_pmd.c
+++ b/drivers/crypto/qat/qat_sym_pmd.c
@@ -2,7 +2,7 @@
  * Copyright(c) 2015-2018 Intel Corporation
  */
 
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_common.h>
 #include <rte_dev.h>
 #include <rte_malloc.h>
diff --git a/drivers/crypto/virtio/virtio_cryptodev.c b/drivers/crypto/virtio/virtio_cryptodev.c
index 4bae74a487..706fa59629 100644
--- a/drivers/crypto/virtio/virtio_cryptodev.c
+++ b/drivers/crypto/virtio/virtio_cryptodev.c
@@ -7,7 +7,7 @@
 #include <rte_common.h>
 #include <rte_errno.h>
 #include <rte_pci.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_cryptodev.h>
 #include <rte_cryptodev_pmd.h>
 #include <rte_eal.h>
diff --git a/drivers/crypto/virtio/virtio_pci.h b/drivers/crypto/virtio/virtio_pci.h
index 0a7ea1bb64..889c263555 100644
--- a/drivers/crypto/virtio/virtio_pci.h
+++ b/drivers/crypto/virtio/virtio_pci.h
@@ -9,7 +9,7 @@
 
 #include <rte_eal_paging.h>
 #include <rte_pci.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_cryptodev.h>
 
 #include "virtio_crypto.h"
diff --git a/drivers/event/dlb2/pf/dlb2_main.h b/drivers/event/dlb2/pf/dlb2_main.h
index 9eeda482a3..40178e0dda 100644
--- a/drivers/event/dlb2/pf/dlb2_main.h
+++ b/drivers/event/dlb2/pf/dlb2_main.h
@@ -9,7 +9,7 @@
 #include <rte_log.h>
 #include <rte_spinlock.h>
 #include <rte_pci.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_eal_paging.h>
 
 #include "base/dlb2_hw_types.h"
diff --git a/drivers/event/dlb2/pf/dlb2_pf.c b/drivers/event/dlb2/pf/dlb2_pf.c
index e9da89d650..8f8c742286 100644
--- a/drivers/event/dlb2/pf/dlb2_pf.c
+++ b/drivers/event/dlb2/pf/dlb2_pf.c
@@ -25,7 +25,7 @@
 #include <rte_cycles.h>
 #include <rte_io.h>
 #include <rte_pci.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_eventdev.h>
 #include <eventdev_pmd.h>
 #include <eventdev_pmd_pci.h>
diff --git a/drivers/event/octeontx/ssovf_probe.c b/drivers/event/octeontx/ssovf_probe.c
index 4da7d1ae45..f45f005e33 100644
--- a/drivers/event/octeontx/ssovf_probe.c
+++ b/drivers/event/octeontx/ssovf_probe.c
@@ -7,7 +7,7 @@
 #include <rte_eal.h>
 #include <rte_io.h>
 #include <rte_pci.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 
 #include "octeontx_mbox.h"
 #include "ssovf_evdev.h"
diff --git a/drivers/event/octeontx/timvf_probe.c b/drivers/event/octeontx/timvf_probe.c
index 59bba31e8e..5a75494b12 100644
--- a/drivers/event/octeontx/timvf_probe.c
+++ b/drivers/event/octeontx/timvf_probe.c
@@ -5,7 +5,7 @@
 #include <rte_eal.h>
 #include <rte_io.h>
 #include <rte_pci.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 
 #include <octeontx_mbox.h>
 
diff --git a/drivers/event/octeontx2/otx2_evdev.c b/drivers/event/octeontx2/otx2_evdev.c
index 38a6b651d9..5db1880455 100644
--- a/drivers/event/octeontx2/otx2_evdev.c
+++ b/drivers/event/octeontx2/otx2_evdev.c
@@ -4,7 +4,7 @@
 
 #include <inttypes.h>
 
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_common.h>
 #include <rte_eal.h>
 #include <eventdev_pmd_pci.h>
diff --git a/drivers/mempool/cnxk/cnxk_mempool.c b/drivers/mempool/cnxk/cnxk_mempool.c
index dd4d74ca05..175bad355f 100644
--- a/drivers/mempool/cnxk/cnxk_mempool.c
+++ b/drivers/mempool/cnxk/cnxk_mempool.c
@@ -3,7 +3,7 @@
  */
 
 #include <rte_atomic.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_common.h>
 #include <rte_devargs.h>
 #include <rte_eal.h>
diff --git a/drivers/mempool/octeontx/octeontx_fpavf.c b/drivers/mempool/octeontx/octeontx_fpavf.c
index 94dc5cd815..a7a09f7872 100644
--- a/drivers/mempool/octeontx/octeontx_fpavf.c
+++ b/drivers/mempool/octeontx/octeontx_fpavf.c
@@ -13,7 +13,7 @@
 
 #include <rte_atomic.h>
 #include <rte_eal.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_errno.h>
 #include <rte_memory.h>
 #include <rte_malloc.h>
diff --git a/drivers/mempool/octeontx2/otx2_mempool.c b/drivers/mempool/octeontx2/otx2_mempool.c
index fb630fecf8..6c3969fcfb 100644
--- a/drivers/mempool/octeontx2/otx2_mempool.c
+++ b/drivers/mempool/octeontx2/otx2_mempool.c
@@ -3,7 +3,7 @@
  */
 
 #include <rte_atomic.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_common.h>
 #include <rte_eal.h>
 #include <rte_io.h>
diff --git a/drivers/mempool/octeontx2/otx2_mempool.h b/drivers/mempool/octeontx2/otx2_mempool.h
index 8aa548248d..b2ed9a56e8 100644
--- a/drivers/mempool/octeontx2/otx2_mempool.h
+++ b/drivers/mempool/octeontx2/otx2_mempool.h
@@ -6,7 +6,7 @@
 #define __OTX2_MEMPOOL_H__
 
 #include <rte_bitmap.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_devargs.h>
 #include <rte_mempool.h>
 
diff --git a/drivers/mempool/octeontx2/otx2_mempool_irq.c b/drivers/mempool/octeontx2/otx2_mempool_irq.c
index 5fa22b9612..c7c9b0d35d 100644
--- a/drivers/mempool/octeontx2/otx2_mempool_irq.c
+++ b/drivers/mempool/octeontx2/otx2_mempool_irq.c
@@ -5,7 +5,7 @@
 #include <inttypes.h>
 
 #include <rte_common.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 
 #include "otx2_common.h"
 #include "otx2_irq.h"
diff --git a/drivers/meson.build b/drivers/meson.build
index d9e331ec85..44fe109892 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -85,6 +85,7 @@ foreach subpath:subdirs
         name = drv
         sources = []
         headers = []
+        driver_sdk_headers = [] # public headers included by drivers
         objs = []
         cflags = default_cflags
         includes = [include_directories(drv_path)]
@@ -150,6 +151,9 @@ foreach subpath:subdirs
         dpdk_extra_ldflags += pkgconfig_extra_libs
 
         install_headers(headers)
+        if get_option('enable_driver_sdk')
+            install_headers(driver_sdk_headers)
+        endif
 
         # generate pmdinfo sources by building a temporary
         # lib and then running pmdinfogen on the contents of
diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c
index 377299b14c..4c564ce21e 100644
--- a/drivers/net/ark/ark_ethdev.c
+++ b/drivers/net/ark/ark_ethdev.c
@@ -6,7 +6,7 @@
 #include <sys/stat.h>
 #include <dlfcn.h>
 
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <ethdev_pci.h>
 #include <rte_kvargs.h>
 
diff --git a/drivers/net/avp/avp_ethdev.c b/drivers/net/avp/avp_ethdev.c
index 623fa5e5ff..87e29519e6 100644
--- a/drivers/net/avp/avp_ethdev.c
+++ b/drivers/net/avp/avp_ethdev.c
@@ -16,7 +16,7 @@
 #include <rte_atomic.h>
 #include <rte_branch_prediction.h>
 #include <rte_pci.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_ether.h>
 #include <rte_common.h>
 #include <rte_cycles.h>
diff --git a/drivers/net/bnx2x/bnx2x.h b/drivers/net/bnx2x/bnx2x.h
index 80d19cbfd6..425acaa5ac 100644
--- a/drivers/net/bnx2x/bnx2x.h
+++ b/drivers/net/bnx2x/bnx2x.h
@@ -16,7 +16,7 @@
 
 #include <rte_byteorder.h>
 #include <rte_spinlock.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_io.h>
 
 #include "bnx2x_osal.h"
diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h
index 494a1eff37..6a456e20e2 100644
--- a/drivers/net/bnxt/bnxt.h
+++ b/drivers/net/bnxt/bnxt.h
@@ -11,7 +11,7 @@
 #include <sys/queue.h>
 
 #include <rte_pci.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <ethdev_driver.h>
 #include <rte_memory.h>
 #include <rte_lcore.h>
diff --git a/drivers/net/bonding/rte_eth_bond_args.c b/drivers/net/bonding/rte_eth_bond_args.c
index 5406e1c934..24ff649ca7 100644
--- a/drivers/net/bonding/rte_eth_bond_args.c
+++ b/drivers/net/bonding/rte_eth_bond_args.c
@@ -4,7 +4,7 @@
 
 #include <rte_devargs.h>
 #include <rte_pci.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_kvargs.h>
 
 #include "rte_eth_bond.h"
diff --git a/drivers/net/cxgbe/base/adapter.h b/drivers/net/cxgbe/base/adapter.h
index 01a2a9d147..80809d7cd6 100644
--- a/drivers/net/cxgbe/base/adapter.h
+++ b/drivers/net/cxgbe/base/adapter.h
@@ -8,7 +8,7 @@
 #ifndef __T4_ADAPTER_H__
 #define __T4_ADAPTER_H__
 
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_mbuf.h>
 #include <rte_io.h>
 #include <rte_rwlock.h>
diff --git a/drivers/net/cxgbe/cxgbe_ethdev.c b/drivers/net/cxgbe/cxgbe_ethdev.c
index 177eca3976..fb03d69d66 100644
--- a/drivers/net/cxgbe/cxgbe_ethdev.c
+++ b/drivers/net/cxgbe/cxgbe_ethdev.c
@@ -20,7 +20,7 @@
 #include <rte_log.h>
 #include <rte_debug.h>
 #include <rte_pci.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_branch_prediction.h>
 #include <rte_memory.h>
 #include <rte_tailq.h>
diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c
index a0ca371b02..657de61aa4 100644
--- a/drivers/net/e1000/em_ethdev.c
+++ b/drivers/net/e1000/em_ethdev.c
@@ -13,7 +13,7 @@
 #include <rte_byteorder.h>
 #include <rte_debug.h>
 #include <rte_pci.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_ether.h>
 #include <ethdev_driver.h>
 #include <ethdev_pci.h>
diff --git a/drivers/net/e1000/em_rxtx.c b/drivers/net/e1000/em_rxtx.c
index dfd8f2fd00..c75be0d1e5 100644
--- a/drivers/net/e1000/em_rxtx.c
+++ b/drivers/net/e1000/em_rxtx.c
@@ -18,7 +18,7 @@
 #include <rte_log.h>
 #include <rte_debug.h>
 #include <rte_pci.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_memory.h>
 #include <rte_memcpy.h>
 #include <rte_memzone.h>
diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c
index 10ee0f3341..94181da21a 100644
--- a/drivers/net/e1000/igb_ethdev.c
+++ b/drivers/net/e1000/igb_ethdev.c
@@ -15,7 +15,7 @@
 #include <rte_log.h>
 #include <rte_debug.h>
 #include <rte_pci.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_ether.h>
 #include <ethdev_driver.h>
 #include <ethdev_pci.h>
diff --git a/drivers/net/e1000/igb_pf.c b/drivers/net/e1000/igb_pf.c
index 2ce74dd5a9..294fb75dc3 100644
--- a/drivers/net/e1000/igb_pf.c
+++ b/drivers/net/e1000/igb_pf.c
@@ -10,7 +10,7 @@
 #include <stdarg.h>
 #include <inttypes.h>
 
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_interrupts.h>
 #include <rte_log.h>
 #include <rte_debug.h>
diff --git a/drivers/net/ena/ena_ethdev.h b/drivers/net/ena/ena_ethdev.h
index 06ac8b06b5..a3d76383e0 100644
--- a/drivers/net/ena/ena_ethdev.h
+++ b/drivers/net/ena/ena_ethdev.h
@@ -12,7 +12,7 @@
 #include <ethdev_pci.h>
 #include <rte_cycles.h>
 #include <rte_pci.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_timer.h>
 #include <rte_dev.h>
 #include <rte_net.h>
diff --git a/drivers/net/enic/base/vnic_dev.h b/drivers/net/enic/base/vnic_dev.h
index 4b9f75b65f..db9b2af3cd 100644
--- a/drivers/net/enic/base/vnic_dev.h
+++ b/drivers/net/enic/base/vnic_dev.h
@@ -9,7 +9,7 @@
 #include <stdbool.h>
 
 #include <rte_pci.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 
 #include "enic_compat.h"
 #include "vnic_resource.h"
diff --git a/drivers/net/enic/enic_ethdev.c b/drivers/net/enic/enic_ethdev.c
index 8d5797523b..1202fcd4f9 100644
--- a/drivers/net/enic/enic_ethdev.c
+++ b/drivers/net/enic/enic_ethdev.c
@@ -8,7 +8,7 @@
 
 #include <rte_dev.h>
 #include <rte_pci.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <ethdev_driver.h>
 #include <ethdev_pci.h>
 #include <rte_geneve.h>
diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
index 2affd380c6..f5c1131839 100644
--- a/drivers/net/enic/enic_main.c
+++ b/drivers/net/enic/enic_main.c
@@ -10,7 +10,7 @@
 #include <fcntl.h>
 
 #include <rte_pci.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_memzone.h>
 #include <rte_malloc.h>
 #include <rte_mbuf.h>
diff --git a/drivers/net/enic/enic_vf_representor.c b/drivers/net/enic/enic_vf_representor.c
index 79dd6e5640..f44f6c013e 100644
--- a/drivers/net/enic/enic_vf_representor.c
+++ b/drivers/net/enic/enic_vf_representor.c
@@ -5,7 +5,7 @@
 #include <stdint.h>
 #include <stdio.h>
 
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_common.h>
 #include <rte_dev.h>
 #include <ethdev_driver.h>
diff --git a/drivers/net/hinic/base/hinic_pmd_hwdev.c b/drivers/net/hinic/base/hinic_pmd_hwdev.c
index cb9cf6efa2..49a6b523f5 100644
--- a/drivers/net/hinic/base/hinic_pmd_hwdev.c
+++ b/drivers/net/hinic/base/hinic_pmd_hwdev.c
@@ -3,7 +3,7 @@
  */
 
 #include<ethdev_driver.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_hash.h>
 #include <rte_jhash.h>
 
diff --git a/drivers/net/hinic/base/hinic_pmd_hwif.c b/drivers/net/hinic/base/hinic_pmd_hwif.c
index 26fa1e27d4..9b1b41ca95 100644
--- a/drivers/net/hinic/base/hinic_pmd_hwif.c
+++ b/drivers/net/hinic/base/hinic_pmd_hwif.c
@@ -2,7 +2,7 @@
  * Copyright(c) 2017 Huawei Technologies Co., Ltd
  */
 
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 
 #include "hinic_compat.h"
 #include "hinic_csr.h"
diff --git a/drivers/net/hinic/base/hinic_pmd_nicio.c b/drivers/net/hinic/base/hinic_pmd_nicio.c
index ad5db9f1de..234b433c90 100644
--- a/drivers/net/hinic/base/hinic_pmd_nicio.c
+++ b/drivers/net/hinic/base/hinic_pmd_nicio.c
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: BSD-3-Clause
  * Copyright(c) 2017 Huawei Technologies Co., Ltd
  */
-#include<rte_bus_pci.h>
+#include <pci_driver.h>
 
 #include "hinic_compat.h"
 #include "hinic_pmd_hwdev.h"
diff --git a/drivers/net/hinic/hinic_pmd_ethdev.c b/drivers/net/hinic/hinic_pmd_ethdev.c
index 1a72401546..d36dad0579 100644
--- a/drivers/net/hinic/hinic_pmd_ethdev.c
+++ b/drivers/net/hinic/hinic_pmd_ethdev.c
@@ -3,7 +3,7 @@
  */
 
 #include <rte_pci.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <ethdev_pci.h>
 #include <rte_mbuf.h>
 #include <rte_malloc.h>
diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
index 7d37004972..d5d5bc8e0f 100644
--- a/drivers/net/hns3/hns3_ethdev.c
+++ b/drivers/net/hns3/hns3_ethdev.c
@@ -3,7 +3,7 @@
  */
 
 #include <rte_alarm.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <ethdev_pci.h>
 #include <rte_pci.h>
 #include <rte_kvargs.h>
diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c
index 0f222b37f9..54cd15d40d 100644
--- a/drivers/net/hns3/hns3_rxtx.c
+++ b/drivers/net/hns3/hns3_rxtx.c
@@ -2,7 +2,7 @@
  * Copyright(c) 2018-2021 HiSilicon Limited.
  */
 
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_common.h>
 #include <rte_cycles.h>
 #include <rte_geneve.h>
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 7b230e2ed1..51fface85e 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -15,7 +15,7 @@
 #include <rte_eal.h>
 #include <rte_string_fns.h>
 #include <rte_pci.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_ether.h>
 #include <ethdev_driver.h>
 #include <ethdev_pci.h>
diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
index 0cfe13b7b2..356ca6de0c 100644
--- a/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/drivers/net/i40e/i40e_ethdev_vf.c
@@ -18,7 +18,7 @@
 #include <rte_log.h>
 #include <rte_debug.h>
 #include <rte_pci.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_atomic.h>
 #include <rte_branch_prediction.h>
 #include <rte_memory.h>
diff --git a/drivers/net/i40e/i40e_vf_representor.c b/drivers/net/i40e/i40e_vf_representor.c
index 0481b55381..650d8ad502 100644
--- a/drivers/net/i40e/i40e_vf_representor.c
+++ b/drivers/net/i40e/i40e_vf_representor.c
@@ -2,7 +2,7 @@
  * Copyright(c) 2018 Intel Corporation.
  */
 
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_ethdev.h>
 #include <rte_pci.h>
 #include <rte_malloc.h>
diff --git a/drivers/net/igc/igc_ethdev.c b/drivers/net/igc/igc_ethdev.c
index 224a095483..3d3d0d6f3c 100644
--- a/drivers/net/igc/igc_ethdev.c
+++ b/drivers/net/igc/igc_ethdev.c
@@ -7,7 +7,7 @@
 
 #include <rte_string_fns.h>
 #include <rte_pci.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <ethdev_driver.h>
 #include <ethdev_pci.h>
 #include <rte_malloc.h>
diff --git a/drivers/net/ionic/ionic.h b/drivers/net/ionic/ionic.h
index 49b90d1b7c..e946d92c29 100644
--- a/drivers/net/ionic/ionic.h
+++ b/drivers/net/ionic/ionic.h
@@ -8,7 +8,7 @@
 #include <stdint.h>
 #include <inttypes.h>
 
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 
 #include "ionic_dev.h"
 #include "ionic_if.h"
diff --git a/drivers/net/ionic/ionic_ethdev.c b/drivers/net/ionic/ionic_ethdev.c
index e620793966..e8bcccccb4 100644
--- a/drivers/net/ionic/ionic_ethdev.c
+++ b/drivers/net/ionic/ionic_ethdev.c
@@ -3,7 +3,7 @@
  */
 
 #include <rte_pci.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_ethdev.h>
 #include <ethdev_driver.h>
 #include <rte_malloc.h>
diff --git a/drivers/net/ipn3ke/ipn3ke_ethdev.c b/drivers/net/ipn3ke/ipn3ke_ethdev.c
index 964506c6db..2493df2bcd 100644
--- a/drivers/net/ipn3ke/ipn3ke_ethdev.c
+++ b/drivers/net/ipn3ke/ipn3ke_ethdev.c
@@ -4,7 +4,7 @@
 
 #include <stdint.h>
 
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_ethdev.h>
 #include <rte_pci.h>
 #include <rte_malloc.h>
diff --git a/drivers/net/ipn3ke/ipn3ke_representor.c b/drivers/net/ipn3ke/ipn3ke_representor.c
index 589d9fa587..f288bf09d8 100644
--- a/drivers/net/ipn3ke/ipn3ke_representor.c
+++ b/drivers/net/ipn3ke/ipn3ke_representor.c
@@ -5,7 +5,7 @@
 #include <stdint.h>
 #include <unistd.h>
 
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_ethdev.h>
 #include <rte_pci.h>
 #include <rte_malloc.h>
diff --git a/drivers/net/ipn3ke/ipn3ke_tm.c b/drivers/net/ipn3ke/ipn3ke_tm.c
index 6a9b98fd7f..532d232dbf 100644
--- a/drivers/net/ipn3ke/ipn3ke_tm.c
+++ b/drivers/net/ipn3ke/ipn3ke_tm.c
@@ -6,7 +6,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_ethdev.h>
 #include <rte_pci.h>
 #include <rte_malloc.h>
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index b5371568b5..f873757a7b 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -20,7 +20,7 @@
 #include <rte_log.h>
 #include <rte_debug.h>
 #include <rte_pci.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_branch_prediction.h>
 #include <rte_memory.h>
 #include <rte_kvargs.h>
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.h b/drivers/net/ixgbe/ixgbe_ethdev.h
index a0ce18ca24..7b0c1ad542 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.h
+++ b/drivers/net/ixgbe/ixgbe_ethdev.h
@@ -19,7 +19,7 @@
 #include <rte_time.h>
 #include <rte_hash.h>
 #include <rte_pci.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_tm_driver.h>
 
 /* need update link, bit flag */
diff --git a/drivers/net/mlx4/mlx4_ethdev.c b/drivers/net/mlx4/mlx4_ethdev.c
index 783ff94dce..b86f65e32a 100644
--- a/drivers/net/mlx4/mlx4_ethdev.c
+++ b/drivers/net/mlx4/mlx4_ethdev.c
@@ -32,7 +32,7 @@
 #pragma GCC diagnostic error "-Wpedantic"
 #endif
 
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_errno.h>
 #include <ethdev_driver.h>
 #include <rte_ether.h>
diff --git a/drivers/net/mlx5/linux/mlx5_ethdev_os.c b/drivers/net/mlx5/linux/mlx5_ethdev_os.c
index f34133e2c6..2e0a40f0cc 100644
--- a/drivers/net/mlx5/linux/mlx5_ethdev_os.c
+++ b/drivers/net/mlx5/linux/mlx5_ethdev_os.c
@@ -25,7 +25,7 @@
 #include <time.h>
 
 #include <ethdev_driver.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_mbuf.h>
 #include <rte_common.h>
 #include <rte_interrupts.h>
diff --git a/drivers/net/mlx5/linux/mlx5_os.c b/drivers/net/mlx5/linux/mlx5_os.c
index 5f8766aa48..ba184470e1 100644
--- a/drivers/net/mlx5/linux/mlx5_os.c
+++ b/drivers/net/mlx5/linux/mlx5_os.c
@@ -19,7 +19,7 @@
 #include <ethdev_driver.h>
 #include <ethdev_pci.h>
 #include <rte_pci.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_bus_auxiliary.h>
 #include <rte_common.h>
 #include <rte_kvargs.h>
diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index f84e061fe7..bbcdec0f49 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -13,7 +13,7 @@
 #include <rte_malloc.h>
 #include <ethdev_driver.h>
 #include <rte_pci.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_common.h>
 #include <rte_kvargs.h>
 #include <rte_rwlock.h>
diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c
index 82e2284d98..8888702fc8 100644
--- a/drivers/net/mlx5/mlx5_ethdev.c
+++ b/drivers/net/mlx5/mlx5_ethdev.c
@@ -11,7 +11,7 @@
 #include <errno.h>
 
 #include <ethdev_driver.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_mbuf.h>
 #include <rte_common.h>
 #include <rte_interrupts.h>
diff --git a/drivers/net/mlx5/mlx5_txq.c b/drivers/net/mlx5/mlx5_txq.c
index eb4d34ca55..4d8c26f7bc 100644
--- a/drivers/net/mlx5/mlx5_txq.c
+++ b/drivers/net/mlx5/mlx5_txq.c
@@ -13,7 +13,7 @@
 #include <rte_mbuf.h>
 #include <rte_malloc.h>
 #include <ethdev_driver.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_common.h>
 #include <rte_eal_paging.h>
 
diff --git a/drivers/net/netvsc/hn_vf.c b/drivers/net/netvsc/hn_vf.c
index 75192e6319..1da4eacb6f 100644
--- a/drivers/net/netvsc/hn_vf.c
+++ b/drivers/net/netvsc/hn_vf.c
@@ -21,7 +21,7 @@
 #include <rte_memory.h>
 #include <rte_bus_vmbus.h>
 #include <rte_pci.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_log.h>
 #include <rte_string_fns.h>
 #include <rte_alarm.h>
diff --git a/drivers/net/octeontx/base/octeontx_pkivf.c b/drivers/net/octeontx/base/octeontx_pkivf.c
index 0ddff54886..9ff5b78fd0 100644
--- a/drivers/net/octeontx/base/octeontx_pkivf.c
+++ b/drivers/net/octeontx/base/octeontx_pkivf.c
@@ -5,7 +5,7 @@
 #include <string.h>
 
 #include <rte_eal.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 
 #include "../octeontx_logs.h"
 #include "octeontx_io.h"
diff --git a/drivers/net/octeontx/base/octeontx_pkovf.c b/drivers/net/octeontx/base/octeontx_pkovf.c
index bf28bc7992..a125acadce 100644
--- a/drivers/net/octeontx/base/octeontx_pkovf.c
+++ b/drivers/net/octeontx/base/octeontx_pkovf.c
@@ -10,7 +10,7 @@
 #include <rte_cycles.h>
 #include <rte_malloc.h>
 #include <rte_memory.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_spinlock.h>
 
 #include "../octeontx_logs.h"
diff --git a/drivers/net/octeontx2/otx2_ethdev_irq.c b/drivers/net/octeontx2/otx2_ethdev_irq.c
index b121488faf..40541c9280 100644
--- a/drivers/net/octeontx2/otx2_ethdev_irq.c
+++ b/drivers/net/octeontx2/otx2_ethdev_irq.c
@@ -4,7 +4,7 @@
 
 #include <inttypes.h>
 
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_malloc.h>
 
 #include "otx2_ethdev.h"
diff --git a/drivers/net/qede/base/bcm_osal.h b/drivers/net/qede/base/bcm_osal.h
index c5b5399282..10ec1e2fb7 100644
--- a/drivers/net/qede/base/bcm_osal.h
+++ b/drivers/net/qede/base/bcm_osal.h
@@ -21,7 +21,7 @@
 #include <rte_ether.h>
 #include <rte_io.h>
 #include <rte_version.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 
 /* Forward declaration */
 struct ecore_dev;
diff --git a/drivers/net/sfc/sfc.h b/drivers/net/sfc/sfc.h
index 331e06bac6..f57da8fc96 100644
--- a/drivers/net/sfc/sfc.h
+++ b/drivers/net/sfc/sfc.h
@@ -13,7 +13,7 @@
 #include <stdbool.h>
 
 #include <rte_pci.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <ethdev_driver.h>
 #include <rte_kvargs.h>
 #include <rte_spinlock.h>
diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c
index 2db0d000c3..7f8b052845 100644
--- a/drivers/net/sfc/sfc_ethdev.c
+++ b/drivers/net/sfc/sfc_ethdev.c
@@ -11,7 +11,7 @@
 #include <ethdev_driver.h>
 #include <ethdev_pci.h>
 #include <rte_pci.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_errno.h>
 #include <rte_string_fns.h>
 #include <rte_ether.h>
diff --git a/drivers/net/sfc/sfc_sriov.c b/drivers/net/sfc/sfc_sriov.c
index baa0242433..48c64c8311 100644
--- a/drivers/net/sfc/sfc_sriov.c
+++ b/drivers/net/sfc/sfc_sriov.c
@@ -8,7 +8,7 @@
  */
 
 #include <rte_common.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 
 #include "sfc.h"
 #include "sfc_log.h"
diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c
index fc1844ddfc..cf87a3861f 100644
--- a/drivers/net/thunderx/nicvf_ethdev.c
+++ b/drivers/net/thunderx/nicvf_ethdev.c
@@ -32,7 +32,7 @@
 #include <rte_malloc.h>
 #include <rte_random.h>
 #include <rte_pci.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_tailq.h>
 #include <rte_devargs.h>
 #include <rte_kvargs.h>
diff --git a/drivers/net/txgbe/txgbe_ethdev.h b/drivers/net/txgbe/txgbe_ethdev.h
index 3021933965..faf0c58bd5 100644
--- a/drivers/net/txgbe/txgbe_ethdev.h
+++ b/drivers/net/txgbe/txgbe_ethdev.h
@@ -20,7 +20,7 @@
 #include <rte_ethdev_core.h>
 #include <rte_hash.h>
 #include <rte_hash_crc.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_tm_driver.h>
 
 /* need update link, bit flag */
diff --git a/drivers/net/txgbe/txgbe_flow.c b/drivers/net/txgbe/txgbe_flow.c
index eae400b141..f70a9309d9 100644
--- a/drivers/net/txgbe/txgbe_flow.c
+++ b/drivers/net/txgbe/txgbe_flow.c
@@ -4,7 +4,7 @@
  */
 
 #include <sys/queue.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_malloc.h>
 #include <rte_flow.h>
 #include <rte_flow_driver.h>
diff --git a/drivers/net/txgbe/txgbe_pf.c b/drivers/net/txgbe/txgbe_pf.c
index 494d779a3c..58159bc226 100644
--- a/drivers/net/txgbe/txgbe_pf.c
+++ b/drivers/net/txgbe/txgbe_pf.c
@@ -20,7 +20,7 @@
 #include <rte_memcpy.h>
 #include <rte_malloc.h>
 #include <rte_random.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 
 #include "base/txgbe.h"
 #include "txgbe_ethdev.h"
diff --git a/drivers/net/virtio/virtio_pci.h b/drivers/net/virtio/virtio_pci.h
index 11e25a0142..a9016534aa 100644
--- a/drivers/net/virtio/virtio_pci.h
+++ b/drivers/net/virtio/virtio_pci.h
@@ -9,7 +9,7 @@
 #include <stdbool.h>
 
 #include <rte_pci.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <ethdev_driver.h>
 
 #include "virtio.h"
diff --git a/drivers/net/virtio/virtio_pci_ethdev.c b/drivers/net/virtio/virtio_pci_ethdev.c
index 4083853c48..13dbc0c419 100644
--- a/drivers/net/virtio/virtio_pci_ethdev.c
+++ b/drivers/net/virtio/virtio_pci_ethdev.c
@@ -11,7 +11,7 @@
 #include <ethdev_driver.h>
 #include <ethdev_pci.h>
 #include <rte_pci.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_errno.h>
 
 #include <rte_memory.h>
diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
index 1a3291273a..ccbab9364e 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
@@ -19,7 +19,7 @@
 #include <rte_log.h>
 #include <rte_debug.h>
 #include <rte_pci.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_branch_prediction.h>
 #include <rte_memory.h>
 #include <rte_memzone.h>
diff --git a/drivers/raw/cnxk_bphy/cnxk_bphy.c b/drivers/raw/cnxk_bphy/cnxk_bphy.c
index 9cb3f8d332..61c60ed363 100644
--- a/drivers/raw/cnxk_bphy/cnxk_bphy.c
+++ b/drivers/raw/cnxk_bphy/cnxk_bphy.c
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: BSD-3-Clause
  * Copyright(C) 2021 Marvell.
  */
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_common.h>
 #include <rte_dev.h>
 #include <rte_eal.h>
diff --git a/drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c b/drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c
index ade45ab741..f9d7353a18 100644
--- a/drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c
+++ b/drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c
@@ -3,7 +3,7 @@
  */
 #include <string.h>
 
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_rawdev.h>
 #include <rte_rawdev_pmd.h>
 
diff --git a/drivers/raw/cnxk_bphy/cnxk_bphy_irq.c b/drivers/raw/cnxk_bphy/cnxk_bphy_irq.c
index bbcc285a7a..6014992934 100644
--- a/drivers/raw/cnxk_bphy/cnxk_bphy_irq.c
+++ b/drivers/raw/cnxk_bphy/cnxk_bphy_irq.c
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: BSD-3-Clause
  * Copyright(C) 2021 Marvell.
  */
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_pci.h>
 #include <rte_rawdev.h>
 #include <rte_rawdev_pmd.h>
diff --git a/drivers/raw/cnxk_bphy/cnxk_bphy_irq.h b/drivers/raw/cnxk_bphy/cnxk_bphy_irq.h
index b55147b93e..7a623b48c8 100644
--- a/drivers/raw/cnxk_bphy/cnxk_bphy_irq.h
+++ b/drivers/raw/cnxk_bphy/cnxk_bphy_irq.h
@@ -5,7 +5,7 @@
 #ifndef _CNXK_BPHY_IRQ_
 #define _CNXK_BPHY_IRQ_
 
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_dev.h>
 
 #include <roc_api.h>
diff --git a/drivers/raw/ifpga/ifpga_rawdev.c b/drivers/raw/ifpga/ifpga_rawdev.c
index 76e6a8530b..eb0c6e271f 100644
--- a/drivers/raw/ifpga/ifpga_rawdev.c
+++ b/drivers/raw/ifpga/ifpga_rawdev.c
@@ -16,7 +16,7 @@
 #include <rte_devargs.h>
 #include <rte_memcpy.h>
 #include <rte_pci.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_kvargs.h>
 #include <rte_alarm.h>
 #include <rte_interrupts.h>
diff --git a/drivers/raw/ifpga/rte_pmd_ifpga.c b/drivers/raw/ifpga/rte_pmd_ifpga.c
index 23146432c2..959aad414d 100644
--- a/drivers/raw/ifpga/rte_pmd_ifpga.c
+++ b/drivers/raw/ifpga/rte_pmd_ifpga.c
@@ -3,7 +3,7 @@
  */
 
 #include <rte_pci.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_rawdev.h>
 #include <rte_rawdev_pmd.h>
 #include "rte_pmd_ifpga.h"
diff --git a/drivers/raw/ioat/idxd_pci.c b/drivers/raw/ioat/idxd_pci.c
index 13515dbc6c..257e4c004a 100644
--- a/drivers/raw/ioat/idxd_pci.c
+++ b/drivers/raw/ioat/idxd_pci.c
@@ -2,7 +2,7 @@
  * Copyright(c) 2020 Intel Corporation
  */
 
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_memzone.h>
 #include <rte_devargs.h>
 
diff --git a/drivers/raw/ioat/ioat_rawdev.c b/drivers/raw/ioat/ioat_rawdev.c
index 5396671d4f..f1d4220b69 100644
--- a/drivers/raw/ioat/ioat_rawdev.c
+++ b/drivers/raw/ioat/ioat_rawdev.c
@@ -3,7 +3,7 @@
  */
 
 #include <rte_cycles.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_memzone.h>
 #include <rte_string_fns.h>
 #include <rte_rawdev_pmd.h>
diff --git a/drivers/raw/ntb/ntb.c b/drivers/raw/ntb/ntb.c
index 78cfcd79f7..a74a42f8d2 100644
--- a/drivers/raw/ntb/ntb.c
+++ b/drivers/raw/ntb/ntb.c
@@ -13,7 +13,7 @@
 #include <rte_log.h>
 #include <rte_pci.h>
 #include <rte_mbuf.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_memzone.h>
 #include <rte_memcpy.h>
 #include <rte_rawdev.h>
diff --git a/drivers/raw/ntb/ntb_hw_intel.c b/drivers/raw/ntb/ntb_hw_intel.c
index a742e8fbb9..072c2dd7b9 100644
--- a/drivers/raw/ntb/ntb_hw_intel.c
+++ b/drivers/raw/ntb/ntb_hw_intel.c
@@ -8,7 +8,7 @@
 #include <rte_io.h>
 #include <rte_eal.h>
 #include <rte_pci.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_rawdev.h>
 #include <rte_rawdev_pmd.h>
 
diff --git a/drivers/raw/octeontx2_dma/otx2_dpi_rawdev.c b/drivers/raw/octeontx2_dma/otx2_dpi_rawdev.c
index 8c01f25ec7..179e3e6dbb 100644
--- a/drivers/raw/octeontx2_dma/otx2_dpi_rawdev.c
+++ b/drivers/raw/octeontx2_dma/otx2_dpi_rawdev.c
@@ -6,7 +6,7 @@
 #include <unistd.h>
 
 #include <rte_bus.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_common.h>
 #include <rte_eal.h>
 #include <rte_lcore.h>
diff --git a/drivers/raw/octeontx2_ep/otx2_ep_enqdeq.c b/drivers/raw/octeontx2_ep/otx2_ep_enqdeq.c
index d04e957d82..214fd83169 100644
--- a/drivers/raw/octeontx2_ep/otx2_ep_enqdeq.c
+++ b/drivers/raw/octeontx2_ep/otx2_ep_enqdeq.c
@@ -8,7 +8,7 @@
 #include <fcntl.h>
 
 #include <rte_bus.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_eal.h>
 #include <rte_lcore.h>
 #include <rte_mempool.h>
diff --git a/drivers/raw/octeontx2_ep/otx2_ep_rawdev.c b/drivers/raw/octeontx2_ep/otx2_ep_rawdev.c
index b2ccdda83e..560a8bbf03 100644
--- a/drivers/raw/octeontx2_ep/otx2_ep_rawdev.c
+++ b/drivers/raw/octeontx2_ep/otx2_ep_rawdev.c
@@ -5,7 +5,7 @@
 #include <unistd.h>
 
 #include <rte_bus.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_eal.h>
 #include <rte_lcore.h>
 #include <rte_mempool.h>
diff --git a/drivers/regex/mlx5/mlx5_regex.c b/drivers/regex/mlx5/mlx5_regex.c
index f17b6df47f..0926aec5bc 100644
--- a/drivers/regex/mlx5/mlx5_regex.c
+++ b/drivers/regex/mlx5/mlx5_regex.c
@@ -9,7 +9,7 @@
 #include <rte_regexdev.h>
 #include <rte_regexdev_core.h>
 #include <rte_regexdev_driver.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 
 #include <mlx5_common.h>
 #include <mlx5_common_mr.h>
diff --git a/drivers/regex/mlx5/mlx5_regex_fastpath.c b/drivers/regex/mlx5/mlx5_regex_fastpath.c
index 786718af53..7693171106 100644
--- a/drivers/regex/mlx5/mlx5_regex_fastpath.c
+++ b/drivers/regex/mlx5/mlx5_regex_fastpath.c
@@ -10,7 +10,7 @@
 #include <rte_malloc.h>
 #include <rte_log.h>
 #include <rte_errno.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_pci.h>
 #include <rte_regexdev_driver.h>
 #include <rte_mbuf.h>
diff --git a/drivers/vdpa/ifc/base/ifcvf_osdep.h b/drivers/vdpa/ifc/base/ifcvf_osdep.h
index 6aef25ea45..3f3eb46f3f 100644
--- a/drivers/vdpa/ifc/base/ifcvf_osdep.h
+++ b/drivers/vdpa/ifc/base/ifcvf_osdep.h
@@ -10,7 +10,7 @@
 
 #include <rte_cycles.h>
 #include <rte_pci.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_log.h>
 #include <rte_io.h>
 
diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c b/drivers/vdpa/ifc/ifcvf_vdpa.c
index 1dc813d0a3..968dea5055 100644
--- a/drivers/vdpa/ifc/ifcvf_vdpa.c
+++ b/drivers/vdpa/ifc/ifcvf_vdpa.c
@@ -14,7 +14,7 @@
 #include <rte_eal_paging.h>
 #include <rte_malloc.h>
 #include <rte_memory.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_vhost.h>
 #include <rte_vdpa.h>
 #include <rte_vdpa_dev.h>
diff --git a/drivers/vdpa/mlx5/mlx5_vdpa.c b/drivers/vdpa/mlx5/mlx5_vdpa.c
index 6d17d7a6f3..81c7e738f5 100644
--- a/drivers/vdpa/mlx5/mlx5_vdpa.c
+++ b/drivers/vdpa/mlx5/mlx5_vdpa.c
@@ -12,7 +12,7 @@
 #include <rte_log.h>
 #include <rte_errno.h>
 #include <rte_string_fns.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 
 #include <mlx5_glue.h>
 #include <mlx5_common.h>
diff --git a/lib/ethdev/ethdev_pci.h b/lib/ethdev/ethdev_pci.h
index 8edca82ce8..76779faa6c 100644
--- a/lib/ethdev/ethdev_pci.h
+++ b/lib/ethdev/ethdev_pci.h
@@ -8,7 +8,7 @@
 
 #include <rte_malloc.h>
 #include <rte_pci.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 #include <rte_config.h>
 #include <ethdev_driver.h>
 
diff --git a/lib/eventdev/eventdev_pmd_pci.h b/lib/eventdev/eventdev_pmd_pci.h
index d14ea634b8..260362aacb 100644
--- a/lib/eventdev/eventdev_pmd_pci.h
+++ b/lib/eventdev/eventdev_pmd_pci.h
@@ -24,7 +24,7 @@ extern "C" {
 #include <rte_eal.h>
 #include <rte_lcore.h>
 #include <rte_pci.h>
-#include <rte_bus_pci.h>
+#include <pci_driver.h>
 
 #include "eventdev_pmd.h"
 
-- 
2.17.1


^ permalink raw reply	[relevance 2%]

* Re: [dpdk-dev] [EXT] Re: [PATCH v2 1/5] net/enetfec: introduce NXP ENETFEC driver
  2021-09-03  7:14  3%   ` David Marchand
@ 2021-09-10  3:47  0%     ` Apeksha Gupta
  0 siblings, 0 replies; 200+ results
From: Apeksha Gupta @ 2021-09-10  3:47 UTC (permalink / raw)
  To: David Marchand
  Cc: Andrew Rybchenko, Yigit, Ferruh, dev, Hemant Agrawal, Sachin Saxena



> -----Original Message-----
> From: David Marchand <david.marchand@redhat.com>
> Sent: Friday, September 3, 2021 12:45 PM
> To: Apeksha Gupta <apeksha.gupta@nxp.com>
> Cc: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>; Yigit, Ferruh
> <ferruh.yigit@intel.com>; dev <dev@dpdk.org>; Hemant Agrawal
> <hemant.agrawal@nxp.com>; Sachin Saxena <sachin.saxena@nxp.com>
> Subject: [EXT] Re: [dpdk-dev] [PATCH v2 1/5] net/enetfec: introduce NXP
> ENETFEC driver
> 
> Caution: EXT Email
> 
> On Thu, Sep 2, 2021 at 8:01 PM Apeksha Gupta <apeksha.gupta@nxp.com>
> wrote:
> >
> > ENETFEC (Fast Ethernet Controller) is a network poll mode driver
> > for NXP SoC i.MX 8M Mini.
> >
> > This patch adds skeleton for enetfec driver with probe function.
> >
> > Signed-off-by: Sachin Saxena <sachin.saxena@nxp.com>
> > Signed-off-by: Apeksha Gupta <apeksha.gupta@nxp.com>
> > ---
> >  doc/guides/nics/enetfec.rst          | 121 ++++++++++++++++++++
> >  doc/guides/nics/features/enetfec.ini |   8 ++
> >  doc/guides/nics/index.rst            |   1 +
> >  drivers/net/enetfec/enet_ethdev.c    |  95 ++++++++++++++++
> >  drivers/net/enetfec/enet_ethdev.h    | 160 +++++++++++++++++++++++++++
> >  drivers/net/enetfec/enet_pmd_logs.h  |  31 ++++++
> >  drivers/net/enetfec/meson.build      |  15 +++
> >  drivers/net/enetfec/version.map      |   3 +
> >  drivers/net/meson.build              |   1 +
> >  9 files changed, 435 insertions(+)
> >  create mode 100644 doc/guides/nics/enetfec.rst
> >  create mode 100644 doc/guides/nics/features/enetfec.ini
> >  create mode 100644 drivers/net/enetfec/enet_ethdev.c
> >  create mode 100644 drivers/net/enetfec/enet_ethdev.h
> >  create mode 100644 drivers/net/enetfec/enet_pmd_logs.h
> >  create mode 100644 drivers/net/enetfec/meson.build
> >  create mode 100644 drivers/net/enetfec/version.map
> 
> Please update MAINTAINERS and release notes in this first patch.
[Apeksha] okay, added in v3.
> 
> >
> > diff --git a/doc/guides/nics/enetfec.rst b/doc/guides/nics/enetfec.rst
> > new file mode 100644
> > index 0000000000..f151bb26c4
> > --- /dev/null
> > +++ b/doc/guides/nics/enetfec.rst
> > @@ -0,0 +1,121 @@
> > +.. SPDX-License-Identifier: BSD-3-Clause
> > +   Copyright 2021 NXP
> > +
> > +ENETFEC Poll Mode Driver
> > +========================
> > +
> > +The ENETFEC NIC PMD (**librte_net_enetfec**) provides poll mode driver
> > +support for the inbuilt NIC found in the ** NXP i.MX 8M Mini** SoC.
> > +
> > +More information can be found at NXP Official Website
> >
> +<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.
> nxp.com%2Fproducts%2Fprocessors-and-microcontrollers%2Farm-
> processors%2Fi-mx-applications-processors%2Fi-mx-8-processors%2Fi-mx-8m-
> mini-arm-cortex-a53-cortex-m4-audio-voice-
> video%3Ai.MX8MMINI&amp;data=04%7C01%7Capeksha.gupta%40nxp.com%7
> Ca965cce583974ae4b49408d96eaa8a58%7C686ea1d3bc2b4c6fa92cd99c5c301
> 635%7C0%7C1%7C637662501011576537%7CUnknown%7CTWFpbGZsb3d8eyJ
> WIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C
> 1000&amp;sdata=2iLDhMwWZvZjskijEk6IGUPNLzw8D0xhPsvwJe305ng%3D&am
> p;reserved=0>
> > +
> > +ENETFEC
> > +-------
> > +
> > +This section provides an overview of the NXP ENETFEC and how it is
> > +integrated into the DPDK.
> > +
> > +Contents summary
> > +
> > +- ENETFEC overview
> > +- ENETFEC features
> > +- Supported ENETFEC SoCs
> > +- Prerequisites
> > +- Driver compilation and testing
> > +- Limitations
> > +
> > +ENETFEC Overview
> > +~~~~~~~~~~~~~~~~
> > +The i.MX 8M Mini Media Applications Processor is built to achieve both high
> > +performance and low power consumption. ENETFEC is a hardware
> programmable
> > +packet forwarding engine to provide high performance Ethernet interface.
> > +The diagram below shows a system level overview of ENETFEC:
> > +
> > +
> ====================================================+============
> ===
> > +   US   +-----------------------------------------+    | Kernel Space
> > +        |                                         |    |
> > +        |              ENETFEC Driver             |    |
> > +        +-----------------------------------------+    |
> > +                          ^   |                        |
> > +   ENETFEC            RXQ |   | TXQ                   |
> > +   PMD                    |   |                       |
> > +                          |   v                       |   +----------+
> 
> Misalignment of the right part.
> 
> 
> > +                     +-------------+                   |   | fec-uio  |
> 
> What is fec-uio?
> I can't find it in upstream linux kernel.
[Apeksha] fec-uio is the kernel driver. We have also initiated the process of upstreaming it.
> 
> 
> > +                     | net_enetfec |                   |   +----------+
> > +                     +-------------+                   |
> > +                          ^   |                        |
> > +                      TXQ |   | RXQ                    |
> > +                          |   |                        |
> > +                          |   v                        |
> > +
> ===================================================+=============
> ==
> > +         +----------------------------------------+
> > +         |                                        |        HW
> > +         |  i.MX 8M MINI EVK                      |
> > +         |               +-----+                  |
> > +         |               | MAC |                  |
> > +         +---------------+-----+------------------+
> > +                        | PHY |
> > +                        +-----+
> 
> Misalignment.
> 
> 
> > +
> > +ENETFEC Ethernet driver is traditional DPDK PMD driver running in the
> userspace.
> > +The MAC and PHY are the hardware blocks. 'fec-uio' is the UIO driver,
> ENETFEC PMD
> > +uses UIO interface to interact with kernel for PHY initialisation and for
> mapping
> > +the allocated memory of register & BD in kernel with DPDK which gives
> access to
> > +non-cacheable memory for BD. net_enetfec is logical Ethernet interface,
> created by
> > +ENETFEC driver.
> > +
> > +- ENETFEC driver registers the device in virtual device driver.
> > +- RTE framework scans and will invoke the probe function of ENETFEC driver.
> > +- The probe function will set the basic device registers and also setups BD
> rings.
> > +- On packet Rx the respective BD Ring status bit is set which is then used for
> > +  packet processing.
> > +- Then Tx is done first followed by Rx via logical interfaces.
> > +
> > +ENETFEC Features
> > +~~~~~~~~~~~~~~~~~
> > +
> > +- ARMv8
> > +
> > +Supported ENETFEC SoCs
> > +~~~~~~~~~~~~~~~~~~~~~~
> > +
> > +- i.MX 8M Mini
> > +
> > +Prerequisites
> > +~~~~~~~~~~~~~
> > +
> > +There are three main pre-requisites for executing ENETFEC PMD on a i.MX
> 8M Mini
> > +compatible board:
> > +
> > +1. **ARM 64 Tool Chain**
> > +
> > +   For example, the `*aarch64* Linaro Toolchain
> <https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Freleases
> .linaro.org%2Fcomponents%2Ftoolchain%2Fbinaries%2F7.4-
> 2019.02%2Faarch64-linux-gnu%2Fgcc-linaro-7.4.1-2019.02-x86_64_aarch64-
> linux-
> gnu.tar.xz&amp;data=04%7C01%7Capeksha.gupta%40nxp.com%7Ca965cce583
> 974ae4b49408d96eaa8a58%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C
> 1%7C637662501011586493%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjA
> wMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sda
> ta=mHBmrwivWNwEJiXBQTR8EAADgrZtd44ggXqJFyRJxTA%3D&amp;reserved=0
> >`_.
> > +
> > +2. **Linux Kernel**
> > +
> > +  It can be obtained from `NXP's Github hosting
> <https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fsource.
> codeaurora.org%2Fexternal%2Fqoriq%2Fqoriq-
> components%2Flinux&amp;data=04%7C01%7Capeksha.gupta%40nxp.com%7Ca
> 965cce583974ae4b49408d96eaa8a58%7C686ea1d3bc2b4c6fa92cd99c5c30163
> 5%7C0%7C1%7C637662501011586493%7CUnknown%7CTWFpbGZsb3d8eyJWIj
> oiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C100
> 0&amp;sdata=4im4j9xK%2FlTxAa0aVyMFVwQ7Klmy3tnTaYSDtu9yVg8%3D&amp
> ;reserved=0>`_.
> > +
> > +3. **Rootfile system**
> > +
> > +   Any *aarch64* supporting filesystem can be used. For example,
> > +   Ubuntu 18.04 LTS (Bionic) or 20.04 LTS(Focal) userland which can be
> obtained
> > +   from `here
> <https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fcdimage.
> ubuntu.com%2Fubuntu-base%2Freleases%2F18.04%2Frelease%2Fubuntu-base-
> 18.04.1-base-
> arm64.tar.gz&amp;data=04%7C01%7Capeksha.gupta%40nxp.com%7Ca965cce5
> 83974ae4b49408d96eaa8a58%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%
> 7C1%7C637662501011586493%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wL
> jAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;s
> data=jBnLNy7HsO%2BPVDOLY3tCizW%2Bvs%2FA86KjTTe73xBLGPY%3D&amp;r
> eserved=0>`_.
> > +
> > +4. The Ethernet device will be registered as virtual device, so ENETFEC has
> dependency on
> > +   **rte_bus_vdev** library and it is mandatory to use `--vdev` with value
> `net_enetfec` to
> > +   run DPDK application.
> > +
> > +Driver compilation and testing
> > +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > +
> > +Follow instructions available in the document
> > +:ref:`compiling and testing a PMD for a NIC <pmd_build_and_test>`
> > +to launch **testpmd**
> 
> dpdk-testpmd.
> 
> 
> > +
> > +Limitations
> > +~~~~~~~~~~~
> > +
> > +- Multi queue is not supported.
> > +- Link status is down always.
> > +- Single Ethernet interface.
> > diff --git a/doc/guides/nics/features/enetfec.ini
> b/doc/guides/nics/features/enetfec.ini
> > new file mode 100644
> > index 0000000000..5700697981
> > --- /dev/null
> > +++ b/doc/guides/nics/features/enetfec.ini
> > @@ -0,0 +1,8 @@
> > +;
> > +; Supported features of the 'enetfec' network poll mode driver.
> > +;
> > +; Refer to default.ini for the full list of available PMD features.
> > +;
> > +[Features]
> > +ARMv8                = Y
> > +Usage doc            = Y
> > diff --git a/doc/guides/nics/index.rst b/doc/guides/nics/index.rst
> > index 784d5d39f6..777fdab4a0 100644
> > --- a/doc/guides/nics/index.rst
> > +++ b/doc/guides/nics/index.rst
> > @@ -26,6 +26,7 @@ Network Interface Controller Drivers
> >      e1000em
> >      ena
> >      enetc
> > +    enetfec
> >      enic
> >      fm10k
> >      hinic
> > diff --git a/drivers/net/enetfec/enet_ethdev.c
> b/drivers/net/enetfec/enet_ethdev.c
> > new file mode 100644
> > index 0000000000..88774788cf
> > --- /dev/null
> > +++ b/drivers/net/enetfec/enet_ethdev.c
> > @@ -0,0 +1,95 @@
> > +/* SPDX-License-Identifier: BSD-3-Clause
> > + * Copyright 2020-2021 NXP
> > + */
> > +
> > +#include <stdio.h>
> > +#include <fcntl.h>
> > +#include <stdlib.h>
> > +#include <unistd.h>
> > +#include <errno.h>
> > +#include <rte_kvargs.h>
> > +#include <ethdev_vdev.h>
> > +#include <rte_bus_vdev.h>
> > +#include <rte_dev.h>
> > +#include <rte_ether.h>
> > +#include "enet_ethdev.h"
> > +#include "enet_pmd_logs.h"
> > +
> > +#define ENETFEC_NAME_PMD                net_enetfec
> > +#define ENETFEC_VDEV_GEM_ID_ARG         "intf"
> > +#define ENETFEC_CDEV_INVALID_FD         -1
> > +
> > +int enetfec_logtype_pmd;
> 
> If using RTE_LOG_REGISTER* macros (see below), you don't need this definition.
[Apeksha] okay.
> 
> 
> > +
> > +static int
> > +enetfec_eth_init(struct rte_eth_dev *dev)
> > +{
> > +       rte_eth_dev_probing_finish(dev);
> > +       return 0;
> > +}
> > +
> > +static int
> > +pmd_enetfec_probe(struct rte_vdev_device *vdev)
> > +{
> > +       struct rte_eth_dev *dev = NULL;
> > +       struct enetfec_private *fep;
> > +       const char *name;
> > +       int rc;
> > +
> > +       name = rte_vdev_device_name(vdev);
> > +       if (name == NULL)
> > +               return -EINVAL;
> > +       ENETFEC_PMD_LOG(INFO, "Initializing pmd_fec for %s", name);
> > +
> > +       dev = rte_eth_vdev_allocate(vdev, sizeof(*fep));
> > +       if (dev == NULL)
> > +               return -ENOMEM;
> > +
> > +       /* setup board info structure */
> > +       fep = dev->data->dev_private;
> > +       fep->dev = dev;
> > +       rc = enetfec_eth_init(dev);
> > +       if (rc)
> > +               goto failed_init;
> > +
> > +       return 0;
> > +
> > +failed_init:
> > +       ENETFEC_PMD_ERR("Failed to init");
> > +       return rc;
> > +}
> > +
> > +static int
> > +pmd_enetfec_remove(struct rte_vdev_device *vdev)
> > +{
> > +       struct rte_eth_dev *eth_dev = NULL;
> > +       int ret;
> > +
> > +       /* find the ethdev entry */
> > +       eth_dev = rte_eth_dev_allocated(rte_vdev_device_name(vdev));
> > +       if (eth_dev == NULL)
> > +               return -ENODEV;
> > +
> > +       ret = rte_eth_dev_release_port(eth_dev);
> > +       if (ret != 0)
> > +               return -EINVAL;
> > +
> > +       ENETFEC_PMD_INFO("Closing sw device");
> > +       return 0;
> > +}
> > +
> > +static struct rte_vdev_driver pmd_enetfec_drv = {
> > +       .probe = pmd_enetfec_probe,
> > +       .remove = pmd_enetfec_remove,
> > +};
> > +
> > +RTE_PMD_REGISTER_VDEV(ENETFEC_NAME_PMD, pmd_enetfec_drv);
> > +RTE_PMD_REGISTER_PARAM_STRING(ENETFEC_NAME_PMD,
> ENETFEC_VDEV_GEM_ID_ARG "=<int>");
> > +
> > +RTE_INIT(enetfec_pmd_init_log)
> > +{
> > +       int ret;
> > +       ret = rte_log_register_type_and_pick_level(ENETFEC_LOGTYPE_PREFIX
> "driver",
> > +                                                  RTE_LOG_NOTICE);
> > +       enetfec_logtype_pmd = (ret < 0) ? RTE_LOGTYPE_PMD : ret;
> > +}
> 
> Please use RTE_LOG_REGISTER_DEFAULT.
> 
> 
> > diff --git a/drivers/net/enetfec/enet_ethdev.h
> b/drivers/net/enetfec/enet_ethdev.h
> > new file mode 100644
> > index 0000000000..8c61176fb5
> > --- /dev/null
> > +++ b/drivers/net/enetfec/enet_ethdev.h
> > @@ -0,0 +1,160 @@
> > +/* SPDX-License-Identifier: BSD-3-Clause
> > + * Copyright 2020-2021 NXP
> > + */
> > +
> > +#ifndef __ENETFEC_ETHDEV_H__
> > +#define __ENETFEC_ETHDEV_H__
> > +
> > +#include <compat.h>
> > +#include <rte_ethdev.h>
> > +
> > +/* Common log type name prefix */
> > +#define ENETFEC_LOGTYPE_PREFIX "pmd.net.enetfec."
> > +
> > +/*
> > + * ENETFEC with AVB IP can support maximum 3 rx and tx queues.
> > + */
> > +#define ENETFEC_MAX_Q          3
> > +
> > +#define BD_LEN                 49152
> > +#define ENETFEC_TX_FR_SIZE     2048
> > +#define MAX_TX_BD_RING_SIZE    512     /* It should be power of 2 */
> > +#define MAX_RX_BD_RING_SIZE    512
> > +
> > +/* full duplex or half duplex */
> > +#define HALF_DUPLEX             0x00
> > +#define FULL_DUPLEX             0x01
> > +#define UNKNOWN_DUPLEX          0xff
> > +
> > +#define PKT_MAX_BUF_SIZE        1984
> > +#define OPT_FRAME_SIZE         (PKT_MAX_BUF_SIZE << 16)
> > +#define ETH_ALEN               RTE_ETHER_ADDR_LEN
> > +#define ETH_HLEN               RTE_ETHER_HDR_LEN
> > +#define VLAN_HLEN              4
> > +
> > +struct bufdesc {
> > +       uint16_t                bd_datlen;  /* buffer data length */
> > +       uint16_t                bd_sc;      /* buffer control & status */
> > +       uint32_t                bd_bufaddr; /* buffer address */
> > +};
> > +
> > +struct bufdesc_ex {
> > +       struct                  bufdesc desc;
> > +       uint32_t                bd_esc;
> > +       uint32_t                bd_prot;
> > +       uint32_t                bd_bdu;
> > +       uint32_t                ts;
> > +       uint16_t                res0[4];
> > +};
> > +
> > +struct bufdesc_prop {
> > +       int                     que_id;
> > +       /* Addresses of Tx and Rx buffers */
> > +       struct bufdesc          *base;
> > +       struct bufdesc          *last;
> > +       struct bufdesc          *cur;
> > +       void __iomem            *active_reg_desc;
> > +       uint64_t                descr_baseaddr_p;
> > +       unsigned short          ring_size;
> > +       unsigned char           d_size;
> > +       unsigned char           d_size_log2;
> > +};
> > +
> > +struct enetfec_priv_tx_q {
> > +       struct bufdesc_prop     bd;
> > +       struct rte_mbuf         *tx_mbuf[MAX_TX_BD_RING_SIZE];
> > +       struct bufdesc          *dirty_tx;
> > +       struct rte_mempool      *pool;
> > +       struct enetfec_private  *fep;
> > +};
> > +
> > +struct enetfec_priv_rx_q {
> > +       struct bufdesc_prop     bd;
> > +       struct rte_mbuf         *rx_mbuf[MAX_RX_BD_RING_SIZE];
> > +       struct rte_mempool      *pool;
> > +       struct enetfec_private  *fep;
> > +};
> > +
> > +/* Buffer descriptors of FEC are used to track the ring buffers. Buffer
> > + * descriptor base is x_bd_base. Currently available buffer are x_cur
> > + * and x_cur. where x is rx or tx. Current buffer is tracked by dirty_tx
> > + * that is sent by the controller.
> > + * The tx_cur and dirty_tx are same in completely full and empty
> > + * conditions. Actual condition is determined by empty & ready bits.
> > + */
> > +struct enetfec_private {
> > +       struct rte_eth_dev      *dev;
> > +       struct rte_eth_stats    stats;
> > +       struct rte_mempool      *pool;
> > +       uint16_t                max_rx_queues;
> > +       uint16_t                max_tx_queues;
> > +       unsigned int            total_tx_ring_size;
> > +       unsigned int            total_rx_ring_size;
> > +       bool                    bufdesc_ex;
> > +       unsigned int            tx_align;
> > +       unsigned int            rx_align;
> > +       int                     full_duplex;
> > +       unsigned int            phy_speed;
> > +       u_int32_t               quirks;
> > +       int                     flag_csum;
> > +       int                     flag_pause;
> > +       int                     flag_wol;
> > +       bool                    rgmii_txc_delay;
> > +       bool                    rgmii_rxc_delay;
> > +       int                     link;
> > +       void                    *hw_baseaddr_v;
> > +       uint64_t                hw_baseaddr_p;
> > +       void                    *bd_addr_v;
> > +       uint64_t                bd_addr_p;
> > +       uint64_t                bd_addr_p_r[ENETFEC_MAX_Q];
> > +       uint64_t                bd_addr_p_t[ENETFEC_MAX_Q];
> > +       void                    *dma_baseaddr_r[ENETFEC_MAX_Q];
> > +       void                    *dma_baseaddr_t[ENETFEC_MAX_Q];
> > +       uint64_t                cbus_size;
> > +       unsigned int            reg_size;
> > +       unsigned int            bd_size;
> > +       int                     hw_ts_rx_en;
> > +       int                     hw_ts_tx_en;
> > +       struct enetfec_priv_rx_q *rx_queues[ENETFEC_MAX_Q];
> > +       struct enetfec_priv_tx_q *tx_queues[ENETFEC_MAX_Q];
> > +};
> > +
> > +#define writel(v, p) ({*(volatile unsigned int *)(p) = (v); })
> > +#define readl(p) rte_read32(p)
> > +
> > +static inline struct
> > +bufdesc *enet_get_nextdesc(struct bufdesc *bdp, struct bufdesc_prop *bd)
> > +{
> > +       return (bdp >= bd->last) ? bd->base
> > +                       : (struct bufdesc *)(((void *)bdp) + bd->d_size);
> > +}
> > +
> > +static inline struct
> > +bufdesc *enet_get_prevdesc(struct bufdesc *bdp, struct bufdesc_prop *bd)
> > +{
> > +       return (bdp <= bd->base) ? bd->last
> > +                       : (struct bufdesc *)(((void *)bdp) - bd->d_size);
> > +}
> > +
> > +static inline int
> > +enet_get_bd_index(struct bufdesc *bdp, struct bufdesc_prop *bd)
> > +{
> > +       return ((const char *)bdp - (const char *)bd->base) >> bd->d_size_log2;
> > +}
> > +
> > +static inline int
> > +fls64(unsigned long word)
> > +{
> > +       return (64 - __builtin_clzl(word)) - 1;
> > +}
> > +
> > +uint16_t enetfec_recv_pkts(void *rxq1, __rte_unused struct rte_mbuf
> **rx_pkts,
> > +               uint16_t nb_pkts);
> > +uint16_t enetfec_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
> > +               uint16_t nb_pkts);
> > +struct bufdesc *enet_get_nextdesc(struct bufdesc *bdp,
> > +               struct bufdesc_prop *bd);
> > +int enet_new_rxbdp(struct enetfec_private *fep, struct bufdesc *bdp,
> > +               struct rte_mbuf *mbuf);
> > +
> > +#endif /*__ENETFEC_ETHDEV_H__*/
> > diff --git a/drivers/net/enetfec/enet_pmd_logs.h
> b/drivers/net/enetfec/enet_pmd_logs.h
> > new file mode 100644
> > index 0000000000..e7b3964a0e
> > --- /dev/null
> > +++ b/drivers/net/enetfec/enet_pmd_logs.h
> > @@ -0,0 +1,31 @@
> > +/* SPDX-License-Identifier: BSD-3-Clause
> > + * Copyright 2020-2021 NXP
> > + */
> > +
> > +#ifndef _ENETFEC_LOGS_H_
> > +#define _ENETFEC_LOGS_H_
> > +
> > +extern int enetfec_logtype_pmd;
> > +
> > +/* PMD related logs */
> > +#define ENETFEC_PMD_LOG(level, fmt, args...) \
> > +       rte_log(RTE_LOG_ ## level, enetfec_logtype_pmd, "\nfec_net: %s()" \
> > +               fmt "\n", __func__, ##args)
> > +
> > +#define PMD_INIT_FUNC_TRACE() ENET_PMD_LOG(DEBUG, " >>")
> > +
> > +#define ENETFEC_PMD_DEBUG(fmt, args...) \
> > +       ENETFEC_PMD_LOG(DEBUG, fmt, ## args)
> > +#define ENETFEC_PMD_ERR(fmt, args...) \
> > +       ENETFEC_PMD_LOG(ERR, fmt, ## args)
> > +#define ENETFEC_PMD_INFO(fmt, args...) \
> > +       ENETFEC_PMD_LOG(INFO, fmt, ## args)
> > +
> > +#define ENETFEC_PMD_WARN(fmt, args...) \
> > +       ENETFEC_PMD_LOG(WARNING, fmt, ## args)
> > +
> > +/* DP Logs, toggled out at compile time if level lower than current level */
> > +#define ENETFEC_DP_LOG(level, fmt, args...) \
> > +       RTE_LOG_DP(level, PMD, fmt, ## args)
> > +
> > +#endif /* _ENETFEC_LOGS_H_ */
> > diff --git a/drivers/net/enetfec/meson.build
> b/drivers/net/enetfec/meson.build
> > new file mode 100644
> > index 0000000000..252bf83309
> > --- /dev/null
> > +++ b/drivers/net/enetfec/meson.build
> > @@ -0,0 +1,15 @@
> > +# SPDX-License-Identifier: BSD-3-Clause
> > +# Copyright 2021 NXP
> > +
> > +if not is_linux
> > +       build = false
> > +       reason = 'only supported on linux'
> 
> The doc specifies that only armv8 is supported.
> 
> 
> > +endif
> > +
> > +deps += ['common_dpaax']
> > +
> > +sources = files('enet_ethdev.c')
> > +
> > +if cc.has_argument('-Wno-pointer-arith')
> > +       cflags += '-Wno-pointer-arith'
> > +endif
> 
> Can't this be fixed in the code rather than ignored?
> 
> 
> > diff --git a/drivers/net/enetfec/version.map
> b/drivers/net/enetfec/version.map
> > new file mode 100644
> > index 0000000000..170c04fe53
> > --- /dev/null
> > +++ b/drivers/net/enetfec/version.map
> > @@ -0,0 +1,3 @@
> > +DPDK_20.0 {
> 
> Wrong ABI version.
> 
> 
> > +        local: *;
> > +};
> > diff --git a/drivers/net/meson.build b/drivers/net/meson.build
> > index bcf488f203..92f433d5e8 100644
> > --- a/drivers/net/meson.build
> > +++ b/drivers/net/meson.build
> > @@ -19,6 +19,7 @@ drivers = [
> >          'e1000',
> >          'ena',
> >          'enetc',
> > +       'enetfec',
> 
> Indent.
> 
> 
> >          'enic',
> >          'failsafe',
> >          'fm10k',
> > --
> > 2.17.1
> >
> 
> --
> David Marchand


^ permalink raw reply	[relevance 0%]

* Re: [dpdk-dev] [PATCH v1 1/6] build: increase default of max lcores to 512
  @ 2021-09-10  8:06  3%         ` David Marchand
  2021-09-10  8:24  0%           ` Thomas Monjalon
  0 siblings, 1 reply; 200+ results
From: David Marchand @ 2021-09-10  8:06 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: David Hunt, dev, Thomas Monjalon

On Fri, Sep 10, 2021 at 9:54 AM Bruce Richardson
<bruce.richardson@intel.com> wrote:
>
> On Fri, Sep 10, 2021 at 08:51:04AM +0200, David Marchand wrote:
> > On Thu, Sep 9, 2021 at 4:38 PM Bruce Richardson
> > <bruce.richardson@intel.com> wrote:
> > >
> > > On Thu, Sep 09, 2021 at 02:45:06PM +0100, David Hunt wrote:
> > > > Modern processors are coming with an ever increasing number of cores,
> > > > and 128 does not seem like a sensible max limit any more, especially
> > > > when you consider multi-socket systems with Hyper-Threading enabled.
> > > >
> > > > This patch increases max_lcores default from 128 to 512.
> > > >
> > > > Signed-off-by: David Hunt <david.hunt@intel.com>
> >
> > Why should we need this?
> >
> > --lcores makes it possible to pin 128 lcores to any physical core on
> > your system.
> > And for applications that have their own thread management, they can
> > pin thread, then use rte_thread_register.
> >
> > Do you have applications that require more than 128 lcores?
> >
> The trouble is that using the --lcores syntax for mapping high core numbers
> to low lcore ids is much more awkward to use. Every case of DPDK use I've
> seen uses -c with a coremask, or -l with just giving a few core numbers on
> it. This simple scheme won't work with core numbers greater than 128, and
> there are already systems available with more than that number of cores.
>
> Apart from the memory footprint issues - which this patch is already making
> a good start in addressing, why would we not increase the default
> max_lcores to that seen on real systems?

The memory footprint is a major issue to me, and reserving all those
lcores won't be needed in any system.
We will also have to decide on a "640k ought to be enough" value to
avoid ABI issue with the next processor that comes out and has more
than 512 cores.

Could we wire the -c / -l options to --lcores behavior ?
It breaks the 1:1 lcore/physical core assumption, but it solves your
usability issue.


-- 
David Marchand


^ permalink raw reply	[relevance 3%]

* Re: [dpdk-dev] [PATCH v1 1/6] build: increase default of max lcores to 512
  2021-09-10  8:06  3%         ` David Marchand
@ 2021-09-10  8:24  0%           ` Thomas Monjalon
  2021-09-14  9:34  0%             ` David Hunt
  0 siblings, 1 reply; 200+ results
From: Thomas Monjalon @ 2021-09-10  8:24 UTC (permalink / raw)
  To: Bruce Richardson, David Hunt, David Marchand; +Cc: dev

10/09/2021 10:06, David Marchand:
> On Fri, Sep 10, 2021 at 9:54 AM Bruce Richardson
> <bruce.richardson@intel.com> wrote:
> >
> > On Fri, Sep 10, 2021 at 08:51:04AM +0200, David Marchand wrote:
> > > On Thu, Sep 9, 2021 at 4:38 PM Bruce Richardson
> > > <bruce.richardson@intel.com> wrote:
> > > >
> > > > On Thu, Sep 09, 2021 at 02:45:06PM +0100, David Hunt wrote:
> > > > > Modern processors are coming with an ever increasing number of cores,
> > > > > and 128 does not seem like a sensible max limit any more, especially
> > > > > when you consider multi-socket systems with Hyper-Threading enabled.
> > > > >
> > > > > This patch increases max_lcores default from 128 to 512.
> > > > >
> > > > > Signed-off-by: David Hunt <david.hunt@intel.com>
> > >
> > > Why should we need this?
> > >
> > > --lcores makes it possible to pin 128 lcores to any physical core on
> > > your system.
> > > And for applications that have their own thread management, they can
> > > pin thread, then use rte_thread_register.
> > >
> > > Do you have applications that require more than 128 lcores?
> > >
> > The trouble is that using the --lcores syntax for mapping high core numbers
> > to low lcore ids is much more awkward to use. Every case of DPDK use I've
> > seen uses -c with a coremask, or -l with just giving a few core numbers on
> > it. This simple scheme won't work with core numbers greater than 128, and
> > there are already systems available with more than that number of cores.
> >
> > Apart from the memory footprint issues - which this patch is already making
> > a good start in addressing, why would we not increase the default
> > max_lcores to that seen on real systems?
> 
> The memory footprint is a major issue to me, and reserving all those
> lcores won't be needed in any system.
> We will also have to decide on a "640k ought to be enough" value to
> avoid ABI issue with the next processor that comes out and has more
> than 512 cores.
> 
> Could we wire the -c / -l options to --lcores behavior ?
> It breaks the 1:1 lcore/physical core assumption, but it solves your
> usability issue.

Why would we change existing options while we already have an option
(--lcores) which solves the issue above?
I think the only issue is to educate users.
Is there something to improve in the documentation?



^ permalink raw reply	[relevance 0%]

* [dpdk-dev] [PATCH v1 5/7] mem: promote extmem API's to stable
  2021-09-10 12:30  3% [dpdk-dev] [PATCH v1 1/7] eal: promote IPC API's to stable Anatoly Burakov
                   ` (2 preceding siblings ...)
  2021-09-10 12:30  3% ` [dpdk-dev] [PATCH v1 4/7] mem: promote memseg " Anatoly Burakov
@ 2021-09-10 12:30  3% ` Anatoly Burakov
  2021-09-10 15:56  0%   ` Kinsella, Ray
  2021-09-10 12:30  3% ` [dpdk-dev] [PATCH v1 6/7] mem: promote DMA mask " Anatoly Burakov
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 200+ results
From: Anatoly Burakov @ 2021-09-10 12:30 UTC (permalink / raw)
  To: dev, Ray Kinsella

As per ABI policy, move the formerly experimental API's to the stable
section.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 lib/eal/include/rte_memory.h | 16 ----------------
 lib/eal/version.map          | 10 ++++------
 2 files changed, 4 insertions(+), 22 deletions(-)

diff --git a/lib/eal/include/rte_memory.h b/lib/eal/include/rte_memory.h
index 4acb2a72a8..c68b9d5e62 100644
--- a/lib/eal/include/rte_memory.h
+++ b/lib/eal/include/rte_memory.h
@@ -403,9 +403,6 @@ rte_memseg_get_fd_offset_thread_unsafe(const struct rte_memseg *ms,
 		size_t *offset);
 
 /**
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice
- *
  * Register external memory chunk with DPDK.
  *
  * @note Using this API is mutually exclusive with ``rte_malloc`` family of
@@ -439,15 +436,11 @@ rte_memseg_get_fd_offset_thread_unsafe(const struct rte_memseg *ms,
  *     EEXIST - memory chunk is already registered
  *     ENOSPC - no more space in internal config to store a new memory chunk
  */
-__rte_experimental
 int
 rte_extmem_register(void *va_addr, size_t len, rte_iova_t iova_addrs[],
 		unsigned int n_pages, size_t page_sz);
 
 /**
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice
- *
  * Unregister external memory chunk with DPDK.
  *
  * @note Using this API is mutually exclusive with ``rte_malloc`` family of
@@ -470,14 +463,10 @@ rte_extmem_register(void *va_addr, size_t len, rte_iova_t iova_addrs[],
  *     EINVAL - one of the parameters was invalid
  *     ENOENT - memory chunk was not found
  */
-__rte_experimental
 int
 rte_extmem_unregister(void *va_addr, size_t len);
 
 /**
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice
- *
  * Attach to external memory chunk registered in another process.
  *
  * @note Using this API is mutually exclusive with ``rte_malloc`` family of
@@ -497,14 +486,10 @@ rte_extmem_unregister(void *va_addr, size_t len);
  *     EINVAL - one of the parameters was invalid
  *     ENOENT - memory chunk was not found
  */
-__rte_experimental
 int
 rte_extmem_attach(void *va_addr, size_t len);
 
 /**
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice
- *
  * Detach from external memory chunk registered in another process.
  *
  * @note Using this API is mutually exclusive with ``rte_malloc`` family of
@@ -524,7 +509,6 @@ rte_extmem_attach(void *va_addr, size_t len);
  *     EINVAL - one of the parameters was invalid
  *     ENOENT - memory chunk was not found
  */
-__rte_experimental
 int
 rte_extmem_detach(void *va_addr, size_t len);
 
diff --git a/lib/eal/version.map b/lib/eal/version.map
index 359b784c16..420779e1aa 100644
--- a/lib/eal/version.map
+++ b/lib/eal/version.map
@@ -70,6 +70,10 @@ DPDK_22 {
 	rte_epoll_ctl;
 	rte_epoll_wait;
 	rte_exit;
+	rte_extmem_attach;
+	rte_extmem_detach;
+	rte_extmem_register;
+	rte_extmem_unregister;
 	rte_fbarray_attach;
 	rte_fbarray_destroy;
 	rte_fbarray_detach;
@@ -307,12 +311,6 @@ EXPERIMENTAL {
 	rte_mem_check_dma_mask_thread_unsafe;
 	rte_mem_set_dma_mask;
 
-	# added in 19.02
-	rte_extmem_attach;
-	rte_extmem_detach;
-	rte_extmem_register;
-	rte_extmem_unregister;
-
 	# added in 19.05
 	rte_dev_dma_map;
 	rte_dev_dma_unmap;
-- 
2.25.1


^ permalink raw reply	[relevance 3%]

* [dpdk-dev] [PATCH v1 1/7] eal: promote IPC API's to stable
@ 2021-09-10 12:30  3% Anatoly Burakov
  2021-09-10 12:30  2% ` [dpdk-dev] [PATCH v1 2/7] fbarray: promote " Anatoly Burakov
                   ` (6 more replies)
  0 siblings, 7 replies; 200+ results
From: Anatoly Burakov @ 2021-09-10 12:30 UTC (permalink / raw)
  To: dev, Ray Kinsella

As per ABI policy, move the formerly experimental API's to the stable
section.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 lib/eal/include/rte_eal.h | 24 ------------------------
 lib/eal/version.map       | 14 ++++++--------
 2 files changed, 6 insertions(+), 32 deletions(-)

diff --git a/lib/eal/include/rte_eal.h b/lib/eal/include/rte_eal.h
index eaf6469e50..f1af86bfff 100644
--- a/lib/eal/include/rte_eal.h
+++ b/lib/eal/include/rte_eal.h
@@ -209,9 +209,6 @@ typedef int (*rte_mp_async_reply_t)(const struct rte_mp_msg *request,
 		const struct rte_mp_reply *reply);
 
 /**
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice
- *
  * Register an action function for primary/secondary communication.
  *
  * Call this function to register an action, if the calling component wants
@@ -231,14 +228,10 @@ typedef int (*rte_mp_async_reply_t)(const struct rte_mp_msg *request,
  *  - 0 on success.
  *  - (<0) on failure.
  */
-__rte_experimental
 int
 rte_mp_action_register(const char *name, rte_mp_t action);
 
 /**
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice
- *
  * Unregister an action function for primary/secondary communication.
  *
  * Call this function to unregister an action  if the calling component does
@@ -252,14 +245,10 @@ rte_mp_action_register(const char *name, rte_mp_t action);
  *   The name argument plays as the nonredundant key to find the action.
  *
  */
-__rte_experimental
 void
 rte_mp_action_unregister(const char *name);
 
 /**
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice
- *
  * Send a message to the peer process.
  *
  * This function will send a message which will be responded by the action
@@ -272,14 +261,10 @@ rte_mp_action_unregister(const char *name);
  *  - On success, return 0.
  *  - On failure, return -1, and the reason will be stored in rte_errno.
  */
-__rte_experimental
 int
 rte_mp_sendmsg(struct rte_mp_msg *msg);
 
 /**
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice
- *
  * Send a request to the peer process and expect a reply.
  *
  * This function sends a request message to the peer process, and will
@@ -307,15 +292,11 @@ rte_mp_sendmsg(struct rte_mp_msg *msg);
  *  - On success, return 0.
  *  - On failure, return -1, and the reason will be stored in rte_errno.
  */
-__rte_experimental
 int
 rte_mp_request_sync(struct rte_mp_msg *req, struct rte_mp_reply *reply,
 	       const struct timespec *ts);
 
 /**
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice
- *
  * Send a request to the peer process and expect a reply in a separate callback.
  *
  * This function sends a request message to the peer process, and will not
@@ -337,15 +318,11 @@ rte_mp_request_sync(struct rte_mp_msg *req, struct rte_mp_reply *reply,
  *  - On success, return 0.
  *  - On failure, return -1, and the reason will be stored in rte_errno.
  */
-__rte_experimental
 int
 rte_mp_request_async(struct rte_mp_msg *req, const struct timespec *ts,
 		rte_mp_async_reply_t clb);
 
 /**
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice
- *
  * Send a reply to the peer process.
  *
  * This function will send a reply message in response to a request message
@@ -366,7 +343,6 @@ rte_mp_request_async(struct rte_mp_msg *req, const struct timespec *ts,
  *  - On success, return 0.
  *  - On failure, return -1, and the reason will be stored in rte_errno.
  */
-__rte_experimental
 int
 rte_mp_reply(struct rte_mp_msg *msg, const char *peer);
 
diff --git a/lib/eal/version.map b/lib/eal/version.map
index beeb986adc..c6e78d68d1 100644
--- a/lib/eal/version.map
+++ b/lib/eal/version.map
@@ -146,6 +146,12 @@ DPDK_22 {
 	rte_memzone_reserve_aligned;
 	rte_memzone_reserve_bounded;
 	rte_memzone_walk;
+	rte_mp_action_register;
+	rte_mp_action_unregister;
+	rte_mp_reply;
+	rte_mp_request_async;
+	rte_mp_request_sync;
+	rte_mp_sendmsg;
 	rte_openlog_stream;
 	rte_rand;
 	rte_realloc;
@@ -224,12 +230,6 @@ DPDK_22 {
 EXPERIMENTAL {
 	global:
 
-	# added in 18.02
-	rte_mp_action_register;
-	rte_mp_action_unregister;
-	rte_mp_reply;
-	rte_mp_sendmsg;
-
 	# added in 18.05
 	rte_dev_event_callback_register;
 	rte_dev_event_callback_unregister;
@@ -264,8 +264,6 @@ EXPERIMENTAL {
 	rte_memseg_contig_walk;
 	rte_memseg_list_walk;
 	rte_memseg_walk;
-	rte_mp_request_async;
-	rte_mp_request_sync;
 
 	# added in 18.08
 	rte_class_find;
-- 
2.25.1


^ permalink raw reply	[relevance 3%]

* [dpdk-dev] [PATCH v1 7/7] eal: promote mcfg API's to stable
  2021-09-10 12:30  3% [dpdk-dev] [PATCH v1 1/7] eal: promote IPC API's to stable Anatoly Burakov
                   ` (4 preceding siblings ...)
  2021-09-10 12:30  3% ` [dpdk-dev] [PATCH v1 6/7] mem: promote DMA mask " Anatoly Burakov
@ 2021-09-10 12:30  3% ` Anatoly Burakov
  2021-09-10 16:23  0%   ` Kinsella, Ray
  2021-09-10 15:51  0% ` [dpdk-dev] [PATCH v1 1/7] eal: promote IPC " Kinsella, Ray
  6 siblings, 1 reply; 200+ results
From: Anatoly Burakov @ 2021-09-10 12:30 UTC (permalink / raw)
  To: dev, Ray Kinsella

As per ABI policy, move the formerly experimental API's to the stable
section.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 lib/eal/include/rte_eal_memconfig.h | 12 ------------
 lib/eal/version.map                 |  8 +++-----
 2 files changed, 3 insertions(+), 17 deletions(-)

diff --git a/lib/eal/include/rte_eal_memconfig.h b/lib/eal/include/rte_eal_memconfig.h
index dede2ee324..44f5324906 100644
--- a/lib/eal/include/rte_eal_memconfig.h
+++ b/lib/eal/include/rte_eal_memconfig.h
@@ -92,33 +92,21 @@ void
 rte_mcfg_mempool_write_unlock(void);
 
 /**
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice
- *
  * Lock the internal EAL Timer Library lock for exclusive access.
  */
-__rte_experimental
 void
 rte_mcfg_timer_lock(void);
 
 /**
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice
- *
  * Unlock the internal EAL Timer Library lock for exclusive access.
  */
-__rte_experimental
 void
 rte_mcfg_timer_unlock(void);
 
 /**
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice
- *
  * If true, pages are put in single files (per memseg list),
  * as opposed to creating a file per page.
  */
-__rte_experimental
 bool
 rte_mcfg_get_single_file_segments(void);
 
diff --git a/lib/eal/version.map b/lib/eal/version.map
index ebafb05e90..ec05d1164b 100644
--- a/lib/eal/version.map
+++ b/lib/eal/version.map
@@ -160,6 +160,7 @@ DPDK_22 {
 	rte_malloc_socket;
 	rte_malloc_validate;
 	rte_malloc_virt2iova;
+	rte_mcfg_get_single_file_segments;
 	rte_mcfg_mem_read_lock;
 	rte_mcfg_mem_read_unlock;
 	rte_mcfg_mem_write_lock;
@@ -172,6 +173,8 @@ DPDK_22 {
 	rte_mcfg_tailq_read_unlock;
 	rte_mcfg_tailq_write_lock;
 	rte_mcfg_tailq_write_unlock;
+	rte_mcfg_timer_lock;
+	rte_mcfg_timer_unlock;
 	rte_mem_alloc_validator_register;
 	rte_mem_alloc_validator_unregister;
 	rte_mem_check_dma_mask;
@@ -320,13 +323,8 @@ EXPERIMENTAL {
 	rte_intr_ack;
 	rte_lcore_cpuset;
 	rte_lcore_to_cpu_id;
-	rte_mcfg_timer_lock;
-	rte_mcfg_timer_unlock;
 	rte_rand_max; # WINDOWS_NO_EXPORT
 
-	# added in 19.11
-	rte_mcfg_get_single_file_segments;
-
 	# added in 20.02
 	rte_thread_is_intr;
 
-- 
2.25.1


^ permalink raw reply	[relevance 3%]

* [dpdk-dev] [PATCH v1 6/7] mem: promote DMA mask API's to stable
  2021-09-10 12:30  3% [dpdk-dev] [PATCH v1 1/7] eal: promote IPC API's to stable Anatoly Burakov
                   ` (3 preceding siblings ...)
  2021-09-10 12:30  3% ` [dpdk-dev] [PATCH v1 5/7] mem: promote extmem " Anatoly Burakov
@ 2021-09-10 12:30  3% ` Anatoly Burakov
  2021-09-10 15:56  0%   ` Kinsella, Ray
  2021-09-10 12:30  3% ` [dpdk-dev] [PATCH v1 7/7] eal: promote mcfg " Anatoly Burakov
  2021-09-10 15:51  0% ` [dpdk-dev] [PATCH v1 1/7] eal: promote IPC " Kinsella, Ray
  6 siblings, 1 reply; 200+ results
From: Anatoly Burakov @ 2021-09-10 12:30 UTC (permalink / raw)
  To: dev, Ray Kinsella

As per ABI policy, move the formerly experimental API's to the stable
section.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 lib/eal/include/rte_memory.h | 12 ------------
 lib/eal/version.map          |  6 +++---
 2 files changed, 3 insertions(+), 15 deletions(-)

diff --git a/lib/eal/include/rte_memory.h b/lib/eal/include/rte_memory.h
index c68b9d5e62..6d018629ae 100644
--- a/lib/eal/include/rte_memory.h
+++ b/lib/eal/include/rte_memory.h
@@ -553,22 +553,15 @@ unsigned rte_memory_get_nchannel(void);
 unsigned rte_memory_get_nrank(void);
 
 /**
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice
- *
  * Check if all currently allocated memory segments are compliant with
  * supplied DMA address width.
  *
  *  @param maskbits
  *    Address width to check against.
  */
-__rte_experimental
 int rte_mem_check_dma_mask(uint8_t maskbits);
 
 /**
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice
- *
  * Check if all currently allocated memory segments are compliant with
  * supplied DMA address width. This function will use
  * rte_memseg_walk_thread_unsafe instead of rte_memseg_walk implying
@@ -581,18 +574,13 @@ int rte_mem_check_dma_mask(uint8_t maskbits);
  *  @param maskbits
  *    Address width to check against.
  */
-__rte_experimental
 int rte_mem_check_dma_mask_thread_unsafe(uint8_t maskbits);
 
 /**
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice
- *
  *  Set dma mask to use once memory initialization is done. Previous functions
  *  rte_mem_check_dma_mask and rte_mem_check_dma_mask_thread_unsafe can not be
  *  used safely until memory has been initialized.
  */
-__rte_experimental
 void rte_mem_set_dma_mask(uint8_t maskbits);
 
 /**
diff --git a/lib/eal/version.map b/lib/eal/version.map
index 420779e1aa..ebafb05e90 100644
--- a/lib/eal/version.map
+++ b/lib/eal/version.map
@@ -174,10 +174,13 @@ DPDK_22 {
 	rte_mcfg_tailq_write_unlock;
 	rte_mem_alloc_validator_register;
 	rte_mem_alloc_validator_unregister;
+	rte_mem_check_dma_mask;
+	rte_mem_check_dma_mask_thread_unsafe;
 	rte_mem_event_callback_register;
 	rte_mem_event_callback_unregister;
 	rte_mem_iova2virt;
 	rte_mem_lock_page;
+	rte_mem_set_dma_mask;
 	rte_mem_virt2iova;
 	rte_mem_virt2memseg;
 	rte_mem_virt2memseg_list;
@@ -293,7 +296,6 @@ EXPERIMENTAL {
 	rte_dev_event_monitor_start; # WINDOWS_NO_EXPORT
 	rte_dev_event_monitor_stop; # WINDOWS_NO_EXPORT
 	rte_log_register_type_and_pick_level;
-	rte_mem_check_dma_mask;
 
 	# added in 18.08
 	rte_class_find;
@@ -308,8 +310,6 @@ EXPERIMENTAL {
 	rte_dev_event_callback_process;
 	rte_dev_hotplug_handle_disable; # WINDOWS_NO_EXPORT
 	rte_dev_hotplug_handle_enable; # WINDOWS_NO_EXPORT
-	rte_mem_check_dma_mask_thread_unsafe;
-	rte_mem_set_dma_mask;
 
 	# added in 19.05
 	rte_dev_dma_map;
-- 
2.25.1


^ permalink raw reply	[relevance 3%]

* [dpdk-dev] [PATCH v1 2/7] fbarray: promote API's to stable
  2021-09-10 12:30  3% [dpdk-dev] [PATCH v1 1/7] eal: promote IPC API's to stable Anatoly Burakov
@ 2021-09-10 12:30  2% ` Anatoly Burakov
  2021-09-10 15:52  0%   ` Kinsella, Ray
  2021-09-10 12:30  3% ` [dpdk-dev] [PATCH v1 3/7] eal: promote malloc " Anatoly Burakov
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 200+ results
From: Anatoly Burakov @ 2021-09-10 12:30 UTC (permalink / raw)
  To: dev, Ray Kinsella

As per ABI policy, move the formerly experimental API's to the stable
section.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 lib/eal/include/rte_fbarray.h | 26 ------------------
 lib/eal/version.map           | 52 +++++++++++++++++------------------
 2 files changed, 26 insertions(+), 52 deletions(-)

diff --git a/lib/eal/include/rte_fbarray.h b/lib/eal/include/rte_fbarray.h
index 6dccdbec98..c64868711e 100644
--- a/lib/eal/include/rte_fbarray.h
+++ b/lib/eal/include/rte_fbarray.h
@@ -74,7 +74,6 @@ struct rte_fbarray {
  *  - 0 on success.
  *  - -1 on failure, with ``rte_errno`` indicating reason for failure.
  */
-__rte_experimental
 int
 rte_fbarray_init(struct rte_fbarray *arr, const char *name, unsigned int len,
 		unsigned int elt_sz);
@@ -97,7 +96,6 @@ rte_fbarray_init(struct rte_fbarray *arr, const char *name, unsigned int len,
  *  - 0 on success.
  *  - -1 on failure, with ``rte_errno`` indicating reason for failure.
  */
-__rte_experimental
 int
 rte_fbarray_attach(struct rte_fbarray *arr);
 
@@ -119,7 +117,6 @@ rte_fbarray_attach(struct rte_fbarray *arr);
  *  - 0 on success.
  *  - -1 on failure, with ``rte_errno`` indicating reason for failure.
  */
-__rte_experimental
 int
 rte_fbarray_destroy(struct rte_fbarray *arr);
 
@@ -138,7 +135,6 @@ rte_fbarray_destroy(struct rte_fbarray *arr);
  *  - 0 on success.
  *  - -1 on failure, with ``rte_errno`` indicating reason for failure.
  */
-__rte_experimental
 int
 rte_fbarray_detach(struct rte_fbarray *arr);
 
@@ -156,7 +152,6 @@ rte_fbarray_detach(struct rte_fbarray *arr);
  *  - non-NULL pointer on success.
  *  - NULL on failure, with ``rte_errno`` indicating reason for failure.
  */
-__rte_experimental
 void *
 rte_fbarray_get(const struct rte_fbarray *arr, unsigned int idx);
 
@@ -174,7 +169,6 @@ rte_fbarray_get(const struct rte_fbarray *arr, unsigned int idx);
  *  - non-negative integer on success.
  *  - -1 on failure, with ``rte_errno`` indicating reason for failure.
  */
-__rte_experimental
 int
 rte_fbarray_find_idx(const struct rte_fbarray *arr, const void *elt);
 
@@ -192,7 +186,6 @@ rte_fbarray_find_idx(const struct rte_fbarray *arr, const void *elt);
  *  - 0 on success.
  *  - -1 on failure, with ``rte_errno`` indicating reason for failure.
  */
-__rte_experimental
 int
 rte_fbarray_set_used(struct rte_fbarray *arr, unsigned int idx);
 
@@ -210,7 +203,6 @@ rte_fbarray_set_used(struct rte_fbarray *arr, unsigned int idx);
  *  - 0 on success.
  *  - -1 on failure, with ``rte_errno`` indicating reason for failure.
  */
-__rte_experimental
 int
 rte_fbarray_set_free(struct rte_fbarray *arr, unsigned int idx);
 
@@ -229,7 +221,6 @@ rte_fbarray_set_free(struct rte_fbarray *arr, unsigned int idx);
  *  - 0 if element is unused.
  *  - -1 on failure, with ``rte_errno`` indicating reason for failure.
  */
-__rte_experimental
 int
 rte_fbarray_is_used(struct rte_fbarray *arr, unsigned int idx);
 
@@ -247,7 +238,6 @@ rte_fbarray_is_used(struct rte_fbarray *arr, unsigned int idx);
  *  - non-negative integer on success.
  *  - -1 on failure, with ``rte_errno`` indicating reason for failure.
  */
-__rte_experimental
 int
 rte_fbarray_find_next_free(struct rte_fbarray *arr, unsigned int start);
 
@@ -265,7 +255,6 @@ rte_fbarray_find_next_free(struct rte_fbarray *arr, unsigned int start);
  *  - non-negative integer on success.
  *  - -1 on failure, with ``rte_errno`` indicating reason for failure.
  */
-__rte_experimental
 int
 rte_fbarray_find_next_used(struct rte_fbarray *arr, unsigned int start);
 
@@ -286,7 +275,6 @@ rte_fbarray_find_next_used(struct rte_fbarray *arr, unsigned int start);
  *  - non-negative integer on success.
  *  - -1 on failure, with ``rte_errno`` indicating reason for failure.
  */
-__rte_experimental
 int
 rte_fbarray_find_next_n_free(struct rte_fbarray *arr, unsigned int start,
 		unsigned int n);
@@ -308,7 +296,6 @@ rte_fbarray_find_next_n_free(struct rte_fbarray *arr, unsigned int start,
  *  - non-negative integer on success.
  *  - -1 on failure, with ``rte_errno`` indicating reason for failure.
  */
-__rte_experimental
 int
 rte_fbarray_find_next_n_used(struct rte_fbarray *arr, unsigned int start,
 		unsigned int n);
@@ -327,7 +314,6 @@ rte_fbarray_find_next_n_used(struct rte_fbarray *arr, unsigned int start,
  *  - non-negative integer on success.
  *  - -1 on failure, with ``rte_errno`` indicating reason for failure.
  */
-__rte_experimental
 int
 rte_fbarray_find_contig_free(struct rte_fbarray *arr,
 		unsigned int start);
@@ -346,7 +332,6 @@ rte_fbarray_find_contig_free(struct rte_fbarray *arr,
  *  - non-negative integer on success.
  *  - -1 on failure, with ``rte_errno`` indicating reason for failure.
  */
-__rte_experimental
 int
 rte_fbarray_find_contig_used(struct rte_fbarray *arr, unsigned int start);
 
@@ -363,7 +348,6 @@ rte_fbarray_find_contig_used(struct rte_fbarray *arr, unsigned int start);
  *  - non-negative integer on success.
  *  - -1 on failure, with ``rte_errno`` indicating reason for failure.
  */
-__rte_experimental
 int
 rte_fbarray_find_prev_free(struct rte_fbarray *arr, unsigned int start);
 
@@ -381,7 +365,6 @@ rte_fbarray_find_prev_free(struct rte_fbarray *arr, unsigned int start);
  *  - non-negative integer on success.
  *  - -1 on failure, with ``rte_errno`` indicating reason for failure.
  */
-__rte_experimental
 int
 rte_fbarray_find_prev_used(struct rte_fbarray *arr, unsigned int start);
 
@@ -403,7 +386,6 @@ rte_fbarray_find_prev_used(struct rte_fbarray *arr, unsigned int start);
  *  - non-negative integer on success.
  *  - -1 on failure, with ``rte_errno`` indicating reason for failure.
  */
-__rte_experimental
 int
 rte_fbarray_find_prev_n_free(struct rte_fbarray *arr, unsigned int start,
 		unsigned int n);
@@ -426,7 +408,6 @@ rte_fbarray_find_prev_n_free(struct rte_fbarray *arr, unsigned int start,
  *  - non-negative integer on success.
  *  - -1 on failure, with ``rte_errno`` indicating reason for failure.
  */
-__rte_experimental
 int
 rte_fbarray_find_prev_n_used(struct rte_fbarray *arr, unsigned int start,
 		unsigned int n);
@@ -446,7 +427,6 @@ rte_fbarray_find_prev_n_used(struct rte_fbarray *arr, unsigned int start,
  *  - non-negative integer on success.
  *  - -1 on failure, with ``rte_errno`` indicating reason for failure.
  */
-__rte_experimental
 int
 rte_fbarray_find_rev_contig_free(struct rte_fbarray *arr,
 		unsigned int start);
@@ -466,7 +446,6 @@ rte_fbarray_find_rev_contig_free(struct rte_fbarray *arr,
  *  - non-negative integer on success.
  *  - -1 on failure, with ``rte_errno`` indicating reason for failure.
  */
-__rte_experimental
 int
 rte_fbarray_find_rev_contig_used(struct rte_fbarray *arr, unsigned int start);
 
@@ -484,7 +463,6 @@ rte_fbarray_find_rev_contig_used(struct rte_fbarray *arr, unsigned int start);
  *  - non-negative integer on success.
  *  - -1 on failure, with ``rte_errno`` indicating reason for failure.
  */
-__rte_experimental
 int
 rte_fbarray_find_biggest_free(struct rte_fbarray *arr, unsigned int start);
 
@@ -502,7 +480,6 @@ rte_fbarray_find_biggest_free(struct rte_fbarray *arr, unsigned int start);
  *  - non-negative integer on success.
  *  - -1 on failure, with ``rte_errno`` indicating reason for failure.
  */
-__rte_experimental
 int
 rte_fbarray_find_biggest_used(struct rte_fbarray *arr, unsigned int start);
 
@@ -521,7 +498,6 @@ rte_fbarray_find_biggest_used(struct rte_fbarray *arr, unsigned int start);
  *  - non-negative integer on success.
  *  - -1 on failure, with ``rte_errno`` indicating reason for failure.
  */
-__rte_experimental
 int
 rte_fbarray_find_rev_biggest_free(struct rte_fbarray *arr, unsigned int start);
 
@@ -540,7 +516,6 @@ rte_fbarray_find_rev_biggest_free(struct rte_fbarray *arr, unsigned int start);
  *  - non-negative integer on success.
  *  - -1 on failure, with ``rte_errno`` indicating reason for failure.
  */
-__rte_experimental
 int
 rte_fbarray_find_rev_biggest_used(struct rte_fbarray *arr, unsigned int start);
 
@@ -554,7 +529,6 @@ rte_fbarray_find_rev_biggest_used(struct rte_fbarray *arr, unsigned int start);
  * @param f
  *   File object to dump information into.
  */
-__rte_experimental
 void
 rte_fbarray_dump_metadata(struct rte_fbarray *arr, FILE *f);
 
diff --git a/lib/eal/version.map b/lib/eal/version.map
index c6e78d68d1..d3b2b07a78 100644
--- a/lib/eal/version.map
+++ b/lib/eal/version.map
@@ -70,6 +70,32 @@ DPDK_22 {
 	rte_epoll_ctl;
 	rte_epoll_wait;
 	rte_exit;
+	rte_fbarray_attach;
+	rte_fbarray_destroy;
+	rte_fbarray_detach;
+	rte_fbarray_dump_metadata;
+	rte_fbarray_find_biggest_free;
+	rte_fbarray_find_biggest_used;
+	rte_fbarray_find_contig_free;
+	rte_fbarray_find_contig_used;
+	rte_fbarray_find_idx;
+	rte_fbarray_find_next_free;
+	rte_fbarray_find_next_n_free;
+	rte_fbarray_find_next_n_used;
+	rte_fbarray_find_next_used;
+	rte_fbarray_find_prev_free;
+	rte_fbarray_find_prev_n_free;
+	rte_fbarray_find_prev_n_used;
+	rte_fbarray_find_prev_used;
+	rte_fbarray_find_rev_contig_free;
+	rte_fbarray_find_rev_contig_used;
+	rte_fbarray_find_rev_biggest_free;
+	rte_fbarray_find_rev_biggest_used;
+	rte_fbarray_get;
+	rte_fbarray_init;
+	rte_fbarray_is_used;
+	rte_fbarray_set_free;
+	rte_fbarray_set_used;
 	rte_free;
 	rte_get_hpet_cycles; # WINDOWS_NO_EXPORT
 	rte_get_hpet_hz; # WINDOWS_NO_EXPORT
@@ -235,22 +261,6 @@ EXPERIMENTAL {
 	rte_dev_event_callback_unregister;
 	rte_dev_event_monitor_start; # WINDOWS_NO_EXPORT
 	rte_dev_event_monitor_stop; # WINDOWS_NO_EXPORT
-	rte_fbarray_attach;
-	rte_fbarray_destroy;
-	rte_fbarray_detach;
-	rte_fbarray_dump_metadata;
-	rte_fbarray_find_contig_free;
-	rte_fbarray_find_contig_used;
-	rte_fbarray_find_idx;
-	rte_fbarray_find_next_free;
-	rte_fbarray_find_next_n_free;
-	rte_fbarray_find_next_n_used;
-	rte_fbarray_find_next_used;
-	rte_fbarray_get;
-	rte_fbarray_init;
-	rte_fbarray_is_used;
-	rte_fbarray_set_free;
-	rte_fbarray_set_used;
 	rte_log_register_type_and_pick_level;
 	rte_malloc_dump_heaps;
 	rte_mem_alloc_validator_register;
@@ -272,12 +282,6 @@ EXPERIMENTAL {
 	rte_class_unregister;
 	rte_dev_iterator_init;
 	rte_dev_iterator_next;
-	rte_fbarray_find_prev_free;
-	rte_fbarray_find_prev_n_free;
-	rte_fbarray_find_prev_n_used;
-	rte_fbarray_find_prev_used;
-	rte_fbarray_find_rev_contig_free;
-	rte_fbarray_find_rev_contig_used;
 	rte_memseg_contig_walk_thread_unsafe;
 	rte_memseg_list_walk_thread_unsafe;
 	rte_memseg_walk_thread_unsafe;
@@ -311,10 +315,6 @@ EXPERIMENTAL {
 	# added in 19.05
 	rte_dev_dma_map;
 	rte_dev_dma_unmap;
-	rte_fbarray_find_biggest_free;
-	rte_fbarray_find_biggest_used;
-	rte_fbarray_find_rev_biggest_free;
-	rte_fbarray_find_rev_biggest_used;
 	rte_intr_callback_unregister_pending;
 	rte_realloc_socket;
 
-- 
2.25.1


^ permalink raw reply	[relevance 2%]

* [dpdk-dev] [PATCH v1 4/7] mem: promote memseg API's to stable
  2021-09-10 12:30  3% [dpdk-dev] [PATCH v1 1/7] eal: promote IPC API's to stable Anatoly Burakov
  2021-09-10 12:30  2% ` [dpdk-dev] [PATCH v1 2/7] fbarray: promote " Anatoly Burakov
  2021-09-10 12:30  3% ` [dpdk-dev] [PATCH v1 3/7] eal: promote malloc " Anatoly Burakov
@ 2021-09-10 12:30  3% ` Anatoly Burakov
  2021-09-10 15:55  0%   ` Kinsella, Ray
  2021-09-10 12:30  3% ` [dpdk-dev] [PATCH v1 5/7] mem: promote extmem " Anatoly Burakov
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 200+ results
From: Anatoly Burakov @ 2021-09-10 12:30 UTC (permalink / raw)
  To: dev, Ray Kinsella

As per ABI policy, move the formerly experimental API's to the stable
section.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 lib/eal/include/rte_memory.h | 17 -----------------
 lib/eal/version.map          | 34 +++++++++++++++++-----------------
 2 files changed, 17 insertions(+), 34 deletions(-)

diff --git a/lib/eal/include/rte_memory.h b/lib/eal/include/rte_memory.h
index bba9b5300a..4acb2a72a8 100644
--- a/lib/eal/include/rte_memory.h
+++ b/lib/eal/include/rte_memory.h
@@ -127,7 +127,6 @@ rte_iova_t rte_mem_virt2iova(const void *virt);
  *   Virtual address corresponding to iova address (or NULL if address does not
  *   exist within DPDK memory map).
  */
-__rte_experimental
 void *
 rte_mem_iova2virt(rte_iova_t iova);
 
@@ -142,7 +141,6 @@ rte_mem_iova2virt(rte_iova_t iova);
  * @return
  *   Memseg pointer on success, or NULL on error.
  */
-__rte_experimental
 struct rte_memseg *
 rte_mem_virt2memseg(const void *virt, const struct rte_memseg_list *msl);
 
@@ -154,7 +152,6 @@ rte_mem_virt2memseg(const void *virt, const struct rte_memseg_list *msl);
  * @return
  *   Memseg list to which this virtual address belongs to.
  */
-__rte_experimental
 struct rte_memseg_list *
 rte_mem_virt2memseg_list(const void *virt);
 
@@ -209,7 +206,6 @@ typedef int (*rte_memseg_list_walk_t)(const struct rte_memseg_list *msl,
  *   1 if stopped by the user
  *   -1 if user function reported error
  */
-__rte_experimental
 int
 rte_memseg_walk(rte_memseg_walk_t func, void *arg);
 
@@ -231,7 +227,6 @@ rte_memseg_walk(rte_memseg_walk_t func, void *arg);
  *   1 if stopped by the user
  *   -1 if user function reported error
  */
-__rte_experimental
 int
 rte_memseg_contig_walk(rte_memseg_contig_walk_t func, void *arg);
 
@@ -253,7 +248,6 @@ rte_memseg_contig_walk(rte_memseg_contig_walk_t func, void *arg);
  *   1 if stopped by the user
  *   -1 if user function reported error
  */
-__rte_experimental
 int
 rte_memseg_list_walk(rte_memseg_list_walk_t func, void *arg);
 
@@ -272,7 +266,6 @@ rte_memseg_list_walk(rte_memseg_list_walk_t func, void *arg);
  *   1 if stopped by the user
  *   -1 if user function reported error
  */
-__rte_experimental
 int
 rte_memseg_walk_thread_unsafe(rte_memseg_walk_t func, void *arg);
 
@@ -291,7 +284,6 @@ rte_memseg_walk_thread_unsafe(rte_memseg_walk_t func, void *arg);
  *   1 if stopped by the user
  *   -1 if user function reported error
  */
-__rte_experimental
 int
 rte_memseg_contig_walk_thread_unsafe(rte_memseg_contig_walk_t func, void *arg);
 
@@ -310,7 +302,6 @@ rte_memseg_contig_walk_thread_unsafe(rte_memseg_contig_walk_t func, void *arg);
  *   1 if stopped by the user
  *   -1 if user function reported error
  */
-__rte_experimental
 int
 rte_memseg_list_walk_thread_unsafe(rte_memseg_list_walk_t func, void *arg);
 
@@ -335,7 +326,6 @@ rte_memseg_list_walk_thread_unsafe(rte_memseg_list_walk_t func, void *arg);
  *     - ENOENT  - ``ms`` is an unused segment
  *     - ENOTSUP - segment fd's are not supported
  */
-__rte_experimental
 int
 rte_memseg_get_fd(const struct rte_memseg *ms);
 
@@ -360,7 +350,6 @@ rte_memseg_get_fd(const struct rte_memseg *ms);
  *     - ENOENT  - ``ms`` is an unused segment
  *     - ENOTSUP - segment fd's are not supported
  */
-__rte_experimental
 int
 rte_memseg_get_fd_thread_unsafe(const struct rte_memseg *ms);
 
@@ -385,7 +374,6 @@ rte_memseg_get_fd_thread_unsafe(const struct rte_memseg *ms);
  *     - ENOENT  - ``ms`` is an unused segment
  *     - ENOTSUP - segment fd's are not supported
  */
-__rte_experimental
 int
 rte_memseg_get_fd_offset(const struct rte_memseg *ms, size_t *offset);
 
@@ -410,7 +398,6 @@ rte_memseg_get_fd_offset(const struct rte_memseg *ms, size_t *offset);
  *     - ENOENT  - ``ms`` is an unused segment
  *     - ENOTSUP - segment fd's are not supported
  */
-__rte_experimental
 int
 rte_memseg_get_fd_offset_thread_unsafe(const struct rte_memseg *ms,
 		size_t *offset);
@@ -678,7 +665,6 @@ typedef void (*rte_mem_event_callback_t)(enum rte_mem_event event_type,
  *   -1 on unsuccessful callback register, with rte_errno value indicating
  *   reason for failure.
  */
-__rte_experimental
 int
 rte_mem_event_callback_register(const char *name, rte_mem_event_callback_t clb,
 		void *arg);
@@ -697,7 +683,6 @@ rte_mem_event_callback_register(const char *name, rte_mem_event_callback_t clb,
  *   -1 on unsuccessful callback unregister, with rte_errno value indicating
  *   reason for failure.
  */
-__rte_experimental
 int
 rte_mem_event_callback_unregister(const char *name, void *arg);
 
@@ -747,7 +732,6 @@ typedef int (*rte_mem_alloc_validator_t)(int socket_id,
  *   -1 on unsuccessful callback register, with rte_errno value indicating
  *   reason for failure.
  */
-__rte_experimental
 int
 rte_mem_alloc_validator_register(const char *name,
 		rte_mem_alloc_validator_t clb, int socket_id, size_t limit);
@@ -766,7 +750,6 @@ rte_mem_alloc_validator_register(const char *name,
  *   -1 on unsuccessful callback unregister, with rte_errno value indicating
  *   reason for failure.
  */
-__rte_experimental
 int
 rte_mem_alloc_validator_unregister(const char *name, int socket_id);
 
diff --git a/lib/eal/version.map b/lib/eal/version.map
index 6f768e66d0..359b784c16 100644
--- a/lib/eal/version.map
+++ b/lib/eal/version.map
@@ -168,12 +168,29 @@ DPDK_22 {
 	rte_mcfg_tailq_read_unlock;
 	rte_mcfg_tailq_write_lock;
 	rte_mcfg_tailq_write_unlock;
+	rte_mem_alloc_validator_register;
+	rte_mem_alloc_validator_unregister;
+	rte_mem_event_callback_register;
+	rte_mem_event_callback_unregister;
+	rte_mem_iova2virt;
 	rte_mem_lock_page;
 	rte_mem_virt2iova;
+	rte_mem_virt2memseg;
+	rte_mem_virt2memseg_list;
 	rte_mem_virt2phy;
 	rte_memdump;
 	rte_memory_get_nchannel;
 	rte_memory_get_nrank;
+	rte_memseg_contig_walk;
+	rte_memseg_contig_walk_thread_unsafe;
+	rte_memseg_get_fd;
+	rte_memseg_get_fd_offset;
+	rte_memseg_get_fd_offset_thread_unsafe;
+	rte_memseg_get_fd_thread_unsafe;
+	rte_memseg_list_walk;
+	rte_memseg_list_walk_thread_unsafe;
+	rte_memseg_walk;
+	rte_memseg_walk_thread_unsafe;
 	rte_memzone_dump;
 	rte_memzone_free;
 	rte_memzone_lookup;
@@ -272,17 +289,7 @@ EXPERIMENTAL {
 	rte_dev_event_monitor_start; # WINDOWS_NO_EXPORT
 	rte_dev_event_monitor_stop; # WINDOWS_NO_EXPORT
 	rte_log_register_type_and_pick_level;
-	rte_mem_alloc_validator_register;
-	rte_mem_alloc_validator_unregister;
 	rte_mem_check_dma_mask;
-	rte_mem_event_callback_register;
-	rte_mem_event_callback_unregister;
-	rte_mem_iova2virt;
-	rte_mem_virt2memseg;
-	rte_mem_virt2memseg_list;
-	rte_memseg_contig_walk;
-	rte_memseg_list_walk;
-	rte_memseg_walk;
 
 	# added in 18.08
 	rte_class_find;
@@ -291,9 +298,6 @@ EXPERIMENTAL {
 	rte_class_unregister;
 	rte_dev_iterator_init;
 	rte_dev_iterator_next;
-	rte_memseg_contig_walk_thread_unsafe;
-	rte_memseg_list_walk_thread_unsafe;
-	rte_memseg_walk_thread_unsafe;
 
 	# added in 18.11
 	rte_delay_us_sleep;
@@ -302,10 +306,6 @@ EXPERIMENTAL {
 	rte_dev_hotplug_handle_enable; # WINDOWS_NO_EXPORT
 	rte_mem_check_dma_mask_thread_unsafe;
 	rte_mem_set_dma_mask;
-	rte_memseg_get_fd;
-	rte_memseg_get_fd_offset;
-	rte_memseg_get_fd_offset_thread_unsafe;
-	rte_memseg_get_fd_thread_unsafe;
 
 	# added in 19.02
 	rte_extmem_attach;
-- 
2.25.1


^ permalink raw reply	[relevance 3%]

* [dpdk-dev] [PATCH v1 3/7] eal: promote malloc API's to stable
  2021-09-10 12:30  3% [dpdk-dev] [PATCH v1 1/7] eal: promote IPC API's to stable Anatoly Burakov
  2021-09-10 12:30  2% ` [dpdk-dev] [PATCH v1 2/7] fbarray: promote " Anatoly Burakov
@ 2021-09-10 12:30  3% ` Anatoly Burakov
  2021-09-10 15:53  0%   ` Kinsella, Ray
  2021-09-10 12:30  3% ` [dpdk-dev] [PATCH v1 4/7] mem: promote memseg " Anatoly Burakov
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 200+ results
From: Anatoly Burakov @ 2021-09-10 12:30 UTC (permalink / raw)
  To: dev, Ray Kinsella

As per ABI policy, move the formerly experimental API's to the stable
section.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 lib/eal/include/rte_malloc.h | 10 ----------
 lib/eal/version.map          | 20 ++++++++++----------
 2 files changed, 10 insertions(+), 20 deletions(-)

diff --git a/lib/eal/include/rte_malloc.h b/lib/eal/include/rte_malloc.h
index 895bb6e849..ed02e15119 100644
--- a/lib/eal/include/rte_malloc.h
+++ b/lib/eal/include/rte_malloc.h
@@ -157,7 +157,6 @@ rte_realloc(void *ptr, size_t size, unsigned int align)
  *     align is not a power of two).
  *   - Otherwise, the pointer to the reallocated memory.
  */
-__rte_experimental
 void *
 rte_realloc_socket(void *ptr, size_t size, unsigned int align, int socket)
 	__rte_alloc_size(2);
@@ -339,7 +338,6 @@ rte_malloc_get_socket_stats(int socket,
  *     EPERM  - attempted to add memory to a reserved heap
  *     ENOSPC - no more space in internal config to store a new memory chunk
  */
-__rte_experimental
 int
 rte_malloc_heap_memory_add(const char *heap_name, void *va_addr, size_t len,
 		rte_iova_t iova_addrs[], unsigned int n_pages, size_t page_sz);
@@ -371,7 +369,6 @@ rte_malloc_heap_memory_add(const char *heap_name, void *va_addr, size_t len,
  *     ENOENT - heap or memory chunk was not found
  *     EBUSY  - memory chunk still contains data
  */
-__rte_experimental
 int
 rte_malloc_heap_memory_remove(const char *heap_name, void *va_addr, size_t len);
 
@@ -396,7 +393,6 @@ rte_malloc_heap_memory_remove(const char *heap_name, void *va_addr, size_t len);
  *     EPERM  - attempted to attach memory to a reserved heap
  *     ENOENT - heap or memory chunk was not found
  */
-__rte_experimental
 int
 rte_malloc_heap_memory_attach(const char *heap_name, void *va_addr, size_t len);
 
@@ -421,7 +417,6 @@ rte_malloc_heap_memory_attach(const char *heap_name, void *va_addr, size_t len);
  *     EPERM  - attempted to detach memory from a reserved heap
  *     ENOENT - heap or memory chunk was not found
  */
-__rte_experimental
 int
 rte_malloc_heap_memory_detach(const char *heap_name, void *va_addr, size_t len);
 
@@ -441,7 +436,6 @@ rte_malloc_heap_memory_detach(const char *heap_name, void *va_addr, size_t len);
  *     EEXIST - heap by name of ``heap_name`` already exists
  *     ENOSPC - no more space in internal config to store a new heap
  */
-__rte_experimental
 int
 rte_malloc_heap_create(const char *heap_name);
 
@@ -465,7 +459,6 @@ rte_malloc_heap_create(const char *heap_name);
  *     EPERM  - attempting to destroy reserved heap
  *     EBUSY  - heap still contains data
  */
-__rte_experimental
 int
 rte_malloc_heap_destroy(const char *heap_name);
 
@@ -480,7 +473,6 @@ rte_malloc_heap_destroy(const char *heap_name);
  *     EINVAL - ``name`` was NULL
  *     ENOENT - heap identified by the name ``name`` was not found
  */
-__rte_experimental
 int
 rte_malloc_heap_get_socket(const char *name);
 
@@ -496,7 +488,6 @@ rte_malloc_heap_get_socket(const char *name);
  *   0 if socket ID refers to internal DPDK memory
  *   -1 if socket ID is invalid
  */
-__rte_experimental
 int
 rte_malloc_heap_socket_is_external(int socket_id);
 
@@ -527,7 +518,6 @@ rte_malloc_dump_stats(FILE *f, const char *type);
  * @param f
  *   A pointer to a file for output
  */
-__rte_experimental
 void
 rte_malloc_dump_heaps(FILE *f);
 
diff --git a/lib/eal/version.map b/lib/eal/version.map
index d3b2b07a78..6f768e66d0 100644
--- a/lib/eal/version.map
+++ b/lib/eal/version.map
@@ -141,8 +141,17 @@ DPDK_22 {
 	rte_log_set_level_pattern;
 	rte_log_set_level_regexp;
 	rte_malloc;
+	rte_malloc_dump_heaps;
 	rte_malloc_dump_stats;
 	rte_malloc_get_socket_stats;
+	rte_malloc_heap_create;
+	rte_malloc_heap_destroy;
+	rte_malloc_heap_get_socket;
+	rte_malloc_heap_memory_add;
+	rte_malloc_heap_memory_attach;
+	rte_malloc_heap_memory_detach;
+	rte_malloc_heap_memory_remove;
+	rte_malloc_heap_socket_is_external;
 	rte_malloc_set_limit;
 	rte_malloc_socket;
 	rte_malloc_validate;
@@ -181,6 +190,7 @@ DPDK_22 {
 	rte_openlog_stream;
 	rte_rand;
 	rte_realloc;
+	rte_realloc_socket;
 	rte_reciprocal_value;
 	rte_reciprocal_value_u64;
 	rte_rtm_supported;
@@ -262,7 +272,6 @@ EXPERIMENTAL {
 	rte_dev_event_monitor_start; # WINDOWS_NO_EXPORT
 	rte_dev_event_monitor_stop; # WINDOWS_NO_EXPORT
 	rte_log_register_type_and_pick_level;
-	rte_malloc_dump_heaps;
 	rte_mem_alloc_validator_register;
 	rte_mem_alloc_validator_unregister;
 	rte_mem_check_dma_mask;
@@ -291,14 +300,6 @@ EXPERIMENTAL {
 	rte_dev_event_callback_process;
 	rte_dev_hotplug_handle_disable; # WINDOWS_NO_EXPORT
 	rte_dev_hotplug_handle_enable; # WINDOWS_NO_EXPORT
-	rte_malloc_heap_create;
-	rte_malloc_heap_destroy;
-	rte_malloc_heap_get_socket;
-	rte_malloc_heap_memory_add;
-	rte_malloc_heap_memory_attach;
-	rte_malloc_heap_memory_detach;
-	rte_malloc_heap_memory_remove;
-	rte_malloc_heap_socket_is_external;
 	rte_mem_check_dma_mask_thread_unsafe;
 	rte_mem_set_dma_mask;
 	rte_memseg_get_fd;
@@ -316,7 +317,6 @@ EXPERIMENTAL {
 	rte_dev_dma_map;
 	rte_dev_dma_unmap;
 	rte_intr_callback_unregister_pending;
-	rte_realloc_socket;
 
 	# added in 19.08
 	rte_intr_ack;
-- 
2.25.1


^ permalink raw reply	[relevance 3%]

* [dpdk-dev] [RFC 1/3] ethdev: update modify field flow action
@ 2021-09-10 14:16  9% Viacheslav Ovsiienko
  0 siblings, 0 replies; 200+ results
From: Viacheslav Ovsiienko @ 2021-09-10 14:16 UTC (permalink / raw)
  To: dev; +Cc: orika

The generic modify field flow action introduced in [1] has
some issues related to the immediate source operand:

  - immediate source can be presented either as an unsigned
    64-bit integer or pointer to data pattern in memory.
    There was no explicit pointer field defined in the union

  - the byte ordering for 64-bit integer was not specified.
    Many fields have lesser lengths and byte ordering
    is crucial.

  - how the bit offset is applied to the immediate source
    field was not defined and documented

  - 64-bit integer size is not enough to provide MAC and
    IPv6 addresses

In order to cover the issues and exclude any ambiguities
the following is done:

  - introduce the explicit pointer field
    in rte_flow_action_modify_data structure

  - replace the 64-bit unsigned integer with 16-byte array

  - update the modify field flow action documentation

[1] commit 73b68f4c54a0 ("ethdev: introduce generic modify flow action")

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
 doc/guides/prog_guide/rte_flow.rst     |  8 ++++++++
 doc/guides/rel_notes/release_21_11.rst |  7 +++++++
 lib/ethdev/rte_flow.h                  | 15 ++++++++++++---
 3 files changed, 27 insertions(+), 3 deletions(-)

diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst
index 2b42d5ec8c..a54760a7b4 100644
--- a/doc/guides/prog_guide/rte_flow.rst
+++ b/doc/guides/prog_guide/rte_flow.rst
@@ -2835,6 +2835,14 @@ a packet to any other part of it.
 ``value`` sets an immediate value to be used as a source or points to a
 location of the value in memory. It is used instead of ``level`` and ``offset``
 for ``RTE_FLOW_FIELD_VALUE`` and ``RTE_FLOW_FIELD_POINTER`` respectively.
+The data in memory should be presented exactly in the same byte order and
+length as in the relevant flow item, i.e. data for field with type
+RTE_FLOW_FIELD_MAC_DST should follow the conventions of dst field
+in rte_flow_item_eth structure, with type RTE_FLOW_FIELD_IPV6_SRC -
+rte_flow_item_ipv6 conventions, and so on. The bitfield exatracted from the
+memory being applied as second operation parameter is defined by width and
+the destination field offset. If the field size is large than 16 bytes the
+pattern can be provided as pointer only.
 
 .. _table_rte_flow_action_modify_field:
 
diff --git a/doc/guides/rel_notes/release_21_11.rst b/doc/guides/rel_notes/release_21_11.rst
index d707a554ef..fdeba27e14 100644
--- a/doc/guides/rel_notes/release_21_11.rst
+++ b/doc/guides/rel_notes/release_21_11.rst
@@ -84,6 +84,10 @@ API Changes
    Also, make sure to start the actual text at the margin.
    =======================================================
 
+* ethdev: ``rte_flow_action_modify_data`` structure udpdated, immediate data
+  array is extended, data pointer field is explicitly added to union, the
+  action behavior is defined in more strict fashion and documentation uddated.
+
 
 ABI Changes
 -----------
@@ -101,6 +105,9 @@ ABI Changes
    =======================================================
 
 
+* ethdev: ``rte_flow_action_modify_data`` structure udpdated.
+
+
 Known Issues
 ------------
 
diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h
index 70f455d47d..50e6f34579 100644
--- a/lib/ethdev/rte_flow.h
+++ b/lib/ethdev/rte_flow.h
@@ -3204,6 +3204,9 @@ enum rte_flow_field_id {
 };
 
 /**
+ * @warning
+ * @b EXPERIMENTAL: this structure may change without prior notice
+ *
  * Field description for MODIFY_FIELD action.
  */
 struct rte_flow_action_modify_data {
@@ -3217,10 +3220,16 @@ struct rte_flow_action_modify_data {
 			uint32_t offset;
 		};
 		/**
-		 * Immediate value for RTE_FLOW_FIELD_VALUE or
-		 * memory address for RTE_FLOW_FIELD_POINTER.
+		 * Immediate value for RTE_FLOW_FIELD_VALUE, presented in the
+		 * same byte order and length as in relevant rte_flow_item_xxx.
 		 */
-		uint64_t value;
+		uint8_t value[16];
+		/*
+		 * Memory address for RTE_FLOW_FIELD_POINTER, memory layout
+		 * should be the same as for relevant field in the
+		 * rte_flow_item_xxx structure.
+		 */
+		void *pvalue;
 	};
 };
 
-- 
2.18.1


^ permalink raw reply	[relevance 9%]

* [dpdk-dev] Minutes of Technical Board Meeting, 2021-08-25
       [not found]     <DU2PR04MB8630C0339D3CFB3CDE952B1389D69@DU2PR04MB8630.eurprd04.prod.outlook.com>
@ 2021-09-10 14:25  4% ` Hemant Agrawal
  0 siblings, 0 replies; 200+ results
From: Hemant Agrawal @ 2021-09-10 14:25 UTC (permalink / raw)
  To: dev, techboard



Minutes of Technical Board Meeting, 2021-08-25



Members Attending: 11/12

- Aaron Conole

- Bruce Richardson

- Ferruh Yigit

- Hemant Agrawal (Chair)

- Honnappa Nagarahalli

- Jerin Jacob

- Kevin Traynor

- Maxime Coquelin

- Olivier Matz

- Stephen Hemminger

- Thomas Monjalon



NOTE: The Technical Board meetings take place every second Wednesday on  https://meet.jit.si/DPDK  at 3 pm UTC.

Meetings are public, and DPDK community members are welcome to attend.

Agenda and minutes can be found at https://annuel.framapad.org/p/r.0c3cc4d1e011214183872a98f6b5c7db

NOTE: Next meeting will be on Wednesday 2021-09-08 @3pm UTC, and will be chaired by Honnappa





#1 DPDK User list

                * Eco system user list required.

                * A survey may help in generating such list.

                * LF Marketing may also help in getting such list generated from public info.



#2 API/ABI breakage exception approval for vhost API

                - The policy is that one should not break the API/ABI even for LTS releases without previous notification. Exception can be approved for LTS.

              - In this particular case, they shall try to do function versioning. AI- Ferruh to send response.



#3 Documenting criteria on adding/removing members to technical board

    * Document needs further reviews, please review.

    * Will set a deadline for the document review in next meeting.

    * Need clear rules for the review of existing members membership.



#4 ORAN API License

    * ORAN forum is planning to use SCCL license in the API file. Will that be acceptable for DPDK integration?

    * Members need more details. Currently distros may not favor it as it may cause issue in source code distribution.

    * Need to discuss more if TB can send it for review by DPDK GB.


^ permalink raw reply	[relevance 4%]

* Re: [dpdk-dev] [PATCH v1 1/7] eal: promote IPC API's to stable
  2021-09-10 12:30  3% [dpdk-dev] [PATCH v1 1/7] eal: promote IPC API's to stable Anatoly Burakov
                   ` (5 preceding siblings ...)
  2021-09-10 12:30  3% ` [dpdk-dev] [PATCH v1 7/7] eal: promote mcfg " Anatoly Burakov
@ 2021-09-10 15:51  0% ` Kinsella, Ray
  6 siblings, 0 replies; 200+ results
From: Kinsella, Ray @ 2021-09-10 15:51 UTC (permalink / raw)
  To: Anatoly Burakov, dev



On 10/09/2021 13:30, Anatoly Burakov wrote:
> As per ABI policy, move the formerly experimental API's to the stable
> section.
> 
> Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
> ---
>  lib/eal/include/rte_eal.h | 24 ------------------------
>  lib/eal/version.map       | 14 ++++++--------
>  2 files changed, 6 insertions(+), 32 deletions(-)
> 
Acked-by: Ray Kinsella <mdr@ashroe.eu>

^ permalink raw reply	[relevance 0%]

* Re: [dpdk-dev] [PATCH v1 2/7] fbarray: promote API's to stable
  2021-09-10 12:30  2% ` [dpdk-dev] [PATCH v1 2/7] fbarray: promote " Anatoly Burakov
@ 2021-09-10 15:52  0%   ` Kinsella, Ray
  0 siblings, 0 replies; 200+ results
From: Kinsella, Ray @ 2021-09-10 15:52 UTC (permalink / raw)
  To: Anatoly Burakov, dev



On 10/09/2021 13:30, Anatoly Burakov wrote:
> As per ABI policy, move the formerly experimental API's to the stable
> section.
> 
> Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
> ---
>  lib/eal/include/rte_fbarray.h | 26 ------------------
>  lib/eal/version.map           | 52 +++++++++++++++++------------------
>  2 files changed, 26 insertions(+), 52 deletions(-)
> 
Acked-by: Ray Kinsella <mdr@ashroe.eu>

^ permalink raw reply	[relevance 0%]

* Re: [dpdk-dev] [PATCH v1 3/7] eal: promote malloc API's to stable
  2021-09-10 12:30  3% ` [dpdk-dev] [PATCH v1 3/7] eal: promote malloc " Anatoly Burakov
@ 2021-09-10 15:53  0%   ` Kinsella, Ray
  0 siblings, 0 replies; 200+ results
From: Kinsella, Ray @ 2021-09-10 15:53 UTC (permalink / raw)
  To: Anatoly Burakov, dev



On 10/09/2021 13:30, Anatoly Burakov wrote:
> As per ABI policy, move the formerly experimental API's to the stable
> section.
> 
> Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
> ---
>  lib/eal/include/rte_malloc.h | 10 ----------
>  lib/eal/version.map          | 20 ++++++++++----------
>  2 files changed, 10 insertions(+), 20 deletions(-)
> 
Acked-by: Ray Kinsella <mdr@ashroe.eu>

^ permalink raw reply	[relevance 0%]

* Re: [dpdk-dev] [PATCH v1 4/7] mem: promote memseg API's to stable
  2021-09-10 12:30  3% ` [dpdk-dev] [PATCH v1 4/7] mem: promote memseg " Anatoly Burakov
@ 2021-09-10 15:55  0%   ` Kinsella, Ray
  0 siblings, 0 replies; 200+ results
From: Kinsella, Ray @ 2021-09-10 15:55 UTC (permalink / raw)
  To: Anatoly Burakov, dev



On 10/09/2021 13:30, Anatoly Burakov wrote:
> As per ABI policy, move the formerly experimental API's to the stable
> section.
> 
> Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
> ---
>  lib/eal/include/rte_memory.h | 17 -----------------
>  lib/eal/version.map          | 34 +++++++++++++++++-----------------
>  2 files changed, 17 insertions(+), 34 deletions(-)
> 
Acked-by: Ray Kinsella <mdr@ashroe.eu>

^ permalink raw reply	[relevance 0%]

* Re: [dpdk-dev] [PATCH v1 5/7] mem: promote extmem API's to stable
  2021-09-10 12:30  3% ` [dpdk-dev] [PATCH v1 5/7] mem: promote extmem " Anatoly Burakov
@ 2021-09-10 15:56  0%   ` Kinsella, Ray
  0 siblings, 0 replies; 200+ results
From: Kinsella, Ray @ 2021-09-10 15:56 UTC (permalink / raw)
  To: Anatoly Burakov, dev



On 10/09/2021 13:30, Anatoly Burakov wrote:
> As per ABI policy, move the formerly experimental API's to the stable
> section.
> 

Acked-by: Ray Kinsella <mdr@ashroe.eu>

^ permalink raw reply	[relevance 0%]

* Re: [dpdk-dev] [PATCH v1 6/7] mem: promote DMA mask API's to stable
  2021-09-10 12:30  3% ` [dpdk-dev] [PATCH v1 6/7] mem: promote DMA mask " Anatoly Burakov
@ 2021-09-10 15:56  0%   ` Kinsella, Ray
  0 siblings, 0 replies; 200+ results
From: Kinsella, Ray @ 2021-09-10 15:56 UTC (permalink / raw)
  To: Anatoly Burakov, dev



On 10/09/2021 13:30, Anatoly Burakov wrote:
> As per ABI policy, move the formerly experimental API's to the stable
> section.
> 
> Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
> ---
>  lib/eal/include/rte_memory.h | 12 ------------
>  lib/eal/version.map          |  6 +++---
>  2 files changed, 3 insertions(+), 15 deletions(-)
> 
Acked-by: Ray Kinsella <mdr@ashroe.eu>

^ permalink raw reply	[relevance 0%]

* Re: [dpdk-dev] [PATCH v1 7/7] eal: promote mcfg API's to stable
  2021-09-10 12:30  3% ` [dpdk-dev] [PATCH v1 7/7] eal: promote mcfg " Anatoly Burakov
@ 2021-09-10 16:23  0%   ` Kinsella, Ray
  0 siblings, 0 replies; 200+ results
From: Kinsella, Ray @ 2021-09-10 16:23 UTC (permalink / raw)
  To: Anatoly Burakov, dev



On 10/09/2021 13:30, Anatoly Burakov wrote:
> As per ABI policy, move the formerly experimental API's to the stable
> section.
> 
> Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
> ---
>  lib/eal/include/rte_eal_memconfig.h | 12 ------------
>  lib/eal/version.map                 |  8 +++-----
>  2 files changed, 3 insertions(+), 17 deletions(-)
> 
Acked-by: Ray Kinsella <mdr@ashroe.eu>

^ permalink raw reply	[relevance 0%]

* [dpdk-dev] [PATCH v7 06/11] pdump: support pcapng and filtering
  @ 2021-09-10 18:18  1%   ` Stephen Hemminger
  2021-09-10 18:18  1%   ` [dpdk-dev] [PATCH v7 10/11] doc: changes for new pcapng and dumpcap Stephen Hemminger
  1 sibling, 0 replies; 200+ results
From: Stephen Hemminger @ 2021-09-10 18:18 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

This enhances the DPDK pdump library to support new
pcapng format and filtering via BPF.

The internal client/server protocol is changed to support
two versions: the original pdump basic version and a
new pcapng version.

The internal version number (not part of exposed API or ABI)
is intentionally increased to cause any attempt to try
mismatched primary/secondary process to fail.

Add new API to do allow filtering of captured packets with
DPDK BPF (eBPF) filter program. It keeps statistics
on packets captured, filtered, and missed (because ring was full).

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/meson.build       |   4 +-
 lib/pdump/meson.build |   2 +-
 lib/pdump/rte_pdump.c | 437 ++++++++++++++++++++++++++++++------------
 lib/pdump/rte_pdump.h | 110 ++++++++++-
 lib/pdump/version.map |   8 +
 5 files changed, 435 insertions(+), 126 deletions(-)

diff --git a/lib/meson.build b/lib/meson.build
index ba88e9eabc58..1da521ea6185 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -26,6 +26,7 @@ libraries = [
         'timer',   # eventdev depends on this
         'acl',
         'bbdev',
+        'bpf',
         'bitratestats',
         'cfgfile',
         'compressdev',
@@ -43,7 +44,6 @@ libraries = [
         'member',
         'pcapng',
         'power',
-        'pdump',
         'rawdev',
         'regexdev',
         'rib',
@@ -55,10 +55,10 @@ libraries = [
         'ipsec', # ipsec lib depends on net, crypto and security
         'fib', #fib lib depends on rib
         'port', # pkt framework libs which use other libs from above
+        'pdump', # pdump lib depends on bpf pcapng
         'table',
         'pipeline',
         'flow_classify', # flow_classify lib depends on pkt framework table lib
-        'bpf',
         'graph',
         'node',
 ]
diff --git a/lib/pdump/meson.build b/lib/pdump/meson.build
index 3a95eabde6a6..51ceb2afdec5 100644
--- a/lib/pdump/meson.build
+++ b/lib/pdump/meson.build
@@ -3,4 +3,4 @@
 
 sources = files('rte_pdump.c')
 headers = files('rte_pdump.h')
-deps += ['ethdev']
+deps += ['ethdev', 'bpf', 'pcapng']
diff --git a/lib/pdump/rte_pdump.c b/lib/pdump/rte_pdump.c
index 382217bc1564..f2047ad9f001 100644
--- a/lib/pdump/rte_pdump.c
+++ b/lib/pdump/rte_pdump.c
@@ -7,8 +7,10 @@
 #include <rte_ethdev.h>
 #include <rte_lcore.h>
 #include <rte_log.h>
+#include <rte_memzone.h>
 #include <rte_errno.h>
 #include <rte_string_fns.h>
+#include <rte_pcapng.h>
 
 #include "rte_pdump.h"
 
@@ -27,30 +29,26 @@ enum pdump_operation {
 	ENABLE = 2
 };
 
+/*
+ * Note: version numbers intentionally start at 3
+ * in order to catch any application built with older out
+ * version of DPDK using incompatible client request format.
+ */
 enum pdump_version {
-	V1 = 1
+	PDUMP_CLIENT_LEGACY = 3,
+	PDUMP_CLIENT_PCAPNG = 4,
 };
 
 struct pdump_request {
 	uint16_t ver;
 	uint16_t op;
-	uint32_t flags;
-	union pdump_data {
-		struct enable_v1 {
-			char device[RTE_DEV_NAME_MAX_LEN];
-			uint16_t queue;
-			struct rte_ring *ring;
-			struct rte_mempool *mp;
-			void *filter;
-		} en_v1;
-		struct disable_v1 {
-			char device[RTE_DEV_NAME_MAX_LEN];
-			uint16_t queue;
-			struct rte_ring *ring;
-			struct rte_mempool *mp;
-			void *filter;
-		} dis_v1;
-	} data;
+	uint16_t flags;
+	uint16_t queue;
+	struct rte_ring *ring;
+	struct rte_mempool *mp;
+	const struct rte_bpf_prm *prm;
+	uint32_t snaplen;
+	char device[RTE_DEV_NAME_MAX_LEN];
 };
 
 struct pdump_response {
@@ -63,80 +61,140 @@ static struct pdump_rxtx_cbs {
 	struct rte_ring *ring;
 	struct rte_mempool *mp;
 	const struct rte_eth_rxtx_callback *cb;
-	void *filter;
+	const struct rte_bpf *filter;
+	enum pdump_version ver;
+	uint32_t snaplen;
 } rx_cbs[RTE_MAX_ETHPORTS][RTE_MAX_QUEUES_PER_PORT],
 tx_cbs[RTE_MAX_ETHPORTS][RTE_MAX_QUEUES_PER_PORT];
 
-
-static inline void
-pdump_copy(struct rte_mbuf **pkts, uint16_t nb_pkts, void *user_params)
+static const char *MZ_RTE_PDUMP_STATS = "rte_pdump_stats";
+
+/* Shared memory between primary and secondary processes. */
+static struct {
+	struct rte_pdump_stats rx[RTE_MAX_ETHPORTS][RTE_MAX_QUEUES_PER_PORT];
+	struct rte_pdump_stats tx[RTE_MAX_ETHPORTS][RTE_MAX_QUEUES_PER_PORT];
+} *pdump_stats;
+
+/* Create a clone of mbuf to be placed into ring. */
+static void
+pdump_copy(uint16_t port_id, uint16_t queue,
+	   enum rte_pcapng_direction direction,
+	   struct rte_mbuf **pkts, uint16_t nb_pkts,
+	   const struct pdump_rxtx_cbs *cbs,
+	   struct rte_pdump_stats *stats)
 {
 	unsigned int i;
 	int ring_enq;
 	uint16_t d_pkts = 0;
 	struct rte_mbuf *dup_bufs[nb_pkts];
-	struct pdump_rxtx_cbs *cbs;
+	uint64_t ts;
 	struct rte_ring *ring;
 	struct rte_mempool *mp;
 	struct rte_mbuf *p;
+	uint64_t rcs[nb_pkts];
+
+	if (cbs->filter &&
+	    rte_bpf_exec_burst(cbs->filter, (void **)pkts, rcs, nb_pkts) == 0) {
+		/* All packets were filtered out */
+		__atomic_fetch_add(&stats->filtered, nb_pkts,
+				   __ATOMIC_RELAXED);
+		return;
+	}
 
-	cbs  = user_params;
+	ts = rte_get_tsc_cycles();
 	ring = cbs->ring;
 	mp = cbs->mp;
 	for (i = 0; i < nb_pkts; i++) {
-		p = rte_pktmbuf_copy(pkts[i], mp, 0, UINT32_MAX);
-		if (p)
+		/*
+		 * Similar behavior to rte_bpf_eth callback.
+		 * if BPF program returns zero value for a given packet,
+		 * then it will be ignored.
+		 */
+		if (cbs->filter && rcs[i] == 0) {
+			__atomic_fetch_add(&stats->filtered,
+					   1, __ATOMIC_RELAXED);
+			continue;
+		}
+
+		/*
+		 * If using pcapng then want to wrap packets
+		 * otherwise a simple copy.
+		 */
+		if (cbs->ver == PDUMP_CLIENT_PCAPNG)
+			p = rte_pcapng_copy(port_id, queue,
+					    pkts[i], mp, cbs->snaplen,
+					    ts, direction);
+		else
+			p = rte_pktmbuf_copy(pkts[i], mp, 0, cbs->snaplen);
+
+		if (unlikely(p == NULL))
+			__atomic_fetch_add(&stats->nombuf, 1, __ATOMIC_RELAXED);
+		else
 			dup_bufs[d_pkts++] = p;
 	}
 
+	__atomic_fetch_add(&stats->accepted, d_pkts, __ATOMIC_RELAXED);
+
 	ring_enq = rte_ring_enqueue_burst(ring, (void *)dup_bufs, d_pkts, NULL);
 	if (unlikely(ring_enq < d_pkts)) {
 		unsigned int drops = d_pkts - ring_enq;
 
-		PDUMP_LOG(DEBUG,
-			"only %d of packets enqueued to ring\n", ring_enq);
+		__atomic_fetch_add(&stats->ringfull, drops, __ATOMIC_RELAXED);
 		rte_pktmbuf_free_bulk(&dup_bufs[ring_enq], drops);
 	}
 }
 
 static uint16_t
-pdump_rx(uint16_t port __rte_unused, uint16_t qidx __rte_unused,
+pdump_rx(uint16_t port, uint16_t queue,
 	struct rte_mbuf **pkts, uint16_t nb_pkts,
-	uint16_t max_pkts __rte_unused,
-	void *user_params)
+	uint16_t max_pkts __rte_unused, void *user_params)
 {
-	pdump_copy(pkts, nb_pkts, user_params);
+	const struct pdump_rxtx_cbs *cbs = user_params;
+	struct rte_pdump_stats *stats = &pdump_stats->rx[port][queue];
+
+	pdump_copy(port, queue, RTE_PCAPNG_DIRECTION_IN,
+		   pkts, nb_pkts, cbs, stats);
 	return nb_pkts;
 }
 
 static uint16_t
-pdump_tx(uint16_t port __rte_unused, uint16_t qidx __rte_unused,
+pdump_tx(uint16_t port, uint16_t queue,
 		struct rte_mbuf **pkts, uint16_t nb_pkts, void *user_params)
 {
-	pdump_copy(pkts, nb_pkts, user_params);
+	const struct pdump_rxtx_cbs *cbs = user_params;
+	struct rte_pdump_stats *stats = &pdump_stats->tx[port][queue];
+
+	pdump_copy(port, queue, RTE_PCAPNG_DIRECTION_OUT,
+		   pkts, nb_pkts, cbs, stats);
 	return nb_pkts;
 }
 
 static int
-pdump_register_rx_callbacks(uint16_t end_q, uint16_t port, uint16_t queue,
-				struct rte_ring *ring, struct rte_mempool *mp,
-				uint16_t operation)
+pdump_register_rx_callbacks(enum pdump_version ver,
+			    uint16_t end_q, uint16_t port, uint16_t queue,
+			    struct rte_ring *ring, struct rte_mempool *mp,
+			    struct rte_bpf *filter,
+			    uint16_t operation, uint32_t snaplen)
 {
 	uint16_t qid;
-	struct pdump_rxtx_cbs *cbs = NULL;
 
 	qid = (queue == RTE_PDUMP_ALL_QUEUES) ? 0 : queue;
 	for (; qid < end_q; qid++) {
-		cbs = &rx_cbs[port][qid];
-		if (cbs && operation == ENABLE) {
+		struct pdump_rxtx_cbs *cbs = &rx_cbs[port][qid];
+
+		if (operation == ENABLE) {
 			if (cbs->cb) {
 				PDUMP_LOG(ERR,
 					"rx callback for port=%d queue=%d, already exists\n",
 					port, qid);
 				return -EEXIST;
 			}
+			cbs->ver = ver;
 			cbs->ring = ring;
 			cbs->mp = mp;
+			cbs->snaplen = snaplen;
+			cbs->filter = filter;
+
 			cbs->cb = rte_eth_add_first_rx_callback(port, qid,
 								pdump_rx, cbs);
 			if (cbs->cb == NULL) {
@@ -145,8 +203,7 @@ pdump_register_rx_callbacks(uint16_t end_q, uint16_t port, uint16_t queue,
 					rte_errno);
 				return rte_errno;
 			}
-		}
-		if (cbs && operation == DISABLE) {
+		} else if (operation == DISABLE) {
 			int ret;
 
 			if (cbs->cb == NULL) {
@@ -170,26 +227,32 @@ pdump_register_rx_callbacks(uint16_t end_q, uint16_t port, uint16_t queue,
 }
 
 static int
-pdump_register_tx_callbacks(uint16_t end_q, uint16_t port, uint16_t queue,
-				struct rte_ring *ring, struct rte_mempool *mp,
-				uint16_t operation)
+pdump_register_tx_callbacks(enum pdump_version ver,
+			    uint16_t end_q, uint16_t port, uint16_t queue,
+			    struct rte_ring *ring, struct rte_mempool *mp,
+			    struct rte_bpf *filter,
+			    uint16_t operation, uint32_t snaplen)
 {
 
 	uint16_t qid;
-	struct pdump_rxtx_cbs *cbs = NULL;
 
 	qid = (queue == RTE_PDUMP_ALL_QUEUES) ? 0 : queue;
 	for (; qid < end_q; qid++) {
-		cbs = &tx_cbs[port][qid];
-		if (cbs && operation == ENABLE) {
+		struct pdump_rxtx_cbs *cbs = &tx_cbs[port][qid];
+
+		if (operation == ENABLE) {
 			if (cbs->cb) {
 				PDUMP_LOG(ERR,
 					"tx callback for port=%d queue=%d, already exists\n",
 					port, qid);
 				return -EEXIST;
 			}
+			cbs->ver = ver;
 			cbs->ring = ring;
 			cbs->mp = mp;
+			cbs->snaplen = snaplen;
+			cbs->filter = filter;
+
 			cbs->cb = rte_eth_add_tx_callback(port, qid, pdump_tx,
 								cbs);
 			if (cbs->cb == NULL) {
@@ -198,8 +261,7 @@ pdump_register_tx_callbacks(uint16_t end_q, uint16_t port, uint16_t queue,
 					rte_errno);
 				return rte_errno;
 			}
-		}
-		if (cbs && operation == DISABLE) {
+		} else if (operation == DISABLE) {
 			int ret;
 
 			if (cbs->cb == NULL) {
@@ -228,37 +290,47 @@ set_pdump_rxtx_cbs(const struct pdump_request *p)
 	uint16_t nb_rx_q = 0, nb_tx_q = 0, end_q, queue;
 	uint16_t port;
 	int ret = 0;
+	struct rte_bpf *filter = NULL;
 	uint32_t flags;
 	uint16_t operation;
 	struct rte_ring *ring;
 	struct rte_mempool *mp;
 
-	flags = p->flags;
-	operation = p->op;
-	if (operation == ENABLE) {
-		ret = rte_eth_dev_get_port_by_name(p->data.en_v1.device,
-				&port);
-		if (ret < 0) {
+	if (!(p->ver == PDUMP_CLIENT_LEGACY ||
+	      p->ver == PDUMP_CLIENT_PCAPNG)) {
+		PDUMP_LOG(ERR,
+			  "incorrect client version %u\n", p->ver);
+		return -EINVAL;
+	}
+
+	if (p->prm) {
+		if (p->prm->prog_arg.type != RTE_BPF_ARG_PTR_MBUF) {
 			PDUMP_LOG(ERR,
-				"failed to get port id for device id=%s\n",
-				p->data.en_v1.device);
+				  "invalid BPF program type: %u\n",
+				  p->prm->prog_arg.type);
 			return -EINVAL;
 		}
-		queue = p->data.en_v1.queue;
-		ring = p->data.en_v1.ring;
-		mp = p->data.en_v1.mp;
-	} else {
-		ret = rte_eth_dev_get_port_by_name(p->data.dis_v1.device,
-				&port);
-		if (ret < 0) {
-			PDUMP_LOG(ERR,
-				"failed to get port id for device id=%s\n",
-				p->data.dis_v1.device);
-			return -EINVAL;
+
+		filter = rte_bpf_load(p->prm);
+		if (filter == NULL) {
+			PDUMP_LOG(ERR, "cannot load BPF filter: %s\n",
+				  rte_strerror(rte_errno));
+			return -rte_errno;
 		}
-		queue = p->data.dis_v1.queue;
-		ring = p->data.dis_v1.ring;
-		mp = p->data.dis_v1.mp;
+	}
+
+	flags = p->flags;
+	operation = p->op;
+	queue = p->queue;
+	ring = p->ring;
+	mp = p->mp;
+
+	ret = rte_eth_dev_get_port_by_name(p->device, &port);
+	if (ret < 0) {
+		PDUMP_LOG(ERR,
+			  "failed to get port id for device id=%s\n",
+			  p->device);
+		return -EINVAL;
 	}
 
 	/* validation if packet capture is for all queues */
@@ -296,8 +368,9 @@ set_pdump_rxtx_cbs(const struct pdump_request *p)
 	/* register RX callback */
 	if (flags & RTE_PDUMP_FLAG_RX) {
 		end_q = (queue == RTE_PDUMP_ALL_QUEUES) ? nb_rx_q : queue + 1;
-		ret = pdump_register_rx_callbacks(end_q, port, queue, ring, mp,
-							operation);
+		ret = pdump_register_rx_callbacks(p->ver, end_q, port, queue,
+						  ring, mp, filter,
+						  operation, p->snaplen);
 		if (ret < 0)
 			return ret;
 	}
@@ -305,8 +378,9 @@ set_pdump_rxtx_cbs(const struct pdump_request *p)
 	/* register TX callback */
 	if (flags & RTE_PDUMP_FLAG_TX) {
 		end_q = (queue == RTE_PDUMP_ALL_QUEUES) ? nb_tx_q : queue + 1;
-		ret = pdump_register_tx_callbacks(end_q, port, queue, ring, mp,
-							operation);
+		ret = pdump_register_tx_callbacks(p->ver, end_q, port, queue,
+						  ring, mp, filter,
+						  operation, p->snaplen);
 		if (ret < 0)
 			return ret;
 	}
@@ -347,8 +421,18 @@ pdump_server(const struct rte_mp_msg *mp_msg, const void *peer)
 int
 rte_pdump_init(void)
 {
+	const struct rte_memzone *mz;
 	int ret;
 
+	mz = rte_memzone_reserve(MZ_RTE_PDUMP_STATS, sizeof(*pdump_stats),
+				 rte_socket_id(), 0);
+	if (mz == NULL) {
+		PDUMP_LOG(ERR, "cannot allocate pdump statistics\n");
+		rte_errno = ENOMEM;
+		return -1;
+	}
+	pdump_stats = mz->addr;
+
 	ret = rte_mp_action_register(PDUMP_MP, pdump_server);
 	if (ret && rte_errno != ENOTSUP)
 		return -1;
@@ -392,14 +476,21 @@ pdump_validate_ring_mp(struct rte_ring *ring, struct rte_mempool *mp)
 static int
 pdump_validate_flags(uint32_t flags)
 {
-	if (flags != RTE_PDUMP_FLAG_RX && flags != RTE_PDUMP_FLAG_TX &&
-		flags != RTE_PDUMP_FLAG_RXTX) {
+	if ((flags & RTE_PDUMP_FLAG_RXTX) == 0) {
 		PDUMP_LOG(ERR,
 			"invalid flags, should be either rx/tx/rxtx\n");
 		rte_errno = EINVAL;
 		return -1;
 	}
 
+	/* mask off the flags we know about */
+	if (flags & ~(RTE_PDUMP_FLAG_RXTX | RTE_PDUMP_FLAG_PCAPNG)) {
+		PDUMP_LOG(ERR,
+			  "unknown flags: %#x\n", flags);
+		rte_errno = ENOTSUP;
+		return -1;
+	}
+
 	return 0;
 }
 
@@ -426,12 +517,12 @@ pdump_validate_port(uint16_t port, char *name)
 }
 
 static int
-pdump_prepare_client_request(char *device, uint16_t queue,
-				uint32_t flags,
-				uint16_t operation,
-				struct rte_ring *ring,
-				struct rte_mempool *mp,
-				void *filter)
+pdump_prepare_client_request(const char *device, uint16_t queue,
+			     uint32_t flags, uint32_t snaplen,
+			     uint16_t operation,
+			     struct rte_ring *ring,
+			     struct rte_mempool *mp,
+			     const struct rte_bpf_prm *prm)
 {
 	int ret = -1;
 	struct rte_mp_msg mp_req, *mp_rep;
@@ -440,23 +531,23 @@ pdump_prepare_client_request(char *device, uint16_t queue,
 	struct pdump_request *req = (struct pdump_request *)mp_req.param;
 	struct pdump_response *resp;
 
-	req->ver = 1;
-	req->flags = flags;
+	memset(req, 0, sizeof(*req));
+	if (flags & RTE_PDUMP_FLAG_PCAPNG)
+		req->ver = PDUMP_CLIENT_PCAPNG;
+	else
+		req->ver = PDUMP_CLIENT_LEGACY;
+
+	req->flags = flags & RTE_PDUMP_FLAG_RXTX;
 	req->op = operation;
+	req->queue = queue;
+	strlcpy(req->device, device, sizeof(req->device));
+
 	if ((operation & ENABLE) != 0) {
-		strlcpy(req->data.en_v1.device, device,
-			sizeof(req->data.en_v1.device));
-		req->data.en_v1.queue = queue;
-		req->data.en_v1.ring = ring;
-		req->data.en_v1.mp = mp;
-		req->data.en_v1.filter = filter;
-	} else {
-		strlcpy(req->data.dis_v1.device, device,
-			sizeof(req->data.dis_v1.device));
-		req->data.dis_v1.queue = queue;
-		req->data.dis_v1.ring = NULL;
-		req->data.dis_v1.mp = NULL;
-		req->data.dis_v1.filter = NULL;
+		req->queue = queue;
+		req->ring = ring;
+		req->mp = mp;
+		req->prm = prm;
+		req->snaplen = snaplen;
 	}
 
 	strlcpy(mp_req.name, PDUMP_MP, RTE_MP_MAX_NAME_LEN);
@@ -477,11 +568,17 @@ pdump_prepare_client_request(char *device, uint16_t queue,
 	return ret;
 }
 
-int
-rte_pdump_enable(uint16_t port, uint16_t queue, uint32_t flags,
-			struct rte_ring *ring,
-			struct rte_mempool *mp,
-			void *filter)
+/*
+ * There are two versions of this function, because although original API
+ * left place holder for future filter, it never checked the value.
+ * Therefore the API can't depend on application passing a non
+ * bogus value.
+ */
+static int
+pdump_enable(uint16_t port, uint16_t queue,
+	     uint32_t flags, uint32_t snaplen,
+	     struct rte_ring *ring, struct rte_mempool *mp,
+	     const struct rte_bpf_prm *prm)
 {
 	int ret;
 	char name[RTE_DEV_NAME_MAX_LEN];
@@ -496,20 +593,42 @@ rte_pdump_enable(uint16_t port, uint16_t queue, uint32_t flags,
 	if (ret < 0)
 		return ret;
 
-	ret = pdump_prepare_client_request(name, queue, flags,
-						ENABLE, ring, mp, filter);
+	if (snaplen == 0)
+		snaplen = UINT32_MAX;
 
-	return ret;
+	return pdump_prepare_client_request(name, queue, flags, snaplen,
+					    ENABLE, ring, mp, prm);
 }
 
 int
-rte_pdump_enable_by_deviceid(char *device_id, uint16_t queue,
-				uint32_t flags,
-				struct rte_ring *ring,
-				struct rte_mempool *mp,
-				void *filter)
+rte_pdump_enable(uint16_t port, uint16_t queue, uint32_t flags,
+		 struct rte_ring *ring,
+		 struct rte_mempool *mp,
+		 void *filter __rte_unused)
 {
-	int ret = 0;
+	return pdump_enable(port, queue, flags, 0,
+			    ring, mp, NULL);
+}
+
+int
+rte_pdump_enable_bpf(uint16_t port, uint16_t queue,
+		     uint32_t flags, uint32_t snaplen,
+		     struct rte_ring *ring,
+		     struct rte_mempool *mp,
+		     const struct rte_bpf_prm *prm)
+{
+	return pdump_enable(port, queue, flags, snaplen,
+			    ring, mp, prm);
+}
+
+static int
+pdump_enable_by_deviceid(const char *device_id, uint16_t queue,
+			 uint32_t flags, uint32_t snaplen,
+			 struct rte_ring *ring,
+			 struct rte_mempool *mp,
+			 const struct rte_bpf_prm *prm)
+{
+	int ret;
 
 	ret = pdump_validate_ring_mp(ring, mp);
 	if (ret < 0)
@@ -518,10 +637,30 @@ rte_pdump_enable_by_deviceid(char *device_id, uint16_t queue,
 	if (ret < 0)
 		return ret;
 
-	ret = pdump_prepare_client_request(device_id, queue, flags,
-						ENABLE, ring, mp, filter);
+	return pdump_prepare_client_request(device_id, queue, flags, snaplen,
+					    ENABLE, ring, mp, prm);
+}
 
-	return ret;
+int
+rte_pdump_enable_by_deviceid(char *device_id, uint16_t queue,
+			     uint32_t flags,
+			     struct rte_ring *ring,
+			     struct rte_mempool *mp,
+			     void *filter __rte_unused)
+{
+	return pdump_enable_by_deviceid(device_id, queue, flags, 0,
+					ring, mp, NULL);
+}
+
+int
+rte_pdump_enable_bpf_by_deviceid(const char *device_id, uint16_t queue,
+				 uint32_t flags, uint32_t snaplen,
+				 struct rte_ring *ring,
+				 struct rte_mempool *mp,
+				 const struct rte_bpf_prm *prm)
+{
+	return pdump_enable_by_deviceid(device_id, queue, flags, snaplen,
+					ring, mp, prm);
 }
 
 int
@@ -537,8 +676,8 @@ rte_pdump_disable(uint16_t port, uint16_t queue, uint32_t flags)
 	if (ret < 0)
 		return ret;
 
-	ret = pdump_prepare_client_request(name, queue, flags,
-						DISABLE, NULL, NULL, NULL);
+	ret = pdump_prepare_client_request(name, queue, flags, 0,
+					   DISABLE, NULL, NULL, NULL);
 
 	return ret;
 }
@@ -553,8 +692,66 @@ rte_pdump_disable_by_deviceid(char *device_id, uint16_t queue,
 	if (ret < 0)
 		return ret;
 
-	ret = pdump_prepare_client_request(device_id, queue, flags,
-						DISABLE, NULL, NULL, NULL);
+	ret = pdump_prepare_client_request(device_id, queue, flags, 0,
+					   DISABLE, NULL, NULL, NULL);
 
 	return ret;
 }
+
+static void
+pdump_sum_stats(uint16_t port, uint16_t nq,
+		struct rte_pdump_stats stats[RTE_MAX_ETHPORTS][RTE_MAX_QUEUES_PER_PORT],
+		struct rte_pdump_stats *total)
+{
+	uint64_t *sum = (uint64_t *)total;
+	unsigned int i;
+	uint64_t val;
+	uint16_t qid;
+
+	for (qid = 0; qid < nq; qid++) {
+		const uint64_t *perq = (const uint64_t *)&stats[port][qid];
+
+		for (i = 0; i < sizeof(*total) / sizeof(uint64_t); i++) {
+			val = __atomic_load_n(&perq[i], __ATOMIC_RELAXED);
+			sum[i] += val;
+		}
+	}
+}
+
+int
+rte_pdump_stats(uint16_t port, struct rte_pdump_stats *stats)
+{
+	struct rte_eth_dev_info dev_info;
+	const struct rte_memzone *mz;
+	int ret;
+
+	memset(stats, 0, sizeof(*stats));
+	ret = rte_eth_dev_info_get(port, &dev_info);
+	if (ret != 0) {
+		PDUMP_LOG(ERR,
+			  "Error during getting device (port %u) info: %s\n",
+			  port, strerror(-ret));
+		return ret;
+	}
+
+	if (pdump_stats == NULL) {
+		if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
+			PDUMP_LOG(ERR,
+				  "pdump not initialized\n");
+			rte_errno = EINVAL;
+			return -1;
+		}
+
+		mz = rte_memzone_lookup(MZ_RTE_PDUMP_STATS);
+		if (mz == NULL) {
+			PDUMP_LOG(ERR, "can not find pdump stats\n");
+			rte_errno = EINVAL;
+			return -1;
+		}
+		pdump_stats = mz->addr;
+	}
+
+	pdump_sum_stats(port, dev_info.nb_rx_queues, pdump_stats->rx, stats);
+	pdump_sum_stats(port, dev_info.nb_tx_queues, pdump_stats->tx, stats);
+	return 0;
+}
diff --git a/lib/pdump/rte_pdump.h b/lib/pdump/rte_pdump.h
index 6b00fc17aeb2..be3fd14c4bd3 100644
--- a/lib/pdump/rte_pdump.h
+++ b/lib/pdump/rte_pdump.h
@@ -15,6 +15,7 @@
 #include <stdint.h>
 #include <rte_mempool.h>
 #include <rte_ring.h>
+#include <rte_bpf.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -26,7 +27,9 @@ enum {
 	RTE_PDUMP_FLAG_RX = 1,  /* receive direction */
 	RTE_PDUMP_FLAG_TX = 2,  /* transmit direction */
 	/* both receive and transmit directions */
-	RTE_PDUMP_FLAG_RXTX = (RTE_PDUMP_FLAG_RX|RTE_PDUMP_FLAG_TX)
+	RTE_PDUMP_FLAG_RXTX = (RTE_PDUMP_FLAG_RX|RTE_PDUMP_FLAG_TX),
+
+	RTE_PDUMP_FLAG_PCAPNG = 4, /* format for pcapng */
 };
 
 /**
@@ -68,7 +71,7 @@ rte_pdump_uninit(void);
  * @param mp
  *  mempool on to which original packets will be mirrored or duplicated.
  * @param filter
- *  place holder for packet filtering.
+ *  Unused should be NULL.
  *
  * @return
  *    0 on success, -1 on error, rte_errno is set accordingly.
@@ -80,6 +83,41 @@ rte_pdump_enable(uint16_t port, uint16_t queue, uint32_t flags,
 		struct rte_mempool *mp,
 		void *filter);
 
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
+ *
+ * Enables packet capturing on given port and queue with filtering.
+ *
+ * @param port_id
+ *  The Ethernet port on which packet capturing should be enabled.
+ * @param queue
+ *  The queue on the Ethernet port which packet capturing
+ *  should be enabled. Pass UINT16_MAX to enable packet capturing on all
+ *  queues of a given port.
+ * @param flags
+ *  Pdump library flags that specify direction and packet format.
+ * @param snaplen
+ *  The upper limit on bytes to copy.
+ *  Passing UINT32_MAX means capture all the possible data.
+ * @param ring
+ *  The ring on which captured packets will be enqueued for user.
+ * @param mp
+ *  The mempool on to which original packets will be mirrored or duplicated.
+ * @param prm
+ *  Use BPF program to run to filter packes (can be NULL)
+ *
+ * @return
+ *    0 on success, -1 on error, rte_errno is set accordingly.
+ */
+__rte_experimental
+int
+rte_pdump_enable_bpf(uint16_t port_id, uint16_t queue,
+		     uint32_t flags, uint32_t snaplen,
+		     struct rte_ring *ring,
+		     struct rte_mempool *mp,
+		     const struct rte_bpf_prm *prm);
+
 /**
  * Disables packet capturing on given port and queue.
  *
@@ -118,7 +156,7 @@ rte_pdump_disable(uint16_t port, uint16_t queue, uint32_t flags);
  * @param mp
  *  mempool on to which original packets will be mirrored or duplicated.
  * @param filter
- *  place holder for packet filtering.
+ *  unused should be NULL
  *
  * @return
  *    0 on success, -1 on error, rte_errno is set accordingly.
@@ -131,6 +169,43 @@ rte_pdump_enable_by_deviceid(char *device_id, uint16_t queue,
 				struct rte_mempool *mp,
 				void *filter);
 
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
+ *
+ * Enables packet capturing on given device id and queue with filtering.
+ * device_id can be name or pci address of device.
+ *
+ * @param device_id
+ *  device id on which packet capturing should be enabled.
+ * @param queue
+ *  The queue on the Ethernet port which packet capturing
+ *  should be enabled. Pass UINT16_MAX to enable packet capturing on all
+ *  queues of a given port.
+ * @param flags
+ *  Pdump library flags that specify direction and packet format.
+ * @param snaplen
+ *  The upper limit on bytes to copy.
+ *  Passing UINT32_MAX means capture all the possible data.
+ * @param ring
+ *  The ring on which captured packets will be enqueued for user.
+ * @param mp
+ *  The mempool on to which original packets will be mirrored or duplicated.
+ * @param filter
+ *  Use BPF program to run to filter packes (can be NULL)
+ *
+ * @return
+ *    0 on success, -1 on error, rte_errno is set accordingly.
+ */
+__rte_experimental
+int
+rte_pdump_enable_bpf_by_deviceid(const char *device_id, uint16_t queue,
+				 uint32_t flags, uint32_t snaplen,
+				 struct rte_ring *ring,
+				 struct rte_mempool *mp,
+				 const struct rte_bpf_prm *filter);
+
+
 /**
  * Disables packet capturing on given device_id and queue.
  * device_id can be name or pci address of device.
@@ -153,6 +228,35 @@ int
 rte_pdump_disable_by_deviceid(char *device_id, uint16_t queue,
 				uint32_t flags);
 
+
+/**
+ * A structure used to retrieve statistics from packet capture.
+ * The statistics are sum of both receive and transmit queues.
+ */
+struct rte_pdump_stats {
+	uint64_t accepted; /**< Number of packets accepted by filter. */
+	uint64_t filtered; /**< Number of packets rejected by filter. */
+	uint64_t nombuf;   /**< Number of mbuf allocation failures. */
+	uint64_t ringfull; /**< Number of missed packets due to ring full. */
+
+	uint64_t reserved[4]; /**< Reserved and pad to cache line */
+};
+
+/**
+ * Retrieve the packet capture statistics for a queue.
+ *
+ * @param port_id
+ *   The port identifier of the Ethernet device.
+ * @param stats
+ *   A pointer to structure of type *rte_pdump_stats* to be filled in.
+ * @return
+ *   Zero if successful. -1 on error and rte_errno is set.
+ */
+__rte_experimental
+int
+rte_pdump_stats(uint16_t port_id, struct rte_pdump_stats *stats);
+
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/lib/pdump/version.map b/lib/pdump/version.map
index f0a9d12c9a9e..ce5502d9cdf4 100644
--- a/lib/pdump/version.map
+++ b/lib/pdump/version.map
@@ -10,3 +10,11 @@ DPDK_22 {
 
 	local: *;
 };
+
+EXPERIMENTAL {
+	global:
+
+	rte_pdump_enable_bpf;
+	rte_pdump_enable_bpf_by_deviceid;
+	rte_pdump_stats;
+};
-- 
2.30.2


^ permalink raw reply	[relevance 1%]

* [dpdk-dev] [PATCH v7 10/11] doc: changes for new pcapng and dumpcap
    2021-09-10 18:18  1%   ` [dpdk-dev] [PATCH v7 06/11] pdump: support pcapng and filtering Stephen Hemminger
@ 2021-09-10 18:18  1%   ` Stephen Hemminger
  1 sibling, 0 replies; 200+ results
From: Stephen Hemminger @ 2021-09-10 18:18 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

Describe the new packet capture library and utilities

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 doc/api/doxy-api-index.md                     |  1 +
 doc/api/doxy-api.conf.in                      |  1 +
 .../howto/img/packet_capture_framework.svg    | 96 +++++++++----------
 doc/guides/howto/packet_capture_framework.rst | 67 ++++++-------
 doc/guides/prog_guide/index.rst               |  1 +
 doc/guides/prog_guide/pcapng_lib.rst          | 24 +++++
 doc/guides/prog_guide/pdump_lib.rst           | 28 ++++--
 doc/guides/rel_notes/release_21_11.rst        | 10 ++
 doc/guides/tools/dumpcap.rst                  | 86 +++++++++++++++++
 doc/guides/tools/index.rst                    |  1 +
 10 files changed, 228 insertions(+), 87 deletions(-)
 create mode 100644 doc/guides/prog_guide/pcapng_lib.rst
 create mode 100644 doc/guides/tools/dumpcap.rst

diff --git a/doc/api/doxy-api-index.md b/doc/api/doxy-api-index.md
index 1992107a0356..ee07394d1c78 100644
--- a/doc/api/doxy-api-index.md
+++ b/doc/api/doxy-api-index.md
@@ -223,3 +223,4 @@ The public API headers are grouped by topics:
   [experimental APIs]  (@ref rte_compat.h),
   [ABI versioning]     (@ref rte_function_versioning.h),
   [version]            (@ref rte_version.h)
+  [pcapng]             (@ref rte_pcapng.h)
diff --git a/doc/api/doxy-api.conf.in b/doc/api/doxy-api.conf.in
index 325a0195c6ab..aba17799a9a1 100644
--- a/doc/api/doxy-api.conf.in
+++ b/doc/api/doxy-api.conf.in
@@ -58,6 +58,7 @@ INPUT                   = @TOPDIR@/doc/api/doxy-api-index.md \
                           @TOPDIR@/lib/metrics \
                           @TOPDIR@/lib/node \
                           @TOPDIR@/lib/net \
+                          @TOPDIR@/lib/pcapng \
                           @TOPDIR@/lib/pci \
                           @TOPDIR@/lib/pdump \
                           @TOPDIR@/lib/pipeline \
diff --git a/doc/guides/howto/img/packet_capture_framework.svg b/doc/guides/howto/img/packet_capture_framework.svg
index a76baf71fdee..1c2646a81096 100644
--- a/doc/guides/howto/img/packet_capture_framework.svg
+++ b/doc/guides/howto/img/packet_capture_framework.svg
@@ -1,6 +1,4 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
 <svg
    xmlns:osb="http://www.openswatchbook.org/uri/2009/osb"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
@@ -16,8 +14,8 @@
    viewBox="0 0 425.19685 283.46457"
    id="svg2"
    version="1.1"
-   inkscape:version="0.91 r13725"
-   sodipodi:docname="drawing-pcap.svg">
+   inkscape:version="1.0.2 (e86c870879, 2021-01-15)"
+   sodipodi:docname="packet_capture_framework.svg">
   <defs
      id="defs4">
     <marker
@@ -228,7 +226,7 @@
        x2="487.64606"
        y2="258.38232"
        gradientUnits="userSpaceOnUse"
-       gradientTransform="translate(-84.916417,744.90779)" />
+       gradientTransform="matrix(1.1457977,0,0,0.99944907,-151.97019,745.05014)" />
     <linearGradient
        inkscape:collect="always"
        xlink:href="#linearGradient5784"
@@ -277,17 +275,18 @@
      borderopacity="1.0"
      inkscape:pageopacity="0.0"
      inkscape:pageshadow="2"
-     inkscape:zoom="0.57434918"
-     inkscape:cx="215.17857"
-     inkscape:cy="285.26445"
+     inkscape:zoom="1"
+     inkscape:cx="226.77165"
+     inkscape:cy="78.124511"
      inkscape:document-units="px"
      inkscape:current-layer="layer1"
      showgrid="false"
-     inkscape:window-width="1874"
-     inkscape:window-height="971"
-     inkscape:window-x="2"
-     inkscape:window-y="24"
-     inkscape:window-maximized="0" />
+     inkscape:window-width="2560"
+     inkscape:window-height="1414"
+     inkscape:window-x="0"
+     inkscape:window-y="0"
+     inkscape:window-maximized="1"
+     inkscape:document-rotation="0" />
   <metadata
      id="metadata7">
     <rdf:RDF>
@@ -296,7 +295,7 @@
         <dc:format>image/svg+xml</dc:format>
         <dc:type
            rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
-        <dc:title></dc:title>
+        <dc:title />
       </cc:Work>
     </rdf:RDF>
   </metadata>
@@ -321,15 +320,15 @@
        y="790.82452" />
     <text
        xml:space="preserve"
-       style="font-style:normal;font-weight:normal;font-size:12.5px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
        x="61.050636"
        y="807.3205"
-       id="text4152"
-       sodipodi:linespacing="125%"><tspan
+       id="text4152"><tspan
          sodipodi:role="line"
          id="tspan4154"
          x="61.050636"
-         y="807.3205">DPDK Primary Application</tspan></text>
+         y="807.3205"
+         style="font-size:12.5px;line-height:1.25">DPDK Primary Application</tspan></text>
     <rect
        style="fill:#000000;fill-opacity:0;stroke:#257cdc;stroke-width:2;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
        id="rect4156-6"
@@ -339,19 +338,20 @@
        y="827.01843" />
     <text
        xml:space="preserve"
-       style="font-style:normal;font-weight:normal;font-size:12.5px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
        x="350.68585"
        y="841.16058"
-       id="text4189"
-       sodipodi:linespacing="125%"><tspan
+       id="text4189"><tspan
          sodipodi:role="line"
          id="tspan4191"
          x="350.68585"
-         y="841.16058">dpdk-pdump</tspan><tspan
+         y="841.16058"
+         style="font-size:12.5px;line-height:1.25">dpdk-dumpcap</tspan><tspan
          sodipodi:role="line"
          x="350.68585"
          y="856.78558"
-         id="tspan4193">tool</tspan></text>
+         id="tspan4193"
+         style="font-size:12.5px;line-height:1.25">tool</tspan></text>
     <rect
        style="fill:#000000;fill-opacity:0;stroke:#257cdc;stroke-width:2;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
        id="rect4156-6-4"
@@ -361,15 +361,15 @@
        y="891.16315" />
     <text
        xml:space="preserve"
-       style="font-style:normal;font-weight:normal;font-size:12.5px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
        x="352.70612"
        y="905.3053"
-       id="text4189-1"
-       sodipodi:linespacing="125%"><tspan
+       id="text4189-1"><tspan
          sodipodi:role="line"
          x="352.70612"
          y="905.3053"
-         id="tspan4193-3">PCAP PMD</tspan></text>
+         id="tspan4193-3"
+         style="font-size:12.5px;line-height:1.25">librte_pcapng</tspan></text>
     <rect
        style="fill:url(#linearGradient5745);fill-opacity:1;stroke:#257cdc;stroke-width:2;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
        id="rect4156-6-6"
@@ -379,15 +379,15 @@
        y="923.9931" />
     <text
        xml:space="preserve"
-       style="font-style:normal;font-weight:normal;font-size:12.5px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
        x="136.02846"
        y="938.13525"
-       id="text4189-0"
-       sodipodi:linespacing="125%"><tspan
+       id="text4189-0"><tspan
          sodipodi:role="line"
          x="136.02846"
          y="938.13525"
-         id="tspan4193-6">dpdk_port0</tspan></text>
+         id="tspan4193-6"
+         style="font-size:12.5px;line-height:1.25">dpdk_port0</tspan></text>
     <rect
        style="fill:#000000;fill-opacity:0;stroke:#257cdc;stroke-width:2;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
        id="rect4156-6-5"
@@ -397,33 +397,33 @@
        y="824.99817" />
     <text
        xml:space="preserve"
-       style="font-style:normal;font-weight:normal;font-size:12.5px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
        x="137.54369"
        y="839.14026"
-       id="text4189-4"
-       sodipodi:linespacing="125%"><tspan
+       id="text4189-4"><tspan
          sodipodi:role="line"
          x="137.54369"
          y="839.14026"
-         id="tspan4193-2">librte_pdump</tspan></text>
+         id="tspan4193-2"
+         style="font-size:12.5px;line-height:1.25">librte_pdump</tspan></text>
     <rect
-       style="fill:url(#linearGradient5788);fill-opacity:1;stroke:#257cdc;stroke-width:1;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       style="fill:url(#linearGradient5788);fill-opacity:1;stroke:#257cdc;stroke-width:1.07013;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
        id="rect4156-6-4-5"
-       width="94.449265"
-       height="35.355339"
-       x="307.7804"
-       y="985.61243" />
+       width="108.21974"
+       height="35.335861"
+       x="297.9809"
+       y="985.62219" />
     <text
        xml:space="preserve"
-       style="font-style:normal;font-weight:normal;font-size:12.5px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
        x="352.70618"
        y="999.75458"
-       id="text4189-1-8"
-       sodipodi:linespacing="125%"><tspan
+       id="text4189-1-8"><tspan
          sodipodi:role="line"
          x="352.70618"
          y="999.75458"
-         id="tspan4193-3-2">capture.pcap</tspan></text>
+         id="tspan4193-3-2"
+         style="font-size:12.5px;line-height:1.25">capture.pcapng</tspan></text>
     <rect
        style="fill:url(#linearGradient5788-1);fill-opacity:1;stroke:#257cdc;stroke-width:1.12555885;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
        id="rect4156-6-4-5-1"
@@ -433,15 +433,15 @@
        y="983.14984" />
     <text
        xml:space="preserve"
-       style="font-style:normal;font-weight:normal;font-size:12.5px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
        x="136.53352"
        y="1002.785"
-       id="text4189-1-8-4"
-       sodipodi:linespacing="125%"><tspan
+       id="text4189-1-8-4"><tspan
          sodipodi:role="line"
          x="136.53352"
          y="1002.785"
-         id="tspan4193-3-2-7">Traffic Generator</tspan></text>
+         id="tspan4193-3-2-7"
+         style="font-size:12.5px;line-height:1.25">Traffic Generator</tspan></text>
     <path
        style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#marker7331)"
        d="m 351.46948,927.02357 c 0,57.5787 0,57.5787 0,57.5787"
diff --git a/doc/guides/howto/packet_capture_framework.rst b/doc/guides/howto/packet_capture_framework.rst
index c31bac52340e..78baa609a021 100644
--- a/doc/guides/howto/packet_capture_framework.rst
+++ b/doc/guides/howto/packet_capture_framework.rst
@@ -1,18 +1,19 @@
 ..  SPDX-License-Identifier: BSD-3-Clause
     Copyright(c) 2017 Intel Corporation.
 
-DPDK pdump Library and pdump Tool
-=================================
+DPDK packet capture libraries and tools
+=======================================
 
 This document describes how the Data Plane Development Kit (DPDK) Packet
 Capture Framework is used for capturing packets on DPDK ports. It is intended
 for users of DPDK who want to know more about the Packet Capture feature and
 for those who want to monitor traffic on DPDK-controlled devices.
 
-The DPDK packet capture framework was introduced in DPDK v16.07. The DPDK
-packet capture framework consists of the DPDK pdump library and DPDK pdump
-tool.
-
+The DPDK packet capture framework was introduced in DPDK v16.07 and
+enhanced in 21.1. The DPDK packet capture framework consists of the
+libraries for collecting packets ``librte_pdump`` and writing packets
+to a file ``librte_pcapng``. There are two sample applications:
+``dpdk-dumpcap`` and older ``dpdk-pdump``.
 
 Introduction
 ------------
@@ -22,43 +23,46 @@ allow users to initialize the packet capture framework and to enable or
 disable packet capture. The library works on a multi process communication model and its
 usage is recommended for debugging purposes.
 
-The :ref:`dpdk-pdump <pdump_tool>` tool is developed based on the
-``librte_pdump`` library.  It runs as a DPDK secondary process and is capable
-of enabling or disabling packet capture on DPDK ports. The ``dpdk-pdump`` tool
-provides command-line options with which users can request enabling or
-disabling of the packet capture on DPDK ports.
+The :ref:`librte_pcapng <pcapng_library>` library provides the APIs to format
+packets and write them to a file in Pcapng format.
+
+
+The :ref:`dpdk-dumpcap <dumpcap_tool>` is a tool that captures packets in
+like Wireshark dumpcap does for Linux. It runs as a DPDK secondary process and
+captures packets from one or more interfaces and writes them to a file
+in Pcapng format.  The ``dpdk-dumpcap`` tool is designed to take
+most of the same options as the Wireshark ``dumpcap`` command.
 
-The application which initializes the packet capture framework will be a primary process
-and the application that enables or disables the packet capture will
-be a secondary process. The primary process sends the Rx and Tx packets from the DPDK ports
-to the secondary process.
+Without any options it will use the packet capture framework to
+capture traffic from the first available DPDK port.
 
 In DPDK the ``testpmd`` application can be used to initialize the packet
-capture framework and acts as a server, and the ``dpdk-pdump`` tool acts as a
+capture framework and acts as a server, and the ``dpdk-dumpcap`` tool acts as a
 client. To view Rx or Tx packets of ``testpmd``, the application should be
-launched first, and then the ``dpdk-pdump`` tool. Packets from ``testpmd``
-will be sent to the tool, which then sends them on to the Pcap PMD device and
-that device writes them to the Pcap file or to an external interface depending
-on the command-line option used.
+launched first, and then the ``dpdk-dumpcap`` tool. Packets from ``testpmd``
+will be sent to the tool, and then to the Pcapng file.
 
 Some things to note:
 
-* The ``dpdk-pdump`` tool can only be used in conjunction with a primary
+* All tools using ``librte_pdump`` can only be used in conjunction with a primary
   application which has the packet capture framework initialized already. In
   dpdk, only ``testpmd`` is modified to initialize packet capture framework,
-  other applications remain untouched. So, if the ``dpdk-pdump`` tool has to
+  other applications remain untouched. So, if the ``dpdk-dumpcap`` tool has to
   be used with any application other than the testpmd, the user needs to
   explicitly modify that application to call the packet capture framework
   initialization code. Refer to the ``app/test-pmd/testpmd.c`` code and look
   for ``pdump`` keyword to see how this is done.
 
-* The ``dpdk-pdump`` tool depends on the libpcap based PMD.
+* The ``dpdk-pdump`` tool is an older tool created as demonstration of ``librte_pdump``
+  library. The ``dpdk-pdump`` tool provides more limited functionality and
+  and depends on the Pcap PMD. It is retained only for compatibility reasons;
+  users should use ``dpdk-dumpcap`` instead.
 
 
 Test Environment
 ----------------
 
-The overview of using the Packet Capture Framework and the ``dpdk-pdump`` tool
+The overview of using the Packet Capture Framework and the ``dpdk-dumpcap`` utility
 for packet capturing on the DPDK port in
 :numref:`figure_packet_capture_framework`.
 
@@ -66,13 +70,13 @@ for packet capturing on the DPDK port in
 
 .. figure:: img/packet_capture_framework.*
 
-   Packet capturing on a DPDK port using the dpdk-pdump tool.
+   Packet capturing on a DPDK port using the dpdk-dumpcap utility.
 
 
 Running the Application
 -----------------------
 
-The following steps demonstrate how to run the ``dpdk-pdump`` tool to capture
+The following steps demonstrate how to run the ``dpdk-dumpcap`` tool to capture
 Rx side packets on dpdk_port0 in :numref:`figure_packet_capture_framework` and
 inspect them using ``tcpdump``.
 
@@ -80,16 +84,15 @@ inspect them using ``tcpdump``.
 
      sudo <build_dir>/app/dpdk-testpmd -c 0xf0 -n 4 -- -i --port-topology=chained
 
-#. Launch the pdump tool as follows::
+#. Launch the dpdk-dump as follows::
 
-     sudo <build_dir>/app/dpdk-pdump -- \
-          --pdump 'port=0,queue=*,rx-dev=/tmp/capture.pcap'
+     sudo <build_dir>/app/dpdk-dumpcap -w /tmp/capture.pcapng
 
 #. Send traffic to dpdk_port0 from traffic generator.
-   Inspect packets captured in the file capture.pcap using a tool
-   that can interpret Pcap files, for example tcpdump::
+   Inspect packets captured in the file capture.pcap using a tool such as
+   tcpdump or tshark that can interpret Pcapng files::
 
-     $tcpdump -nr /tmp/capture.pcap
+     $ tcpdump -nr /tmp/capture.pcapng
      reading from file /tmp/capture.pcap, link-type EN10MB (Ethernet)
      11:11:36.891404 IP 4.4.4.4.whois++ > 3.3.3.3.whois++: UDP, length 18
      11:11:36.891442 IP 4.4.4.4.whois++ > 3.3.3.3.whois++: UDP, length 18
diff --git a/doc/guides/prog_guide/index.rst b/doc/guides/prog_guide/index.rst
index 2dce507f46a3..b440c77c2ba1 100644
--- a/doc/guides/prog_guide/index.rst
+++ b/doc/guides/prog_guide/index.rst
@@ -43,6 +43,7 @@ Programmer's Guide
     ip_fragment_reassembly_lib
     generic_receive_offload_lib
     generic_segmentation_offload_lib
+    pcapng_lib
     pdump_lib
     multi_proc_support
     kernel_nic_interface
diff --git a/doc/guides/prog_guide/pcapng_lib.rst b/doc/guides/prog_guide/pcapng_lib.rst
new file mode 100644
index 000000000000..36379b530a57
--- /dev/null
+++ b/doc/guides/prog_guide/pcapng_lib.rst
@@ -0,0 +1,24 @@
+..  SPDX-License-Identifier: BSD-3-Clause
+    Copyright(c) 2016 Intel Corporation.
+
+.. _pcapng_library:
+
+Packet Capture File Writer
+==========================
+
+Pcapng is a library for creating files in Pcapng file format.
+The Pcapng file format is the default capture file format for modern
+network capture processing tools. It can be read by wireshark and tcpdump.
+
+Usage
+-----
+
+Before the library can be used the function ``rte_pcapng_init``
+should be called once to initialize timestamp computation.
+
+
+References
+----------
+* Draft RFC https://www.ietf.org/id/draft-tuexen-opsawg-pcapng-03.html
+
+* Project repository  https://github.com/pcapng/pcapng/
diff --git a/doc/guides/prog_guide/pdump_lib.rst b/doc/guides/prog_guide/pdump_lib.rst
index 62c0b015b2fe..9af91415e5ea 100644
--- a/doc/guides/prog_guide/pdump_lib.rst
+++ b/doc/guides/prog_guide/pdump_lib.rst
@@ -3,10 +3,10 @@
 
 .. _pdump_library:
 
-The librte_pdump Library
-========================
+The Packet Capture Library
+==========================
 
-The ``librte_pdump`` library provides a framework for packet capturing in DPDK.
+The DPDK ``pdump`` library provides a framework for packet capturing in DPDK.
 The library does the complete copy of the Rx and Tx mbufs to a new mempool and
 hence it slows down the performance of the applications, so it is recommended
 to use this library for debugging purposes.
@@ -23,11 +23,19 @@ or disable the packet capture, and to uninitialize it.
 
 * ``rte_pdump_enable()``:
   This API enables the packet capture on a given port and queue.
-  Note: The filter option in the API is a place holder for future enhancements.
+
+* ``rte_pdump_enable_bpf()``
+  This API enables the packet capture on a given port and queue.
+  It also allows setting an optional filter using DPDK BPF interpreter and
+  setting the captured packet length.
 
 * ``rte_pdump_enable_by_deviceid()``:
   This API enables the packet capture on a given device id (``vdev name or pci address``) and queue.
-  Note: The filter option in the API is a place holder for future enhancements.
+
+* ``rte_pdump_enable_bpf_by_deviceid()``
+  This API enables the packet capture on a given device id (``vdev name or pci address``) and queue.
+  It also allows seating an optional filter using DPDK BPF interpreter and
+  setting the captured packet length.
 
 * ``rte_pdump_disable()``:
   This API disables the packet capture on a given port and queue.
@@ -61,6 +69,12 @@ and enables the packet capture by registering the Ethernet RX and TX callbacks f
 and queue combinations. Then the primary process will mirror the packets to the new mempool and enqueue them to
 the rte_ring that secondary process have passed to these APIs.
 
+The packet ring supports one of two formats. The default format enqueues copies of the original packets
+into the rte_ring. If the ``RTE_PDUMP_FLAG_PCAPNG`` is set the mbuf data is extended with header and trailer
+to match the format of Pcapng enhanced packet block. The enhanced packet block has meta-data such as the
+timestamp, port and queue the packet was captured on. It is up to the application consuming the
+packets from the ring to select the format desired.
+
 The library APIs ``rte_pdump_disable()`` and ``rte_pdump_disable_by_deviceid()`` disables the packet capture.
 For the calls to these APIs from secondary process, the library creates the "pdump disable" request and sends
 the request to the primary process over the multi process channel. The primary process takes this request and
@@ -74,5 +88,5 @@ function.
 Use Case: Packet Capturing
 --------------------------
 
-The DPDK ``app/pdump`` tool is developed based on this library to capture packets in DPDK.
-Users can use this as an example to develop their own packet capturing tools.
+The DPDK ``app/dpdk-dumpcap`` utility uses this library
+to capture packets in DPDK.
diff --git a/doc/guides/rel_notes/release_21_11.rst b/doc/guides/rel_notes/release_21_11.rst
index 675b5738348b..ee24cbfdb99d 100644
--- a/doc/guides/rel_notes/release_21_11.rst
+++ b/doc/guides/rel_notes/release_21_11.rst
@@ -62,6 +62,16 @@ New Features
   * Added bus-level parsing of the devargs syntax.
   * Kept compatibility with the legacy syntax as parsing fallback.
 
+* **Enhance Packet capture.**
+
+  * New dpdk-dumpcap program that has most of the features of the
+    wireshark dumpcap utility including capture of multiple interfaces,
+    stopping after number of bytes, packets.
+  * New library for writing pcapng packet capture files.
+  * Enhancement to the pdump library to support:
+    * Packet filter with BPF.
+    * Pcapng format with timestamps and meta-data.
+    * Fixes packet capture with stripped VLAN tags.
 
 Removed Items
 -------------
diff --git a/doc/guides/tools/dumpcap.rst b/doc/guides/tools/dumpcap.rst
new file mode 100644
index 000000000000..664ea0c79802
--- /dev/null
+++ b/doc/guides/tools/dumpcap.rst
@@ -0,0 +1,86 @@
+..  SPDX-License-Identifier: BSD-3-Clause
+    Copyright(c) 2020 Microsoft Corporation.
+
+.. _dumpcap_tool:
+
+dpdk-dumpcap Application
+========================
+
+The ``dpdk-dumpcap`` tool is a Data Plane Development Kit (DPDK)
+network traffic dump tool.  The interface is similar to  the dumpcap tool in Wireshark.
+It runs as a secondary DPDK process and lets you capture packets that are
+coming into and out of a DPDK primary process.
+The ``dpdk-dumpcap`` writes files in Pcapng packet format using
+capture file format is pcapng.
+
+Without any options set it will use DPDK to capture traffic from the first
+available DPDK interface and write the received raw packet data, along
+with timestamps into a pcapng file.
+
+If the ``-w`` option is not specified, ``dpdk-dumpcap`` writes to a newly
+create file with a name chosen based on interface name and timestamp.
+If ``-w`` option is specified, then that file is used.
+
+   .. Note::
+      * The ``dpdk-dumpcap`` tool can only be used in conjunction with a primary
+        application which has the packet capture framework initialized already.
+        In dpdk, only the ``testpmd`` is modified to initialize packet capture
+        framework, other applications remain untouched. So, if the ``dpdk-dumpcap``
+        tool has to be used with any application other than the testpmd, user
+        needs to explicitly modify that application to call packet capture
+        framework initialization code. Refer ``app/test-pmd/testpmd.c``
+        code to see how this is done.
+
+      * The ``dpdk-dumpcap`` tool runs as a DPDK secondary process. It exits when
+        the primary application exits.
+
+
+Running the Application
+-----------------------
+
+To list interfaces available for capture use ``--list-interfaces``.
+
+To filter packets in style of *tshark* use the ``-f`` flag.
+
+To capture on multiple interfaces at once, use multiple ``-I`` flags.
+
+Example
+-------
+
+.. code-block:: console
+
+   # ./<build_dir>/app/dpdk-dumpcap --list-interfaces
+   0. 000:00:03.0
+   1. 000:00:03.1
+
+   # ./<build_dir>/app/dpdk-dumpcap -I 0000:00:03.0 -c 6 -w /tmp/sample.pcapng
+   Packets captured: 6
+   Packets received/dropped on interface '0000:00:03.0' 6/0
+
+   # ./<build_dir>/app/dpdk-dumpcap -f 'tcp port 80'
+   Packets captured: 6
+   Packets received/dropped on interface '0000:00:03.0' 10/8
+
+
+Limitations
+-----------
+The following option of Wireshark ``dumpcap`` is not yet implemented:
+
+   * ``-b|--ring-buffer`` -- more complex file management.
+
+The following options do not make sense in the context of DPDK.
+
+   * ``-C <byte_limit>`` -- its a kernel thing
+
+   * ``-t`` -- use a thread per interface
+
+   * Timestamp type.
+
+   * Link data types. Only EN10MB (Ethernet) is supported.
+
+   * Wireless related options:  ``-I|--monitor-mode`` and  ``-k <freq>``
+
+
+.. Note::
+   * The options to ``dpdk-dumpcap`` are like the Wireshark dumpcap program and
+     are not the same as ``dpdk-pdump`` and other DPDK applications.
diff --git a/doc/guides/tools/index.rst b/doc/guides/tools/index.rst
index 93dde4148e90..b71c12b8f2dd 100644
--- a/doc/guides/tools/index.rst
+++ b/doc/guides/tools/index.rst
@@ -8,6 +8,7 @@ DPDK Tools User Guides
     :maxdepth: 2
     :numbered:
 
+    dumpcap
     proc_info
     pdump
     pmdinfo
-- 
2.30.2


^ permalink raw reply	[relevance 1%]

* [dpdk-dev] [PATCH] cmdline: reduce ABI
  @ 2021-09-10 23:16  8% ` Dmitry Kozlyuk
  0 siblings, 0 replies; 200+ results
From: Dmitry Kozlyuk @ 2021-09-10 23:16 UTC (permalink / raw)
  To: dev; +Cc: Dmitry Kozlyuk, Ray Kinsella, Olivier Matz

Remove the definition of `struct cmdline` from public header.
Deprecation notice:
https://mails.dpdk.org/archives/dev/2020-September/183310.html

Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
---
I would also hide struct rdline to be able to alter buffer size,
but we don't have a deprecation notice for it.

 doc/guides/rel_notes/deprecation.rst   |  4 ----
 doc/guides/rel_notes/release_21_11.rst |  2 ++
 lib/cmdline/cmdline.h                  | 19 -------------------
 lib/cmdline/cmdline_private.h          |  8 +++++++-
 4 files changed, 9 insertions(+), 24 deletions(-)

diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index 76a4abfd6b..a404276fa2 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -275,10 +275,6 @@ Deprecation Notices
 * metrics: The function ``rte_metrics_init`` will have a non-void return
   in order to notify errors instead of calling ``rte_exit``.
 
-* cmdline: ``cmdline`` structure will be made opaque to hide platform-specific
-  content. On Linux and FreeBSD, supported prior to DPDK 20.11,
-  original structure will be kept until DPDK 21.11.
-
 * security: The functions ``rte_security_set_pkt_metadata`` and
   ``rte_security_get_userdata`` will be made inline functions and additional
   flags will be added in structure ``rte_security_ctx`` in DPDK 21.11.
diff --git a/doc/guides/rel_notes/release_21_11.rst b/doc/guides/rel_notes/release_21_11.rst
index 675b573834..be73d17ef6 100644
--- a/doc/guides/rel_notes/release_21_11.rst
+++ b/doc/guides/rel_notes/release_21_11.rst
@@ -91,6 +91,8 @@ API Changes
    Also, make sure to start the actual text at the margin.
    =======================================================
 
+* cmdline: Made ``cmdline`` structure definition hidden on Linux and FreeBSD.
+
 
 ABI Changes
 -----------
diff --git a/lib/cmdline/cmdline.h b/lib/cmdline/cmdline.h
index c29762ddae..96674dfda2 100644
--- a/lib/cmdline/cmdline.h
+++ b/lib/cmdline/cmdline.h
@@ -7,10 +7,6 @@
 #ifndef _CMDLINE_H_
 #define _CMDLINE_H_
 
-#ifndef RTE_EXEC_ENV_WINDOWS
-#include <termios.h>
-#endif
-
 #include <rte_common.h>
 #include <rte_compat.h>
 
@@ -27,23 +23,8 @@
 extern "C" {
 #endif
 
-#ifndef RTE_EXEC_ENV_WINDOWS
-
-struct cmdline {
-	int s_in;
-	int s_out;
-	cmdline_parse_ctx_t *ctx;
-	struct rdline rdl;
-	char prompt[RDLINE_PROMPT_SIZE];
-	struct termios oldterm;
-};
-
-#else
-
 struct cmdline;
 
-#endif /* RTE_EXEC_ENV_WINDOWS */
-
 struct cmdline *cmdline_new(cmdline_parse_ctx_t *ctx, const char *prompt, int s_in, int s_out);
 void cmdline_set_prompt(struct cmdline *cl, const char *prompt);
 void cmdline_free(struct cmdline *cl);
diff --git a/lib/cmdline/cmdline_private.h b/lib/cmdline/cmdline_private.h
index a87c45275c..2e93674c66 100644
--- a/lib/cmdline/cmdline_private.h
+++ b/lib/cmdline/cmdline_private.h
@@ -11,6 +11,8 @@
 #include <rte_os_shim.h>
 #ifdef RTE_EXEC_ENV_WINDOWS
 #include <rte_windows.h>
+#else
+#include <termios.h>
 #endif
 
 #include <cmdline.h>
@@ -22,6 +24,7 @@ struct terminal {
 	int is_console_input;
 	int is_console_output;
 };
+#endif
 
 struct cmdline {
 	int s_in;
@@ -29,11 +32,14 @@ struct cmdline {
 	cmdline_parse_ctx_t *ctx;
 	struct rdline rdl;
 	char prompt[RDLINE_PROMPT_SIZE];
+#ifdef RTE_EXEC_ENV_WINDOWS
 	struct terminal oldterm;
 	char repeated_char;
 	WORD repeat_count;
-};
+#else
+	struct termios oldterm;
 #endif
+};
 
 /* Disable buffering and echoing, save previous settings to oldterm. */
 void terminal_adjust(struct cmdline *cl);
-- 
2.29.3


^ permalink raw reply	[relevance 8%]

* Re: [dpdk-dev] [PATCH v2 1/6] bbdev: add capability for CRC16 check
  2021-09-01 15:00  3%     ` Chautru, Nicolas
@ 2021-09-11 19:11  0%       ` Tom Rix
  0 siblings, 0 replies; 200+ results
From: Tom Rix @ 2021-09-11 19:11 UTC (permalink / raw)
  To: Chautru, Nicolas, dev, gakhil
  Cc: thomas, hemant.agrawal, Zhang, Mingshan, Joshi, Arun


On 9/1/21 8:00 AM, Chautru, Nicolas wrote:
>
>> -----Original Message-----
>> From: Tom Rix <trix@redhat.com>
>> Sent: Wednesday, September 1, 2021 6:37 AM
>> To: Chautru, Nicolas <nicolas.chautru@intel.com>; dev@dpdk.org;
>> gakhil@marvell.com
>> Cc: thomas@monjalon.net; hemant.agrawal@nxp.com; Zhang, Mingshan
>> <mingshan.zhang@intel.com>; Joshi, Arun <arun.joshi@intel.com>
>> Subject: Re: [PATCH v2 1/6] bbdev: add capability for CRC16 check
>>
>>
>> On 8/19/21 2:10 PM, Nicolas Chautru wrote:
>>> Adding a missing operation when CRC16
>>> is being used for TB CRC check.
>>>
>>> Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
>>> ---
>>>    app/test-bbdev/test_bbdev_vector.c     |  2 ++
>>>    doc/guides/prog_guide/bbdev.rst        |  3 +++
>>>    doc/guides/rel_notes/release_21_11.rst |  1 +
>>>    lib/bbdev/rte_bbdev_op.h               | 34 ++++++++++++++++++--------------
>> --
>>>    4 files changed, 24 insertions(+), 16 deletions(-)
>>>
>>> diff --git a/app/test-bbdev/test_bbdev_vector.c
>>> b/app/test-bbdev/test_bbdev_vector.c
>>> index 614dbd1..8d796b1 100644
>>> --- a/app/test-bbdev/test_bbdev_vector.c
>>> +++ b/app/test-bbdev/test_bbdev_vector.c
>>> @@ -167,6 +167,8 @@
>>>    		*op_flag_value = RTE_BBDEV_LDPC_CRC_TYPE_24B_CHECK;
>>>    	else if (!strcmp(token, "RTE_BBDEV_LDPC_CRC_TYPE_24B_DROP"))
>>>    		*op_flag_value = RTE_BBDEV_LDPC_CRC_TYPE_24B_DROP;
>>> +	else if (!strcmp(token, "RTE_BBDEV_LDPC_CRC_TYPE_16_CHECK"))
>>> +		*op_flag_value = RTE_BBDEV_LDPC_CRC_TYPE_16_CHECK;
>>>    	else if (!strcmp(token,
>> "RTE_BBDEV_LDPC_DEINTERLEAVER_BYPASS"))
>>>    		*op_flag_value =
>> RTE_BBDEV_LDPC_DEINTERLEAVER_BYPASS;
>>>    	else if (!strcmp(token,
>> "RTE_BBDEV_LDPC_HQ_COMBINE_IN_ENABLE"))
>>> diff --git a/doc/guides/prog_guide/bbdev.rst
>>> b/doc/guides/prog_guide/bbdev.rst index 9619280..8bd7cba 100644
>>> --- a/doc/guides/prog_guide/bbdev.rst
>>> +++ b/doc/guides/prog_guide/bbdev.rst
>>> @@ -891,6 +891,9 @@ given below.
>>>    |RTE_BBDEV_LDPC_CRC_TYPE_24B_DROP                                    |
>>>    | Set to drop the last CRC bits decoding output                      |
>>>
>>> +--------------------------------------------------------------------+
>>> +|RTE_BBDEV_LDPC_CRC_TYPE_16_CHECK                                    |
>>> +| Set for code block CRC-16 checking                                 |
>>> ++--------------------------------------------------------------------+
>>>    |RTE_BBDEV_LDPC_DEINTERLEAVER_BYPASS                                 |
>>>    | Set for bit-level de-interleaver bypass on input stream            |
>>>
>>> +--------------------------------------------------------------------+
>>> diff --git a/doc/guides/rel_notes/release_21_11.rst
>>> b/doc/guides/rel_notes/release_21_11.rst
>>> index d707a55..69dd518 100644
>>> --- a/doc/guides/rel_notes/release_21_11.rst
>>> +++ b/doc/guides/rel_notes/release_21_11.rst
>>> @@ -84,6 +84,7 @@ API Changes
>>>       Also, make sure to start the actual text at the margin.
>>>       =======================================================
>>>
>>> +* bbdev: Added capability related to more comprehensive CRC options.
>>>
>>>    ABI Changes
>>>    -----------
>>> diff --git a/lib/bbdev/rte_bbdev_op.h b/lib/bbdev/rte_bbdev_op.h index
>>> f946842..7c44ddd 100644
>>> --- a/lib/bbdev/rte_bbdev_op.h
>>> +++ b/lib/bbdev/rte_bbdev_op.h
>>> @@ -142,51 +142,53 @@ enum rte_bbdev_op_ldpcdec_flag_bitmasks {
>>>    	RTE_BBDEV_LDPC_CRC_TYPE_24B_CHECK = (1ULL << 1),
>>>    	/** Set to drop the last CRC bits decoding output */
>>>    	RTE_BBDEV_LDPC_CRC_TYPE_24B_DROP = (1ULL << 2),
>>> +	/** Set for transport block CRC-16 checking */
>>> +	RTE_BBDEV_LDPC_CRC_TYPE_16_CHECK = (1ULL << 3),
>> Changing these enums will break the abi backwards.
>>
>> Why not add the new one at the end ?
> To keep all the CRC related flags next to each other for better readability and logical clarity. The ABI is still marked as experimental.

Ok

>
>> Tom
>>
>>>    	/** Set for bit-level de-interleaver bypass on Rx stream. */
>>> -	RTE_BBDEV_LDPC_DEINTERLEAVER_BYPASS = (1ULL << 3),
>>> +	RTE_BBDEV_LDPC_DEINTERLEAVER_BYPASS = (1ULL << 4),
>>>    	/** Set for HARQ combined input stream enable. */
>>> -	RTE_BBDEV_LDPC_HQ_COMBINE_IN_ENABLE = (1ULL << 4),
>>> +	RTE_BBDEV_LDPC_HQ_COMBINE_IN_ENABLE = (1ULL << 5),
>>>    	/** Set for HARQ combined output stream enable. */
>>> -	RTE_BBDEV_LDPC_HQ_COMBINE_OUT_ENABLE = (1ULL << 5),
>>> +	RTE_BBDEV_LDPC_HQ_COMBINE_OUT_ENABLE = (1ULL << 6),
>>>    	/** Set for LDPC decoder bypass.
>>>    	 *  RTE_BBDEV_LDPC_HQ_COMBINE_OUT_ENABLE must be set.
>>>    	 */
>>> -	RTE_BBDEV_LDPC_DECODE_BYPASS = (1ULL << 6),
>>> +	RTE_BBDEV_LDPC_DECODE_BYPASS = (1ULL << 7),
>>>    	/** Set for soft-output stream enable */
>>> -	RTE_BBDEV_LDPC_SOFT_OUT_ENABLE = (1ULL << 7),
>>> +	RTE_BBDEV_LDPC_SOFT_OUT_ENABLE = (1ULL << 8),
>>>    	/** Set for Rate-Matching bypass on soft-out stream. */
>>> -	RTE_BBDEV_LDPC_SOFT_OUT_RM_BYPASS = (1ULL << 8),
>>> +	RTE_BBDEV_LDPC_SOFT_OUT_RM_BYPASS = (1ULL << 9),
>>>    	/** Set for bit-level de-interleaver bypass on soft-output stream. */
>>> -	RTE_BBDEV_LDPC_SOFT_OUT_DEINTERLEAVER_BYPASS = (1ULL <<
>> 9),
>>> +	RTE_BBDEV_LDPC_SOFT_OUT_DEINTERLEAVER_BYPASS = (1ULL <<
>> 10),
>>>    	/** Set for iteration stopping on successful decode condition
>>>    	 *  i.e. a successful syndrome check.
>>>    	 */
>>> -	RTE_BBDEV_LDPC_ITERATION_STOP_ENABLE = (1ULL << 10),
>>> +	RTE_BBDEV_LDPC_ITERATION_STOP_ENABLE = (1ULL << 11),
>>>    	/** Set if a device supports decoder dequeue interrupts. */
>>> -	RTE_BBDEV_LDPC_DEC_INTERRUPTS = (1ULL << 11),
>>> +	RTE_BBDEV_LDPC_DEC_INTERRUPTS = (1ULL << 12),
>>>    	/** Set if a device supports scatter-gather functionality. */
>>> -	RTE_BBDEV_LDPC_DEC_SCATTER_GATHER = (1ULL << 12),
>>> +	RTE_BBDEV_LDPC_DEC_SCATTER_GATHER = (1ULL << 13),
>>>    	/** Set if a device supports input/output HARQ compression. */
>>> -	RTE_BBDEV_LDPC_HARQ_6BIT_COMPRESSION = (1ULL << 13),
>>> +	RTE_BBDEV_LDPC_HARQ_6BIT_COMPRESSION = (1ULL << 14),
>>>    	/** Set if a device supports input LLR compression. */
>>> -	RTE_BBDEV_LDPC_LLR_COMPRESSION = (1ULL << 14),
>>> +	RTE_BBDEV_LDPC_LLR_COMPRESSION = (1ULL << 15),
>>>    	/** Set if a device supports HARQ input from
>>>    	 *  device's internal memory.
>>>    	 */
>>> -	RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_IN_ENABLE = (1ULL
>> << 15),
>>> +	RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_IN_ENABLE = (1ULL
>> << 16),
>>>    	/** Set if a device supports HARQ output to
>>>    	 *  device's internal memory.
>>>    	 */
>>> -	RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_OUT_ENABLE =
>> (1ULL << 16),
>>> +	RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_OUT_ENABLE =
>> (1ULL << 17),
>>>    	/** Set if a device supports loop-back access to
>>>    	 *  HARQ internal memory. Intended for troubleshooting.
>>>    	 */
>>> -	RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_LOOPBACK = (1ULL
>> << 17),
>>> +	RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_LOOPBACK = (1ULL
>> << 18),
>>>    	/** Set if a device includes LLR filler bits in the circular buffer
>>>    	 *  for HARQ memory. If not set, it is assumed the filler bits are not
>>>    	 *  in HARQ memory and handled directly by the LDPC decoder.
>>>    	 */
>>> -	RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_FILLERS = (1ULL <<
>> 18)
>>> +	RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_FILLERS = (1ULL <<
>> 19)
>>>    };
>>>
>>>    /** Flags for LDPC encoder operation and capability structure */


^ permalink raw reply	[relevance 0%]

* Re: [dpdk-dev] [PATCH v3 1/6] bbdev: add capability for CRC16 check
  2021-09-08  1:15  4% ` [dpdk-dev] [PATCH v3 1/6] bbdev: add capability for CRC16 check Nicolas Chautru
@ 2021-09-12 12:35  0%   ` Tom Rix
  0 siblings, 0 replies; 200+ results
From: Tom Rix @ 2021-09-12 12:35 UTC (permalink / raw)
  To: Nicolas Chautru, dev, gakhil
  Cc: thomas, hemant.agrawal, mingshan.zhang, arun.joshi


On 9/7/21 6:15 PM, Nicolas Chautru wrote:
> Adding a missing operation when CRC16
> is being used for TB CRC check.
>
> Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
> ---
>   app/test-bbdev/test_bbdev_vector.c     |  2 ++
>   doc/guides/prog_guide/bbdev.rst        |  3 +++
>   doc/guides/rel_notes/release_21_11.rst |  1 +
>   lib/bbdev/rte_bbdev_op.h               | 34 ++++++++++++++++++----------------
>   4 files changed, 24 insertions(+), 16 deletions(-)
>
> diff --git a/app/test-bbdev/test_bbdev_vector.c b/app/test-bbdev/test_bbdev_vector.c
> index 614dbd1..8d796b1 100644
> --- a/app/test-bbdev/test_bbdev_vector.c
> +++ b/app/test-bbdev/test_bbdev_vector.c
> @@ -167,6 +167,8 @@
>   		*op_flag_value = RTE_BBDEV_LDPC_CRC_TYPE_24B_CHECK;
>   	else if (!strcmp(token, "RTE_BBDEV_LDPC_CRC_TYPE_24B_DROP"))
>   		*op_flag_value = RTE_BBDEV_LDPC_CRC_TYPE_24B_DROP;
> +	else if (!strcmp(token, "RTE_BBDEV_LDPC_CRC_TYPE_16_CHECK"))
> +		*op_flag_value = RTE_BBDEV_LDPC_CRC_TYPE_16_CHECK;
>   	else if (!strcmp(token, "RTE_BBDEV_LDPC_DEINTERLEAVER_BYPASS"))
>   		*op_flag_value = RTE_BBDEV_LDPC_DEINTERLEAVER_BYPASS;
>   	else if (!strcmp(token, "RTE_BBDEV_LDPC_HQ_COMBINE_IN_ENABLE"))
> diff --git a/doc/guides/prog_guide/bbdev.rst b/doc/guides/prog_guide/bbdev.rst
> index 9619280..8bd7cba 100644
> --- a/doc/guides/prog_guide/bbdev.rst
> +++ b/doc/guides/prog_guide/bbdev.rst
> @@ -891,6 +891,9 @@ given below.
>   |RTE_BBDEV_LDPC_CRC_TYPE_24B_DROP                                    |
>   | Set to drop the last CRC bits decoding output                      |
>   +--------------------------------------------------------------------+
> +|RTE_BBDEV_LDPC_CRC_TYPE_16_CHECK                                    |
> +| Set for code block CRC-16 checking                                 |
> ++--------------------------------------------------------------------+
>   |RTE_BBDEV_LDPC_DEINTERLEAVER_BYPASS                                 |
>   | Set for bit-level de-interleaver bypass on input stream            |
>   +--------------------------------------------------------------------+
> diff --git a/doc/guides/rel_notes/release_21_11.rst b/doc/guides/rel_notes/release_21_11.rst
> index d707a55..69dd518 100644
> --- a/doc/guides/rel_notes/release_21_11.rst
> +++ b/doc/guides/rel_notes/release_21_11.rst
> @@ -84,6 +84,7 @@ API Changes
>      Also, make sure to start the actual text at the margin.
>      =======================================================
>   
> +* bbdev: Added capability related to more comprehensive CRC options.
>   
>   ABI Changes
>   -----------
> diff --git a/lib/bbdev/rte_bbdev_op.h b/lib/bbdev/rte_bbdev_op.h
> index f946842..7c44ddd 100644
> --- a/lib/bbdev/rte_bbdev_op.h
> +++ b/lib/bbdev/rte_bbdev_op.h
> @@ -142,51 +142,53 @@ enum rte_bbdev_op_ldpcdec_flag_bitmasks {
>   	RTE_BBDEV_LDPC_CRC_TYPE_24B_CHECK = (1ULL << 1),
>   	/** Set to drop the last CRC bits decoding output */
>   	RTE_BBDEV_LDPC_CRC_TYPE_24B_DROP = (1ULL << 2),
> +	/** Set for transport block CRC-16 checking */
> +	RTE_BBDEV_LDPC_CRC_TYPE_16_CHECK = (1ULL << 3),
>   	/** Set for bit-level de-interleaver bypass on Rx stream. */
> -	RTE_BBDEV_LDPC_DEINTERLEAVER_BYPASS = (1ULL << 3),
> +	RTE_BBDEV_LDPC_DEINTERLEAVER_BYPASS = (1ULL << 4),
>   	/** Set for HARQ combined input stream enable. */
> -	RTE_BBDEV_LDPC_HQ_COMBINE_IN_ENABLE = (1ULL << 4),
> +	RTE_BBDEV_LDPC_HQ_COMBINE_IN_ENABLE = (1ULL << 5),
>   	/** Set for HARQ combined output stream enable. */
> -	RTE_BBDEV_LDPC_HQ_COMBINE_OUT_ENABLE = (1ULL << 5),
> +	RTE_BBDEV_LDPC_HQ_COMBINE_OUT_ENABLE = (1ULL << 6),
>   	/** Set for LDPC decoder bypass.
>   	 *  RTE_BBDEV_LDPC_HQ_COMBINE_OUT_ENABLE must be set.
>   	 */
> -	RTE_BBDEV_LDPC_DECODE_BYPASS = (1ULL << 6),
> +	RTE_BBDEV_LDPC_DECODE_BYPASS = (1ULL << 7),
>   	/** Set for soft-output stream enable */
> -	RTE_BBDEV_LDPC_SOFT_OUT_ENABLE = (1ULL << 7),
> +	RTE_BBDEV_LDPC_SOFT_OUT_ENABLE = (1ULL << 8),
>   	/** Set for Rate-Matching bypass on soft-out stream. */
> -	RTE_BBDEV_LDPC_SOFT_OUT_RM_BYPASS = (1ULL << 8),
> +	RTE_BBDEV_LDPC_SOFT_OUT_RM_BYPASS = (1ULL << 9),
>   	/** Set for bit-level de-interleaver bypass on soft-output stream. */
> -	RTE_BBDEV_LDPC_SOFT_OUT_DEINTERLEAVER_BYPASS = (1ULL << 9),
> +	RTE_BBDEV_LDPC_SOFT_OUT_DEINTERLEAVER_BYPASS = (1ULL << 10),
>   	/** Set for iteration stopping on successful decode condition
>   	 *  i.e. a successful syndrome check.
>   	 */
> -	RTE_BBDEV_LDPC_ITERATION_STOP_ENABLE = (1ULL << 10),
> +	RTE_BBDEV_LDPC_ITERATION_STOP_ENABLE = (1ULL << 11),
>   	/** Set if a device supports decoder dequeue interrupts. */
> -	RTE_BBDEV_LDPC_DEC_INTERRUPTS = (1ULL << 11),
> +	RTE_BBDEV_LDPC_DEC_INTERRUPTS = (1ULL << 12),
>   	/** Set if a device supports scatter-gather functionality. */
> -	RTE_BBDEV_LDPC_DEC_SCATTER_GATHER = (1ULL << 12),
> +	RTE_BBDEV_LDPC_DEC_SCATTER_GATHER = (1ULL << 13),
>   	/** Set if a device supports input/output HARQ compression. */
> -	RTE_BBDEV_LDPC_HARQ_6BIT_COMPRESSION = (1ULL << 13),
> +	RTE_BBDEV_LDPC_HARQ_6BIT_COMPRESSION = (1ULL << 14),
>   	/** Set if a device supports input LLR compression. */
> -	RTE_BBDEV_LDPC_LLR_COMPRESSION = (1ULL << 14),
> +	RTE_BBDEV_LDPC_LLR_COMPRESSION = (1ULL << 15),
>   	/** Set if a device supports HARQ input from
>   	 *  device's internal memory.
>   	 */
> -	RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_IN_ENABLE = (1ULL << 15),
> +	RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_IN_ENABLE = (1ULL << 16),
>   	/** Set if a device supports HARQ output to
>   	 *  device's internal memory.
>   	 */
> -	RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_OUT_ENABLE = (1ULL << 16),
> +	RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_OUT_ENABLE = (1ULL << 17),
>   	/** Set if a device supports loop-back access to
>   	 *  HARQ internal memory. Intended for troubleshooting.
>   	 */
> -	RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_LOOPBACK = (1ULL << 17),
> +	RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_LOOPBACK = (1ULL << 18),
>   	/** Set if a device includes LLR filler bits in the circular buffer
>   	 *  for HARQ memory. If not set, it is assumed the filler bits are not
>   	 *  in HARQ memory and handled directly by the LDPC decoder.
>   	 */
> -	RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_FILLERS = (1ULL << 18)
> +	RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_FILLERS = (1ULL << 19)

The fiddling in the middle is fine since bbdev api is experimental

Look good.

Reviewed-by: Tom Rix <trix@redhat.com>

>   };
>   
>   /** Flags for LDPC encoder operation and capability structure */


^ permalink raw reply	[relevance 0%]

* Re: [dpdk-dev] [EXT] Re: [PATCH] RFC: ethdev: add reassembly offload
  2021-09-08 10:29  0%   ` [dpdk-dev] [EXT] " Anoob Joseph
@ 2021-09-13  6:56  0%     ` Xu, Rosen
  2021-09-13  7:22  0%       ` Andrew Rybchenko
  0 siblings, 1 reply; 200+ results
From: Xu, Rosen @ 2021-09-13  6:56 UTC (permalink / raw)
  To: Anoob Joseph, Yigit, Ferruh, Andrew Rybchenko
  Cc: Nicolau, Radu, Doherty, Declan, hemant.agrawal, matan, Ananyev,
	Konstantin, thomas, Ankur Dwivedi, andrew.rybchenko, Akhil Goyal,
	dev, Xu, Rosen

Hi,

> -----Original Message-----
> From: Anoob Joseph <anoobj@marvell.com>
> Sent: Wednesday, September 08, 2021 18:30
> To: Yigit, Ferruh <ferruh.yigit@intel.com>; Xu, Rosen <rosen.xu@intel.com>;
> Andrew Rybchenko <arybchenko@solarflare.com>
> Cc: Nicolau, Radu <radu.nicolau@intel.com>; Doherty, Declan
> <declan.doherty@intel.com>; hemant.agrawal@nxp.com;
> matan@nvidia.com; Ananyev, Konstantin <konstantin.ananyev@intel.com>;
> thomas@monjalon.net; Ankur Dwivedi <adwivedi@marvell.com>;
> andrew.rybchenko@oktetlabs.ru; Akhil Goyal <gakhil@marvell.com>;
> dev@dpdk.org
> Subject: RE: [EXT] Re: [PATCH] RFC: ethdev: add reassembly offload
> 
> Hi Ferruh, Rosen, Andrew,
> 
> Please see inline.
> 
> Thanks,
> Anoob
> 
> > Subject: [EXT] Re: [PATCH] RFC: ethdev: add reassembly offload
> >
> > External Email
> >
> > ----------------------------------------------------------------------
> > On 8/23/2021 11:02 AM, Akhil Goyal wrote:
> > > Reassembly is a costly operation if it is done in software, however,
> > > if it is offloaded to HW, it can considerably save application cycles.
> > > The operation becomes even more costlier if IP fragmants are
> > > encrypted.
> > >
> > > To resolve above two issues, a new offload
> > DEV_RX_OFFLOAD_REASSEMBLY
> > > is introduced in ethdev for devices which can attempt reassembly of
> > > packets in hardware.
> > > rte_eth_dev_info is added with the reassembly capabilities which a
> > > device can support.
> > > Now, if IP fragments are encrypted, reassembly can also be attempted
> > > while doing inline IPsec processing.
> > > This is controlled by a flag in rte_security_ipsec_sa_options to
> > > enable reassembly of encrypted IP fragments in the inline path.
> > >
> > > The resulting reassembled packet would be a typical segmented mbuf
> > > in case of success.
> > >
> > > And if reassembly of fragments is failed or is incomplete (if
> > > fragments do not come before the reass_timeout), the mbuf is updated
> > > with an ol_flag PKT_RX_REASSEMBLY_INCOMPLETE and mbuf is returned
> > as
> > > is. Now application may decide the fate of the packet to wait more
> > > for fragments to come or drop.
> > >
> > > Signed-off-by: Akhil Goyal <gakhil@marvell.com>
> > > ---
> > >  lib/ethdev/rte_ethdev.c     |  1 +
> > >  lib/ethdev/rte_ethdev.h     | 18 +++++++++++++++++-
> > >  lib/mbuf/rte_mbuf_core.h    |  3 ++-
> > >  lib/security/rte_security.h | 10 ++++++++++
> > >  4 files changed, 30 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c index
> > > 9d95cd11e1..1ab3a093cf 100644
> > > --- a/lib/ethdev/rte_ethdev.c
> > > +++ b/lib/ethdev/rte_ethdev.c
> > > @@ -119,6 +119,7 @@ static const struct {
> > >  	RTE_RX_OFFLOAD_BIT2STR(VLAN_FILTER),
> > >  	RTE_RX_OFFLOAD_BIT2STR(VLAN_EXTEND),
> > >  	RTE_RX_OFFLOAD_BIT2STR(JUMBO_FRAME),
> > > +	RTE_RX_OFFLOAD_BIT2STR(REASSEMBLY),
> > >  	RTE_RX_OFFLOAD_BIT2STR(SCATTER),
> > >  	RTE_RX_OFFLOAD_BIT2STR(TIMESTAMP),
> > >  	RTE_RX_OFFLOAD_BIT2STR(SECURITY),
> > > diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h index
> > > d2b27c351f..e89a4dc1eb 100644
> > > --- a/lib/ethdev/rte_ethdev.h
> > > +++ b/lib/ethdev/rte_ethdev.h
> > > @@ -1360,6 +1360,7 @@ struct rte_eth_conf {
> > >  #define DEV_RX_OFFLOAD_VLAN_FILTER	0x00000200
> > >  #define DEV_RX_OFFLOAD_VLAN_EXTEND	0x00000400
> > >  #define DEV_RX_OFFLOAD_JUMBO_FRAME	0x00000800
> > > +#define DEV_RX_OFFLOAD_REASSEMBLY	0x00001000
> >
> > previous '0x00001000' was 'DEV_RX_OFFLOAD_CRC_STRIP', it has been
> long
> > that offload has been removed, but not sure if it cause any problem to
> > re- use it.
> >
> > >  #define DEV_RX_OFFLOAD_SCATTER		0x00002000
> > >  /**
> > >   * Timestamp is set by the driver in
> > RTE_MBUF_DYNFIELD_TIMESTAMP_NAME
> > > @@ -1477,6 +1478,20 @@ struct rte_eth_dev_portconf {
> > >   */
> > >  #define RTE_ETH_DEV_SWITCH_DOMAIN_ID_INVALID
> > 	(UINT16_MAX)
> > >
> > > +/**
> > > + * Reassembly capabilities that a device can support.
> > > + * The device which can support reassembly offload should set
> > > + * DEV_RX_OFFLOAD_REASSEMBLY
> > > + */
> > > +struct rte_eth_reass_capa {
> > > +	/** Maximum time in ns that a fragment can wait for further
> > fragments */
> > > +	uint64_t reass_timeout;
> > > +	/** Maximum number of fragments that device can reassemble */
> > > +	uint16_t max_frags;
> > > +	/** Reserved for future capabilities */
> > > +	uint16_t reserved[3];
> > > +};
> > > +
> >
> > I wonder if there is any other hardware around supports reassembly
> > offload, it would be good to get more feedback on the capabilities list.
> >
> > >  /**
> > >   * Ethernet device associated switch information
> > >   */
> > > @@ -1582,8 +1597,9 @@ struct rte_eth_dev_info {
> > >  	 * embedded managed interconnect/switch.
> > >  	 */
> > >  	struct rte_eth_switch_info switch_info;
> > > +	/* Reassembly capabilities of a device for reassembly offload */
> > > +	struct rte_eth_reass_capa reass_capa;
> > >
> > > -	uint64_t reserved_64s[2]; /**< Reserved for future fields */
> >
> > Reserved fields were added to be able to update the struct without
> > breaking the ABI, so that a critical change doesn't have to wait until
> > next ABI break release.
> > Since this is ABI break release, we can keep the reserved field and
> > add the new struct. Or this can be an opportunity to get rid of the reserved
> field.
> >
> > Personally I have no objection to get rid of the reserved field, but
> > better to agree on this explicitly.
> >
> > >  	void *reserved_ptrs[2];   /**< Reserved for future fields */
> > >  };
> > >
> > > diff --git a/lib/mbuf/rte_mbuf_core.h b/lib/mbuf/rte_mbuf_core.h
> > > index
> > > bb38d7f581..cea25c87f7 100644
> > > --- a/lib/mbuf/rte_mbuf_core.h
> > > +++ b/lib/mbuf/rte_mbuf_core.h
> > > @@ -200,10 +200,11 @@ extern "C" {
> > >  #define PKT_RX_OUTER_L4_CKSUM_BAD	(1ULL << 21)
> > >  #define PKT_RX_OUTER_L4_CKSUM_GOOD	(1ULL << 22)
> > >  #define PKT_RX_OUTER_L4_CKSUM_INVALID	((1ULL << 21) | (1ULL
> > << 22))
> > > +#define PKT_RX_REASSEMBLY_INCOMPLETE	(1ULL << 23)
> > >
> >
> > Similar comment with Andrew's, what is the expectation from
> > application if this flag exists? Can we drop it to simplify the logic in the
> application?
> 
> [Anoob] There can be few cases where hardware/NIC attempts inline
> reassembly but it fails to complete it
> 
> 1. Number of fragments is larger than what is supported by the hardware 2.
> Hardware reassembly resources are exhausted (due to limited reassembly
> contexts etc) 3. Reassembly errors such as overlapping fragments 4. Wait
> time exhausted (or reassembly timeout)
> 
> In such cases, application would be required to retrieve the original
> fragments so that it can attempt reassembly in software. The incomplete flag
> is useful for 2 purposes basically, 1. Application would need to retrieve the
> time the fragment has already spend in hardware reassembly so that
> software reassembly attempt can compensate for it. Otherwise, reassembly
> timeout across hardware + software will not be accurate 2. Retrieve original
> fragments. With this proposal, an incomplete reassembly would result in a
> chained mbuf but the segments need not be consecutive. To explain bit more,
> 
> Suppose we have a packet that is fragmented into 3 fragments, and fragment
> 3 & fragment 1 arrives in that order. Fragment 2 didn't arrive and hardware
> ultimately pushes it. In that case, application would be receiving a
> chained/segmented mbuf with fragment 1 & fragment 3 chained.
> 
> Now, this chained mbuf can't be treated like a regular chained mbuf. Each
> fragment would have its IP hdr and there are fragments missing in between.
> The only thing application is expected to do is, retrieve fragments, push it to
> s/w reassembly.

What you mentioned is error identification. But actually a negotiation about max frame size is needed before datagrams tx/rx.
> >
> > >  /* add new RX flags here, don't forget to update PKT_FIRST_FREE */
> > >
> > > -#define PKT_FIRST_FREE (1ULL << 23)
> > > +#define PKT_FIRST_FREE (1ULL << 24)
> > >  #define PKT_LAST_FREE (1ULL << 40)
> > >
> > >  /* add new TX flags here, don't forget to update PKT_LAST_FREE  */
> > > diff --git a/lib/security/rte_security.h
> > > b/lib/security/rte_security.h index 88d31de0a6..364eeb5cd4 100644
> > > --- a/lib/security/rte_security.h
> > > +++ b/lib/security/rte_security.h
> > > @@ -181,6 +181,16 @@ struct rte_security_ipsec_sa_options {
> > >  	 * * 0: Disable per session security statistics collection for this SA.
> > >  	 */
> > >  	uint32_t stats : 1;
> > > +
> > > +	/** Enable reassembly on incoming packets.
> > > +	 *
> > > +	 * * 1: Enable driver to try reassembly of encrypted IP packets for
> > > +	 *      this SA, if supported by the driver. This feature will work
> > > +	 *      only if rx_offload DEV_RX_OFFLOAD_REASSEMBLY is set in
> > > +	 *      inline ethernet device.
> > > +	 * * 0: Disable reassembly of packets (default).
> > > +	 */
> > > +	uint32_t reass_en : 1;
> > >  };
> > >
> > >  /** IPSec security association direction */
> > >


^ permalink raw reply	[relevance 0%]

* Re: [dpdk-dev] [EXT] Re: [PATCH] RFC: ethdev: add reassembly offload
  2021-09-13  6:56  0%     ` Xu, Rosen
@ 2021-09-13  7:22  0%       ` Andrew Rybchenko
  2021-09-14  5:14  0%         ` Anoob Joseph
  0 siblings, 1 reply; 200+ results
From: Andrew Rybchenko @ 2021-09-13  7:22 UTC (permalink / raw)
  To: Xu, Rosen, Anoob Joseph, Yigit, Ferruh, Andrew Rybchenko
  Cc: Nicolau, Radu, Doherty, Declan, hemant.agrawal, matan, Ananyev,
	Konstantin, thomas, Ankur Dwivedi, Akhil Goyal, dev

On 9/13/21 9:56 AM, Xu, Rosen wrote:
> Hi,
> 
>> -----Original Message-----
>> From: Anoob Joseph <anoobj@marvell.com>
>> Sent: Wednesday, September 08, 2021 18:30
>> To: Yigit, Ferruh <ferruh.yigit@intel.com>; Xu, Rosen <rosen.xu@intel.com>;
>> Andrew Rybchenko <arybchenko@solarflare.com>
>> Cc: Nicolau, Radu <radu.nicolau@intel.com>; Doherty, Declan
>> <declan.doherty@intel.com>; hemant.agrawal@nxp.com;
>> matan@nvidia.com; Ananyev, Konstantin <konstantin.ananyev@intel.com>;
>> thomas@monjalon.net; Ankur Dwivedi <adwivedi@marvell.com>;
>> andrew.rybchenko@oktetlabs.ru; Akhil Goyal <gakhil@marvell.com>;
>> dev@dpdk.org
>> Subject: RE: [EXT] Re: [PATCH] RFC: ethdev: add reassembly offload
>>
>> Hi Ferruh, Rosen, Andrew,
>>
>> Please see inline.
>>
>> Thanks,
>> Anoob
>>
>>> Subject: [EXT] Re: [PATCH] RFC: ethdev: add reassembly offload
>>>
>>> External Email
>>>
>>> ----------------------------------------------------------------------
>>> On 8/23/2021 11:02 AM, Akhil Goyal wrote:
>>>> Reassembly is a costly operation if it is done in software, however,
>>>> if it is offloaded to HW, it can considerably save application cycles.
>>>> The operation becomes even more costlier if IP fragmants are
>>>> encrypted.
>>>>
>>>> To resolve above two issues, a new offload
>>> DEV_RX_OFFLOAD_REASSEMBLY
>>>> is introduced in ethdev for devices which can attempt reassembly of
>>>> packets in hardware.
>>>> rte_eth_dev_info is added with the reassembly capabilities which a
>>>> device can support.
>>>> Now, if IP fragments are encrypted, reassembly can also be attempted
>>>> while doing inline IPsec processing.
>>>> This is controlled by a flag in rte_security_ipsec_sa_options to
>>>> enable reassembly of encrypted IP fragments in the inline path.
>>>>
>>>> The resulting reassembled packet would be a typical segmented mbuf
>>>> in case of success.
>>>>
>>>> And if reassembly of fragments is failed or is incomplete (if
>>>> fragments do not come before the reass_timeout), the mbuf is updated
>>>> with an ol_flag PKT_RX_REASSEMBLY_INCOMPLETE and mbuf is returned
>>> as
>>>> is. Now application may decide the fate of the packet to wait more
>>>> for fragments to come or drop.
>>>>
>>>> Signed-off-by: Akhil Goyal <gakhil@marvell.com>
>>>> ---
>>>>  lib/ethdev/rte_ethdev.c     |  1 +
>>>>  lib/ethdev/rte_ethdev.h     | 18 +++++++++++++++++-
>>>>  lib/mbuf/rte_mbuf_core.h    |  3 ++-
>>>>  lib/security/rte_security.h | 10 ++++++++++
>>>>  4 files changed, 30 insertions(+), 2 deletions(-)
>>>>
>>>> diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c index
>>>> 9d95cd11e1..1ab3a093cf 100644
>>>> --- a/lib/ethdev/rte_ethdev.c
>>>> +++ b/lib/ethdev/rte_ethdev.c
>>>> @@ -119,6 +119,7 @@ static const struct {
>>>>  	RTE_RX_OFFLOAD_BIT2STR(VLAN_FILTER),
>>>>  	RTE_RX_OFFLOAD_BIT2STR(VLAN_EXTEND),
>>>>  	RTE_RX_OFFLOAD_BIT2STR(JUMBO_FRAME),
>>>> +	RTE_RX_OFFLOAD_BIT2STR(REASSEMBLY),
>>>>  	RTE_RX_OFFLOAD_BIT2STR(SCATTER),
>>>>  	RTE_RX_OFFLOAD_BIT2STR(TIMESTAMP),
>>>>  	RTE_RX_OFFLOAD_BIT2STR(SECURITY),
>>>> diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h index
>>>> d2b27c351f..e89a4dc1eb 100644
>>>> --- a/lib/ethdev/rte_ethdev.h
>>>> +++ b/lib/ethdev/rte_ethdev.h
>>>> @@ -1360,6 +1360,7 @@ struct rte_eth_conf {
>>>>  #define DEV_RX_OFFLOAD_VLAN_FILTER	0x00000200
>>>>  #define DEV_RX_OFFLOAD_VLAN_EXTEND	0x00000400
>>>>  #define DEV_RX_OFFLOAD_JUMBO_FRAME	0x00000800
>>>> +#define DEV_RX_OFFLOAD_REASSEMBLY	0x00001000
>>>
>>> previous '0x00001000' was 'DEV_RX_OFFLOAD_CRC_STRIP', it has been
>> long
>>> that offload has been removed, but not sure if it cause any problem to
>>> re- use it.
>>>
>>>>  #define DEV_RX_OFFLOAD_SCATTER		0x00002000
>>>>  /**
>>>>   * Timestamp is set by the driver in
>>> RTE_MBUF_DYNFIELD_TIMESTAMP_NAME
>>>> @@ -1477,6 +1478,20 @@ struct rte_eth_dev_portconf {
>>>>   */
>>>>  #define RTE_ETH_DEV_SWITCH_DOMAIN_ID_INVALID
>>> 	(UINT16_MAX)
>>>>
>>>> +/**
>>>> + * Reassembly capabilities that a device can support.
>>>> + * The device which can support reassembly offload should set
>>>> + * DEV_RX_OFFLOAD_REASSEMBLY
>>>> + */
>>>> +struct rte_eth_reass_capa {
>>>> +	/** Maximum time in ns that a fragment can wait for further
>>> fragments */
>>>> +	uint64_t reass_timeout;
>>>> +	/** Maximum number of fragments that device can reassemble */
>>>> +	uint16_t max_frags;
>>>> +	/** Reserved for future capabilities */
>>>> +	uint16_t reserved[3];
>>>> +};
>>>> +
>>>
>>> I wonder if there is any other hardware around supports reassembly
>>> offload, it would be good to get more feedback on the capabilities list.
>>>
>>>>  /**
>>>>   * Ethernet device associated switch information
>>>>   */
>>>> @@ -1582,8 +1597,9 @@ struct rte_eth_dev_info {
>>>>  	 * embedded managed interconnect/switch.
>>>>  	 */
>>>>  	struct rte_eth_switch_info switch_info;
>>>> +	/* Reassembly capabilities of a device for reassembly offload */
>>>> +	struct rte_eth_reass_capa reass_capa;
>>>>
>>>> -	uint64_t reserved_64s[2]; /**< Reserved for future fields */
>>>
>>> Reserved fields were added to be able to update the struct without
>>> breaking the ABI, so that a critical change doesn't have to wait until
>>> next ABI break release.
>>> Since this is ABI break release, we can keep the reserved field and
>>> add the new struct. Or this can be an opportunity to get rid of the reserved
>> field.
>>>
>>> Personally I have no objection to get rid of the reserved field, but
>>> better to agree on this explicitly.
>>>
>>>>  	void *reserved_ptrs[2];   /**< Reserved for future fields */
>>>>  };
>>>>
>>>> diff --git a/lib/mbuf/rte_mbuf_core.h b/lib/mbuf/rte_mbuf_core.h
>>>> index
>>>> bb38d7f581..cea25c87f7 100644
>>>> --- a/lib/mbuf/rte_mbuf_core.h
>>>> +++ b/lib/mbuf/rte_mbuf_core.h
>>>> @@ -200,10 +200,11 @@ extern "C" {
>>>>  #define PKT_RX_OUTER_L4_CKSUM_BAD	(1ULL << 21)
>>>>  #define PKT_RX_OUTER_L4_CKSUM_GOOD	(1ULL << 22)
>>>>  #define PKT_RX_OUTER_L4_CKSUM_INVALID	((1ULL << 21) | (1ULL
>>> << 22))
>>>> +#define PKT_RX_REASSEMBLY_INCOMPLETE	(1ULL << 23)
>>>>
>>>
>>> Similar comment with Andrew's, what is the expectation from
>>> application if this flag exists? Can we drop it to simplify the logic in the
>> application?
>>
>> [Anoob] There can be few cases where hardware/NIC attempts inline
>> reassembly but it fails to complete it
>>
>> 1. Number of fragments is larger than what is supported by the hardware 2.
>> Hardware reassembly resources are exhausted (due to limited reassembly
>> contexts etc) 3. Reassembly errors such as overlapping fragments 4. Wait
>> time exhausted (or reassembly timeout)
>>
>> In such cases, application would be required to retrieve the original
>> fragments so that it can attempt reassembly in software. The incomplete flag
>> is useful for 2 purposes basically, 1. Application would need to retrieve the
>> time the fragment has already spend in hardware reassembly so that
>> software reassembly attempt can compensate for it. Otherwise, reassembly
>> timeout across hardware + software will not be accurate 

Could you clarify how application will find out the time spent
in HW.

>> 2. Retrieve original
>> fragments. With this proposal, an incomplete reassembly would result in a
>> chained mbuf but the segments need not be consecutive. To explain bit more,
>>
>> Suppose we have a packet that is fragmented into 3 fragments, and fragment
>> 3 & fragment 1 arrives in that order. Fragment 2 didn't arrive and hardware
>> ultimately pushes it. In that case, application would be receiving a
>> chained/segmented mbuf with fragment 1 & fragment 3 chained.
>>
>> Now, this chained mbuf can't be treated like a regular chained mbuf. Each
>> fragment would have its IP hdr and there are fragments missing in between.
>> The only thing application is expected to do is, retrieve fragments, push it to
>> s/w reassembly.

It sounds like it conflicts with SCATTER and BUFFER_SPLIT
offloads which allow to return chained mbuf's. Don't know
if it is good or bad, but anyway it must be documented.

> 
> What you mentioned is error identification. But actually a negotiation about max frame size is needed before datagrams tx/rx.

It sounds like it is OK for informational purposes, but
right now I don't understand how it could be used by the
application. Application still has to support reassembly
in SW regardless of the information.

>>>
>>>>  /* add new RX flags here, don't forget to update PKT_FIRST_FREE */
>>>>
>>>> -#define PKT_FIRST_FREE (1ULL << 23)
>>>> +#define PKT_FIRST_FREE (1ULL << 24)
>>>>  #define PKT_LAST_FREE (1ULL << 40)
>>>>
>>>>  /* add new TX flags here, don't forget to update PKT_LAST_FREE  */
>>>> diff --git a/lib/security/rte_security.h
>>>> b/lib/security/rte_security.h index 88d31de0a6..364eeb5cd4 100644
>>>> --- a/lib/security/rte_security.h
>>>> +++ b/lib/security/rte_security.h
>>>> @@ -181,6 +181,16 @@ struct rte_security_ipsec_sa_options {
>>>>  	 * * 0: Disable per session security statistics collection for this SA.
>>>>  	 */
>>>>  	uint32_t stats : 1;
>>>> +
>>>> +	/** Enable reassembly on incoming packets.
>>>> +	 *
>>>> +	 * * 1: Enable driver to try reassembly of encrypted IP packets for
>>>> +	 *      this SA, if supported by the driver. This feature will work
>>>> +	 *      only if rx_offload DEV_RX_OFFLOAD_REASSEMBLY is set in
>>>> +	 *      inline ethernet device.
>>>> +	 * * 0: Disable reassembly of packets (default).
>>>> +	 */
>>>> +	uint32_t reass_en : 1;
>>>>  };
>>>>
>>>>  /** IPSec security association direction */
>>>>
> 


^ permalink raw reply	[relevance 0%]

* [dpdk-dev] [PATCH] eal: promote rte_mcfg_get_single_file_segment to stable ABI
@ 2021-09-13  8:44 13% Jakub Grajciar -X (jgrajcia - PANTHEON TECH SRO at Cisco)
  0 siblings, 0 replies; 200+ results
From: Jakub Grajciar -X (jgrajcia - PANTHEON TECH SRO at Cisco) @ 2021-09-13  8:44 UTC (permalink / raw)
  To: dev

Signed-off-by: Jakub Grajciar jgrajcia@cisco.com<mailto:jgrajcia@cisco.com>
---
 doc/guides/rel_notes/release_21_11.rst | 3 +++
 lib/eal/include/rte_eal_memconfig.h    | 4 ----
 lib/eal/version.map                    | 4 +---
 3 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/doc/guides/rel_notes/release_21_11.rst b/doc/guides/rel_notes/release_21_11.rst
index 675b573834..1611562f6a 100644
--- a/doc/guides/rel_notes/release_21_11.rst
+++ b/doc/guides/rel_notes/release_21_11.rst
@@ -107,6 +107,9 @@ ABI Changes
    Also, make sure to start the actual text at the margin.
    =======================================================

+* The experimental function ``rte_mcfg_get_single_file_segments`` has been
+  promoted to stable ABI.
+

 Known Issues
 ------------
diff --git a/lib/eal/include/rte_eal_memconfig.h b/lib/eal/include/rte_eal_memconfig.h
index dede2ee324..d61023d80a 100644
--- a/lib/eal/include/rte_eal_memconfig.h
+++ b/lib/eal/include/rte_eal_memconfig.h
@@ -112,13 +112,9 @@ void
 rte_mcfg_timer_unlock(void);

 /**
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice
- *
  * If true, pages are put in single files (per memseg list),
  * as opposed to creating a file per page.
  */
-__rte_experimental
 bool
 rte_mcfg_get_single_file_segments(void);

diff --git a/lib/eal/version.map b/lib/eal/version.map
index beeb986adc..0cb757a1cf 100644
--- a/lib/eal/version.map
+++ b/lib/eal/version.map
@@ -121,6 +121,7 @@ DPDK_22 {
    rte_malloc_socket;
    rte_malloc_validate;
    rte_malloc_virt2iova;
+   rte_mcfg_get_single_file_segments;
    rte_mcfg_mem_read_lock;
    rte_mcfg_mem_read_unlock;
    rte_mcfg_mem_write_lock;
@@ -328,9 +329,6 @@ EXPERIMENTAL {
    rte_mcfg_timer_unlock;
    rte_rand_max; # WINDOWS_NO_EXPORT

-   # added in 19.11
-   rte_mcfg_get_single_file_segments;
-
    # added in 20.02
    rte_thread_is_intr;

--
2.25.1



^ permalink raw reply	[relevance 13%]

* [dpdk-dev] [PATCH v5] ethdev: fix representor port ID search by name
      2021-08-31 16:06  3% ` [dpdk-dev] [PATCH v4] " Andrew Rybchenko
@ 2021-09-13 11:26  4% ` Andrew Rybchenko
  2 siblings, 0 replies; 200+ results
From: Andrew Rybchenko @ 2021-09-13 11:26 UTC (permalink / raw)
  To: Ajit Khaparde, Somnath Kotur, John Daley, Hyong Youb Kim,
	Beilei Xing, Qiming Yang, Qi Zhang, Haiyue Wang, Matan Azrad,
	Viacheslav Ovsiienko, Thomas Monjalon, Ferruh Yigit
  Cc: dev, Viacheslav Galaktionov

From: Viacheslav Galaktionov <viacheslav.galaktionov@oktetlabs.ru>

Getting a list of representors from a representor does not make sense.
Instead, a parent device should be used.

To this end, extend the rte_eth_dev_data structure to include the port ID
of the backing device for representors.

Signed-off-by: Viacheslav Galaktionov <viacheslav.galaktionov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
---
The new field is added into the hole in rte_eth_dev_data structure.
The patch does not change ABI, but extra care is required since ABI
check is disabled for the structure because of the libabigail bug [1].
It should not be a problem anyway since 21.11 is a ABI breaking release.

Potentially it is bad for out-of-tree drivers which implement
representors but do not fill in a new parert_port_id field in
rte_eth_dev_data structure. Get ID by name will not work.

mlx5 changes should be reviwed by maintainers very carefully, since
we are not sure if we patch it correctly.

[1] https://sourceware.org/bugzilla/show_bug.cgi?id=28060

v5:
    - try to improve name: backer_port_id instead of parent_port_id
    - init new field to RTE_MAX_ETHPORTS on allocation to avoid
      zero port usage by default

v4:
    - apply mlx5 review notes: remove fallback from generic ethdev
      code and add fallback to mlx5 code to handle legacy usecase

v3:
    - fix mlx5 build breakage

v2:
    - fix mlx5 review notes
    - try device port ID first before parent in order to address
      backward compatibility issue

 drivers/net/bnxt/bnxt_reps.c             |  1 +
 drivers/net/enic/enic_vf_representor.c   |  1 +
 drivers/net/i40e/i40e_vf_representor.c   |  1 +
 drivers/net/ice/ice_dcf_vf_representor.c |  1 +
 drivers/net/ixgbe/ixgbe_vf_representor.c |  1 +
 drivers/net/mlx5/linux/mlx5_os.c         | 13 +++++++++++++
 drivers/net/mlx5/windows/mlx5_os.c       | 13 +++++++++++++
 lib/ethdev/ethdev_driver.h               |  6 +++---
 lib/ethdev/rte_class_eth.c               |  2 +-
 lib/ethdev/rte_ethdev.c                  |  9 +++++----
 lib/ethdev/rte_ethdev_core.h             |  6 ++++++
 11 files changed, 46 insertions(+), 8 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_reps.c b/drivers/net/bnxt/bnxt_reps.c
index bdbad53b7d..0d50c0f1da 100644
--- a/drivers/net/bnxt/bnxt_reps.c
+++ b/drivers/net/bnxt/bnxt_reps.c
@@ -187,6 +187,7 @@ int bnxt_representor_init(struct rte_eth_dev *eth_dev, void *params)
 	eth_dev->data->dev_flags |= RTE_ETH_DEV_REPRESENTOR |
 					RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS;
 	eth_dev->data->representor_id = rep_params->vf_id;
+	eth_dev->data->backer_port_id = rep_params->parent_dev->data->port_id;
 
 	rte_eth_random_addr(vf_rep_bp->dflt_mac_addr);
 	memcpy(vf_rep_bp->mac_addr, vf_rep_bp->dflt_mac_addr,
diff --git a/drivers/net/enic/enic_vf_representor.c b/drivers/net/enic/enic_vf_representor.c
index 79dd6e5640..fedb09ecd6 100644
--- a/drivers/net/enic/enic_vf_representor.c
+++ b/drivers/net/enic/enic_vf_representor.c
@@ -662,6 +662,7 @@ int enic_vf_representor_init(struct rte_eth_dev *eth_dev, void *init_params)
 	eth_dev->data->dev_flags |= RTE_ETH_DEV_REPRESENTOR |
 					RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS;
 	eth_dev->data->representor_id = vf->vf_id;
+	eth_dev->data->backer_port_id = pf->port_id;
 	eth_dev->data->mac_addrs = rte_zmalloc("enic_mac_addr_vf",
 		sizeof(struct rte_ether_addr) *
 		ENIC_UNICAST_PERFECT_FILTERS, 0);
diff --git a/drivers/net/i40e/i40e_vf_representor.c b/drivers/net/i40e/i40e_vf_representor.c
index 0481b55381..d65b821a01 100644
--- a/drivers/net/i40e/i40e_vf_representor.c
+++ b/drivers/net/i40e/i40e_vf_representor.c
@@ -514,6 +514,7 @@ i40e_vf_representor_init(struct rte_eth_dev *ethdev, void *init_params)
 	ethdev->data->dev_flags |= RTE_ETH_DEV_REPRESENTOR |
 					RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS;
 	ethdev->data->representor_id = representor->vf_id;
+	ethdev->data->backer_port_id = pf->dev_data->port_id;
 
 	/* Setting the number queues allocated to the VF */
 	ethdev->data->nb_rx_queues = vf->vsi->nb_qps;
diff --git a/drivers/net/ice/ice_dcf_vf_representor.c b/drivers/net/ice/ice_dcf_vf_representor.c
index 970461f3e9..e51d0aa6b9 100644
--- a/drivers/net/ice/ice_dcf_vf_representor.c
+++ b/drivers/net/ice/ice_dcf_vf_representor.c
@@ -418,6 +418,7 @@ ice_dcf_vf_repr_init(struct rte_eth_dev *vf_rep_eth_dev, void *init_param)
 
 	vf_rep_eth_dev->data->dev_flags |= RTE_ETH_DEV_REPRESENTOR;
 	vf_rep_eth_dev->data->representor_id = repr->vf_id;
+	vf_rep_eth_dev->data->backer_port_id = repr->dcf_eth_dev->data->port_id;
 
 	vf_rep_eth_dev->data->mac_addrs = &repr->mac_addr;
 
diff --git a/drivers/net/ixgbe/ixgbe_vf_representor.c b/drivers/net/ixgbe/ixgbe_vf_representor.c
index d5b636a194..9fa75984fb 100644
--- a/drivers/net/ixgbe/ixgbe_vf_representor.c
+++ b/drivers/net/ixgbe/ixgbe_vf_representor.c
@@ -197,6 +197,7 @@ ixgbe_vf_representor_init(struct rte_eth_dev *ethdev, void *init_params)
 
 	ethdev->data->dev_flags |= RTE_ETH_DEV_REPRESENTOR;
 	ethdev->data->representor_id = representor->vf_id;
+	ethdev->data->backer_port_id = representor->pf_ethdev->data->port_id;
 
 	/* Set representor device ops */
 	ethdev->dev_ops = &ixgbe_vf_representor_dev_ops;
diff --git a/drivers/net/mlx5/linux/mlx5_os.c b/drivers/net/mlx5/linux/mlx5_os.c
index 470b16cb9a..1cddaaba1a 100644
--- a/drivers/net/mlx5/linux/mlx5_os.c
+++ b/drivers/net/mlx5/linux/mlx5_os.c
@@ -1677,6 +1677,19 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev,
 	if (priv->representor) {
 		eth_dev->data->dev_flags |= RTE_ETH_DEV_REPRESENTOR;
 		eth_dev->data->representor_id = priv->representor_id;
+		MLX5_ETH_FOREACH_DEV(port_id, &priv->pci_dev->device) {
+			struct mlx5_priv *opriv =
+				rte_eth_devices[port_id].data->dev_private;
+			if (opriv &&
+			    opriv->master &&
+			    opriv->domain_id == priv->domain_id &&
+			    opriv->sh == priv->sh) {
+				eth_dev->data->backer_port_id = port_id;
+				break;
+			}
+		}
+		if (port_id >= RTE_MAX_ETHPORTS)
+			eth_dev->data->backer_port_id = eth_dev->data->port_id;
 	}
 	priv->mp_id.port_id = eth_dev->data->port_id;
 	strlcpy(priv->mp_id.name, MLX5_MP_NAME, RTE_MP_MAX_NAME_LEN);
diff --git a/drivers/net/mlx5/windows/mlx5_os.c b/drivers/net/mlx5/windows/mlx5_os.c
index 26fa927039..a9c244c7dc 100644
--- a/drivers/net/mlx5/windows/mlx5_os.c
+++ b/drivers/net/mlx5/windows/mlx5_os.c
@@ -543,6 +543,19 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev,
 	if (priv->representor) {
 		eth_dev->data->dev_flags |= RTE_ETH_DEV_REPRESENTOR;
 		eth_dev->data->representor_id = priv->representor_id;
+		MLX5_ETH_FOREACH_DEV(port_id, &priv->pci_dev->device) {
+			struct mlx5_priv *opriv =
+				rte_eth_devices[port_id].data->dev_private;
+			if (opriv &&
+			    opriv->master &&
+			    opriv->domain_id == priv->domain_id &&
+			    opriv->sh == priv->sh) {
+				eth_dev->data->backer_port_id = port_id;
+				break;
+			}
+		}
+		if (port_id >= RTE_MAX_ETHPORTS)
+			eth_dev->data->backer_port_id = eth_dev->data->port_id;
 	}
 	/*
 	 * Store associated network device interface index. This index
diff --git a/lib/ethdev/ethdev_driver.h b/lib/ethdev/ethdev_driver.h
index 40e474aa7e..b940e6cb38 100644
--- a/lib/ethdev/ethdev_driver.h
+++ b/lib/ethdev/ethdev_driver.h
@@ -1248,8 +1248,8 @@ struct rte_eth_devargs {
  * For backward compatibility, if no representor info, direct
  * map legacy VF (no controller and pf).
  *
- * @param ethdev
- *  Handle of ethdev port.
+ * @param port_id
+ *  Port ID of the backing device.
  * @param type
  *  Representor type.
  * @param controller
@@ -1266,7 +1266,7 @@ struct rte_eth_devargs {
  */
 __rte_internal
 int
-rte_eth_representor_id_get(const struct rte_eth_dev *ethdev,
+rte_eth_representor_id_get(uint16_t port_id,
 			   enum rte_eth_representor_type type,
 			   int controller, int pf, int representor_port,
 			   uint16_t *repr_id);
diff --git a/lib/ethdev/rte_class_eth.c b/lib/ethdev/rte_class_eth.c
index 1fe5fa1f36..eda216ced5 100644
--- a/lib/ethdev/rte_class_eth.c
+++ b/lib/ethdev/rte_class_eth.c
@@ -95,7 +95,7 @@ eth_representor_cmp(const char *key __rte_unused,
 		c = i / (np * nf);
 		p = (i / nf) % np;
 		f = i % nf;
-		if (rte_eth_representor_id_get(edev,
+		if (rte_eth_representor_id_get(edev->data->backer_port_id,
 			eth_da.type,
 			eth_da.nb_mh_controllers == 0 ? -1 :
 					eth_da.mh_controllers[c],
diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c
index daf5ca9242..7c9b0d6b3b 100644
--- a/lib/ethdev/rte_ethdev.c
+++ b/lib/ethdev/rte_ethdev.c
@@ -524,6 +524,7 @@ rte_eth_dev_allocate(const char *name)
 	eth_dev = eth_dev_get(port_id);
 	strlcpy(eth_dev->data->name, name, sizeof(eth_dev->data->name));
 	eth_dev->data->port_id = port_id;
+	eth_dev->data->backer_port_id = RTE_MAX_ETHPORTS;
 	eth_dev->data->mtu = RTE_ETHER_MTU;
 	pthread_mutex_init(&eth_dev->data->flow_ops_mutex, NULL);
 
@@ -5996,7 +5997,7 @@ rte_eth_devargs_parse(const char *dargs, struct rte_eth_devargs *eth_da)
 }
 
 int
-rte_eth_representor_id_get(const struct rte_eth_dev *ethdev,
+rte_eth_representor_id_get(uint16_t port_id,
 			   enum rte_eth_representor_type type,
 			   int controller, int pf, int representor_port,
 			   uint16_t *repr_id)
@@ -6012,7 +6013,7 @@ rte_eth_representor_id_get(const struct rte_eth_dev *ethdev,
 		return -EINVAL;
 
 	/* Get PMD representor range info. */
-	ret = rte_eth_representor_info_get(ethdev->data->port_id, NULL);
+	ret = rte_eth_representor_info_get(port_id, NULL);
 	if (ret == -ENOTSUP && type == RTE_ETH_REPRESENTOR_VF &&
 	    controller == -1 && pf == -1) {
 		/* Direct mapping for legacy VF representor. */
@@ -6027,7 +6028,7 @@ rte_eth_representor_id_get(const struct rte_eth_dev *ethdev,
 	if (info == NULL)
 		return -ENOMEM;
 	info->nb_ranges_alloc = n;
-	ret = rte_eth_representor_info_get(ethdev->data->port_id, info);
+	ret = rte_eth_representor_info_get(port_id, info);
 	if (ret < 0)
 		goto out;
 
@@ -6046,7 +6047,7 @@ rte_eth_representor_id_get(const struct rte_eth_dev *ethdev,
 			continue;
 		if (info->ranges[i].id_end < info->ranges[i].id_base) {
 			RTE_LOG(WARNING, EAL, "Port %hu invalid representor ID Range %u - %u, entry %d\n",
-				ethdev->data->port_id, info->ranges[i].id_base,
+				port_id, info->ranges[i].id_base,
 				info->ranges[i].id_end, i);
 			continue;
 
diff --git a/lib/ethdev/rte_ethdev_core.h b/lib/ethdev/rte_ethdev_core.h
index edf96de2dc..48b814e8a1 100644
--- a/lib/ethdev/rte_ethdev_core.h
+++ b/lib/ethdev/rte_ethdev_core.h
@@ -185,6 +185,12 @@ struct rte_eth_dev_data {
 			/**< Switch-specific identifier.
 			 *   Valid if RTE_ETH_DEV_REPRESENTOR in dev_flags.
 			 */
+	uint16_t backer_port_id;
+			/**< Port ID of the backing device.
+			 *   This device will be used to query representor
+			 *   info and calculate representor IDs.
+			 *   Valid if RTE_ETH_DEV_REPRESENTOR in dev_flags.
+			 */
 
 	pthread_mutex_t flow_ops_mutex; /**< rte_flow ops mutex. */
 	uint64_t reserved_64s[4]; /**< Reserved for future fields */
-- 
2.30.2


^ permalink raw reply	[relevance 4%]

* Re: [dpdk-dev] [PATCH 8/8] bus/pci: remove ABIs in PCI bus
  2021-09-10  2:24  2% ` [dpdk-dev] [PATCH 8/8] bus/pci: remove ABIs in PCI bus Chenbo Xia
@ 2021-09-13 12:06  0%   ` Kinsella, Ray
  2021-09-14  8:15  0%   ` Xu, Rosen
  1 sibling, 0 replies; 200+ results
From: Kinsella, Ray @ 2021-09-13 12:06 UTC (permalink / raw)
  To: Chenbo Xia, dev
  Cc: Nicolas Chautru, Ferruh Yigit, Anatoly Burakov,
	Nithin Dabilpuram, Kiran Kumar K, Sunil Kumar Kori, Satha Rao,
	Matan Azrad, Shahaf Shuler, Viacheslav Ovsiienko, Jerin Jacob,
	Anoob Joseph, Fiona Trahe, John Griffin, Deepak Kumar Jain,
	Andrew Rybchenko, Ashish Gupta, Somalapuram Amaranath,
	Ankur Dwivedi, Tejasree Kondoj, Nagadheeraj Rottela,
	Srikanth Jampala, Jay Zhou, Timothy McDaniel, Pavan Nikhilesh,
	Ashwin Sekhar T K, Harman Kalra, Shepard Siegel, Ed Czeck,
	John Miller, Steven Webster, Matt Peters, Rasesh Mody,
	Shahed Shaikh, Ajit Khaparde, Somnath Kotur, Chas Williams,
	Min Hu (Connor),
	Rahul Lakkireddy, Haiyue Wang, Marcin Wojtas, Michal Krawczyk,
	Shai Brandes, Evgeny Schemeilin, Igor Chauskin, John Daley,
	Hyong Youb Kim, Ziyang Xuan, Xiaoyun Wang, Guoyang Zhou,
	Yisen Zhuang, Lijun Ou, Beilei Xing, Andrew Boyer, Rosen Xu,
	Stephen Hemminger, Long Li, Devendra Singh Rawat, Maciej Czekaj,
	Jiawen Wu, Jian Wang, Maxime Coquelin, Yong Wang, Jakub Palider,
	Tomasz Duszynski, Tianfei zhang, Bruce Richardson, Xiaoyun Li,
	Jingjing Wu, Radha Mohan Chintakuntla, Veerasenareddy Burru,
	Ori Kam, Xiao Wang, Thomas Monjalon



On 10/09/2021 03:24, Chenbo Xia wrote:
> As announced in the deprecation note, most of ABIs in PCI bus are
> removed in this patch. Only the function rte_pci_dump is still ABI
> and experimental APIs are kept for future promotion.
> 
> This patch creates a new file named pci_driver.h and moves most of
> the content in original rte_bus_pci.h to it. After that, pci_driver.h
> is considered the interface for drivers and rte_bus_pci.h for
> applications. pci_driver.h is defined as driver_sdk_headers so that
> out-of-tree drivers can use it.
> 
> Then this patch replaces the including of rte_bus_pci.h with pci_driver.h
> in all related drivers.
> 
> Signed-off-by: Chenbo Xia <chenbo.xia@intel.com>
> ---
>  app/test/virtual_pmd.c                        |   2 +-
>  doc/guides/rel_notes/release_21_11.rst        |   2 +
>  drivers/baseband/acc100/rte_acc100_pmd.c      |   2 +-
>  .../fpga_5gnr_fec/rte_fpga_5gnr_fec.c         |   2 +-
>  drivers/baseband/fpga_lte_fec/fpga_lte_fec.c  |   2 +-
>  drivers/bus/pci/bsd/pci.c                     |   1 -
>  drivers/bus/pci/linux/pci.c                   |   1 -
>  drivers/bus/pci/linux/pci_uio.c               |   1 -
>  drivers/bus/pci/linux/pci_vfio.c              |   1 -
>  drivers/bus/pci/meson.build                   |   4 +
>  drivers/bus/pci/pci_common_uio.c              |   1 -
>  drivers/bus/pci/pci_driver.h                  | 402 ++++++++++++++++++
>  drivers/bus/pci/pci_params.c                  |   1 -
>  drivers/bus/pci/private.h                     |   3 +-
>  drivers/bus/pci/rte_bus_pci.h                 | 375 +---------------
>  drivers/bus/pci/version.map                   |  32 +-
>  drivers/common/cnxk/roc_platform.h            |   2 +-
>  drivers/common/mlx5/linux/mlx5_common_verbs.c |   2 +-
>  drivers/common/mlx5/mlx5_common_pci.c         |   2 +-
>  drivers/common/octeontx2/otx2_dev.h           |   2 +-
>  drivers/common/octeontx2/otx2_sec_idev.c      |   2 +-
>  drivers/common/qat/qat_device.h               |   2 +-
>  drivers/common/qat/qat_qp.c                   |   2 +-
>  drivers/common/sfc_efx/sfc_efx.h              |   2 +-
>  drivers/compress/mlx5/mlx5_compress.c         |   2 +-
>  drivers/compress/octeontx/otx_zip.h           |   2 +-
>  drivers/compress/qat/qat_comp.c               |   2 +-
>  drivers/crypto/ccp/ccp_dev.h                  |   2 +-
>  drivers/crypto/ccp/ccp_pci.h                  |   2 +-
>  drivers/crypto/ccp/rte_ccp_pmd.c              |   2 +-
>  drivers/crypto/cnxk/cn10k_cryptodev.c         |   2 +-
>  drivers/crypto/cnxk/cn9k_cryptodev.c          |   2 +-
>  drivers/crypto/mlx5/mlx5_crypto.c             |   2 +-
>  drivers/crypto/nitrox/nitrox_device.h         |   2 +-
>  drivers/crypto/octeontx/otx_cryptodev.c       |   2 +-
>  drivers/crypto/octeontx/otx_cryptodev_ops.c   |   2 +-
>  drivers/crypto/octeontx2/otx2_cryptodev.c     |   2 +-
>  drivers/crypto/qat/qat_sym.c                  |   2 +-
>  drivers/crypto/qat/qat_sym_pmd.c              |   2 +-
>  drivers/crypto/virtio/virtio_cryptodev.c      |   2 +-
>  drivers/crypto/virtio/virtio_pci.h            |   2 +-
>  drivers/event/dlb2/pf/dlb2_main.h             |   2 +-
>  drivers/event/dlb2/pf/dlb2_pf.c               |   2 +-
>  drivers/event/octeontx/ssovf_probe.c          |   2 +-
>  drivers/event/octeontx/timvf_probe.c          |   2 +-
>  drivers/event/octeontx2/otx2_evdev.c          |   2 +-
>  drivers/mempool/cnxk/cnxk_mempool.c           |   2 +-
>  drivers/mempool/octeontx/octeontx_fpavf.c     |   2 +-
>  drivers/mempool/octeontx2/otx2_mempool.c      |   2 +-
>  drivers/mempool/octeontx2/otx2_mempool.h      |   2 +-
>  drivers/mempool/octeontx2/otx2_mempool_irq.c  |   2 +-
>  drivers/meson.build                           |   4 +
>  drivers/net/ark/ark_ethdev.c                  |   2 +-
>  drivers/net/avp/avp_ethdev.c                  |   2 +-
>  drivers/net/bnx2x/bnx2x.h                     |   2 +-
>  drivers/net/bnxt/bnxt.h                       |   2 +-
>  drivers/net/bonding/rte_eth_bond_args.c       |   2 +-
>  drivers/net/cxgbe/base/adapter.h              |   2 +-
>  drivers/net/cxgbe/cxgbe_ethdev.c              |   2 +-
>  drivers/net/e1000/em_ethdev.c                 |   2 +-
>  drivers/net/e1000/em_rxtx.c                   |   2 +-
>  drivers/net/e1000/igb_ethdev.c                |   2 +-
>  drivers/net/e1000/igb_pf.c                    |   2 +-
>  drivers/net/ena/ena_ethdev.h                  |   2 +-
>  drivers/net/enic/base/vnic_dev.h              |   2 +-
>  drivers/net/enic/enic_ethdev.c                |   2 +-
>  drivers/net/enic/enic_main.c                  |   2 +-
>  drivers/net/enic/enic_vf_representor.c        |   2 +-
>  drivers/net/hinic/base/hinic_pmd_hwdev.c      |   2 +-
>  drivers/net/hinic/base/hinic_pmd_hwif.c       |   2 +-
>  drivers/net/hinic/base/hinic_pmd_nicio.c      |   2 +-
>  drivers/net/hinic/hinic_pmd_ethdev.c          |   2 +-
>  drivers/net/hns3/hns3_ethdev.c                |   2 +-
>  drivers/net/hns3/hns3_rxtx.c                  |   2 +-
>  drivers/net/i40e/i40e_ethdev.c                |   2 +-
>  drivers/net/i40e/i40e_ethdev_vf.c             |   2 +-
>  drivers/net/i40e/i40e_vf_representor.c        |   2 +-
>  drivers/net/igc/igc_ethdev.c                  |   2 +-
>  drivers/net/ionic/ionic.h                     |   2 +-
>  drivers/net/ionic/ionic_ethdev.c              |   2 +-
>  drivers/net/ipn3ke/ipn3ke_ethdev.c            |   2 +-
>  drivers/net/ipn3ke/ipn3ke_representor.c       |   2 +-
>  drivers/net/ipn3ke/ipn3ke_tm.c                |   2 +-
>  drivers/net/ixgbe/ixgbe_ethdev.c              |   2 +-
>  drivers/net/ixgbe/ixgbe_ethdev.h              |   2 +-
>  drivers/net/mlx4/mlx4_ethdev.c                |   2 +-
>  drivers/net/mlx5/linux/mlx5_ethdev_os.c       |   2 +-
>  drivers/net/mlx5/linux/mlx5_os.c              |   2 +-
>  drivers/net/mlx5/mlx5.c                       |   2 +-
>  drivers/net/mlx5/mlx5_ethdev.c                |   2 +-
>  drivers/net/mlx5/mlx5_txq.c                   |   2 +-
>  drivers/net/netvsc/hn_vf.c                    |   2 +-
>  drivers/net/octeontx/base/octeontx_pkivf.c    |   2 +-
>  drivers/net/octeontx/base/octeontx_pkovf.c    |   2 +-
>  drivers/net/octeontx2/otx2_ethdev_irq.c       |   2 +-
>  drivers/net/qede/base/bcm_osal.h              |   2 +-
>  drivers/net/sfc/sfc.h                         |   2 +-
>  drivers/net/sfc/sfc_ethdev.c                  |   2 +-
>  drivers/net/sfc/sfc_sriov.c                   |   2 +-
>  drivers/net/thunderx/nicvf_ethdev.c           |   2 +-
>  drivers/net/txgbe/txgbe_ethdev.h              |   2 +-
>  drivers/net/txgbe/txgbe_flow.c                |   2 +-
>  drivers/net/txgbe/txgbe_pf.c                  |   2 +-
>  drivers/net/virtio/virtio_pci.h               |   2 +-
>  drivers/net/virtio/virtio_pci_ethdev.c        |   2 +-
>  drivers/net/vmxnet3/vmxnet3_ethdev.c          |   2 +-
>  drivers/raw/cnxk_bphy/cnxk_bphy.c             |   2 +-
>  drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c         |   2 +-
>  drivers/raw/cnxk_bphy/cnxk_bphy_irq.c         |   2 +-
>  drivers/raw/cnxk_bphy/cnxk_bphy_irq.h         |   2 +-
>  drivers/raw/ifpga/ifpga_rawdev.c              |   2 +-
>  drivers/raw/ifpga/rte_pmd_ifpga.c             |   2 +-
>  drivers/raw/ioat/idxd_pci.c                   |   2 +-
>  drivers/raw/ioat/ioat_rawdev.c                |   2 +-
>  drivers/raw/ntb/ntb.c                         |   2 +-
>  drivers/raw/ntb/ntb_hw_intel.c                |   2 +-
>  drivers/raw/octeontx2_dma/otx2_dpi_rawdev.c   |   2 +-
>  drivers/raw/octeontx2_ep/otx2_ep_enqdeq.c     |   2 +-
>  drivers/raw/octeontx2_ep/otx2_ep_rawdev.c     |   2 +-
>  drivers/regex/mlx5/mlx5_regex.c               |   2 +-
>  drivers/regex/mlx5/mlx5_regex_fastpath.c      |   2 +-
>  drivers/vdpa/ifc/base/ifcvf_osdep.h           |   2 +-
>  drivers/vdpa/ifc/ifcvf_vdpa.c                 |   2 +-
>  drivers/vdpa/mlx5/mlx5_vdpa.c                 |   2 +-
>  lib/ethdev/ethdev_pci.h                       |   2 +-
>  lib/eventdev/eventdev_pmd_pci.h               |   2 +-
>  126 files changed, 546 insertions(+), 508 deletions(-)
>  create mode 100644 drivers/bus/pci/pci_driver.h
> 

Acked-by: Ray Kinsella <mdr@ashroe.eu>

^ permalink raw reply	[relevance 0%]

* Re: [dpdk-dev] [PATCH 2/8] cryptodev: move inline APIs into separate structure
  @ 2021-09-13 14:11  0%   ` Zhang, Roy Fan
  2021-09-16 15:21  0%   ` Ananyev, Konstantin
  1 sibling, 0 replies; 200+ results
From: Zhang, Roy Fan @ 2021-09-13 14:11 UTC (permalink / raw)
  To: Akhil Goyal, dev
  Cc: anoobj, Nicolau, Radu, Doherty, Declan, hemant.agrawal, matan,
	Ananyev, Konstantin, thomas, asomalap, ruifeng.wang,
	ajit.khaparde, De Lara Guarch, Pablo, Trahe, Fiona, adwivedi,
	michaelsh, rnagadheeraj, jianjay.zhou, jerinj

> -----Original Message-----
> From: Akhil Goyal <gakhil@marvell.com>
> Sent: Sunday, August 29, 2021 1:52 PM
> To: dev@dpdk.org
> Cc: anoobj@marvell.com; Nicolau, Radu <radu.nicolau@intel.com>; Doherty,
> Declan <declan.doherty@intel.com>; hemant.agrawal@nxp.com;
> matan@nvidia.com; Ananyev, Konstantin <konstantin.ananyev@intel.com>;
> thomas@monjalon.net; Zhang, Roy Fan <roy.fan.zhang@intel.com>;
> asomalap@amd.com; ruifeng.wang@arm.com;
> ajit.khaparde@broadcom.com; De Lara Guarch, Pablo
> <pablo.de.lara.guarch@intel.com>; Trahe, Fiona <fiona.trahe@intel.com>;
> adwivedi@marvell.com; michaelsh@marvell.com;
> rnagadheeraj@marvell.com; jianjay.zhou@huawei.com; jerinj@marvell.com;
> Akhil Goyal <gakhil@marvell.com>
> Subject: [PATCH 2/8] cryptodev: move inline APIs into separate structure
> 
> Move fastpath inline function pointers from rte_cryptodev into a
> separate structure accessed via a flat array.
> The intension is to make rte_cryptodev and related structures private
> to avoid future API/ABI breakages.
> 
> Signed-off-by: Akhil Goyal <gakhil@marvell.com>
> ---
Tested-by: Rebecca Troy <rebecca.troy@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>

^ permalink raw reply	[relevance 0%]

* [dpdk-dev] [PATCH v2 08/18] eal: fix typos in comments
  @ 2021-09-13 16:10  4%   ` Stephen Hemminger
  0 siblings, 0 replies; 200+ results
From: Stephen Hemminger @ 2021-09-13 16:10 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

Minor spelling errors.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/eal/include/rte_function_versioning.h | 2 +-
 lib/eal/windows/include/fnmatch.h         | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/eal/include/rte_function_versioning.h b/lib/eal/include/rte_function_versioning.h
index 746a1e19923e..eb6dd2bc1727 100644
--- a/lib/eal/include/rte_function_versioning.h
+++ b/lib/eal/include/rte_function_versioning.h
@@ -15,7 +15,7 @@
 
 /*
  * Provides backwards compatibility when updating exported functions.
- * When a symol is exported from a library to provide an API, it also provides a
+ * When a symbol is exported from a library to provide an API, it also provides a
  * calling convention (ABI) that is embodied in its name, return type,
  * arguments, etc.  On occasion that function may need to change to accommodate
  * new functionality, behavior, etc.  When that occurs, it is desirable to
diff --git a/lib/eal/windows/include/fnmatch.h b/lib/eal/windows/include/fnmatch.h
index 142753c3568d..c272f65ccdc3 100644
--- a/lib/eal/windows/include/fnmatch.h
+++ b/lib/eal/windows/include/fnmatch.h
@@ -30,7 +30,7 @@ extern "C" {
  * with the given regular expression pattern.
  *
  * @param pattern
- *	regular expression notation decribing the pattern to match
+ *	regular expression notation describing the pattern to match
  *
  * @param string
  *	source string to searcg for the pattern
-- 
2.30.2


^ permalink raw reply	[relevance 4%]

* Re: [dpdk-dev] [PATCH V3 01/24] pipeline: move data structures to internal header file
  @ 2021-09-13 16:51  3%   ` Stephen Hemminger
  2021-09-13 18:42  0%     ` Dumitrescu, Cristian
  0 siblings, 1 reply; 200+ results
From: Stephen Hemminger @ 2021-09-13 16:51 UTC (permalink / raw)
  To: Cristian Dumitrescu; +Cc: dev

On Mon, 13 Sep 2021 17:44:20 +0100
Cristian Dumitrescu <cristian.dumitrescu@intel.com> wrote:

> Start to consolidate the data structures and inline functions required
> by the pipeline instructions into an internal header file.
> 
> Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
> ---
> Depends-on: series-18297 ("[V4,1/4] table: add support learner tables")

Won't this change will make future changes to API/ABI harder because more
of the pipeline internals are exposed to application?

^ permalink raw reply	[relevance 3%]

* [dpdk-dev] [PATCH v8 06/12] pdump: support pcapng and filtering
  @ 2021-09-13 18:15  1%   ` Stephen Hemminger
  2021-09-13 18:15  1%   ` [dpdk-dev] [PATCH v8 11/12] doc: changes for new pcapng and dumpcap Stephen Hemminger
  1 sibling, 0 replies; 200+ results
From: Stephen Hemminger @ 2021-09-13 18:15 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

This enhances the DPDK pdump library to support new
pcapng format and filtering via BPF.

The internal client/server protocol is changed to support
two versions: the original pdump basic version and a
new pcapng version.

The internal version number (not part of exposed API or ABI)
is intentionally increased to cause any attempt to try
mismatched primary/secondary process to fail.

Add new API to do allow filtering of captured packets with
DPDK BPF (eBPF) filter program. It keeps statistics
on packets captured, filtered, and missed (because ring was full).

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/meson.build       |   4 +-
 lib/pdump/meson.build |   2 +-
 lib/pdump/rte_pdump.c | 441 ++++++++++++++++++++++++++++++------------
 lib/pdump/rte_pdump.h | 110 ++++++++++-
 lib/pdump/version.map |   8 +
 5 files changed, 437 insertions(+), 128 deletions(-)

diff --git a/lib/meson.build b/lib/meson.build
index ba88e9eabc58..1da521ea6185 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -26,6 +26,7 @@ libraries = [
         'timer',   # eventdev depends on this
         'acl',
         'bbdev',
+        'bpf',
         'bitratestats',
         'cfgfile',
         'compressdev',
@@ -43,7 +44,6 @@ libraries = [
         'member',
         'pcapng',
         'power',
-        'pdump',
         'rawdev',
         'regexdev',
         'rib',
@@ -55,10 +55,10 @@ libraries = [
         'ipsec', # ipsec lib depends on net, crypto and security
         'fib', #fib lib depends on rib
         'port', # pkt framework libs which use other libs from above
+        'pdump', # pdump lib depends on bpf pcapng
         'table',
         'pipeline',
         'flow_classify', # flow_classify lib depends on pkt framework table lib
-        'bpf',
         'graph',
         'node',
 ]
diff --git a/lib/pdump/meson.build b/lib/pdump/meson.build
index 3a95eabde6a6..51ceb2afdec5 100644
--- a/lib/pdump/meson.build
+++ b/lib/pdump/meson.build
@@ -3,4 +3,4 @@
 
 sources = files('rte_pdump.c')
 headers = files('rte_pdump.h')
-deps += ['ethdev']
+deps += ['ethdev', 'bpf', 'pcapng']
diff --git a/lib/pdump/rte_pdump.c b/lib/pdump/rte_pdump.c
index 382217bc1564..abc28fcee0ad 100644
--- a/lib/pdump/rte_pdump.c
+++ b/lib/pdump/rte_pdump.c
@@ -7,8 +7,10 @@
 #include <rte_ethdev.h>
 #include <rte_lcore.h>
 #include <rte_log.h>
+#include <rte_memzone.h>
 #include <rte_errno.h>
 #include <rte_string_fns.h>
+#include <rte_pcapng.h>
 
 #include "rte_pdump.h"
 
@@ -27,30 +29,26 @@ enum pdump_operation {
 	ENABLE = 2
 };
 
+/*
+ * Note: version numbers intentionally start at 3
+ * in order to catch any application built with older out
+ * version of DPDK using incompatible client request format.
+ */
 enum pdump_version {
-	V1 = 1
+	PDUMP_CLIENT_LEGACY = 3,
+	PDUMP_CLIENT_PCAPNG = 4,
 };
 
 struct pdump_request {
 	uint16_t ver;
 	uint16_t op;
-	uint32_t flags;
-	union pdump_data {
-		struct enable_v1 {
-			char device[RTE_DEV_NAME_MAX_LEN];
-			uint16_t queue;
-			struct rte_ring *ring;
-			struct rte_mempool *mp;
-			void *filter;
-		} en_v1;
-		struct disable_v1 {
-			char device[RTE_DEV_NAME_MAX_LEN];
-			uint16_t queue;
-			struct rte_ring *ring;
-			struct rte_mempool *mp;
-			void *filter;
-		} dis_v1;
-	} data;
+	uint16_t flags;
+	uint16_t queue;
+	struct rte_ring *ring;
+	struct rte_mempool *mp;
+	const struct rte_bpf_prm *prm;
+	uint32_t snaplen;
+	char device[RTE_DEV_NAME_MAX_LEN];
 };
 
 struct pdump_response {
@@ -63,80 +61,140 @@ static struct pdump_rxtx_cbs {
 	struct rte_ring *ring;
 	struct rte_mempool *mp;
 	const struct rte_eth_rxtx_callback *cb;
-	void *filter;
+	const struct rte_bpf *filter;
+	enum pdump_version ver;
+	uint32_t snaplen;
 } rx_cbs[RTE_MAX_ETHPORTS][RTE_MAX_QUEUES_PER_PORT],
 tx_cbs[RTE_MAX_ETHPORTS][RTE_MAX_QUEUES_PER_PORT];
 
-
-static inline void
-pdump_copy(struct rte_mbuf **pkts, uint16_t nb_pkts, void *user_params)
+static const char *MZ_RTE_PDUMP_STATS = "rte_pdump_stats";
+
+/* Shared memory between primary and secondary processes. */
+static struct {
+	struct rte_pdump_stats rx[RTE_MAX_ETHPORTS][RTE_MAX_QUEUES_PER_PORT];
+	struct rte_pdump_stats tx[RTE_MAX_ETHPORTS][RTE_MAX_QUEUES_PER_PORT];
+} *pdump_stats;
+
+/* Create a clone of mbuf to be placed into ring. */
+static void
+pdump_copy(uint16_t port_id, uint16_t queue,
+	   enum rte_pcapng_direction direction,
+	   struct rte_mbuf **pkts, uint16_t nb_pkts,
+	   const struct pdump_rxtx_cbs *cbs,
+	   struct rte_pdump_stats *stats)
 {
 	unsigned int i;
 	int ring_enq;
 	uint16_t d_pkts = 0;
 	struct rte_mbuf *dup_bufs[nb_pkts];
-	struct pdump_rxtx_cbs *cbs;
+	uint64_t ts;
 	struct rte_ring *ring;
 	struct rte_mempool *mp;
 	struct rte_mbuf *p;
+	uint64_t rcs[nb_pkts];
+
+	if (cbs->filter &&
+	    rte_bpf_exec_burst(cbs->filter, (void **)pkts, rcs, nb_pkts) == 0) {
+		/* All packets were filtered out */
+		__atomic_fetch_add(&stats->filtered, nb_pkts,
+				   __ATOMIC_RELAXED);
+		return;
+	}
 
-	cbs  = user_params;
+	ts = rte_get_tsc_cycles();
 	ring = cbs->ring;
 	mp = cbs->mp;
 	for (i = 0; i < nb_pkts; i++) {
-		p = rte_pktmbuf_copy(pkts[i], mp, 0, UINT32_MAX);
-		if (p)
+		/*
+		 * Similar behavior to rte_bpf_eth callback.
+		 * if BPF program returns zero value for a given packet,
+		 * then it will be ignored.
+		 */
+		if (cbs->filter && rcs[i] == 0) {
+			__atomic_fetch_add(&stats->filtered,
+					   1, __ATOMIC_RELAXED);
+			continue;
+		}
+
+		/*
+		 * If using pcapng then want to wrap packets
+		 * otherwise a simple copy.
+		 */
+		if (cbs->ver == PDUMP_CLIENT_PCAPNG)
+			p = rte_pcapng_copy(port_id, queue,
+					    pkts[i], mp, cbs->snaplen,
+					    ts, direction);
+		else
+			p = rte_pktmbuf_copy(pkts[i], mp, 0, cbs->snaplen);
+
+		if (unlikely(p == NULL))
+			__atomic_fetch_add(&stats->nombuf, 1, __ATOMIC_RELAXED);
+		else
 			dup_bufs[d_pkts++] = p;
 	}
 
+	__atomic_fetch_add(&stats->accepted, d_pkts, __ATOMIC_RELAXED);
+
 	ring_enq = rte_ring_enqueue_burst(ring, (void *)dup_bufs, d_pkts, NULL);
 	if (unlikely(ring_enq < d_pkts)) {
 		unsigned int drops = d_pkts - ring_enq;
 
-		PDUMP_LOG(DEBUG,
-			"only %d of packets enqueued to ring\n", ring_enq);
+		__atomic_fetch_add(&stats->ringfull, drops, __ATOMIC_RELAXED);
 		rte_pktmbuf_free_bulk(&dup_bufs[ring_enq], drops);
 	}
 }
 
 static uint16_t
-pdump_rx(uint16_t port __rte_unused, uint16_t qidx __rte_unused,
+pdump_rx(uint16_t port, uint16_t queue,
 	struct rte_mbuf **pkts, uint16_t nb_pkts,
-	uint16_t max_pkts __rte_unused,
-	void *user_params)
+	uint16_t max_pkts __rte_unused, void *user_params)
 {
-	pdump_copy(pkts, nb_pkts, user_params);
+	const struct pdump_rxtx_cbs *cbs = user_params;
+	struct rte_pdump_stats *stats = &pdump_stats->rx[port][queue];
+
+	pdump_copy(port, queue, RTE_PCAPNG_DIRECTION_IN,
+		   pkts, nb_pkts, cbs, stats);
 	return nb_pkts;
 }
 
 static uint16_t
-pdump_tx(uint16_t port __rte_unused, uint16_t qidx __rte_unused,
+pdump_tx(uint16_t port, uint16_t queue,
 		struct rte_mbuf **pkts, uint16_t nb_pkts, void *user_params)
 {
-	pdump_copy(pkts, nb_pkts, user_params);
+	const struct pdump_rxtx_cbs *cbs = user_params;
+	struct rte_pdump_stats *stats = &pdump_stats->tx[port][queue];
+
+	pdump_copy(port, queue, RTE_PCAPNG_DIRECTION_OUT,
+		   pkts, nb_pkts, cbs, stats);
 	return nb_pkts;
 }
 
 static int
-pdump_register_rx_callbacks(uint16_t end_q, uint16_t port, uint16_t queue,
-				struct rte_ring *ring, struct rte_mempool *mp,
-				uint16_t operation)
+pdump_register_rx_callbacks(enum pdump_version ver,
+			    uint16_t end_q, uint16_t port, uint16_t queue,
+			    struct rte_ring *ring, struct rte_mempool *mp,
+			    struct rte_bpf *filter,
+			    uint16_t operation, uint32_t snaplen)
 {
 	uint16_t qid;
-	struct pdump_rxtx_cbs *cbs = NULL;
 
 	qid = (queue == RTE_PDUMP_ALL_QUEUES) ? 0 : queue;
 	for (; qid < end_q; qid++) {
-		cbs = &rx_cbs[port][qid];
-		if (cbs && operation == ENABLE) {
+		struct pdump_rxtx_cbs *cbs = &rx_cbs[port][qid];
+
+		if (operation == ENABLE) {
 			if (cbs->cb) {
 				PDUMP_LOG(ERR,
 					"rx callback for port=%d queue=%d, already exists\n",
 					port, qid);
 				return -EEXIST;
 			}
+			cbs->ver = ver;
 			cbs->ring = ring;
 			cbs->mp = mp;
+			cbs->snaplen = snaplen;
+			cbs->filter = filter;
+
 			cbs->cb = rte_eth_add_first_rx_callback(port, qid,
 								pdump_rx, cbs);
 			if (cbs->cb == NULL) {
@@ -145,8 +203,7 @@ pdump_register_rx_callbacks(uint16_t end_q, uint16_t port, uint16_t queue,
 					rte_errno);
 				return rte_errno;
 			}
-		}
-		if (cbs && operation == DISABLE) {
+		} else if (operation == DISABLE) {
 			int ret;
 
 			if (cbs->cb == NULL) {
@@ -170,26 +227,32 @@ pdump_register_rx_callbacks(uint16_t end_q, uint16_t port, uint16_t queue,
 }
 
 static int
-pdump_register_tx_callbacks(uint16_t end_q, uint16_t port, uint16_t queue,
-				struct rte_ring *ring, struct rte_mempool *mp,
-				uint16_t operation)
+pdump_register_tx_callbacks(enum pdump_version ver,
+			    uint16_t end_q, uint16_t port, uint16_t queue,
+			    struct rte_ring *ring, struct rte_mempool *mp,
+			    struct rte_bpf *filter,
+			    uint16_t operation, uint32_t snaplen)
 {
 
 	uint16_t qid;
-	struct pdump_rxtx_cbs *cbs = NULL;
 
 	qid = (queue == RTE_PDUMP_ALL_QUEUES) ? 0 : queue;
 	for (; qid < end_q; qid++) {
-		cbs = &tx_cbs[port][qid];
-		if (cbs && operation == ENABLE) {
+		struct pdump_rxtx_cbs *cbs = &tx_cbs[port][qid];
+
+		if (operation == ENABLE) {
 			if (cbs->cb) {
 				PDUMP_LOG(ERR,
 					"tx callback for port=%d queue=%d, already exists\n",
 					port, qid);
 				return -EEXIST;
 			}
+			cbs->ver = ver;
 			cbs->ring = ring;
 			cbs->mp = mp;
+			cbs->snaplen = snaplen;
+			cbs->filter = filter;
+
 			cbs->cb = rte_eth_add_tx_callback(port, qid, pdump_tx,
 								cbs);
 			if (cbs->cb == NULL) {
@@ -198,8 +261,7 @@ pdump_register_tx_callbacks(uint16_t end_q, uint16_t port, uint16_t queue,
 					rte_errno);
 				return rte_errno;
 			}
-		}
-		if (cbs && operation == DISABLE) {
+		} else if (operation == DISABLE) {
 			int ret;
 
 			if (cbs->cb == NULL) {
@@ -228,37 +290,47 @@ set_pdump_rxtx_cbs(const struct pdump_request *p)
 	uint16_t nb_rx_q = 0, nb_tx_q = 0, end_q, queue;
 	uint16_t port;
 	int ret = 0;
+	struct rte_bpf *filter = NULL;
 	uint32_t flags;
 	uint16_t operation;
 	struct rte_ring *ring;
 	struct rte_mempool *mp;
 
-	flags = p->flags;
-	operation = p->op;
-	if (operation == ENABLE) {
-		ret = rte_eth_dev_get_port_by_name(p->data.en_v1.device,
-				&port);
-		if (ret < 0) {
+	if (!(p->ver == PDUMP_CLIENT_LEGACY ||
+	      p->ver == PDUMP_CLIENT_PCAPNG)) {
+		PDUMP_LOG(ERR,
+			  "incorrect client version %u\n", p->ver);
+		return -EINVAL;
+	}
+
+	if (p->prm) {
+		if (p->prm->prog_arg.type != RTE_BPF_ARG_PTR_MBUF) {
 			PDUMP_LOG(ERR,
-				"failed to get port id for device id=%s\n",
-				p->data.en_v1.device);
+				  "invalid BPF program type: %u\n",
+				  p->prm->prog_arg.type);
 			return -EINVAL;
 		}
-		queue = p->data.en_v1.queue;
-		ring = p->data.en_v1.ring;
-		mp = p->data.en_v1.mp;
-	} else {
-		ret = rte_eth_dev_get_port_by_name(p->data.dis_v1.device,
-				&port);
-		if (ret < 0) {
-			PDUMP_LOG(ERR,
-				"failed to get port id for device id=%s\n",
-				p->data.dis_v1.device);
-			return -EINVAL;
+
+		filter = rte_bpf_load(p->prm);
+		if (filter == NULL) {
+			PDUMP_LOG(ERR, "cannot load BPF filter: %s\n",
+				  rte_strerror(rte_errno));
+			return -rte_errno;
 		}
-		queue = p->data.dis_v1.queue;
-		ring = p->data.dis_v1.ring;
-		mp = p->data.dis_v1.mp;
+	}
+
+	flags = p->flags;
+	operation = p->op;
+	queue = p->queue;
+	ring = p->ring;
+	mp = p->mp;
+
+	ret = rte_eth_dev_get_port_by_name(p->device, &port);
+	if (ret < 0) {
+		PDUMP_LOG(ERR,
+			  "failed to get port id for device id=%s\n",
+			  p->device);
+		return -EINVAL;
 	}
 
 	/* validation if packet capture is for all queues */
@@ -296,8 +368,9 @@ set_pdump_rxtx_cbs(const struct pdump_request *p)
 	/* register RX callback */
 	if (flags & RTE_PDUMP_FLAG_RX) {
 		end_q = (queue == RTE_PDUMP_ALL_QUEUES) ? nb_rx_q : queue + 1;
-		ret = pdump_register_rx_callbacks(end_q, port, queue, ring, mp,
-							operation);
+		ret = pdump_register_rx_callbacks(p->ver, end_q, port, queue,
+						  ring, mp, filter,
+						  operation, p->snaplen);
 		if (ret < 0)
 			return ret;
 	}
@@ -305,8 +378,9 @@ set_pdump_rxtx_cbs(const struct pdump_request *p)
 	/* register TX callback */
 	if (flags & RTE_PDUMP_FLAG_TX) {
 		end_q = (queue == RTE_PDUMP_ALL_QUEUES) ? nb_tx_q : queue + 1;
-		ret = pdump_register_tx_callbacks(end_q, port, queue, ring, mp,
-							operation);
+		ret = pdump_register_tx_callbacks(p->ver, end_q, port, queue,
+						  ring, mp, filter,
+						  operation, p->snaplen);
 		if (ret < 0)
 			return ret;
 	}
@@ -332,7 +406,7 @@ pdump_server(const struct rte_mp_msg *mp_msg, const void *peer)
 		resp->err_value = set_pdump_rxtx_cbs(cli_req);
 	}
 
-	strlcpy(mp_resp.name, PDUMP_MP, RTE_MP_MAX_NAME_LEN);
+	rte_strscpy(mp_resp.name, PDUMP_MP, RTE_MP_MAX_NAME_LEN);
 	mp_resp.len_param = sizeof(*resp);
 	mp_resp.num_fds = 0;
 	if (rte_mp_reply(&mp_resp, peer) < 0) {
@@ -347,8 +421,18 @@ pdump_server(const struct rte_mp_msg *mp_msg, const void *peer)
 int
 rte_pdump_init(void)
 {
+	const struct rte_memzone *mz;
 	int ret;
 
+	mz = rte_memzone_reserve(MZ_RTE_PDUMP_STATS, sizeof(*pdump_stats),
+				 rte_socket_id(), 0);
+	if (mz == NULL) {
+		PDUMP_LOG(ERR, "cannot allocate pdump statistics\n");
+		rte_errno = ENOMEM;
+		return -1;
+	}
+	pdump_stats = mz->addr;
+
 	ret = rte_mp_action_register(PDUMP_MP, pdump_server);
 	if (ret && rte_errno != ENOTSUP)
 		return -1;
@@ -392,14 +476,21 @@ pdump_validate_ring_mp(struct rte_ring *ring, struct rte_mempool *mp)
 static int
 pdump_validate_flags(uint32_t flags)
 {
-	if (flags != RTE_PDUMP_FLAG_RX && flags != RTE_PDUMP_FLAG_TX &&
-		flags != RTE_PDUMP_FLAG_RXTX) {
+	if ((flags & RTE_PDUMP_FLAG_RXTX) == 0) {
 		PDUMP_LOG(ERR,
 			"invalid flags, should be either rx/tx/rxtx\n");
 		rte_errno = EINVAL;
 		return -1;
 	}
 
+	/* mask off the flags we know about */
+	if (flags & ~(RTE_PDUMP_FLAG_RXTX | RTE_PDUMP_FLAG_PCAPNG)) {
+		PDUMP_LOG(ERR,
+			  "unknown flags: %#x\n", flags);
+		rte_errno = ENOTSUP;
+		return -1;
+	}
+
 	return 0;
 }
 
@@ -426,12 +517,12 @@ pdump_validate_port(uint16_t port, char *name)
 }
 
 static int
-pdump_prepare_client_request(char *device, uint16_t queue,
-				uint32_t flags,
-				uint16_t operation,
-				struct rte_ring *ring,
-				struct rte_mempool *mp,
-				void *filter)
+pdump_prepare_client_request(const char *device, uint16_t queue,
+			     uint32_t flags, uint32_t snaplen,
+			     uint16_t operation,
+			     struct rte_ring *ring,
+			     struct rte_mempool *mp,
+			     const struct rte_bpf_prm *prm)
 {
 	int ret = -1;
 	struct rte_mp_msg mp_req, *mp_rep;
@@ -440,26 +531,26 @@ pdump_prepare_client_request(char *device, uint16_t queue,
 	struct pdump_request *req = (struct pdump_request *)mp_req.param;
 	struct pdump_response *resp;
 
-	req->ver = 1;
-	req->flags = flags;
+	memset(req, 0, sizeof(*req));
+	if (flags & RTE_PDUMP_FLAG_PCAPNG)
+		req->ver = PDUMP_CLIENT_PCAPNG;
+	else
+		req->ver = PDUMP_CLIENT_LEGACY;
+
+	req->flags = flags & RTE_PDUMP_FLAG_RXTX;
 	req->op = operation;
+	req->queue = queue;
+	rte_strscpy(req->device, device, sizeof(req->device));
+
 	if ((operation & ENABLE) != 0) {
-		strlcpy(req->data.en_v1.device, device,
-			sizeof(req->data.en_v1.device));
-		req->data.en_v1.queue = queue;
-		req->data.en_v1.ring = ring;
-		req->data.en_v1.mp = mp;
-		req->data.en_v1.filter = filter;
-	} else {
-		strlcpy(req->data.dis_v1.device, device,
-			sizeof(req->data.dis_v1.device));
-		req->data.dis_v1.queue = queue;
-		req->data.dis_v1.ring = NULL;
-		req->data.dis_v1.mp = NULL;
-		req->data.dis_v1.filter = NULL;
+		req->queue = queue;
+		req->ring = ring;
+		req->mp = mp;
+		req->prm = prm;
+		req->snaplen = snaplen;
 	}
 
-	strlcpy(mp_req.name, PDUMP_MP, RTE_MP_MAX_NAME_LEN);
+	rte_strscpy(mp_req.name, PDUMP_MP, RTE_MP_MAX_NAME_LEN);
 	mp_req.len_param = sizeof(*req);
 	mp_req.num_fds = 0;
 	if (rte_mp_request_sync(&mp_req, &mp_reply, &ts) == 0) {
@@ -477,11 +568,17 @@ pdump_prepare_client_request(char *device, uint16_t queue,
 	return ret;
 }
 
-int
-rte_pdump_enable(uint16_t port, uint16_t queue, uint32_t flags,
-			struct rte_ring *ring,
-			struct rte_mempool *mp,
-			void *filter)
+/*
+ * There are two versions of this function, because although original API
+ * left place holder for future filter, it never checked the value.
+ * Therefore the API can't depend on application passing a non
+ * bogus value.
+ */
+static int
+pdump_enable(uint16_t port, uint16_t queue,
+	     uint32_t flags, uint32_t snaplen,
+	     struct rte_ring *ring, struct rte_mempool *mp,
+	     const struct rte_bpf_prm *prm)
 {
 	int ret;
 	char name[RTE_DEV_NAME_MAX_LEN];
@@ -496,20 +593,42 @@ rte_pdump_enable(uint16_t port, uint16_t queue, uint32_t flags,
 	if (ret < 0)
 		return ret;
 
-	ret = pdump_prepare_client_request(name, queue, flags,
-						ENABLE, ring, mp, filter);
+	if (snaplen == 0)
+		snaplen = UINT32_MAX;
 
-	return ret;
+	return pdump_prepare_client_request(name, queue, flags, snaplen,
+					    ENABLE, ring, mp, prm);
 }
 
 int
-rte_pdump_enable_by_deviceid(char *device_id, uint16_t queue,
-				uint32_t flags,
-				struct rte_ring *ring,
-				struct rte_mempool *mp,
-				void *filter)
+rte_pdump_enable(uint16_t port, uint16_t queue, uint32_t flags,
+		 struct rte_ring *ring,
+		 struct rte_mempool *mp,
+		 void *filter __rte_unused)
 {
-	int ret = 0;
+	return pdump_enable(port, queue, flags, 0,
+			    ring, mp, NULL);
+}
+
+int
+rte_pdump_enable_bpf(uint16_t port, uint16_t queue,
+		     uint32_t flags, uint32_t snaplen,
+		     struct rte_ring *ring,
+		     struct rte_mempool *mp,
+		     const struct rte_bpf_prm *prm)
+{
+	return pdump_enable(port, queue, flags, snaplen,
+			    ring, mp, prm);
+}
+
+static int
+pdump_enable_by_deviceid(const char *device_id, uint16_t queue,
+			 uint32_t flags, uint32_t snaplen,
+			 struct rte_ring *ring,
+			 struct rte_mempool *mp,
+			 const struct rte_bpf_prm *prm)
+{
+	int ret;
 
 	ret = pdump_validate_ring_mp(ring, mp);
 	if (ret < 0)
@@ -518,10 +637,30 @@ rte_pdump_enable_by_deviceid(char *device_id, uint16_t queue,
 	if (ret < 0)
 		return ret;
 
-	ret = pdump_prepare_client_request(device_id, queue, flags,
-						ENABLE, ring, mp, filter);
+	return pdump_prepare_client_request(device_id, queue, flags, snaplen,
+					    ENABLE, ring, mp, prm);
+}
 
-	return ret;
+int
+rte_pdump_enable_by_deviceid(char *device_id, uint16_t queue,
+			     uint32_t flags,
+			     struct rte_ring *ring,
+			     struct rte_mempool *mp,
+			     void *filter __rte_unused)
+{
+	return pdump_enable_by_deviceid(device_id, queue, flags, 0,
+					ring, mp, NULL);
+}
+
+int
+rte_pdump_enable_bpf_by_deviceid(const char *device_id, uint16_t queue,
+				 uint32_t flags, uint32_t snaplen,
+				 struct rte_ring *ring,
+				 struct rte_mempool *mp,
+				 const struct rte_bpf_prm *prm)
+{
+	return pdump_enable_by_deviceid(device_id, queue, flags, snaplen,
+					ring, mp, prm);
 }
 
 int
@@ -537,8 +676,8 @@ rte_pdump_disable(uint16_t port, uint16_t queue, uint32_t flags)
 	if (ret < 0)
 		return ret;
 
-	ret = pdump_prepare_client_request(name, queue, flags,
-						DISABLE, NULL, NULL, NULL);
+	ret = pdump_prepare_client_request(name, queue, flags, 0,
+					   DISABLE, NULL, NULL, NULL);
 
 	return ret;
 }
@@ -553,8 +692,66 @@ rte_pdump_disable_by_deviceid(char *device_id, uint16_t queue,
 	if (ret < 0)
 		return ret;
 
-	ret = pdump_prepare_client_request(device_id, queue, flags,
-						DISABLE, NULL, NULL, NULL);
+	ret = pdump_prepare_client_request(device_id, queue, flags, 0,
+					   DISABLE, NULL, NULL, NULL);
 
 	return ret;
 }
+
+static void
+pdump_sum_stats(uint16_t port, uint16_t nq,
+		struct rte_pdump_stats stats[RTE_MAX_ETHPORTS][RTE_MAX_QUEUES_PER_PORT],
+		struct rte_pdump_stats *total)
+{
+	uint64_t *sum = (uint64_t *)total;
+	unsigned int i;
+	uint64_t val;
+	uint16_t qid;
+
+	for (qid = 0; qid < nq; qid++) {
+		const uint64_t *perq = (const uint64_t *)&stats[port][qid];
+
+		for (i = 0; i < sizeof(*total) / sizeof(uint64_t); i++) {
+			val = __atomic_load_n(&perq[i], __ATOMIC_RELAXED);
+			sum[i] += val;
+		}
+	}
+}
+
+int
+rte_pdump_stats(uint16_t port, struct rte_pdump_stats *stats)
+{
+	struct rte_eth_dev_info dev_info;
+	const struct rte_memzone *mz;
+	int ret;
+
+	memset(stats, 0, sizeof(*stats));
+	ret = rte_eth_dev_info_get(port, &dev_info);
+	if (ret != 0) {
+		PDUMP_LOG(ERR,
+			  "Error during getting device (port %u) info: %s\n",
+			  port, strerror(-ret));
+		return ret;
+	}
+
+	if (pdump_stats == NULL) {
+		if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
+			PDUMP_LOG(ERR,
+				  "pdump not initialized\n");
+			rte_errno = EINVAL;
+			return -1;
+		}
+
+		mz = rte_memzone_lookup(MZ_RTE_PDUMP_STATS);
+		if (mz == NULL) {
+			PDUMP_LOG(ERR, "can not find pdump stats\n");
+			rte_errno = EINVAL;
+			return -1;
+		}
+		pdump_stats = mz->addr;
+	}
+
+	pdump_sum_stats(port, dev_info.nb_rx_queues, pdump_stats->rx, stats);
+	pdump_sum_stats(port, dev_info.nb_tx_queues, pdump_stats->tx, stats);
+	return 0;
+}
diff --git a/lib/pdump/rte_pdump.h b/lib/pdump/rte_pdump.h
index 6b00fc17aeb2..be3fd14c4bd3 100644
--- a/lib/pdump/rte_pdump.h
+++ b/lib/pdump/rte_pdump.h
@@ -15,6 +15,7 @@
 #include <stdint.h>
 #include <rte_mempool.h>
 #include <rte_ring.h>
+#include <rte_bpf.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -26,7 +27,9 @@ enum {
 	RTE_PDUMP_FLAG_RX = 1,  /* receive direction */
 	RTE_PDUMP_FLAG_TX = 2,  /* transmit direction */
 	/* both receive and transmit directions */
-	RTE_PDUMP_FLAG_RXTX = (RTE_PDUMP_FLAG_RX|RTE_PDUMP_FLAG_TX)
+	RTE_PDUMP_FLAG_RXTX = (RTE_PDUMP_FLAG_RX|RTE_PDUMP_FLAG_TX),
+
+	RTE_PDUMP_FLAG_PCAPNG = 4, /* format for pcapng */
 };
 
 /**
@@ -68,7 +71,7 @@ rte_pdump_uninit(void);
  * @param mp
  *  mempool on to which original packets will be mirrored or duplicated.
  * @param filter
- *  place holder for packet filtering.
+ *  Unused should be NULL.
  *
  * @return
  *    0 on success, -1 on error, rte_errno is set accordingly.
@@ -80,6 +83,41 @@ rte_pdump_enable(uint16_t port, uint16_t queue, uint32_t flags,
 		struct rte_mempool *mp,
 		void *filter);
 
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
+ *
+ * Enables packet capturing on given port and queue with filtering.
+ *
+ * @param port_id
+ *  The Ethernet port on which packet capturing should be enabled.
+ * @param queue
+ *  The queue on the Ethernet port which packet capturing
+ *  should be enabled. Pass UINT16_MAX to enable packet capturing on all
+ *  queues of a given port.
+ * @param flags
+ *  Pdump library flags that specify direction and packet format.
+ * @param snaplen
+ *  The upper limit on bytes to copy.
+ *  Passing UINT32_MAX means capture all the possible data.
+ * @param ring
+ *  The ring on which captured packets will be enqueued for user.
+ * @param mp
+ *  The mempool on to which original packets will be mirrored or duplicated.
+ * @param prm
+ *  Use BPF program to run to filter packes (can be NULL)
+ *
+ * @return
+ *    0 on success, -1 on error, rte_errno is set accordingly.
+ */
+__rte_experimental
+int
+rte_pdump_enable_bpf(uint16_t port_id, uint16_t queue,
+		     uint32_t flags, uint32_t snaplen,
+		     struct rte_ring *ring,
+		     struct rte_mempool *mp,
+		     const struct rte_bpf_prm *prm);
+
 /**
  * Disables packet capturing on given port and queue.
  *
@@ -118,7 +156,7 @@ rte_pdump_disable(uint16_t port, uint16_t queue, uint32_t flags);
  * @param mp
  *  mempool on to which original packets will be mirrored or duplicated.
  * @param filter
- *  place holder for packet filtering.
+ *  unused should be NULL
  *
  * @return
  *    0 on success, -1 on error, rte_errno is set accordingly.
@@ -131,6 +169,43 @@ rte_pdump_enable_by_deviceid(char *device_id, uint16_t queue,
 				struct rte_mempool *mp,
 				void *filter);
 
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
+ *
+ * Enables packet capturing on given device id and queue with filtering.
+ * device_id can be name or pci address of device.
+ *
+ * @param device_id
+ *  device id on which packet capturing should be enabled.
+ * @param queue
+ *  The queue on the Ethernet port which packet capturing
+ *  should be enabled. Pass UINT16_MAX to enable packet capturing on all
+ *  queues of a given port.
+ * @param flags
+ *  Pdump library flags that specify direction and packet format.
+ * @param snaplen
+ *  The upper limit on bytes to copy.
+ *  Passing UINT32_MAX means capture all the possible data.
+ * @param ring
+ *  The ring on which captured packets will be enqueued for user.
+ * @param mp
+ *  The mempool on to which original packets will be mirrored or duplicated.
+ * @param filter
+ *  Use BPF program to run to filter packes (can be NULL)
+ *
+ * @return
+ *    0 on success, -1 on error, rte_errno is set accordingly.
+ */
+__rte_experimental
+int
+rte_pdump_enable_bpf_by_deviceid(const char *device_id, uint16_t queue,
+				 uint32_t flags, uint32_t snaplen,
+				 struct rte_ring *ring,
+				 struct rte_mempool *mp,
+				 const struct rte_bpf_prm *filter);
+
+
 /**
  * Disables packet capturing on given device_id and queue.
  * device_id can be name or pci address of device.
@@ -153,6 +228,35 @@ int
 rte_pdump_disable_by_deviceid(char *device_id, uint16_t queue,
 				uint32_t flags);
 
+
+/**
+ * A structure used to retrieve statistics from packet capture.
+ * The statistics are sum of both receive and transmit queues.
+ */
+struct rte_pdump_stats {
+	uint64_t accepted; /**< Number of packets accepted by filter. */
+	uint64_t filtered; /**< Number of packets rejected by filter. */
+	uint64_t nombuf;   /**< Number of mbuf allocation failures. */
+	uint64_t ringfull; /**< Number of missed packets due to ring full. */
+
+	uint64_t reserved[4]; /**< Reserved and pad to cache line */
+};
+
+/**
+ * Retrieve the packet capture statistics for a queue.
+ *
+ * @param port_id
+ *   The port identifier of the Ethernet device.
+ * @param stats
+ *   A pointer to structure of type *rte_pdump_stats* to be filled in.
+ * @return
+ *   Zero if successful. -1 on error and rte_errno is set.
+ */
+__rte_experimental
+int
+rte_pdump_stats(uint16_t port_id, struct rte_pdump_stats *stats);
+
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/lib/pdump/version.map b/lib/pdump/version.map
index f0a9d12c9a9e..ce5502d9cdf4 100644
--- a/lib/pdump/version.map
+++ b/lib/pdump/version.map
@@ -10,3 +10,11 @@ DPDK_22 {
 
 	local: *;
 };
+
+EXPERIMENTAL {
+	global:
+
+	rte_pdump_enable_bpf;
+	rte_pdump_enable_bpf_by_deviceid;
+	rte_pdump_stats;
+};
-- 
2.30.2


^ permalink raw reply	[relevance 1%]

* [dpdk-dev] [PATCH v8 11/12] doc: changes for new pcapng and dumpcap
    2021-09-13 18:15  1%   ` [dpdk-dev] [PATCH v8 06/12] pdump: support pcapng and filtering Stephen Hemminger
@ 2021-09-13 18:15  1%   ` Stephen Hemminger
  1 sibling, 0 replies; 200+ results
From: Stephen Hemminger @ 2021-09-13 18:15 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

Describe the new packet capture library and utilities

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 doc/api/doxy-api-index.md                     |  1 +
 doc/api/doxy-api.conf.in                      |  1 +
 .../howto/img/packet_capture_framework.svg    | 96 +++++++++----------
 doc/guides/howto/packet_capture_framework.rst | 67 ++++++-------
 doc/guides/prog_guide/index.rst               |  1 +
 doc/guides/prog_guide/pcapng_lib.rst          | 24 +++++
 doc/guides/prog_guide/pdump_lib.rst           | 28 ++++--
 doc/guides/rel_notes/release_21_11.rst        | 10 ++
 doc/guides/tools/dumpcap.rst                  | 86 +++++++++++++++++
 doc/guides/tools/index.rst                    |  1 +
 10 files changed, 228 insertions(+), 87 deletions(-)
 create mode 100644 doc/guides/prog_guide/pcapng_lib.rst
 create mode 100644 doc/guides/tools/dumpcap.rst

diff --git a/doc/api/doxy-api-index.md b/doc/api/doxy-api-index.md
index 1992107a0356..ee07394d1c78 100644
--- a/doc/api/doxy-api-index.md
+++ b/doc/api/doxy-api-index.md
@@ -223,3 +223,4 @@ The public API headers are grouped by topics:
   [experimental APIs]  (@ref rte_compat.h),
   [ABI versioning]     (@ref rte_function_versioning.h),
   [version]            (@ref rte_version.h)
+  [pcapng]             (@ref rte_pcapng.h)
diff --git a/doc/api/doxy-api.conf.in b/doc/api/doxy-api.conf.in
index 325a0195c6ab..aba17799a9a1 100644
--- a/doc/api/doxy-api.conf.in
+++ b/doc/api/doxy-api.conf.in
@@ -58,6 +58,7 @@ INPUT                   = @TOPDIR@/doc/api/doxy-api-index.md \
                           @TOPDIR@/lib/metrics \
                           @TOPDIR@/lib/node \
                           @TOPDIR@/lib/net \
+                          @TOPDIR@/lib/pcapng \
                           @TOPDIR@/lib/pci \
                           @TOPDIR@/lib/pdump \
                           @TOPDIR@/lib/pipeline \
diff --git a/doc/guides/howto/img/packet_capture_framework.svg b/doc/guides/howto/img/packet_capture_framework.svg
index a76baf71fdee..1c2646a81096 100644
--- a/doc/guides/howto/img/packet_capture_framework.svg
+++ b/doc/guides/howto/img/packet_capture_framework.svg
@@ -1,6 +1,4 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
 <svg
    xmlns:osb="http://www.openswatchbook.org/uri/2009/osb"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
@@ -16,8 +14,8 @@
    viewBox="0 0 425.19685 283.46457"
    id="svg2"
    version="1.1"
-   inkscape:version="0.91 r13725"
-   sodipodi:docname="drawing-pcap.svg">
+   inkscape:version="1.0.2 (e86c870879, 2021-01-15)"
+   sodipodi:docname="packet_capture_framework.svg">
   <defs
      id="defs4">
     <marker
@@ -228,7 +226,7 @@
        x2="487.64606"
        y2="258.38232"
        gradientUnits="userSpaceOnUse"
-       gradientTransform="translate(-84.916417,744.90779)" />
+       gradientTransform="matrix(1.1457977,0,0,0.99944907,-151.97019,745.05014)" />
     <linearGradient
        inkscape:collect="always"
        xlink:href="#linearGradient5784"
@@ -277,17 +275,18 @@
      borderopacity="1.0"
      inkscape:pageopacity="0.0"
      inkscape:pageshadow="2"
-     inkscape:zoom="0.57434918"
-     inkscape:cx="215.17857"
-     inkscape:cy="285.26445"
+     inkscape:zoom="1"
+     inkscape:cx="226.77165"
+     inkscape:cy="78.124511"
      inkscape:document-units="px"
      inkscape:current-layer="layer1"
      showgrid="false"
-     inkscape:window-width="1874"
-     inkscape:window-height="971"
-     inkscape:window-x="2"
-     inkscape:window-y="24"
-     inkscape:window-maximized="0" />
+     inkscape:window-width="2560"
+     inkscape:window-height="1414"
+     inkscape:window-x="0"
+     inkscape:window-y="0"
+     inkscape:window-maximized="1"
+     inkscape:document-rotation="0" />
   <metadata
      id="metadata7">
     <rdf:RDF>
@@ -296,7 +295,7 @@
         <dc:format>image/svg+xml</dc:format>
         <dc:type
            rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
-        <dc:title></dc:title>
+        <dc:title />
       </cc:Work>
     </rdf:RDF>
   </metadata>
@@ -321,15 +320,15 @@
        y="790.82452" />
     <text
        xml:space="preserve"
-       style="font-style:normal;font-weight:normal;font-size:12.5px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
        x="61.050636"
        y="807.3205"
-       id="text4152"
-       sodipodi:linespacing="125%"><tspan
+       id="text4152"><tspan
          sodipodi:role="line"
          id="tspan4154"
          x="61.050636"
-         y="807.3205">DPDK Primary Application</tspan></text>
+         y="807.3205"
+         style="font-size:12.5px;line-height:1.25">DPDK Primary Application</tspan></text>
     <rect
        style="fill:#000000;fill-opacity:0;stroke:#257cdc;stroke-width:2;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
        id="rect4156-6"
@@ -339,19 +338,20 @@
        y="827.01843" />
     <text
        xml:space="preserve"
-       style="font-style:normal;font-weight:normal;font-size:12.5px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
        x="350.68585"
        y="841.16058"
-       id="text4189"
-       sodipodi:linespacing="125%"><tspan
+       id="text4189"><tspan
          sodipodi:role="line"
          id="tspan4191"
          x="350.68585"
-         y="841.16058">dpdk-pdump</tspan><tspan
+         y="841.16058"
+         style="font-size:12.5px;line-height:1.25">dpdk-dumpcap</tspan><tspan
          sodipodi:role="line"
          x="350.68585"
          y="856.78558"
-         id="tspan4193">tool</tspan></text>
+         id="tspan4193"
+         style="font-size:12.5px;line-height:1.25">tool</tspan></text>
     <rect
        style="fill:#000000;fill-opacity:0;stroke:#257cdc;stroke-width:2;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
        id="rect4156-6-4"
@@ -361,15 +361,15 @@
        y="891.16315" />
     <text
        xml:space="preserve"
-       style="font-style:normal;font-weight:normal;font-size:12.5px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
        x="352.70612"
        y="905.3053"
-       id="text4189-1"
-       sodipodi:linespacing="125%"><tspan
+       id="text4189-1"><tspan
          sodipodi:role="line"
          x="352.70612"
          y="905.3053"
-         id="tspan4193-3">PCAP PMD</tspan></text>
+         id="tspan4193-3"
+         style="font-size:12.5px;line-height:1.25">librte_pcapng</tspan></text>
     <rect
        style="fill:url(#linearGradient5745);fill-opacity:1;stroke:#257cdc;stroke-width:2;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
        id="rect4156-6-6"
@@ -379,15 +379,15 @@
        y="923.9931" />
     <text
        xml:space="preserve"
-       style="font-style:normal;font-weight:normal;font-size:12.5px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
        x="136.02846"
        y="938.13525"
-       id="text4189-0"
-       sodipodi:linespacing="125%"><tspan
+       id="text4189-0"><tspan
          sodipodi:role="line"
          x="136.02846"
          y="938.13525"
-         id="tspan4193-6">dpdk_port0</tspan></text>
+         id="tspan4193-6"
+         style="font-size:12.5px;line-height:1.25">dpdk_port0</tspan></text>
     <rect
        style="fill:#000000;fill-opacity:0;stroke:#257cdc;stroke-width:2;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
        id="rect4156-6-5"
@@ -397,33 +397,33 @@
        y="824.99817" />
     <text
        xml:space="preserve"
-       style="font-style:normal;font-weight:normal;font-size:12.5px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
        x="137.54369"
        y="839.14026"
-       id="text4189-4"
-       sodipodi:linespacing="125%"><tspan
+       id="text4189-4"><tspan
          sodipodi:role="line"
          x="137.54369"
          y="839.14026"
-         id="tspan4193-2">librte_pdump</tspan></text>
+         id="tspan4193-2"
+         style="font-size:12.5px;line-height:1.25">librte_pdump</tspan></text>
     <rect
-       style="fill:url(#linearGradient5788);fill-opacity:1;stroke:#257cdc;stroke-width:1;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       style="fill:url(#linearGradient5788);fill-opacity:1;stroke:#257cdc;stroke-width:1.07013;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
        id="rect4156-6-4-5"
-       width="94.449265"
-       height="35.355339"
-       x="307.7804"
-       y="985.61243" />
+       width="108.21974"
+       height="35.335861"
+       x="297.9809"
+       y="985.62219" />
     <text
        xml:space="preserve"
-       style="font-style:normal;font-weight:normal;font-size:12.5px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
        x="352.70618"
        y="999.75458"
-       id="text4189-1-8"
-       sodipodi:linespacing="125%"><tspan
+       id="text4189-1-8"><tspan
          sodipodi:role="line"
          x="352.70618"
          y="999.75458"
-         id="tspan4193-3-2">capture.pcap</tspan></text>
+         id="tspan4193-3-2"
+         style="font-size:12.5px;line-height:1.25">capture.pcapng</tspan></text>
     <rect
        style="fill:url(#linearGradient5788-1);fill-opacity:1;stroke:#257cdc;stroke-width:1.12555885;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
        id="rect4156-6-4-5-1"
@@ -433,15 +433,15 @@
        y="983.14984" />
     <text
        xml:space="preserve"
-       style="font-style:normal;font-weight:normal;font-size:12.5px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
        x="136.53352"
        y="1002.785"
-       id="text4189-1-8-4"
-       sodipodi:linespacing="125%"><tspan
+       id="text4189-1-8-4"><tspan
          sodipodi:role="line"
          x="136.53352"
          y="1002.785"
-         id="tspan4193-3-2-7">Traffic Generator</tspan></text>
+         id="tspan4193-3-2-7"
+         style="font-size:12.5px;line-height:1.25">Traffic Generator</tspan></text>
     <path
        style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#marker7331)"
        d="m 351.46948,927.02357 c 0,57.5787 0,57.5787 0,57.5787"
diff --git a/doc/guides/howto/packet_capture_framework.rst b/doc/guides/howto/packet_capture_framework.rst
index c31bac52340e..78baa609a021 100644
--- a/doc/guides/howto/packet_capture_framework.rst
+++ b/doc/guides/howto/packet_capture_framework.rst
@@ -1,18 +1,19 @@
 ..  SPDX-License-Identifier: BSD-3-Clause
     Copyright(c) 2017 Intel Corporation.
 
-DPDK pdump Library and pdump Tool
-=================================
+DPDK packet capture libraries and tools
+=======================================
 
 This document describes how the Data Plane Development Kit (DPDK) Packet
 Capture Framework is used for capturing packets on DPDK ports. It is intended
 for users of DPDK who want to know more about the Packet Capture feature and
 for those who want to monitor traffic on DPDK-controlled devices.
 
-The DPDK packet capture framework was introduced in DPDK v16.07. The DPDK
-packet capture framework consists of the DPDK pdump library and DPDK pdump
-tool.
-
+The DPDK packet capture framework was introduced in DPDK v16.07 and
+enhanced in 21.1. The DPDK packet capture framework consists of the
+libraries for collecting packets ``librte_pdump`` and writing packets
+to a file ``librte_pcapng``. There are two sample applications:
+``dpdk-dumpcap`` and older ``dpdk-pdump``.
 
 Introduction
 ------------
@@ -22,43 +23,46 @@ allow users to initialize the packet capture framework and to enable or
 disable packet capture. The library works on a multi process communication model and its
 usage is recommended for debugging purposes.
 
-The :ref:`dpdk-pdump <pdump_tool>` tool is developed based on the
-``librte_pdump`` library.  It runs as a DPDK secondary process and is capable
-of enabling or disabling packet capture on DPDK ports. The ``dpdk-pdump`` tool
-provides command-line options with which users can request enabling or
-disabling of the packet capture on DPDK ports.
+The :ref:`librte_pcapng <pcapng_library>` library provides the APIs to format
+packets and write them to a file in Pcapng format.
+
+
+The :ref:`dpdk-dumpcap <dumpcap_tool>` is a tool that captures packets in
+like Wireshark dumpcap does for Linux. It runs as a DPDK secondary process and
+captures packets from one or more interfaces and writes them to a file
+in Pcapng format.  The ``dpdk-dumpcap`` tool is designed to take
+most of the same options as the Wireshark ``dumpcap`` command.
 
-The application which initializes the packet capture framework will be a primary process
-and the application that enables or disables the packet capture will
-be a secondary process. The primary process sends the Rx and Tx packets from the DPDK ports
-to the secondary process.
+Without any options it will use the packet capture framework to
+capture traffic from the first available DPDK port.
 
 In DPDK the ``testpmd`` application can be used to initialize the packet
-capture framework and acts as a server, and the ``dpdk-pdump`` tool acts as a
+capture framework and acts as a server, and the ``dpdk-dumpcap`` tool acts as a
 client. To view Rx or Tx packets of ``testpmd``, the application should be
-launched first, and then the ``dpdk-pdump`` tool. Packets from ``testpmd``
-will be sent to the tool, which then sends them on to the Pcap PMD device and
-that device writes them to the Pcap file or to an external interface depending
-on the command-line option used.
+launched first, and then the ``dpdk-dumpcap`` tool. Packets from ``testpmd``
+will be sent to the tool, and then to the Pcapng file.
 
 Some things to note:
 
-* The ``dpdk-pdump`` tool can only be used in conjunction with a primary
+* All tools using ``librte_pdump`` can only be used in conjunction with a primary
   application which has the packet capture framework initialized already. In
   dpdk, only ``testpmd`` is modified to initialize packet capture framework,
-  other applications remain untouched. So, if the ``dpdk-pdump`` tool has to
+  other applications remain untouched. So, if the ``dpdk-dumpcap`` tool has to
   be used with any application other than the testpmd, the user needs to
   explicitly modify that application to call the packet capture framework
   initialization code. Refer to the ``app/test-pmd/testpmd.c`` code and look
   for ``pdump`` keyword to see how this is done.
 
-* The ``dpdk-pdump`` tool depends on the libpcap based PMD.
+* The ``dpdk-pdump`` tool is an older tool created as demonstration of ``librte_pdump``
+  library. The ``dpdk-pdump`` tool provides more limited functionality and
+  and depends on the Pcap PMD. It is retained only for compatibility reasons;
+  users should use ``dpdk-dumpcap`` instead.
 
 
 Test Environment
 ----------------
 
-The overview of using the Packet Capture Framework and the ``dpdk-pdump`` tool
+The overview of using the Packet Capture Framework and the ``dpdk-dumpcap`` utility
 for packet capturing on the DPDK port in
 :numref:`figure_packet_capture_framework`.
 
@@ -66,13 +70,13 @@ for packet capturing on the DPDK port in
 
 .. figure:: img/packet_capture_framework.*
 
-   Packet capturing on a DPDK port using the dpdk-pdump tool.
+   Packet capturing on a DPDK port using the dpdk-dumpcap utility.
 
 
 Running the Application
 -----------------------
 
-The following steps demonstrate how to run the ``dpdk-pdump`` tool to capture
+The following steps demonstrate how to run the ``dpdk-dumpcap`` tool to capture
 Rx side packets on dpdk_port0 in :numref:`figure_packet_capture_framework` and
 inspect them using ``tcpdump``.
 
@@ -80,16 +84,15 @@ inspect them using ``tcpdump``.
 
      sudo <build_dir>/app/dpdk-testpmd -c 0xf0 -n 4 -- -i --port-topology=chained
 
-#. Launch the pdump tool as follows::
+#. Launch the dpdk-dump as follows::
 
-     sudo <build_dir>/app/dpdk-pdump -- \
-          --pdump 'port=0,queue=*,rx-dev=/tmp/capture.pcap'
+     sudo <build_dir>/app/dpdk-dumpcap -w /tmp/capture.pcapng
 
 #. Send traffic to dpdk_port0 from traffic generator.
-   Inspect packets captured in the file capture.pcap using a tool
-   that can interpret Pcap files, for example tcpdump::
+   Inspect packets captured in the file capture.pcap using a tool such as
+   tcpdump or tshark that can interpret Pcapng files::
 
-     $tcpdump -nr /tmp/capture.pcap
+     $ tcpdump -nr /tmp/capture.pcapng
      reading from file /tmp/capture.pcap, link-type EN10MB (Ethernet)
      11:11:36.891404 IP 4.4.4.4.whois++ > 3.3.3.3.whois++: UDP, length 18
      11:11:36.891442 IP 4.4.4.4.whois++ > 3.3.3.3.whois++: UDP, length 18
diff --git a/doc/guides/prog_guide/index.rst b/doc/guides/prog_guide/index.rst
index 2dce507f46a3..b440c77c2ba1 100644
--- a/doc/guides/prog_guide/index.rst
+++ b/doc/guides/prog_guide/index.rst
@@ -43,6 +43,7 @@ Programmer's Guide
     ip_fragment_reassembly_lib
     generic_receive_offload_lib
     generic_segmentation_offload_lib
+    pcapng_lib
     pdump_lib
     multi_proc_support
     kernel_nic_interface
diff --git a/doc/guides/prog_guide/pcapng_lib.rst b/doc/guides/prog_guide/pcapng_lib.rst
new file mode 100644
index 000000000000..36379b530a57
--- /dev/null
+++ b/doc/guides/prog_guide/pcapng_lib.rst
@@ -0,0 +1,24 @@
+..  SPDX-License-Identifier: BSD-3-Clause
+    Copyright(c) 2016 Intel Corporation.
+
+.. _pcapng_library:
+
+Packet Capture File Writer
+==========================
+
+Pcapng is a library for creating files in Pcapng file format.
+The Pcapng file format is the default capture file format for modern
+network capture processing tools. It can be read by wireshark and tcpdump.
+
+Usage
+-----
+
+Before the library can be used the function ``rte_pcapng_init``
+should be called once to initialize timestamp computation.
+
+
+References
+----------
+* Draft RFC https://www.ietf.org/id/draft-tuexen-opsawg-pcapng-03.html
+
+* Project repository  https://github.com/pcapng/pcapng/
diff --git a/doc/guides/prog_guide/pdump_lib.rst b/doc/guides/prog_guide/pdump_lib.rst
index 62c0b015b2fe..9af91415e5ea 100644
--- a/doc/guides/prog_guide/pdump_lib.rst
+++ b/doc/guides/prog_guide/pdump_lib.rst
@@ -3,10 +3,10 @@
 
 .. _pdump_library:
 
-The librte_pdump Library
-========================
+The Packet Capture Library
+==========================
 
-The ``librte_pdump`` library provides a framework for packet capturing in DPDK.
+The DPDK ``pdump`` library provides a framework for packet capturing in DPDK.
 The library does the complete copy of the Rx and Tx mbufs to a new mempool and
 hence it slows down the performance of the applications, so it is recommended
 to use this library for debugging purposes.
@@ -23,11 +23,19 @@ or disable the packet capture, and to uninitialize it.
 
 * ``rte_pdump_enable()``:
   This API enables the packet capture on a given port and queue.
-  Note: The filter option in the API is a place holder for future enhancements.
+
+* ``rte_pdump_enable_bpf()``
+  This API enables the packet capture on a given port and queue.
+  It also allows setting an optional filter using DPDK BPF interpreter and
+  setting the captured packet length.
 
 * ``rte_pdump_enable_by_deviceid()``:
   This API enables the packet capture on a given device id (``vdev name or pci address``) and queue.
-  Note: The filter option in the API is a place holder for future enhancements.
+
+* ``rte_pdump_enable_bpf_by_deviceid()``
+  This API enables the packet capture on a given device id (``vdev name or pci address``) and queue.
+  It also allows seating an optional filter using DPDK BPF interpreter and
+  setting the captured packet length.
 
 * ``rte_pdump_disable()``:
   This API disables the packet capture on a given port and queue.
@@ -61,6 +69,12 @@ and enables the packet capture by registering the Ethernet RX and TX callbacks f
 and queue combinations. Then the primary process will mirror the packets to the new mempool and enqueue them to
 the rte_ring that secondary process have passed to these APIs.
 
+The packet ring supports one of two formats. The default format enqueues copies of the original packets
+into the rte_ring. If the ``RTE_PDUMP_FLAG_PCAPNG`` is set the mbuf data is extended with header and trailer
+to match the format of Pcapng enhanced packet block. The enhanced packet block has meta-data such as the
+timestamp, port and queue the packet was captured on. It is up to the application consuming the
+packets from the ring to select the format desired.
+
 The library APIs ``rte_pdump_disable()`` and ``rte_pdump_disable_by_deviceid()`` disables the packet capture.
 For the calls to these APIs from secondary process, the library creates the "pdump disable" request and sends
 the request to the primary process over the multi process channel. The primary process takes this request and
@@ -74,5 +88,5 @@ function.
 Use Case: Packet Capturing
 --------------------------
 
-The DPDK ``app/pdump`` tool is developed based on this library to capture packets in DPDK.
-Users can use this as an example to develop their own packet capturing tools.
+The DPDK ``app/dpdk-dumpcap`` utility uses this library
+to capture packets in DPDK.
diff --git a/doc/guides/rel_notes/release_21_11.rst b/doc/guides/rel_notes/release_21_11.rst
index 3fa80186957a..43464e999aaa 100644
--- a/doc/guides/rel_notes/release_21_11.rst
+++ b/doc/guides/rel_notes/release_21_11.rst
@@ -82,6 +82,16 @@ New Features
 
   * Added PDCP short MAC-I support.
 
+* **Enhanced Packet capture.**
+
+  * New dpdk-dumpcap program that has most of the features of the
+    wireshark dumpcap utility including: capture of multiple interfaces,
+    filtering, and stopping after number of bytes, packets.
+  * New library for writing pcapng packet capture files.
+  * Enhancements to the pdump library to support:
+    * Packet filter with BPF.
+    * Pcapng format with timestamps and meta-data.
+    * Fixes packet capture with stripped VLAN tags.
 
 Removed Items
 -------------
diff --git a/doc/guides/tools/dumpcap.rst b/doc/guides/tools/dumpcap.rst
new file mode 100644
index 000000000000..664ea0c79802
--- /dev/null
+++ b/doc/guides/tools/dumpcap.rst
@@ -0,0 +1,86 @@
+..  SPDX-License-Identifier: BSD-3-Clause
+    Copyright(c) 2020 Microsoft Corporation.
+
+.. _dumpcap_tool:
+
+dpdk-dumpcap Application
+========================
+
+The ``dpdk-dumpcap`` tool is a Data Plane Development Kit (DPDK)
+network traffic dump tool.  The interface is similar to  the dumpcap tool in Wireshark.
+It runs as a secondary DPDK process and lets you capture packets that are
+coming into and out of a DPDK primary process.
+The ``dpdk-dumpcap`` writes files in Pcapng packet format using
+capture file format is pcapng.
+
+Without any options set it will use DPDK to capture traffic from the first
+available DPDK interface and write the received raw packet data, along
+with timestamps into a pcapng file.
+
+If the ``-w`` option is not specified, ``dpdk-dumpcap`` writes to a newly
+create file with a name chosen based on interface name and timestamp.
+If ``-w`` option is specified, then that file is used.
+
+   .. Note::
+      * The ``dpdk-dumpcap`` tool can only be used in conjunction with a primary
+        application which has the packet capture framework initialized already.
+        In dpdk, only the ``testpmd`` is modified to initialize packet capture
+        framework, other applications remain untouched. So, if the ``dpdk-dumpcap``
+        tool has to be used with any application other than the testpmd, user
+        needs to explicitly modify that application to call packet capture
+        framework initialization code. Refer ``app/test-pmd/testpmd.c``
+        code to see how this is done.
+
+      * The ``dpdk-dumpcap`` tool runs as a DPDK secondary process. It exits when
+        the primary application exits.
+
+
+Running the Application
+-----------------------
+
+To list interfaces available for capture use ``--list-interfaces``.
+
+To filter packets in style of *tshark* use the ``-f`` flag.
+
+To capture on multiple interfaces at once, use multiple ``-I`` flags.
+
+Example
+-------
+
+.. code-block:: console
+
+   # ./<build_dir>/app/dpdk-dumpcap --list-interfaces
+   0. 000:00:03.0
+   1. 000:00:03.1
+
+   # ./<build_dir>/app/dpdk-dumpcap -I 0000:00:03.0 -c 6 -w /tmp/sample.pcapng
+   Packets captured: 6
+   Packets received/dropped on interface '0000:00:03.0' 6/0
+
+   # ./<build_dir>/app/dpdk-dumpcap -f 'tcp port 80'
+   Packets captured: 6
+   Packets received/dropped on interface '0000:00:03.0' 10/8
+
+
+Limitations
+-----------
+The following option of Wireshark ``dumpcap`` is not yet implemented:
+
+   * ``-b|--ring-buffer`` -- more complex file management.
+
+The following options do not make sense in the context of DPDK.
+
+   * ``-C <byte_limit>`` -- its a kernel thing
+
+   * ``-t`` -- use a thread per interface
+
+   * Timestamp type.
+
+   * Link data types. Only EN10MB (Ethernet) is supported.
+
+   * Wireless related options:  ``-I|--monitor-mode`` and  ``-k <freq>``
+
+
+.. Note::
+   * The options to ``dpdk-dumpcap`` are like the Wireshark dumpcap program and
+     are not the same as ``dpdk-pdump`` and other DPDK applications.
diff --git a/doc/guides/tools/index.rst b/doc/guides/tools/index.rst
index 93dde4148e90..b71c12b8f2dd 100644
--- a/doc/guides/tools/index.rst
+++ b/doc/guides/tools/index.rst
@@ -8,6 +8,7 @@ DPDK Tools User Guides
     :maxdepth: 2
     :numbered:
 
+    dumpcap
     proc_info
     pdump
     pmdinfo
-- 
2.30.2


^ permalink raw reply	[relevance 1%]

* Re: [dpdk-dev] [PATCH V3 01/24] pipeline: move data structures to internal header file
  2021-09-13 16:51  3%   ` Stephen Hemminger
@ 2021-09-13 18:42  0%     ` Dumitrescu, Cristian
  2021-09-13 19:02  0%       ` Stephen Hemminger
  0 siblings, 1 reply; 200+ results
From: Dumitrescu, Cristian @ 2021-09-13 18:42 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: dev



> -----Original Message-----
> From: Stephen Hemminger <stephen@networkplumber.org>
> Sent: Monday, September 13, 2021 5:51 PM
> To: Dumitrescu, Cristian <cristian.dumitrescu@intel.com>
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH V3 01/24] pipeline: move data structures to
> internal header file
> 
> On Mon, 13 Sep 2021 17:44:20 +0100
> Cristian Dumitrescu <cristian.dumitrescu@intel.com> wrote:
> 
> > Start to consolidate the data structures and inline functions required
> > by the pipeline instructions into an internal header file.
> >
> > Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
> > ---
> > Depends-on: series-18297 ("[V4,1/4] table: add support learner tables")
> 
> Won't this change will make future changes to API/ABI harder because more
> of the pipeline internals are exposed to application?

Not at all, this header file is internal to the library and not accessible to the application.

^ permalink raw reply	[relevance 0%]

* Re: [dpdk-dev] [PATCH V3 01/24] pipeline: move data structures to internal header file
  2021-09-13 18:42  0%     ` Dumitrescu, Cristian
@ 2021-09-13 19:02  0%       ` Stephen Hemminger
  0 siblings, 0 replies; 200+ results
From: Stephen Hemminger @ 2021-09-13 19:02 UTC (permalink / raw)
  To: Dumitrescu, Cristian; +Cc: dev

On Mon, 13 Sep 2021 18:42:39 +0000
"Dumitrescu, Cristian" <cristian.dumitrescu@intel.com> wrote:

> > -----Original Message-----
> > From: Stephen Hemminger <stephen@networkplumber.org>
> > Sent: Monday, September 13, 2021 5:51 PM
> > To: Dumitrescu, Cristian <cristian.dumitrescu@intel.com>
> > Cc: dev@dpdk.org
> > Subject: Re: [dpdk-dev] [PATCH V3 01/24] pipeline: move data structures to
> > internal header file
> > 
> > On Mon, 13 Sep 2021 17:44:20 +0100
> > Cristian Dumitrescu <cristian.dumitrescu@intel.com> wrote:
> >   
> > > Start to consolidate the data structures and inline functions required
> > > by the pipeline instructions into an internal header file.
> > >
> > > Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
> > > ---
> > > Depends-on: series-18297 ("[V4,1/4] table: add support learner tables")  
> > 
> > Won't this change will make future changes to API/ABI harder because more
> > of the pipeline internals are exposed to application?  
> 
> Not at all, this header file is internal to the library and not accessible to the application.

Good

^ permalink raw reply	[relevance 0%]

* Re: [dpdk-dev] [PATCH v1] bbdev: remove experimental tag from API
  2021-09-01 14:54  3%       ` Chautru, Nicolas
@ 2021-09-13 19:44  0%         ` Maxime Coquelin
  2021-09-14  3:13  0%           ` Hemant Agrawal
  0 siblings, 1 reply; 200+ results
From: Maxime Coquelin @ 2021-09-13 19:44 UTC (permalink / raw)
  To: Chautru, Nicolas, Kinsella, Ray, Hemant Agrawal, David Marchand
  Cc: dev, Akhil Goyal, Thomas Monjalon, Tom Rix, Zhang, Mingshan, Joshi, Arun


On 9/1/21 4:54 PM, Chautru, Nicolas wrote:
> 
> 
>> -----Original Message-----
>> From: Kinsella, Ray <mdr@ashroe.eu>
>> Sent: Wednesday, September 1, 2021 4:15 AM
>> To: Hemant Agrawal <hemant.agrawal@nxp.com>; David Marchand
>> <david.marchand@redhat.com>; Chautru, Nicolas
>> <nicolas.chautru@intel.com>
>> Cc: dev <dev@dpdk.org>; Akhil Goyal <gakhil@marvell.com>; Thomas
>> Monjalon <thomas@monjalon.net>; Tom Rix <trix@redhat.com>; Zhang,
>> Mingshan <mingshan.zhang@intel.com>; Joshi, Arun
>> <arun.joshi@intel.com>; Maxime Coquelin <maxime.coquelin@redhat.com>
>> Subject: Re: [PATCH v1] bbdev: remove experimental tag from API
>>
>>
>>
>> On 01/09/2021 04:52, Hemant Agrawal wrote:
>>>>
>>>> On Tue, Aug 31, 2021 at 6:27 PM Nicolas Chautru
>>>> <nicolas.chautru@intel.com> wrote:
>>>>>
>>>>> This was previously suggested last year
>>>>>
>>>>
>> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpat
>>>> c
>>>>> hes.dpdk.org%2Fproject%2Fdpdk%2Fpatch%2F1593213242-157394-2-
>> git-
>>>> send-e
>>>>> mail-
>>>>
>> nicolas.chautru%40intel.com%2F&amp;data=04%7C01%7Chemant.agrawal%
>>>>>
>>>>
>> 40nxp.com%7Cfcdfb339ec284057db1508d96c9dd048%7C686ea1d3bc2b4c6f
>>>> a92cd99
>>>>>
>>>> c5c301635%7C0%7C0%7C637660247324212288%7CUnknown%7CTWFpbGZ
>>>> sb3d8eyJWIjo
>>>>>
>>>>
>> iMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1
>>>> 000&amp
>>>>>
>> ;sdata=%2FYwaT29I4XlUxedcdCeyvM5z1R5QeNGTLLPY3XQBKjU%3D&amp
>>>> ;reserved=0
>>>>> but there was request from community to wait another year to confirm
>>>> formally this api is mature.
>>>>
>>>> The request was to wait for a new vendor (i.e. non Intel) to
>>>> implement a bbdev driver for their hw.
>>>>
>>>> NXP proposed a driver for this class:
>>>>
>> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpat
>>>> ch
>> work.dpdk.org%2Fproject%2Fdpdk%2Flist%2F%3Fseries%3D16642%26state
>>>>
>> %3D%252A%26archive%3Dboth&amp;data=04%7C01%7Chemant.agrawal%
>>>>
>> 40nxp.com%7Cfcdfb339ec284057db1508d96c9dd048%7C686ea1d3bc2b4c6f
>>>> a92cd99c5c301635%7C0%7C0%7C637660247324212288%7CUnknown%7CT
>>>>
>> WFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLC
>>>>
>> JXVCI6Mn0%3D%7C1000&amp;sdata=iorsQ7wAXyU2%2FaqeV5CrDp9asl8ztZ
>>>> nSrbDuJpCv9Gk%3D&amp;reserved=0
>>>>
>>>> What is the status of this driver?
>>>
>>> [Hemant]  We are in process of resending the patches in next few days.
>>
>> Ok - just so we are clear - the net-net of that, is that the bbdev APIs will be
>> 'experimental'
>> for another year, right?
> 
> There is little reason to defer further I believe. Henant please confirm you are not looking at any ABI change based on discussion for the last few months.
> 
>>
>>>
>>>> I see no update on the bbdev API, which seems good, but a
>>>> confirmation is needed.
> 
> Indeed that's all we need. Confirmation no change is require for new PMD.

Hemant, could you confirm this is good for you?

Thanks,
Maxime

>>>>
>>>>
>>>> --
>>>> David Marchand
>>>


^ permalink raw reply	[relevance 0%]

* Re: [dpdk-dev] [PATCH v1] bbdev: remove experimental tag from API
  2021-09-13 19:44  0%         ` Maxime Coquelin
@ 2021-09-14  3:13  0%           ` Hemant Agrawal
  0 siblings, 0 replies; 200+ results
From: Hemant Agrawal @ 2021-09-14  3:13 UTC (permalink / raw)
  To: Maxime Coquelin, Chautru, Nicolas, Kinsella, Ray, David Marchand
  Cc: dev, Akhil Goyal, Thomas Monjalon, Tom Rix, Zhang, Mingshan, Joshi, Arun

HI Maxime,

> 
> On 9/1/21 4:54 PM, Chautru, Nicolas wrote:
> >
> >
> >> -----Original Message-----
> >> From: Kinsella, Ray <mdr@ashroe.eu>
> >> Sent: Wednesday, September 1, 2021 4:15 AM
> >> To: Hemant Agrawal <hemant.agrawal@nxp.com>; David Marchand
> >> <david.marchand@redhat.com>; Chautru, Nicolas
> >> <nicolas.chautru@intel.com>
> >> Cc: dev <dev@dpdk.org>; Akhil Goyal <gakhil@marvell.com>; Thomas
> >> Monjalon <thomas@monjalon.net>; Tom Rix <trix@redhat.com>; Zhang,
> >> Mingshan <mingshan.zhang@intel.com>; Joshi, Arun
> >> <arun.joshi@intel.com>; Maxime Coquelin
> <maxime.coquelin@redhat.com>
> >> Subject: Re: [PATCH v1] bbdev: remove experimental tag from API
> >>
> >>
> >>
> >> On 01/09/2021 04:52, Hemant Agrawal wrote:
> >>>>
> >>>> On Tue, Aug 31, 2021 at 6:27 PM Nicolas Chautru
> >>>> <nicolas.chautru@intel.com> wrote:
> >>>>>
> >>>>> This was previously suggested last year
> >>>>>
> >>>>
> >> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpat
> >>>> c
> >>>>> hes.dpdk.org%2Fproject%2Fdpdk%2Fpatch%2F1593213242-157394-2-
> >> git-
> >>>> send-e
> >>>>> mail-
> >>>>
> >>
> nicolas.chautru%40intel.com%2F&amp;data=04%7C01%7Chemant.agrawal%
> >>>>>
> >>>>
> >>
> 40nxp.com%7Cfcdfb339ec284057db1508d96c9dd048%7C686ea1d3bc2b4c6f
> >>>> a92cd99
> >>>>>
> >>>>
> c5c301635%7C0%7C0%7C637660247324212288%7CUnknown%7CTWFpbGZ
> >>>> sb3d8eyJWIjo
> >>>>>
> >>>>
> >>
> iMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1
> >>>> 000&amp
> >>>>>
> >> ;sdata=%2FYwaT29I4XlUxedcdCeyvM5z1R5QeNGTLLPY3XQBKjU%3D&amp
> >>>> ;reserved=0
> >>>>> but there was request from community to wait another year to
> >>>>> confirm
> >>>> formally this api is mature.
> >>>>
> >>>> The request was to wait for a new vendor (i.e. non Intel) to
> >>>> implement a bbdev driver for their hw.
> >>>>
> >>>> NXP proposed a driver for this class:
> >>>>
> >> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpat
> >>>> ch
> >>
> work.dpdk.org%2Fproject%2Fdpdk%2Flist%2F%3Fseries%3D16642%26state
> >>>>
> >> %3D%252A%26archive%3Dboth&amp;data=04%7C01%7Chemant.agrawal%
> >>>>
> >>
> 40nxp.com%7Cfcdfb339ec284057db1508d96c9dd048%7C686ea1d3bc2b4c6f
> >>>>
> a92cd99c5c301635%7C0%7C0%7C637660247324212288%7CUnknown%7CT
> >>>>
> >>
> WFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLC
> >>>>
> >>
> JXVCI6Mn0%3D%7C1000&amp;sdata=iorsQ7wAXyU2%2FaqeV5CrDp9asl8ztZ
> >>>> nSrbDuJpCv9Gk%3D&amp;reserved=0
> >>>>
> >>>> What is the status of this driver?
> >>>
> >>> [Hemant]  We are in process of resending the patches in next few days.
> >>
> >> Ok - just so we are clear - the net-net of that, is that the bbdev
> >> APIs will be 'experimental'
> >> for another year, right?
> >
> > There is little reason to defer further I believe. Henant please confirm you
> are not looking at any ABI change based on discussion for the last few
> months.
> >
> >>
> >>>
> >>>> I see no update on the bbdev API, which seems good, but a
> >>>> confirmation is needed.
> >
> > Indeed that's all we need. Confirmation no change is require for new PMD.
> 
> Hemant, could you confirm this is good for you?

[Hemant] I am ok to remove experimental from these APIs. However, can that wait towards later part for this release. 

NXP will be sending few changes in next few days for the APIs. 

Regards,
Hemant  


> 
> Thanks,
> Maxime
> 
> >>>>
> >>>>
> >>>> --
> >>>> David Marchand
> >>>


^ permalink raw reply	[relevance 0%]

* Re: [dpdk-dev] [PATCH v3] eventdev: update crypto adapter metadata structures
  2021-09-08  7:53  0%           ` Gujjar, Abhinandan S
@ 2021-09-14  4:36  0%             ` Shijith Thotton
  2021-09-14  4:46  0%               ` Anoob Joseph
  0 siblings, 1 reply; 200+ results
From: Shijith Thotton @ 2021-09-14  4:36 UTC (permalink / raw)
  To: Gujjar, Abhinandan S, dev
  Cc: Jerin Jacob Kollanukkaran, Anoob Joseph,
	Pavan Nikhilesh Bhagavatula, Akhil Goyal, Ray Kinsella,
	Ankur Dwivedi

>> >>
>> >> >> In crypto adapter metadata, reserved bytes in request info
>> >> >> structure is a space holder for response info. It enforces an
>> >> >> order of operation if the structures are updated using memcpy to
>> >> >> avoid overwriting response info. It is logical to move the
>> >> >> reserved space out of request info. It also solves the ordering issue
>> mentioned before.
>> >> >I would like to understand what kind of ordering issue you have
>> >> >faced with the current approach. Could you please give an
>> >> >example/sequence
>> >> and explain?
>> >> >
>> >>
>> >> I have seen this issue with crypto adapter autotest (#n215).
>> >>
>> >> Example:
>> >> rte_memcpy(&m_data.response_info, &response_info,
>> >> sizeof(response_info)); rte_memcpy(&m_data.request_info,
>> >> &request_info, sizeof(request_info));
>> >>
>> >> Here response info is getting overwritten by request info.
>> >> Above lines can reordered to fix the issue, but can be ignored with this
>> patch.
>> >There is a reason for designing the metadata in this way.
>> >Right now, sizeof (union rte_event_crypto_metadata) is 16 bytes.
>> >So, the session based case needs just 16 bytes to store the data.
>> >Whereas, for sessionless case each crypto_ops requires another 16 bytes.
>> >
>> >By changing the struct in the following way you are doubling the memory
>> >requirement.
>> >With the changes, for sessionless case, each crypto op requires 32
>> >bytes of space instead of 16 bytes and the mempool will be bigger.
>> >This will have the perf impact too!
>> >
>> >You can just copy the individual members(cdev_id & queue_pair_id) after
>> >the response_info.
>> >OR You have a better way?
>> >
>>
>> I missed the second word of event structure. It adds an extra 8 bytes, which
>> is not required.
>I guess you meant not adding, it is overlapping with request information.
>> Let me know, what you think of below change to metadata structure.
>>
>> struct rte_event_crypto_metadata {
>> 	uint64_t response_info; // 8 bytes
>With this, it lags clarity saying it is an event information.
>> 	struct rte_event_crypto_request request_info; // 8 bytes };
>>
>> Total structure size is 16 bytes.
>>
>> Response info can be set like below in test app:
>> 	m_data.response_info = response_info.event;
>>
>> The main aim of this patch is to decouple response info from request info.
>The decoupling was required as it was doing memcpy.
>If you copy the individual members of request info(after response), you don't
>require it.
 
With this change, the application will be free of such constraints.

>>
>> >>
>> >> >>
>> >> >> This patch removes the reserve field from request info and makes
>> >> >> event crypto metadata type to structure from union to make space
>> >> >> for response info.
>> >> >>
>> >> >> App and drivers are updated as per metadata change.
>> >> >>
>> >> >> Signed-off-by: Shijith Thotton <sthotton@marvell.com>
>> >> >> Acked-by: Anoob Joseph <anoobj@marvell.com>
>> >> >> ---
>> >> >> v3:
>> >> >> * Updated ABI section of release notes.
>> >> >>
>> >> >> v2:
>> >> >> * Updated deprecation notice.
>> >> >>
>> >> >> v1:
>> >> >> * Rebased.
>> >> >>
>> >> >>  app/test/test_event_crypto_adapter.c              | 14 +++++++-------
>> >> >>  doc/guides/rel_notes/deprecation.rst              |  6 ------
>> >> >>  doc/guides/rel_notes/release_21_11.rst            |  2 ++
>> >> >>  drivers/crypto/octeontx/otx_cryptodev_ops.c       |  8 ++++----
>> >> >>  drivers/crypto/octeontx2/otx2_cryptodev_ops.c     |  4 ++--
>> >> >>  .../event/octeontx2/otx2_evdev_crypto_adptr_tx.h  |  4 ++--
>> >> >>  lib/eventdev/rte_event_crypto_adapter.c           |  8 ++++----
>> >> >>  lib/eventdev/rte_event_crypto_adapter.h           | 15 +++++----------
>> >> >>  8 files changed, 26 insertions(+), 35 deletions(-)
>> >> >>
>> >> >> diff --git a/app/test/test_event_crypto_adapter.c
>> >> >> b/app/test/test_event_crypto_adapter.c
>> >> >> index 3ad20921e2..0d73694d3a 100644
>> >> >> --- a/app/test/test_event_crypto_adapter.c
>> >> >> +++ b/app/test/test_event_crypto_adapter.c
>> >> >> @@ -168,7 +168,7 @@ test_op_forward_mode(uint8_t session_less)
>> {
>> >> >>  	struct rte_crypto_sym_xform cipher_xform;
>> >> >>  	struct rte_cryptodev_sym_session *sess;
>> >> >> -	union rte_event_crypto_metadata m_data;
>> >> >> +	struct rte_event_crypto_metadata m_data;
>> >> >>  	struct rte_crypto_sym_op *sym_op;
>> >> >>  	struct rte_crypto_op *op;
>> >> >>  	struct rte_mbuf *m;
>> >> >> @@ -368,7 +368,7 @@ test_op_new_mode(uint8_t session_less)  {
>> >> >>  	struct rte_crypto_sym_xform cipher_xform;
>> >> >>  	struct rte_cryptodev_sym_session *sess;
>> >> >> -	union rte_event_crypto_metadata m_data;
>> >> >> +	struct rte_event_crypto_metadata m_data;
>> >> >>  	struct rte_crypto_sym_op *sym_op;
>> >> >>  	struct rte_crypto_op *op;
>> >> >>  	struct rte_mbuf *m;
>> >> >> @@ -406,7 +406,7 @@ test_op_new_mode(uint8_t session_less)
>> >> >>  		if (cap &
>> >> >> RTE_EVENT_CRYPTO_ADAPTER_CAP_SESSION_PRIVATE_DATA) {
>> >> >>  			/* Fill in private user data information */
>> >> >>  			rte_memcpy(&m_data.response_info,
>> >> &response_info,
>> >> >> -				   sizeof(m_data));
>> >> >> +				   sizeof(response_info));
>> >> >>  			rte_cryptodev_sym_session_set_user_data(sess,
>> >> >>  						&m_data, sizeof(m_data));
>> >> >>  		}
>> >> >> @@ -426,7 +426,7 @@ test_op_new_mode(uint8_t session_less)
>> >> >>  		op->private_data_offset = len;
>> >> >>  		/* Fill in private data information */
>> >> >>  		rte_memcpy(&m_data.response_info, &response_info,
>> >> >> -			   sizeof(m_data));
>> >> >> +			   sizeof(response_info));
>> >> >>  		rte_memcpy((uint8_t *)op + len, &m_data,
>sizeof(m_data));
>> >> >>  	}
>> >> >>
>> >> >> @@ -519,7 +519,7 @@ configure_cryptodev(void)
>> >> >>  			DEFAULT_NUM_XFORMS *
>> >> >>  			sizeof(struct rte_crypto_sym_xform) +
>> >> >>  			MAXIMUM_IV_LENGTH +
>> >> >> -			sizeof(union rte_event_crypto_metadata),
>> >> >> +			sizeof(struct rte_event_crypto_metadata),
>> >> >>  			rte_socket_id());
>> >> >>  	if (params.op_mpool == NULL) {
>> >> >>  		RTE_LOG(ERR, USER1, "Can't create
>CRYPTO_OP_POOL\n");
>> >> @@ -549,12
>> >> >> +549,12 @@ configure_cryptodev(void)
>> >> >>  	 * to include the session headers & private data
>> >> >>  	 */
>> >> >>  	session_size =
>> >> >> rte_cryptodev_sym_get_private_session_size(TEST_CDEV_ID);
>> >> >> -	session_size += sizeof(union rte_event_crypto_metadata);
>> >> >> +	session_size += sizeof(struct rte_event_crypto_metadata);
>> >> >>
>> >> >>  	params.session_mpool =
>rte_cryptodev_sym_session_pool_create(
>> >> >>  			"CRYPTO_ADAPTER_SESSION_MP",
>> >> >>  			MAX_NB_SESSIONS, 0, 0,
>> >> >> -			sizeof(union rte_event_crypto_metadata),
>> >> >> +			sizeof(struct rte_event_crypto_metadata),
>> >> >>  			SOCKET_ID_ANY);
>> >> >>  	TEST_ASSERT_NOT_NULL(params.session_mpool,
>> >> >>  			"session mempool allocation failed\n"); diff --git
>> >> >> a/doc/guides/rel_notes/deprecation.rst
>> >> >> b/doc/guides/rel_notes/deprecation.rst
>> >> >> index 76a4abfd6b..58ee95c020 100644
>> >> >> --- a/doc/guides/rel_notes/deprecation.rst
>> >> >> +++ b/doc/guides/rel_notes/deprecation.rst
>> >> >> @@ -266,12 +266,6 @@ Deprecation Notices
>> >> >>    values to the function ``rte_event_eth_rx_adapter_queue_add``
>> using
>> >> >>    the structure ``rte_event_eth_rx_adapter_queue_add``.
>> >> >>
>> >> >> -* eventdev: Reserved bytes of ``rte_event_crypto_request`` is a
>> >> >> space holder
>> >> >> -  for ``response_info``. Both should be decoupled for better clarity.
>> >> >> -  New space for ``response_info`` can be made by changing
>> >> >> -  ``rte_event_crypto_metadata`` type to structure from union.
>> >> >> -  This change is targeted for DPDK 21.11.
>> >> >> -
>> >> >>  * metrics: The function ``rte_metrics_init`` will have a non-void return
>> >> >>    in order to notify errors instead of calling ``rte_exit``.
>> >> >>
>> >> >> diff --git a/doc/guides/rel_notes/release_21_11.rst
>> >> >> b/doc/guides/rel_notes/release_21_11.rst
>> >> >> index d707a554ef..ab76d5dd55 100644
>> >> >> --- a/doc/guides/rel_notes/release_21_11.rst
>> >> >> +++ b/doc/guides/rel_notes/release_21_11.rst
>> >> >> @@ -100,6 +100,8 @@ ABI Changes
>> >> >>     Also, make sure to start the actual text at the margin.
>> >> >>
>> >> =======================================================
>> >> >>
>> >> >> +* eventdev: Modified type of ``union rte_event_crypto_metadata``
>> >> >> +to struct and
>> >> >> +  removed reserved bytes from ``struct rte_event_crypto_request``.
>> >> >>
>> >> >>  Known Issues
>> >> >>  ------------
>> >> >> diff --git a/drivers/crypto/octeontx/otx_cryptodev_ops.c
>> >> >> b/drivers/crypto/octeontx/otx_cryptodev_ops.c
>> >> >> index eac6796cfb..c51be63146 100644
>> >> >> --- a/drivers/crypto/octeontx/otx_cryptodev_ops.c
>> >> >> +++ b/drivers/crypto/octeontx/otx_cryptodev_ops.c
>> >> >> @@ -710,17 +710,17 @@ submit_request_to_sso(struct ssows *ws,
>> >> >> uintptr_t req,
>> >> >>  	ssovf_store_pair(add_work, req, ws->grps[rsp_info->queue_id]);
>> >> >> }
>> >> >>
>> >> >> -static inline union rte_event_crypto_metadata *
>> >> >> +static inline struct rte_event_crypto_metadata *
>> >> >>  get_event_crypto_mdata(struct rte_crypto_op *op)  {
>> >> >> -	union rte_event_crypto_metadata *ec_mdata;
>> >> >> +	struct rte_event_crypto_metadata *ec_mdata;
>> >> >>
>> >> >>  	if (op->sess_type == RTE_CRYPTO_OP_WITH_SESSION)
>> >> >>  		ec_mdata = rte_cryptodev_sym_session_get_user_data(
>> >> >>  							   op->sym-
>>session);
>> >> >>  	else if (op->sess_type == RTE_CRYPTO_OP_SESSIONLESS &&
>> >> >>  		 op->private_data_offset)
>> >> >> -		ec_mdata = (union rte_event_crypto_metadata *)
>> >> >> +		ec_mdata = (struct rte_event_crypto_metadata *)
>> >> >>  			((uint8_t *)op + op->private_data_offset);
>> >> >>  	else
>> >> >>  		return NULL;
>> >> >> @@ -731,7 +731,7 @@ get_event_crypto_mdata(struct rte_crypto_op
>> >> *op)
>> >> >> uint16_t __rte_hot  otx_crypto_adapter_enqueue(void *port, struct
>> >> >> rte_crypto_op *op)  {
>> >> >> -	union rte_event_crypto_metadata *ec_mdata;
>> >> >> +	struct rte_event_crypto_metadata *ec_mdata;
>> >> >>  	struct cpt_instance *instance;
>> >> >>  	struct cpt_request_info *req;
>> >> >>  	struct rte_event *rsp_info;
>> >> >> diff --git a/drivers/crypto/octeontx2/otx2_cryptodev_ops.c
>> >> >> b/drivers/crypto/octeontx2/otx2_cryptodev_ops.c
>> >> >> index 42100154cd..952d1352f4 100644
>> >> >> --- a/drivers/crypto/octeontx2/otx2_cryptodev_ops.c
>> >> >> +++ b/drivers/crypto/octeontx2/otx2_cryptodev_ops.c
>> >> >> @@ -453,7 +453,7 @@ otx2_ca_enqueue_req(const struct
>> otx2_cpt_qp
>> >> *qp,
>> >> >>  		    struct rte_crypto_op *op,
>> >> >>  		    uint64_t cpt_inst_w7)
>> >> >>  {
>> >> >> -	union rte_event_crypto_metadata *m_data;
>> >> >> +	struct rte_event_crypto_metadata *m_data;
>> >> >>  	union cpt_inst_s inst;
>> >> >>  	uint64_t lmt_status;
>> >> >>
>> >> >> @@ -468,7 +468,7 @@ otx2_ca_enqueue_req(const struct
>> otx2_cpt_qp
>> >> *qp,
>> >> >>  		}
>> >> >>  	} else if (op->sess_type == RTE_CRYPTO_OP_SESSIONLESS &&
>> >> >>  		   op->private_data_offset) {
>> >> >> -		m_data = (union rte_event_crypto_metadata *)
>> >> >> +		m_data = (struct rte_event_crypto_metadata *)
>> >> >>  			 ((uint8_t *)op +
>> >> >>  			  op->private_data_offset);
>> >> >>  	} else {
>> >> >> diff --git a/drivers/event/octeontx2/otx2_evdev_crypto_adptr_tx.h
>> >> >> b/drivers/event/octeontx2/otx2_evdev_crypto_adptr_tx.h
>> >> >> index ecf7eb9f56..458e8306d7 100644
>> >> >> --- a/drivers/event/octeontx2/otx2_evdev_crypto_adptr_tx.h
>> >> >> +++ b/drivers/event/octeontx2/otx2_evdev_crypto_adptr_tx.h
>> >> >> @@ -16,7 +16,7 @@
>> >> >>  static inline uint16_t
>> >> >>  otx2_ca_enq(uintptr_t tag_op, const struct rte_event *ev)  {
>> >> >> -	union rte_event_crypto_metadata *m_data;
>> >> >> +	struct rte_event_crypto_metadata *m_data;
>> >> >>  	struct rte_crypto_op *crypto_op;
>> >> >>  	struct rte_cryptodev *cdev;
>> >> >>  	struct otx2_cpt_qp *qp;
>> >> >> @@ -37,7 +37,7 @@ otx2_ca_enq(uintptr_t tag_op, const struct
>> >> >> rte_event
>> >> >> *ev)
>> >> >>  		qp_id = m_data->request_info.queue_pair_id;
>> >> >>  	} else if (crypto_op->sess_type == RTE_CRYPTO_OP_SESSIONLESS
>> >> &&
>> >> >>  		   crypto_op->private_data_offset) {
>> >> >> -		m_data = (union rte_event_crypto_metadata *)
>> >> >> +		m_data = (struct rte_event_crypto_metadata *)
>> >> >>  			 ((uint8_t *)crypto_op +
>> >> >>  			  crypto_op->private_data_offset);
>> >> >>  		cdev_id = m_data->request_info.cdev_id; diff --git
>> >> >> a/lib/eventdev/rte_event_crypto_adapter.c
>> >> >> b/lib/eventdev/rte_event_crypto_adapter.c
>> >> >> index e1d38d383d..6977391ae9 100644
>> >> >> --- a/lib/eventdev/rte_event_crypto_adapter.c
>> >> >> +++ b/lib/eventdev/rte_event_crypto_adapter.c
>> >> >> @@ -333,7 +333,7 @@ eca_enq_to_cryptodev(struct
>> >> >> rte_event_crypto_adapter *adapter,
>> >> >>  		 struct rte_event *ev, unsigned int cnt)  {
>> >> >>  	struct rte_event_crypto_adapter_stats *stats = &adapter-
>> >> >> >crypto_stats;
>> >> >> -	union rte_event_crypto_metadata *m_data = NULL;
>> >> >> +	struct rte_event_crypto_metadata *m_data = NULL;
>> >> >>  	struct crypto_queue_pair_info *qp_info = NULL;
>> >> >>  	struct rte_crypto_op *crypto_op;
>> >> >>  	unsigned int i, n;
>> >> >> @@ -371,7 +371,7 @@ eca_enq_to_cryptodev(struct
>> >> >> rte_event_crypto_adapter *adapter,
>> >> >>  			len++;
>> >> >>  		} else if (crypto_op->sess_type ==
>> >> RTE_CRYPTO_OP_SESSIONLESS &&
>> >> >>  				crypto_op->private_data_offset) {
>> >> >> -			m_data = (union rte_event_crypto_metadata *)
>> >> >> +			m_data = (struct rte_event_crypto_metadata *)
>> >> >>  				 ((uint8_t *)crypto_op +
>> >> >>  					crypto_op->private_data_offset);
>> >> >>  			cdev_id = m_data->request_info.cdev_id; @@ -
>> >> >> 504,7 +504,7 @@ eca_ops_enqueue_burst(struct
>> >> rte_event_crypto_adapter
>> >> >> *adapter,
>> >> >>  		  struct rte_crypto_op **ops, uint16_t num)  {
>> >> >>  	struct rte_event_crypto_adapter_stats *stats = &adapter-
>> >> >> >crypto_stats;
>> >> >> -	union rte_event_crypto_metadata *m_data = NULL;
>> >> >> +	struct rte_event_crypto_metadata *m_data = NULL;
>> >> >>  	uint8_t event_dev_id = adapter->eventdev_id;
>> >> >>  	uint8_t event_port_id = adapter->event_port_id;
>> >> >>  	struct rte_event events[BATCH_SIZE]; @@ -523,7 +523,7 @@
>> >> >> eca_ops_enqueue_burst(struct rte_event_crypto_adapter *adapter,
>> >> >>  					ops[i]->sym->session);
>> >> >>  		} else if (ops[i]->sess_type ==
>> RTE_CRYPTO_OP_SESSIONLESS &&
>> >> >>  				ops[i]->private_data_offset) {
>> >> >> -			m_data = (union rte_event_crypto_metadata *)
>> >> >> +			m_data = (struct rte_event_crypto_metadata *)
>> >> >>  				 ((uint8_t *)ops[i] +
>> >> >>  				  ops[i]->private_data_offset);
>> >> >>  		}
>> >> >> diff --git a/lib/eventdev/rte_event_crypto_adapter.h
>> >> >> b/lib/eventdev/rte_event_crypto_adapter.h
>> >> >> index f8c6cca87c..3c24d9d9df 100644
>> >> >> --- a/lib/eventdev/rte_event_crypto_adapter.h
>> >> >> +++ b/lib/eventdev/rte_event_crypto_adapter.h
>> >> >> @@ -200,11 +200,6 @@ enum rte_event_crypto_adapter_mode {
>> >> >>   * provide event request information to the adapter.
>> >> >>   */
>> >> >>  struct rte_event_crypto_request {
>> >> >> -	uint8_t resv[8];
>> >> >> -	/**< Overlaps with first 8 bytes of struct rte_event
>> >> >> -	 * that encode the response event information. Application
>> >> >> -	 * is expected to fill in struct rte_event response_info.
>> >> >> -	 */
>> >> >>  	uint16_t cdev_id;
>> >> >>  	/**< cryptodev ID to be used */
>> >> >>  	uint16_t queue_pair_id;
>> >> >> @@ -223,16 +218,16 @@ struct rte_event_crypto_request {
>> >> >>   * operation. If the transfer is done by SW, event response
>> information
>> >> >>   * will be used by the adapter.
>> >> >>   */
>> >> >> -union rte_event_crypto_metadata {
>> >> >> -	struct rte_event_crypto_request request_info;
>> >> >> -	/**< Request information to be filled in by application
>> >> >> -	 * for RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD mode.
>> >> >> -	 */
>> >> >> +struct rte_event_crypto_metadata {
>> >> >>  	struct rte_event response_info;
>> >> >>  	/**< Response information to be filled in by application
>> >> >>  	 * for RTE_EVENT_CRYPTO_ADAPTER_OP_NEW and
>> >> >>  	 * RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD mode.
>> >> >>  	 */
>> >> >> +	struct rte_event_crypto_request request_info;
>> >> >> +	/**< Request information to be filled in by application
>> >> >> +	 * for RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD mode.
>> >> >> +	 */
>> >> >>  };
>> >> >>
>> >> >>  /**
>> >> >> --
>> >> >> 2.25.1


^ permalink raw reply	[relevance 0%]

* Re: [dpdk-dev] [PATCH v3] eventdev: update crypto adapter metadata structures
  2021-09-14  4:36  0%             ` Shijith Thotton
@ 2021-09-14  4:46  0%               ` Anoob Joseph
  0 siblings, 0 replies; 200+ results
From: Anoob Joseph @ 2021-09-14  4:46 UTC (permalink / raw)
  To: Gujjar, Abhinandan S
  Cc: Jerin Jacob Kollanukkaran, Pavan Nikhilesh Bhagavatula,
	Akhil Goyal, Ray Kinsella, Ankur Dwivedi, Shijith Thotton, dev

Hi Abhinandan, Shijith,

Please see inline.

Thanks,
Anoob

> -----Original Message-----
> From: Shijith Thotton <sthotton@marvell.com>
> Sent: Tuesday, September 14, 2021 10:07 AM
> To: Gujjar, Abhinandan S <abhinandan.gujjar@intel.com>; dev@dpdk.org
> Cc: Jerin Jacob Kollanukkaran <jerinj@marvell.com>; Anoob Joseph
> <anoobj@marvell.com>; Pavan Nikhilesh Bhagavatula
> <pbhagavatula@marvell.com>; Akhil Goyal <gakhil@marvell.com>; Ray
> Kinsella <mdr@ashroe.eu>; Ankur Dwivedi <adwivedi@marvell.com>
> Subject: RE: [PATCH v3] eventdev: update crypto adapter metadata
> structures
> 
> >> >>
> >> >> >> In crypto adapter metadata, reserved bytes in request info
> >> >> >> structure is a space holder for response info. It enforces an
> >> >> >> order of operation if the structures are updated using memcpy
> >> >> >> to avoid overwriting response info. It is logical to move the
> >> >> >> reserved space out of request info. It also solves the ordering
> >> >> >> issue
> >> mentioned before.
> >> >> >I would like to understand what kind of ordering issue you have
> >> >> >faced with the current approach. Could you please give an
> >> >> >example/sequence
> >> >> and explain?
> >> >> >
> >> >>
> >> >> I have seen this issue with crypto adapter autotest (#n215).
> >> >>
> >> >> Example:
> >> >> rte_memcpy(&m_data.response_info, &response_info,
> >> >> sizeof(response_info)); rte_memcpy(&m_data.request_info,
> >> >> &request_info, sizeof(request_info));
> >> >>
> >> >> Here response info is getting overwritten by request info.
> >> >> Above lines can reordered to fix the issue, but can be ignored
> >> >> with this
> >> patch.
> >> >There is a reason for designing the metadata in this way.
> >> >Right now, sizeof (union rte_event_crypto_metadata) is 16 bytes.
> >> >So, the session based case needs just 16 bytes to store the data.
> >> >Whereas, for sessionless case each crypto_ops requires another 16
> bytes.
> >> >
> >> >By changing the struct in the following way you are doubling the
> >> >memory requirement.
> >> >With the changes, for sessionless case, each crypto op requires 32
> >> >bytes of space instead of 16 bytes and the mempool will be bigger.
> >> >This will have the perf impact too!
> >> >
> >> >You can just copy the individual members(cdev_id & queue_pair_id)
> >> >after the response_info.
> >> >OR You have a better way?
> >> >
> >>
> >> I missed the second word of event structure. It adds an extra 8
> >> bytes, which is not required.
> >I guess you meant not adding, it is overlapping with request information.
> >> Let me know, what you think of below change to metadata structure.
> >>
> >> struct rte_event_crypto_metadata {
> >> 	uint64_t response_info; // 8 bytes
> >With this, it lags clarity saying it is an event information.
> >> 	struct rte_event_crypto_request request_info; // 8 bytes };
> >>
> >> Total structure size is 16 bytes.
> >>
> >> Response info can be set like below in test app:
> >> 	m_data.response_info = response_info.event;
> >>
> >> The main aim of this patch is to decouple response info from request info.
> >The decoupling was required as it was doing memcpy.
> >If you copy the individual members of request info(after response), you
> >don't require it.
> 
> With this change, the application will be free of such constraints.

[Anoob] Why don't we make it like,

struct rte_event_crypto_metadata {
 	uint64_t ev_w0_template;
              /**< Template of the first word of ``struct rte_event`` (rte_event.event) to be set in the events generated by crypto adapter in both RTE_EVENT_CRYPTO_ADAPTER_OP_NEW and
	 * RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD modes.
	*/
 	struct rte_event_crypto_request request_info;
};
 
This way, the usage would become more obvious and we will not have additional space reserved as well.

> 
> >>
> >> >>
> >> >> >>
> >> >> >> This patch removes the reserve field from request info and
> >> >> >> makes event crypto metadata type to structure from union to
> >> >> >> make space for response info.
> >> >> >>
> >> >> >> App and drivers are updated as per metadata change.
> >> >> >>
> >> >> >> Signed-off-by: Shijith Thotton <sthotton@marvell.com>
> >> >> >> Acked-by: Anoob Joseph <anoobj@marvell.com>
> >> >> >> ---
> >> >> >> v3:
> >> >> >> * Updated ABI section of release notes.
> >> >> >>
> >> >> >> v2:
> >> >> >> * Updated deprecation notice.
> >> >> >>
> >> >> >> v1:
> >> >> >> * Rebased.
> >> >> >>
> >> >> >>  app/test/test_event_crypto_adapter.c              | 14 +++++++-------
> >> >> >>  doc/guides/rel_notes/deprecation.rst              |  6 ------
> >> >> >>  doc/guides/rel_notes/release_21_11.rst            |  2 ++
> >> >> >>  drivers/crypto/octeontx/otx_cryptodev_ops.c       |  8 ++++----
> >> >> >>  drivers/crypto/octeontx2/otx2_cryptodev_ops.c     |  4 ++--
> >> >> >>  .../event/octeontx2/otx2_evdev_crypto_adptr_tx.h  |  4 ++--
> >> >> >>  lib/eventdev/rte_event_crypto_adapter.c           |  8 ++++----
> >> >> >>  lib/eventdev/rte_event_crypto_adapter.h           | 15 +++++---------
> -
> >> >> >>  8 files changed, 26 insertions(+), 35 deletions(-)
> >> >> >>
> >> >> >> diff --git a/app/test/test_event_crypto_adapter.c
> >> >> >> b/app/test/test_event_crypto_adapter.c
> >> >> >> index 3ad20921e2..0d73694d3a 100644
> >> >> >> --- a/app/test/test_event_crypto_adapter.c
> >> >> >> +++ b/app/test/test_event_crypto_adapter.c
> >> >> >> @@ -168,7 +168,7 @@ test_op_forward_mode(uint8_t
> session_less)
> >> {
> >> >> >>  	struct rte_crypto_sym_xform cipher_xform;
> >> >> >>  	struct rte_cryptodev_sym_session *sess;
> >> >> >> -	union rte_event_crypto_metadata m_data;
> >> >> >> +	struct rte_event_crypto_metadata m_data;
> >> >> >>  	struct rte_crypto_sym_op *sym_op;
> >> >> >>  	struct rte_crypto_op *op;
> >> >> >>  	struct rte_mbuf *m;
> >> >> >> @@ -368,7 +368,7 @@ test_op_new_mode(uint8_t session_less)  {
> >> >> >>  	struct rte_crypto_sym_xform cipher_xform;
> >> >> >>  	struct rte_cryptodev_sym_session *sess;
> >> >> >> -	union rte_event_crypto_metadata m_data;
> >> >> >> +	struct rte_event_crypto_metadata m_data;
> >> >> >>  	struct rte_crypto_sym_op *sym_op;
> >> >> >>  	struct rte_crypto_op *op;
> >> >> >>  	struct rte_mbuf *m;
> >> >> >> @@ -406,7 +406,7 @@ test_op_new_mode(uint8_t session_less)
> >> >> >>  		if (cap &
> >> >> >> RTE_EVENT_CRYPTO_ADAPTER_CAP_SESSION_PRIVATE_DATA) {
> >> >> >>  			/* Fill in private user data information */
> >> >> >>  			rte_memcpy(&m_data.response_info,
> >> >> &response_info,
> >> >> >> -				   sizeof(m_data));
> >> >> >> +				   sizeof(response_info));
> >> >> >>
> 	rte_cryptodev_sym_session_set_user_data(sess,
> >> >> >>  						&m_data,
> sizeof(m_data));
> >> >> >>  		}
> >> >> >> @@ -426,7 +426,7 @@ test_op_new_mode(uint8_t session_less)
> >> >> >>  		op->private_data_offset = len;
> >> >> >>  		/* Fill in private data information */
> >> >> >>  		rte_memcpy(&m_data.response_info,
> &response_info,
> >> >> >> -			   sizeof(m_data));
> >> >> >> +			   sizeof(response_info));
> >> >> >>  		rte_memcpy((uint8_t *)op + len, &m_data,
> >sizeof(m_data));
> >> >> >>  	}
> >> >> >>
> >> >> >> @@ -519,7 +519,7 @@ configure_cryptodev(void)
> >> >> >>  			DEFAULT_NUM_XFORMS *
> >> >> >>  			sizeof(struct rte_crypto_sym_xform) +
> >> >> >>  			MAXIMUM_IV_LENGTH +
> >> >> >> -			sizeof(union rte_event_crypto_metadata),
> >> >> >> +			sizeof(struct rte_event_crypto_metadata),
> >> >> >>  			rte_socket_id());
> >> >> >>  	if (params.op_mpool == NULL) {
> >> >> >>  		RTE_LOG(ERR, USER1, "Can't create
> >CRYPTO_OP_POOL\n");
> >> >> @@ -549,12
> >> >> >> +549,12 @@ configure_cryptodev(void)
> >> >> >>  	 * to include the session headers & private data
> >> >> >>  	 */
> >> >> >>  	session_size =
> >> >> >> rte_cryptodev_sym_get_private_session_size(TEST_CDEV_ID);
> >> >> >> -	session_size += sizeof(union rte_event_crypto_metadata);
> >> >> >> +	session_size += sizeof(struct rte_event_crypto_metadata);
> >> >> >>
> >> >> >>  	params.session_mpool =
> >rte_cryptodev_sym_session_pool_create(
> >> >> >>  			"CRYPTO_ADAPTER_SESSION_MP",
> >> >> >>  			MAX_NB_SESSIONS, 0, 0,
> >> >> >> -			sizeof(union rte_event_crypto_metadata),
> >> >> >> +			sizeof(struct rte_event_crypto_metadata),
> >> >> >>  			SOCKET_ID_ANY);
> >> >> >>  	TEST_ASSERT_NOT_NULL(params.session_mpool,
> >> >> >>  			"session mempool allocation failed\n"); diff --
> git
> >> >> >> a/doc/guides/rel_notes/deprecation.rst
> >> >> >> b/doc/guides/rel_notes/deprecation.rst
> >> >> >> index 76a4abfd6b..58ee95c020 100644
> >> >> >> --- a/doc/guides/rel_notes/deprecation.rst
> >> >> >> +++ b/doc/guides/rel_notes/deprecation.rst
> >> >> >> @@ -266,12 +266,6 @@ Deprecation Notices
> >> >> >>    values to the function
> >> >> >> ``rte_event_eth_rx_adapter_queue_add``
> >> using
> >> >> >>    the structure ``rte_event_eth_rx_adapter_queue_add``.
> >> >> >>
> >> >> >> -* eventdev: Reserved bytes of ``rte_event_crypto_request`` is
> >> >> >> a space holder
> >> >> >> -  for ``response_info``. Both should be decoupled for better clarity.
> >> >> >> -  New space for ``response_info`` can be made by changing
> >> >> >> -  ``rte_event_crypto_metadata`` type to structure from union.
> >> >> >> -  This change is targeted for DPDK 21.11.
> >> >> >> -
> >> >> >>  * metrics: The function ``rte_metrics_init`` will have a non-void
> return
> >> >> >>    in order to notify errors instead of calling ``rte_exit``.
> >> >> >>
> >> >> >> diff --git a/doc/guides/rel_notes/release_21_11.rst
> >> >> >> b/doc/guides/rel_notes/release_21_11.rst
> >> >> >> index d707a554ef..ab76d5dd55 100644
> >> >> >> --- a/doc/guides/rel_notes/release_21_11.rst
> >> >> >> +++ b/doc/guides/rel_notes/release_21_11.rst
> >> >> >> @@ -100,6 +100,8 @@ ABI Changes
> >> >> >>     Also, make sure to start the actual text at the margin.
> >> >> >>
> >> >>
> =======================================================
> >> >> >>
> >> >> >> +* eventdev: Modified type of ``union
> >> >> >> +rte_event_crypto_metadata`` to struct and
> >> >> >> +  removed reserved bytes from ``struct
> rte_event_crypto_request``.
> >> >> >>
> >> >> >>  Known Issues
> >> >> >>  ------------
> >> >> >> diff --git a/drivers/crypto/octeontx/otx_cryptodev_ops.c
> >> >> >> b/drivers/crypto/octeontx/otx_cryptodev_ops.c
> >> >> >> index eac6796cfb..c51be63146 100644
> >> >> >> --- a/drivers/crypto/octeontx/otx_cryptodev_ops.c
> >> >> >> +++ b/drivers/crypto/octeontx/otx_cryptodev_ops.c
> >> >> >> @@ -710,17 +710,17 @@ submit_request_to_sso(struct ssows
> *ws,
> >> >> >> uintptr_t req,
> >> >> >>  	ssovf_store_pair(add_work, req,
> >> >> >> ws->grps[rsp_info->queue_id]); }
> >> >> >>
> >> >> >> -static inline union rte_event_crypto_metadata *
> >> >> >> +static inline struct rte_event_crypto_metadata *
> >> >> >>  get_event_crypto_mdata(struct rte_crypto_op *op)  {
> >> >> >> -	union rte_event_crypto_metadata *ec_mdata;
> >> >> >> +	struct rte_event_crypto_metadata *ec_mdata;
> >> >> >>
> >> >> >>  	if (op->sess_type == RTE_CRYPTO_OP_WITH_SESSION)
> >> >> >>  		ec_mdata =
> rte_cryptodev_sym_session_get_user_data(
> >> >> >>  							   op->sym-
> >>session);
> >> >> >>  	else if (op->sess_type == RTE_CRYPTO_OP_SESSIONLESS &&
> >> >> >>  		 op->private_data_offset)
> >> >> >> -		ec_mdata = (union rte_event_crypto_metadata *)
> >> >> >> +		ec_mdata = (struct rte_event_crypto_metadata *)
> >> >> >>  			((uint8_t *)op + op->private_data_offset);
> >> >> >>  	else
> >> >> >>  		return NULL;
> >> >> >> @@ -731,7 +731,7 @@ get_event_crypto_mdata(struct
> rte_crypto_op
> >> >> *op)
> >> >> >> uint16_t __rte_hot  otx_crypto_adapter_enqueue(void *port,
> >> >> >> struct rte_crypto_op *op)  {
> >> >> >> -	union rte_event_crypto_metadata *ec_mdata;
> >> >> >> +	struct rte_event_crypto_metadata *ec_mdata;
> >> >> >>  	struct cpt_instance *instance;
> >> >> >>  	struct cpt_request_info *req;
> >> >> >>  	struct rte_event *rsp_info;
> >> >> >> diff --git a/drivers/crypto/octeontx2/otx2_cryptodev_ops.c
> >> >> >> b/drivers/crypto/octeontx2/otx2_cryptodev_ops.c
> >> >> >> index 42100154cd..952d1352f4 100644
> >> >> >> --- a/drivers/crypto/octeontx2/otx2_cryptodev_ops.c
> >> >> >> +++ b/drivers/crypto/octeontx2/otx2_cryptodev_ops.c
> >> >> >> @@ -453,7 +453,7 @@ otx2_ca_enqueue_req(const struct
> >> otx2_cpt_qp
> >> >> *qp,
> >> >> >>  		    struct rte_crypto_op *op,
> >> >> >>  		    uint64_t cpt_inst_w7)
> >> >> >>  {
> >> >> >> -	union rte_event_crypto_metadata *m_data;
> >> >> >> +	struct rte_event_crypto_metadata *m_data;
> >> >> >>  	union cpt_inst_s inst;
> >> >> >>  	uint64_t lmt_status;
> >> >> >>
> >> >> >> @@ -468,7 +468,7 @@ otx2_ca_enqueue_req(const struct
> >> otx2_cpt_qp
> >> >> *qp,
> >> >> >>  		}
> >> >> >>  	} else if (op->sess_type == RTE_CRYPTO_OP_SESSIONLESS
> &&
> >> >> >>  		   op->private_data_offset) {
> >> >> >> -		m_data = (union rte_event_crypto_metadata *)
> >> >> >> +		m_data = (struct rte_event_crypto_metadata *)
> >> >> >>  			 ((uint8_t *)op +
> >> >> >>  			  op->private_data_offset);
> >> >> >>  	} else {
> >> >> >> diff --git
> >> >> >> a/drivers/event/octeontx2/otx2_evdev_crypto_adptr_tx.h
> >> >> >> b/drivers/event/octeontx2/otx2_evdev_crypto_adptr_tx.h
> >> >> >> index ecf7eb9f56..458e8306d7 100644
> >> >> >> --- a/drivers/event/octeontx2/otx2_evdev_crypto_adptr_tx.h
> >> >> >> +++ b/drivers/event/octeontx2/otx2_evdev_crypto_adptr_tx.h
> >> >> >> @@ -16,7 +16,7 @@
> >> >> >>  static inline uint16_t
> >> >> >>  otx2_ca_enq(uintptr_t tag_op, const struct rte_event *ev)  {
> >> >> >> -	union rte_event_crypto_metadata *m_data;
> >> >> >> +	struct rte_event_crypto_metadata *m_data;
> >> >> >>  	struct rte_crypto_op *crypto_op;
> >> >> >>  	struct rte_cryptodev *cdev;
> >> >> >>  	struct otx2_cpt_qp *qp;
> >> >> >> @@ -37,7 +37,7 @@ otx2_ca_enq(uintptr_t tag_op, const struct
> >> >> >> rte_event
> >> >> >> *ev)
> >> >> >>  		qp_id = m_data->request_info.queue_pair_id;
> >> >> >>  	} else if (crypto_op->sess_type ==
> RTE_CRYPTO_OP_SESSIONLESS
> >> >> &&
> >> >> >>  		   crypto_op->private_data_offset) {
> >> >> >> -		m_data = (union rte_event_crypto_metadata *)
> >> >> >> +		m_data = (struct rte_event_crypto_metadata *)
> >> >> >>  			 ((uint8_t *)crypto_op +
> >> >> >>  			  crypto_op->private_data_offset);
> >> >> >>  		cdev_id = m_data->request_info.cdev_id; diff --git
> >> >> >> a/lib/eventdev/rte_event_crypto_adapter.c
> >> >> >> b/lib/eventdev/rte_event_crypto_adapter.c
> >> >> >> index e1d38d383d..6977391ae9 100644
> >> >> >> --- a/lib/eventdev/rte_event_crypto_adapter.c
> >> >> >> +++ b/lib/eventdev/rte_event_crypto_adapter.c
> >> >> >> @@ -333,7 +333,7 @@ eca_enq_to_cryptodev(struct
> >> >> >> rte_event_crypto_adapter *adapter,
> >> >> >>  		 struct rte_event *ev, unsigned int cnt)  {
> >> >> >>  	struct rte_event_crypto_adapter_stats *stats = &adapter-
> >> >> >> >crypto_stats;
> >> >> >> -	union rte_event_crypto_metadata *m_data = NULL;
> >> >> >> +	struct rte_event_crypto_metadata *m_data = NULL;
> >> >> >>  	struct crypto_queue_pair_info *qp_info = NULL;
> >> >> >>  	struct rte_crypto_op *crypto_op;
> >> >> >>  	unsigned int i, n;
> >> >> >> @@ -371,7 +371,7 @@ eca_enq_to_cryptodev(struct
> >> >> >> rte_event_crypto_adapter *adapter,
> >> >> >>  			len++;
> >> >> >>  		} else if (crypto_op->sess_type ==
> >> >> RTE_CRYPTO_OP_SESSIONLESS &&
> >> >> >>  				crypto_op->private_data_offset) {
> >> >> >> -			m_data = (union
> rte_event_crypto_metadata *)
> >> >> >> +			m_data = (struct
> rte_event_crypto_metadata *)
> >> >> >>  				 ((uint8_t *)crypto_op +
> >> >> >>  					crypto_op-
> >private_data_offset);
> >> >> >>  			cdev_id = m_data->request_info.cdev_id;
> @@ -
> >> >> >> 504,7 +504,7 @@ eca_ops_enqueue_burst(struct
> >> >> rte_event_crypto_adapter
> >> >> >> *adapter,
> >> >> >>  		  struct rte_crypto_op **ops, uint16_t num)  {
> >> >> >>  	struct rte_event_crypto_adapter_stats *stats = &adapter-
> >> >> >> >crypto_stats;
> >> >> >> -	union rte_event_crypto_metadata *m_data = NULL;
> >> >> >> +	struct rte_event_crypto_metadata *m_data = NULL;
> >> >> >>  	uint8_t event_dev_id = adapter->eventdev_id;
> >> >> >>  	uint8_t event_port_id = adapter->event_port_id;
> >> >> >>  	struct rte_event events[BATCH_SIZE]; @@ -523,7 +523,7 @@
> >> >> >> eca_ops_enqueue_burst(struct rte_event_crypto_adapter
> *adapter,
> >> >> >>  					ops[i]->sym->session);
> >> >> >>  		} else if (ops[i]->sess_type ==
> >> RTE_CRYPTO_OP_SESSIONLESS &&
> >> >> >>  				ops[i]->private_data_offset) {
> >> >> >> -			m_data = (union
> rte_event_crypto_metadata *)
> >> >> >> +			m_data = (struct
> rte_event_crypto_metadata *)
> >> >> >>  				 ((uint8_t *)ops[i] +
> >> >> >>  				  ops[i]->private_data_offset);
> >> >> >>  		}
> >> >> >> diff --git a/lib/eventdev/rte_event_crypto_adapter.h
> >> >> >> b/lib/eventdev/rte_event_crypto_adapter.h
> >> >> >> index f8c6cca87c..3c24d9d9df 100644
> >> >> >> --- a/lib/eventdev/rte_event_crypto_adapter.h
> >> >> >> +++ b/lib/eventdev/rte_event_crypto_adapter.h
> >> >> >> @@ -200,11 +200,6 @@ enum rte_event_crypto_adapter_mode {
> >> >> >>   * provide event request information to the adapter.
> >> >> >>   */
> >> >> >>  struct rte_event_crypto_request {
> >> >> >> -	uint8_t resv[8];
> >> >> >> -	/**< Overlaps with first 8 bytes of struct rte_event
> >> >> >> -	 * that encode the response event information. Application
> >> >> >> -	 * is expected to fill in struct rte_event response_info.
> >> >> >> -	 */
> >> >> >>  	uint16_t cdev_id;
> >> >> >>  	/**< cryptodev ID to be used */
> >> >> >>  	uint16_t queue_pair_id;
> >> >> >> @@ -223,16 +218,16 @@ struct rte_event_crypto_request {
> >> >> >>   * operation. If the transfer is done by SW, event response
> >> information
> >> >> >>   * will be used by the adapter.
> >> >> >>   */
> >> >> >> -union rte_event_crypto_metadata {
> >> >> >> -	struct rte_event_crypto_request request_info;
> >> >> >> -	/**< Request information to be filled in by application
> >> >> >> -	 * for RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD mode.
> >> >> >> -	 */
> >> >> >> +struct rte_event_crypto_metadata {
> >> >> >>  	struct rte_event response_info;
> >> >> >>  	/**< Response information to be filled in by application
> >> >> >>  	 * for RTE_EVENT_CRYPTO_ADAPTER_OP_NEW and
> >> >> >>  	 * RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD mode.
> >> >> >>  	 */
> >> >> >> +	struct rte_event_crypto_request request_info;
> >> >> >> +	/**< Request information to be filled in by application
> >> >> >> +	 * for RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD mode.
> >> >> >> +	 */
> >> >> >>  };
> >> >> >>
> >> >> >>  /**
> >> >> >> --
> >> >> >> 2.25.1


^ permalink raw reply	[relevance 0%]

* Re: [dpdk-dev] [EXT] Re: [PATCH] RFC: ethdev: add reassembly offload
  2021-09-13  7:22  0%       ` Andrew Rybchenko
@ 2021-09-14  5:14  0%         ` Anoob Joseph
  0 siblings, 0 replies; 200+ results
From: Anoob Joseph @ 2021-09-14  5:14 UTC (permalink / raw)
  To: Andrew Rybchenko, Xu, Rosen, Yigit, Ferruh, Andrew Rybchenko
  Cc: Nicolau, Radu, Doherty, Declan, hemant.agrawal, matan, Ananyev,
	Konstantin, thomas, Ankur Dwivedi, Akhil Goyal, dev

Hi Andrew, Rosen,

Please see inline.

Thanks,
Anoob

> -----Original Message-----
> From: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
> Sent: Monday, September 13, 2021 12:52 PM
> To: Xu, Rosen <rosen.xu@intel.com>; Anoob Joseph
> <anoobj@marvell.com>; Yigit, Ferruh <ferruh.yigit@intel.com>; Andrew
> Rybchenko <arybchenko@solarflare.com>
> Cc: Nicolau, Radu <radu.nicolau@intel.com>; Doherty, Declan
> <declan.doherty@intel.com>; hemant.agrawal@nxp.com;
> matan@nvidia.com; Ananyev, Konstantin <konstantin.ananyev@intel.com>;
> thomas@monjalon.net; Ankur Dwivedi <adwivedi@marvell.com>; Akhil
> Goyal <gakhil@marvell.com>; dev@dpdk.org
> Subject: Re: [EXT] Re: [PATCH] RFC: ethdev: add reassembly offload
> 
> On 9/13/21 9:56 AM, Xu, Rosen wrote:
> > Hi,
> >
> >> -----Original Message-----
> >> From: Anoob Joseph <anoobj@marvell.com>
> >> Sent: Wednesday, September 08, 2021 18:30
> >> To: Yigit, Ferruh <ferruh.yigit@intel.com>; Xu, Rosen
> >> <rosen.xu@intel.com>; Andrew Rybchenko
> <arybchenko@solarflare.com>
> >> Cc: Nicolau, Radu <radu.nicolau@intel.com>; Doherty, Declan
> >> <declan.doherty@intel.com>; hemant.agrawal@nxp.com;
> matan@nvidia.com;
> >> Ananyev, Konstantin <konstantin.ananyev@intel.com>;
> >> thomas@monjalon.net; Ankur Dwivedi <adwivedi@marvell.com>;
> >> andrew.rybchenko@oktetlabs.ru; Akhil Goyal <gakhil@marvell.com>;
> >> dev@dpdk.org
> >> Subject: RE: [EXT] Re: [PATCH] RFC: ethdev: add reassembly offload
> >>
> >> Hi Ferruh, Rosen, Andrew,
> >>
> >> Please see inline.
> >>
> >> Thanks,
> >> Anoob
> >>
> >>> Subject: [EXT] Re: [PATCH] RFC: ethdev: add reassembly offload
> >>>
> >>> External Email
> >>>
> >>> --------------------------------------------------------------------
> >>> -- On 8/23/2021 11:02 AM, Akhil Goyal wrote:
> >>>> Reassembly is a costly operation if it is done in software,
> >>>> however, if it is offloaded to HW, it can considerably save application
> cycles.
> >>>> The operation becomes even more costlier if IP fragmants are
> >>>> encrypted.
> >>>>
> >>>> To resolve above two issues, a new offload
> >>> DEV_RX_OFFLOAD_REASSEMBLY
> >>>> is introduced in ethdev for devices which can attempt reassembly of
> >>>> packets in hardware.
> >>>> rte_eth_dev_info is added with the reassembly capabilities which a
> >>>> device can support.
> >>>> Now, if IP fragments are encrypted, reassembly can also be
> >>>> attempted while doing inline IPsec processing.
> >>>> This is controlled by a flag in rte_security_ipsec_sa_options to
> >>>> enable reassembly of encrypted IP fragments in the inline path.
> >>>>
> >>>> The resulting reassembled packet would be a typical segmented mbuf
> >>>> in case of success.
> >>>>
> >>>> And if reassembly of fragments is failed or is incomplete (if
> >>>> fragments do not come before the reass_timeout), the mbuf is
> >>>> updated with an ol_flag PKT_RX_REASSEMBLY_INCOMPLETE and mbuf
> is
> >>>> returned
> >>> as
> >>>> is. Now application may decide the fate of the packet to wait more
> >>>> for fragments to come or drop.
> >>>>
> >>>> Signed-off-by: Akhil Goyal <gakhil@marvell.com>
> >>>> ---
> >>>>  lib/ethdev/rte_ethdev.c     |  1 +
> >>>>  lib/ethdev/rte_ethdev.h     | 18 +++++++++++++++++-
> >>>>  lib/mbuf/rte_mbuf_core.h    |  3 ++-
> >>>>  lib/security/rte_security.h | 10 ++++++++++
> >>>>  4 files changed, 30 insertions(+), 2 deletions(-)
> >>>>
> >>>> diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c
> >>>> index 9d95cd11e1..1ab3a093cf 100644
> >>>> --- a/lib/ethdev/rte_ethdev.c
> >>>> +++ b/lib/ethdev/rte_ethdev.c
> >>>> @@ -119,6 +119,7 @@ static const struct {
> >>>>  	RTE_RX_OFFLOAD_BIT2STR(VLAN_FILTER),
> >>>>  	RTE_RX_OFFLOAD_BIT2STR(VLAN_EXTEND),
> >>>>  	RTE_RX_OFFLOAD_BIT2STR(JUMBO_FRAME),
> >>>> +	RTE_RX_OFFLOAD_BIT2STR(REASSEMBLY),
> >>>>  	RTE_RX_OFFLOAD_BIT2STR(SCATTER),
> >>>>  	RTE_RX_OFFLOAD_BIT2STR(TIMESTAMP),
> >>>>  	RTE_RX_OFFLOAD_BIT2STR(SECURITY), diff --git
> >>>> a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h index
> >>>> d2b27c351f..e89a4dc1eb 100644
> >>>> --- a/lib/ethdev/rte_ethdev.h
> >>>> +++ b/lib/ethdev/rte_ethdev.h
> >>>> @@ -1360,6 +1360,7 @@ struct rte_eth_conf {
> >>>>  #define DEV_RX_OFFLOAD_VLAN_FILTER	0x00000200
> >>>>  #define DEV_RX_OFFLOAD_VLAN_EXTEND	0x00000400
> >>>>  #define DEV_RX_OFFLOAD_JUMBO_FRAME	0x00000800
> >>>> +#define DEV_RX_OFFLOAD_REASSEMBLY	0x00001000
> >>>
> >>> previous '0x00001000' was 'DEV_RX_OFFLOAD_CRC_STRIP', it has been
> >> long
> >>> that offload has been removed, but not sure if it cause any problem
> >>> to
> >>> re- use it.
> >>>
> >>>>  #define DEV_RX_OFFLOAD_SCATTER		0x00002000
> >>>>  /**
> >>>>   * Timestamp is set by the driver in
> >>> RTE_MBUF_DYNFIELD_TIMESTAMP_NAME
> >>>> @@ -1477,6 +1478,20 @@ struct rte_eth_dev_portconf {
> >>>>   */
> >>>>  #define RTE_ETH_DEV_SWITCH_DOMAIN_ID_INVALID
> >>> 	(UINT16_MAX)
> >>>>
> >>>> +/**
> >>>> + * Reassembly capabilities that a device can support.
> >>>> + * The device which can support reassembly offload should set
> >>>> + * DEV_RX_OFFLOAD_REASSEMBLY
> >>>> + */
> >>>> +struct rte_eth_reass_capa {
> >>>> +	/** Maximum time in ns that a fragment can wait for further
> >>> fragments */
> >>>> +	uint64_t reass_timeout;
> >>>> +	/** Maximum number of fragments that device can reassemble */
> >>>> +	uint16_t max_frags;
> >>>> +	/** Reserved for future capabilities */
> >>>> +	uint16_t reserved[3];
> >>>> +};
> >>>> +
> >>>
> >>> I wonder if there is any other hardware around supports reassembly
> >>> offload, it would be good to get more feedback on the capabilities list.
> >>>
> >>>>  /**
> >>>>   * Ethernet device associated switch information
> >>>>   */
> >>>> @@ -1582,8 +1597,9 @@ struct rte_eth_dev_info {
> >>>>  	 * embedded managed interconnect/switch.
> >>>>  	 */
> >>>>  	struct rte_eth_switch_info switch_info;
> >>>> +	/* Reassembly capabilities of a device for reassembly offload */
> >>>> +	struct rte_eth_reass_capa reass_capa;
> >>>>
> >>>> -	uint64_t reserved_64s[2]; /**< Reserved for future fields */
> >>>
> >>> Reserved fields were added to be able to update the struct without
> >>> breaking the ABI, so that a critical change doesn't have to wait
> >>> until next ABI break release.
> >>> Since this is ABI break release, we can keep the reserved field and
> >>> add the new struct. Or this can be an opportunity to get rid of the
> >>> reserved
> >> field.
> >>>
> >>> Personally I have no objection to get rid of the reserved field, but
> >>> better to agree on this explicitly.
> >>>
> >>>>  	void *reserved_ptrs[2];   /**< Reserved for future fields */
> >>>>  };
> >>>>
> >>>> diff --git a/lib/mbuf/rte_mbuf_core.h b/lib/mbuf/rte_mbuf_core.h
> >>>> index
> >>>> bb38d7f581..cea25c87f7 100644
> >>>> --- a/lib/mbuf/rte_mbuf_core.h
> >>>> +++ b/lib/mbuf/rte_mbuf_core.h
> >>>> @@ -200,10 +200,11 @@ extern "C" {
> >>>>  #define PKT_RX_OUTER_L4_CKSUM_BAD	(1ULL << 21)
> >>>>  #define PKT_RX_OUTER_L4_CKSUM_GOOD	(1ULL << 22)
> >>>>  #define PKT_RX_OUTER_L4_CKSUM_INVALID	((1ULL << 21) | (1ULL
> >>> << 22))
> >>>> +#define PKT_RX_REASSEMBLY_INCOMPLETE	(1ULL << 23)
> >>>>
> >>>
> >>> Similar comment with Andrew's, what is the expectation from
> >>> application if this flag exists? Can we drop it to simplify the
> >>> logic in the
> >> application?
> >>
> >> [Anoob] There can be few cases where hardware/NIC attempts inline
> >> reassembly but it fails to complete it
> >>
> >> 1. Number of fragments is larger than what is supported by the hardware
> 2.
> >> Hardware reassembly resources are exhausted (due to limited
> >> reassembly contexts etc) 3. Reassembly errors such as overlapping
> >> fragments 4. Wait time exhausted (or reassembly timeout)
> >>
> >> In such cases, application would be required to retrieve the original
> >> fragments so that it can attempt reassembly in software. The
> >> incomplete flag is useful for 2 purposes basically, 1. Application
> >> would need to retrieve the time the fragment has already spend in
> >> hardware reassembly so that software reassembly attempt can
> >> compensate for it. Otherwise, reassembly timeout across hardware +
> >> software will not be accurate
> 
> Could you clarify how application will find out the time spent in HW.

[Anoob] We could use rte_mbuf dynamic fields for the same. Looks like RFC hasn't touched on this aspect yet. 
 
> 
> >> 2. Retrieve original
> >> fragments. With this proposal, an incomplete reassembly would result
> >> in a chained mbuf but the segments need not be consecutive. To
> >> explain bit more,
> >>
> >> Suppose we have a packet that is fragmented into 3 fragments, and
> >> fragment
> >> 3 & fragment 1 arrives in that order. Fragment 2 didn't arrive and
> >> hardware ultimately pushes it. In that case, application would be
> >> receiving a chained/segmented mbuf with fragment 1 & fragment 3
> chained.
> >>
> >> Now, this chained mbuf can't be treated like a regular chained mbuf.
> >> Each fragment would have its IP hdr and there are fragments missing in
> between.
> >> The only thing application is expected to do is, retrieve fragments,
> >> push it to s/w reassembly.
> 
> It sounds like it conflicts with SCATTER and BUFFER_SPLIT offloads which
> allow to return chained mbuf's. Don't know if it is good or bad, but anyway it
> must be documented.

[Anoob] Agreed.
 
> 
> >
> > What you mentioned is error identification. But actually a negotiation about
> max frame size is needed before datagrams tx/rx.

[Anoob] The actually reassembly settings would be negotiated by the s/w. The offload can be thought of like how checksum is being done now. S/w negotiates with peer and then enables the hardware to accelerate. If hardware is able to reassemble, then well and good. If not, we would have software compensate for it.
 
> 
> It sounds like it is OK for informational purposes, but right now I don't
> understand how it could be used by the application. Application still has to
> support reassembly in SW regardless of the information.

[Anoob] The additional information from "incomplete reassembly" attempt would be useful for software to properly compensate for the hardware reassembly attempt (basically, the reassembly timeout is honored across s/w + h/w  reassembly attempt). 

Benefit of such an offload is in accelerating reassembly in hardware for performance use cases. If application expects heavy fragmentation, then every packet would have a cost of ~1000 cycles (typically) to get it reassembled. By offloading this (atleast some portion of it) to hardware, application would be able to save significant cycles.

Since IP reassembly presents varying challenges depending on hardware implementation, we cannot expect complete reassembly offload in hardware. For some vendors, maximum number of fragments supported could be limited. Some vendors could have limited reassembly timeout (or wait_time). Some vendors could have limitations depending on datagram sizes. So s/w reassembly is not going away even with the proposed hardware assisted inline reassembly.

> 
> >>>
> >>>>  /* add new RX flags here, don't forget to update PKT_FIRST_FREE */
> >>>>
> >>>> -#define PKT_FIRST_FREE (1ULL << 23)
> >>>> +#define PKT_FIRST_FREE (1ULL << 24)
> >>>>  #define PKT_LAST_FREE (1ULL << 40)
> >>>>
> >>>>  /* add new TX flags here, don't forget to update PKT_LAST_FREE  */
> >>>> diff --git a/lib/security/rte_security.h
> >>>> b/lib/security/rte_security.h index 88d31de0a6..364eeb5cd4 100644
> >>>> --- a/lib/security/rte_security.h
> >>>> +++ b/lib/security/rte_security.h
> >>>> @@ -181,6 +181,16 @@ struct rte_security_ipsec_sa_options {
> >>>>  	 * * 0: Disable per session security statistics collection for this SA.
> >>>>  	 */
> >>>>  	uint32_t stats : 1;
> >>>> +
> >>>> +	/** Enable reassembly on incoming packets.
> >>>> +	 *
> >>>> +	 * * 1: Enable driver to try reassembly of encrypted IP packets for
> >>>> +	 *      this SA, if supported by the driver. This feature will work
> >>>> +	 *      only if rx_offload DEV_RX_OFFLOAD_REASSEMBLY is set in
> >>>> +	 *      inline ethernet device.
> >>>> +	 * * 0: Disable reassembly of packets (default).
> >>>> +	 */
> >>>> +	uint32_t reass_en : 1;
> >>>>  };
> >>>>
> >>>>  /** IPSec security association direction */
> >>>>
> >


^ permalink raw reply	[relevance 0%]

* [dpdk-dev] [PATCH v9] doc: add release milestones definition
    @ 2021-09-14  7:56  5% ` Thomas Monjalon
  1 sibling, 0 replies; 200+ results
From: Thomas Monjalon @ 2021-09-14  7:56 UTC (permalink / raw)
  To: dev
  Cc: david.marchand, ferruh.yigit, Asaf Penso, John McNamara,
	Ajit Khaparde, Bruce Richardson, Andrew Rybchenko

From: Asaf Penso <asafp@nvidia.com>

Adding more information about the release milestones.
This includes the scope of change, expectations, etc.

Signed-off-by: Asaf Penso <asafp@nvidia.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: John McNamara <john.mcnamara@intel.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
---
v2: fix styling format and add content in the commit message
v3: change punctuation and avoid plural form when unneeded
v4: avoid abbreviations, "Priority" in -rc, and reword as John suggests
v5: note that release candidates may vary
v6: merge RFC and proposal deadline, add roadmap link and reduce duplication
v7: make expectations clearer and stricter
v8: add tests, more fixes, maintainers approval and new API rules
v9: make deadlines more explicit, remove confusing lines about fixes
---
 doc/guides/contributing/patches.rst | 83 +++++++++++++++++++++++++++--
 1 file changed, 78 insertions(+), 5 deletions(-)

diff --git a/doc/guides/contributing/patches.rst b/doc/guides/contributing/patches.rst
index b9cc6e67ae..5a83209474 100644
--- a/doc/guides/contributing/patches.rst
+++ b/doc/guides/contributing/patches.rst
@@ -164,6 +164,10 @@ Make your planned changes in the cloned ``dpdk`` repo. Here are some guidelines
   the :doc:`ABI policy <abi_policy>` and :ref:`ABI versioning <abi_versioning>`
   guides. New external functions should also be added in alphabetical order.
 
+* Any new API function should be used in ``/app`` test directory.
+
+* When introducing a new device API, at least one driver should implement it.
+
 * Important changes will require an addition to the release notes in ``doc/guides/rel_notes/``.
   See the :ref:`Release Notes section of the Documentation Guidelines <doc_guidelines>` for details.
 
@@ -177,6 +181,8 @@ Make your planned changes in the cloned ``dpdk`` repo. Here are some guidelines
 * Add documentation, if relevant, in the form of Doxygen comments or a User Guide in RST format.
   See the :ref:`Documentation Guidelines <doc_guidelines>`.
 
+* Code and related documentation must be updated atomically in the same patch.
+
 Once the changes have been made you should commit them to your local repo.
 
 For small changes, that do not require specific explanations, it is better to keep things together in the
@@ -185,11 +191,6 @@ Larger changes that require different explanations should be separated into logi
 A good way of thinking about whether a patch should be split is to consider whether the change could be
 applied without dependencies as a backport.
 
-It is better to keep the related documentation changes in the same patch
-file as the code, rather than one big documentation patch at the end of a
-patchset. This makes it easier for future maintenance and development of the
-code.
-
 As a guide to how patches should be structured run ``git log`` on similar files.
 
 
@@ -663,3 +664,75 @@ patch accepted. The general cycle for patch review and acceptance is:
      than rework of the original.
    * Trivial patches may be merged sooner than described above at the tree committer's
      discretion.
+
+
+Milestones definition
+---------------------
+
+Each DPDK release has milestones that help everyone to converge to the release date.
+The following is a list of these milestones together with
+concrete definitions and expectations for a typical release cycle.
+An average cycle lasts 3 months and have 4 release candidates in the last month.
+Test reports are expected to be received after each release candidate.
+The number and expectations of release candidates might vary slightly.
+The schedule is updated in the `roadmap <https://core.dpdk.org/roadmap/#dates>`_.
+
+.. note::
+   Sooner is always better. Deadlines are not ideal dates.
+
+   Integration is never guaranteed but everyone can help.
+
+Roadmap
+~~~~~~~
+
+* Announce new features in libraries, drivers, applications, and examples.
+* To be published before the previous release.
+
+Proposal Deadline
+~~~~~~~~~~~~~~~~~
+
+* Must send an RFC (Request For Comments) or a complete patch of new features.
+* Early RFC gives time for design review before complete implementation.
+* Should include at least the API changes in libraries and applications.
+* Library code should be quite complete at the deadline.
+* Nice to have: driver implementation, example code, and documentation.
+
+rc1
+~~~
+
+* Priority: libraries. No library feature should be accepted after -rc1.
+* API changes or additions must be implemented in libraries.
+* The API must include Doxygen documentation
+  and be part of the relevant .rst files (library-specific and release notes).
+* API should be used in a test application (``/app``).
+* At least one PMD should implement the API.
+  It may be a draft sent in a separate series.
+* The above should be sent to the mailing list at least 2 weeks before -rc1
+  to give time for review and maintainers approval.
+* If no review after 10 days, a reminder should be sent.
+* Nice to have: example code (``/examples``)
+
+rc2
+~~~
+
+* Priority: drivers. No driver feature should be accepted after -rc2.
+* A driver change must include documentation
+  in the relevant .rst files (driver-specific and release notes).
+* Driver changes should be sent to the mailing list before -rc1 is released.
+
+rc3
+~~~
+
+* Priority: applications. No application feature should be accepted after -rc3.
+* New functionality that does not depend on libraries update
+  can be integrated as part of -rc3.
+* The application change must include documentation in the relevant .rst files
+  (application-specific and release notes if significant).
+* Libraries and drivers cleanup are allowed.
+* Small driver reworks.
+
+rc4
+~~~
+
+* Documentation updates.
+* Critical bug fixes only.
-- 
2.33.0


^ permalink raw reply	[relevance 5%]

* Re: [dpdk-dev] [PATCH 8/8] bus/pci: remove ABIs in PCI bus
  2021-09-10  2:24  2% ` [dpdk-dev] [PATCH 8/8] bus/pci: remove ABIs in PCI bus Chenbo Xia
  2021-09-13 12:06  0%   ` Kinsella, Ray
@ 2021-09-14  8:15  0%   ` Xu, Rosen
  1 sibling, 0 replies; 200+ results
From: Xu, Rosen @ 2021-09-14  8:15 UTC (permalink / raw)
  To: Xia, Chenbo, dev
  Cc: Chautru, Nicolas, Yigit, Ferruh, Burakov, Anatoly, Ray Kinsella,
	Nithin Dabilpuram, Kiran Kumar K, Sunil Kumar Kori, Satha Rao,
	Matan Azrad, Shahaf Shuler, Viacheslav Ovsiienko, Jerin Jacob,
	Anoob Joseph, Trahe, Fiona, Griffin, John, Jain, Deepak K,
	Andrew Rybchenko, Ashish Gupta, Somalapuram Amaranath,
	Ankur Dwivedi, Tejasree Kondoj, Nagadheeraj Rottela,
	Srikanth Jampala, Jay Zhou, McDaniel, Timothy, Pavan Nikhilesh,
	Ashwin Sekhar T K, Harman Kalra, Shepard Siegel, Ed Czeck,
	John Miller, Steven Webster, Peters, Matt, Rasesh Mody,
	Shahed Shaikh, Ajit Khaparde, Somnath Kotur, Chas Williams,
	Min Hu (Connor),
	Rahul Lakkireddy, Wang, Haiyue, Marcin Wojtas, Michal Krawczyk,
	Shai Brandes, Evgeny Schemeilin, Igor Chauskin, Daley, John,
	Hyong Youb Kim, Ziyang Xuan, Xiaoyun Wang, Guoyang Zhou,
	Yisen Zhuang, Lijun Ou, Xing, Beilei, Andrew Boyer,
	Stephen Hemminger, Long Li, Devendra Singh Rawat, Maciej Czekaj,
	Jiawen Wu, Jian Wang, Maxime Coquelin, Yong Wang, Jakub Palider,
	Tomasz Duszynski, Zhang, Tianfei, Richardson, Bruce, Li, Xiaoyun,
	Wu, Jingjing, Radha Mohan Chintakuntla, Veerasenareddy Burru,
	Ori Kam, Wang, Xiao W, Thomas Monjalon



> -----Original Message-----
> From: Xia, Chenbo <chenbo.xia@intel.com>
> Sent: Friday, September 10, 2021 10:24
> To: dev@dpdk.org
> Cc: Chautru, Nicolas <nicolas.chautru@intel.com>; Yigit, Ferruh
> <ferruh.yigit@intel.com>; Burakov, Anatoly <anatoly.burakov@intel.com>;
> Ray Kinsella <mdr@ashroe.eu>; Nithin Dabilpuram
> <ndabilpuram@marvell.com>; Kiran Kumar K <kirankumark@marvell.com>;
> Sunil Kumar Kori <skori@marvell.com>; Satha Rao
> <skoteshwar@marvell.com>; Matan Azrad <matan@nvidia.com>; Shahaf
> Shuler <shahafs@nvidia.com>; Viacheslav Ovsiienko
> <viacheslavo@nvidia.com>; Jerin Jacob <jerinj@marvell.com>; Anoob Joseph
> <anoobj@marvell.com>; Trahe, Fiona <fiona.trahe@intel.com>; Griffin, John
> <john.griffin@intel.com>; Jain, Deepak K <deepak.k.jain@intel.com>;
> Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>; Ashish Gupta
> <ashish.gupta@marvell.com>; Somalapuram Amaranath
> <asomalap@amd.com>; Ankur Dwivedi <adwivedi@marvell.com>; Tejasree
> Kondoj <ktejasree@marvell.com>; Nagadheeraj Rottela
> <rnagadheeraj@marvell.com>; Srikanth Jampala <jsrikanth@marvell.com>;
> Jay Zhou <jianjay.zhou@huawei.com>; McDaniel, Timothy
> <timothy.mcdaniel@intel.com>; Pavan Nikhilesh
> <pbhagavatula@marvell.com>; Ashwin Sekhar T K <asekhar@marvell.com>;
> Harman Kalra <hkalra@marvell.com>; Shepard Siegel
> <shepard.siegel@atomicrules.com>; Ed Czeck <ed.czeck@atomicrules.com>;
> John Miller <john.miller@atomicrules.com>; Steven Webster
> <steven.webster@windriver.com>; Peters, Matt
> <matt.peters@windriver.com>; Rasesh Mody <rmody@marvell.com>;
> Shahed Shaikh <shshaikh@marvell.com>; Ajit Khaparde
> <ajit.khaparde@broadcom.com>; Somnath Kotur
> <somnath.kotur@broadcom.com>; Chas Williams <chas3@att.com>; Min Hu
> (Connor) <humin29@huawei.com>; Rahul Lakkireddy
> <rahul.lakkireddy@chelsio.com>; Wang, Haiyue <haiyue.wang@intel.com>;
> Marcin Wojtas <mw@semihalf.com>; Michal Krawczyk <mk@semihalf.com>;
> Shai Brandes <shaibran@amazon.com>; Evgeny Schemeilin
> <evgenys@amazon.com>; Igor Chauskin <igorch@amazon.com>; Daley, John
> <johndale@cisco.com>; Hyong Youb Kim <hyonkim@cisco.com>; Ziyang
> Xuan <xuanziyang2@huawei.com>; Xiaoyun Wang
> <cloud.wangxiaoyun@huawei.com>; Guoyang Zhou
> <zhouguoyang@huawei.com>; Yisen Zhuang <yisen.zhuang@huawei.com>;
> Lijun Ou <oulijun@huawei.com>; Xing, Beilei <beilei.xing@intel.com>;
> Andrew Boyer <aboyer@pensando.io>; Xu, Rosen <rosen.xu@intel.com>;
> Stephen Hemminger <sthemmin@microsoft.com>; Long Li
> <longli@microsoft.com>; Devendra Singh Rawat
> <dsinghrawat@marvell.com>; Maciej Czekaj <mczekaj@marvell.com>;
> Jiawen Wu <jiawenwu@trustnetic.com>; Jian Wang
> <jianwang@trustnetic.com>; Maxime Coquelin
> <maxime.coquelin@redhat.com>; Yong Wang <yongwang@vmware.com>;
> Jakub Palider <jpalider@marvell.com>; Tomasz Duszynski
> <tduszynski@marvell.com>; Zhang, Tianfei <tianfei.zhang@intel.com>;
> Richardson, Bruce <bruce.richardson@intel.com>; Li, Xiaoyun
> <xiaoyun.li@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>; Radha Mohan
> Chintakuntla <radhac@marvell.com>; Veerasenareddy Burru
> <vburru@marvell.com>; Ori Kam <orika@nvidia.com>; Wang, Xiao W
> <xiao.w.wang@intel.com>; Thomas Monjalon <thomas@monjalon.net>
> Subject: [PATCH 8/8] bus/pci: remove ABIs in PCI bus
> 
> As announced in the deprecation note, most of ABIs in PCI bus are
> removed in this patch. Only the function rte_pci_dump is still ABI
> and experimental APIs are kept for future promotion.
> 
> This patch creates a new file named pci_driver.h and moves most of
> the content in original rte_bus_pci.h to it. After that, pci_driver.h
> is considered the interface for drivers and rte_bus_pci.h for
> applications. pci_driver.h is defined as driver_sdk_headers so that
> out-of-tree drivers can use it.
> 
> Then this patch replaces the including of rte_bus_pci.h with pci_driver.h
> in all related drivers.
> 
> Signed-off-by: Chenbo Xia <chenbo.xia@intel.com>
> ---
>  app/test/virtual_pmd.c                        |   2 +-
>  doc/guides/rel_notes/release_21_11.rst        |   2 +
>  drivers/baseband/acc100/rte_acc100_pmd.c      |   2 +-
>  .../fpga_5gnr_fec/rte_fpga_5gnr_fec.c         |   2 +-
>  drivers/baseband/fpga_lte_fec/fpga_lte_fec.c  |   2 +-
>  drivers/bus/pci/bsd/pci.c                     |   1 -
>  drivers/bus/pci/linux/pci.c                   |   1 -
>  drivers/bus/pci/linux/pci_uio.c               |   1 -
>  drivers/bus/pci/linux/pci_vfio.c              |   1 -
>  drivers/bus/pci/meson.build                   |   4 +
>  drivers/bus/pci/pci_common_uio.c              |   1 -
>  drivers/bus/pci/pci_driver.h                  | 402 ++++++++++++++++++
>  drivers/bus/pci/pci_params.c                  |   1 -
>  drivers/bus/pci/private.h                     |   3 +-
>  drivers/bus/pci/rte_bus_pci.h                 | 375 +---------------
>  drivers/bus/pci/version.map                   |  32 +-
>  drivers/common/cnxk/roc_platform.h            |   2 +-
>  drivers/common/mlx5/linux/mlx5_common_verbs.c |   2 +-
>  drivers/common/mlx5/mlx5_common_pci.c         |   2 +-
>  drivers/common/octeontx2/otx2_dev.h           |   2 +-
>  drivers/common/octeontx2/otx2_sec_idev.c      |   2 +-
>  drivers/common/qat/qat_device.h               |   2 +-
>  drivers/common/qat/qat_qp.c                   |   2 +-
>  drivers/common/sfc_efx/sfc_efx.h              |   2 +-
>  drivers/compress/mlx5/mlx5_compress.c         |   2 +-
>  drivers/compress/octeontx/otx_zip.h           |   2 +-
>  drivers/compress/qat/qat_comp.c               |   2 +-
>  drivers/crypto/ccp/ccp_dev.h                  |   2 +-
>  drivers/crypto/ccp/ccp_pci.h                  |   2 +-
>  drivers/crypto/ccp/rte_ccp_pmd.c              |   2 +-
>  drivers/crypto/cnxk/cn10k_cryptodev.c         |   2 +-
>  drivers/crypto/cnxk/cn9k_cryptodev.c          |   2 +-
>  drivers/crypto/mlx5/mlx5_crypto.c             |   2 +-
>  drivers/crypto/nitrox/nitrox_device.h         |   2 +-
>  drivers/crypto/octeontx/otx_cryptodev.c       |   2 +-
>  drivers/crypto/octeontx/otx_cryptodev_ops.c   |   2 +-
>  drivers/crypto/octeontx2/otx2_cryptodev.c     |   2 +-
>  drivers/crypto/qat/qat_sym.c                  |   2 +-
>  drivers/crypto/qat/qat_sym_pmd.c              |   2 +-
>  drivers/crypto/virtio/virtio_cryptodev.c      |   2 +-
>  drivers/crypto/virtio/virtio_pci.h            |   2 +-
>  drivers/event/dlb2/pf/dlb2_main.h             |   2 +-
>  drivers/event/dlb2/pf/dlb2_pf.c               |   2 +-
>  drivers/event/octeontx/ssovf_probe.c          |   2 +-
>  drivers/event/octeontx/timvf_probe.c          |   2 +-
>  drivers/event/octeontx2/otx2_evdev.c          |   2 +-
>  drivers/mempool/cnxk/cnxk_mempool.c           |   2 +-
>  drivers/mempool/octeontx/octeontx_fpavf.c     |   2 +-
>  drivers/mempool/octeontx2/otx2_mempool.c      |   2 +-
>  drivers/mempool/octeontx2/otx2_mempool.h      |   2 +-
>  drivers/mempool/octeontx2/otx2_mempool_irq.c  |   2 +-
>  drivers/meson.build                           |   4 +
>  drivers/net/ark/ark_ethdev.c                  |   2 +-
>  drivers/net/avp/avp_ethdev.c                  |   2 +-
>  drivers/net/bnx2x/bnx2x.h                     |   2 +-
>  drivers/net/bnxt/bnxt.h                       |   2 +-
>  drivers/net/bonding/rte_eth_bond_args.c       |   2 +-
>  drivers/net/cxgbe/base/adapter.h              |   2 +-
>  drivers/net/cxgbe/cxgbe_ethdev.c              |   2 +-
>  drivers/net/e1000/em_ethdev.c                 |   2 +-
>  drivers/net/e1000/em_rxtx.c                   |   2 +-
>  drivers/net/e1000/igb_ethdev.c                |   2 +-
>  drivers/net/e1000/igb_pf.c                    |   2 +-
>  drivers/net/ena/ena_ethdev.h                  |   2 +-
>  drivers/net/enic/base/vnic_dev.h              |   2 +-
>  drivers/net/enic/enic_ethdev.c                |   2 +-
>  drivers/net/enic/enic_main.c                  |   2 +-
>  drivers/net/enic/enic_vf_representor.c        |   2 +-
>  drivers/net/hinic/base/hinic_pmd_hwdev.c      |   2 +-
>  drivers/net/hinic/base/hinic_pmd_hwif.c       |   2 +-
>  drivers/net/hinic/base/hinic_pmd_nicio.c      |   2 +-
>  drivers/net/hinic/hinic_pmd_ethdev.c          |   2 +-
>  drivers/net/hns3/hns3_ethdev.c                |   2 +-
>  drivers/net/hns3/hns3_rxtx.c                  |   2 +-
>  drivers/net/i40e/i40e_ethdev.c                |   2 +-
>  drivers/net/i40e/i40e_ethdev_vf.c             |   2 +-
>  drivers/net/i40e/i40e_vf_representor.c        |   2 +-
>  drivers/net/igc/igc_ethdev.c                  |   2 +-
>  drivers/net/ionic/ionic.h                     |   2 +-
>  drivers/net/ionic/ionic_ethdev.c              |   2 +-
>  drivers/net/ipn3ke/ipn3ke_ethdev.c            |   2 +-
>  drivers/net/ipn3ke/ipn3ke_representor.c       |   2 +-
>  drivers/net/ipn3ke/ipn3ke_tm.c                |   2 +-
>  drivers/net/ixgbe/ixgbe_ethdev.c              |   2 +-
>  drivers/net/ixgbe/ixgbe_ethdev.h              |   2 +-
>  drivers/net/mlx4/mlx4_ethdev.c                |   2 +-
>  drivers/net/mlx5/linux/mlx5_ethdev_os.c       |   2 +-
>  drivers/net/mlx5/linux/mlx5_os.c              |   2 +-
>  drivers/net/mlx5/mlx5.c                       |   2 +-
>  drivers/net/mlx5/mlx5_ethdev.c                |   2 +-
>  drivers/net/mlx5/mlx5_txq.c                   |   2 +-
>  drivers/net/netvsc/hn_vf.c                    |   2 +-
>  drivers/net/octeontx/base/octeontx_pkivf.c    |   2 +-
>  drivers/net/octeontx/base/octeontx_pkovf.c    |   2 +-
>  drivers/net/octeontx2/otx2_ethdev_irq.c       |   2 +-
>  drivers/net/qede/base/bcm_osal.h              |   2 +-
>  drivers/net/sfc/sfc.h                         |   2 +-
>  drivers/net/sfc/sfc_ethdev.c                  |   2 +-
>  drivers/net/sfc/sfc_sriov.c                   |   2 +-
>  drivers/net/thunderx/nicvf_ethdev.c           |   2 +-
>  drivers/net/txgbe/txgbe_ethdev.h              |   2 +-
>  drivers/net/txgbe/txgbe_flow.c                |   2 +-
>  drivers/net/txgbe/txgbe_pf.c                  |   2 +-
>  drivers/net/virtio/virtio_pci.h               |   2 +-
>  drivers/net/virtio/virtio_pci_ethdev.c        |   2 +-
>  drivers/net/vmxnet3/vmxnet3_ethdev.c          |   2 +-
>  drivers/raw/cnxk_bphy/cnxk_bphy.c             |   2 +-
>  drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c         |   2 +-
>  drivers/raw/cnxk_bphy/cnxk_bphy_irq.c         |   2 +-
>  drivers/raw/cnxk_bphy/cnxk_bphy_irq.h         |   2 +-
>  drivers/raw/ifpga/ifpga_rawdev.c              |   2 +-
>  drivers/raw/ifpga/rte_pmd_ifpga.c             |   2 +-
>  drivers/raw/ioat/idxd_pci.c                   |   2 +-
>  drivers/raw/ioat/ioat_rawdev.c                |   2 +-
>  drivers/raw/ntb/ntb.c                         |   2 +-
>  drivers/raw/ntb/ntb_hw_intel.c                |   2 +-
>  drivers/raw/octeontx2_dma/otx2_dpi_rawdev.c   |   2 +-
>  drivers/raw/octeontx2_ep/otx2_ep_enqdeq.c     |   2 +-
>  drivers/raw/octeontx2_ep/otx2_ep_rawdev.c     |   2 +-
>  drivers/regex/mlx5/mlx5_regex.c               |   2 +-
>  drivers/regex/mlx5/mlx5_regex_fastpath.c      |   2 +-
>  drivers/vdpa/ifc/base/ifcvf_osdep.h           |   2 +-
>  drivers/vdpa/ifc/ifcvf_vdpa.c                 |   2 +-
>  drivers/vdpa/mlx5/mlx5_vdpa.c                 |   2 +-
>  lib/ethdev/ethdev_pci.h                       |   2 +-
>  lib/eventdev/eventdev_pmd_pci.h               |   2 +-
>  126 files changed, 546 insertions(+), 508 deletions(-)
>  create mode 100644 drivers/bus/pci/pci_driver.h
> 

Acked-by: Rosen Xu <rosen.xu@intel.com>

^ permalink raw reply	[relevance 0%]

* Re: [dpdk-dev] [PATCH v1 1/6] build: increase default of max lcores to 512
  2021-09-10  8:24  0%           ` Thomas Monjalon
@ 2021-09-14  9:34  0%             ` David Hunt
  2021-09-14 10:00  0%               ` David Marchand
  0 siblings, 1 reply; 200+ results
From: David Hunt @ 2021-09-14  9:34 UTC (permalink / raw)
  To: Thomas Monjalon, Bruce Richardson, David Marchand; +Cc: dev


On 10/9/2021 9:24 AM, Thomas Monjalon wrote:
> 10/09/2021 10:06, David Marchand:
>> On Fri, Sep 10, 2021 at 9:54 AM Bruce Richardson
>> <bruce.richardson@intel.com> wrote:
>>> On Fri, Sep 10, 2021 at 08:51:04AM +0200, David Marchand wrote:
>>>> On Thu, Sep 9, 2021 at 4:38 PM Bruce Richardson
>>>> <bruce.richardson@intel.com> wrote:
>>>>> On Thu, Sep 09, 2021 at 02:45:06PM +0100, David Hunt wrote:
>>>>>> Modern processors are coming with an ever increasing number of cores,
>>>>>> and 128 does not seem like a sensible max limit any more, especially
>>>>>> when you consider multi-socket systems with Hyper-Threading enabled.
>>>>>>
>>>>>> This patch increases max_lcores default from 128 to 512.
>>>>>>
>>>>>> Signed-off-by: David Hunt <david.hunt@intel.com>
>>>> Why should we need this?
>>>>
>>>> --lcores makes it possible to pin 128 lcores to any physical core on
>>>> your system.
>>>> And for applications that have their own thread management, they can
>>>> pin thread, then use rte_thread_register.
>>>>
>>>> Do you have applications that require more than 128 lcores?
>>>>
>>> The trouble is that using the --lcores syntax for mapping high core numbers
>>> to low lcore ids is much more awkward to use. Every case of DPDK use I've
>>> seen uses -c with a coremask, or -l with just giving a few core numbers on
>>> it. This simple scheme won't work with core numbers greater than 128, and
>>> there are already systems available with more than that number of cores.
>>>
>>> Apart from the memory footprint issues - which this patch is already making
>>> a good start in addressing, why would we not increase the default
>>> max_lcores to that seen on real systems?
>> The memory footprint is a major issue to me, and reserving all those
>> lcores won't be needed in any system.
>> We will also have to decide on a "640k ought to be enough" value to
>> avoid ABI issue with the next processor that comes out and has more
>> than 512 cores.
>>
>> Could we wire the -c / -l options to --lcores behavior ?
>> It breaks the 1:1 lcore/physical core assumption, but it solves your
>> usability issue.
> Why would we change existing options while we already have an option
> (--lcores) which solves the issue above?
> I think the only issue is to educate users.
> Is there something to improve in the documentation?
>

Hi all,
I agree that it’s a good idea to switch to using the “--lcrores” option 
for cores above the default, that’s already future proofed.
However, I’m still a little concerned about usability, if our users are 
accustomed to the “-c” and “-l” options, I suggest that we add a warning 
to suggest using the “--lcores” option if any of the cores provided on 
the command line are above RTE_MAX_LCORE. That would help them with the 
solution to using physical cores above 128 (or whatever the compiled 
default is).

Example:

“ERROR: logical core 212 is above the maximum lcore number permitted.
Please use the --lcores option to map lcores onto physical cores, e.g. 
--lcores="(0-3)@(212-215).”

I’ll replace the first patch in the set with a patch that adds the 
additional information in the error message.

Thanks,
Dave.



^ permalink raw reply	[relevance 0%]

* Re: [dpdk-dev] [PATCH v1 1/6] build: increase default of max lcores to 512
  2021-09-14  9:34  0%             ` David Hunt
@ 2021-09-14 10:00  0%               ` David Marchand
  2021-09-14 11:07  0%                 ` David Hunt
  0 siblings, 1 reply; 200+ results
From: David Marchand @ 2021-09-14 10:00 UTC (permalink / raw)
  To: David Hunt; +Cc: Thomas Monjalon, Bruce Richardson, dev

On Tue, Sep 14, 2021 at 11:34 AM David Hunt <david.hunt@intel.com> wrote:
>
>
> On 10/9/2021 9:24 AM, Thomas Monjalon wrote:
> > 10/09/2021 10:06, David Marchand:
> >> On Fri, Sep 10, 2021 at 9:54 AM Bruce Richardson
> >> <bruce.richardson@intel.com> wrote:
> >>> On Fri, Sep 10, 2021 at 08:51:04AM +0200, David Marchand wrote:
> >>>> On Thu, Sep 9, 2021 at 4:38 PM Bruce Richardson
> >>>> <bruce.richardson@intel.com> wrote:
> >>>>> On Thu, Sep 09, 2021 at 02:45:06PM +0100, David Hunt wrote:
> >>>>>> Modern processors are coming with an ever increasing number of cores,
> >>>>>> and 128 does not seem like a sensible max limit any more, especially
> >>>>>> when you consider multi-socket systems with Hyper-Threading enabled.
> >>>>>>
> >>>>>> This patch increases max_lcores default from 128 to 512.
> >>>>>>
> >>>>>> Signed-off-by: David Hunt <david.hunt@intel.com>
> >>>> Why should we need this?
> >>>>
> >>>> --lcores makes it possible to pin 128 lcores to any physical core on
> >>>> your system.
> >>>> And for applications that have their own thread management, they can
> >>>> pin thread, then use rte_thread_register.
> >>>>
> >>>> Do you have applications that require more than 128 lcores?
> >>>>
> >>> The trouble is that using the --lcores syntax for mapping high core numbers
> >>> to low lcore ids is much more awkward to use. Every case of DPDK use I've
> >>> seen uses -c with a coremask, or -l with just giving a few core numbers on
> >>> it. This simple scheme won't work with core numbers greater than 128, and
> >>> there are already systems available with more than that number of cores.
> >>>
> >>> Apart from the memory footprint issues - which this patch is already making
> >>> a good start in addressing, why would we not increase the default
> >>> max_lcores to that seen on real systems?
> >> The memory footprint is a major issue to me, and reserving all those
> >> lcores won't be needed in any system.
> >> We will also have to decide on a "640k ought to be enough" value to
> >> avoid ABI issue with the next processor that comes out and has more
> >> than 512 cores.
> >>
> >> Could we wire the -c / -l options to --lcores behavior ?
> >> It breaks the 1:1 lcore/physical core assumption, but it solves your
> >> usability issue.
> > Why would we change existing options while we already have an option
> > (--lcores) which solves the issue above?
> > I think the only issue is to educate users.
> > Is there something to improve in the documentation?
> >
>
> Hi all,
> I agree that it’s a good idea to switch to using the “--lcrores” option

Let's avoid typo in the error message you'll add :-).


> for cores above the default, that’s already future proofed.
> However, I’m still a little concerned about usability, if our users are
> accustomed to the “-c” and “-l” options, I suggest that we add a warning
> to suggest using the “--lcores” option if any of the cores provided on
> the command line are above RTE_MAX_LCORE. That would help them with the
> solution to using physical cores above 128 (or whatever the compiled
> default is).
>
> Example:
>
> “ERROR: logical core 212 is above the maximum lcore number permitted.
> Please use the --lcores option to map lcores onto physical cores, e.g.
> --lcores="(0-3)@(212-215).”

If you could directly provide the right --lcores syntax based on what
user provided with -c or -l, it would be even better.
This should be not that difficult.


>
> I’ll replace the first patch in the set with a patch that adds the
> additional information in the error message.



-- 
David Marchand


^ permalink raw reply	[relevance 0%]

* Re: [dpdk-dev] [PATCH] efd: change data type of parameter
  @ 2021-09-14 10:49  3%   ` Kinsella, Ray
  0 siblings, 0 replies; 200+ results
From: Kinsella, Ray @ 2021-09-14 10:49 UTC (permalink / raw)
  To: David Marchand, Pablo de Lara
  Cc: Wang, Yipeng1, Byron Marohn, dev, techboard, David Christensen



On 14/09/2021 08:10, David Marchand wrote:
> On Fri, Sep 10, 2021 at 6:54 PM Pablo de Lara
> <pablo.de.lara.guarch@intel.com> wrote:
>>
>> rte_efd_create() function was using uint8_t for a socket bitmask,
>> for one of its parameters.
>> This limits the maximum of NUMA sockets to be 8.
>> Changing to to uint64_t increases it to 64, which should be
>> more future-proof.
> 
> Cc: ppc maintainer, since I think powerX servers have non contiguous
> NUMA sockets.
> 
> 
>>
>> Coverity issue: 366390
>> Fixes: 56b6ef874f8 ("efd: new Elastic Flow Distributor library")
>>
>> Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
>> ---
>>
>> This fix requires an API breakage and therefore it is not
>> a good candidate for backporting (besides, it is a very low impact bug).
>> Hence, I am not CC'ing stable.
> 
> This is an unannounced breakage for a stable API.
> Cc: techboard + Ray for awareness.

Understood.
Its low impact, at a time we are changing the ABI in any case.

> 
> 
>>
>> ---
>>
>>  lib/efd/rte_efd.c | 2 +-
>>  lib/efd/rte_efd.h | 2 +-
>>  2 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/lib/efd/rte_efd.c b/lib/efd/rte_efd.c
>> index 77f46809f8..68a2378e88 100644
>> --- a/lib/efd/rte_efd.c
>> +++ b/lib/efd/rte_efd.c
>> @@ -495,7 +495,7 @@ efd_search_hash(struct rte_efd_table * const table,
>>
>>  struct rte_efd_table *
>>  rte_efd_create(const char *name, uint32_t max_num_rules, uint32_t key_len,
>> -               uint8_t online_cpu_socket_bitmask, uint8_t offline_cpu_socket)
>> +               uint64_t online_cpu_socket_bitmask, uint8_t offline_cpu_socket)
>>  {
>>         struct rte_efd_table *table = NULL;
>>         uint8_t *key_array = NULL;
>> diff --git a/lib/efd/rte_efd.h b/lib/efd/rte_efd.h
>> index c2be4c09ae..d3d7befd0c 100644
>> --- a/lib/efd/rte_efd.h
>> +++ b/lib/efd/rte_efd.h
>> @@ -139,7 +139,7 @@ typedef uint16_t efd_hashfunc_t;
>>   */
>>  struct rte_efd_table *
>>  rte_efd_create(const char *name, uint32_t max_num_rules, uint32_t key_len,
>> -       uint8_t online_cpu_socket_bitmask, uint8_t offline_cpu_socket);
>> +       uint64_t online_cpu_socket_bitmask, uint8_t offline_cpu_socket);
>>
>>  /**
>>   * Releases the resources from an EFD table
>> --
>> 2.25.1
>>
> 
> 

^ permalink raw reply	[relevance 3%]

* Re: [dpdk-dev] [PATCH v1 1/6] build: increase default of max lcores to 512
  2021-09-14 10:00  0%               ` David Marchand
@ 2021-09-14 11:07  0%                 ` David Hunt
  0 siblings, 0 replies; 200+ results
From: David Hunt @ 2021-09-14 11:07 UTC (permalink / raw)
  To: David Marchand; +Cc: Thomas Monjalon, Bruce Richardson, dev


On 14/9/2021 11:00 AM, David Marchand wrote:
> On Tue, Sep 14, 2021 at 11:34 AM David Hunt <david.hunt@intel.com> wrote:
>>
>> On 10/9/2021 9:24 AM, Thomas Monjalon wrote:
>>> 10/09/2021 10:06, David Marchand:
>>>> On Fri, Sep 10, 2021 at 9:54 AM Bruce Richardson
>>>> <bruce.richardson@intel.com> wrote:
>>>>> On Fri, Sep 10, 2021 at 08:51:04AM +0200, David Marchand wrote:
>>>>>> On Thu, Sep 9, 2021 at 4:38 PM Bruce Richardson
>>>>>> <bruce.richardson@intel.com> wrote:
>>>>>>> On Thu, Sep 09, 2021 at 02:45:06PM +0100, David Hunt wrote:
>>>>>>>> Modern processors are coming with an ever increasing number of cores,
>>>>>>>> and 128 does not seem like a sensible max limit any more, especially
>>>>>>>> when you consider multi-socket systems with Hyper-Threading enabled.
>>>>>>>>
>>>>>>>> This patch increases max_lcores default from 128 to 512.
>>>>>>>>
>>>>>>>> Signed-off-by: David Hunt <david.hunt@intel.com>
>>>>>> Why should we need this?
>>>>>>
>>>>>> --lcores makes it possible to pin 128 lcores to any physical core on
>>>>>> your system.
>>>>>> And for applications that have their own thread management, they can
>>>>>> pin thread, then use rte_thread_register.
>>>>>>
>>>>>> Do you have applications that require more than 128 lcores?
>>>>>>
>>>>> The trouble is that using the --lcores syntax for mapping high core numbers
>>>>> to low lcore ids is much more awkward to use. Every case of DPDK use I've
>>>>> seen uses -c with a coremask, or -l with just giving a few core numbers on
>>>>> it. This simple scheme won't work with core numbers greater than 128, and
>>>>> there are already systems available with more than that number of cores.
>>>>>
>>>>> Apart from the memory footprint issues - which this patch is already making
>>>>> a good start in addressing, why would we not increase the default
>>>>> max_lcores to that seen on real systems?
>>>> The memory footprint is a major issue to me, and reserving all those
>>>> lcores won't be needed in any system.
>>>> We will also have to decide on a "640k ought to be enough" value to
>>>> avoid ABI issue with the next processor that comes out and has more
>>>> than 512 cores.
>>>>
>>>> Could we wire the -c / -l options to --lcores behavior ?
>>>> It breaks the 1:1 lcore/physical core assumption, but it solves your
>>>> usability issue.
>>> Why would we change existing options while we already have an option
>>> (--lcores) which solves the issue above?
>>> I think the only issue is to educate users.
>>> Is there something to improve in the documentation?
>>>
>> Hi all,
>> I agree that it’s a good idea to switch to using the “--lcrores” option
> Let's avoid typo in the error message you'll add :-).
>
>
>> for cores above the default, that’s already future proofed.
>> However, I’m still a little concerned about usability, if our users are
>> accustomed to the “-c” and “-l” options, I suggest that we add a warning
>> to suggest using the “--lcores” option if any of the cores provided on
>> the command line are above RTE_MAX_LCORE. That would help them with the
>> solution to using physical cores above 128 (or whatever the compiled
>> default is).
>>
>> Example:
>>
>> “ERROR: logical core 212 is above the maximum lcore number permitted.
>> Please use the --lcores option to map lcores onto physical cores, e.g.
>> --lcores="(0-3)@(212-215).”
> If you could directly provide the right --lcores syntax based on what
> user provided with -c or -l, it would be even better.
> This should be not that difficult.


Agreed. I now have something working that when given "-l 12-16,130,132", 
will output the following:

EAL: One of the 7 cores provided exceeds RTE_MAX_LCORE (128)
EAL: Please use --lcores instead, e.g. --lcores "(0-6)@(12-16,130,132)"

So you can just cut-and-paste that option into your command line. Makes 
it very easy for users to migrate.


>
>> I’ll replace the first patch in the set with a patch that adds the
>> additional information in the error message.
>
>

^ permalink raw reply	[relevance 0%]

* Re: [dpdk-dev] [RFC 0/7] hide eth dev related structures
    2021-09-06 18:09  0%   ` Ferruh Yigit
@ 2021-09-14 13:33  3%   ` Ananyev, Konstantin
  2021-09-15  9:45  0%     ` Jerin Jacob
  1 sibling, 1 reply; 200+ results
From: Ananyev, Konstantin @ 2021-09-14 13:33 UTC (permalink / raw)
  To: Jerin Jacob
  Cc: dpdk-dev, Thomas Monjalon, Yigit, Ferruh, Andrew Rybchenko, Yang,
	Qiming, Zhang, Qi Z, Xing, Beilei, techboard


Hi Jerin,

> > NOTE: This is just an RFC to start further discussion and collect the feedback.
> > Due to significant amount of work, changes required are applied only to two
> > PMDs so far: net/i40e and net/ice.
> > So to build it you'll need to add:
> > -Denable_drivers='common/*,mempool/*,net/ice,net/i40e'
> > to your config options.
> 
> >
> > That approach was selected to avoid(/minimize) possible performance losses.
> >
> > So far I done only limited amount functional and performance testing.
> > Didn't spot any functional problems, and performance numbers
> > remains the same before and after the patch on my box (testpmd, macswap fwd).
> 
> 
> Based on testing on octeonxt2. We see some regression in testpmd and
> bit on l3fwd too.
> 
> Without patch: 73.5mpps/core in testpmd iofwd
> With out patch: 72 5mpps/core in testpmd iofwd
> 
> Based on my understanding it is due to additional indirection.

From your patch below, it looks like not actually additional indirection,
but extra memory dereference - func and dev pointers are now stored
at different places. Plus the fact that now we dereference rte_eth_devices[]
data inside PMD function. Which probably prevents compiler and CPU to load
 rte_eth_devices[port_id].data and rte_eth_devices[port_id]. pre_tx_burst_cbs[queue_id]  
in advance before calling actual RX/TX function.
About your approach: I don’t mind to add extra opaque 'void *data' pointer,
but would prefer not to expose callback invocations code into inline function.
Main reason for that - I think it still need to be reworked to allow adding/removing 
callbacks without stopping the device. Something similar to what was done for cryptodev
callbacks. To be able to do that in future without another ABI breakage callbacks related part
needs to be kept internal.
Though what we probably can do: add two dynamic arrays of opaque pointers to  rte_eth_burst_api.
One for rx/tx queue data pointers, second for rx/tx callback pointers.
To be more specific, something like:

typedef uint16_t (*rte_eth_rx_burst_t)( void *rxq, struct rte_mbuf **rx_pkts, uint16_t nb_pkts, void *cbs);
typedef uint16_t (*rte_eth_tx_burst_t)(void *txq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts, void *cbs);
....

struct rte_eth_burst_api {
        rte_eth_rx_burst_t rx_pkt_burst;
        /**< PMD receive function. */
        rte_eth_tx_burst_t tx_pkt_burst;
        /**< PMD transmit function. */
        rte_eth_tx_prep_t tx_pkt_prepare;
        /**< PMD transmit prepare function. */
        rte_eth_rx_queue_count_t rx_queue_count;
        /**< Get the number of used RX descriptors. */
        rte_eth_rx_descriptor_status_t rx_descriptor_status;
        /**< Check the status of a Rx descriptor. */
        rte_eth_tx_descriptor_status_t tx_descriptor_status;
        /**< Check the status of a Tx descriptor. */
        struct {
                 void **queue_data;   /* point to rte_eth_devices[port_id].data-> rx_queues */
                 void **cbs;                  /*  points to rte_eth_devices[port_id].post_rx_burst_cbs */ 
       } rx_data, tx_data;
} __rte_cache_aligned;

static inline uint16_t
rte_eth_rx_burst(uint16_t port_id, uint16_t queue_id,
                 struct rte_mbuf **rx_pkts, const uint16_t nb_pkts)
{
       struct rte_eth_burst_api *p;

        if (port_id >= RTE_MAX_ETHPORTS || queue_id >= RTE_MAX_QUEUES_PER_PORT)
                return 0;
 
      p =  &rte_eth_burst_api[port_id];
      return p->rx_pkt_burst(p->rx_data.queue_data[queue_id], rx_pkts, nb_pkts, p->rx_data.cbs[queue_id]);
}

Same for TX.

If that looks ok to everyone, I'll try to prepare next version based on that.
In theory that should avoid extra dereference problem and even reduce indirection.
As a drawback data->rxq/txq should always be allocated for RTE_MAX_QUEUES_PER_PORT entries,
but I presume that’s not a big deal.

As a side question - is there any reason why rte_ethdev_trace_rx_burst() is invoked at very last point,
while rte_ethdev_trace_tx_burst()  after CBs but before actual tx_pkt_burst()?
It would make things simpler if tracng would always be done either on entrance or exit of rx/tx_burst.

> 
> My suggestion to fix the problem by:
> Removing the additional `data` redirection and pull callback function
> pointers back
> and keep rest as opaque as done in the existing patch like [1]
> 
> I don't believe this has any real implication on future ABI stability
> as we will not be adding
> any new item in rte_eth_fp in any way as new features can be added in slowpath
> rte_eth_dev as mentioned in the patch.
> 
> [2] is the patch of doing the same as I don't see any performance
> regression after [2].
> 
> 
> [1]
> - struct rte_eth_burst_api {
> - struct rte_eth_fp {
> + void *data;
>   rte_eth_rx_burst_t rx_pkt_burst;
>   /**< PMD receive function. */
>   rte_eth_tx_burst_t tx_pkt_burst;
> @@ -85,8 +100,19 @@ struct rte_eth_burst_api {
>   /**< Check the status of a Rx descriptor. */
>   rte_eth_tx_descriptor_status_t tx_descriptor_status;
>   /**< Check the status of a Tx descriptor. */
> + /**
> + * User-supplied functions called from rx_burst to post-process
> + * received packets before passing them to the user
> + */
> + struct rte_eth_rxtx_callback
> + *post_rx_burst_cbs[RTE_MAX_QUEUES_PER_PORT];
> + /**
> + * User-supplied functions called from tx_burst to pre-process
> + * received packets before passing them to the driver for transmission.
> + */
> + struct rte_eth_rxtx_callback *pre_tx_burst_cbs[RTE_MAX_QUEUES_PER_PORT];
>   uintptr_t reserved[2];
> -} __rte_cache_min_aligned;
> +} __rte_cache_aligned;
> 
> [2]
> https://pastebin.com/CuqkrCW4

^ permalink raw reply	[relevance 3%]

* [dpdk-dev] [PATCH v5 2/3] security: add option for faster udata or mdata access
  @ 2021-09-14 15:14  8%   ` Nithin Dabilpuram
  2021-09-15 14:33  0%     ` Ananyev, Konstantin
  0 siblings, 1 reply; 200+ results
From: Nithin Dabilpuram @ 2021-09-14 15:14 UTC (permalink / raw)
  To: konstantin.ananyev, jerinj, gakhil, roy.fan.zhang, hemant.agrawal, matan
  Cc: ndabilpuram, dev, ferruh.yigit, radu.nicolau, olivier.matz,
	g.singh, declan.doherty, jiawenwu

Currently rte_security_set_pkt_metadata() and rte_security_get_userdata()
methods to set pkt metadata on Inline outbound and get userdata
after Inline inbound processing is always driver specific callbacks.

For drivers that do not have much to do in the callbacks but just
to update metadata in rte_security dynamic field and get userdata
from rte_security dynamic field, having to just to PMD specific
callback is costly per packet operation. This patch provides
a mechanism to do the same in inline function and avoid function
pointer jump if a driver supports the same.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
---
 doc/guides/rel_notes/deprecation.rst   |  4 ---
 doc/guides/rel_notes/release_21_08.rst |  6 +++++
 lib/security/rte_security.c            |  8 +++---
 lib/security/rte_security.h            | 48 +++++++++++++++++++++++++++++++---
 lib/security/version.map               |  2 ++
 5 files changed, 56 insertions(+), 12 deletions(-)

diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index 59445a6..70ef45e 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -276,10 +276,6 @@ Deprecation Notices
   content. On Linux and FreeBSD, supported prior to DPDK 20.11,
   original structure will be kept until DPDK 21.11.
 
-* security: The functions ``rte_security_set_pkt_metadata`` and
-  ``rte_security_get_userdata`` will be made inline functions and additional
-  flags will be added in structure ``rte_security_ctx`` in DPDK 21.11.
-
 * cryptodev: The structure ``rte_crypto_op`` would be updated to reduce
   reserved bytes to 2 (from 3), and use 1 byte to indicate warnings and other
   information from the crypto/security operation. This field will be used to
diff --git a/doc/guides/rel_notes/release_21_08.rst b/doc/guides/rel_notes/release_21_08.rst
index b4cbf2d..59ff15a 100644
--- a/doc/guides/rel_notes/release_21_08.rst
+++ b/doc/guides/rel_notes/release_21_08.rst
@@ -223,6 +223,12 @@ ABI Changes
 
 * No ABI change that would break compatibility with 20.11.
 
+* security: ``rte_security_set_pkt_metadata`` and ``rte_security_get_userdata``
+  routines used by Inline outbound and Inline inbound security processing are
+  made inline and enhanced to do simple 64-bit set/get for PMD's that donot
+  have much processing in PMD specific callbacks but just 64-bit set/get.
+  This avoids a per-pkt function pointer jump overhead for such PMD's.
+
 
 Known Issues
 ------------
diff --git a/lib/security/rte_security.c b/lib/security/rte_security.c
index e8116d5..fe81ed3 100644
--- a/lib/security/rte_security.c
+++ b/lib/security/rte_security.c
@@ -122,9 +122,9 @@ rte_security_session_destroy(struct rte_security_ctx *instance,
 }
 
 int
-rte_security_set_pkt_metadata(struct rte_security_ctx *instance,
-			      struct rte_security_session *sess,
-			      struct rte_mbuf *m, void *params)
+__rte_security_set_pkt_metadata(struct rte_security_ctx *instance,
+				struct rte_security_session *sess,
+				struct rte_mbuf *m, void *params)
 {
 #ifdef RTE_DEBUG
 	RTE_PTR_OR_ERR_RET(sess, -EINVAL);
@@ -137,7 +137,7 @@ rte_security_set_pkt_metadata(struct rte_security_ctx *instance,
 }
 
 void *
-rte_security_get_userdata(struct rte_security_ctx *instance, uint64_t md)
+__rte_security_get_userdata(struct rte_security_ctx *instance, uint64_t md)
 {
 	void *userdata = NULL;
 
diff --git a/lib/security/rte_security.h b/lib/security/rte_security.h
index 2e136d7..3124134 100644
--- a/lib/security/rte_security.h
+++ b/lib/security/rte_security.h
@@ -71,8 +71,18 @@ struct rte_security_ctx {
 	/**< Pointer to security ops for the device */
 	uint16_t sess_cnt;
 	/**< Number of sessions attached to this context */
+	uint32_t flags;
+	/**< Flags for security context */
 };
 
+#define RTE_SEC_CTX_F_FAST_SET_MDATA 0x00000001
+/**< Driver uses fast metadata update without using driver specific callback */
+
+#define RTE_SEC_CTX_F_FAST_GET_UDATA 0x00000002
+/**< Driver provides udata using fast method without using driver specific
+ * callback.
+ */
+
 /**
  * IPSEC tunnel parameters
  *
@@ -494,6 +504,12 @@ static inline bool rte_security_dynfield_is_registered(void)
 	return rte_security_dynfield_offset >= 0;
 }
 
+/** Function to call PMD specific function pointer set_pkt_metadata() */
+__rte_experimental
+extern int __rte_security_set_pkt_metadata(struct rte_security_ctx *instance,
+					   struct rte_security_session *sess,
+					   struct rte_mbuf *m, void *params);
+
 /**
  *  Updates the buffer with device-specific defined metadata
  *
@@ -507,10 +523,26 @@ static inline bool rte_security_dynfield_is_registered(void)
  *  - On success, zero.
  *  - On failure, a negative value.
  */
-int
+static inline int
 rte_security_set_pkt_metadata(struct rte_security_ctx *instance,
 			      struct rte_security_session *sess,
-			      struct rte_mbuf *mb, void *params);
+			      struct rte_mbuf *mb, void *params)
+{
+	/* Fast Path */
+	if (instance->flags & RTE_SEC_CTX_F_FAST_SET_MDATA) {
+		*rte_security_dynfield(mb) =
+			(rte_security_dynfield_t)(sess->sess_private_data);
+		return 0;
+	}
+
+	/* Jump to PMD specific function pointer */
+	return __rte_security_set_pkt_metadata(instance, sess, mb, params);
+}
+
+/** Function to call PMD specific function pointer get_userdata() */
+__rte_experimental
+extern void *__rte_security_get_userdata(struct rte_security_ctx *instance,
+					 uint64_t md);
 
 /**
  * Get userdata associated with the security session. Device specific metadata
@@ -530,8 +562,16 @@ rte_security_set_pkt_metadata(struct rte_security_ctx *instance,
  *  - On failure, NULL
  */
 __rte_experimental
-void *
-rte_security_get_userdata(struct rte_security_ctx *instance, uint64_t md);
+static inline void *
+rte_security_get_userdata(struct rte_security_ctx *instance, uint64_t md)
+{
+	/* Fast Path */
+	if (instance->flags & RTE_SEC_CTX_F_FAST_GET_UDATA)
+		return (void *)(uintptr_t)md;
+
+	/* Jump to PMD specific function pointer */
+	return __rte_security_get_userdata(instance, md);
+}
 
 /**
  * Attach a session to a symmetric crypto operation
diff --git a/lib/security/version.map b/lib/security/version.map
index c44c7f5..45ace9c 100644
--- a/lib/security/version.map
+++ b/lib/security/version.map
@@ -20,4 +20,6 @@ EXPERIMENTAL {
 	rte_security_get_userdata;
 	rte_security_session_stats_get;
 	rte_security_session_update;
+	__rte_security_set_pkt_metadata;
+	__rte_security_get_userdata;
 };
-- 
2.8.4


^ permalink raw reply	[relevance 8%]

* Re: [dpdk-dev] [PATCH v2] ethdev: promote burst mode API to stable
  2021-09-06  6:36  0%   ` Andrew Rybchenko
@ 2021-09-15  8:46  0%     ` Ferruh Yigit
  0 siblings, 0 replies; 200+ results
From: Ferruh Yigit @ 2021-09-15  8:46 UTC (permalink / raw)
  To: Andrew Rybchenko, Haiyue Wang, dev; +Cc: Ray Kinsella, Thomas Monjalon

On 9/6/2021 7:36 AM, Andrew Rybchenko wrote:
> On 9/6/21 8:56 AM, Haiyue Wang wrote:
>> The DPDK Symbol Bot reports:
>> Please note the symbols listed below have expired. In line with the
>> DPDK ABI policy, they should be scheduled for removal, in the next
>> DPDK release.
>>
>> Symbol
>> rte_eth_rx_burst_mode_get
>> rte_eth_tx_burst_mode_get
>>
>> Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
>> Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
>> Acked-by: Ray Kinsella <mdr@ashroe.eu>
> 
> Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
> 

Applied to dpdk-next-net/main, thanks.

^ permalink raw reply	[relevance 0%]

* Re: [dpdk-dev] [RFC 0/7] hide eth dev related structures
  2021-09-14 13:33  3%   ` Ananyev, Konstantin
@ 2021-09-15  9:45  0%     ` Jerin Jacob
  0 siblings, 0 replies; 200+ results
From: Jerin Jacob @ 2021-09-15  9:45 UTC (permalink / raw)
  To: Ananyev, Konstantin
  Cc: dpdk-dev, Thomas Monjalon, Yigit, Ferruh, Andrew Rybchenko, Yang,
	Qiming, Zhang, Qi Z, Xing, Beilei, techboard

On Tue, Sep 14, 2021 at 7:03 PM Ananyev, Konstantin
<konstantin.ananyev@intel.com> wrote:
>
>
> Hi Jerin,
>
> > > NOTE: This is just an RFC to start further discussion and collect the feedback.
> > > Due to significant amount of work, changes required are applied only to two
> > > PMDs so far: net/i40e and net/ice.
> > > So to build it you'll need to add:
> > > -Denable_drivers='common/*,mempool/*,net/ice,net/i40e'
> > > to your config options.
> >
> > >
> > > That approach was selected to avoid(/minimize) possible performance losses.
> > >
> > > So far I done only limited amount functional and performance testing.
> > > Didn't spot any functional problems, and performance numbers
> > > remains the same before and after the patch on my box (testpmd, macswap fwd).
> >
> >
> > Based on testing on octeonxt2. We see some regression in testpmd and
> > bit on l3fwd too.
> >
> > Without patch: 73.5mpps/core in testpmd iofwd
> > With out patch: 72 5mpps/core in testpmd iofwd
> >
> > Based on my understanding it is due to additional indirection.
>
> From your patch below, it looks like not actually additional indirection,
> but extra memory dereference - func and dev pointers are now stored
> at different places.

Yup. I meant the same. We are on the same page.

> Plus the fact that now we dereference rte_eth_devices[]
> data inside PMD function. Which probably prevents compiler and CPU to load
>  rte_eth_devices[port_id].data and rte_eth_devices[port_id]. pre_tx_burst_cbs[queue_id]
> in advance before calling actual RX/TX function.

Yes.

> About your approach: I don’t mind to add extra opaque 'void *data' pointer,
> but would prefer not to expose callback invocations code into inline function.
> Main reason for that - I think it still need to be reworked to allow adding/removing
> callbacks without stopping the device. Something similar to what was done for cryptodev
> callbacks. To be able to do that in future without another ABI breakage callbacks related part
> needs to be kept internal.
> Though what we probably can do: add two dynamic arrays of opaque pointers to  rte_eth_burst_api.
> One for rx/tx queue data pointers, second for rx/tx callback pointers.
> To be more specific, something like:
>
> typedef uint16_t (*rte_eth_rx_burst_t)( void *rxq, struct rte_mbuf **rx_pkts, uint16_t nb_pkts, void *cbs);
> typedef uint16_t (*rte_eth_tx_burst_t)(void *txq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts, void *cbs);
> ....
>
> struct rte_eth_burst_api {
>         rte_eth_rx_burst_t rx_pkt_burst;
>         /**< PMD receive function. */
>         rte_eth_tx_burst_t tx_pkt_burst;
>         /**< PMD transmit function. */
>         rte_eth_tx_prep_t tx_pkt_prepare;
>         /**< PMD transmit prepare function. */
>         rte_eth_rx_queue_count_t rx_queue_count;
>         /**< Get the number of used RX descriptors. */
>         rte_eth_rx_descriptor_status_t rx_descriptor_status;
>         /**< Check the status of a Rx descriptor. */
>         rte_eth_tx_descriptor_status_t tx_descriptor_status;
>         /**< Check the status of a Tx descriptor. */
>         struct {
>                  void **queue_data;   /* point to rte_eth_devices[port_id].data-> rx_queues */
>                  void **cbs;                  /*  points to rte_eth_devices[port_id].post_rx_burst_cbs */
>        } rx_data, tx_data;
> } __rte_cache_aligned;
>
> static inline uint16_t
> rte_eth_rx_burst(uint16_t port_id, uint16_t queue_id,
>                  struct rte_mbuf **rx_pkts, const uint16_t nb_pkts)
> {
>        struct rte_eth_burst_api *p;
>
>         if (port_id >= RTE_MAX_ETHPORTS || queue_id >= RTE_MAX_QUEUES_PER_PORT)
>                 return 0;
>
>       p =  &rte_eth_burst_api[port_id];
>       return p->rx_pkt_burst(p->rx_data.queue_data[queue_id], rx_pkts, nb_pkts, p->rx_data.cbs[queue_id]);



That works.


> }
>
> Same for TX.
>
> If that looks ok to everyone, I'll try to prepare next version based on that.


Looks good to me.

> In theory that should avoid extra dereference problem and even reduce indirection.
> As a drawback data->rxq/txq should always be allocated for RTE_MAX_QUEUES_PER_PORT entries,
> but I presume that’s not a big deal.
>
> As a side question - is there any reason why rte_ethdev_trace_rx_burst() is invoked at very last point,
> while rte_ethdev_trace_tx_burst()  after CBs but before actual tx_pkt_burst()?
> It would make things simpler if tracng would always be done either on entrance or exit of rx/tx_burst.

exit is fine.

>
> >
> > My suggestion to fix the problem by:
> > Removing the additional `data` redirection and pull callback function
> > pointers back
> > and keep rest as opaque as done in the existing patch like [1]
> >
> > I don't believe this has any real implication on future ABI stability
> > as we will not be adding
> > any new item in rte_eth_fp in any way as new features can be added in slowpath
> > rte_eth_dev as mentioned in the patch.

Ack

I will happy to test again after the rework and report any performance
issues if any.

Thaks for the great work :-)


> >
> > [2] is the patch of doing the same as I don't see any performance
> > regression after [2].
> >
> >
> > [1]
> > - struct rte_eth_burst_api {
> > - struct rte_eth_fp {
> > + void *data;
> >   rte_eth_rx_burst_t rx_pkt_burst;
> >   /**< PMD receive function. */
> >   rte_eth_tx_burst_t tx_pkt_burst;
> > @@ -85,8 +100,19 @@ struct rte_eth_burst_api {
> >   /**< Check the status of a Rx descriptor. */
> >   rte_eth_tx_descriptor_status_t tx_descriptor_status;
> >   /**< Check the status of a Tx descriptor. */
> > + /**
> > + * User-supplied functions called from rx_burst to post-process
> > + * received packets before passing them to the user
> > + */
> > + struct rte_eth_rxtx_callback
> > + *post_rx_burst_cbs[RTE_MAX_QUEUES_PER_PORT];
> > + /**
> > + * User-supplied functions called from tx_burst to pre-process
> > + * received packets before passing them to the driver for transmission.
> > + */
> > + struct rte_eth_rxtx_callback *pre_tx_burst_cbs[RTE_MAX_QUEUES_PER_PORT];
> >   uintptr_t reserved[2];
> > -} __rte_cache_min_aligned;
> > +} __rte_cache_aligned;
> >
> > [2]
> > https://pastebin.com/CuqkrCW4

^ permalink raw reply	[relevance 0%]

* Re: [dpdk-dev] [PATCH 1/4] vhost: support async dequeue for split ring
       [not found]         ` <CO1PR11MB4897F3D5ABDE7133DB99791385DB9@CO1PR11MB4897.namprd11.prod.outlook.com>
@ 2021-09-15 11:35  3%       ` Xia, Chenbo
  0 siblings, 0 replies; 200+ results
From: Xia, Chenbo @ 2021-09-15 11:35 UTC (permalink / raw)
  To: Wang, YuanX, Ma, WenwuX, dev, maxime.coquelin
  Cc: Jiang, Cheng1, Hu, Jiayu, Pai G, Sunil, Yang, YvonneX, Wang, Yinan

Hi Maxime & Yuan,

> -----Original Message-----
> From: Wang, YuanX <yuanx.wang@intel.com>
> Sent: Wednesday, September 15, 2021 5:09 PM
> To: Xia, Chenbo <chenbo.xia@intel.com>; Ma, WenwuX <wenwux.ma@intel.com>;
> dev@dpdk.org
> Cc: maxime.coquelin@redhat.com; Jiang, Cheng1 <cheng1.jiang@intel.com>; Hu,
> Jiayu <jiayu.hu@intel.com>; Pai G, Sunil <sunil.pai.g@intel.com>; Yang,
> YvonneX <yvonnex.yang@intel.com>; Wang, Yinan <yinan.wang@intel.com>
> Subject: RE: [PATCH 1/4] vhost: support async dequeue for split ring
> 
> Hi Chenbo,
> 
> > -----Original Message-----
> > From: Xia, Chenbo <chenbo.xia@intel.com>
> > Sent: Wednesday, September 15, 2021 10:52 AM
> > To: Ma, WenwuX <wenwux.ma@intel.com>; dev@dpdk.org
> > Cc: maxime.coquelin@redhat.com; Jiang, Cheng1 <cheng1.jiang@intel.com>;
> > Hu, Jiayu <jiayu.hu@intel.com>; Pai G, Sunil <sunil.pai.g@intel.com>; Yang,
> > YvonneX <yvonnex.yang@intel.com>; Wang, YuanX
> > <yuanx.wang@intel.com>; Wang, Yinan <yinan.wang@intel.com>
> > Subject: RE: [PATCH 1/4] vhost: support async dequeue for split ring
> >
> > Hi,
> >
> > > -----Original Message-----
> > > From: Ma, WenwuX <wenwux.ma@intel.com>
> > > Sent: Tuesday, September 7, 2021 4:49 AM
> > > To: dev@dpdk.org
> > > Cc: maxime.coquelin@redhat.com; Xia, Chenbo <chenbo.xia@intel.com>;
> > > Jiang,
> > > Cheng1 <cheng1.jiang@intel.com>; Hu, Jiayu <jiayu.hu@intel.com>; Pai
> > > G, Sunil <sunil.pai.g@intel.com>; Yang, YvonneX
> > > <yvonnex.yang@intel.com>; Wang, YuanX <yuanx.wang@intel.com>; Ma,
> > > WenwuX <wenwux.ma@intel.com>; Wang, Yinan <yinan.wang@intel.com>
> > > Subject: [PATCH 1/4] vhost: support async dequeue for split ring
> > >
> > > From: Yuan Wang <yuanx.wang@intel.com>
> > >
> > > This patch implements asynchronous dequeue data path for split ring.
> > > A new asynchronous dequeue function is introduced. With this function,
> > > the application can try to receive packets from the guest with
> > > offloading copies to the async channel, thus saving precious CPU
> > > cycles.
> > >
> > > Signed-off-by: Yuan Wang <yuanx.wang@intel.com>
> > > Signed-off-by: Jiayu Hu <jiayu.hu@intel.com>
> > > Signed-off-by: Wenwu Ma <wenwux.ma@intel.com>
> > > Tested-by: Yinan Wang <yinan.wang@intel.com>
> > > ---
> > >  doc/guides/prog_guide/vhost_lib.rst |   9 +
> > >  lib/vhost/rte_vhost_async.h         |  36 +-
> > >  lib/vhost/version.map               |   3 +
> > >  lib/vhost/vhost.h                   |   3 +-
> > >  lib/vhost/virtio_net.c              | 531 ++++++++++++++++++++++++++++
> > >  5 files changed, 579 insertions(+), 3 deletions(-)
> > >
> > > diff --git a/doc/guides/prog_guide/vhost_lib.rst
> > > b/doc/guides/prog_guide/vhost_lib.rst
> > > index 171e0096f6..9ed544db7a 100644
> > > --- a/doc/guides/prog_guide/vhost_lib.rst
> > > +++ b/doc/guides/prog_guide/vhost_lib.rst
> > > @@ -303,6 +303,15 @@ The following is an overview of some key Vhost
> > > API
> > > functions:
> > >    Clear inflight packets which are submitted to DMA engine in vhost
> > > async data
> > >    path. Completed packets are returned to applications through ``pkts``.
> > >
> > > +* ``rte_vhost_async_try_dequeue_burst(vid, queue_id, mbuf_pool, pkts,
> > > +count,
> > > nr_inflight)``
> > > +
> > > +  This function tries to receive packets from the guest with
> > > + offloading  copies to the async channel. The packets that are
> > > + transfer completed  are returned in ``pkts``. The other packets that
> > > + their copies are submitted  to the async channel but not completed are
> > called "in-flight packets".
> > > +  This function will not return in-flight packets until their copies
> > > + are  completed by the async channel.
> > > +
> > >  Vhost-user Implementations
> > >  --------------------------
> > >
> > > diff --git a/lib/vhost/rte_vhost_async.h b/lib/vhost/rte_vhost_async.h
> > > index ad71555a7f..5e2429ab70 100644
> > > --- a/lib/vhost/rte_vhost_async.h
> > > +++ b/lib/vhost/rte_vhost_async.h
> > > @@ -83,12 +83,18 @@ struct rte_vhost_async_channel_ops {
> > >  		uint16_t max_packets);
> > >  };
> > >
> > > +struct async_nethdr {
> > > +	struct virtio_net_hdr hdr;
> > > +	bool valid;
> > > +};
> > > +
> >
> > As a struct exposed in public headers, it's better to prefix it with rte_.
> > In this case I would prefer rte_async_net_hdr.
> >
> > >  /**
> > > - * inflight async packet information
> > > + * in-flight async packet information
> > >   */
> > >  struct async_inflight_info {
> >
> > Could you help to rename it too? Like rte_async_inflight_info.
> 
> You are right, these two structs are for internal use and not suitable for
> exposure in the public header,
> but they are used for async channel, I think it's not suitable to be placed in
> other headers.
> Could you give some advice on which file to put them in?

@Maxime, What do you think of this? I think either changing it/renaming it/moving it
is ABI breakage. But since it's never used by any APP, I guess it's not big problem.
So what do you think we should do with the struct? I will vote for move it temporarily
to header like vhost.h. At some point, we can create a new internal async header for
structs like this. Or create it now?

@Yuan, I think again of the struct async_nethdr, do we really need to define this?
As for now, header being invalid only happens when virtio_net_with_host_offload(dev)
is false, right? So why not use this to know hdr invalid or not when you need to check?

Thanks,
Chenbo

> 
> >
> > >  	struct rte_mbuf *mbuf;
> > > -	uint16_t descs; /* num of descs inflight */
> > > +	struct async_nethdr nethdr;
> > > +	uint16_t descs; /* num of descs in-flight */
> > >  	uint16_t nr_buffers; /* num of buffers inflight for packed ring */
> > > };
> > >
> > > @@ -255,5 +261,31 @@ int rte_vhost_async_get_inflight(int vid,
> > > uint16_t queue_id);  __rte_experimental  uint16_t
> > > rte_vhost_clear_queue_thread_unsafe(int vid, uint16_t queue_id,
> > >  		struct rte_mbuf **pkts, uint16_t count);
> > > +/**
> > > + * This function tries to receive packets from the guest with
> > > +offloading
> > > + * copies to the async channel. The packets that are transfer
> > > +completed
> > > + * are returned in "pkts". The other packets that their copies are
> > > +submitted
> > > to
> > > + * the async channel but not completed are called "in-flight packets".
> > > + * This function will not return in-flight packets until their copies
> > > + are
> > > + * completed by the async channel.
> > > + *
> > > + * @param vid
> > > + *  id of vhost device to dequeue data
> > > + * @param queue_id
> > > + *  queue id to dequeue data
> >
> > Param mbuf_pool is missed.
> 
> Thanks, will fix it in next version.
> 
> Regards,
> Yuan
> 
> >
> > > + * @param pkts
> > > + *  blank array to keep successfully dequeued packets
> > > + * @param count
> > > + *  size of the packet array
> > > + * @param nr_inflight
> > > + *  the amount of in-flight packets. If error occurred, its value is
> > > + set to -
> > > 1.
> > > + * @return
> > > + *  num of successfully dequeued packets  */ __rte_experimental
> > > +uint16_t rte_vhost_async_try_dequeue_burst(int vid, uint16_t
> > > +queue_id,
> > > +	struct rte_mempool *mbuf_pool, struct rte_mbuf **pkts, uint16_t
> > count,
> > > +	int *nr_inflight);
> > >
> > >  #endif /* _RTE_VHOST_ASYNC_H_ */
> > > diff --git a/lib/vhost/version.map b/lib/vhost/version.map index
> > > c92a9d4962..1e033ad8e2 100644
> > > --- a/lib/vhost/version.map
> > > +++ b/lib/vhost/version.map
> > > @@ -85,4 +85,7 @@ EXPERIMENTAL {
> > >  	rte_vhost_async_channel_register_thread_unsafe;
> > >  	rte_vhost_async_channel_unregister_thread_unsafe;
> > >  	rte_vhost_clear_queue_thread_unsafe;
> > > +
> > > +	# added in 21.11
> > > +	rte_vhost_async_try_dequeue_burst;
> > >  };
> > > diff --git a/lib/vhost/vhost.h b/lib/vhost/vhost.h index
> > > 1e56311725..89a31e4ca8 100644
> > > --- a/lib/vhost/vhost.h
> > > +++ b/lib/vhost/vhost.h
> > > @@ -49,7 +49,8 @@
> >
> > [...]
> >
> > > +uint16_t
> > > +rte_vhost_async_try_dequeue_burst(int vid, uint16_t queue_id,
> > > +	struct rte_mempool *mbuf_pool, struct rte_mbuf **pkts, uint16_t
> > count,
> > > +	int *nr_inflight)
> > > +{
> > > +	struct virtio_net *dev;
> > > +	struct rte_mbuf *rarp_mbuf = NULL;
> > > +	struct vhost_virtqueue *vq;
> > > +	int16_t success = 1;
> > > +
> > > +	*nr_inflight = -1;
> > > +
> > > +	dev = get_device(vid);
> > > +	if (!dev)
> > > +		return 0;
> > > +
> > > +	if (unlikely(!(dev->flags & VIRTIO_DEV_BUILTIN_VIRTIO_NET))) {
> > > +		VHOST_LOG_DATA(ERR,
> > > +			"(%d) %s: built-in vhost net backend is disabled.\n",
> > > +			dev->vid, __func__);
> > > +		return 0;
> > > +	}
> > > +
> > > +	if (unlikely(!is_valid_virt_queue_idx(queue_id, 1, dev->nr_vring))) {
> > > +		VHOST_LOG_DATA(ERR,
> > > +			"(%d) %s: invalid virtqueue idx %d.\n",
> > > +			dev->vid, __func__, queue_id);
> > > +		return 0;
> > > +	}
> > > +
> > > +	vq = dev->virtqueue[queue_id];
> > > +
> > > +	if (unlikely(rte_spinlock_trylock(&vq->access_lock) == 0))
> > > +		return 0;
> > > +
> > > +	if (unlikely(vq->enabled == 0)) {
> > > +		count = 0;
> > > +		goto out_access_unlock;
> > > +	}
> > > +
> > > +	if (unlikely(!vq->async_registered)) {
> > > +		VHOST_LOG_DATA(ERR, "(%d) %s: async not registered for
> > queue
> > > id %d.\n",
> > > +			dev->vid, __func__, queue_id);
> > > +		count = 0;
> > > +		goto out_access_unlock;
> > > +	}
> > > +
> > > +	if (dev->features & (1ULL << VIRTIO_F_IOMMU_PLATFORM))
> > > +		vhost_user_iotlb_rd_lock(vq);
> > > +
> > > +	if (unlikely(vq->access_ok == 0))
> > > +		if (unlikely(vring_translate(dev, vq) < 0)) {
> > > +			count = 0;
> > > +			goto out_access_unlock;
> > > +		}
> > > +
> > > +	/*
> > > +	 * Construct a RARP broadcast packet, and inject it to the "pkts"
> > > +	 * array, to looks like that guest actually send such packet.
> > > +	 *
> > > +	 * Check user_send_rarp() for more information.
> > > +	 *
> > > +	 * broadcast_rarp shares a cacheline in the virtio_net structure
> > > +	 * with some fields that are accessed during enqueue and
> > > +	 * __atomic_compare_exchange_n causes a write if performed
> > compare
> > > +	 * and exchange. This could result in false sharing between enqueue
> > > +	 * and dequeue.
> > > +	 *
> > > +	 * Prevent unnecessary false sharing by reading broadcast_rarp first
> > > +	 * and only performing compare and exchange if the read indicates it
> > > +	 * is likely to be set.
> > > +	 */
> > > +	if (unlikely(__atomic_load_n(&dev->broadcast_rarp,
> > __ATOMIC_ACQUIRE) &&
> > > +			__atomic_compare_exchange_n(&dev-
> > >broadcast_rarp,
> > > +			&success, 0, 0, __ATOMIC_RELEASE,
> > __ATOMIC_RELAXED))) {
> > > +
> > > +		rarp_mbuf = rte_net_make_rarp_packet(mbuf_pool, &dev-
> > >mac);
> > > +		if (rarp_mbuf == NULL) {
> > > +			VHOST_LOG_DATA(ERR, "Failed to make RARP
> > packet.\n");
> > > +			count = 0;
> > > +			goto out;
> > > +		}
> > > +		count -= 1;
> > > +	}
> > > +
> > > +	if (unlikely(vq_is_packed(dev)))
> > > +		return 0;
> >
> > Should add a log here.
> >
> > Thanks,
> > Chenbo

^ permalink raw reply	[relevance 3%]

* Re: [dpdk-dev] [PATCH v1 0/7] make rte_intr_handle internal
  2021-09-03 12:40  4% ` [dpdk-dev] [PATCH v1 " Harman Kalra
  2021-09-03 12:40  1%   ` [dpdk-dev] [PATCH v1 3/7] eal/interrupts: avoid direct access to interrupt handle Harman Kalra
@ 2021-09-15 14:13  0%   ` Harman Kalra
  1 sibling, 0 replies; 200+ results
From: Harman Kalra @ 2021-09-15 14:13 UTC (permalink / raw)
  To: dev

Ping...
Kindly review the series. Also would like to request PMD maintainers(who uses interrupt APIs) to validate the series for their respective drivers, 
as many drivers underwent interrupt related changes in patch 5 of the series.

Thanks
Harman

> -----Original Message-----
> From: Harman Kalra <hkalra@marvell.com>
> Sent: Friday, September 3, 2021 6:11 PM
> To: dev@dpdk.org
> Cc: Harman Kalra <hkalra@marvell.com>
> Subject: [PATCH v1 0/7] make rte_intr_handle internal
> 
> Moving struct rte_intr_handle as an internal structure to avoid any ABI
> breakages in future. Since this structure defines some static arrays and
> changing respective macros breaks the ABI.
> Eg:
> Currently RTE_MAX_RXTX_INTR_VEC_ID imposes a limit of maximum 512
> MSI-X interrupts that can be defined for a PCI device, while PCI specification
> allows maximum 2048 MSI-X interrupts that can be used.
> If some PCI device requires more than 512 vectors, either change the
> RTE_MAX_RXTX_INTR_VEC_ID limit or dynamically allocate based on PCI
> device MSI-X size on probe time. Either way its an ABI breakage.
> 
> Change already included in 21.11 ABI improvement spreadsheet (item 42):
> https://urldefense.proofpoint.com/v2/url?u=https-3A__docs.google.com_s
> preadsheets_d_1betlC000ua5SsSiJIcC54mCCCJnW6voH5Dqv9UxeyfE_edit-
> 23gid-
> 3D0&d=DwICaQ&c=nKjWec2b6R0mOyPaz7xtfQ&r=5ESHPj7V-
> 7JdkxT_Z_SU6RrS37ys4U
> XudBQ_rrS5LRo&m=7dl3OmXU7QHMmWYB6V1hYJtq1cUkjfhXUwze2Si_48c
> &s=lh6DEGhR
> Bg1shODpAy3RQk-H-0uQx5icRfUBf9dtCp4&e=
> 
> 
> This series makes struct rte_intr_handle totally opaque to the outside world
> by wrapping it inside a .c file and providing get set wrapper APIs to read or
> manipulate its fields.. Any changes to be made to any of the fields should be
> done via these get set APIs.
> Introduced a new eal_common_interrupts.c where all these APIs are
> defined and also hides struct rte_intr_handle definition.
> 
> Details on each patch of the series:
> Patch 1: eal: interrupt handle API prototypes This patch provides prototypes
> of all the new get set APIs, and also rearranges the headers related to
> interrupt framework. Epoll related definitions prototypes are moved into a
> new header i.e.
> rte_epoll.h and APIs defined in rte_eal_interrupts.h which were driver
> specific are moved to rte_interrupts.h (as anyways it was accessible and used
> outside DPDK library. Later in the series rte_eal_interrupts.h is removed.
> 
> Patch 2: eal/interrupts: implement get set APIs Implementing all get, set and
> alloc APIs. Alloc APIs are implemented to allocate memory for interrupt
> handle instance. Currently most of the drivers defines interrupt handle
> instance as static but now it cant be static as size of rte_intr_handle is
> unknown to all the drivers.
> Drivers are expected to allocate interrupt instances during initialization and
> free these instances during cleanup phase.
> 
> Patch 3: eal/interrupts: avoid direct access to interrupt handle Modifying the
> interrupt framework for linux and freebsd to use these get set alloc APIs as
> per requirement and avoid accessing the fields directly.
> 
> Patch 4: test/interrupt: apply get set interrupt handle APIs Updating
> interrupt test suite to use interrupt handle APIs.
> 
> Patch 5: drivers: remove direct access to interrupt handle fields Modifying all
> the drivers and libraries which are currently directly accessing the interrupt
> handle fields. Drivers are expected to allocated the interrupt instance, use
> get set APIs with the allocated interrupt handle and free it on cleanup.
> 
> Patch 6: eal/interrupts: make interrupt handle structure opaque In this patch
> rte_eal_interrupt.h is removed, struct rte_intr_handle definition is moved to
> c file to make it completely opaque. As part of interrupt handle allocation,
> array like efds and elist(which are currently
> static) are dynamically allocated with default size
> (RTE_MAX_RXTX_INTR_VEC_ID). Later these arrays can be reallocated as per
> device requirement using new API rte_intr_handle_event_list_update().
> Eg, on PCI device probing MSIX size can be queried and these arrays can be
> reallocated accordingly.
> 
> Patch 7: eal/alarm: introduce alarm fini routine Introducing alarm fini routine,
> as the memory allocated for alarm interrupt instance can be freed in alarm
> fini.
> 
> Testing performed:
> 1. Validated the series by running interrupts and alarm test suite.
> 2. Validate l3fwd power functionality with octeontx2 and i40e intel cards,
>    where interrupts are expected on packet arrival.
> 
> v1:
> * Fixed freebsd compilation failure
> * Fixed seg fault in case of memif
> 
> Harman Kalra (7):
>   eal: interrupt handle API prototypes
>   eal/interrupts: implement get set APIs
>   eal/interrupts: avoid direct access to interrupt handle
>   test/interrupt: apply get set interrupt handle APIs
>   drivers: remove direct access to interrupt handle fields
>   eal/interrupts: make interrupt handle structure opaque
>   eal/alarm: introduce alarm fini routine
> 
>  MAINTAINERS                                   |   1 +
>  app/test/test_interrupts.c                    | 237 +++---
>  drivers/baseband/acc100/rte_acc100_pmd.c      |  18 +-
>  .../fpga_5gnr_fec/rte_fpga_5gnr_fec.c         |  13 +-
>  drivers/baseband/fpga_lte_fec/fpga_lte_fec.c  |  14 +-
>  drivers/bus/auxiliary/auxiliary_common.c      |   2 +
>  drivers/bus/auxiliary/linux/auxiliary.c       |  11 +
>  drivers/bus/auxiliary/rte_bus_auxiliary.h     |   2 +-
>  drivers/bus/dpaa/dpaa_bus.c                   |  28 +-
>  drivers/bus/dpaa/rte_dpaa_bus.h               |   2 +-
>  drivers/bus/fslmc/fslmc_bus.c                 |  17 +-
>  drivers/bus/fslmc/fslmc_vfio.c                |  32 +-
>  drivers/bus/fslmc/portal/dpaa2_hw_dpio.c      |  21 +-
>  drivers/bus/fslmc/portal/dpaa2_hw_pvt.h       |   2 +-
>  drivers/bus/fslmc/rte_fslmc.h                 |   2 +-
>  drivers/bus/ifpga/ifpga_bus.c                 |  16 +-
>  drivers/bus/ifpga/rte_bus_ifpga.h             |   2 +-
>  drivers/bus/pci/bsd/pci.c                     |  21 +-
>  drivers/bus/pci/linux/pci.c                   |   4 +-
>  drivers/bus/pci/linux/pci_uio.c               |  73 +-
>  drivers/bus/pci/linux/pci_vfio.c              | 115 ++-
>  drivers/bus/pci/pci_common.c                  |  29 +-
>  drivers/bus/pci/pci_common_uio.c              |  21 +-
>  drivers/bus/pci/rte_bus_pci.h                 |   4 +-
>  drivers/bus/vmbus/linux/vmbus_bus.c           |   7 +
>  drivers/bus/vmbus/linux/vmbus_uio.c           |  37 +-
>  drivers/bus/vmbus/rte_bus_vmbus.h             |   2 +-
>  drivers/bus/vmbus/vmbus_common_uio.c          |  24 +-
>  drivers/common/cnxk/roc_cpt.c                 |   8 +-
>  drivers/common/cnxk/roc_dev.c                 |  14 +-
>  drivers/common/cnxk/roc_irq.c                 | 106 +--
>  drivers/common/cnxk/roc_nix_irq.c             |  37 +-
>  drivers/common/cnxk/roc_npa.c                 |   2 +-
>  drivers/common/cnxk/roc_platform.h            |  34 +
>  drivers/common/cnxk/roc_sso.c                 |   4 +-
>  drivers/common/cnxk/roc_tim.c                 |   4 +-
>  drivers/common/octeontx2/otx2_dev.c           |  14 +-
>  drivers/common/octeontx2/otx2_irq.c           | 117 +--
>  .../octeontx2/otx2_cryptodev_hw_access.c      |   4 +-
>  drivers/event/octeontx2/otx2_evdev_irq.c      |  12 +-
>  drivers/mempool/octeontx2/otx2_mempool.c      |   2 +-
>  drivers/net/atlantic/atl_ethdev.c             |  22 +-
>  drivers/net/avp/avp_ethdev.c                  |   8 +-
>  drivers/net/axgbe/axgbe_ethdev.c              |  12 +-
>  drivers/net/axgbe/axgbe_mdio.c                |   6 +-
>  drivers/net/bnx2x/bnx2x_ethdev.c              |  10 +-
>  drivers/net/bnxt/bnxt_ethdev.c                |  32 +-
>  drivers/net/bnxt/bnxt_irq.c                   |   4 +-
>  drivers/net/dpaa/dpaa_ethdev.c                |  47 +-
>  drivers/net/dpaa2/dpaa2_ethdev.c              |  10 +-
>  drivers/net/e1000/em_ethdev.c                 |  24 +-
>  drivers/net/e1000/igb_ethdev.c                |  84 ++-
>  drivers/net/ena/ena_ethdev.c                  |  36 +-
>  drivers/net/enic/enic_main.c                  |  27 +-
>  drivers/net/failsafe/failsafe.c               |  24 +-
>  drivers/net/failsafe/failsafe_intr.c          |  45 +-
>  drivers/net/failsafe/failsafe_ops.c           |  23 +-
>  drivers/net/failsafe/failsafe_private.h       |   2 +-
>  drivers/net/fm10k/fm10k_ethdev.c              |  32 +-
>  drivers/net/hinic/hinic_pmd_ethdev.c          |  10 +-
>  drivers/net/hns3/hns3_ethdev.c                |  50 +-
>  drivers/net/hns3/hns3_ethdev_vf.c             |  57 +-
>  drivers/net/hns3/hns3_rxtx.c                  |   2 +-
>  drivers/net/i40e/i40e_ethdev.c                |  55 +-
>  drivers/net/i40e/i40e_ethdev_vf.c             |  43 +-
>  drivers/net/iavf/iavf_ethdev.c                |  41 +-
>  drivers/net/iavf/iavf_vchnl.c                 |   4 +-
>  drivers/net/ice/ice_dcf.c                     |  10 +-
>  drivers/net/ice/ice_dcf_ethdev.c              |  23 +-
>  drivers/net/ice/ice_ethdev.c                  |  51 +-
>  drivers/net/igc/igc_ethdev.c                  |  47 +-
>  drivers/net/ionic/ionic_ethdev.c              |  12 +-
>  drivers/net/ixgbe/ixgbe_ethdev.c              |  70 +-
>  drivers/net/memif/memif_socket.c              | 114 ++-
>  drivers/net/memif/memif_socket.h              |   4 +-
>  drivers/net/memif/rte_eth_memif.c             |  63 +-
>  drivers/net/memif/rte_eth_memif.h             |   2 +-
>  drivers/net/mlx4/mlx4.c                       |  20 +-
>  drivers/net/mlx4/mlx4.h                       |   2 +-
>  drivers/net/mlx4/mlx4_intr.c                  |  48 +-
>  drivers/net/mlx5/linux/mlx5_os.c              |  56 +-
>  drivers/net/mlx5/linux/mlx5_socket.c          |  26 +-
>  drivers/net/mlx5/mlx5.h                       |   6 +-
>  drivers/net/mlx5/mlx5_rxq.c                   |  43 +-
>  drivers/net/mlx5/mlx5_trigger.c               |   4 +-
>  drivers/net/mlx5/mlx5_txpp.c                  |  27 +-
>  drivers/net/netvsc/hn_ethdev.c                |   4 +-
>  drivers/net/nfp/nfp_common.c                  |  28 +-
>  drivers/net/nfp/nfp_ethdev.c                  |  13 +-
>  drivers/net/nfp/nfp_ethdev_vf.c               |  13 +-
>  drivers/net/ngbe/ngbe_ethdev.c                |  31 +-
>  drivers/net/octeontx2/otx2_ethdev_irq.c       |  35 +-
>  drivers/net/qede/qede_ethdev.c                |  16 +-
>  drivers/net/sfc/sfc_intr.c                    |  29 +-
>  drivers/net/tap/rte_eth_tap.c                 |  37 +-
>  drivers/net/tap/rte_eth_tap.h                 |   2 +-
>  drivers/net/tap/tap_intr.c                    |  33 +-
>  drivers/net/thunderx/nicvf_ethdev.c           |  13 +
>  drivers/net/thunderx/nicvf_struct.h           |   2 +-
>  drivers/net/txgbe/txgbe_ethdev.c              |  36 +-
>  drivers/net/txgbe/txgbe_ethdev_vf.c           |  35 +-
>  drivers/net/vhost/rte_eth_vhost.c             |  78 +-
>  drivers/net/virtio/virtio_ethdev.c            |  17 +-
>  .../net/virtio/virtio_user/virtio_user_dev.c  |  53 +-
>  drivers/net/vmxnet3/vmxnet3_ethdev.c          |  45 +-
>  drivers/raw/ifpga/ifpga_rawdev.c              |  42 +-
>  drivers/raw/ntb/ntb.c                         |  10 +-
>  .../regex/octeontx2/otx2_regexdev_hw_access.c |   4 +-
>  drivers/vdpa/ifc/ifcvf_vdpa.c                 |   5 +-
>  drivers/vdpa/mlx5/mlx5_vdpa.c                 |  11 +
>  drivers/vdpa/mlx5/mlx5_vdpa.h                 |   4 +-
>  drivers/vdpa/mlx5/mlx5_vdpa_event.c           |  22 +-
>  drivers/vdpa/mlx5/mlx5_vdpa_virtq.c           |  46 +-
>  lib/bbdev/rte_bbdev.c                         |   4 +-
>  lib/eal/common/eal_common_interrupts.c        | 668 +++++++++++++++++
>  lib/eal/common/eal_private.h                  |  11 +
>  lib/eal/common/meson.build                    |   2 +
>  lib/eal/freebsd/eal.c                         |   1 +
>  lib/eal/freebsd/eal_alarm.c                   |  56 +-
>  lib/eal/freebsd/eal_interrupts.c              |  94 ++-
>  lib/eal/include/meson.build                   |   2 +-
>  lib/eal/include/rte_eal_interrupts.h          | 269 -------
>  lib/eal/include/rte_eal_trace.h               |  24 +-
>  lib/eal/include/rte_epoll.h                   | 116 +++
>  lib/eal/include/rte_interrupts.h              | 673 +++++++++++++++++-
>  lib/eal/linux/eal.c                           |   1 +
>  lib/eal/linux/eal_alarm.c                     |  39 +-
>  lib/eal/linux/eal_dev.c                       |  65 +-
>  lib/eal/linux/eal_interrupts.c                | 294 +++++---
>  lib/eal/version.map                           |  30 +
>  lib/ethdev/ethdev_pci.h                       |   2 +-
>  lib/ethdev/rte_ethdev.c                       |  14 +-
>  132 files changed, 3797 insertions(+), 1685 deletions(-)  create mode 100644
> lib/eal/common/eal_common_interrupts.c
>  delete mode 100644 lib/eal/include/rte_eal_interrupts.h
>  create mode 100644 lib/eal/include/rte_epoll.h
> 
> --
> 2.18.0


^ permalink raw reply	[relevance 0%]

* Re: [dpdk-dev] [PATCH v5 2/3] security: add option for faster udata or mdata access
  2021-09-14 15:14  8%   ` [dpdk-dev] [PATCH v5 2/3] security: add option for faster udata or mdata access Nithin Dabilpuram
@ 2021-09-15 14:33  0%     ` Ananyev, Konstantin
  0 siblings, 0 replies; 200+ results
From: Ananyev, Konstantin @ 2021-09-15 14:33 UTC (permalink / raw)
  To: Nithin Dabilpuram, jerinj, gakhil, Zhang, Roy Fan, hemant.agrawal, matan
  Cc: dev, Yigit, Ferruh, Nicolau, Radu, olivier.matz, g.singh,
	Doherty, Declan, jiawenwu


> 
> Currently rte_security_set_pkt_metadata() and rte_security_get_userdata()
> methods to set pkt metadata on Inline outbound and get userdata
> after Inline inbound processing is always driver specific callbacks.
> 
> For drivers that do not have much to do in the callbacks but just
> to update metadata in rte_security dynamic field and get userdata
> from rte_security dynamic field, having to just to PMD specific
> callback is costly per packet operation. This patch provides
> a mechanism to do the same in inline function and avoid function
> pointer jump if a driver supports the same.
> 
> Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
> Acked-by: Akhil Goyal <gakhil@marvell.com>
> ---
>  doc/guides/rel_notes/deprecation.rst   |  4 ---
>  doc/guides/rel_notes/release_21_08.rst |  6 +++++
>  lib/security/rte_security.c            |  8 +++---
>  lib/security/rte_security.h            | 48 +++++++++++++++++++++++++++++++---
>  lib/security/version.map               |  2 ++
>  5 files changed, 56 insertions(+), 12 deletions(-)
> 
> diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
> index 59445a6..70ef45e 100644
> --- a/doc/guides/rel_notes/deprecation.rst
> +++ b/doc/guides/rel_notes/deprecation.rst
> @@ -276,10 +276,6 @@ Deprecation Notices
>    content. On Linux and FreeBSD, supported prior to DPDK 20.11,
>    original structure will be kept until DPDK 21.11.
> 
> -* security: The functions ``rte_security_set_pkt_metadata`` and
> -  ``rte_security_get_userdata`` will be made inline functions and additional
> -  flags will be added in structure ``rte_security_ctx`` in DPDK 21.11.
> -
>  * cryptodev: The structure ``rte_crypto_op`` would be updated to reduce
>    reserved bytes to 2 (from 3), and use 1 byte to indicate warnings and other
>    information from the crypto/security operation. This field will be used to
> diff --git a/doc/guides/rel_notes/release_21_08.rst b/doc/guides/rel_notes/release_21_08.rst
> index b4cbf2d..59ff15a 100644
> --- a/doc/guides/rel_notes/release_21_08.rst
> +++ b/doc/guides/rel_notes/release_21_08.rst
> @@ -223,6 +223,12 @@ ABI Changes
> 
>  * No ABI change that would break compatibility with 20.11.
> 
> +* security: ``rte_security_set_pkt_metadata`` and ``rte_security_get_userdata``
> +  routines used by Inline outbound and Inline inbound security processing are
> +  made inline and enhanced to do simple 64-bit set/get for PMD's that donot
> +  have much processing in PMD specific callbacks but just 64-bit set/get.
> +  This avoids a per-pkt function pointer jump overhead for such PMD's.
> +
> 
>  Known Issues
>  ------------
> diff --git a/lib/security/rte_security.c b/lib/security/rte_security.c
> index e8116d5..fe81ed3 100644
> --- a/lib/security/rte_security.c
> +++ b/lib/security/rte_security.c
> @@ -122,9 +122,9 @@ rte_security_session_destroy(struct rte_security_ctx *instance,
>  }
> 
>  int
> -rte_security_set_pkt_metadata(struct rte_security_ctx *instance,
> -			      struct rte_security_session *sess,
> -			      struct rte_mbuf *m, void *params)
> +__rte_security_set_pkt_metadata(struct rte_security_ctx *instance,
> +				struct rte_security_session *sess,
> +				struct rte_mbuf *m, void *params)
>  {
>  #ifdef RTE_DEBUG
>  	RTE_PTR_OR_ERR_RET(sess, -EINVAL);
> @@ -137,7 +137,7 @@ rte_security_set_pkt_metadata(struct rte_security_ctx *instance,
>  }
> 
>  void *
> -rte_security_get_userdata(struct rte_security_ctx *instance, uint64_t md)
> +__rte_security_get_userdata(struct rte_security_ctx *instance, uint64_t md)
>  {
>  	void *userdata = NULL;
> 
> diff --git a/lib/security/rte_security.h b/lib/security/rte_security.h
> index 2e136d7..3124134 100644
> --- a/lib/security/rte_security.h
> +++ b/lib/security/rte_security.h
> @@ -71,8 +71,18 @@ struct rte_security_ctx {
>  	/**< Pointer to security ops for the device */
>  	uint16_t sess_cnt;
>  	/**< Number of sessions attached to this context */
> +	uint32_t flags;
> +	/**< Flags for security context */
>  };
> 
> +#define RTE_SEC_CTX_F_FAST_SET_MDATA 0x00000001
> +/**< Driver uses fast metadata update without using driver specific callback */

Probably worth to mention somewhere that it is driver responsibility to call 
rte_security_dynfield_register() to expose that flag.

> +
> +#define RTE_SEC_CTX_F_FAST_GET_UDATA 0x00000002
> +/**< Driver provides udata using fast method without using driver specific
> + * callback.
> + */
> +
>  /**
>   * IPSEC tunnel parameters
>   *
> @@ -494,6 +504,12 @@ static inline bool rte_security_dynfield_is_registered(void)
>  	return rte_security_dynfield_offset >= 0;
>  }
> 
> +/** Function to call PMD specific function pointer set_pkt_metadata() */
> +__rte_experimental
> +extern int __rte_security_set_pkt_metadata(struct rte_security_ctx *instance,
> +					   struct rte_security_session *sess,
> +					   struct rte_mbuf *m, void *params);
> +
>  /**
>   *  Updates the buffer with device-specific defined metadata
>   *
> @@ -507,10 +523,26 @@ static inline bool rte_security_dynfield_is_registered(void)
>   *  - On success, zero.
>   *  - On failure, a negative value.
>   */
> -int
> +static inline int
>  rte_security_set_pkt_metadata(struct rte_security_ctx *instance,
>  			      struct rte_security_session *sess,
> -			      struct rte_mbuf *mb, void *params);
> +			      struct rte_mbuf *mb, void *params)
> +{
> +	/* Fast Path */
> +	if (instance->flags & RTE_SEC_CTX_F_FAST_SET_MDATA) {
> +		*rte_security_dynfield(mb) =
> +			(rte_security_dynfield_t)(sess->sess_private_data);
> +		return 0;
> +	}
> +
> +	/* Jump to PMD specific function pointer */
> +	return __rte_security_set_pkt_metadata(instance, sess, mb, params);
> +}
> +
> +/** Function to call PMD specific function pointer get_userdata() */
> +__rte_experimental
> +extern void *__rte_security_get_userdata(struct rte_security_ctx *instance,
> +					 uint64_t md);
> 
>  /**
>   * Get userdata associated with the security session. Device specific metadata
> @@ -530,8 +562,16 @@ rte_security_set_pkt_metadata(struct rte_security_ctx *instance,
>   *  - On failure, NULL
>   */
>  __rte_experimental
> -void *
> -rte_security_get_userdata(struct rte_security_ctx *instance, uint64_t md);
> +static inline void *
> +rte_security_get_userdata(struct rte_security_ctx *instance, uint64_t md)
> +{
> +	/* Fast Path */
> +	if (instance->flags & RTE_SEC_CTX_F_FAST_GET_UDATA)
> +		return (void *)(uintptr_t)md;
> +
> +	/* Jump to PMD specific function pointer */
> +	return __rte_security_get_userdata(instance, md);
> +}
> 
>  /**
>   * Attach a session to a symmetric crypto operation
> diff --git a/lib/security/version.map b/lib/security/version.map
> index c44c7f5..45ace9c 100644
> --- a/lib/security/version.map
> +++ b/lib/security/version.map
> @@ -20,4 +20,6 @@ EXPERIMENTAL {
>  	rte_security_get_userdata;
>  	rte_security_session_stats_get;
>  	rte_security_session_update;
> +	__rte_security_set_pkt_metadata;
> +	__rte_security_get_userdata;
>  };
> --
> 2.8.4

Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>


^ permalink raw reply	[relevance 0%]

* Re: [dpdk-dev] [PATCH v2 01/15] ethdev: introduce shared Rx queue
  @ 2021-09-15 14:45  0%                     ` Xueming(Steven) Li
  2021-09-16  4:16  0%                       ` Jerin Jacob
  0 siblings, 1 reply; 200+ results
From: Xueming(Steven) Li @ 2021-09-15 14:45 UTC (permalink / raw)
  To: jerinjacobk
  Cc: NBU-Contact-Thomas Monjalon, andrew.rybchenko, dev, ferruh.yigit

Hi Jerin,

On Mon, 2021-08-30 at 15:01 +0530, Jerin Jacob wrote:
> On Sat, Aug 28, 2021 at 7:46 PM Xueming(Steven) Li <xuemingl@nvidia.com> wrote:
> > 
> > 
> > 
> > > -----Original Message-----
> > > From: Jerin Jacob <jerinjacobk@gmail.com>
> > > Sent: Thursday, August 26, 2021 7:58 PM
> > > To: Xueming(Steven) Li <xuemingl@nvidia.com>
> > > Cc: dpdk-dev <dev@dpdk.org>; Ferruh Yigit <ferruh.yigit@intel.com>; NBU-Contact-Thomas Monjalon <thomas@monjalon.net>;
> > > Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
> > > Subject: Re: [PATCH v2 01/15] ethdev: introduce shared Rx queue
> > > 
> > > On Thu, Aug 19, 2021 at 5:39 PM Xueming(Steven) Li <xuemingl@nvidia.com> wrote:
> > > > 
> > > > 
> > > > 
> > > > > -----Original Message-----
> > > > > From: Jerin Jacob <jerinjacobk@gmail.com>
> > > > > Sent: Thursday, August 19, 2021 1:27 PM
> > > > > To: Xueming(Steven) Li <xuemingl@nvidia.com>
> > > > > Cc: dpdk-dev <dev@dpdk.org>; Ferruh Yigit <ferruh.yigit@intel.com>;
> > > > > NBU-Contact-Thomas Monjalon <thomas@monjalon.net>; Andrew Rybchenko
> > > > > <andrew.rybchenko@oktetlabs.ru>
> > > > > Subject: Re: [PATCH v2 01/15] ethdev: introduce shared Rx queue
> > > > > 
> > > > > On Wed, Aug 18, 2021 at 4:44 PM Xueming(Steven) Li <xuemingl@nvidia.com> wrote:
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > > -----Original Message-----
> > > > > > > From: Jerin Jacob <jerinjacobk@gmail.com>
> > > > > > > Sent: Tuesday, August 17, 2021 11:12 PM
> > > > > > > To: Xueming(Steven) Li <xuemingl@nvidia.com>
> > > > > > > Cc: dpdk-dev <dev@dpdk.org>; Ferruh Yigit
> > > > > > > <ferruh.yigit@intel.com>; NBU-Contact-Thomas Monjalon
> > > > > > > <thomas@monjalon.net>; Andrew Rybchenko
> > > > > > > <andrew.rybchenko@oktetlabs.ru>
> > > > > > > Subject: Re: [PATCH v2 01/15] ethdev: introduce shared Rx queue
> > > > > > > 
> > > > > > > On Tue, Aug 17, 2021 at 5:01 PM Xueming(Steven) Li <xuemingl@nvidia.com> wrote:
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > > -----Original Message-----
> > > > > > > > > From: Jerin Jacob <jerinjacobk@gmail.com>
> > > > > > > > > Sent: Tuesday, August 17, 2021 5:33 PM
> > > > > > > > > To: Xueming(Steven) Li <xuemingl@nvidia.com>
> > > > > > > > > Cc: dpdk-dev <dev@dpdk.org>; Ferruh Yigit
> > > > > > > > > <ferruh.yigit@intel.com>; NBU-Contact-Thomas Monjalon
> > > > > > > > > <thomas@monjalon.net>; Andrew Rybchenko
> > > > > > > > > <andrew.rybchenko@oktetlabs.ru>
> > > > > > > > > Subject: Re: [PATCH v2 01/15] ethdev: introduce shared Rx
> > > > > > > > > queue
> > > > > > > > > 
> > > > > > > > > On Wed, Aug 11, 2021 at 7:34 PM Xueming Li <xuemingl@nvidia.com> wrote:
> > > > > > > > > > 
> > > > > > > > > > In current DPDK framework, each RX queue is pre-loaded
> > > > > > > > > > with mbufs for incoming packets. When number of
> > > > > > > > > > representors scale out in a switch domain, the memory
> > > > > > > > > > consumption became significant. Most important, polling
> > > > > > > > > > all ports leads to high cache miss, high latency and low throughput.
> > > > > > > > > > 
> > > > > > > > > > This patch introduces shared RX queue. Ports with same
> > > > > > > > > > configuration in a switch domain could share RX queue set by specifying sharing group.
> > > > > > > > > > Polling any queue using same shared RX queue receives
> > > > > > > > > > packets from all member ports. Source port is identified by mbuf->port.
> > > > > > > > > > 
> > > > > > > > > > Port queue number in a shared group should be identical.
> > > > > > > > > > Queue index is
> > > > > > > > > > 1:1 mapped in shared group.
> > > > > > > > > > 
> > > > > > > > > > Share RX queue must be polled on single thread or core.
> > > > > > > > > > 
> > > > > > > > > > Multiple groups is supported by group ID.
> > > > > > > > > > 
> > > > > > > > > > Signed-off-by: Xueming Li <xuemingl@nvidia.com>
> > > > > > > > > > Cc: Jerin Jacob <jerinjacobk@gmail.com>
> > > > > > > > > > ---
> > > > > > > > > > Rx queue object could be used as shared Rx queue object,
> > > > > > > > > > it's important to clear all queue control callback api that using queue object:
> > > > > > > > > > 
> > > > > > > > > > https://mails.dpdk.org/archives/dev/2021-July/215574.html
> > > > > > > > > 
> > > > > > > > > >  #undef RTE_RX_OFFLOAD_BIT2STR diff --git
> > > > > > > > > > a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h index
> > > > > > > > > > d2b27c351f..a578c9db9d 100644
> > > > > > > > > > --- a/lib/ethdev/rte_ethdev.h
> > > > > > > > > > +++ b/lib/ethdev/rte_ethdev.h
> > > > > > > > > > @@ -1047,6 +1047,7 @@ struct rte_eth_rxconf {
> > > > > > > > > >         uint8_t rx_drop_en; /**< Drop packets if no descriptors are available. */
> > > > > > > > > >         uint8_t rx_deferred_start; /**< Do not start queue with rte_eth_dev_start(). */
> > > > > > > > > >         uint16_t rx_nseg; /**< Number of descriptions in rx_seg array.
> > > > > > > > > > */
> > > > > > > > > > +       uint32_t shared_group; /**< Shared port group
> > > > > > > > > > + index in switch domain. */
> > > > > > > > > 
> > > > > > > > > Not to able to see anyone setting/creating this group ID test application.
> > > > > > > > > How this group is created?
> > > > > > > > 
> > > > > > > > Nice catch, the initial testpmd version only support one default group(0).
> > > > > > > > All ports that supports shared-rxq assigned in same group.
> > > > > > > > 
> > > > > > > > We should be able to change "--rxq-shared" to "--rxq-shared-group"
> > > > > > > > to support group other than default.
> > > > > > > > 
> > > > > > > > To support more groups simultaneously, need to consider
> > > > > > > > testpmd forwarding stream core assignment, all streams in same group need to stay on same core.
> > > > > > > > It's possible to specify how many ports to increase group
> > > > > > > > number, but user must schedule stream affinity carefully - error prone.
> > > > > > > > 
> > > > > > > > On the other hand, one group should be sufficient for most
> > > > > > > > customer, the doubt is whether it valuable to support multiple groups test.
> > > > > > > 
> > > > > > > Ack. One group is enough in testpmd.
> > > > > > > 
> > > > > > > My question was more about who and how this group is created,
> > > > > > > Should n't we need API to create shared_group? If we do the following, at least, I can think, how it can be implemented in SW
> > > or other HW.
> > > > > > > 
> > > > > > > - Create aggregation queue group
> > > > > > > - Attach multiple  Rx queues to the aggregation queue group
> > > > > > > - Pull the packets from the queue group(which internally fetch
> > > > > > > from the Rx queues _attached_)
> > > > > > > 
> > > > > > > Does the above kind of sequence, break your representor use case?
> > > > > > 
> > > > > > Seems more like a set of EAL wrapper. Current API tries to minimize the application efforts to adapt shared-rxq.
> > > > > > - step 1, not sure how important it is to create group with API, in rte_flow, group is created on demand.
> > > > > 
> > > > > Which rte_flow pattern/action for this?
> > > > 
> > > > No rte_flow for this, just recalled that the group in rte_flow is not created along with flow, not via api.
> > > > I don’t see anything else to create along with group, just double whether it valuable to introduce a new api set to manage group.
> > > 
> > > See below.
> > > 
> > > > 
> > > > > 
> > > > > > - step 2, currently, the attaching is done in rte_eth_rx_queue_setup, specify offload and group in rx_conf struct.
> > > > > > - step 3, define a dedicate api to receive packets from shared rxq? Looks clear to receive packets from shared rxq.
> > > > > >   currently, rxq objects in share group is same - the shared rxq, so the eth callback eth_rx_burst_t(rxq_obj, mbufs, n) could
> > > > > >   be used to receive packets from any ports in group, normally the first port(PF) in group.
> > > > > >   An alternative way is defining a vdev with same queue number and copy rxq objects will make the vdev a proxy of
> > > > > >   the shared rxq group - this could be an helper API.
> > > > > > 
> > > > > > Anyway the wrapper doesn't break use case, step 3 api is more clear, need to understand how to implement efficiently.
> > > > > 
> > > > > Are you doing this feature based on any HW support or it just pure
> > > > > SW thing, If it is SW, It is better to have just new vdev for like drivers/net/bonding/. This we can help aggregate multiple Rxq across
> > > the multiple ports of same the driver.
> > > > 
> > > > Based on HW support.
> > > 
> > > In Marvel HW, we do some support, I will outline here and some queries on this.
> > > 
> > > # We need to create some new HW structure for aggregation # Connect each Rxq to the new HW structure for aggregation # Use
> > > rx_burst from the new HW structure.
> > > 
> > > Could you outline your HW support?
> > > 
> > > Also, I am not able to understand how this will reduce the memory, atleast in our HW need creating more memory now to deal this as
> > > we need to deal new HW structure.
> > > 
> > > How is in your HW it reduces the memory? Also, if memory is the constraint, why NOT reduce the number of queues.
> > > 
> > 
> > Glad to know that Marvel is working on this, what's the status of driver implementation?
> > 
> > In my PMD implementation, it's very similar, a new HW object shared memory pool is created to replace per rxq memory pool.
> > Legacy rxq feed queue with allocated mbufs as number of descriptors, now shared rxqs share the same pool, no need to supply
> > mbufs for each rxq, just feed the shared rxq.
> > 
> > So the memory saving reflects to mbuf per rxq, even 1000 representors in shared rxq group, the mbufs consumed is one rxq.
> > In other words, new members in shared rxq doesn’t allocate new mbufs to feed rxq, just share with existing shared rxq(HW mempool).
> > The memory required to setup each rxq doesn't change too much, agree.
> 
> We can ask the application to configure the same mempool for multiple
> RQ too. RIght? If the saving is based on sharing the mempool
> with multiple RQs.
> 
> > 
> > > # Also, I was thinking, one way to avoid the fast path or ABI change would like.
> > > 
> > > # Driver Initializes one more eth_dev_ops in driver as aggregator ethdev # devargs of new ethdev or specific API like
> > > drivers/net/bonding/rte_eth_bond.h can take the argument (port, queue) tuples which needs to aggregate by new ethdev port # No
> > > change in fastpath or ABI is required in this model.
> > > 
> > 
> > This could be an option to access shared rxq. What's the difference of the new PMD?
> 
> No ABI and fast change are required.
> 
> > What's the difference of PMD driver to create the new device?
> > 
> > Is it important in your implementation? Does it work with existing rx_burst api?
> 
> Yes . It will work with the existing rx_burst API.
> 

The aggregator ethdev required by user is a port, maybe it good to add
a callback for PMD to prepare a complete ethdev just like creating
representor ethdev - pmd register new port internally. If the PMD
doens't provide the callback, ethdev api fallback to initialize an
empty ethdev by copy rxq data(shared) and rx_burst api from source port
and share group. Actually users can do this fallback themselves or with
an util api.

IIUC, an aggregator ethdev not a must, do you think we can continue and
leave that design in later stage? 

> > 
> > > 
> > > 
> > > > Most user might uses PF in group as the anchor port to rx burst, current definition should be easy for them to migrate.
> > > > but some user might prefer grouping some hot
> > > > plug/unpluggedrepresentors, EAL could provide wrappers, users could do that either due to the strategy not complex enough.
> > > Anyway, welcome any suggestion.
> > > > 
> > > > > 
> > > > > 
> > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > >         /**
> > > > > > > > > >          * Per-queue Rx offloads to be set using DEV_RX_OFFLOAD_* flags.
> > > > > > > > > >          * Only offloads set on rx_queue_offload_capa or
> > > > > > > > > > rx_offload_capa @@ -1373,6 +1374,12 @@ struct rte_eth_conf
> > > > > > > > > > { #define DEV_RX_OFFLOAD_OUTER_UDP_CKSUM  0x00040000
> > > > > > > > > >  #define DEV_RX_OFFLOAD_RSS_HASH                0x00080000
> > > > > > > > > >  #define RTE_ETH_RX_OFFLOAD_BUFFER_SPLIT 0x00100000
> > > > > > > > > > +/**
> > > > > > > > > > + * Rx queue is shared among ports in same switch domain
> > > > > > > > > > +to save memory,
> > > > > > > > > > + * avoid polling each port. Any port in group can be used to receive packets.
> > > > > > > > > > + * Real source port number saved in mbuf->port field.
> > > > > > > > > > + */
> > > > > > > > > > +#define RTE_ETH_RX_OFFLOAD_SHARED_RXQ   0x00200000
> > > > > > > > > > 
> > > > > > > > > >  #define DEV_RX_OFFLOAD_CHECKSUM (DEV_RX_OFFLOAD_IPV4_CKSUM | \
> > > > > > > > > >                                  DEV_RX_OFFLOAD_UDP_CKSUM
> > > > > > > > > > > \
> > > > > > > > > > --
> > > > > > > > > > 2.25.1
> > > > > > > > > > 


^ permalink raw reply	[relevance 0%]

* Re: [dpdk-dev] [PATCH 4/4] security: add reserved bitfields
  @ 2021-09-15 15:55  0%   ` Ananyev, Konstantin
  0 siblings, 0 replies; 200+ results
From: Ananyev, Konstantin @ 2021-09-15 15:55 UTC (permalink / raw)
  To: Akhil Goyal, dev
  Cc: thomas, david.marchand, hemant.agrawal, anoobj, De Lara Guarch,
	Pablo, Trahe, Fiona, Doherty, Declan, matan, g.singh, Zhang,
	Roy Fan, jianjay.zhou, asomalap, ruifeng.wang


> In struct rte_security_ipsec_sa_options, for every new option
> added, there is an ABI breakage, to avoid, a reserved_opts
> bitfield is added to for the remaining bits available in the
> structure.
> Now for every new sa option, these reserved_opts can be reduced
> and new option can be added. A corresponding exception is also
> added in devtools/libabigail.abignore
> 
> Signed-off-by: Akhil Goyal <gakhil@marvell.com>
> ---
>  devtools/libabigail.abignore | 4 ++++
>  lib/security/rte_security.h  | 6 ++++++
>  2 files changed, 10 insertions(+)
> 
> diff --git a/devtools/libabigail.abignore b/devtools/libabigail.abignore
> index 93158405e0..5d8da28e55 100644
> --- a/devtools/libabigail.abignore
> +++ b/devtools/libabigail.abignore
> @@ -52,3 +52,7 @@
>  ; https://sourceware.org/bugzilla/show_bug.cgi?id=28060
>  [suppress_type]
>  	name = rte_eth_dev_data
> +
> +; Ignore changes in reserved_opts bitfield of rte_security_ipsec_sa_options
> +[suppress_variable]
> +	name = reserved_opts
> diff --git a/lib/security/rte_security.h b/lib/security/rte_security.h
> index 88d31de0a6..4606425e8d 100644
> --- a/lib/security/rte_security.h
> +++ b/lib/security/rte_security.h
> @@ -181,6 +181,12 @@ struct rte_security_ipsec_sa_options {
>  	 * * 0: Disable per session security statistics collection for this SA.
>  	 */
>  	uint32_t stats : 1;
> +
> +	/** Reserved bit fields for future extension
> +	 *
> +	 * Note: reduce number of bits in reserved_opts for every new option
> +	 */
> +	uint32_t reserved_opts : 24;
>  };
> 
>  /** IPSec security association direction */
> --

Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>

> 2.25.1


^ permalink raw reply	[relevance 0%]

* [dpdk-dev] [PATCH] doc: remove template comments in old release notes
@ 2021-09-15 16:25 19% Thomas Monjalon
  0 siblings, 0 replies; 200+ results
From: Thomas Monjalon @ 2021-09-15 16:25 UTC (permalink / raw)
  To: dev; +Cc: john.mcnamara, david.marchand, ferruh.yigit

The release notes comments mention how to generate the documentation
with the old & removed build system.

Rather than fixing these comments, all old release notes comments
are removed, because they are useful only for the current release.

Few extra blank lines are removed for consistency.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 doc/guides/rel_notes/release_16_04.rst |   1 -
 doc/guides/rel_notes/release_16_07.rst |  90 ------------------
 doc/guides/rel_notes/release_16_11.rst | 124 -------------------------
 doc/guides/rel_notes/release_17_02.rst |  97 -------------------
 doc/guides/rel_notes/release_17_05.rst | 121 ------------------------
 doc/guides/rel_notes/release_17_08.rst |  95 -------------------
 doc/guides/rel_notes/release_17_11.rst | 110 ----------------------
 doc/guides/rel_notes/release_18_02.rst |  65 -------------
 doc/guides/rel_notes/release_18_05.rst |  95 -------------------
 doc/guides/rel_notes/release_18_08.rst |  73 ---------------
 doc/guides/rel_notes/release_18_11.rst | 105 ---------------------
 doc/guides/rel_notes/release_19_02.rst | 108 ---------------------
 doc/guides/rel_notes/release_19_05.rst | 108 ---------------------
 doc/guides/rel_notes/release_19_08.rst | 117 -----------------------
 doc/guides/rel_notes/release_19_11.rst | 121 ------------------------
 doc/guides/rel_notes/release_20_02.rst |  96 -------------------
 doc/guides/rel_notes/release_20_05.rst |  87 -----------------
 doc/guides/rel_notes/release_20_08.rst | 107 ---------------------
 doc/guides/rel_notes/release_20_11.rst |  95 -------------------
 doc/guides/rel_notes/release_21_02.rst |  94 -------------------
 doc/guides/rel_notes/release_21_05.rst |  95 -------------------
 doc/guides/rel_notes/release_21_08.rst |  97 -------------------
 doc/guides/rel_notes/release_2_0.rst   |   1 -
 doc/guides/rel_notes/release_2_1.rst   |   2 -
 24 files changed, 2104 deletions(-)

diff --git a/doc/guides/rel_notes/release_16_04.rst b/doc/guides/rel_notes/release_16_04.rst
index e9f1e6ff6c..b7d07834e1 100644
--- a/doc/guides/rel_notes/release_16_04.rst
+++ b/doc/guides/rel_notes/release_16_04.rst
@@ -4,7 +4,6 @@
 DPDK Release 16.04
 ==================
 
-
 New Features
 ------------
 
diff --git a/doc/guides/rel_notes/release_16_07.rst b/doc/guides/rel_notes/release_16_07.rst
index af89cf60a2..5be2d171f1 100644
--- a/doc/guides/rel_notes/release_16_07.rst
+++ b/doc/guides/rel_notes/release_16_07.rst
@@ -4,39 +4,9 @@
 DPDK Release 16.07
 ==================
 
-.. **Read this first.**
-
-   The text below explains how to update the release notes.
-
-   Use proper spelling, capitalization and punctuation in all sections.
-
-   Variable and config names should be quoted as fixed width text: ``LIKE_THIS``.
-
-   Build the docs and view the output file to ensure the changes are correct::
-
-      make doc-guides-html
-
-      firefox build/doc/html/guides/rel_notes/release_16_07.html
-
-
 New Features
 ------------
 
-.. This section should contain new features added in this release. Sample format:
-
-   * **Add a title in the past tense with a full stop.**
-
-     Add a short 1-2 sentence description in the past tense. The description
-     should be enough to allow someone scanning the release notes to understand
-     the new feature.
-
-     If the feature adds a lot of sub-features you can use a bullet list like this.
-
-     * Added feature foo to do something.
-     * Enhanced feature bar to do something else.
-
-     Refer to the previous release notes for examples.
-
 * **Removed the mempool cache memory if caching is not being used.**
 
   The size of the mempool structure is reduced if the per-lcore cache is disabled.
@@ -217,15 +187,6 @@ New Features
 Resolved Issues
 ---------------
 
-.. This section should contain bug fixes added to the relevant sections. Sample format:
-
-   * **code/section Fixed issue in the past tense with a full stop.**
-
-     Add a short 1-2 sentence description of the resolved issue in the past tense.
-     The title should contain the code/lib section like a commit message.
-     Add the entries in alphabetic order in the relevant sections below.
-
-
 EAL
 ~~~
 
@@ -289,33 +250,9 @@ Libraries
   counter. This lead to a memory leak of the direct mbuf.
 
 
-Examples
-~~~~~~~~
-
-
-Other
-~~~~~
-
-
-Known Issues
-------------
-
-.. This section should contain new known issues in this release. Sample format:
-
-   * **Add title in present tense with full stop.**
-
-     Add a short 1-2 sentence description of the known issue in the present
-     tense. Add information on any known workarounds.
-
-
 API Changes
 -----------
 
-.. This section should contain API changes. Sample format:
-
-   * Add a short 1-2 sentence description of the API change. Use fixed width
-     quotes for ``rte_function_names`` or ``rte_struct_names``. Use the past tense.
-
 * The following counters are removed from the ``rte_eth_stats`` structure:
 
   * ``ibadcrc``
@@ -354,10 +291,6 @@ API Changes
 ABI Changes
 -----------
 
-.. * Add a short 1-2 sentence description of the ABI change that was announced in
-     the previous releases and made in this release. Use fixed width quotes for
-     ``rte_function_names`` or ``rte_struct_names``. Use the past tense.
-
 * The ``rte_port_source_params`` structure has new fields to support PCAP files.
   It was already in release 16.04 with ``RTE_NEXT_ABI`` flag.
 
@@ -372,8 +305,6 @@ ABI Changes
 Shared Library Versions
 -----------------------
 
-.. Update any library version updated in this release and prepend with a ``+`` sign.
-
 The libraries prepended with a plus sign were incremented in this version.
 
 .. code-block:: diff
@@ -412,16 +343,6 @@ The libraries prepended with a plus sign were incremented in this version.
 Tested Platforms
 ----------------
 
-.. This section should contain a list of platforms that were tested with this
-   release.
-
-   The format is:
-
-   #. Platform name.
-
-      - Platform details.
-      - Platform details.
-
 #. SuperMicro 1U
 
    - BIOS: 1.0c
@@ -472,15 +393,6 @@ Tested Platforms
 Tested NICs
 -----------
 
-.. This section should contain a list of NICs that were tested with this release.
-
-   The format is:
-
-   #. NIC name.
-
-      - NIC details.
-      - NIC details.
-
 #. Intel(R) Ethernet Controller X540-AT2
 
    - Firmware version: 0x80000389
@@ -539,8 +451,6 @@ Tested NICs
 Tested OSes
 -----------
 
-.. This section should contain a list of OSes that were tested with this release.
-
 - CentOS 7.0
 - Fedora 23
 - Fedora 24
diff --git a/doc/guides/rel_notes/release_16_11.rst b/doc/guides/rel_notes/release_16_11.rst
index 3cec9143cf..a2bfbcd70e 100644
--- a/doc/guides/rel_notes/release_16_11.rst
+++ b/doc/guides/rel_notes/release_16_11.rst
@@ -4,42 +4,9 @@
 DPDK Release 16.11
 ==================
 
-.. **Read this first.**
-
-   The text below explains how to update the release notes.
-
-   Use proper spelling, capitalization and punctuation in all sections.
-
-   Variable and config names should be quoted as fixed width text: ``LIKE_THIS``.
-
-   Build the docs and view the output file to ensure the changes are correct::
-
-      make doc-guides-html
-
-      firefox build/doc/html/guides/rel_notes/release_16_11.html
-
-
 New Features
 ------------
 
-.. This section should contain new features added in this release. Sample format:
-
-   * **Add a title in the past tense with a full stop.**
-
-     Add a short 1-2 sentence description in the past tense. The description
-     should be enough to allow someone scanning the release notes to understand
-     the new feature.
-
-     If the feature adds a lot of sub-features you can use a bullet list like this.
-
-     * Added feature foo to do something.
-     * Enhanced feature bar to do something else.
-
-     Refer to the previous release notes for examples.
-
-     This section is a comment. Make sure to start the actual text at the margin.
-
-
 * **Added software parser for packet type.**
 
   * Added a new function ``rte_pktmbuf_read()`` to read the packet data from an
@@ -159,20 +126,6 @@ New Features
   The config option ``RTE_MACHINE`` can be used to pass code names to the compiler via the ``-march`` flag.
 
 
-Resolved Issues
----------------
-
-.. This section should contain bug fixes added to the relevant sections. Sample format:
-
-   * **code/section Fixed issue in the past tense with a full stop.**
-
-     Add a short 1-2 sentence description of the resolved issue in the past tense.
-     The title should contain the code/lib section like a commit message.
-     Add the entries in alphabetic order in the relevant sections below.
-
-   This section is a comment. Make sure to start the actual text at the margin.
-
-
 Drivers
 ~~~~~~~
 
@@ -183,19 +136,9 @@ Drivers
 * **enic: Fixed high driver overhead when servicing Rx queues beyond the first.**
 
 
-
 Known Issues
 ------------
 
-.. This section should contain new known issues in this release. Sample format:
-
-   * **Add title in present tense with full stop.**
-
-     Add a short 1-2 sentence description of the known issue in the present
-     tense. Add information on any known workarounds.
-
-   This section is a comment. Make sure to start the actual text at the margin.
-
 * **L3fwd-power app does not work properly when Rx vector is enabled.**
 
   The L3fwd-power app doesn't work properly with some drivers in vector mode
@@ -223,13 +166,6 @@ Known Issues
 API Changes
 -----------
 
-.. This section should contain API changes. Sample format:
-
-   * Add a short 1-2 sentence description of the API change. Use fixed width
-     quotes for ``rte_function_names`` or ``rte_struct_names``. Use the past tense.
-
-   This section is a comment. Make sure to start the actual text at the margin.
-
 * The driver naming convention has been changed to make them more
   consistent. It especially impacts ``--vdev`` arguments. For example
   ``eth_pcap`` becomes ``net_pcap`` and ``cryptodev_aesni_mb_pmd`` becomes
@@ -273,32 +209,9 @@ API Changes
     and ``rte_eal_vdrv_unregister``.
 
 
-ABI Changes
------------
-
-.. This section should contain ABI changes. Sample format:
-
-   * Add a short 1-2 sentence description of the ABI change that was announced in
-     the previous releases and made in this release. Use fixed width quotes for
-     ``rte_function_names`` or ``rte_struct_names``. Use the past tense.
-
-   This section is a comment. Make sure to start the actual text at the margin.
-
-
-
 Shared Library Versions
 -----------------------
 
-.. Update any library version updated in this release and prepend with a ``+``
-   sign, like this:
-
-     libethdev.so.4
-     librte_acl.so.2
-   + librte_cfgfile.so.2
-     librte_cmdline.so.2
-
-
-
 The libraries prepended with a plus sign were incremented in this version.
 
 .. code-block:: diff
@@ -337,17 +250,6 @@ The libraries prepended with a plus sign were incremented in this version.
 Tested Platforms
 ----------------
 
-.. This section should contain a list of platforms that were tested with this release.
-
-   The format is:
-
-   #. Platform name.
-
-      * Platform details.
-      * Platform details.
-
-   This section is a comment. Make sure to start the actual text at the margin.
-
 #. SuperMicro 1U
 
    - BIOS: 1.0c
@@ -412,17 +314,6 @@ Tested Platforms
 Tested NICs
 -----------
 
-.. This section should contain a list of NICs that were tested with this release.
-
-   The format is:
-
-   #. NIC name.
-
-      * NIC details.
-      * NIC details.
-
-   This section is a comment. Make sure to start the actual text at the margin.
-
 #. Intel(R) Ethernet Controller X540-AT2
 
    - Firmware version: 0x80000389
@@ -572,21 +463,6 @@ Tested NICs
 Tested OSes
 -----------
 
-.. This section should contain a list of OSes that were tested with this release.
-   The format is as follows, in alphabetical order:
-
-   * CentOS 7.0
-   * Fedora 23
-   * Fedora 24
-   * FreeBSD 10.3
-   * Red Hat Enterprise Linux 7.2
-   * SUSE Enterprise Linux 12
-   * Ubuntu 15.10
-   * Ubuntu 16.04 LTS
-   * Wind River Linux 8
-
-   This section is a comment. Make sure to start the actual text at the margin.
-
 * CentOS 7.2
 * Fedora 23
 * Fedora 24
diff --git a/doc/guides/rel_notes/release_17_02.rst b/doc/guides/rel_notes/release_17_02.rst
index 2244d27f96..753ef8a408 100644
--- a/doc/guides/rel_notes/release_17_02.rst
+++ b/doc/guides/rel_notes/release_17_02.rst
@@ -4,43 +4,9 @@
 DPDK Release 17.02
 ==================
 
-.. **Read this first.**
-
-   The text below explains how to update the release notes.
-
-   Use proper spelling, capitalization and punctuation in all sections.
-
-   Variable and config names should be quoted as fixed width text: ``LIKE_THIS``.
-
-   Build the docs and view the output file to ensure the changes are correct::
-
-      make doc-guides-html
-
-      firefox build/doc/html/guides/rel_notes/release_17_02.html
-
-
 New Features
 ------------
 
-.. This section should contain new features added in this release. Sample format:
-
-   * **Add a title in the past tense with a full stop.**
-
-     Add a short 1-2 sentence description in the past tense. The description
-     should be enough to allow someone scanning the release notes to understand
-     the new feature.
-
-     If the feature adds a lot of sub-features you can use a bullet list like this.
-
-     * Added feature foo to do something.
-     * Enhanced feature bar to do something else.
-
-     Refer to the previous release notes for examples.
-
-     This section is a comment. do not overwrite or remove it.
-     Also, make sure to start the actual text at the margin.
-     =========================================================
-
 * **Added support for representing buses in EAL**
 
   The ``rte_bus`` structure was introduced into the EAL. This allows for
@@ -256,18 +222,6 @@ New Features
 Resolved Issues
 ---------------
 
-.. This section should contain bug fixes added to the relevant sections. Sample format:
-
-   * **code/section Fixed issue in the past tense with a full stop.**
-
-     Add a short 1-2 sentence description of the resolved issue in the past tense.
-     The title should contain the code/lib section like a commit message.
-     Add the entries in alphabetic order in the relevant sections below.
-
-   This section is a comment. do not overwrite or remove it.
-   Also, make sure to start the actual text at the margin.
-   =========================================================
-
 Drivers
 ~~~~~~~
 
@@ -286,19 +240,9 @@ Examples
   PCI data resulting in a segmentation fault.
 
 
-
 API Changes
 -----------
 
-.. This section should contain API changes. Sample format:
-
-   * Add a short 1-2 sentence description of the API change. Use fixed width
-     quotes for ``rte_function_names`` or ``rte_struct_names``. Use the past tense.
-
-   This section is a comment. do not overwrite or remove it.
-   Also, make sure to start the actual text at the margin.
-   =========================================================
-
 * **Moved five APIs for VF management from the ethdev to the ixgbe PMD.**
 
   The following five APIs for VF management from the PF have been removed from
@@ -321,35 +265,9 @@ API Changes
   The declarations for the API’s can be found in ``rte_pmd_ixgbe.h``.
 
 
-ABI Changes
------------
-
-.. This section should contain ABI changes. Sample format:
-
-   * Add a short 1-2 sentence description of the ABI change that was announced in
-     the previous releases and made in this release. Use fixed width quotes for
-     ``rte_function_names`` or ``rte_struct_names``. Use the past tense.
-
-   This section is a comment. do not overwrite or remove it.
-   Also, make sure to start the actual text at the margin.
-   =========================================================
-
-
-
 Shared Library Versions
 -----------------------
 
-.. Update any library version updated in this release and prepend with a ``+``
-   sign, like this:
-
-     librte_acl.so.2
-   + librte_cfgfile.so.2
-     librte_cmdline.so.2
-
-   This section is a comment. do not overwrite or remove it.
-   =========================================================
-
-
 The libraries prepended with a plus sign were incremented in this version.
 
 .. code-block:: diff
@@ -388,21 +306,6 @@ The libraries prepended with a plus sign were incremented in this version.
 Tested Platforms
 ----------------
 
-.. This section should contain a list of platforms that were tested with this release.
-
-   The format is:
-
-   * <vendor> platform with <vendor> <type of devices> combinations
-
-     * List of CPU
-     * List of OS
-     * List of devices
-     * Other relevant details...
-
-   This section is a comment. do not overwrite or remove it.
-   Also, make sure to start the actual text at the margin.
-   =========================================================
-
 This release has been tested with the below list of CPU/device/firmware/OS.
 Each section describes a different set of combinations.
 
diff --git a/doc/guides/rel_notes/release_17_05.rst b/doc/guides/rel_notes/release_17_05.rst
index 641824065e..b0dad76fd3 100644
--- a/doc/guides/rel_notes/release_17_05.rst
+++ b/doc/guides/rel_notes/release_17_05.rst
@@ -4,46 +4,9 @@
 DPDK Release 17.05
 ==================
 
-.. **Read this first.**
-
-   The text in the sections below explains how to update the release notes.
-
-   Use proper spelling, capitalization and punctuation in all sections.
-
-   Variable and config names should be quoted as fixed width text:
-   ``LIKE_THIS``.
-
-   Build the docs and view the output file to ensure the changes are correct::
-
-      make doc-guides-html
-
-      xdg-open build/doc/html/guides/rel_notes/release_17_05.html
-
-
 New Features
 ------------
 
-.. This section should contain new features added in this release. Sample
-   format:
-
-   * **Add a title in the past tense with a full stop.**
-
-     Add a short 1-2 sentence description in the past tense. The description
-     should be enough to allow someone scanning the release notes to
-     understand the new feature.
-
-     If the feature adds a lot of sub-features you can use a bullet list like
-     this:
-
-     * Added feature foo to do something.
-     * Enhanced feature bar to do something else.
-
-     Refer to the previous release notes for examples.
-
-     This section is a comment. do not overwrite or remove it.
-     Also, make sure to start the actual text at the margin.
-     =========================================================
-
 * **Reorganized mbuf structure.**
 
   The mbuf structure has been reorganized as follows:
@@ -328,23 +291,6 @@ New Features
 Resolved Issues
 ---------------
 
-.. This section should contain bug fixes added to the relevant
-   sections. Sample format:
-
-   * **code/section Fixed issue in the past tense with a full stop.**
-
-     Add a short 1-2 sentence description of the resolved issue in the past
-     tense.
-
-     The title should contain the code/lib section like a commit message.
-
-     Add the entries in alphabetic order in the relevant sections below.
-
-   This section is a comment. do not overwrite or remove it.
-   Also, make sure to start the actual text at the margin.
-   =========================================================
-
-
 * **l2fwd-keepalive: Fixed unclean shutdowns.**
 
   Added clean shutdown to l2fwd-keepalive so that it can free up
@@ -354,17 +300,6 @@ Resolved Issues
 Known Issues
 ------------
 
-.. This section should contain new known issues in this release. Sample format:
-
-   * **Add title in present tense with full stop.**
-
-     Add a short 1-2 sentence description of the known issue in the present
-     tense. Add information on any known workarounds.
-
-   This section is a comment. do not overwrite or remove it.
-   Also, make sure to start the actual text at the margin.
-   =========================================================
-
 * **LSC interrupt doesn't work for virtio-user + vhost-kernel.**
 
   LSC interrupt cannot be detected when setting the backend, tap device,
@@ -374,16 +309,6 @@ Known Issues
 API Changes
 -----------
 
-.. This section should contain API changes. Sample format:
-
-   * Add a short 1-2 sentence description of the API change. Use fixed width
-     quotes for ``rte_function_names`` or ``rte_struct_names``. Use the past
-     tense.
-
-   This section is a comment. do not overwrite or remove it.
-   Also, make sure to start the actual text at the margin.
-   =========================================================
-
 * The LPM ``next_hop`` field is extended from 8 bits to 21 bits for IPv6
   while keeping ABI compatibility.
 
@@ -466,16 +391,6 @@ API Changes
 ABI Changes
 -----------
 
-.. This section should contain ABI changes. Sample format:
-
-   * Add a short 1-2 sentence description of the ABI change that was announced
-     in the previous releases and made in this release. Use fixed width quotes
-     for ``rte_function_names`` or ``rte_struct_names``. Use the past tense.
-
-   This section is a comment. do not overwrite or remove it.
-   Also, make sure to start the actual text at the margin.
-   =========================================================
-
 * **Reorganized the mbuf structure.**
 
   The order and size of the fields in the ``mbuf`` structure changed,
@@ -488,15 +403,6 @@ ABI Changes
 Removed Items
 -------------
 
-.. This section should contain removed items in this release. Sample format:
-
-   * Add a short 1-2 sentence description of the removed item in the past
-     tense.
-
-   This section is a comment. do not overwrite or remove it.
-   Also, make sure to start the actual text at the margin.
-   =========================================================
-
 * KNI vhost support has been removed.
 
 * The dpdk_qat sample application has been removed.
@@ -504,17 +410,6 @@ Removed Items
 Shared Library Versions
 -----------------------
 
-.. Update any library version updated in this release and prepend with a ``+``
-   sign, like this:
-
-     librte_acl.so.2
-   + librte_cfgfile.so.2
-     librte_cmdline.so.2
-
-   This section is a comment. do not overwrite or remove it.
-   =========================================================
-
-
 The libraries prepended with a plus sign were incremented in this version.
 
 .. code-block:: diff
@@ -557,22 +452,6 @@ The libraries prepended with a plus sign were incremented in this version.
 Tested Platforms
 ----------------
 
-.. This section should contain a list of platforms that were tested with this
-   release.
-
-   The format is:
-
-   * <vendor> platform with <vendor> <type of devices> combinations
-
-     * List of CPU
-     * List of OS
-     * List of devices
-     * Other relevant details...
-
-   This section is a comment. do not overwrite or remove it.
-   Also, make sure to start the actual text at the margin.
-   =========================================================
-
 * Intel(R) platforms with Intel(R) NICs combinations
 
    * CPU
diff --git a/doc/guides/rel_notes/release_17_08.rst b/doc/guides/rel_notes/release_17_08.rst
index dc6224097a..25439dad45 100644
--- a/doc/guides/rel_notes/release_17_08.rst
+++ b/doc/guides/rel_notes/release_17_08.rst
@@ -4,46 +4,9 @@
 DPDK Release 17.08
 ==================
 
-.. **Read this first.**
-
-   The text in the sections below explains how to update the release notes.
-
-   Use proper spelling, capitalization and punctuation in all sections.
-
-   Variable and config names should be quoted as fixed width text:
-   ``LIKE_THIS``.
-
-   Build the docs and view the output file to ensure the changes are correct::
-
-      make doc-guides-html
-
-      xdg-open build/doc/html/guides/rel_notes/release_17_08.html
-
-
 New Features
 ------------
 
-.. This section should contain new features added in this release. Sample
-   format:
-
-   * **Add a title in the past tense with a full stop.**
-
-     Add a short 1-2 sentence description in the past tense. The description
-     should be enough to allow someone scanning the release notes to
-     understand the new feature.
-
-     If the feature adds a lot of sub-features you can use a bullet list like
-     this:
-
-     * Added feature foo to do something.
-     * Enhanced feature bar to do something else.
-
-     Refer to the previous release notes for examples.
-
-     This section is a comment. do not overwrite or remove it.
-     Also, make sure to start the actual text at the margin.
-     =========================================================
-
 * **Increase minimum x86 ISA version to SSE4.2.**
 
   Starting with version 17.08, DPDK requires SSE4.2 to run on x86.
@@ -218,33 +181,12 @@ New Features
 Known Issues
 ------------
 
-.. This section should contain new known issues in this release. Sample format:
-
-   * **Add title in present tense with full stop.**
-
-     Add a short 1-2 sentence description of the known issue in the present
-     tense. Add information on any known workarounds.
-
-   This section is a comment. do not overwrite or remove it.
-   Also, make sure to start the actual text at the margin.
-   =========================================================
-
 * **Starting with version 17.08, libnuma is required to build DPDK.**
 
 
 API Changes
 -----------
 
-.. This section should contain API changes. Sample format:
-
-   * Add a short 1-2 sentence description of the API change. Use fixed width
-     quotes for ``rte_function_names`` or ``rte_struct_names``. Use the past
-     tense.
-
-   This section is a comment. do not overwrite or remove it.
-   Also, make sure to start the actual text at the margin.
-   =========================================================
-
 * **Modified the _rte_eth_dev_callback_process function in the ethdev library.**
 
   The function ``_rte_eth_dev_callback_process()`` has been modified. The
@@ -307,16 +249,6 @@ API Changes
 ABI Changes
 -----------
 
-.. This section should contain ABI changes. Sample format:
-
-   * Add a short 1-2 sentence description of the ABI change that was announced
-     in the previous releases and made in this release. Use fixed width quotes
-     for ``rte_function_names`` or ``rte_struct_names``. Use the past tense.
-
-   This section is a comment. do not overwrite or remove it.
-   Also, make sure to start the actual text at the margin.
-   =========================================================
-
 * Changed type of ``domain`` field in ``rte_pci_addr`` to ``uint32_t``
   to follow the PCI standard.
 
@@ -359,17 +291,6 @@ ABI Changes
 Shared Library Versions
 -----------------------
 
-.. Update any library version updated in this release and prepend with a ``+``
-   sign, like this:
-
-     librte_acl.so.2
-   + librte_cfgfile.so.2
-     librte_cmdline.so.2
-
-   This section is a comment. do not overwrite or remove it.
-   =========================================================
-
-
 The libraries prepended with a plus sign were incremented in this version.
 
 .. code-block:: diff
@@ -413,22 +334,6 @@ The libraries prepended with a plus sign were incremented in this version.
 Tested Platforms
 ----------------
 
-.. This section should contain a list of platforms that were tested with this
-   release.
-
-   The format is:
-
-   * <vendor> platform with <vendor> <type of devices> combinations
-
-     * List of CPU
-     * List of OS
-     * List of devices
-     * Other relevant details...
-
-   This section is a comment. do not overwrite or remove it.
-   Also, make sure to start the actual text at the margin.
-   =========================================================
-
 * Intel(R) platforms with Mellanox(R) NICs combinations
 
    * Platform details:
diff --git a/doc/guides/rel_notes/release_17_11.rst b/doc/guides/rel_notes/release_17_11.rst
index 1f3b45ef61..9ecf38c9d5 100644
--- a/doc/guides/rel_notes/release_17_11.rst
+++ b/doc/guides/rel_notes/release_17_11.rst
@@ -4,46 +4,9 @@
 DPDK Release 17.11
 ==================
 
-.. **Read this first.**
-
-   The text in the sections below explains how to update the release notes.
-
-   Use proper spelling, capitalization and punctuation in all sections.
-
-   Variable and config names should be quoted as fixed width text:
-   ``LIKE_THIS``.
-
-   Build the docs and view the output file to ensure the changes are correct::
-
-      make doc-guides-html
-
-      xdg-open build/doc/html/guides/rel_notes/release_17_11.html
-
-
 New Features
 ------------
 
-.. This section should contain new features added in this release. Sample
-   format:
-
-   * **Add a title in the past tense with a full stop.**
-
-     Add a short 1-2 sentence description in the past tense. The description
-     should be enough to allow someone scanning the release notes to
-     understand the new feature.
-
-     If the feature adds a lot of sub-features you can use a bullet list like
-     this:
-
-     * Added feature foo to do something.
-     * Enhanced feature bar to do something else.
-
-     Refer to the previous release notes for examples.
-
-     This section is a comment. do not overwrite or remove it.
-     Also, make sure to start the actual text at the margin.
-     =========================================================
-
 * **Extended port_id range from uint8_t to uint16_t.**
 
   Increased the ``port_id`` range from 8 bits to 16 bits in order to support
@@ -293,23 +256,6 @@ New Features
 Resolved Issues
 ---------------
 
-.. This section should contain bug fixes added to the relevant
-   sections. Sample format:
-
-   * **code/section Fixed issue in the past tense with a full stop.**
-
-     Add a short 1-2 sentence description of the resolved issue in the past
-     tense.
-
-     The title should contain the code/lib section like a commit message.
-
-     Add the entries in alphabetic order in the relevant sections below.
-
-   This section is a comment. do not overwrite or remove it.
-   Also, make sure to start the actual text at the margin.
-   =========================================================
-
-
 * **Service core fails to call service callback due to atomic lock**
 
   In a specific configuration of multi-thread unsafe services and service
@@ -322,16 +268,6 @@ Resolved Issues
 API Changes
 -----------
 
-.. This section should contain API changes. Sample format:
-
-   * Add a short 1-2 sentence description of the API change. Use fixed width
-     quotes for ``rte_function_names`` or ``rte_struct_names``. Use the past
-     tense.
-
-   This section is a comment. do not overwrite or remove it.
-   Also, make sure to start the actual text at the margin.
-   =========================================================
-
 * **Ethdev device name length increased.**
 
   The size of internal device name has been increased to 64 characters
@@ -491,16 +427,6 @@ API Changes
 ABI Changes
 -----------
 
-.. This section should contain ABI changes. Sample format:
-
-   * Add a short 1-2 sentence description of the ABI change that was announced
-     in the previous releases and made in this release. Use fixed width quotes
-     for ``rte_function_names`` or ``rte_struct_names``. Use the past tense.
-
-   This section is a comment. do not overwrite or remove it.
-   Also, make sure to start the actual text at the margin.
-   =========================================================
-
 * **Extended port_id range.**
 
   The size of the field ``port_id`` in the ``rte_eth_dev_data`` structure
@@ -520,15 +446,6 @@ ABI Changes
 Removed Items
 -------------
 
-.. This section should contain removed items in this release. Sample format:
-
-   * Add a short 1-2 sentence description of the removed item in the past
-     tense.
-
-   This section is a comment. do not overwrite or remove it.
-   Also, make sure to start the actual text at the margin.
-   =========================================================
-
 * Xen dom0 in EAL has been removed, as well as the xenvirt PMD and vhost_xen.
 
 * The crypto performance unit tests have been removed,
@@ -538,17 +455,6 @@ Removed Items
 Shared Library Versions
 -----------------------
 
-.. Update any library version updated in this release and prepend with a ``+``
-   sign, like this:
-
-     librte_acl.so.2
-   + librte_cfgfile.so.2
-     librte_cmdline.so.2
-
-   This section is a comment. do not overwrite or remove it.
-   =========================================================
-
-
 The libraries prepended with a plus sign were incremented in this version.
 
 .. code-block:: diff
@@ -605,22 +511,6 @@ The libraries prepended with a plus sign were incremented in this version.
 Tested Platforms
 ----------------
 
-.. This section should contain a list of platforms that were tested with this
-   release.
-
-   The format is:
-
-   * <vendor> platform with <vendor> <type of devices> combinations
-
-     * List of CPU
-     * List of OS
-     * List of devices
-     * Other relevant details...
-
-   This section is a comment. do not overwrite or remove it.
-   Also, make sure to start the actual text at the margin.
-   =========================================================
-
 * Intel(R) platforms with Intel(R) NICs combinations
 
    * CPU
diff --git a/doc/guides/rel_notes/release_18_02.rst b/doc/guides/rel_notes/release_18_02.rst
index 3523ea7fdc..989017786b 100644
--- a/doc/guides/rel_notes/release_18_02.rst
+++ b/doc/guides/rel_notes/release_18_02.rst
@@ -4,46 +4,9 @@
 DPDK Release 18.02
 ==================
 
-.. **Read this first.**
-
-   The text in the sections below explains how to update the release notes.
-
-   Use proper spelling, capitalization and punctuation in all sections.
-
-   Variable and config names should be quoted as fixed width text:
-   ``LIKE_THIS``.
-
-   Build the docs and view the output file to ensure the changes are correct::
-
-      make doc-guides-html
-
-      xdg-open build/doc/html/guides/rel_notes/release_18_02.html
-
-
 New Features
 ------------
 
-.. This section should contain new features added in this release. Sample
-   format:
-
-   * **Add a title in the past tense with a full stop.**
-
-     Add a short 1-2 sentence description in the past tense. The description
-     should be enough to allow someone scanning the release notes to
-     understand the new feature.
-
-     If the feature adds a lot of sub-features you can use a bullet list like
-     this:
-
-     * Added feature foo to do something.
-     * Enhanced feature bar to do something else.
-
-     Refer to the previous release notes for examples.
-
-     This section is a comment. do not overwrite or remove it.
-     Also, make sure to start the actual text at the margin.
-     =========================================================
-
 * **Added function to allow releasing internal EAL resources on exit.**
 
   During ``rte_eal_init()`` EAL allocates memory from hugepages to enable its
@@ -260,17 +223,6 @@ New Features
 Shared Library Versions
 -----------------------
 
-.. Update any library version updated in this release and prepend with a ``+``
-   sign, like this:
-
-     librte_acl.so.2
-   + librte_cfgfile.so.2
-     librte_cmdline.so.2
-
-   This section is a comment. do not overwrite or remove it.
-   =========================================================
-
-
 The libraries prepended with a plus sign were incremented in this version.
 
 .. code-block:: diff
@@ -326,26 +278,9 @@ The libraries prepended with a plus sign were incremented in this version.
      librte_vhost.so.3
 
 
-
 Tested Platforms
 ----------------
 
-.. This section should contain a list of platforms that were tested with this
-   release.
-
-   The format is:
-
-   * <vendor> platform with <vendor> <type of devices> combinations
-
-     * List of CPU
-     * List of OS
-     * List of devices
-     * Other relevant details...
-
-   This section is a comment. do not overwrite or remove it.
-   Also, make sure to start the actual text at the margin.
-   =========================================================
-
 * Intel(R) platforms with Intel(R) NICs combinations
 
    * CPU
diff --git a/doc/guides/rel_notes/release_18_05.rst b/doc/guides/rel_notes/release_18_05.rst
index 2b1bb06a6a..3255c8a4b1 100644
--- a/doc/guides/rel_notes/release_18_05.rst
+++ b/doc/guides/rel_notes/release_18_05.rst
@@ -4,46 +4,9 @@
 DPDK Release 18.05
 ==================
 
-.. **Read this first.**
-
-   The text in the sections below explains how to update the release notes.
-
-   Use proper spelling, capitalization and punctuation in all sections.
-
-   Variable and config names should be quoted as fixed width text:
-   ``LIKE_THIS``.
-
-   Build the docs and view the output file to ensure the changes are correct::
-
-      make doc-guides-html
-
-      xdg-open build/doc/html/guides/rel_notes/release_18_05.html
-
-
 New Features
 ------------
 
-.. This section should contain new features added in this release. Sample
-   format:
-
-   * **Add a title in the past tense with a full stop.**
-
-     Add a short 1-2 sentence description in the past tense. The description
-     should be enough to allow someone scanning the release notes to
-     understand the new feature.
-
-     If the feature adds a lot of sub-features you can use a bullet list like
-     this:
-
-     * Added feature foo to do something.
-     * Enhanced feature bar to do something else.
-
-     Refer to the previous release notes for examples.
-
-     This section is a comment. Do not overwrite or remove it.
-     Also, make sure to start the actual text at the margin.
-     =========================================================
-
 * **Reworked memory subsystem.**
 
   Memory subsystem has been reworked to support new functionality.
@@ -343,16 +306,6 @@ New Features
 API Changes
 -----------
 
-.. This section should contain API changes. Sample format:
-
-   * Add a short 1-2 sentence description of the API change. Use fixed width
-     quotes for ``rte_function_names`` or ``rte_struct_names``. Use the past
-     tense.
-
-   This section is a comment. Do not overwrite or remove it.
-   Also, make sure to start the actual text at the margin.
-   =========================================================
-
 * service cores: No longer marked as experimental.
 
   The service cores functions are no longer marked as experimental, and have
@@ -507,16 +460,6 @@ API Changes
 ABI Changes
 -----------
 
-.. This section should contain ABI changes. Sample format:
-
-   * Add a short 1-2 sentence description of the ABI change that was announced
-     in the previous releases and made in this release. Use fixed width quotes
-     for ``rte_function_names`` or ``rte_struct_names``. Use the past tense.
-
-   This section is a comment. Do not overwrite or remove it.
-   Also, make sure to start the actual text at the margin.
-   =========================================================
-
 * ring: The alignment constraints on the ring structure has been relaxed
   to one cache line instead of two, and an empty cache line padding is
   added between the producer and consumer structures. The size of the
@@ -572,17 +515,6 @@ ABI Changes
 Known Issues
 ------------
 
-.. This section should contain new known issues in this release. Sample format:
-
-   * **Add title in present tense with full stop.**
-
-     Add a short 1-2 sentence description of the known issue in the present
-     tense. Add information on any known workarounds.
-
-   This section is a comment. Do not overwrite or remove it.
-   Also, make sure to start the actual text at the margin.
-   =========================================================
-
 * **Secondary process launch is not reliable.**
 
   Recent memory hotplug patches have made multiprocess startup less reliable
@@ -647,17 +579,6 @@ Known Issues
 Shared Library Versions
 -----------------------
 
-.. Update any library version updated in this release and prepend with a ``+``
-   sign, like this:
-
-     librte_acl.so.2
-   + librte_cfgfile.so.2
-     librte_cmdline.so.2
-
-   This section is a comment. Do not overwrite or remove it.
-   =========================================================
-
-
 The libraries prepended with a plus sign were incremented in this version.
 
 .. code-block:: diff
@@ -721,22 +642,6 @@ The libraries prepended with a plus sign were incremented in this version.
 Tested Platforms
 ----------------
 
-.. This section should contain a list of platforms that were tested with this
-   release.
-
-   The format is:
-
-   * <vendor> platform with <vendor> <type of devices> combinations
-
-     * List of CPU
-     * List of OS
-     * List of devices
-     * Other relevant details...
-
-   This section is a comment. Do not overwrite or remove it.
-   Also, make sure to start the actual text at the margin.
-   =========================================================
-
 * Intel(R) platforms with Intel(R) NICs combinations
 
    * CPU
diff --git a/doc/guides/rel_notes/release_18_08.rst b/doc/guides/rel_notes/release_18_08.rst
index 4ae388c331..314723f1e0 100644
--- a/doc/guides/rel_notes/release_18_08.rst
+++ b/doc/guides/rel_notes/release_18_08.rst
@@ -4,46 +4,9 @@
 DPDK Release 18.08
 ==================
 
-.. **Read this first.**
-
-   The text in the sections below explains how to update the release notes.
-
-   Use proper spelling, capitalization and punctuation in all sections.
-
-   Variable and config names should be quoted as fixed width text:
-   ``LIKE_THIS``.
-
-   Build the docs and view the output file to ensure the changes are correct::
-
-      make doc-guides-html
-
-      xdg-open build/doc/html/guides/rel_notes/release_18_08.html
-
-
 New Features
 ------------
 
-.. This section should contain new features added in this release.
-   Sample format:
-
-   * **Add a title in the past tense with a full stop.**
-
-     Add a short 1-2 sentence description in the past tense.
-     The description should be enough to allow someone scanning
-     the release notes to understand the new feature.
-
-     If the feature adds a lot of sub-features you can use a bullet list
-     like this:
-
-     * Added feature foo to do something.
-     * Enhanced feature bar to do something else.
-
-     Refer to the previous release notes for examples.
-
-     This section is a comment. Do not overwrite or remove it.
-     Also, make sure to start the actual text at the margin.
-     =========================================================
-
 * **Added support for Hyper-V netvsc PMD.**
 
   The new ``netvsc`` poll mode driver provides native support for
@@ -121,16 +84,6 @@ New Features
 API Changes
 -----------
 
-.. This section should contain API changes. Sample format:
-
-   * Add a short 1-2 sentence description of the API change.
-     Use fixed width quotes for ``function_names`` or ``struct_names``.
-     Use the past tense.
-
-   This section is a comment. Do not overwrite or remove it.
-   Also, make sure to start the actual text at the margin.
-   =========================================================
-
 * The path to the runtime config file has changed. The new path is determined
   as follows:
 
@@ -221,16 +174,6 @@ API Changes
 Shared Library Versions
 -----------------------
 
-.. Update any library version updated in this release
-   and prepend with a ``+`` sign, like this:
-
-     librte_acl.so.2
-   + librte_cfgfile.so.2
-     librte_cmdline.so.2
-
-   This section is a comment. Do not overwrite or remove it.
-   =========================================================
-
 The libraries prepended with a plus sign were incremented in this version.
 
 .. code-block:: diff
@@ -295,22 +238,6 @@ The libraries prepended with a plus sign were incremented in this version.
 Tested Platforms
 ----------------
 
-.. This section should contain a list of platforms that were tested
-   with this release.
-
-   The format is:
-
-   * <vendor> platform with <vendor> <type of devices> combinations
-
-     * List of CPU
-     * List of OS
-     * List of devices
-     * Other relevant details...
-
-   This section is a comment. Do not overwrite or remove it.
-   Also, make sure to start the actual text at the margin.
-   =========================================================
-
 * Intel(R) platforms with Intel(R) NICs combinations
 
    * CPU
diff --git a/doc/guides/rel_notes/release_18_11.rst b/doc/guides/rel_notes/release_18_11.rst
index 65bab557d4..be52bf0803 100644
--- a/doc/guides/rel_notes/release_18_11.rst
+++ b/doc/guides/rel_notes/release_18_11.rst
@@ -4,56 +4,9 @@
 DPDK Release 18.11
 ==================
 
-.. **Read this first.**
-
-   The text in the sections below explains how to update the release notes.
-
-   Use proper spelling, capitalization and punctuation in all sections.
-
-   Variable and config names should be quoted as fixed width text:
-   ``LIKE_THIS``.
-
-   Build the docs and view the output file to ensure the changes are correct::
-
-      make doc-guides-html
-
-      xdg-open build/doc/html/guides/rel_notes/release_18_11.html
-
-
 New Features
 ------------
 
-.. This section should contain new features added in this release.
-   Sample format:
-
-   * **Add a title in the past tense with a full stop.**
-
-     Add a short 1-2 sentence description in the past tense.
-     The description should be enough to allow someone scanning
-     the release notes to understand the new feature.
-
-     If the feature adds a lot of sub-features you can use a bullet list
-     like this:
-
-     * Added feature foo to do something.
-     * Enhanced feature bar to do something else.
-
-     Refer to the previous release notes for examples.
-
-     Suggested order in release notes items:
-     * Core libs (EAL, mempool, ring, mbuf, buses)
-     * Device abstraction libs and PMDs
-       - ethdev (lib, PMDs)
-       - cryptodev (lib, PMDs)
-       - eventdev (lib, PMDs)
-       - etc
-     * Other libs
-     * Apps, Examples, Tools (if significant)
-
-     This section is a comment. Do not overwrite or remove it.
-     Also, make sure to start the actual text at the margin.
-     =========================================================
-
 * **Added support for using externally allocated memory in DPDK.**
 
   DPDK has added support for creating new ``rte_malloc`` heaps referencing
@@ -356,16 +309,6 @@ New Features
 API Changes
 -----------
 
-.. This section should contain API changes. Sample format:
-
-   * Add a short 1-2 sentence description of the API change.
-     Use fixed width quotes for ``function_names`` or ``struct_names``.
-     Use the past tense.
-
-   This section is a comment. Do not overwrite or remove it.
-   Also, make sure to start the actual text at the margin.
-   =========================================================
-
 * eal: ``rte_memseg_list`` structure now has an additional flag indicating
   whether the memseg list is externally allocated. This will have implications
   for any users of memseg-walk-related functions, as they will now have to skip
@@ -448,17 +391,6 @@ API Changes
 ABI Changes
 -----------
 
-.. This section should contain ABI changes. Sample format:
-
-   * Add a short 1-2 sentence description of the ABI change
-     that was announced in the previous releases and made in this release.
-     Use fixed width quotes for ``function_names`` or ``struct_names``.
-     Use the past tense.
-
-   This section is a comment. Do not overwrite or remove it.
-   Also, make sure to start the actual text at the margin.
-   =========================================================
-
 * eal: added ``legacy_mem`` and ``single_file_segments`` values to
   ``rte_config`` structure on account of improving DPDK usability when
   using either ``--legacy-mem`` or ``--single-file-segments`` flags.
@@ -489,16 +421,6 @@ ABI Changes
 Shared Library Versions
 -----------------------
 
-.. Update any library version updated in this release
-   and prepend with a ``+`` sign, like this:
-
-     librte_acl.so.2
-   + librte_cfgfile.so.2
-     librte_cmdline.so.2
-
-   This section is a comment. Do not overwrite or remove it.
-   =========================================================
-
 The libraries prepended with a plus sign were incremented in this version.
 
 .. code-block:: diff
@@ -564,17 +486,6 @@ The libraries prepended with a plus sign were incremented in this version.
 Known Issues
 ------------
 
-.. This section should contain new known issues in this release. Sample format:
-
-   * **Add title in present tense with full stop.**
-
-     Add a short 1-2 sentence description of the known issue
-     in the present tense. Add information on any known workarounds.
-
-   This section is a comment. Do not overwrite or remove it.
-   Also, make sure to start the actual text at the margin.
-   =========================================================
-
 * When using SR-IOV (VF) support with netvsc PMD and the Mellanox mlx5
   bifurcated driver the Linux netvsc device must be brought up before the
   netvsc device is unbound and passed to the DPDK.
@@ -598,22 +509,6 @@ Known Issues
 Tested Platforms
 ----------------
 
-.. This section should contain a list of platforms that were tested
-   with this release.
-
-   The format is:
-
-   * <vendor> platform with <vendor> <type of devices> combinations
-
-     * List of CPU
-     * List of OS
-     * List of devices
-     * Other relevant details...
-
-   This section is a comment. Do not overwrite or remove it.
-   Also, make sure to start the actual text at the margin.
-   =========================================================
-
 * Intel(R) platforms with Intel(R) NICs combinations
 
    * CPU
diff --git a/doc/guides/rel_notes/release_19_02.rst b/doc/guides/rel_notes/release_19_02.rst
index 87dfbf5c7d..e2b8200739 100644
--- a/doc/guides/rel_notes/release_19_02.rst
+++ b/doc/guides/rel_notes/release_19_02.rst
@@ -4,56 +4,9 @@
 DPDK Release 19.02
 ==================
 
-.. **Read this first.**
-
-   The text in the sections below explains how to update the release notes.
-
-   Use proper spelling, capitalization and punctuation in all sections.
-
-   Variable and config names should be quoted as fixed width text:
-   ``LIKE_THIS``.
-
-   Build the docs and view the output file to ensure the changes are correct::
-
-      make doc-guides-html
-
-      xdg-open build/doc/html/guides/rel_notes/release_19_02.html
-
-
 New Features
 ------------
 
-.. This section should contain new features added in this release.
-   Sample format:
-
-   * **Add a title in the past tense with a full stop.**
-
-     Add a short 1-2 sentence description in the past tense.
-     The description should be enough to allow someone scanning
-     the release notes to understand the new feature.
-
-     If the feature adds a lot of sub-features you can use a bullet list
-     like this:
-
-     * Added feature foo to do something.
-     * Enhanced feature bar to do something else.
-
-     Refer to the previous release notes for examples.
-
-     Suggested order in release notes items:
-     * Core libs (EAL, mempool, ring, mbuf, buses)
-     * Device abstraction libs and PMDs
-       - ethdev (lib, PMDs)
-       - cryptodev (lib, PMDs)
-       - eventdev (lib, PMDs)
-       - etc
-     * Other libs
-     * Apps, Examples, Tools (if significant)
-
-     This section is a comment. Do not overwrite or remove it.
-     Also, make sure to start the actual text at the margin.
-     =========================================================
-
 * **Added support for freeing hugepages exactly as originally allocated.**
 
   Some applications using memory event callbacks (especially for managing
@@ -197,18 +150,6 @@ New Features
 API Changes
 -----------
 
-.. This section should contain API changes. Sample format:
-
-   * sample: Add a short 1-2 sentence description of the API change
-     which was announced in the previous releases and made in this release.
-     Start with a scope label like "ethdev:".
-     Use fixed width quotes for ``function_names`` or ``struct_names``.
-     Use the past tense.
-
-   This section is a comment. Do not overwrite or remove it.
-   Also, make sure to start the actual text at the margin.
-   =========================================================
-
 * eal: Function ``rte_bsf64`` in ``rte_bitmap.h`` has been renamed to
   ``rte_bsf64_safe`` and moved to ``rte_common.h``. A new ``rte_bsf64``
   function has been added in ``rte_common.h`` that follows the convention set
@@ -250,18 +191,6 @@ API Changes
 ABI Changes
 -----------
 
-.. This section should contain ABI changes. Sample format:
-
-   * sample: Add a short 1-2 sentence description of the ABI change
-     which was announced in the previous releases and made in this release.
-     Start with a scope label like "ethdev:".
-     Use fixed width quotes for ``function_names`` or ``struct_names``.
-     Use the past tense.
-
-   This section is a comment. Do not overwrite or remove it.
-   Also, make sure to start the actual text at the margin.
-   =========================================================
-
 * mbuf: The format of the sched field of ``rte_mbuf`` has been changed
   to include the following fields: ``queue ID``, ``traffic class``, ``color``.
 
@@ -281,16 +210,6 @@ ABI Changes
 Shared Library Versions
 -----------------------
 
-.. Update any library version updated in this release
-   and prepend with a ``+`` sign, like this:
-
-     libfoo.so.1
-   + libupdated.so.2
-     libbar.so.1
-
-   This section is a comment. Do not overwrite or remove it.
-   =========================================================
-
 The libraries prepended with a plus sign were incremented in this version.
 
 .. code-block:: diff
@@ -356,17 +275,6 @@ The libraries prepended with a plus sign were incremented in this version.
 Known Issues
 ------------
 
-.. This section should contain new known issues in this release. Sample format:
-
-   * **Add title in present tense with full stop.**
-
-     Add a short 1-2 sentence description of the known issue
-     in the present tense. Add information on any known workarounds.
-
-   This section is a comment. Do not overwrite or remove it.
-   Also, make sure to start the actual text at the margin.
-   =========================================================
-
 * ``AVX-512`` support has been disabled for ``GCC`` builds when ``binutils 2.30``
   is detected [1] because of a crash [2]. This can affect ``native`` machine type
   build targets on the platforms that support ``AVX512F`` like ``Intel Skylake``
@@ -386,22 +294,6 @@ Known Issues
 Tested Platforms
 ----------------
 
-.. This section should contain a list of platforms that were tested
-   with this release.
-
-   The format is:
-
-   * <vendor> platform with <vendor> <type of devices> combinations
-
-     * List of CPU
-     * List of OS
-     * List of devices
-     * Other relevant details...
-
-   This section is a comment. Do not overwrite or remove it.
-   Also, make sure to start the actual text at the margin.
-   =========================================================
-
 * Intel(R) platforms with Intel(R) NICs combinations
 
    * CPU
diff --git a/doc/guides/rel_notes/release_19_05.rst b/doc/guides/rel_notes/release_19_05.rst
index b4c6972e35..30f704e204 100644
--- a/doc/guides/rel_notes/release_19_05.rst
+++ b/doc/guides/rel_notes/release_19_05.rst
@@ -4,56 +4,9 @@
 DPDK Release 19.05
 ==================
 
-.. **Read this first.**
-
-   The text in the sections below explains how to update the release notes.
-
-   Use proper spelling, capitalization and punctuation in all sections.
-
-   Variable and config names should be quoted as fixed width text:
-   ``LIKE_THIS``.
-
-   Build the docs and view the output file to ensure the changes are correct::
-
-      make doc-guides-html
-
-      xdg-open build/doc/html/guides/rel_notes/release_19_05.html
-
-
 New Features
 ------------
 
-.. This section should contain new features added in this release.
-   Sample format:
-
-   * **Add a title in the past tense with a full stop.**
-
-     Add a short 1-2 sentence description in the past tense.
-     The description should be enough to allow someone scanning
-     the release notes to understand the new feature.
-
-     If the feature adds a lot of sub-features you can use a bullet list
-     like this:
-
-     * Added feature foo to do something.
-     * Enhanced feature bar to do something else.
-
-     Refer to the previous release notes for examples.
-
-     Suggested order in release notes items:
-     * Core libs (EAL, mempool, ring, mbuf, buses)
-     * Device abstraction libs and PMDs
-       - ethdev (lib, PMDs)
-       - cryptodev (lib, PMDs)
-       - eventdev (lib, PMDs)
-       - etc
-     * Other libs
-     * Apps, Examples, Tools (if significant)
-
-     This section is a comment. Do not overwrite or remove it.
-     Also, make sure to start the actual text at the margin.
-     =========================================================
-
 * **Added new armv8 machine targets.**
 
   Added new armv8 machine targets:
@@ -258,18 +211,6 @@ New Features
 API Changes
 -----------
 
-.. This section should contain API changes. Sample format:
-
-   * sample: Add a short 1-2 sentence description of the API change
-     which was announced in the previous releases and made in this release.
-     Start with a scope label like "ethdev:".
-     Use fixed width quotes for ``function_names`` or ``struct_names``.
-     Use the past tense.
-
-   This section is a comment. Do not overwrite or remove it.
-   Also, make sure to start the actual text at the margin.
-   =========================================================
-
 * eal: the type of the ``attr_value`` parameter of the function
   ``rte_service_attr_get()`` has been changed
   from ``uint32_t *`` to ``uint64_t *``.
@@ -295,18 +236,6 @@ API Changes
 ABI Changes
 -----------
 
-.. This section should contain ABI changes. Sample format:
-
-   * sample: Add a short 1-2 sentence description of the ABI change
-     which was announced in the previous releases and made in this release.
-     Start with a scope label like "ethdev:".
-     Use fixed width quotes for ``function_names`` or ``struct_names``.
-     Use the past tense.
-
-   This section is a comment. Do not overwrite or remove it.
-   Also, make sure to start the actual text at the margin.
-   =========================================================
-
 * ethdev: Additional fields in rte_eth_dev_info.
 
   The ``rte_eth_dev_info`` structure has had two extra fields
@@ -328,16 +257,6 @@ ABI Changes
 Shared Library Versions
 -----------------------
 
-.. Update any library version updated in this release
-   and prepend with a ``+`` sign, like this:
-
-     libfoo.so.1
-   + libupdated.so.2
-     libbar.so.1
-
-   This section is a comment. Do not overwrite or remove it.
-   =========================================================
-
 The libraries prepended with a plus sign were incremented in this version.
 
 .. code-block:: diff
@@ -406,17 +325,6 @@ The libraries prepended with a plus sign were incremented in this version.
 Known Issues
 ------------
 
-.. This section should contain new known issues in this release. Sample format:
-
-   * **Add title in present tense with full stop.**
-
-     Add a short 1-2 sentence description of the known issue
-     in the present tense. Add information on any known workarounds.
-
-   This section is a comment. Do not overwrite or remove it.
-   Also, make sure to start the actual text at the margin.
-   =========================================================
-
 * **On x86 platforms, AVX512 support is disabled with binutils 2.31.**
 
   Due to a defect in binutils 2.31 AVX512 support is disabled.
@@ -433,22 +341,6 @@ Known Issues
 Tested Platforms
 ----------------
 
-.. This section should contain a list of platforms that were tested
-   with this release.
-
-   The format is:
-
-   * <vendor> platform with <vendor> <type of devices> combinations
-
-     * List of CPU
-     * List of OS
-     * List of devices
-     * Other relevant details...
-
-   This section is a comment. Do not overwrite or remove it.
-   Also, make sure to start the actual text at the margin.
-   =========================================================
-
 * Intel(R) platforms with Intel(R) NICs combinations
 
   * CPU
diff --git a/doc/guides/rel_notes/release_19_08.rst b/doc/guides/rel_notes/release_19_08.rst
index d2baa828b1..9ea2f2eee9 100644
--- a/doc/guides/rel_notes/release_19_08.rst
+++ b/doc/guides/rel_notes/release_19_08.rst
@@ -6,56 +6,9 @@
 DPDK Release 19.08
 ==================
 
-.. **Read this first.**
-
-   The text in the sections below explains how to update the release notes.
-
-   Use proper spelling, capitalization and punctuation in all sections.
-
-   Variable and config names should be quoted as fixed width text:
-   ``LIKE_THIS``.
-
-   Build the docs and view the output file to ensure the changes are correct::
-
-      make doc-guides-html
-
-      xdg-open build/doc/html/guides/rel_notes/release_19_08.html
-
-
 New Features
 ------------
 
-.. This section should contain new features added in this release.
-   Sample format:
-
-   * **Add a title in the past tense with a full stop.**
-
-     Add a short 1-2 sentence description in the past tense.
-     The description should be enough to allow someone scanning
-     the release notes to understand the new feature.
-
-     If the feature adds a lot of sub-features you can use a bullet list
-     like this:
-
-     * Added feature foo to do something.
-     * Enhanced feature bar to do something else.
-
-     Refer to the previous release notes for examples.
-
-     Suggested order in release notes items:
-     * Core libs (EAL, mempool, ring, mbuf, buses)
-     * Device abstraction libs and PMDs
-       - ethdev (lib, PMDs)
-       - cryptodev (lib, PMDs)
-       - eventdev (lib, PMDs)
-       - etc
-     * Other libs
-     * Apps, Examples, Tools (if significant)
-
-     This section is a comment. Do not overwrite or remove it.
-     Also, make sure to start the actual text at the margin.
-     =========================================================
-
 * **EAL will now pick IOVA as VA mode as the default in most cases.**
 
   Previously, the preferred default IOVA mode was selected to be IOVA as PA. The
@@ -243,15 +196,6 @@ New Features
 Removed Items
 -------------
 
-.. This section should contain removed items in this release. Sample format:
-
-   * Add a short 1-2 sentence description of the removed item
-     in the past tense.
-
-   This section is a comment. Do not overwrite or remove it.
-   Also, make sure to start the actual text at the margin.
-   =========================================================
-
 * Removed KNI ethtool, ``CONFIG_RTE_KNI_KMOD_ETHTOOL``, support.
 
 * build: armv8 crypto extension is disabled.
@@ -260,18 +204,6 @@ Removed Items
 API Changes
 -----------
 
-.. This section should contain API changes. Sample format:
-
-   * sample: Add a short 1-2 sentence description of the API change
-     which was announced in the previous releases and made in this release.
-     Start with a scope label like "ethdev:".
-     Use fixed width quotes for ``function_names`` or ``struct_names``.
-     Use the past tense.
-
-   This section is a comment. Do not overwrite or remove it.
-   Also, make sure to start the actual text at the margin.
-   =========================================================
-
 * The ``rte_mem_config`` structure has been made private. New accessor
   ``rte_mcfg_*`` functions were introduced to provide replacement for direct
   access to the shared mem config.
@@ -321,18 +253,6 @@ API Changes
 ABI Changes
 -----------
 
-.. This section should contain ABI changes. Sample format:
-
-   * sample: Add a short 1-2 sentence description of the ABI change
-     which was announced in the previous releases and made in this release.
-     Start with a scope label like "ethdev:".
-     Use fixed width quotes for ``function_names`` or ``struct_names``.
-     Use the past tense.
-
-   This section is a comment. Do not overwrite or remove it.
-   Also, make sure to start the actual text at the margin.
-   =========================================================
-
 * eventdev: Event based Rx adapter callback
 
   The mbuf pointer array in the event eth Rx adapter callback
@@ -365,16 +285,6 @@ ABI Changes
 Shared Library Versions
 -----------------------
 
-.. Update any library version updated in this release
-   and prepend with a ``+`` sign, like this:
-
-     libfoo.so.1
-   + libupdated.so.2
-     libbar.so.1
-
-   This section is a comment. Do not overwrite or remove it.
-   =========================================================
-
 The libraries prepended with a plus sign were incremented in this version.
 
 .. code-block:: diff
@@ -443,17 +353,6 @@ The libraries prepended with a plus sign were incremented in this version.
 Known Issues
 ------------
 
-.. This section should contain new known issues in this release. Sample format:
-
-   * **Add title in present tense with full stop.**
-
-     Add a short 1-2 sentence description of the known issue
-     in the present tense. Add information on any known workarounds.
-
-   This section is a comment. Do not overwrite or remove it.
-   Also, make sure to start the actual text at the margin.
-   =========================================================
-
 * **Unsuitable IOVA mode may be picked as the default.**
 
   Not all kernel drivers and not all devices support all IOVA modes. EAL will
@@ -467,22 +366,6 @@ Known Issues
 Tested Platforms
 ----------------
 
-.. This section should contain a list of platforms that were tested
-   with this release.
-
-   The format is:
-
-   * <vendor> platform with <vendor> <type of devices> combinations
-
-     * List of CPU
-     * List of OS
-     * List of devices
-     * Other relevant details...
-
-   This section is a comment. Do not overwrite or remove it.
-   Also, make sure to start the actual text at the margin.
-   =========================================================
-
 * Intel(R) platforms with Intel(R) NICs combinations
 
    * CPU
diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst
index 0261d28431..b509a6dd28 100644
--- a/doc/guides/rel_notes/release_19_11.rst
+++ b/doc/guides/rel_notes/release_19_11.rst
@@ -6,56 +6,9 @@
 DPDK Release 19.11
 ==================
 
-.. **Read this first.**
-
-   The text in the sections below explains how to update the release notes.
-
-   Use proper spelling, capitalization and punctuation in all sections.
-
-   Variable and config names should be quoted as fixed width text:
-   ``LIKE_THIS``.
-
-   Build the docs and view the output file to ensure the changes are correct::
-
-      make doc-guides-html
-
-      xdg-open build/doc/html/guides/rel_notes/release_19_11.html
-
-
 New Features
 ------------
 
-.. This section should contain new features added in this release.
-   Sample format:
-
-   * **Add a title in the past tense with a full stop.**
-
-     Add a short 1-2 sentence description in the past tense.
-     The description should be enough to allow someone scanning
-     the release notes to understand the new feature.
-
-     If the feature adds a lot of sub-features you can use a bullet list
-     like this:
-
-     * Added feature foo to do something.
-     * Enhanced feature bar to do something else.
-
-     Refer to the previous release notes for examples.
-
-     Suggested order in release notes items:
-     * Core libs (EAL, mempool, ring, mbuf, buses)
-     * Device abstraction libs and PMDs
-       - ethdev (lib, PMDs)
-       - cryptodev (lib, PMDs)
-       - eventdev (lib, PMDs)
-       - etc
-     * Other libs
-     * Apps, Examples, Tools (if significant)
-
-     This section is a comment. Do not overwrite or remove it.
-     Also, make sure to start the actual text at the margin.
-     =========================================================
-
 * **Added support for --base-virtaddr EAL option to FreeBSD.**
 
   The FreeBSD version of DPDK now also supports setting base virtual address
@@ -346,15 +299,6 @@ New Features
 Removed Items
 -------------
 
-.. This section should contain removed items in this release. Sample format:
-
-   * Add a short 1-2 sentence description of the removed item
-     in the past tense.
-
-   This section is a comment. Do not overwrite or remove it.
-   Also, make sure to start the actual text at the margin.
-   =========================================================
-
 * Removed library-level ABI versions. These have been replaced with a single
   project-level ABI version for non-experimental libraries and an ABI version of
   ``0`` for experimental libraries. Review the :doc:`../contributing/abi_policy`
@@ -390,18 +334,6 @@ Removed Items
 API Changes
 -----------
 
-.. This section should contain API changes. Sample format:
-
-   * sample: Add a short 1-2 sentence description of the API change
-     which was announced in the previous releases and made in this release.
-     Start with a scope label like "ethdev:".
-     Use fixed width quotes for ``function_names`` or ``struct_names``.
-     Use the past tense.
-
-   This section is a comment. Do not overwrite or remove it.
-   Also, make sure to start the actual text at the margin.
-   =========================================================
-
 * eal: made the ``lcore_config`` struct and global symbol private.
 
 * eal: removed the ``rte_cpu_check_supported`` function, replaced by
@@ -486,18 +418,6 @@ API Changes
 ABI Changes
 -----------
 
-.. This section should contain ABI changes. Sample format:
-
-   * sample: Add a short 1-2 sentence description of the ABI change
-     which was announced in the previous releases and made in this release.
-     Start with a scope label like "ethdev:".
-     Use fixed width quotes for ``function_names`` or ``struct_names``.
-     Use the past tense.
-
-   This section is a comment. Do not overwrite or remove it.
-   Also, make sure to start the actual text at the margin.
-   =========================================================
-
 * policy: Please note the revisions to the :doc:`../contributing/abi_policy`
   introducing major ABI versions, with DPDK 19.11 becoming the first major
   version ``v20``. ABI changes to add new features continue to be permitted in
@@ -530,16 +450,6 @@ ABI Changes
 Shared Library Versions
 -----------------------
 
-.. Update any library version updated in this release
-   and prepend with a ``+`` sign, like this:
-
-     libfoo.so.1
-   + libupdated.so.2
-     libbar.so.1
-
-   This section is a comment. Do not overwrite or remove it.
-   =========================================================
-
 The libraries prepended with a plus sign were incremented in this version.
 
 .. code-block:: diff
@@ -607,40 +517,9 @@ The libraries prepended with a plus sign were incremented in this version.
      librte_vhost.so.4
 
 
-Known Issues
-------------
-
-.. This section should contain new known issues in this release. Sample format:
-
-   * **Add title in present tense with full stop.**
-
-     Add a short 1-2 sentence description of the known issue
-     in the present tense. Add information on any known workarounds.
-
-   This section is a comment. Do not overwrite or remove it.
-   Also, make sure to start the actual text at the margin.
-   =========================================================
-
-
 Tested Platforms
 ----------------
 
-.. This section should contain a list of platforms that were tested
-   with this release.
-
-   The format is:
-
-   * <vendor> platform with <vendor> <type of devices> combinations
-
-     * List of CPU
-     * List of OS
-     * List of devices
-     * Other relevant details...
-
-   This section is a comment. Do not overwrite or remove it.
-   Also, make sure to start the actual text at the margin.
-   =========================================================
-
 * Intel\ |reg| platforms with Intel\ |reg| NICs combinations
 
   * CPU
diff --git a/doc/guides/rel_notes/release_20_02.rst b/doc/guides/rel_notes/release_20_02.rst
index 40ebbfac90..fd53973b20 100644
--- a/doc/guides/rel_notes/release_20_02.rst
+++ b/doc/guides/rel_notes/release_20_02.rst
@@ -6,56 +6,9 @@
 DPDK Release 20.02
 ==================
 
-.. **Read this first.**
-
-   The text in the sections below explains how to update the release notes.
-
-   Use proper spelling, capitalization and punctuation in all sections.
-
-   Variable and config names should be quoted as fixed width text:
-   ``LIKE_THIS``.
-
-   Build the docs and view the output file to ensure the changes are correct::
-
-      make doc-guides-html
-
-      xdg-open build/doc/html/guides/rel_notes/release_20_02.html
-
-
 New Features
 ------------
 
-.. This section should contain new features added in this release.
-   Sample format:
-
-   * **Add a title in the past tense with a full stop.**
-
-     Add a short 1-2 sentence description in the past tense.
-     The description should be enough to allow someone scanning
-     the release notes to understand the new feature.
-
-     If the feature adds a lot of sub-features you can use a bullet list
-     like this:
-
-     * Added feature foo to do something.
-     * Enhanced feature bar to do something else.
-
-     Refer to the previous release notes for examples.
-
-     Suggested order in release notes items:
-     * Core libs (EAL, mempool, ring, mbuf, buses)
-     * Device abstraction libs and PMDs
-       - ethdev (lib, PMDs)
-       - cryptodev (lib, PMDs)
-       - eventdev (lib, PMDs)
-       - etc
-     * Other libs
-     * Apps, Examples, Tools (if significant)
-
-     This section is a comment. Do not overwrite or remove it.
-     Also, make sure to start the actual text at the margin.
-     =========================================================
-
 * **Added Wait Until Equal API.**
 
   A new API has been added to wait for a memory location to be updated with a
@@ -255,15 +208,6 @@ New Features
 Removed Items
 -------------
 
-.. This section should contain removed items in this release. Sample format:
-
-   * Add a short 1-2 sentence description of the removed item
-     in the past tense.
-
-   This section is a comment. Do not overwrite or remove it.
-   Also, make sure to start the actual text at the margin.
-   =========================================================
-
 * **Disabled building all the Linux kernel modules by default.**
 
   In order to remove the build time dependency on the Linux kernel,
@@ -283,18 +227,6 @@ Removed Items
 API Changes
 -----------
 
-.. This section should contain API changes. Sample format:
-
-   * sample: Add a short 1-2 sentence description of the API change
-     which was announced in the previous releases and made in this release.
-     Start with a scope label like "ethdev:".
-     Use fixed width quotes for ``function_names`` or ``struct_names``.
-     Use the past tense.
-
-   This section is a comment. Do not overwrite or remove it.
-   Also, make sure to start the actual text at the margin.
-   =========================================================
-
 * No change in this release.
 
 
@@ -303,18 +235,6 @@ API Changes
 ABI Changes
 -----------
 
-.. This section should contain ABI changes. Sample format:
-
-   * sample: Add a short 1-2 sentence description of the ABI change
-     which was announced in the previous releases and made in this release.
-     Start with a scope label like "ethdev:".
-     Use fixed width quotes for ``function_names`` or ``struct_names``.
-     Use the past tense.
-
-   This section is a comment. Do not overwrite or remove it.
-   Also, make sure to start the actual text at the margin.
-   =========================================================
-
 * No change, kept ABI v20. DPDK 20.02 is compatible with DPDK 19.11.
 
 * The soname for each stable ABI version should be just the ABI version major
@@ -331,22 +251,6 @@ ABI Changes
 Tested Platforms
 ----------------
 
-.. This section should contain a list of platforms that were tested
-   with this release.
-
-   The format is:
-
-   * <vendor> platform with <vendor> <type of devices> combinations
-
-     * List of CPU
-     * List of OS
-     * List of devices
-     * Other relevant details...
-
-   This section is a comment. Do not overwrite or remove it.
-   Also, make sure to start the actual text at the margin.
-   =========================================================
-
 * Intel\ |reg| platforms with Intel\ |reg| NICs combinations
 
   * CPU
diff --git a/doc/guides/rel_notes/release_20_05.rst b/doc/guides/rel_notes/release_20_05.rst
index b59576a575..a38c6c673d 100644
--- a/doc/guides/rel_notes/release_20_05.rst
+++ b/doc/guides/rel_notes/release_20_05.rst
@@ -6,56 +6,9 @@
 DPDK Release 20.05
 ==================
 
-.. **Read this first.**
-
-   The text in the sections below explains how to update the release notes.
-
-   Use proper spelling, capitalization and punctuation in all sections.
-
-   Variable and config names should be quoted as fixed width text:
-   ``LIKE_THIS``.
-
-   Build the docs and view the output file to ensure the changes are correct::
-
-      make doc-guides-html
-
-      xdg-open build/doc/html/guides/rel_notes/release_20_05.html
-
-
 New Features
 ------------
 
-.. This section should contain new features added in this release.
-   Sample format:
-
-   * **Add a title in the past tense with a full stop.**
-
-     Add a short 1-2 sentence description in the past tense.
-     The description should be enough to allow someone scanning
-     the release notes to understand the new feature.
-
-     If the feature adds a lot of sub-features you can use a bullet list
-     like this:
-
-     * Added feature foo to do something.
-     * Enhanced feature bar to do something else.
-
-     Refer to the previous release notes for examples.
-
-     Suggested order in release notes items:
-     * Core libs (EAL, mempool, ring, mbuf, buses)
-     * Device abstraction libs and PMDs
-       - ethdev (lib, PMDs)
-       - cryptodev (lib, PMDs)
-       - eventdev (lib, PMDs)
-       - etc
-     * Other libs
-     * Apps, Examples, Tools (if significant)
-
-     This section is a comment. Do not overwrite or remove it.
-     Also, make sure to start the actual text at the margin.
-     =========================================================
-
 * **Added Trace Library and Tracepoints.**
 
   Added a native implementation of the "common trace format" (CTF) based trace
@@ -351,18 +304,6 @@ New Features
 API Changes
 -----------
 
-.. This section should contain API changes. Sample format:
-
-   * sample: Add a short 1-2 sentence description of the API change
-     which was announced in the previous releases and made in this release.
-     Start with a scope label like "ethdev:".
-     Use fixed width quotes for ``function_names`` or ``struct_names``.
-     Use the past tense.
-
-   This section is a comment. Do not overwrite or remove it.
-   Also, make sure to start the actual text at the margin.
-   =========================================================
-
 * mempool: The API of ``rte_mempool_populate_iova()`` and
   ``rte_mempool_populate_virt()`` changed to return 0 instead of ``-EINVAL``
   when there is not enough room to store one object.
@@ -371,40 +312,12 @@ API Changes
 ABI Changes
 -----------
 
-.. This section should contain ABI changes. Sample format:
-
-   * sample: Add a short 1-2 sentence description of the ABI change
-     which was announced in the previous releases and made in this release.
-     Start with a scope label like "ethdev:".
-     Use fixed width quotes for ``function_names`` or ``struct_names``.
-     Use the past tense.
-
-   This section is a comment. Do not overwrite or remove it.
-   Also, make sure to start the actual text at the margin.
-   =========================================================
-
 * No ABI change that would break compatibility with DPDK 20.02 and 19.11.
 
 
 Tested Platforms
 ----------------
 
-.. This section should contain a list of platforms that were tested
-   with this release.
-
-   The format is:
-
-   * <vendor> platform with <vendor> <type of devices> combinations
-
-     * List of CPU
-     * List of OS
-     * List of devices
-     * Other relevant details...
-
-   This section is a comment. Do not overwrite or remove it.
-   Also, make sure to start the actual text at the margin.
-   =========================================================
-
 * Intel\ |reg| platforms with Broadcom\ |reg| NICs combinations
 
   * CPU:
diff --git a/doc/guides/rel_notes/release_20_08.rst b/doc/guides/rel_notes/release_20_08.rst
index a19ec6db2b..445e40fbac 100644
--- a/doc/guides/rel_notes/release_20_08.rst
+++ b/doc/guides/rel_notes/release_20_08.rst
@@ -6,56 +6,9 @@
 DPDK Release 20.08
 ==================
 
-.. **Read this first.**
-
-   The text in the sections below explains how to update the release notes.
-
-   Use proper spelling, capitalization and punctuation in all sections.
-
-   Variable and config names should be quoted as fixed width text:
-   ``LIKE_THIS``.
-
-   Build the docs and view the output file to ensure the changes are correct::
-
-      make doc-guides-html
-
-      xdg-open build/doc/html/guides/rel_notes/release_20_08.html
-
-
 New Features
 ------------
 
-.. This section should contain new features added in this release.
-   Sample format:
-
-   * **Add a title in the past tense with a full stop.**
-
-     Add a short 1-2 sentence description in the past tense.
-     The description should be enough to allow someone scanning
-     the release notes to understand the new feature.
-
-     If the feature adds a lot of sub-features you can use a bullet list
-     like this:
-
-     * Added feature foo to do something.
-     * Enhanced feature bar to do something else.
-
-     Refer to the previous release notes for examples.
-
-     Suggested order in release notes items:
-     * Core libs (EAL, mempool, ring, mbuf, buses)
-     * Device abstraction libs and PMDs
-       - ethdev (lib, PMDs)
-       - cryptodev (lib, PMDs)
-       - eventdev (lib, PMDs)
-       - etc
-     * Other libs
-     * Apps, Examples, Tools (if significant)
-
-     This section is a comment. Do not overwrite or remove it.
-     Also, make sure to start the actual text at the margin.
-     =========================================================
-
 * **Added non-EAL threads registration API.**
 
   Added a new API to register non-EAL threads as lcores. This can be used by
@@ -276,33 +229,12 @@ New Features
 Removed Items
 -------------
 
-.. This section should contain removed items in this release. Sample format:
-
-   * Add a short 1-2 sentence description of the removed item
-     in the past tense.
-
-   This section is a comment. Do not overwrite or remove it.
-   Also, make sure to start the actual text at the margin.
-   =========================================================
-
 * Removed ``RTE_KDRV_NONE`` based PCI device driver probing.
 
 
 API Changes
 -----------
 
-.. This section should contain API changes. Sample format:
-
-   * sample: Add a short 1-2 sentence description of the API change
-     which was announced in the previous releases and made in this release.
-     Start with a scope label like "ethdev:".
-     Use fixed width quotes for ``function_names`` or ``struct_names``.
-     Use the past tense.
-
-   This section is a comment. Do not overwrite or remove it.
-   Also, make sure to start the actual text at the margin.
-   =========================================================
-
 * ``rte_page_sizes`` enumeration is replaced with ``RTE_PGSIZE_xxx`` defines.
 
 * vhost: The API of ``rte_vhost_host_notifier_ctrl`` was changed to be per
@@ -312,35 +244,12 @@ API Changes
 ABI Changes
 -----------
 
-.. This section should contain ABI changes. Sample format:
-
-   * sample: Add a short 1-2 sentence description of the ABI change
-     which was announced in the previous releases and made in this release.
-     Start with a scope label like "ethdev:".
-     Use fixed width quotes for ``function_names`` or ``struct_names``.
-     Use the past tense.
-
-   This section is a comment. Do not overwrite or remove it.
-   Also, make sure to start the actual text at the margin.
-   =========================================================
-
 * No ABI change that would break compatibility with 19.11.
 
 
 Known Issues
 ------------
 
-.. This section should contain new known issues in this release. Sample format:
-
-   * **Add title in present tense with full stop.**
-
-     Add a short 1-2 sentence description of the known issue
-     in the present tense. Add information on any known workarounds.
-
-   This section is a comment. Do not overwrite or remove it.
-   Also, make sure to start the actual text at the margin.
-   =========================================================
-
 * **mlx5 PMD does not work on Power 9 with OFED 5.1-0.6.6.0.**
 
   Consider using the newer OFED releases, the previous
@@ -350,22 +259,6 @@ Known Issues
 Tested Platforms
 ----------------
 
-.. This section should contain a list of platforms that were tested
-   with this release.
-
-   The format is:
-
-   * <vendor> platform with <vendor> <type of devices> combinations
-
-     * List of CPU
-     * List of OS
-     * List of devices
-     * Other relevant details...
-
-   This section is a comment. Do not overwrite or remove it.
-   Also, make sure to start the actual text at the margin.
-   =========================================================
-
 * Intel\ |reg| platforms with Intel\ |reg| NICs combinations
 
   * CPU
diff --git a/doc/guides/rel_notes/release_20_11.rst b/doc/guides/rel_notes/release_20_11.rst
index d07fd815dc..90cc3ed680 100644
--- a/doc/guides/rel_notes/release_20_11.rst
+++ b/doc/guides/rel_notes/release_20_11.rst
@@ -6,55 +6,9 @@
 DPDK Release 20.11
 ==================
 
-.. **Read this first.**
-
-   The text in the sections below explains how to update the release notes.
-
-   Use proper spelling, capitalization and punctuation in all sections.
-
-   Variable and config names should be quoted as fixed width text:
-   ``LIKE_THIS``.
-
-   Build the docs and view the output file to ensure the changes are correct::
-
-      make doc-guides-html
-      xdg-open build/doc/html/guides/rel_notes/release_20_11.html
-
-
 New Features
 ------------
 
-.. This section should contain new features added in this release.
-   Sample format:
-
-   * **Add a title in the past tense with a full stop.**
-
-     Add a short 1-2 sentence description in the past tense.
-     The description should be enough to allow someone scanning
-     the release notes to understand the new feature.
-
-     If the feature adds a lot of sub-features you can use a bullet list
-     like this:
-
-     * Added feature foo to do something.
-     * Enhanced feature bar to do something else.
-
-     Refer to the previous release notes for examples.
-
-     Suggested order in release notes items:
-     * Core libs (EAL, mempool, ring, mbuf, buses)
-     * Device abstraction libs and PMDs
-       - ethdev (lib, PMDs)
-       - cryptodev (lib, PMDs)
-       - eventdev (lib, PMDs)
-       - etc
-     * Other libs
-     * Apps, Examples, Tools (if significant)
-
-     This section is a comment. Do not overwrite or remove it.
-     Also, make sure to start the actual text at the margin.
-     =======================================================
-
 * **Added write combining store APIs.**
 
   Added ``rte_write32_wc`` and ``rte_write32_wc_relaxed`` APIs
@@ -432,15 +386,6 @@ New Features
 Removed Items
 -------------
 
-.. This section should contain removed items in this release. Sample format:
-
-   * Add a short 1-2 sentence description of the removed item
-     in the past tense.
-
-   This section is a comment. Do not overwrite or remove it.
-   Also, make sure to start the actual text at the margin.
-   =======================================================
-
 * build: Support for the Make build system has been removed from DPDK.
   Meson is now the primary build system.
   Sample applications can still be built with Make standalone, using pkg-config.
@@ -462,18 +407,6 @@ Removed Items
 API Changes
 -----------
 
-.. This section should contain API changes. Sample format:
-
-   * sample: Add a short 1-2 sentence description of the API change
-     which was announced in the previous releases and made in this release.
-     Start with a scope label like "ethdev:".
-     Use fixed width quotes for ``function_names`` or ``struct_names``.
-     Use the past tense.
-
-   This section is a comment. Do not overwrite or remove it.
-   Also, make sure to start the actual text at the margin.
-   =======================================================
-
 * build macros: The macros defining ``RTE_MACHINE_CPUFLAG_*`` have been removed.
   The information provided by these macros is now available through standard
   compiler macros.
@@ -666,18 +599,6 @@ API Changes
 ABI Changes
 -----------
 
-.. This section should contain ABI changes. Sample format:
-
-   * sample: Add a short 1-2 sentence description of the ABI change
-     which was announced in the previous releases and made in this release.
-     Start with a scope label like "ethdev:".
-     Use fixed width quotes for ``function_names`` or ``struct_names``.
-     Use the past tense.
-
-   This section is a comment. Do not overwrite or remove it.
-   Also, make sure to start the actual text at the margin.
-   =======================================================
-
 * eal: Removed the unimplemented function ``rte_dump_registers()``.
 
 * ``ethdev`` changes
@@ -732,22 +653,6 @@ ABI Changes
 Tested Platforms
 ----------------
 
-.. This section should contain a list of platforms that were tested
-   with this release.
-
-   The format is:
-
-   * <vendor> platform with <vendor> <type of devices> combinations
-
-     * List of CPU
-     * List of OS
-     * List of devices
-     * Other relevant details...
-
-   This section is a comment. Do not overwrite or remove it.
-   Also, make sure to start the actual text at the margin.
-   =======================================================
-
 * Intel\ |reg| platforms with Intel\ |reg| NICs combinations
 
   * CPU
diff --git a/doc/guides/rel_notes/release_21_02.rst b/doc/guides/rel_notes/release_21_02.rst
index 1813fe767a..9d5e17758f 100644
--- a/doc/guides/rel_notes/release_21_02.rst
+++ b/doc/guides/rel_notes/release_21_02.rst
@@ -6,20 +6,6 @@
 DPDK Release 21.02
 ==================
 
-.. **Read this first.**
-
-   The text in the sections below explains how to update the release notes.
-
-   Use proper spelling, capitalization and punctuation in all sections.
-
-   Variable and config names should be quoted as fixed width text:
-   ``LIKE_THIS``.
-
-   Build the docs and view the output file to ensure the changes are correct::
-
-      make doc-guides-html
-      xdg-open build/doc/html/guides/rel_notes/release_21_02.html
-
 .. note::
 
    A **dependency** has been added for building DPDK on Linux or FreeBSD:
@@ -34,37 +20,6 @@ DPDK Release 21.02
 New Features
 ------------
 
-.. This section should contain new features added in this release.
-   Sample format:
-
-   * **Add a title in the past tense with a full stop.**
-
-     Add a short 1-2 sentence description in the past tense.
-     The description should be enough to allow someone scanning
-     the release notes to understand the new feature.
-
-     If the feature adds a lot of sub-features you can use a bullet list
-     like this:
-
-     * Added feature foo to do something.
-     * Enhanced feature bar to do something else.
-
-     Refer to the previous release notes for examples.
-
-     Suggested order in release notes items:
-     * Core libs (EAL, mempool, ring, mbuf, buses)
-     * Device abstraction libs and PMDs
-       - ethdev (lib, PMDs)
-       - cryptodev (lib, PMDs)
-       - eventdev (lib, PMDs)
-       - etc
-     * Other libs
-     * Apps, Examples, Tools (if significant)
-
-     This section is a comment. Do not overwrite or remove it.
-     Also, make sure to start the actual text at the margin.
-     =======================================================
-
 * **Added new ethdev API for PMD power management.**
 
   Added ``rte_eth_get_monitor_addr()``, to be used in conjunction with
@@ -209,15 +164,6 @@ New Features
 Removed Items
 -------------
 
-.. This section should contain removed items in this release. Sample format:
-
-   * Add a short 1-2 sentence description of the removed item
-     in the past tense.
-
-   This section is a comment. Do not overwrite or remove it.
-   Also, make sure to start the actual text at the margin.
-   =======================================================
-
 * The internal header files ``rte_ethdev_driver.h``, ``rte_ethdev_vdev.h`` and
   ``rte_ethdev_pci.h`` are no longer installed as part of the DPDK
   ``ninja install`` action and are renamed to ``ethdev_driver.h``,
@@ -243,18 +189,6 @@ Removed Items
 API Changes
 -----------
 
-.. This section should contain API changes. Sample format:
-
-   * sample: Add a short 1-2 sentence description of the API change
-     which was announced in the previous releases and made in this release.
-     Start with a scope label like "ethdev:".
-     Use fixed width quotes for ``function_names`` or ``struct_names``.
-     Use the past tense.
-
-   This section is a comment. Do not overwrite or remove it.
-   Also, make sure to start the actual text at the margin.
-   =======================================================
-
 * config: Removed the old macros, included in ``rte_config.h``,
   to indicate which DPDK libraries and drivers are built.
   The new macros are generated by meson in a standardized format:
@@ -269,18 +203,6 @@ API Changes
 ABI Changes
 -----------
 
-.. This section should contain ABI changes. Sample format:
-
-   * sample: Add a short 1-2 sentence description of the ABI change
-     which was announced in the previous releases and made in this release.
-     Start with a scope label like "ethdev:".
-     Use fixed width quotes for ``function_names`` or ``struct_names``.
-     Use the past tense.
-
-   This section is a comment. Do not overwrite or remove it.
-   Also, make sure to start the actual text at the margin.
-   =======================================================
-
 * No ABI change that would break compatibility with 20.11.
 
 * The experimental function ``rte_telemetry_init`` has been removed from the
@@ -292,22 +214,6 @@ ABI Changes
 Tested Platforms
 ----------------
 
-.. This section should contain a list of platforms that were tested
-   with this release.
-
-   The format is:
-
-   * <vendor> platform with <vendor> <type of devices> combinations
-
-     * List of CPU
-     * List of OS
-     * List of devices
-     * Other relevant details...
-
-   This section is a comment. Do not overwrite or remove it.
-   Also, make sure to start the actual text at the margin.
-   =======================================================
-
 * Intel\ |reg| platforms with Intel\ |reg| NICs combinations
 
   * CPU
diff --git a/doc/guides/rel_notes/release_21_05.rst b/doc/guides/rel_notes/release_21_05.rst
index 8bf0333d41..8adb225a4d 100644
--- a/doc/guides/rel_notes/release_21_05.rst
+++ b/doc/guides/rel_notes/release_21_05.rst
@@ -6,55 +6,9 @@
 DPDK Release 21.05
 ==================
 
-.. **Read this first.**
-
-   The text in the sections below explains how to update the release notes.
-
-   Use proper spelling, capitalization and punctuation in all sections.
-
-   Variable and config names should be quoted as fixed width text:
-   ``LIKE_THIS``.
-
-   Build the docs and view the output file to ensure the changes are correct::
-
-      make doc-guides-html
-      xdg-open build/doc/html/guides/rel_notes/release_21_05.html
-
-
 New Features
 ------------
 
-.. This section should contain new features added in this release.
-   Sample format:
-
-   * **Add a title in the past tense with a full stop.**
-
-     Add a short 1-2 sentence description in the past tense.
-     The description should be enough to allow someone scanning
-     the release notes to understand the new feature.
-
-     If the feature adds a lot of sub-features you can use a bullet list
-     like this:
-
-     * Added feature foo to do something.
-     * Enhanced feature bar to do something else.
-
-     Refer to the previous release notes for examples.
-
-     Suggested order in release notes items:
-     * Core libs (EAL, mempool, ring, mbuf, buses)
-     * Device abstraction libs and PMDs (ordered alphabetically by vendor name)
-       - ethdev (lib, PMDs)
-       - cryptodev (lib, PMDs)
-       - eventdev (lib, PMDs)
-       - etc
-     * Other libs
-     * Apps, Examples, Tools (if significant)
-
-     This section is a comment. Do not overwrite or remove it.
-     Also, make sure to start the actual text at the margin.
-     =======================================================
-
 * **Added support for GCC 11 and clang 12.**
 
   Added support for building with GCC 11.1.1 and clang 12.0.0.
@@ -321,15 +275,6 @@ New Features
 Removed Items
 -------------
 
-.. This section should contain removed items in this release. Sample format:
-
-   * Add a short 1-2 sentence description of the removed item
-     in the past tense.
-
-   This section is a comment. Do not overwrite or remove it.
-   Also, make sure to start the actual text at the margin.
-   =======================================================
-
 * Removed support for Intel DLB V1 hardware. This is not a broad market device,
   and existing customers already obtain the source code directly from Intel.
 
@@ -337,18 +282,6 @@ Removed Items
 API Changes
 -----------
 
-.. This section should contain API changes. Sample format:
-
-   * sample: Add a short 1-2 sentence description of the API change
-     which was announced in the previous releases and made in this release.
-     Start with a scope label like "ethdev:".
-     Use fixed width quotes for ``function_names`` or ``struct_names``.
-     Use the past tense.
-
-   This section is a comment. Do not overwrite or remove it.
-   Also, make sure to start the actual text at the margin.
-   =======================================================
-
 * eal: The experimental TLS API added in ``rte_thread.h`` has been renamed
   from ``rte_thread_tls_*`` to ``rte_thread_*`` to avoid naming redundancy
   and confusion with the transport layer security term.
@@ -394,18 +327,6 @@ API Changes
 ABI Changes
 -----------
 
-.. This section should contain ABI changes. Sample format:
-
-   * sample: Add a short 1-2 sentence description of the ABI change
-     which was announced in the previous releases and made in this release.
-     Start with a scope label like "ethdev:".
-     Use fixed width quotes for ``function_names`` or ``struct_names``.
-     Use the past tense.
-
-   This section is a comment. Do not overwrite or remove it.
-   Also, make sure to start the actual text at the margin.
-   =======================================================
-
 * No ABI change that would break compatibility with 20.11.
 
 * The experimental function ``rte_telemetry_legacy_register`` has been
@@ -417,22 +338,6 @@ ABI Changes
 Tested Platforms
 ----------------
 
-.. This section should contain a list of platforms that were tested
-   with this release.
-
-   The format is:
-
-   * <vendor> platform with <vendor> <type of devices> combinations
-
-     * List of CPU
-     * List of OS
-     * List of devices
-     * Other relevant details...
-
-   This section is a comment. Do not overwrite or remove it.
-   Also, make sure to start the actual text at the margin.
-   =======================================================
-
 * Intel\ |reg| platforms with Intel\ |reg| NICs combinations
 
   * CPU
diff --git a/doc/guides/rel_notes/release_21_08.rst b/doc/guides/rel_notes/release_21_08.rst
index b4cbf2d7ce..6fb4e43346 100644
--- a/doc/guides/rel_notes/release_21_08.rst
+++ b/doc/guides/rel_notes/release_21_08.rst
@@ -6,55 +6,9 @@
 DPDK Release 21.08
 ==================
 
-.. **Read this first.**
-
-   The text in the sections below explains how to update the release notes.
-
-   Use proper spelling, capitalization and punctuation in all sections.
-
-   Variable and config names should be quoted as fixed width text:
-   ``LIKE_THIS``.
-
-   Build the docs and view the output file to ensure the changes are correct::
-
-      make doc-guides-html
-      xdg-open build/doc/html/guides/rel_notes/release_21_08.html
-
-
 New Features
 ------------
 
-.. This section should contain new features added in this release.
-   Sample format:
-
-   * **Add a title in the past tense with a full stop.**
-
-     Add a short 1-2 sentence description in the past tense.
-     The description should be enough to allow someone scanning
-     the release notes to understand the new feature.
-
-     If the feature adds a lot of sub-features you can use a bullet list
-     like this:
-
-     * Added feature foo to do something.
-     * Enhanced feature bar to do something else.
-
-     Refer to the previous release notes for examples.
-
-     Suggested order in release notes items:
-     * Core libs (EAL, mempool, ring, mbuf, buses)
-     * Device abstraction libs and PMDs (ordered alphabetically by vendor name)
-       - ethdev (lib, PMDs)
-       - cryptodev (lib, PMDs)
-       - eventdev (lib, PMDs)
-       - etc
-     * Other libs
-     * Apps, Examples, Tools (if significant)
-
-     This section is a comment. Do not overwrite or remove it.
-     Also, make sure to start the actual text at the margin.
-     =======================================================
-
 * **Added auxiliary bus support.**
 
   An auxiliary bus provides a way to split a function into child-devices
@@ -179,18 +133,6 @@ New Features
 API Changes
 -----------
 
-.. This section should contain API changes. Sample format:
-
-   * sample: Add a short 1-2 sentence description of the API change
-     which was announced in the previous releases and made in this release.
-     Start with a scope label like "ethdev:".
-     Use fixed width quotes for ``function_names`` or ``struct_names``.
-     Use the past tense.
-
-   This section is a comment. Do not overwrite or remove it.
-   Also, make sure to start the actual text at the margin.
-   =======================================================
-
 * eal: ``rte_strscpy`` sets ``rte_errno`` to ``E2BIG`` in case of string
   truncation.
 
@@ -209,35 +151,12 @@ API Changes
 ABI Changes
 -----------
 
-.. This section should contain ABI changes. Sample format:
-
-   * sample: Add a short 1-2 sentence description of the ABI change
-     which was announced in the previous releases and made in this release.
-     Start with a scope label like "ethdev:".
-     Use fixed width quotes for ``function_names`` or ``struct_names``.
-     Use the past tense.
-
-   This section is a comment. Do not overwrite or remove it.
-   Also, make sure to start the actual text at the margin.
-   =======================================================
-
 * No ABI change that would break compatibility with 20.11.
 
 
 Known Issues
 ------------
 
-.. This section should contain new known issues in this release. Sample format:
-
-   * **Add title in present tense with full stop.**
-
-     Add a short 1-2 sentence description of the known issue
-     in the present tense. Add information on any known workarounds.
-
-   This section is a comment. Do not overwrite or remove it.
-   Also, make sure to start the actual text at the margin.
-   =======================================================
-
 * **Last mbuf segment not implicitly reset.**
 
   It is expected that free mbufs have their field ``nb_seg`` set to 1,
@@ -258,22 +177,6 @@ Known Issues
 Tested Platforms
 ----------------
 
-.. This section should contain a list of platforms that were tested
-   with this release.
-
-   The format is:
-
-   * <vendor> platform with <vendor> <type of devices> combinations
-
-     * List of CPU
-     * List of OS
-     * List of devices
-     * Other relevant details...
-
-   This section is a comment. Do not overwrite or remove it.
-   Also, make sure to start the actual text at the margin.
-   =======================================================
-
 * Intel\ |reg| platforms with Intel\ |reg| NICs combinations
 
   * CPU
diff --git a/doc/guides/rel_notes/release_2_0.rst b/doc/guides/rel_notes/release_2_0.rst
index 82b5743a8a..c05ca4b87e 100644
--- a/doc/guides/rel_notes/release_2_0.rst
+++ b/doc/guides/rel_notes/release_2_0.rst
@@ -4,7 +4,6 @@
 DPDK Release 2.0
 ================
 
-
 New Features
 ------------
 
diff --git a/doc/guides/rel_notes/release_2_1.rst b/doc/guides/rel_notes/release_2_1.rst
index beadc51ba4..0c34458316 100644
--- a/doc/guides/rel_notes/release_2_1.rst
+++ b/doc/guides/rel_notes/release_2_1.rst
@@ -4,7 +4,6 @@
 DPDK Release 2.1
 ================
 
-
 New Features
 ------------
 
@@ -387,7 +386,6 @@ New Features
   64M.
 
 
-
 Resolved Issues
 ---------------
 
-- 
2.33.0


^ permalink raw reply	[relevance 19%]

* [dpdk-dev] [PATCH v6 2/3] security: add option for faster udata or mdata access
  @ 2021-09-15 16:30  8%   ` Nithin Dabilpuram
  0 siblings, 0 replies; 200+ results
From: Nithin Dabilpuram @ 2021-09-15 16:30 UTC (permalink / raw)
  To: konstantin.ananyev, jerinj, gakhil, roy.fan.zhang, hemant.agrawal, matan
  Cc: ndabilpuram, dev, ferruh.yigit, radu.nicolau, olivier.matz,
	g.singh, declan.doherty, jiawenwu

Currently rte_security_set_pkt_metadata() and rte_security_get_userdata()
methods to set pkt metadata on Inline outbound and get userdata
after Inline inbound processing is always driver specific callbacks.

For drivers that do not have much to do in the callbacks but just
to update metadata in rte_security dynamic field and get userdata
from rte_security dynamic field, having to just to PMD specific
callback is costly per packet operation. This patch provides
a mechanism to do the same in inline function and avoid function
pointer jump if a driver supports the same.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
---
 doc/guides/rel_notes/deprecation.rst   |  4 ---
 doc/guides/rel_notes/release_21_08.rst |  6 +++++
 lib/security/rte_security.c            |  8 +++---
 lib/security/rte_security.h            | 49 +++++++++++++++++++++++++++++++---
 lib/security/version.map               |  2 ++
 5 files changed, 57 insertions(+), 12 deletions(-)

diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index 59445a6..70ef45e 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -276,10 +276,6 @@ Deprecation Notices
   content. On Linux and FreeBSD, supported prior to DPDK 20.11,
   original structure will be kept until DPDK 21.11.
 
-* security: The functions ``rte_security_set_pkt_metadata`` and
-  ``rte_security_get_userdata`` will be made inline functions and additional
-  flags will be added in structure ``rte_security_ctx`` in DPDK 21.11.
-
 * cryptodev: The structure ``rte_crypto_op`` would be updated to reduce
   reserved bytes to 2 (from 3), and use 1 byte to indicate warnings and other
   information from the crypto/security operation. This field will be used to
diff --git a/doc/guides/rel_notes/release_21_08.rst b/doc/guides/rel_notes/release_21_08.rst
index b4cbf2d..dd92461 100644
--- a/doc/guides/rel_notes/release_21_08.rst
+++ b/doc/guides/rel_notes/release_21_08.rst
@@ -223,6 +223,12 @@ ABI Changes
 
 * No ABI change that would break compatibility with 20.11.
 
+* security: ``rte_security_set_pkt_metadata`` and ``rte_security_get_userdata``
+  routines used by Inline outbound and Inline inbound security processing are
+  made inline and enhanced to do simple 64-bit set/get for PMD's that do not
+  have much processing in PMD specific callbacks but just 64-bit set/get.
+  This avoids a per pkt function pointer jump overhead for such PMD's.
+
 
 Known Issues
 ------------
diff --git a/lib/security/rte_security.c b/lib/security/rte_security.c
index e8116d5..fe81ed3 100644
--- a/lib/security/rte_security.c
+++ b/lib/security/rte_security.c
@@ -122,9 +122,9 @@ rte_security_session_destroy(struct rte_security_ctx *instance,
 }
 
 int
-rte_security_set_pkt_metadata(struct rte_security_ctx *instance,
-			      struct rte_security_session *sess,
-			      struct rte_mbuf *m, void *params)
+__rte_security_set_pkt_metadata(struct rte_security_ctx *instance,
+				struct rte_security_session *sess,
+				struct rte_mbuf *m, void *params)
 {
 #ifdef RTE_DEBUG
 	RTE_PTR_OR_ERR_RET(sess, -EINVAL);
@@ -137,7 +137,7 @@ rte_security_set_pkt_metadata(struct rte_security_ctx *instance,
 }
 
 void *
-rte_security_get_userdata(struct rte_security_ctx *instance, uint64_t md)
+__rte_security_get_userdata(struct rte_security_ctx *instance, uint64_t md)
 {
 	void *userdata = NULL;
 
diff --git a/lib/security/rte_security.h b/lib/security/rte_security.h
index 2e136d7..2446ab0 100644
--- a/lib/security/rte_security.h
+++ b/lib/security/rte_security.h
@@ -71,8 +71,19 @@ struct rte_security_ctx {
 	/**< Pointer to security ops for the device */
 	uint16_t sess_cnt;
 	/**< Number of sessions attached to this context */
+	uint32_t flags;
+	/**< Flags for security context */
 };
 
+#define RTE_SEC_CTX_F_FAST_SET_MDATA 0x00000001
+/**< Driver uses fast metadata update without using driver specific callback */
+
+#define RTE_SEC_CTX_F_FAST_GET_UDATA 0x00000002
+/**< Driver provides udata using fast method without using driver specific
+ * callback. For fast mdata and udata, mbuf dynamic field would be registered
+ * by driver via rte_security_dynfield_register().
+ */
+
 /**
  * IPSEC tunnel parameters
  *
@@ -494,6 +505,12 @@ static inline bool rte_security_dynfield_is_registered(void)
 	return rte_security_dynfield_offset >= 0;
 }
 
+/** Function to call PMD specific function pointer set_pkt_metadata() */
+__rte_experimental
+extern int __rte_security_set_pkt_metadata(struct rte_security_ctx *instance,
+					   struct rte_security_session *sess,
+					   struct rte_mbuf *m, void *params);
+
 /**
  *  Updates the buffer with device-specific defined metadata
  *
@@ -507,10 +524,26 @@ static inline bool rte_security_dynfield_is_registered(void)
  *  - On success, zero.
  *  - On failure, a negative value.
  */
-int
+static inline int
 rte_security_set_pkt_metadata(struct rte_security_ctx *instance,
 			      struct rte_security_session *sess,
-			      struct rte_mbuf *mb, void *params);
+			      struct rte_mbuf *mb, void *params)
+{
+	/* Fast Path */
+	if (instance->flags & RTE_SEC_CTX_F_FAST_SET_MDATA) {
+		*rte_security_dynfield(mb) =
+			(rte_security_dynfield_t)(sess->sess_private_data);
+		return 0;
+	}
+
+	/* Jump to PMD specific function pointer */
+	return __rte_security_set_pkt_metadata(instance, sess, mb, params);
+}
+
+/** Function to call PMD specific function pointer get_userdata() */
+__rte_experimental
+extern void *__rte_security_get_userdata(struct rte_security_ctx *instance,
+					 uint64_t md);
 
 /**
  * Get userdata associated with the security session. Device specific metadata
@@ -530,8 +563,16 @@ rte_security_set_pkt_metadata(struct rte_security_ctx *instance,
  *  - On failure, NULL
  */
 __rte_experimental
-void *
-rte_security_get_userdata(struct rte_security_ctx *instance, uint64_t md);
+static inline void *
+rte_security_get_userdata(struct rte_security_ctx *instance, uint64_t md)
+{
+	/* Fast Path */
+	if (instance->flags & RTE_SEC_CTX_F_FAST_GET_UDATA)
+		return (void *)(uintptr_t)md;
+
+	/* Jump to PMD specific function pointer */
+	return __rte_security_get_userdata(instance, md);
+}
 
 /**
  * Attach a session to a symmetric crypto operation
diff --git a/lib/security/version.map b/lib/security/version.map
index c44c7f5..45ace9c 100644
--- a/lib/security/version.map
+++ b/lib/security/version.map
@@ -20,4 +20,6 @@ EXPERIMENTAL {
 	rte_security_get_userdata;
 	rte_security_session_stats_get;
 	rte_security_session_update;
+	__rte_security_set_pkt_metadata;
+	__rte_security_get_userdata;
 };
-- 
2.8.4


^ permalink raw reply	[relevance 8%]

* [dpdk-dev] [PATCH 1/5] compressdev: rename fields for Windows compatibility
  @ 2021-09-15 21:40  4% ` Dmitry Kozlyuk
  2021-09-15 21:40  1% ` [dpdk-dev] [PATCH 2/5] cryptodev: " Dmitry Kozlyuk
  2021-09-15 21:40  1% ` [dpdk-dev] [PATCH 5/5] net: rename Ethernet header fields Dmitry Kozlyuk
  2 siblings, 0 replies; 200+ results
From: Dmitry Kozlyuk @ 2021-09-15 21:40 UTC (permalink / raw)
  To: dev
  Cc: Dmitry Kozlyuk, Ashish Gupta, Fiona Trahe,
	Narcisa Ana Maria Vasile, Pallavi Kadam, Ray Kinsella,
	Tyler Retzlaff

Windows SDK headers define `min` and `max` macros which break definition
of `struct rte_param_log2_range`. Rename the structure fields
to `minimum` and `maximum` to allow inclusion of both DPDK and Windows
headers in the same file. Deprecation notice:
https://mails.dpdk.org/archives/dev/2021-July/215270.html

Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
---
 app/test-compress-perf/comp_perf_test_common.c | 6 +++---
 app/test-compress-perf/main.c                  | 2 +-
 doc/guides/rel_notes/deprecation.rst           | 3 ---
 doc/guides/rel_notes/release_20_11.rst         | 3 +++
 drivers/compress/isal/isal_compress_pmd_ops.c  | 4 ++--
 drivers/compress/mlx5/mlx5_compress.c          | 2 +-
 drivers/compress/octeontx/otx_zip_pmd.c        | 4 ++--
 drivers/compress/qat/qat_comp_pmd.c            | 2 +-
 drivers/compress/zlib/zlib_pmd_ops.c           | 4 ++--
 lib/compressdev/rte_compressdev.h              | 4 ++--
 10 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/app/test-compress-perf/comp_perf_test_common.c b/app/test-compress-perf/comp_perf_test_common.c
index b402a0d839..b85323049f 100644
--- a/app/test-compress-perf/comp_perf_test_common.c
+++ b/app/test-compress-perf/comp_perf_test_common.c
@@ -35,10 +35,10 @@ param_range_check(uint16_t size, const struct rte_param_log2_range *range)
 	unsigned int next_size;
 
 	/* Check lower/upper bounds */
-	if (size < range->min)
+	if (size < range->minimum)
 		return -1;
 
-	if (size > range->max)
+	if (size > range->maximum)
 		return -1;
 
 	/* If range is actually only one value, size is correct */
@@ -46,7 +46,7 @@ param_range_check(uint16_t size, const struct rte_param_log2_range *range)
 		return 0;
 
 	/* Check if value is one of the supported sizes */
-	for (next_size = range->min; next_size <= range->max;
+	for (next_size = range->minimum; next_size <= range->maximum;
 			next_size += range->increment)
 		if (size == next_size)
 			return 0;
diff --git a/app/test-compress-perf/main.c b/app/test-compress-perf/main.c
index cc9951a9b1..9fe6160f4a 100644
--- a/app/test-compress-perf/main.c
+++ b/app/test-compress-perf/main.c
@@ -93,7 +93,7 @@ comp_perf_check_capabilities(struct comp_test_data *test_data, uint8_t cdev_id)
 		}
 	} else
 		/* Set window size to PMD maximum if none was specified */
-		test_data->window_sz = cap->window_size.max;
+		test_data->window_sz = cap->window_size.maximum;
 
 	/* Check if chained mbufs is supported */
 	if (test_data->max_sgl_segs > 1  &&
diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index 76a4abfd6b..7b848528ff 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -196,9 +196,6 @@ Deprecation Notices
   and ``rte_vhost_driver_set_protocol_features`` functions will be removed
   and the API functions will be made stable in DPDK 21.11.
 
-* compressdev: ``min`` and ``max`` fields of ``rte_param_log2_range`` structure
-  will be renamed in DPDK 21.11 to avoid conflict with Windows Sockets headers.
-
 * cryptodev: ``min`` and ``max`` fields of ``rte_crypto_param_range`` structure
   will be renamed in DPDK 21.11 to avoid conflict with Windows Sockets headers.
 
diff --git a/doc/guides/rel_notes/release_20_11.rst b/doc/guides/rel_notes/release_20_11.rst
index d07fd815dc..d93790c3b1 100644
--- a/doc/guides/rel_notes/release_20_11.rst
+++ b/doc/guides/rel_notes/release_20_11.rst
@@ -662,6 +662,9 @@ API Changes
 * sched: Removed ``tb_rate``, ``tc_rate``, ``tc_period`` and ``tb_size``
   from ``struct rte_sched_subport_params``.
 
+* compressdev: Renamed ``min`` and ``max`` fields of ``rte_param_log2_range``
+  structure to ``minimum`` and ``maximum``, respectively.
+
 
 ABI Changes
 -----------
diff --git a/drivers/compress/isal/isal_compress_pmd_ops.c b/drivers/compress/isal/isal_compress_pmd_ops.c
index 9b42147a0b..3a736794dc 100644
--- a/drivers/compress/isal/isal_compress_pmd_ops.c
+++ b/drivers/compress/isal/isal_compress_pmd_ops.c
@@ -22,8 +22,8 @@ static const struct rte_compressdev_capabilities isal_pmd_capabilities[] = {
 					RTE_COMP_FF_CRC32_CHECKSUM |
 					RTE_COMP_FF_ADLER32_CHECKSUM,
 		.window_size = {
-			.min = 15,
-			.max = 15,
+			.minimum = 15,
+			.maximum = 15,
 			.increment = 0
 		},
 	},
diff --git a/drivers/compress/mlx5/mlx5_compress.c b/drivers/compress/mlx5/mlx5_compress.c
index c5e0a83a8c..5ec936c7db 100644
--- a/drivers/compress/mlx5/mlx5_compress.c
+++ b/drivers/compress/mlx5/mlx5_compress.c
@@ -90,7 +90,7 @@ static const struct rte_compressdev_capabilities mlx5_caps[] = {
 				      RTE_COMP_FF_SHAREABLE_PRIV_XFORM |
 				      RTE_COMP_FF_HUFFMAN_FIXED |
 				      RTE_COMP_FF_HUFFMAN_DYNAMIC,
-		.window_size = {.min = 10, .max = 15, .increment = 1},
+		.window_size = {.minimum = 10, .maximum = 15, .increment = 1},
 	},
 	{
 		.algo = RTE_COMP_ALGO_LIST_END,
diff --git a/drivers/compress/octeontx/otx_zip_pmd.c b/drivers/compress/octeontx/otx_zip_pmd.c
index dd62285b86..9b8aef9809 100644
--- a/drivers/compress/octeontx/otx_zip_pmd.c
+++ b/drivers/compress/octeontx/otx_zip_pmd.c
@@ -19,8 +19,8 @@ static const struct rte_compressdev_capabilities
 					RTE_COMP_FF_HUFFMAN_DYNAMIC,
 		/* Non sharable Priv XFORM and Stateless */
 		.window_size = {
-				.min = 1,
-				.max = 14,
+				.minimum = 1,
+				.maximum = 14,
 				.increment = 1
 				/* size supported 2^1 to 2^14 */
 		},
diff --git a/drivers/compress/qat/qat_comp_pmd.c b/drivers/compress/qat/qat_comp_pmd.c
index caac7839e9..b79d35b85d 100644
--- a/drivers/compress/qat/qat_comp_pmd.c
+++ b/drivers/compress/qat/qat_comp_pmd.c
@@ -29,7 +29,7 @@ static const struct rte_compressdev_capabilities qat_comp_gen_capabilities[] = {
 				RTE_COMP_FF_OOP_SGL_IN_LB_OUT |
 				RTE_COMP_FF_OOP_LB_IN_SGL_OUT |
 				RTE_COMP_FF_STATEFUL_DECOMPRESSION,
-	 .window_size = {.min = 15, .max = 15, .increment = 0} },
+	 .window_size = {.minimum = 15, .maximum = 15, .increment = 0} },
 	{RTE_COMP_ALGO_LIST_END, 0, {0, 0, 0} } };
 
 static void
diff --git a/drivers/compress/zlib/zlib_pmd_ops.c b/drivers/compress/zlib/zlib_pmd_ops.c
index 0a73aed949..50222f942e 100644
--- a/drivers/compress/zlib/zlib_pmd_ops.c
+++ b/drivers/compress/zlib/zlib_pmd_ops.c
@@ -16,8 +16,8 @@ static const struct rte_compressdev_capabilities zlib_pmd_capabilities[] = {
 					RTE_COMP_FF_HUFFMAN_FIXED |
 					RTE_COMP_FF_HUFFMAN_DYNAMIC),
 		.window_size = {
-			.min = 8,
-			.max = 15,
+			.minimum = 8,
+			.maximum = 15,
 			.increment = 1
 		},
 	},
diff --git a/lib/compressdev/rte_compressdev.h b/lib/compressdev/rte_compressdev.h
index 2840c27c6c..c6cea3e9c4 100644
--- a/lib/compressdev/rte_compressdev.h
+++ b/lib/compressdev/rte_compressdev.h
@@ -30,8 +30,8 @@ extern "C" {
  * Final value will be 2^value.
  */
 struct rte_param_log2_range {
-	uint8_t min;	/**< Minimum log2 value */
-	uint8_t max;	/**< Maximum log2 value */
+	uint8_t minimum;	/**< Minimum log2 value */
+	uint8_t maximum;	/**< Maximum log2 value */
 	uint8_t increment;
 	/**< If a range of sizes are supported,
 	 * this parameter is used to indicate
-- 
2.29.3


^ permalink raw reply	[relevance 4%]

* [dpdk-dev] [PATCH 2/5] cryptodev: rename fields for Windows compatibility
    2021-09-15 21:40  4% ` [dpdk-dev] [PATCH 1/5] compressdev: rename fields for Windows compatibility Dmitry Kozlyuk
@ 2021-09-15 21:40  1% ` Dmitry Kozlyuk
  2021-09-15 21:40  1% ` [dpdk-dev] [PATCH 5/5] net: rename Ethernet header fields Dmitry Kozlyuk
  2 siblings, 0 replies; 200+ results
From: Dmitry Kozlyuk @ 2021-09-15 21:40 UTC (permalink / raw)
  To: dev
  Cc: Dmitry Kozlyuk, Akhil Goyal, Declan Doherty,
	Narcisa Ana Maria Vasile, Pallavi Kadam, Ray Kinsella,
	Tyler Retzlaff

Windows SDK headers define `min` and `max` macros which break definition
of `struct rte_crypto_param_range`. Rename the structure fields
to `minimum` and `maximum` to allow inclusion of both DPDK and Windows
headers in the same file. Deprecation notice:
https://mails.dpdk.org/archives/dev/2021-July/215270.html

Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
---
 app/test/test_cryptodev_asym.c                |   4 +-
 doc/guides/rel_notes/deprecation.rst          |   3 -
 doc/guides/rel_notes/release_20_11.rst        |   3 +
 drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c  |  28 +-
 .../crypto/aesni_mb/rte_aesni_mb_pmd_ops.c    | 284 +++++-----
 drivers/crypto/armv8/rte_armv8_pmd_ops.c      |  24 +-
 drivers/crypto/bcmfs/bcmfs_sym_capabilities.c | 288 +++++-----
 drivers/crypto/caam_jr/caam_jr_capabilities.c |  88 +--
 drivers/crypto/ccp/ccp_pmd_ops.c              | 208 ++++----
 .../crypto/cnxk/cnxk_cryptodev_capabilities.c | 300 +++++------
 drivers/crypto/dpaa2_sec/dpaa2_sec_priv.h     | 280 +++++-----
 drivers/crypto/dpaa_sec/dpaa_sec.h            | 208 ++++----
 drivers/crypto/kasumi/rte_kasumi_pmd_ops.c    |  16 +-
 drivers/crypto/mlx5/mlx5_crypto.c             |   8 +-
 drivers/crypto/mvsam/rte_mrvl_pmd_ops.c       | 192 +++----
 .../crypto/nitrox/nitrox_sym_capabilities.c   |  56 +-
 drivers/crypto/null/null_crypto_pmd_ops.c     |  12 +-
 .../octeontx/otx_cryptodev_capabilities.c     | 252 ++++-----
 .../octeontx2/otx2_cryptodev_capabilities.c   | 284 +++++-----
 drivers/crypto/openssl/rte_openssl_pmd_ops.c  | 208 ++++----
 drivers/crypto/qat/qat_asym_capabilities.h    |  12 +-
 drivers/crypto/qat/qat_sym_capabilities.h     | 504 +++++++++---------
 .../scheduler/rte_cryptodev_scheduler.c       |  20 +-
 drivers/crypto/snow3g/rte_snow3g_pmd_ops.c    |  20 +-
 .../virtio/virtio_crypto_capabilities.h       |  16 +-
 drivers/crypto/zuc/rte_zuc_pmd_ops.c          |  20 +-
 drivers/net/ixgbe/ixgbe_ipsec.c               |  28 +-
 drivers/net/octeontx2/otx2_ethdev_sec.c       |  32 +-
 drivers/net/txgbe/txgbe_ipsec.c               |  28 +-
 examples/l2fwd-crypto/main.c                  |  66 +--
 lib/cryptodev/rte_cryptodev.c                 |  14 +-
 lib/cryptodev/rte_cryptodev.h                 |   4 +-
 32 files changed, 1755 insertions(+), 1755 deletions(-)

diff --git a/app/test/test_cryptodev_asym.c b/app/test/test_cryptodev_asym.c
index 847b074a4f..e138ed0890 100644
--- a/app/test/test_cryptodev_asym.c
+++ b/app/test/test_cryptodev_asym.c
@@ -1041,8 +1041,8 @@ static inline void print_asym_capa(
 		case RTE_CRYPTO_ASYM_XFORM_DH:
 		case RTE_CRYPTO_ASYM_XFORM_DSA:
 			printf(" modlen: min %d max %d increment %d",
-					capa->modlen.min,
-					capa->modlen.max,
+					capa->modlen.minimum,
+					capa->modlen.maximum,
 					capa->modlen.increment);
 		break;
 		case RTE_CRYPTO_ASYM_XFORM_ECDSA:
diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index 7b848528ff..6d48155b35 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -196,9 +196,6 @@ Deprecation Notices
   and ``rte_vhost_driver_set_protocol_features`` functions will be removed
   and the API functions will be made stable in DPDK 21.11.
 
-* cryptodev: ``min`` and ``max`` fields of ``rte_crypto_param_range`` structure
-  will be renamed in DPDK 21.11 to avoid conflict with Windows Sockets headers.
-
 * cryptodev: The field ``dataunit_len`` of the ``struct rte_crypto_cipher_xform``
   has a limited size ``uint16_t``.
   It will be moved and extended as ``uint32_t`` in DPDK 21.11.
diff --git a/doc/guides/rel_notes/release_20_11.rst b/doc/guides/rel_notes/release_20_11.rst
index d93790c3b1..3eb30f855c 100644
--- a/doc/guides/rel_notes/release_20_11.rst
+++ b/doc/guides/rel_notes/release_20_11.rst
@@ -665,6 +665,9 @@ API Changes
 * compressdev: Renamed ``min`` and ``max`` fields of ``rte_param_log2_range``
   structure to ``minimum`` and ``maximum``, respectively.
 
+* cryptodev: Renamed ``min`` and ``max`` fields of ``rte_crypto_param_range``
+  structure to ``minimum`` and ``maximum``, respectively.
+
 
 ABI Changes
 -----------
diff --git a/drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c b/drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c
index 18dbc4c18c..e75082dd8f 100644
--- a/drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c
+++ b/drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c
@@ -19,18 +19,18 @@ static const struct rte_cryptodev_capabilities aesni_gcm_pmd_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_AES_GMAC,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 32,
+					.minimum = 16,
+					.maximum = 32,
 					.increment = 8
 				},
 				.digest_size = {
-					.min = 1,
-					.max = 16,
+					.minimum = 1,
+					.maximum = 16,
 					.increment = 1
 				},
 				.iv_size = {
-					.min = 12,
-					.max = 12,
+					.minimum = 12,
+					.maximum = 12,
 					.increment = 0
 				}
 			}, }
@@ -44,23 +44,23 @@ static const struct rte_cryptodev_capabilities aesni_gcm_pmd_capabilities[] = {
 				.algo = RTE_CRYPTO_AEAD_AES_GCM,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 32,
+					.minimum = 16,
+					.maximum = 32,
 					.increment = 8
 				},
 				.digest_size = {
-					.min = 1,
-					.max = 16,
+					.minimum = 1,
+					.maximum = 16,
 					.increment = 1
 				},
 				.aad_size = {
-					.min = 0,
-					.max = 65535,
+					.minimum = 0,
+					.maximum = 65535,
 					.increment = 1
 				},
 				.iv_size = {
-					.min = 12,
-					.max = 12,
+					.minimum = 12,
+					.maximum = 12,
 					.increment = 0
 				}
 			}, }
diff --git a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c
index fc7fdfec8e..f572ad2da7 100644
--- a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c
+++ b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c
@@ -22,13 +22,13 @@ static const struct rte_cryptodev_capabilities aesni_mb_pmd_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_MD5_HMAC,
 				.block_size = 64,
 				.key_size = {
-					.min = 1,
-					.max = 64,
+					.minimum = 1,
+					.maximum = 64,
 					.increment = 1
 				},
 				.digest_size = {
-					.min = 1,
-					.max = 16,
+					.minimum = 1,
+					.maximum = 16,
 					.increment = 1
 				},
 				.iv_size = { 0 }
@@ -43,13 +43,13 @@ static const struct rte_cryptodev_capabilities aesni_mb_pmd_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA1_HMAC,
 				.block_size = 64,
 				.key_size = {
-					.min = 1,
-					.max = 65535,
+					.minimum = 1,
+					.maximum = 65535,
 					.increment = 1
 				},
 				.digest_size = {
-					.min = 1,
-					.max = 20,
+					.minimum = 1,
+					.maximum = 20,
 					.increment = 1
 				},
 				.iv_size = { 0 }
@@ -64,13 +64,13 @@ static const struct rte_cryptodev_capabilities aesni_mb_pmd_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA1,
 				.block_size = 64,
 				.key_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 1,
-					.max = 20,
+					.minimum = 1,
+					.maximum = 20,
 					.increment = 1
 				},
 				.iv_size = { 0 }
@@ -85,13 +85,13 @@ static const struct rte_cryptodev_capabilities aesni_mb_pmd_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA224_HMAC,
 				.block_size = 64,
 				.key_size = {
-					.min = 1,
-					.max = 65535,
+					.minimum = 1,
+					.maximum = 65535,
 					.increment = 1
 				},
 				.digest_size = {
-					.min = 1,
-					.max = 28,
+					.minimum = 1,
+					.maximum = 28,
 					.increment = 1
 				},
 				.iv_size = { 0 }
@@ -106,13 +106,13 @@ static const struct rte_cryptodev_capabilities aesni_mb_pmd_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA224,
 				.block_size = 64,
 				.key_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 1,
-					.max = 28,
+					.minimum = 1,
+					.maximum = 28,
 					.increment = 1
 				},
 				.iv_size = { 0 }
@@ -127,13 +127,13 @@ static const struct rte_cryptodev_capabilities aesni_mb_pmd_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA256_HMAC,
 				.block_size = 64,
 				.key_size = {
-					.min = 1,
-					.max = 65535,
+					.minimum = 1,
+					.maximum = 65535,
 					.increment = 1
 				},
 				.digest_size = {
-					.min = 1,
-					.max = 32,
+					.minimum = 1,
+					.maximum = 32,
 					.increment = 1
 				},
 				.iv_size = { 0 }
@@ -148,13 +148,13 @@ static const struct rte_cryptodev_capabilities aesni_mb_pmd_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA256,
 				.block_size = 64,
 				.key_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 1,
-					.max = 32,
+					.minimum = 1,
+					.maximum = 32,
 					.increment = 1
 				},
 				.iv_size = { 0 }
@@ -169,13 +169,13 @@ static const struct rte_cryptodev_capabilities aesni_mb_pmd_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA384_HMAC,
 				.block_size = 128,
 				.key_size = {
-					.min = 1,
-					.max = 65535,
+					.minimum = 1,
+					.maximum = 65535,
 					.increment = 1
 				},
 				.digest_size = {
-					.min = 1,
-					.max = 48,
+					.minimum = 1,
+					.maximum = 48,
 					.increment = 1
 				},
 				.iv_size = { 0 }
@@ -190,13 +190,13 @@ static const struct rte_cryptodev_capabilities aesni_mb_pmd_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA384,
 				.block_size = 128,
 				.key_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 1,
-					.max = 48,
+					.minimum = 1,
+					.maximum = 48,
 					.increment = 1
 				},
 				.iv_size = { 0 }
@@ -211,13 +211,13 @@ static const struct rte_cryptodev_capabilities aesni_mb_pmd_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA512_HMAC,
 				.block_size = 128,
 				.key_size = {
-					.min = 1,
-					.max = 65535,
+					.minimum = 1,
+					.maximum = 65535,
 					.increment = 1
 				},
 				.digest_size = {
-					.min = 1,
-					.max = 64,
+					.minimum = 1,
+					.maximum = 64,
 					.increment = 1
 				},
 				.iv_size = { 0 }
@@ -232,13 +232,13 @@ static const struct rte_cryptodev_capabilities aesni_mb_pmd_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA512,
 				.block_size = 128,
 				.key_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 1,
-					.max = 64,
+					.minimum = 1,
+					.maximum = 64,
 					.increment = 1
 				},
 				.iv_size = { 0 }
@@ -253,13 +253,13 @@ static const struct rte_cryptodev_capabilities aesni_mb_pmd_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_AES_XCBC_MAC,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 12,
-					.max = 12,
+					.minimum = 12,
+					.maximum = 12,
 					.increment = 0
 				},
 				.iv_size = { 0 }
@@ -274,13 +274,13 @@ static const struct rte_cryptodev_capabilities aesni_mb_pmd_capabilities[] = {
 				.algo = RTE_CRYPTO_CIPHER_AES_CBC,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 32,
+					.minimum = 16,
+					.maximum = 32,
 					.increment = 8
 				},
 				.iv_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				}
 			}, }
@@ -294,13 +294,13 @@ static const struct rte_cryptodev_capabilities aesni_mb_pmd_capabilities[] = {
 				.algo = RTE_CRYPTO_CIPHER_AES_CTR,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 32,
+					.minimum = 16,
+					.maximum = 32,
 					.increment = 8
 				},
 				.iv_size = {
-					.min = 12,
-					.max = 16,
+					.minimum = 12,
+					.maximum = 16,
 					.increment = 4
 				}
 			}, }
@@ -314,18 +314,18 @@ static const struct rte_cryptodev_capabilities aesni_mb_pmd_capabilities[] = {
 				.algo = RTE_CRYPTO_CIPHER_AES_DOCSISBPI,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
+					.minimum = 16,
 #if IMB_VERSION_NUM >= IMB_VERSION(0, 53, 3)
-					.max = 32,
+					.maximum = 32,
 					.increment = 16
 #else
-					.max = 16,
+					.maximum = 16,
 					.increment = 0
 #endif
 				},
 				.iv_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				}
 			}, }
@@ -339,13 +339,13 @@ static const struct rte_cryptodev_capabilities aesni_mb_pmd_capabilities[] = {
 				.algo = RTE_CRYPTO_CIPHER_DES_CBC,
 				.block_size = 8,
 				.key_size = {
-					.min = 8,
-					.max = 8,
+					.minimum = 8,
+					.maximum = 8,
 					.increment = 0
 				},
 				.iv_size = {
-					.min = 8,
-					.max = 8,
+					.minimum = 8,
+					.maximum = 8,
 					.increment = 0
 				}
 			}, }
@@ -359,13 +359,13 @@ static const struct rte_cryptodev_capabilities aesni_mb_pmd_capabilities[] = {
 				.algo = RTE_CRYPTO_CIPHER_3DES_CBC,
 				.block_size = 8,
 				.key_size = {
-					.min = 8,
-					.max = 24,
+					.minimum = 8,
+					.maximum = 24,
 					.increment = 8
 				},
 				.iv_size = {
-					.min = 8,
-					.max = 8,
+					.minimum = 8,
+					.maximum = 8,
 					.increment = 0
 				}
 			}, }
@@ -379,13 +379,13 @@ static const struct rte_cryptodev_capabilities aesni_mb_pmd_capabilities[] = {
 				.algo = RTE_CRYPTO_CIPHER_DES_DOCSISBPI,
 				.block_size = 8,
 				.key_size = {
-					.min = 8,
-					.max = 8,
+					.minimum = 8,
+					.maximum = 8,
 					.increment = 0
 				},
 				.iv_size = {
-					.min = 8,
-					.max = 8,
+					.minimum = 8,
+					.maximum = 8,
 					.increment = 0
 				}
 			}, }
@@ -399,28 +399,28 @@ static const struct rte_cryptodev_capabilities aesni_mb_pmd_capabilities[] = {
 				.algo = RTE_CRYPTO_AEAD_AES_CCM,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
+					.minimum = 16,
 #if IMB_VERSION(0, 54, 2) <= IMB_VERSION_NUM
-					.max = 32,
+					.maximum = 32,
 					.increment = 16
 #else
-					.max = 16,
+					.maximum = 16,
 					.increment = 0
 #endif
 				},
 				.digest_size = {
-					.min = 4,
-					.max = 16,
+					.minimum = 4,
+					.maximum = 16,
 					.increment = 2
 				},
 				.aad_size = {
-					.min = 0,
-					.max = 46,
+					.minimum = 0,
+					.maximum = 46,
 					.increment = 1
 				},
 				.iv_size = {
-					.min = 7,
-					.max = 13,
+					.minimum = 7,
+					.maximum = 13,
 					.increment = 1
 				},
 			}, }
@@ -434,13 +434,13 @@ static const struct rte_cryptodev_capabilities aesni_mb_pmd_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_AES_CMAC,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 1,
-					.max = 16,
+					.minimum = 1,
+					.maximum = 16,
 					.increment = 1
 				},
 				.iv_size = { 0 }
@@ -455,23 +455,23 @@ static const struct rte_cryptodev_capabilities aesni_mb_pmd_capabilities[] = {
 				.algo = RTE_CRYPTO_AEAD_AES_GCM,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 32,
+					.minimum = 16,
+					.maximum = 32,
 					.increment = 8
 				},
 				.digest_size = {
-					.min = 1,
-					.max = 16,
+					.minimum = 1,
+					.maximum = 16,
 					.increment = 1
 				},
 				.aad_size = {
-					.min = 0,
-					.max = 65535,
+					.minimum = 0,
+					.maximum = 65535,
 					.increment = 1
 				},
 				.iv_size = {
-					.min = 12,
-					.max = 12,
+					.minimum = 12,
+					.maximum = 12,
 					.increment = 0
 				}
 			}, }
@@ -485,18 +485,18 @@ static const struct rte_cryptodev_capabilities aesni_mb_pmd_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_AES_GMAC,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 32,
+					.minimum = 16,
+					.maximum = 32,
 					.increment = 8
 				},
 				.digest_size = {
-					.min = 1,
-					.max = 16,
+					.minimum = 1,
+					.maximum = 16,
 					.increment = 1
 				},
 				.iv_size = {
-					.min = 12,
-					.max = 12,
+					.minimum = 12,
+					.maximum = 12,
 					.increment = 0
 				}
 			}, }
@@ -511,8 +511,8 @@ static const struct rte_cryptodev_capabilities aesni_mb_pmd_capabilities[] = {
 				.algo = RTE_CRYPTO_CIPHER_AES_ECB,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 32,
+					.minimum = 16,
+					.maximum = 32,
 					.increment = 8
 				},
 				.iv_size = { 0 }
@@ -529,18 +529,18 @@ static const struct rte_cryptodev_capabilities aesni_mb_pmd_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_ZUC_EIA3,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 4,
-					.max = 4,
+					.minimum = 4,
+					.maximum = 4,
 					.increment = 0
 				},
 				.iv_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				}
 			}, }
@@ -554,13 +554,13 @@ static const struct rte_cryptodev_capabilities aesni_mb_pmd_capabilities[] = {
 				.algo = RTE_CRYPTO_CIPHER_ZUC_EEA3,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				},
 				.iv_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				},
 			}, }
@@ -574,18 +574,18 @@ static const struct rte_cryptodev_capabilities aesni_mb_pmd_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_SNOW3G_UIA2,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 4,
-					.max = 4,
+					.minimum = 4,
+					.maximum = 4,
 					.increment = 0
 				},
 				.iv_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				}
 			}, }
@@ -599,13 +599,13 @@ static const struct rte_cryptodev_capabilities aesni_mb_pmd_capabilities[] = {
 				.algo = RTE_CRYPTO_CIPHER_SNOW3G_UEA2,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				},
 				.iv_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				}
 			}, }
@@ -619,13 +619,13 @@ static const struct rte_cryptodev_capabilities aesni_mb_pmd_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_KASUMI_F9,
 				.block_size = 8,
 				.key_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 4,
-					.max = 4,
+					.minimum = 4,
+					.maximum = 4,
 					.increment = 0
 				},
 				.iv_size = { 0 }
@@ -640,13 +640,13 @@ static const struct rte_cryptodev_capabilities aesni_mb_pmd_capabilities[] = {
 				.algo = RTE_CRYPTO_CIPHER_KASUMI_F8,
 				.block_size = 8,
 				.key_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				},
 				.iv_size = {
-					.min = 8,
-					.max = 8,
+					.minimum = 8,
+					.maximum = 8,
 					.increment = 0
 				}
 			}, }
@@ -662,23 +662,23 @@ static const struct rte_cryptodev_capabilities aesni_mb_pmd_capabilities[] = {
 				.algo = RTE_CRYPTO_AEAD_CHACHA20_POLY1305,
 				.block_size = 64,
 				.key_size = {
-					.min = 32,
-					.max = 32,
+					.minimum = 32,
+					.maximum = 32,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				},
 				.aad_size = {
-					.min = 0,
-					.max = 240,
+					.minimum = 0,
+					.maximum = 240,
 					.increment = 1
 				},
 				.iv_size = {
-					.min = 12,
-					.max = 12,
+					.minimum = 12,
+					.maximum = 12,
 					.increment = 0
 				},
 			}, }
@@ -699,13 +699,13 @@ static const struct rte_cryptodev_capabilities
 				.algo = RTE_CRYPTO_CIPHER_AES_DOCSISBPI,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 32,
+					.minimum = 16,
+					.maximum = 32,
 					.increment = 16
 				},
 				.iv_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				}
 			}, }
diff --git a/drivers/crypto/armv8/rte_armv8_pmd_ops.c b/drivers/crypto/armv8/rte_armv8_pmd_ops.c
index 01ccfb4b23..5d0eae6b45 100644
--- a/drivers/crypto/armv8/rte_armv8_pmd_ops.c
+++ b/drivers/crypto/armv8/rte_armv8_pmd_ops.c
@@ -20,13 +20,13 @@ static const struct rte_cryptodev_capabilities
 					.algo = RTE_CRYPTO_AUTH_SHA1_HMAC,
 					.block_size = 64,
 					.key_size = {
-						.min = 1,
-						.max = 64,
+						.minimum = 1,
+						.maximum = 64,
 						.increment = 1
 					},
 					.digest_size = {
-						.min = 1,
-						.max = 20,
+						.minimum = 1,
+						.maximum = 20,
 						.increment = 1
 					},
 					.iv_size = { 0 }
@@ -41,13 +41,13 @@ static const struct rte_cryptodev_capabilities
 					.algo = RTE_CRYPTO_AUTH_SHA256_HMAC,
 					.block_size = 64,
 					.key_size = {
-						.min = 1,
-						.max = 64,
+						.minimum = 1,
+						.maximum = 64,
 						.increment = 1
 					},
 					.digest_size = {
-						.min = 1,
-						.max = 32,
+						.minimum = 1,
+						.maximum = 32,
 						.increment = 1
 					},
 					.iv_size = { 0 }
@@ -62,13 +62,13 @@ static const struct rte_cryptodev_capabilities
 					.algo = RTE_CRYPTO_CIPHER_AES_CBC,
 					.block_size = 16,
 					.key_size = {
-						.min = 16,
-						.max = 16,
+						.minimum = 16,
+						.maximum = 16,
 						.increment = 0
 					},
 					.iv_size = {
-						.min = 16,
-						.max = 16,
+						.minimum = 16,
+						.maximum = 16,
 						.increment = 0
 					}
 				}, }
diff --git a/drivers/crypto/bcmfs/bcmfs_sym_capabilities.c b/drivers/crypto/bcmfs/bcmfs_sym_capabilities.c
index afed7696a6..ec15ca2323 100644
--- a/drivers/crypto/bcmfs/bcmfs_sym_capabilities.c
+++ b/drivers/crypto/bcmfs/bcmfs_sym_capabilities.c
@@ -17,13 +17,13 @@ static const struct rte_cryptodev_capabilities bcmfs_sym_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA1,
 				.block_size = 64,
 				.key_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 20,
-					.max = 20,
+					.minimum = 20,
+					.maximum = 20,
 					.increment = 0
 				},
 				.aad_size = { 0 }
@@ -39,13 +39,13 @@ static const struct rte_cryptodev_capabilities bcmfs_sym_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_MD5,
 				.block_size = 64,
 				.key_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				},
 			}, }
@@ -60,13 +60,13 @@ static const struct rte_cryptodev_capabilities bcmfs_sym_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA224,
 				.block_size = 64,
 				.key_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 28,
-					.max = 28,
+					.minimum = 28,
+					.maximum = 28,
 					.increment = 0
 				},
 				.aad_size = { 0 }
@@ -82,13 +82,13 @@ static const struct rte_cryptodev_capabilities bcmfs_sym_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA256,
 				.block_size = 64,
 				.key_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 32,
-					.max = 32,
+					.minimum = 32,
+					.maximum = 32,
 					.increment = 0
 				},
 				.aad_size = { 0 }
@@ -104,13 +104,13 @@ static const struct rte_cryptodev_capabilities bcmfs_sym_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA384,
 				.block_size = 64,
 				.key_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 48,
-					.max = 48,
+					.minimum = 48,
+					.maximum = 48,
 					.increment = 0
 				},
 				.aad_size = { 0 }
@@ -126,13 +126,13 @@ static const struct rte_cryptodev_capabilities bcmfs_sym_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA512,
 				.block_size = 64,
 				.key_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 64,
-					.max = 64,
+					.minimum = 64,
+					.maximum = 64,
 					.increment = 0
 				},
 				.aad_size = { 0 }
@@ -148,13 +148,13 @@ static const struct rte_cryptodev_capabilities bcmfs_sym_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA3_224,
 				.block_size = 144,
 				.key_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 28,
-					.max = 28,
+					.minimum = 28,
+					.maximum = 28,
 					.increment = 0
 				},
 				.aad_size = { 0 }
@@ -170,13 +170,13 @@ static const struct rte_cryptodev_capabilities bcmfs_sym_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA3_256,
 				.block_size = 136,
 				.key_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 32,
-					.max = 32,
+					.minimum = 32,
+					.maximum = 32,
 					.increment = 0
 				},
 				.aad_size = { 0 }
@@ -192,13 +192,13 @@ static const struct rte_cryptodev_capabilities bcmfs_sym_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA3_384,
 				.block_size = 104,
 				.key_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 48,
-					.max = 48,
+					.minimum = 48,
+					.maximum = 48,
 					.increment = 0
 				},
 				.aad_size = { 0 }
@@ -214,13 +214,13 @@ static const struct rte_cryptodev_capabilities bcmfs_sym_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA3_512,
 				.block_size = 72,
 				.key_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 64,
-					.max = 64,
+					.minimum = 64,
+					.maximum = 64,
 					.increment = 0
 				},
 				.aad_size = { 0 }
@@ -236,13 +236,13 @@ static const struct rte_cryptodev_capabilities bcmfs_sym_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA1_HMAC,
 				.block_size = 64,
 				.key_size = {
-					.min = 1,
-					.max = 64,
+					.minimum = 1,
+					.maximum = 64,
 					.increment = 1
 				},
 				.digest_size = {
-					.min = 20,
-					.max = 20,
+					.minimum = 20,
+					.maximum = 20,
 					.increment = 0
 				},
 				.aad_size = { 0 }
@@ -258,13 +258,13 @@ static const struct rte_cryptodev_capabilities bcmfs_sym_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_MD5_HMAC,
 				.block_size = 64,
 				.key_size = {
-					.min = 1,
-					.max = 64,
+					.minimum = 1,
+					.maximum = 64,
 					.increment = 1
 				},
 				.digest_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				},
 				.aad_size = { 0 }
@@ -280,13 +280,13 @@ static const struct rte_cryptodev_capabilities bcmfs_sym_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA224_HMAC,
 				.block_size = 64,
 				.key_size = {
-					.min = 1,
-					.max = 64,
+					.minimum = 1,
+					.maximum = 64,
 					.increment = 1
 				},
 				.digest_size = {
-					.min = 28,
-					.max = 28,
+					.minimum = 28,
+					.maximum = 28,
 					.increment = 0
 				},
 				.aad_size = { 0 }
@@ -302,13 +302,13 @@ static const struct rte_cryptodev_capabilities bcmfs_sym_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA256_HMAC,
 				.block_size = 64,
 				.key_size = {
-					.min = 1,
-					.max = 64,
+					.minimum = 1,
+					.maximum = 64,
 					.increment = 1
 				},
 				.digest_size = {
-					.min = 32,
-					.max = 32,
+					.minimum = 32,
+					.maximum = 32,
 					.increment = 0
 				},
 				.aad_size = { 0 }
@@ -324,13 +324,13 @@ static const struct rte_cryptodev_capabilities bcmfs_sym_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA384_HMAC,
 				.block_size = 128,
 				.key_size = {
-					.min = 1,
-					.max = 128,
+					.minimum = 1,
+					.maximum = 128,
 					.increment = 1
 				},
 				.digest_size = {
-					.min = 48,
-					.max = 48,
+					.minimum = 48,
+					.maximum = 48,
 					.increment = 0
 				},
 				.aad_size = { 0 }
@@ -346,13 +346,13 @@ static const struct rte_cryptodev_capabilities bcmfs_sym_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA512_HMAC,
 				.block_size = 128,
 				.key_size = {
-					.min = 1,
-					.max = 128,
+					.minimum = 1,
+					.maximum = 128,
 					.increment = 1
 				},
 				.digest_size = {
-					.min = 64,
-					.max = 64,
+					.minimum = 64,
+					.maximum = 64,
 					.increment = 0
 				},
 				.aad_size = { 0 }
@@ -368,13 +368,13 @@ static const struct rte_cryptodev_capabilities bcmfs_sym_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA3_224_HMAC,
 				.block_size = 144,
 				.key_size = {
-					.min = 1,
-					.max = 144,
+					.minimum = 1,
+					.maximum = 144,
 					.increment = 1
 				},
 				.digest_size = {
-					.min = 28,
-					.max = 28,
+					.minimum = 28,
+					.maximum = 28,
 					.increment = 0
 				},
 				.aad_size = { 0 }
@@ -390,13 +390,13 @@ static const struct rte_cryptodev_capabilities bcmfs_sym_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA3_256_HMAC,
 				.block_size = 136,
 				.key_size = {
-					.min = 1,
-					.max = 136,
+					.minimum = 1,
+					.maximum = 136,
 					.increment = 1
 				},
 				.digest_size = {
-					.min = 32,
-					.max = 32,
+					.minimum = 32,
+					.maximum = 32,
 					.increment = 0
 				},
 				.aad_size = { 0 }
@@ -412,13 +412,13 @@ static const struct rte_cryptodev_capabilities bcmfs_sym_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA3_384_HMAC,
 				.block_size = 104,
 				.key_size = {
-					.min = 1,
-					.max = 104,
+					.minimum = 1,
+					.maximum = 104,
 					.increment = 1
 				},
 				.digest_size = {
-					.min = 48,
-					.max = 48,
+					.minimum = 48,
+					.maximum = 48,
 					.increment = 0
 				},
 				.aad_size = { 0 }
@@ -434,13 +434,13 @@ static const struct rte_cryptodev_capabilities bcmfs_sym_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA3_512_HMAC,
 				.block_size = 72,
 				.key_size = {
-					.min = 1,
-					.max = 72,
+					.minimum = 1,
+					.maximum = 72,
 					.increment = 1
 				},
 				.digest_size = {
-					.min = 64,
-					.max = 64,
+					.minimum = 64,
+					.maximum = 64,
 					.increment = 0
 				},
 				.aad_size = { 0 }
@@ -456,13 +456,13 @@ static const struct rte_cryptodev_capabilities bcmfs_sym_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_AES_XCBC_MAC,
 				.block_size = 16,
 				.key_size = {
-					.min = 1,
-					.max = 16,
+					.minimum = 1,
+					.maximum = 16,
 					.increment = 1
 				},
 				.digest_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				},
 				.aad_size = { 0 }
@@ -478,23 +478,23 @@ static const struct rte_cryptodev_capabilities bcmfs_sym_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_AES_GMAC,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 32,
+					.minimum = 16,
+					.maximum = 32,
 					.increment = 8
 				},
 				.digest_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				},
 				.aad_size = {
-					.min = 0,
-					.max = 65535,
+					.minimum = 0,
+					.maximum = 65535,
 					.increment = 1
 				},
 				.iv_size = {
-					.min = 12,
-					.max = 16,
+					.minimum = 12,
+					.maximum = 16,
 					.increment = 4
 				},
 			}, }
@@ -509,13 +509,13 @@ static const struct rte_cryptodev_capabilities bcmfs_sym_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_AES_CMAC,
 				.block_size = 16,
 				.key_size = {
-					.min = 1,
-					.max = 16,
+					.minimum = 1,
+					.maximum = 16,
 					.increment = 1
 				},
 				.digest_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				},
 				.aad_size = { 0 }
@@ -531,13 +531,13 @@ static const struct rte_cryptodev_capabilities bcmfs_sym_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_AES_CBC_MAC,
 				.block_size = 16,
 				.key_size = {
-					.min = 1,
-					.max = 16,
+					.minimum = 1,
+					.maximum = 16,
 					.increment = 1
 				},
 				.digest_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				},
 				.aad_size = { 0 }
@@ -553,13 +553,13 @@ static const struct rte_cryptodev_capabilities bcmfs_sym_capabilities[] = {
 				.algo = RTE_CRYPTO_CIPHER_AES_ECB,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 32,
+					.minimum = 16,
+					.maximum = 32,
 					.increment = 8
 				},
 				.iv_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				}
 			}, }
@@ -574,13 +574,13 @@ static const struct rte_cryptodev_capabilities bcmfs_sym_capabilities[] = {
 				.algo = RTE_CRYPTO_CIPHER_AES_CBC,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 32,
+					.minimum = 16,
+					.maximum = 32,
 					.increment = 8
 				},
 				.iv_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				}
 			}, }
@@ -595,13 +595,13 @@ static const struct rte_cryptodev_capabilities bcmfs_sym_capabilities[] = {
 				.algo = RTE_CRYPTO_CIPHER_AES_CTR,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 32,
+					.minimum = 16,
+					.maximum = 32,
 					.increment = 8
 				},
 				.iv_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				}
 			}, }
@@ -616,13 +616,13 @@ static const struct rte_cryptodev_capabilities bcmfs_sym_capabilities[] = {
 				.algo = RTE_CRYPTO_CIPHER_AES_XTS,
 				.block_size = 16,
 				.key_size = {
-					.min = 32,
-					.max = 64,
+					.minimum = 32,
+					.maximum = 64,
 					.increment = 32
 				},
 				.iv_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				}
 			}, }
@@ -637,13 +637,13 @@ static const struct rte_cryptodev_capabilities bcmfs_sym_capabilities[] = {
 				.algo = RTE_CRYPTO_CIPHER_DES_CBC,
 				.block_size = 8,
 				.key_size = {
-					.min = 8,
-					.max = 8,
+					.minimum = 8,
+					.maximum = 8,
 					.increment = 0
 				},
 				.iv_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				}
 			}, }
@@ -658,13 +658,13 @@ static const struct rte_cryptodev_capabilities bcmfs_sym_capabilities[] = {
 				.algo = RTE_CRYPTO_CIPHER_3DES_CBC,
 				.block_size = 8,
 				.key_size = {
-					.min = 24,
-					.max = 24,
+					.minimum = 24,
+					.maximum = 24,
 					.increment = 0
 				},
 				.iv_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				}
 			}, }
@@ -679,13 +679,13 @@ static const struct rte_cryptodev_capabilities bcmfs_sym_capabilities[] = {
 				.algo = RTE_CRYPTO_CIPHER_3DES_ECB,
 				.block_size = 8,
 				.key_size = {
-					.min = 24,
-					.max = 24,
+					.minimum = 24,
+					.maximum = 24,
 					.increment = 0
 				},
 				.iv_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				}
 			}, }
@@ -700,23 +700,23 @@ static const struct rte_cryptodev_capabilities bcmfs_sym_capabilities[] = {
 				.algo = RTE_CRYPTO_AEAD_AES_GCM,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 32,
+					.minimum = 16,
+					.maximum = 32,
 					.increment = 8
 				},
 				.digest_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				},
 				.aad_size = {
-					.min = 0,
-					.max = 65535,
+					.minimum = 0,
+					.maximum = 65535,
 					.increment = 1
 				},
 				.iv_size = {
-					.min = 12,
-					.max = 16,
+					.minimum = 12,
+					.maximum = 16,
 					.increment = 4
 				},
 			}, }
@@ -731,23 +731,23 @@ static const struct rte_cryptodev_capabilities bcmfs_sym_capabilities[] = {
 				.algo = RTE_CRYPTO_AEAD_AES_CCM,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 32,
+					.minimum = 16,
+					.maximum = 32,
 					.increment = 8
 				},
 				.digest_size = {
-					.min = 4,
-					.max = 16,
+					.minimum = 4,
+					.maximum = 16,
 					.increment = 2
 				},
 				.aad_size = {
-					.min = 0,
-					.max = 65535,
+					.minimum = 0,
+					.maximum = 65535,
 					.increment = 1
 				},
 				.iv_size = {
-					.min = 7,
-					.max = 13,
+					.minimum = 7,
+					.maximum = 13,
 					.increment = 1
 				},
 			}, }
diff --git a/drivers/crypto/caam_jr/caam_jr_capabilities.c b/drivers/crypto/caam_jr/caam_jr_capabilities.c
index c51593c4bb..991a3b46ab 100644
--- a/drivers/crypto/caam_jr/caam_jr_capabilities.c
+++ b/drivers/crypto/caam_jr/caam_jr_capabilities.c
@@ -13,13 +13,13 @@ static const struct rte_cryptodev_capabilities caam_jr_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_MD5_HMAC,
 				.block_size = 64,
 				.key_size = {
-					.min = 1,
-					.max = 64,
+					.minimum = 1,
+					.maximum = 64,
 					.increment = 1
 				},
 				.digest_size = {
-					.min = 1,
-					.max = 16,
+					.minimum = 1,
+					.maximum = 16,
 					.increment = 1
 				},
 				.iv_size = { 0 }
@@ -34,13 +34,13 @@ static const struct rte_cryptodev_capabilities caam_jr_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA1_HMAC,
 				.block_size = 64,
 				.key_size = {
-					.min = 1,
-					.max = 64,
+					.minimum = 1,
+					.maximum = 64,
 					.increment = 1
 				},
 				.digest_size = {
-					.min = 1,
-					.max = 20,
+					.minimum = 1,
+					.maximum = 20,
 					.increment = 1
 				},
 				.iv_size = { 0 }
@@ -55,13 +55,13 @@ static const struct rte_cryptodev_capabilities caam_jr_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA224_HMAC,
 				.block_size = 64,
 				.key_size = {
-					.min = 1,
-					.max = 64,
+					.minimum = 1,
+					.maximum = 64,
 					.increment = 1
 				},
 				.digest_size = {
-					.min = 1,
-					.max = 28,
+					.minimum = 1,
+					.maximum = 28,
 					.increment = 1
 				},
 				.iv_size = { 0 }
@@ -76,13 +76,13 @@ static const struct rte_cryptodev_capabilities caam_jr_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA256_HMAC,
 				.block_size = 64,
 				.key_size = {
-					.min = 1,
-					.max = 64,
+					.minimum = 1,
+					.maximum = 64,
 					.increment = 1
 				},
 				.digest_size = {
-					.min = 1,
-					.max = 32,
+					.minimum = 1,
+					.maximum = 32,
 					.increment = 1
 				},
 				.iv_size = { 0 }
@@ -97,13 +97,13 @@ static const struct rte_cryptodev_capabilities caam_jr_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA384_HMAC,
 				.block_size = 128,
 				.key_size = {
-					.min = 1,
-					.max = 128,
+					.minimum = 1,
+					.maximum = 128,
 					.increment = 1
 				},
 				.digest_size = {
-					.min = 1,
-					.max = 48,
+					.minimum = 1,
+					.maximum = 48,
 					.increment = 1
 				},
 				.iv_size = { 0 }
@@ -118,13 +118,13 @@ static const struct rte_cryptodev_capabilities caam_jr_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA512_HMAC,
 				.block_size = 128,
 				.key_size = {
-					.min = 1,
-					.max = 128,
+					.minimum = 1,
+					.maximum = 128,
 					.increment = 1
 				},
 				.digest_size = {
-					.min = 1,
-					.max = 64,
+					.minimum = 1,
+					.maximum = 64,
 					.increment = 1
 				},
 				.iv_size = { 0 }
@@ -139,23 +139,23 @@ static const struct rte_cryptodev_capabilities caam_jr_capabilities[] = {
 				.algo = RTE_CRYPTO_AEAD_AES_GCM,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 32,
+					.minimum = 16,
+					.maximum = 32,
 					.increment = 8
 				},
 				.digest_size = {
-					.min = 8,
-					.max = 16,
+					.minimum = 8,
+					.maximum = 16,
 					.increment = 4
 				},
 				.aad_size = {
-					.min = 0,
-					.max = 240,
+					.minimum = 0,
+					.maximum = 240,
 					.increment = 1
 				},
 				.iv_size = {
-					.min = 12,
-					.max = 12,
+					.minimum = 12,
+					.maximum = 12,
 					.increment = 0
 				},
 			}, }
@@ -169,13 +169,13 @@ static const struct rte_cryptodev_capabilities caam_jr_capabilities[] = {
 				.algo = RTE_CRYPTO_CIPHER_AES_CBC,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 32,
+					.minimum = 16,
+					.maximum = 32,
 					.increment = 8
 				},
 				.iv_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				}
 			}, }
@@ -189,13 +189,13 @@ static const struct rte_cryptodev_capabilities caam_jr_capabilities[] = {
 				.algo = RTE_CRYPTO_CIPHER_AES_CTR,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 32,
+					.minimum = 16,
+					.maximum = 32,
 					.increment = 8
 				},
 				.iv_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				}
 			}, }
@@ -209,13 +209,13 @@ static const struct rte_cryptodev_capabilities caam_jr_capabilities[] = {
 				.algo = RTE_CRYPTO_CIPHER_3DES_CBC,
 				.block_size = 8,
 				.key_size = {
-					.min = 16,
-					.max = 24,
+					.minimum = 16,
+					.maximum = 24,
 					.increment = 8
 				},
 				.iv_size = {
-					.min = 8,
-					.max = 8,
+					.minimum = 8,
+					.maximum = 8,
 					.increment = 0
 				}
 			}, }
diff --git a/drivers/crypto/ccp/ccp_pmd_ops.c b/drivers/crypto/ccp/ccp_pmd_ops.c
index 98f964f361..60f3c14d87 100644
--- a/drivers/crypto/ccp/ccp_pmd_ops.c
+++ b/drivers/crypto/ccp/ccp_pmd_ops.c
@@ -21,13 +21,13 @@
 				 .algo = RTE_CRYPTO_AUTH_SHA1,		\
 				 .block_size = 64,			\
 				 .key_size = {				\
-					 .min = 0,			\
-					 .max = 0,			\
+					 .minimum = 0,			\
+					 .maximum = 0,			\
 					 .increment = 0			\
 				 },					\
 				 .digest_size = {			\
-					 .min = 20,			\
-					 .max = 20,			\
+					 .minimum = 20,			\
+					 .maximum = 20,			\
 					 .increment = 0			\
 				 },					\
 				 .aad_size = { 0 }			\
@@ -42,13 +42,13 @@
 				 .algo = RTE_CRYPTO_AUTH_SHA1_HMAC,     \
 				 .block_size = 64,                      \
 				 .key_size = {                          \
-					 .min = 1,                      \
-					 .max = 64,                     \
+					 .minimum = 1,                      \
+					 .maximum = 64,                     \
 					 .increment = 1                 \
 				 },                                     \
 				 .digest_size = {                       \
-					 .min = 1,                      \
-					 .max = 20,                     \
+					 .minimum = 1,                      \
+					 .maximum = 20,                     \
 					 .increment = 1                 \
 				 },                                     \
 				 .aad_size = { 0 }                      \
@@ -63,13 +63,13 @@
 				 .algo = RTE_CRYPTO_AUTH_SHA224,        \
 				 .block_size = 64,                      \
 				 .key_size = {                          \
-					 .min = 0,                      \
-					 .max = 0,			\
+					 .minimum = 0,                      \
+					 .maximum = 0,			\
 					 .increment = 0                 \
 				 },                                     \
 				 .digest_size = {                       \
-					 .min = 28,                     \
-					 .max = 28,                     \
+					 .minimum = 28,                     \
+					 .maximum = 28,                     \
 					 .increment = 0                 \
 				 },                                     \
 				 .aad_size = { 0 }                      \
@@ -84,13 +84,13 @@
 				 .algo = RTE_CRYPTO_AUTH_SHA224_HMAC,   \
 				 .block_size = 64,                      \
 				 .key_size = {                          \
-					 .min = 1,                      \
-					 .max = 64,                     \
+					 .minimum = 1,                      \
+					 .maximum = 64,                     \
 					 .increment = 1                 \
 				 },                                     \
 				 .digest_size = {                       \
-					 .min = 1,                     \
-					 .max = 28,                     \
+					 .minimum = 1,                     \
+					 .maximum = 28,                     \
 					 .increment = 1                 \
 				 },                                     \
 				 .aad_size = { 0 }                      \
@@ -105,13 +105,13 @@
 				 .algo = RTE_CRYPTO_AUTH_SHA3_224,      \
 				 .block_size = 144,                     \
 				 .key_size = {                          \
-					 .min = 0,                      \
-					 .max = 0,                      \
+					 .minimum = 0,                      \
+					 .maximum = 0,                      \
 					 .increment = 0                 \
 				 },                                     \
 				 .digest_size = {                       \
-					 .min = 28,                     \
-					 .max = 28,                     \
+					 .minimum = 28,                     \
+					 .maximum = 28,                     \
 					 .increment = 0                 \
 				 },                                     \
 				 .aad_size = { 0 }                      \
@@ -126,13 +126,13 @@
 				 .algo = RTE_CRYPTO_AUTH_SHA3_224_HMAC, \
 				 .block_size = 144,                     \
 				 .key_size = {                          \
-					 .min = 1,                      \
-					 .max = 144,                    \
+					 .minimum = 1,                      \
+					 .maximum = 144,                    \
 					 .increment = 1                 \
 				 },                                     \
 				 .digest_size = {                       \
-					 .min = 28,                     \
-					 .max = 28,                     \
+					 .minimum = 28,                     \
+					 .maximum = 28,                     \
 					 .increment = 0                 \
 				 },                                     \
 				 .aad_size = { 0 }                      \
@@ -147,13 +147,13 @@
 				 .algo = RTE_CRYPTO_AUTH_SHA256,        \
 				 .block_size = 64,                      \
 				 .key_size = {                          \
-					 .min = 0,                      \
-					 .max = 0,                      \
+					 .minimum = 0,                      \
+					 .maximum = 0,                      \
 					 .increment = 0                 \
 				 },                                     \
 				 .digest_size = {                       \
-					 .min = 32,                     \
-					 .max = 32,                     \
+					 .minimum = 32,                     \
+					 .maximum = 32,                     \
 					 .increment = 0                 \
 				 },                                     \
 				 .aad_size = { 0 }                      \
@@ -168,13 +168,13 @@
 				 .algo = RTE_CRYPTO_AUTH_SHA256_HMAC,   \
 				 .block_size = 64,                      \
 				 .key_size = {                          \
-					 .min = 1,                      \
-					 .max = 64,                     \
+					 .minimum = 1,                      \
+					 .maximum = 64,                     \
 					 .increment = 1                 \
 				 },                                     \
 				 .digest_size = {                       \
-					 .min = 1,                     \
-					 .max = 32,                     \
+					 .minimum = 1,                     \
+					 .maximum = 32,                     \
 					 .increment = 1                 \
 				 },                                     \
 				 .aad_size = { 0 }                      \
@@ -189,13 +189,13 @@
 				 .algo = RTE_CRYPTO_AUTH_SHA3_256,      \
 				 .block_size = 136,                     \
 				 .key_size = {                          \
-					 .min = 0,                      \
-					 .max = 0,                      \
+					 .minimum = 0,                      \
+					 .maximum = 0,                      \
 					 .increment = 0                 \
 				 },                                     \
 				 .digest_size = {                       \
-					 .min = 32,                     \
-					 .max = 32,                     \
+					 .minimum = 32,                     \
+					 .maximum = 32,                     \
 					 .increment = 0                 \
 				 },                                     \
 				 .aad_size = { 0 }                      \
@@ -210,13 +210,13 @@
 				 .algo = RTE_CRYPTO_AUTH_SHA3_256_HMAC, \
 				 .block_size = 136,                     \
 				 .key_size = {                          \
-					 .min = 1,                      \
-					 .max = 136,                    \
+					 .minimum = 1,                      \
+					 .maximum = 136,                    \
 					 .increment = 1                 \
 				 },                                     \
 				 .digest_size = {                       \
-					 .min = 32,                     \
-					 .max = 32,                     \
+					 .minimum = 32,                     \
+					 .maximum = 32,                     \
 					 .increment = 0                 \
 				 },                                     \
 				 .aad_size = { 0 }                      \
@@ -231,13 +231,13 @@
 				 .algo = RTE_CRYPTO_AUTH_SHA384,        \
 				 .block_size = 128,                     \
 				 .key_size = {                          \
-					 .min = 0,                      \
-					 .max = 0,                      \
+					 .minimum = 0,                      \
+					 .maximum = 0,                      \
 					 .increment = 0                 \
 				 },                                     \
 				 .digest_size = {                       \
-					 .min = 48,                     \
-					 .max = 48,                     \
+					 .minimum = 48,                     \
+					 .maximum = 48,                     \
 					 .increment = 0                 \
 				 },                                     \
 				 .aad_size = { 0 }                      \
@@ -252,13 +252,13 @@
 				 .algo = RTE_CRYPTO_AUTH_SHA384_HMAC,   \
 				 .block_size = 128,                     \
 				 .key_size = {                          \
-					 .min = 1,                      \
-					 .max = 128,                    \
+					 .minimum = 1,                      \
+					 .maximum = 128,                    \
 					 .increment = 1                 \
 				 },                                     \
 				 .digest_size = {                       \
-					 .min = 1,                     \
-					 .max = 48,                     \
+					 .minimum = 1,                     \
+					 .maximum = 48,                     \
 					 .increment = 1                 \
 				 },                                     \
 				 .aad_size = { 0 }                      \
@@ -273,13 +273,13 @@
 				 .algo = RTE_CRYPTO_AUTH_SHA3_384,      \
 				 .block_size = 104,                     \
 				 .key_size = {                          \
-					 .min = 0,                      \
-					 .max = 0,                      \
+					 .minimum = 0,                      \
+					 .maximum = 0,                      \
 					 .increment = 0                 \
 				 },                                     \
 				 .digest_size = {                       \
-					 .min = 48,                     \
-					 .max = 48,                     \
+					 .minimum = 48,                     \
+					 .maximum = 48,                     \
 					 .increment = 0                 \
 				 },                                     \
 				 .aad_size = { 0 }                      \
@@ -294,13 +294,13 @@
 				 .algo = RTE_CRYPTO_AUTH_SHA3_384_HMAC, \
 				 .block_size = 104,                     \
 				 .key_size = {                          \
-					 .min = 1,                      \
-					 .max = 104,                    \
+					 .minimum = 1,                      \
+					 .maximum = 104,                    \
 					 .increment = 1                 \
 				 },                                     \
 				 .digest_size = {                       \
-					 .min = 48,                     \
-					 .max = 48,                     \
+					 .minimum = 48,                     \
+					 .maximum = 48,                     \
 					 .increment = 0                 \
 				 },                                     \
 				 .aad_size = { 0 }                      \
@@ -315,13 +315,13 @@
 				 .algo = RTE_CRYPTO_AUTH_SHA512,        \
 				 .block_size = 128,                     \
 				 .key_size = {                          \
-					 .min = 0,                      \
-					 .max = 0,                      \
+					 .minimum = 0,                      \
+					 .maximum = 0,                      \
 					 .increment = 0                 \
 				 },                                     \
 				 .digest_size = {                       \
-					 .min = 64,                     \
-					 .max = 64,                     \
+					 .minimum = 64,                     \
+					 .maximum = 64,                     \
 					 .increment = 0                 \
 				 },                                     \
 				 .aad_size = { 0 }			\
@@ -336,13 +336,13 @@
 				 .algo = RTE_CRYPTO_AUTH_SHA512_HMAC,   \
 				 .block_size = 128,                     \
 				 .key_size = {                          \
-					 .min = 1,                      \
-					 .max = 128,                    \
+					 .minimum = 1,                      \
+					 .maximum = 128,                    \
 					 .increment = 1                 \
 				 },                                     \
 				 .digest_size = {                       \
-					 .min = 1,                     \
-					 .max = 64,                     \
+					 .minimum = 1,                     \
+					 .maximum = 64,                     \
 					 .increment = 1                 \
 				 },                                     \
 				 .aad_size = { 0 }                      \
@@ -357,13 +357,13 @@
 				 .algo = RTE_CRYPTO_AUTH_SHA3_512,      \
 				 .block_size = 72,                      \
 				 .key_size = {                          \
-					 .min = 0,                      \
-					 .max = 0,                      \
+					 .minimum = 0,                      \
+					 .maximum = 0,                      \
 					 .increment = 0                 \
 				 },                                     \
 				 .digest_size = {                       \
-					 .min = 64,                     \
-					 .max = 64,                     \
+					 .minimum = 64,                     \
+					 .maximum = 64,                     \
 					 .increment = 0                 \
 				 },                                     \
 				 .aad_size = { 0 }                      \
@@ -378,13 +378,13 @@
 				 .algo = RTE_CRYPTO_AUTH_SHA3_512_HMAC, \
 				 .block_size = 72,                      \
 				 .key_size = {                          \
-					 .min = 1,                      \
-					 .max = 72,                     \
+					 .minimum = 1,                      \
+					 .maximum = 72,                     \
 					 .increment = 1                 \
 				 },                                     \
 				 .digest_size = {                       \
-					 .min = 1,                     \
-					 .max = 64,                     \
+					 .minimum = 1,                     \
+					 .maximum = 64,                     \
 					 .increment = 1                 \
 				 },                                     \
 				 .aad_size = { 0 }                      \
@@ -399,13 +399,13 @@
 				 .algo = RTE_CRYPTO_AUTH_AES_CMAC,      \
 				 .block_size = 16,                      \
 				 .key_size = {                          \
-					 .min = 16,                     \
-					 .max = 32,                     \
+					 .minimum = 16,                     \
+					 .maximum = 32,                     \
 					 .increment = 8                 \
 				 },                                     \
 				 .digest_size = {                       \
-					 .min = 16,                     \
-					 .max = 16,                     \
+					 .minimum = 16,                     \
+					 .maximum = 16,                     \
 					 .increment = 0                 \
 				 },                                     \
 			}, }                                            \
@@ -419,13 +419,13 @@
 				.algo = RTE_CRYPTO_CIPHER_AES_ECB,      \
 				.block_size = 16,                       \
 				.key_size = {                           \
-				   .min = 16,                           \
-				   .max = 32,                           \
+				   .minimum = 16,                           \
+				   .maximum = 32,                           \
 				   .increment = 8                       \
 				},                                      \
 				.iv_size = {                            \
-				   .min = 0,                            \
-				   .max = 0,                            \
+				   .minimum = 0,                            \
+				   .maximum = 0,                            \
 				   .increment = 0                       \
 				}                                       \
 			}, }						\
@@ -439,13 +439,13 @@
 				.algo = RTE_CRYPTO_CIPHER_AES_CBC,      \
 				.block_size = 16,                       \
 				.key_size = {                           \
-					.min = 16,                      \
-					.max = 32,                      \
+					.minimum = 16,                      \
+					.maximum = 32,                      \
 					.increment = 8                  \
 				},                                      \
 				.iv_size = {                            \
-					.min = 16,                      \
-					.max = 16,                      \
+					.minimum = 16,                      \
+					.maximum = 16,                      \
 					.increment = 0                  \
 				}                                       \
 			}, }                                            \
@@ -459,13 +459,13 @@
 				.algo = RTE_CRYPTO_CIPHER_AES_CTR,      \
 				.block_size = 16,                       \
 				.key_size = {                           \
-					.min = 16,                      \
-					.max = 32,                      \
+					.minimum = 16,                      \
+					.maximum = 32,                      \
 					.increment = 8                  \
 				},                                      \
 				.iv_size = {                            \
-					.min = 16,                      \
-					.max = 16,                      \
+					.minimum = 16,                      \
+					.maximum = 16,                      \
 					.increment = 0                  \
 				}                                       \
 			}, }                                            \
@@ -479,13 +479,13 @@
 				.algo = RTE_CRYPTO_CIPHER_3DES_CBC,     \
 				.block_size = 8,                        \
 				.key_size = {                           \
-					.min = 16,                      \
-					.max = 24,                      \
+					.minimum = 16,                      \
+					.maximum = 24,                      \
 					.increment = 8                  \
 				},                                      \
 				.iv_size = {                            \
-					.min = 8,                       \
-					.max = 8,                       \
+					.minimum = 8,                       \
+					.maximum = 8,                       \
 					.increment = 0                  \
 				}                                       \
 			}, }                                            \
@@ -499,23 +499,23 @@
 				 .algo = RTE_CRYPTO_AEAD_AES_GCM,       \
 				 .block_size = 16,                      \
 				 .key_size = {                          \
-					 .min = 16,                     \
-					 .max = 32,                     \
+					 .minimum = 16,                     \
+					 .maximum = 32,                     \
 					 .increment = 8                 \
 				 },                                     \
 				 .digest_size = {                       \
-					 .min = 16,                     \
-					 .max = 16,                     \
+					 .minimum = 16,                     \
+					 .maximum = 16,                     \
 					 .increment = 0                 \
 				 },                                     \
 				 .aad_size = {                          \
-					 .min = 0,                      \
-					 .max = 65535,                  \
+					 .minimum = 0,                      \
+					 .maximum = 65535,                  \
 					 .increment = 1                 \
 				 },                                     \
 				 .iv_size = {                           \
-					 .min = 12,                     \
-					 .max = 16,                     \
+					 .minimum = 12,                     \
+					 .maximum = 16,                     \
 					 .increment = 4                 \
 				 },                                     \
 			}, }                                            \
@@ -531,13 +531,13 @@
 				 .algo = RTE_CRYPTO_AUTH_MD5_HMAC,	\
 				 .block_size = 64,			\
 				 .key_size = {				\
-					 .min = 1,			\
-					 .max = 64,			\
+					 .minimum = 1,			\
+					 .maximum = 64,			\
 					 .increment = 1			\
 				 },					\
 				 .digest_size = {			\
-					 .min = 1,			\
-					 .max = 16,			\
+					 .minimum = 1,			\
+					 .maximum = 16,			\
 					 .increment = 1			\
 				 },					\
 				 .aad_size = { 0 }			\
diff --git a/drivers/crypto/cnxk/cnxk_cryptodev_capabilities.c b/drivers/crypto/cnxk/cnxk_cryptodev_capabilities.c
index c4f7824332..a2903116f9 100644
--- a/drivers/crypto/cnxk/cnxk_cryptodev_capabilities.c
+++ b/drivers/crypto/cnxk/cnxk_cryptodev_capabilities.c
@@ -39,8 +39,8 @@ static const struct rte_cryptodev_capabilities caps_mul[] = {
 					(1 << RTE_CRYPTO_ASYM_OP_ENCRYPT) |
 					(1 << RTE_CRYPTO_ASYM_OP_DECRYPT)),
 				{.modlen = {
-					.min = 17,
-					.max = 1024,
+					.minimum = 17,
+					.maximum = 1024,
 					.increment = 1
 				}, }
 			}
@@ -53,8 +53,8 @@ static const struct rte_cryptodev_capabilities caps_mul[] = {
 				.xform_type = RTE_CRYPTO_ASYM_XFORM_MODEX,
 				.op_types = 0,
 				{.modlen = {
-					.min = 17,
-					.max = 1024,
+					.minimum = 17,
+					.maximum = 1024,
 					.increment = 1
 				}, }
 			}
@@ -92,13 +92,13 @@ static const struct rte_cryptodev_capabilities caps_sha1_sha2[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA1,
 				.block_size = 64,
 				.key_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 20,
-					.max = 20,
+					.minimum = 20,
+					.maximum = 20,
 					.increment = 0
 				},
 			}, }
@@ -112,13 +112,13 @@ static const struct rte_cryptodev_capabilities caps_sha1_sha2[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA1_HMAC,
 				.block_size = 64,
 				.key_size = {
-					.min = 1,
-					.max = 1024,
+					.minimum = 1,
+					.maximum = 1024,
 					.increment = 1
 				},
 				.digest_size = {
-					.min = 12,
-					.max = 20,
+					.minimum = 12,
+					.maximum = 20,
 					.increment = 8
 				},
 			}, }
@@ -132,13 +132,13 @@ static const struct rte_cryptodev_capabilities caps_sha1_sha2[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA224,
 				.block_size = 64,
 					.key_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 28,
-					.max = 28,
+					.minimum = 28,
+					.maximum = 28,
 					.increment = 0
 				},
 			}, }
@@ -152,13 +152,13 @@ static const struct rte_cryptodev_capabilities caps_sha1_sha2[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA224_HMAC,
 				.block_size = 64,
 					.key_size = {
-					.min = 1,
-					.max = 1024,
+					.minimum = 1,
+					.maximum = 1024,
 					.increment = 1
 				},
 				.digest_size = {
-					.min = 28,
-					.max = 28,
+					.minimum = 28,
+					.maximum = 28,
 					.increment = 0
 				},
 			}, }
@@ -172,13 +172,13 @@ static const struct rte_cryptodev_capabilities caps_sha1_sha2[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA256,
 				.block_size = 64,
 				.key_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 32,
-					.max = 32,
+					.minimum = 32,
+					.maximum = 32,
 					.increment = 0
 				},
 			}, }
@@ -192,13 +192,13 @@ static const struct rte_cryptodev_capabilities caps_sha1_sha2[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA256_HMAC,
 				.block_size = 64,
 				.key_size = {
-					.min = 1,
-					.max = 1024,
+					.minimum = 1,
+					.maximum = 1024,
 					.increment = 1
 				},
 				.digest_size = {
-					.min = 16,
-					.max = 32,
+					.minimum = 16,
+					.maximum = 32,
 					.increment = 16
 				},
 			}, }
@@ -212,13 +212,13 @@ static const struct rte_cryptodev_capabilities caps_sha1_sha2[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA384,
 				.block_size = 64,
 				.key_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 48,
-					.max = 48,
+					.minimum = 48,
+					.maximum = 48,
 					.increment = 0
 					},
 			}, }
@@ -232,13 +232,13 @@ static const struct rte_cryptodev_capabilities caps_sha1_sha2[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA384_HMAC,
 				.block_size = 64,
 				.key_size = {
-					.min = 1,
-					.max = 1024,
+					.minimum = 1,
+					.maximum = 1024,
 					.increment = 1
 				},
 				.digest_size = {
-					.min = 24,
-					.max = 48,
+					.minimum = 24,
+					.maximum = 48,
 					.increment = 24
 					},
 			}, }
@@ -252,13 +252,13 @@ static const struct rte_cryptodev_capabilities caps_sha1_sha2[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA512,
 				.block_size = 128,
 				.key_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 64,
-					.max = 64,
+					.minimum = 64,
+					.maximum = 64,
 					.increment = 0
 				},
 			}, }
@@ -272,13 +272,13 @@ static const struct rte_cryptodev_capabilities caps_sha1_sha2[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA512_HMAC,
 				.block_size = 128,
 				.key_size = {
-					.min = 1,
-					.max = 1024,
+					.minimum = 1,
+					.maximum = 1024,
 					.increment = 1
 				},
 				.digest_size = {
-					.min = 32,
-					.max = 64,
+					.minimum = 32,
+					.maximum = 64,
 					.increment = 32
 				},
 			}, }
@@ -292,13 +292,13 @@ static const struct rte_cryptodev_capabilities caps_sha1_sha2[] = {
 				.algo = RTE_CRYPTO_AUTH_MD5,
 				.block_size = 64,
 				.key_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				},
 			}, }
@@ -312,13 +312,13 @@ static const struct rte_cryptodev_capabilities caps_sha1_sha2[] = {
 				.algo = RTE_CRYPTO_AUTH_MD5_HMAC,
 				.block_size = 64,
 				.key_size = {
-					.min = 8,
-					.max = 64,
+					.minimum = 8,
+					.maximum = 64,
 					.increment = 8
 				},
 				.digest_size = {
-					.min = 12,
-					.max = 16,
+					.minimum = 12,
+					.maximum = 16,
 					.increment = 4
 				},
 			}, }
@@ -335,23 +335,23 @@ static const struct rte_cryptodev_capabilities caps_chacha20[] = {
 				.algo = RTE_CRYPTO_AEAD_CHACHA20_POLY1305,
 				.block_size = 64,
 				.key_size = {
-					.min = 32,
-					.max = 32,
+					.minimum = 32,
+					.maximum = 32,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				},
 				.aad_size = {
-					.min = 0,
-					.max = 1024,
+					.minimum = 0,
+					.maximum = 1024,
 					.increment = 1
 				},
 				.iv_size = {
-					.min = 12,
-					.max = 12,
+					.minimum = 12,
+					.maximum = 12,
 					.increment = 0
 				},
 			}, }
@@ -368,13 +368,13 @@ static const struct rte_cryptodev_capabilities caps_zuc_snow3g[] = {
 				.algo = RTE_CRYPTO_CIPHER_SNOW3G_UEA2,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				},
 				.iv_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				}
 			}, }
@@ -388,13 +388,13 @@ static const struct rte_cryptodev_capabilities caps_zuc_snow3g[] = {
 				.algo = RTE_CRYPTO_CIPHER_ZUC_EEA3,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				},
 				.iv_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				}
 			}, }
@@ -408,18 +408,18 @@ static const struct rte_cryptodev_capabilities caps_zuc_snow3g[] = {
 				.algo = RTE_CRYPTO_AUTH_SNOW3G_UIA2,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 4,
-					.max = 4,
+					.minimum = 4,
+					.maximum = 4,
 					.increment = 0
 				},
 				.iv_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				}
 			}, }
@@ -433,18 +433,18 @@ static const struct rte_cryptodev_capabilities caps_zuc_snow3g[] = {
 				.algo = RTE_CRYPTO_AUTH_ZUC_EIA3,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 4,
-					.max = 4,
+					.minimum = 4,
+					.maximum = 4,
 					.increment = 0
 				},
 				.iv_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				}
 			}, }
@@ -461,18 +461,18 @@ static const struct rte_cryptodev_capabilities caps_aes[] = {
 				.algo = RTE_CRYPTO_AUTH_AES_GMAC,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 32,
+					.minimum = 16,
+					.maximum = 32,
 					.increment = 8
 				},
 				.digest_size = {
-					.min = 8,
-					.max = 16,
+					.minimum = 8,
+					.maximum = 16,
 					.increment = 4
 				},
 				.iv_size = {
-					.min = 12,
-					.max = 12,
+					.minimum = 12,
+					.maximum = 12,
 					.increment = 0
 				}
 			}, }
@@ -486,13 +486,13 @@ static const struct rte_cryptodev_capabilities caps_aes[] = {
 				.algo = RTE_CRYPTO_CIPHER_AES_CBC,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 32,
+					.minimum = 16,
+					.maximum = 32,
 					.increment = 8
 				},
 				.iv_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				}
 			}, }
@@ -506,13 +506,13 @@ static const struct rte_cryptodev_capabilities caps_aes[] = {
 				.algo = RTE_CRYPTO_CIPHER_AES_CTR,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 32,
+					.minimum = 16,
+					.maximum = 32,
 					.increment = 8
 				},
 				.iv_size = {
-					.min = 12,
-					.max = 16,
+					.minimum = 12,
+					.maximum = 16,
 					.increment = 4
 				}
 			}, }
@@ -526,13 +526,13 @@ static const struct rte_cryptodev_capabilities caps_aes[] = {
 				.algo = RTE_CRYPTO_CIPHER_AES_XTS,
 				.block_size = 16,
 				.key_size = {
-					.min = 32,
-					.max = 64,
+					.minimum = 32,
+					.maximum = 64,
 					.increment = 32
 				},
 				.iv_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				}
 			}, }
@@ -546,23 +546,23 @@ static const struct rte_cryptodev_capabilities caps_aes[] = {
 				.algo = RTE_CRYPTO_AEAD_AES_GCM,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 32,
+					.minimum = 16,
+					.maximum = 32,
 					.increment = 8
 				},
 				.digest_size = {
-					.min = 4,
-					.max = 16,
+					.minimum = 4,
+					.maximum = 16,
 					.increment = 1
 				},
 				.aad_size = {
-					.min = 0,
-					.max = 1024,
+					.minimum = 0,
+					.maximum = 1024,
 					.increment = 1
 				},
 				.iv_size = {
-					.min = 12,
-					.max = 12,
+					.minimum = 12,
+					.maximum = 12,
 					.increment = 0
 				}
 			}, }
@@ -579,13 +579,13 @@ static const struct rte_cryptodev_capabilities caps_kasumi[] = {
 				.algo = RTE_CRYPTO_CIPHER_KASUMI_F8,
 				.block_size = 8,
 				.key_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				},
 				.iv_size = {
-					.min = 8,
-					.max = 8,
+					.minimum = 8,
+					.maximum = 8,
 					.increment = 0
 				}
 			}, }
@@ -599,13 +599,13 @@ static const struct rte_cryptodev_capabilities caps_kasumi[] = {
 				.algo = RTE_CRYPTO_AUTH_KASUMI_F9,
 				.block_size = 8,
 				.key_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 4,
-					.max = 4,
+					.minimum = 4,
+					.maximum = 4,
 					.increment = 0
 				},
 			}, }
@@ -622,13 +622,13 @@ static const struct rte_cryptodev_capabilities caps_des[] = {
 				.algo = RTE_CRYPTO_CIPHER_3DES_CBC,
 				.block_size = 8,
 				.key_size = {
-					.min = 24,
-					.max = 24,
+					.minimum = 24,
+					.maximum = 24,
 					.increment = 0
 				},
 				.iv_size = {
-					.min = 8,
-					.max = 16,
+					.minimum = 8,
+					.maximum = 16,
 					.increment = 8
 				}
 			}, }
@@ -642,13 +642,13 @@ static const struct rte_cryptodev_capabilities caps_des[] = {
 				.algo = RTE_CRYPTO_CIPHER_3DES_ECB,
 				.block_size = 8,
 				.key_size = {
-					.min = 24,
-					.max = 24,
+					.minimum = 24,
+					.maximum = 24,
 					.increment = 0
 				},
 				.iv_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				}
 			}, }
@@ -662,13 +662,13 @@ static const struct rte_cryptodev_capabilities caps_des[] = {
 				.algo = RTE_CRYPTO_CIPHER_DES_CBC,
 				.block_size = 8,
 				.key_size = {
-					.min = 8,
-					.max = 8,
+					.minimum = 8,
+					.maximum = 8,
 					.increment = 0
 				},
 				.iv_size = {
-					.min = 8,
-					.max = 8,
+					.minimum = 8,
+					.maximum = 8,
 					.increment = 0
 				}
 			}, }
@@ -685,13 +685,13 @@ static const struct rte_cryptodev_capabilities caps_null[] = {
 				.algo = RTE_CRYPTO_AUTH_NULL,
 				.block_size = 1,
 				.key_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				},
 			}, },
@@ -705,13 +705,13 @@ static const struct rte_cryptodev_capabilities caps_null[] = {
 				.algo = RTE_CRYPTO_CIPHER_NULL,
 				.block_size = 1,
 				.key_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				},
 				.iv_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				}
 			}, },
@@ -732,23 +732,23 @@ static const struct rte_cryptodev_capabilities sec_caps_aes[] = {
 				.algo = RTE_CRYPTO_AEAD_AES_GCM,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 32,
+					.minimum = 16,
+					.maximum = 32,
 					.increment = 8
 				},
 				.digest_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				},
 				.aad_size = {
-					.min = 8,
-					.max = 12,
+					.minimum = 8,
+					.maximum = 12,
 					.increment = 4
 				},
 				.iv_size = {
-					.min = 12,
-					.max = 12,
+					.minimum = 12,
+					.maximum = 12,
 					.increment = 0
 				}
 			}, }
@@ -762,13 +762,13 @@ static const struct rte_cryptodev_capabilities sec_caps_aes[] = {
 				.algo = RTE_CRYPTO_CIPHER_AES_CBC,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 32,
+					.minimum = 16,
+					.maximum = 32,
 					.increment = 8
 				},
 				.iv_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				}
 			}, }
@@ -785,13 +785,13 @@ static const struct rte_cryptodev_capabilities sec_caps_sha1_sha2[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA1_HMAC,
 				.block_size = 64,
 				.key_size = {
-					.min = 20,
-					.max = 64,
+					.minimum = 20,
+					.maximum = 64,
 					.increment = 1
 				},
 				.digest_size = {
-					.min = 12,
-					.max = 12,
+					.minimum = 12,
+					.maximum = 12,
 					.increment = 0
 				},
 			}, }
diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_priv.h b/drivers/crypto/dpaa2_sec/dpaa2_sec_priv.h
index 7dbc69f6cb..7bd6f89fd5 100644
--- a/drivers/crypto/dpaa2_sec/dpaa2_sec_priv.h
+++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_priv.h
@@ -209,13 +209,13 @@ static const struct rte_cryptodev_capabilities dpaa2_sec_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_NULL,
 				.block_size = 1,
 				.key_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				},
 				.iv_size = { 0 }
@@ -230,13 +230,13 @@ static const struct rte_cryptodev_capabilities dpaa2_sec_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_MD5,
 				.block_size = 64,
 				.key_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				},
 				.iv_size = { 0 }
@@ -251,13 +251,13 @@ static const struct rte_cryptodev_capabilities dpaa2_sec_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_MD5_HMAC,
 				.block_size = 64,
 				.key_size = {
-					.min = 1,
-					.max = 64,
+					.minimum = 1,
+					.maximum = 64,
 					.increment = 1
 				},
 				.digest_size = {
-					.min = 1,
-					.max = 16,
+					.minimum = 1,
+					.maximum = 16,
 					.increment = 1
 				},
 				.iv_size = { 0 }
@@ -272,13 +272,13 @@ static const struct rte_cryptodev_capabilities dpaa2_sec_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA1,
 				.block_size = 64,
 				.key_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 20,
-					.max = 20,
+					.minimum = 20,
+					.maximum = 20,
 					.increment = 0
 				},
 				.iv_size = { 0 }
@@ -293,13 +293,13 @@ static const struct rte_cryptodev_capabilities dpaa2_sec_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA1_HMAC,
 				.block_size = 64,
 				.key_size = {
-					.min = 1,
-					.max = 64,
+					.minimum = 1,
+					.maximum = 64,
 					.increment = 1
 				},
 				.digest_size = {
-					.min = 1,
-					.max = 20,
+					.minimum = 1,
+					.maximum = 20,
 					.increment = 1
 				},
 				.iv_size = { 0 }
@@ -314,13 +314,13 @@ static const struct rte_cryptodev_capabilities dpaa2_sec_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA224,
 				.block_size = 64,
 					.key_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 28,
-					.max = 28,
+					.minimum = 28,
+					.maximum = 28,
 					.increment = 0
 				},
 				.iv_size = { 0 }
@@ -335,13 +335,13 @@ static const struct rte_cryptodev_capabilities dpaa2_sec_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA224_HMAC,
 				.block_size = 64,
 				.key_size = {
-					.min = 1,
-					.max = 64,
+					.minimum = 1,
+					.maximum = 64,
 					.increment = 1
 				},
 				.digest_size = {
-					.min = 1,
-					.max = 28,
+					.minimum = 1,
+					.maximum = 28,
 					.increment = 1
 				},
 				.iv_size = { 0 }
@@ -356,13 +356,13 @@ static const struct rte_cryptodev_capabilities dpaa2_sec_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA256,
 				.block_size = 64,
 				.key_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 32,
-					.max = 32,
+					.minimum = 32,
+					.maximum = 32,
 					.increment = 0
 				},
 				.iv_size = { 0 }
@@ -377,13 +377,13 @@ static const struct rte_cryptodev_capabilities dpaa2_sec_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA256_HMAC,
 				.block_size = 64,
 				.key_size = {
-					.min = 1,
-					.max = 64,
+					.minimum = 1,
+					.maximum = 64,
 					.increment = 1
 				},
 				.digest_size = {
-					.min = 1,
-					.max = 32,
+					.minimum = 1,
+					.maximum = 32,
 					.increment = 1
 				},
 				.iv_size = { 0 }
@@ -398,13 +398,13 @@ static const struct rte_cryptodev_capabilities dpaa2_sec_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA384,
 				.block_size = 64,
 				.key_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 48,
-					.max = 48,
+					.minimum = 48,
+					.maximum = 48,
 					.increment = 0
 					},
 				.iv_size = { 0 }
@@ -419,13 +419,13 @@ static const struct rte_cryptodev_capabilities dpaa2_sec_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA384_HMAC,
 				.block_size = 128,
 				.key_size = {
-					.min = 1,
-					.max = 128,
+					.minimum = 1,
+					.maximum = 128,
 					.increment = 1
 				},
 				.digest_size = {
-					.min = 1,
-					.max = 48,
+					.minimum = 1,
+					.maximum = 48,
 					.increment = 1
 				},
 				.iv_size = { 0 }
@@ -440,13 +440,13 @@ static const struct rte_cryptodev_capabilities dpaa2_sec_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA512,
 				.block_size = 128,
 				.key_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 64,
-					.max = 64,
+					.minimum = 64,
+					.maximum = 64,
 					.increment = 0
 				},
 				.iv_size = { 0 }
@@ -461,13 +461,13 @@ static const struct rte_cryptodev_capabilities dpaa2_sec_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA512_HMAC,
 				.block_size = 128,
 				.key_size = {
-					.min = 1,
-					.max = 128,
+					.minimum = 1,
+					.maximum = 128,
 					.increment = 1
 				},
 				.digest_size = {
-					.min = 1,
-					.max = 64,
+					.minimum = 1,
+					.maximum = 64,
 					.increment = 1
 				},
 				.iv_size = { 0 }
@@ -482,23 +482,23 @@ static const struct rte_cryptodev_capabilities dpaa2_sec_capabilities[] = {
 				.algo = RTE_CRYPTO_AEAD_AES_GCM,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 32,
+					.minimum = 16,
+					.maximum = 32,
 					.increment = 8
 				},
 				.digest_size = {
-					.min = 8,
-					.max = 16,
+					.minimum = 8,
+					.maximum = 16,
 					.increment = 4
 				},
 				.aad_size = {
-					.min = 0,
-					.max = 240,
+					.minimum = 0,
+					.maximum = 240,
 					.increment = 1
 				},
 				.iv_size = {
-					.min = 12,
-					.max = 12,
+					.minimum = 12,
+					.maximum = 12,
 					.increment = 0
 				},
 			}, }
@@ -512,13 +512,13 @@ static const struct rte_cryptodev_capabilities dpaa2_sec_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_AES_XCBC_MAC,
 				.block_size = 16,
 				.key_size = {
-					.min = 1,
-					.max = 16,
+					.minimum = 1,
+					.maximum = 16,
 					.increment = 1
 				},
 				.digest_size = {
-					.min = 12,
-					.max = 16,
+					.minimum = 12,
+					.maximum = 16,
 					.increment = 4
 				},
 				.aad_size = { 0 },
@@ -534,13 +534,13 @@ static const struct rte_cryptodev_capabilities dpaa2_sec_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_AES_CMAC,
 				.block_size = 16,
 				.key_size = {
-					.min = 1,
-					.max = 16,
+					.minimum = 1,
+					.maximum = 16,
 					.increment = 1
 				},
 				.digest_size = {
-					.min = 4,
-					.max = 16,
+					.minimum = 4,
+					.maximum = 16,
 					.increment = 4
 				},
 				.aad_size = { 0 }
@@ -555,13 +555,13 @@ static const struct rte_cryptodev_capabilities dpaa2_sec_capabilities[] = {
 				.algo = RTE_CRYPTO_CIPHER_NULL,
 				.block_size = 1,
 				.key_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				},
 				.iv_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				}
 			}, },
@@ -575,13 +575,13 @@ static const struct rte_cryptodev_capabilities dpaa2_sec_capabilities[] = {
 				.algo = RTE_CRYPTO_CIPHER_AES_CBC,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 32,
+					.minimum = 16,
+					.maximum = 32,
 					.increment = 8
 				},
 				.iv_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				}
 			}, }
@@ -595,13 +595,13 @@ static const struct rte_cryptodev_capabilities dpaa2_sec_capabilities[] = {
 				.algo = RTE_CRYPTO_CIPHER_AES_CTR,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 32,
+					.minimum = 16,
+					.maximum = 32,
 					.increment = 8
 				},
 				.iv_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				},
 			}, }
@@ -615,13 +615,13 @@ static const struct rte_cryptodev_capabilities dpaa2_sec_capabilities[] = {
 				.algo = RTE_CRYPTO_CIPHER_DES_CBC,
 				.block_size = 8,
 				.key_size = {
-					.min = 8,
-					.max = 8,
+					.minimum = 8,
+					.maximum = 8,
 					.increment = 0
 				},
 				.iv_size = {
-					.min = 8,
-					.max = 8,
+					.minimum = 8,
+					.maximum = 8,
 					.increment = 0
 				}
 			}, }
@@ -635,13 +635,13 @@ static const struct rte_cryptodev_capabilities dpaa2_sec_capabilities[] = {
 				.algo = RTE_CRYPTO_CIPHER_3DES_CBC,
 				.block_size = 8,
 				.key_size = {
-					.min = 16,
-					.max = 24,
+					.minimum = 16,
+					.maximum = 24,
 					.increment = 8
 				},
 				.iv_size = {
-					.min = 8,
-					.max = 8,
+					.minimum = 8,
+					.maximum = 8,
 					.increment = 0
 				}
 			}, }
@@ -655,18 +655,18 @@ static const struct rte_cryptodev_capabilities dpaa2_sec_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_SNOW3G_UIA2,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 4,
-					.max = 4,
+					.minimum = 4,
+					.maximum = 4,
 					.increment = 0
 				},
 				.iv_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				}
 			}, }
@@ -680,13 +680,13 @@ static const struct rte_cryptodev_capabilities dpaa2_sec_capabilities[] = {
 				.algo = RTE_CRYPTO_CIPHER_SNOW3G_UEA2,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				},
 				.iv_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				}
 			}, }
@@ -700,13 +700,13 @@ static const struct rte_cryptodev_capabilities dpaa2_sec_capabilities[] = {
 				.algo = RTE_CRYPTO_CIPHER_ZUC_EEA3,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				},
 				.iv_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				}
 			}, }
@@ -720,18 +720,18 @@ static const struct rte_cryptodev_capabilities dpaa2_sec_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_ZUC_EIA3,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 4,
-					.max = 4,
+					.minimum = 4,
+					.maximum = 4,
 					.increment = 0
 				},
 				.iv_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				}
 			}, }
@@ -751,18 +751,18 @@ static const struct rte_cryptodev_capabilities dpaa2_pdcp_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_SNOW3G_UIA2,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 4,
-					.max = 4,
+					.minimum = 4,
+					.maximum = 4,
 					.increment = 0
 				},
 				.iv_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				}
 			}, }
@@ -776,13 +776,13 @@ static const struct rte_cryptodev_capabilities dpaa2_pdcp_capabilities[] = {
 				.algo = RTE_CRYPTO_CIPHER_SNOW3G_UEA2,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				},
 				.iv_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				}
 			}, }
@@ -796,13 +796,13 @@ static const struct rte_cryptodev_capabilities dpaa2_pdcp_capabilities[] = {
 				.algo = RTE_CRYPTO_CIPHER_AES_CTR,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 32,
+					.minimum = 16,
+					.maximum = 32,
 					.increment = 8
 				},
 				.iv_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				}
 			}, }
@@ -816,13 +816,13 @@ static const struct rte_cryptodev_capabilities dpaa2_pdcp_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_NULL,
 				.block_size = 1,
 				.key_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				},
 				.iv_size = { 0 }
@@ -837,13 +837,13 @@ static const struct rte_cryptodev_capabilities dpaa2_pdcp_capabilities[] = {
 				.algo = RTE_CRYPTO_CIPHER_NULL,
 				.block_size = 1,
 				.key_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				},
 				.iv_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				}
 			}, },
@@ -857,13 +857,13 @@ static const struct rte_cryptodev_capabilities dpaa2_pdcp_capabilities[] = {
 				.algo = RTE_CRYPTO_CIPHER_ZUC_EEA3,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				},
 				.iv_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				}
 			}, }
@@ -877,18 +877,18 @@ static const struct rte_cryptodev_capabilities dpaa2_pdcp_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_ZUC_EIA3,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 4,
-					.max = 4,
+					.minimum = 4,
+					.maximum = 4,
 					.increment = 0
 				},
 				.iv_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				}
 			}, }
diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.h b/drivers/crypto/dpaa_sec/dpaa_sec.h
index 368699678b..ff15708e10 100644
--- a/drivers/crypto/dpaa_sec/dpaa_sec.h
+++ b/drivers/crypto/dpaa_sec/dpaa_sec.h
@@ -227,13 +227,13 @@ static const struct rte_cryptodev_capabilities dpaa_sec_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_NULL,
 				.block_size = 1,
 				.key_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				},
 				.iv_size = { 0 }
@@ -248,13 +248,13 @@ static const struct rte_cryptodev_capabilities dpaa_sec_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_MD5_HMAC,
 				.block_size = 64,
 				.key_size = {
-					.min = 1,
-					.max = 64,
+					.minimum = 1,
+					.maximum = 64,
 					.increment = 1
 				},
 				.digest_size = {
-					.min = 1,
-					.max = 16,
+					.minimum = 1,
+					.maximum = 16,
 					.increment = 1
 				},
 				.iv_size = { 0 }
@@ -269,13 +269,13 @@ static const struct rte_cryptodev_capabilities dpaa_sec_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA1_HMAC,
 				.block_size = 64,
 				.key_size = {
-					.min = 1,
-					.max = 64,
+					.minimum = 1,
+					.maximum = 64,
 					.increment = 1
 				},
 				.digest_size = {
-					.min = 1,
-					.max = 20,
+					.minimum = 1,
+					.maximum = 20,
 					.increment = 1
 				},
 				.iv_size = { 0 }
@@ -290,13 +290,13 @@ static const struct rte_cryptodev_capabilities dpaa_sec_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA224_HMAC,
 				.block_size = 64,
 				.key_size = {
-					.min = 1,
-					.max = 64,
+					.minimum = 1,
+					.maximum = 64,
 					.increment = 1
 				},
 				.digest_size = {
-					.min = 1,
-					.max = 28,
+					.minimum = 1,
+					.maximum = 28,
 					.increment = 1
 				},
 				.iv_size = { 0 }
@@ -311,13 +311,13 @@ static const struct rte_cryptodev_capabilities dpaa_sec_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA256_HMAC,
 				.block_size = 64,
 				.key_size = {
-					.min = 1,
-					.max = 64,
+					.minimum = 1,
+					.maximum = 64,
 					.increment = 1
 				},
 				.digest_size = {
-					.min = 1,
-					.max = 32,
+					.minimum = 1,
+					.maximum = 32,
 					.increment = 1
 				},
 				.iv_size = { 0 }
@@ -332,13 +332,13 @@ static const struct rte_cryptodev_capabilities dpaa_sec_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA384_HMAC,
 				.block_size = 128,
 				.key_size = {
-					.min = 1,
-					.max = 128,
+					.minimum = 1,
+					.maximum = 128,
 					.increment = 1
 				},
 				.digest_size = {
-					.min = 1,
-					.max = 48,
+					.minimum = 1,
+					.maximum = 48,
 					.increment = 1
 				},
 				.iv_size = { 0 }
@@ -353,13 +353,13 @@ static const struct rte_cryptodev_capabilities dpaa_sec_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA512_HMAC,
 				.block_size = 128,
 				.key_size = {
-					.min = 1,
-					.max = 128,
+					.minimum = 1,
+					.maximum = 128,
 					.increment = 1
 				},
 				.digest_size = {
-					.min = 1,
-					.max = 64,
+					.minimum = 1,
+					.maximum = 64,
 					.increment = 1
 				},
 				.iv_size = { 0 }
@@ -374,23 +374,23 @@ static const struct rte_cryptodev_capabilities dpaa_sec_capabilities[] = {
 				.algo = RTE_CRYPTO_AEAD_AES_GCM,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 32,
+					.minimum = 16,
+					.maximum = 32,
 					.increment = 8
 				},
 				.digest_size = {
-					.min = 8,
-					.max = 16,
+					.minimum = 8,
+					.maximum = 16,
 					.increment = 4
 				},
 				.aad_size = {
-					.min = 0,
-					.max = 240,
+					.minimum = 0,
+					.maximum = 240,
 					.increment = 1
 				},
 				.iv_size = {
-					.min = 12,
-					.max = 12,
+					.minimum = 12,
+					.maximum = 12,
 					.increment = 0
 				},
 			}, }
@@ -404,13 +404,13 @@ static const struct rte_cryptodev_capabilities dpaa_sec_capabilities[] = {
 				.algo = RTE_CRYPTO_CIPHER_NULL,
 				.block_size = 1,
 				.key_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				},
 				.iv_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				}
 			}, },
@@ -424,13 +424,13 @@ static const struct rte_cryptodev_capabilities dpaa_sec_capabilities[] = {
 				.algo = RTE_CRYPTO_CIPHER_AES_CBC,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 32,
+					.minimum = 16,
+					.maximum = 32,
 					.increment = 8
 				},
 				.iv_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				}
 			}, }
@@ -444,13 +444,13 @@ static const struct rte_cryptodev_capabilities dpaa_sec_capabilities[] = {
 				.algo = RTE_CRYPTO_CIPHER_AES_CTR,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 32,
+					.minimum = 16,
+					.maximum = 32,
 					.increment = 8
 				},
 				.iv_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				},
 			}, }
@@ -464,13 +464,13 @@ static const struct rte_cryptodev_capabilities dpaa_sec_capabilities[] = {
 				.algo = RTE_CRYPTO_CIPHER_3DES_CBC,
 				.block_size = 8,
 				.key_size = {
-					.min = 16,
-					.max = 24,
+					.minimum = 16,
+					.maximum = 24,
 					.increment = 8
 				},
 				.iv_size = {
-					.min = 8,
-					.max = 8,
+					.minimum = 8,
+					.maximum = 8,
 					.increment = 0
 				}
 			}, }
@@ -484,18 +484,18 @@ static const struct rte_cryptodev_capabilities dpaa_sec_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_SNOW3G_UIA2,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 4,
-					.max = 4,
+					.minimum = 4,
+					.maximum = 4,
 					.increment = 0
 				},
 				.iv_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				}
 			}, }
@@ -509,13 +509,13 @@ static const struct rte_cryptodev_capabilities dpaa_sec_capabilities[] = {
 				.algo = RTE_CRYPTO_CIPHER_SNOW3G_UEA2,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				},
 				.iv_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				}
 			}, }
@@ -529,13 +529,13 @@ static const struct rte_cryptodev_capabilities dpaa_sec_capabilities[] = {
 				.algo = RTE_CRYPTO_CIPHER_ZUC_EEA3,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				},
 				.iv_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				}
 			}, }
@@ -549,18 +549,18 @@ static const struct rte_cryptodev_capabilities dpaa_sec_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_ZUC_EIA3,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 4,
-					.max = 4,
+					.minimum = 4,
+					.maximum = 4,
 					.increment = 0
 				},
 				.iv_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				}
 			}, }
@@ -579,18 +579,18 @@ static const struct rte_cryptodev_capabilities dpaa_pdcp_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_SNOW3G_UIA2,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 4,
-					.max = 4,
+					.minimum = 4,
+					.maximum = 4,
 					.increment = 0
 				},
 				.iv_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				}
 			}, }
@@ -604,13 +604,13 @@ static const struct rte_cryptodev_capabilities dpaa_pdcp_capabilities[] = {
 				.algo = RTE_CRYPTO_CIPHER_SNOW3G_UEA2,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				},
 				.iv_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				}
 			}, }
@@ -624,13 +624,13 @@ static const struct rte_cryptodev_capabilities dpaa_pdcp_capabilities[] = {
 				.algo = RTE_CRYPTO_CIPHER_AES_CTR,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 32,
+					.minimum = 16,
+					.maximum = 32,
 					.increment = 8
 				},
 				.iv_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				}
 			}, }
@@ -644,13 +644,13 @@ static const struct rte_cryptodev_capabilities dpaa_pdcp_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_NULL,
 				.block_size = 1,
 				.key_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				},
 				.iv_size = { 0 }
@@ -665,13 +665,13 @@ static const struct rte_cryptodev_capabilities dpaa_pdcp_capabilities[] = {
 				.algo = RTE_CRYPTO_CIPHER_NULL,
 				.block_size = 1,
 				.key_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				},
 				.iv_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				}
 			}, },
@@ -685,13 +685,13 @@ static const struct rte_cryptodev_capabilities dpaa_pdcp_capabilities[] = {
 				.algo = RTE_CRYPTO_CIPHER_ZUC_EEA3,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				},
 				.iv_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				}
 			}, }
@@ -705,18 +705,18 @@ static const struct rte_cryptodev_capabilities dpaa_pdcp_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_ZUC_EIA3,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 4,
-					.max = 4,
+					.minimum = 4,
+					.maximum = 4,
 					.increment = 0
 				},
 				.iv_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				}
 			}, }
diff --git a/drivers/crypto/kasumi/rte_kasumi_pmd_ops.c b/drivers/crypto/kasumi/rte_kasumi_pmd_ops.c
index 43376c1aa0..51d1f97407 100644
--- a/drivers/crypto/kasumi/rte_kasumi_pmd_ops.c
+++ b/drivers/crypto/kasumi/rte_kasumi_pmd_ops.c
@@ -19,13 +19,13 @@ static const struct rte_cryptodev_capabilities kasumi_pmd_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_KASUMI_F9,
 				.block_size = 8,
 				.key_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 4,
-					.max = 4,
+					.minimum = 4,
+					.maximum = 4,
 					.increment = 0
 				},
 				.iv_size = { 0 }
@@ -40,13 +40,13 @@ static const struct rte_cryptodev_capabilities kasumi_pmd_capabilities[] = {
 				.algo = RTE_CRYPTO_CIPHER_KASUMI_F8,
 				.block_size = 8,
 				.key_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				},
 				.iv_size = {
-					.min = 8,
-					.max = 8,
+					.minimum = 8,
+					.maximum = 8,
 					.increment = 0
 				}
 			}, }
diff --git a/drivers/crypto/mlx5/mlx5_crypto.c b/drivers/crypto/mlx5/mlx5_crypto.c
index e01be15ade..d5b83e8fdd 100644
--- a/drivers/crypto/mlx5/mlx5_crypto.c
+++ b/drivers/crypto/mlx5/mlx5_crypto.c
@@ -48,13 +48,13 @@ const struct rte_cryptodev_capabilities mlx5_crypto_caps[] = {
 				.algo = RTE_CRYPTO_CIPHER_AES_XTS,
 				.block_size = 16,
 				.key_size = {
-					.min = 32,
-					.max = 64,
+					.minimum = 32,
+					.maximum = 64,
 					.increment = 32
 				},
 				.iv_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				},
 				.dataunit_set =
diff --git a/drivers/crypto/mvsam/rte_mrvl_pmd_ops.c b/drivers/crypto/mvsam/rte_mrvl_pmd_ops.c
index fa36461276..3c22c48c24 100644
--- a/drivers/crypto/mvsam/rte_mrvl_pmd_ops.c
+++ b/drivers/crypto/mvsam/rte_mrvl_pmd_ops.c
@@ -26,13 +26,13 @@ static const struct rte_cryptodev_capabilities
 				.algo = RTE_CRYPTO_AUTH_MD5_HMAC,
 				.block_size = 64,
 				.key_size = {
-					.min = 1,
-					.max = 64,
+					.minimum = 1,
+					.maximum = 64,
 					.increment = 1
 				},
 				.digest_size = {
-					.min = 12,
-					.max = 16,
+					.minimum = 12,
+					.maximum = 16,
 					.increment = 4
 				},
 			}, }
@@ -46,13 +46,13 @@ static const struct rte_cryptodev_capabilities
 					.algo = RTE_CRYPTO_AUTH_MD5,
 					.block_size = 64,
 					.key_size = {
-						.min = 0,
-						.max = 0,
+						.minimum = 0,
+						.maximum = 0,
 						.increment = 0
 					},
 					.digest_size = {
-						.min = 12,
-						.max = 16,
+						.minimum = 12,
+						.maximum = 16,
 						.increment = 4
 					},
 				}, }
@@ -66,13 +66,13 @@ static const struct rte_cryptodev_capabilities
 					.algo = RTE_CRYPTO_AUTH_SHA1_HMAC,
 					.block_size = 64,
 					.key_size = {
-						.min = 1,
-						.max = 64,
+						.minimum = 1,
+						.maximum = 64,
 						.increment = 1
 					},
 					.digest_size = {
-						.min = 12,
-						.max = 20,
+						.minimum = 12,
+						.maximum = 20,
 						.increment = 4
 					},
 				}, }
@@ -86,13 +86,13 @@ static const struct rte_cryptodev_capabilities
 				.algo = RTE_CRYPTO_AUTH_SHA1,
 				.block_size = 64,
 				.key_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 12,
-					.max = 20,
+					.minimum = 12,
+					.maximum = 20,
 					.increment = 4
 				},
 			}, }
@@ -107,13 +107,13 @@ static const struct rte_cryptodev_capabilities
 				.algo = RTE_CRYPTO_AUTH_SHA224_HMAC,
 				.block_size = 64,
 				.key_size = {
-					.min = 1,
-					.max = 64,
+					.minimum = 1,
+					.maximum = 64,
 					.increment = 1
 				},
 				.digest_size = {
-					.min = 12,
-					.max = 28,
+					.minimum = 12,
+					.maximum = 28,
 					.increment = 0
 				},
 			}, }
@@ -127,13 +127,13 @@ static const struct rte_cryptodev_capabilities
 				.algo = RTE_CRYPTO_AUTH_SHA224,
 				.block_size = 64,
 				.key_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 12,
-					.max = 28,
+					.minimum = 12,
+					.maximum = 28,
 					.increment = 4
 				},
 			}, }
@@ -147,13 +147,13 @@ static const struct rte_cryptodev_capabilities
 					.algo = RTE_CRYPTO_AUTH_SHA256_HMAC,
 					.block_size = 64,
 					.key_size = {
-						.min = 1,
-						.max = 64,
+						.minimum = 1,
+						.maximum = 64,
 						.increment = 1
 					},
 					.digest_size = {
-						.min = 12,
-						.max = 32,
+						.minimum = 12,
+						.maximum = 32,
 						.increment = 4
 					},
 				}, }
@@ -167,13 +167,13 @@ static const struct rte_cryptodev_capabilities
 					.algo = RTE_CRYPTO_AUTH_SHA256,
 					.block_size = 64,
 					.key_size = {
-						.min = 0,
-						.max = 0,
+						.minimum = 0,
+						.maximum = 0,
 						.increment = 0
 					},
 					.digest_size = {
-						.min = 12,
-						.max = 32,
+						.minimum = 12,
+						.maximum = 32,
 						.increment = 4
 					},
 				}, }
@@ -187,13 +187,13 @@ static const struct rte_cryptodev_capabilities
 				.algo = RTE_CRYPTO_AUTH_SHA384_HMAC,
 				.block_size = 128,
 				.key_size = {
-					.min = 1,
-					.max = 128,
+					.minimum = 1,
+					.maximum = 128,
 					.increment = 1
 				},
 				.digest_size = {
-					.min = 12,
-					.max = 48,
+					.minimum = 12,
+					.maximum = 48,
 					.increment = 4
 				},
 			}, }
@@ -207,13 +207,13 @@ static const struct rte_cryptodev_capabilities
 				.algo = RTE_CRYPTO_AUTH_SHA384,
 				.block_size = 128,
 				.key_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 12,
-					.max = 48,
+					.minimum = 12,
+					.maximum = 48,
 					.increment = 4
 				},
 			}, }
@@ -227,13 +227,13 @@ static const struct rte_cryptodev_capabilities
 				.algo = RTE_CRYPTO_AUTH_SHA512_HMAC,
 				.block_size = 128,
 				.key_size = {
-					.min = 1,
-					.max = 128,
+					.minimum = 1,
+					.maximum = 128,
 					.increment = 1
 				},
 				.digest_size = {
-					.min = 12,
-					.max = 64,
+					.minimum = 12,
+					.maximum = 64,
 					.increment = 4
 				},
 			}, }
@@ -247,13 +247,13 @@ static const struct rte_cryptodev_capabilities
 				.algo = RTE_CRYPTO_AUTH_SHA512,
 				.block_size = 128,
 				.key_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 12,
-					.max = 64,
+					.minimum = 12,
+					.maximum = 64,
 					.increment = 0
 				},
 			}, }
@@ -267,13 +267,13 @@ static const struct rte_cryptodev_capabilities
 					.algo = RTE_CRYPTO_CIPHER_AES_CBC,
 					.block_size = 16,
 					.key_size = {
-						.min = 16,
-						.max = 32,
+						.minimum = 16,
+						.maximum = 32,
 						.increment = 8
 					},
 					.iv_size = {
-						.min = 16,
-						.max = 16,
+						.minimum = 16,
+						.maximum = 16,
 						.increment = 0
 					}
 				}, }
@@ -287,13 +287,13 @@ static const struct rte_cryptodev_capabilities
 				.algo = RTE_CRYPTO_CIPHER_AES_CTR,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 32,
+					.minimum = 16,
+					.maximum = 32,
 					.increment = 8
 				},
 				.iv_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				}
 			}, }
@@ -307,13 +307,13 @@ static const struct rte_cryptodev_capabilities
 				.algo = RTE_CRYPTO_CIPHER_AES_ECB,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 32,
+					.minimum = 16,
+					.maximum = 32,
 					.increment = 8
 				},
 				.iv_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				}
 			}, }
@@ -327,23 +327,23 @@ static const struct rte_cryptodev_capabilities
 				.algo = RTE_CRYPTO_AEAD_AES_GCM,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 32,
+					.minimum = 16,
+					.maximum = 32,
 					.increment = 8
 				},
 				.digest_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				},
 				.aad_size = {
-					.min = 0,
-					.max = 64,
+					.minimum = 0,
+					.maximum = 64,
 					.increment = 1
 				},
 				.iv_size = {
-					.min = 12,
-					.max = 16,
+					.minimum = 12,
+					.maximum = 16,
 					.increment = 4
 				}
 			}, }
@@ -357,18 +357,18 @@ static const struct rte_cryptodev_capabilities
 				.algo = RTE_CRYPTO_AUTH_AES_GMAC,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 32,
+					.minimum = 16,
+					.maximum = 32,
 					.increment = 8
 				},
 				.digest_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				},
 				.iv_size = {
-					.min = 8,
-					.max = 65532,
+					.minimum = 8,
+					.maximum = 65532,
 					.increment = 4
 				}
 			}, }
@@ -382,13 +382,13 @@ static const struct rte_cryptodev_capabilities
 				.algo = RTE_CRYPTO_CIPHER_3DES_CBC,
 				.block_size = 8,
 				.key_size = {
-					.min = 24,
-					.max = 24,
+					.minimum = 24,
+					.maximum = 24,
 					.increment = 0
 				},
 				.iv_size = {
-					.min = 8,
-					.max = 8,
+					.minimum = 8,
+					.maximum = 8,
 					.increment = 0
 				}
 			}, }
@@ -402,13 +402,13 @@ static const struct rte_cryptodev_capabilities
 				.algo = RTE_CRYPTO_CIPHER_3DES_CTR,
 				.block_size = 8,
 				.key_size = {
-					.min = 24,
-					.max = 24,
+					.minimum = 24,
+					.maximum = 24,
 					.increment = 0
 				},
 				.iv_size = {
-					.min = 8,
-					.max = 8,
+					.minimum = 8,
+					.maximum = 8,
 					.increment = 0
 				}
 			}, }
@@ -422,13 +422,13 @@ static const struct rte_cryptodev_capabilities
 				.algo = RTE_CRYPTO_CIPHER_3DES_ECB,
 				.block_size = 8,
 				.key_size = {
-					.min = 24,
-					.max = 24,
+					.minimum = 24,
+					.maximum = 24,
 					.increment = 0
 				},
 				.iv_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				}
 			}, }
@@ -442,18 +442,18 @@ static const struct rte_cryptodev_capabilities
 				.algo = RTE_CRYPTO_AUTH_NULL,
 				.block_size = 1,
 				.key_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				},
 				.iv_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				}
 			}, },
@@ -467,13 +467,13 @@ static const struct rte_cryptodev_capabilities
 				.algo = RTE_CRYPTO_CIPHER_NULL,
 				.block_size = 1,
 				.key_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				},
 				.iv_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				}
 			}, },
diff --git a/drivers/crypto/nitrox/nitrox_sym_capabilities.c b/drivers/crypto/nitrox/nitrox_sym_capabilities.c
index a30cd9f8fa..510e5c74eb 100644
--- a/drivers/crypto/nitrox/nitrox_sym_capabilities.c
+++ b/drivers/crypto/nitrox/nitrox_sym_capabilities.c
@@ -13,13 +13,13 @@ static const struct rte_cryptodev_capabilities nitrox_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA1_HMAC,
 				.block_size = 64,
 				.key_size = {
-					.min = 1,
-					.max = 64,
+					.minimum = 1,
+					.maximum = 64,
 					.increment = 1
 				},
 				.digest_size = {
-					.min = 1,
-					.max = 20,
+					.minimum = 1,
+					.maximum = 20,
 					.increment = 1
 				},
 				.iv_size = { 0 }
@@ -34,13 +34,13 @@ static const struct rte_cryptodev_capabilities nitrox_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA224_HMAC,
 				.block_size = 64,
 				.key_size = {
-					.min = 1,
-					.max = 64,
+					.minimum = 1,
+					.maximum = 64,
 					.increment = 1
 				},
 				.digest_size = {
-					.min = 1,
-					.max = 28,
+					.minimum = 1,
+					.maximum = 28,
 					.increment = 1
 				},
 				.iv_size = { 0 }
@@ -55,13 +55,13 @@ static const struct rte_cryptodev_capabilities nitrox_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA256_HMAC,
 				.block_size = 64,
 				.key_size = {
-					.min = 1,
-					.max = 64,
+					.minimum = 1,
+					.maximum = 64,
 					.increment = 1
 				},
 				.digest_size = {
-					.min = 1,
-					.max = 32,
+					.minimum = 1,
+					.maximum = 32,
 					.increment = 1
 				},
 				.iv_size = { 0 }
@@ -76,13 +76,13 @@ static const struct rte_cryptodev_capabilities nitrox_capabilities[] = {
 				.algo = RTE_CRYPTO_CIPHER_AES_CBC,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 32,
+					.minimum = 16,
+					.maximum = 32,
 					.increment = 8
 				},
 				.iv_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				}
 			}, }
@@ -96,13 +96,13 @@ static const struct rte_cryptodev_capabilities nitrox_capabilities[] = {
 				.algo = RTE_CRYPTO_CIPHER_3DES_CBC,
 				.block_size = 8,
 				.key_size = {
-					.min = 24,
-					.max = 24,
+					.minimum = 24,
+					.maximum = 24,
 					.increment = 0
 				},
 				.iv_size = {
-					.min = 8,
-					.max = 8,
+					.minimum = 8,
+					.maximum = 8,
 					.increment = 0
 				}
 			}, }
@@ -116,23 +116,23 @@ static const struct rte_cryptodev_capabilities nitrox_capabilities[] = {
 				.algo = RTE_CRYPTO_AEAD_AES_GCM,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 32,
+					.minimum = 16,
+					.maximum = 32,
 					.increment = 8
 				},
 				.digest_size = {
-					.min = 1,
-					.max = 16,
+					.minimum = 1,
+					.maximum = 16,
 					.increment = 1
 				},
 				.aad_size = {
-					.min = 0,
-					.max = 512,
+					.minimum = 0,
+					.maximum = 512,
 					.increment = 1
 				},
 				.iv_size = {
-					.min = 12,
-					.max = 16,
+					.minimum = 12,
+					.maximum = 16,
 					.increment = 4
 				},
 			}, }
diff --git a/drivers/crypto/null/null_crypto_pmd_ops.c b/drivers/crypto/null/null_crypto_pmd_ops.c
index d67892a1bb..55526f2e6d 100644
--- a/drivers/crypto/null/null_crypto_pmd_ops.c
+++ b/drivers/crypto/null/null_crypto_pmd_ops.c
@@ -19,13 +19,13 @@ static const struct rte_cryptodev_capabilities null_crypto_pmd_capabilities[] =
 				.algo = RTE_CRYPTO_AUTH_NULL,
 				.block_size = 1,
 				.key_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				},
 				.iv_size = { 0 }
@@ -40,8 +40,8 @@ static const struct rte_cryptodev_capabilities null_crypto_pmd_capabilities[] =
 				.algo = RTE_CRYPTO_CIPHER_NULL,
 				.block_size = 1,
 				.key_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				},
 				.iv_size = { 0 }
diff --git a/drivers/crypto/octeontx/otx_cryptodev_capabilities.c b/drivers/crypto/octeontx/otx_cryptodev_capabilities.c
index 3f734b232c..88f02b07ad 100644
--- a/drivers/crypto/octeontx/otx_cryptodev_capabilities.c
+++ b/drivers/crypto/octeontx/otx_cryptodev_capabilities.c
@@ -16,13 +16,13 @@ static const struct rte_cryptodev_capabilities otx_sym_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_NULL,
 				.block_size = 1,
 				.key_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				},
 			}, },
@@ -36,18 +36,18 @@ static const struct rte_cryptodev_capabilities otx_sym_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_AES_GMAC,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 32,
+					.minimum = 16,
+					.maximum = 32,
 					.increment = 8
 				},
 				.digest_size = {
-					.min = 8,
-					.max = 16,
+					.minimum = 8,
+					.maximum = 16,
 					.increment = 4
 				},
 				.iv_size = {
-					.min = 12,
-					.max = 12,
+					.minimum = 12,
+					.maximum = 12,
 					.increment = 0
 				}
 			}, }
@@ -61,13 +61,13 @@ static const struct rte_cryptodev_capabilities otx_sym_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_KASUMI_F9,
 				.block_size = 8,
 				.key_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 4,
-					.max = 4,
+					.minimum = 4,
+					.maximum = 4,
 					.increment = 0
 				},
 			}, }
@@ -81,13 +81,13 @@ static const struct rte_cryptodev_capabilities otx_sym_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_MD5,
 				.block_size = 64,
 				.key_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				},
 			}, }
@@ -101,13 +101,13 @@ static const struct rte_cryptodev_capabilities otx_sym_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_MD5_HMAC,
 				.block_size = 64,
 				.key_size = {
-					.min = 8,
-					.max = 64,
+					.minimum = 8,
+					.maximum = 64,
 					.increment = 8
 				},
 				.digest_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				},
 			}, }
@@ -121,13 +121,13 @@ static const struct rte_cryptodev_capabilities otx_sym_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA1,
 				.block_size = 64,
 				.key_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 20,
-					.max = 20,
+					.minimum = 20,
+					.maximum = 20,
 					.increment = 0
 				},
 			}, }
@@ -141,13 +141,13 @@ static const struct rte_cryptodev_capabilities otx_sym_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA1_HMAC,
 				.block_size = 64,
 				.key_size = {
-					.min = 1,
-					.max = 1024,
+					.minimum = 1,
+					.maximum = 1024,
 					.increment = 1
 				},
 				.digest_size = {
-					.min = 20,
-					.max = 20,
+					.minimum = 20,
+					.maximum = 20,
 					.increment = 0
 				},
 			}, }
@@ -161,13 +161,13 @@ static const struct rte_cryptodev_capabilities otx_sym_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA224,
 				.block_size = 64,
 					.key_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 28,
-					.max = 28,
+					.minimum = 28,
+					.maximum = 28,
 					.increment = 0
 				},
 			}, }
@@ -181,13 +181,13 @@ static const struct rte_cryptodev_capabilities otx_sym_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA224_HMAC,
 				.block_size = 64,
 					.key_size = {
-					.min = 1,
-					.max = 1024,
+					.minimum = 1,
+					.maximum = 1024,
 					.increment = 1
 				},
 				.digest_size = {
-					.min = 28,
-					.max = 28,
+					.minimum = 28,
+					.maximum = 28,
 					.increment = 0
 				},
 			}, }
@@ -201,13 +201,13 @@ static const struct rte_cryptodev_capabilities otx_sym_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA256,
 				.block_size = 64,
 				.key_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 32,
-					.max = 32,
+					.minimum = 32,
+					.maximum = 32,
 					.increment = 0
 				},
 			}, }
@@ -221,13 +221,13 @@ static const struct rte_cryptodev_capabilities otx_sym_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA256_HMAC,
 				.block_size = 64,
 				.key_size = {
-					.min = 1,
-					.max = 1024,
+					.minimum = 1,
+					.maximum = 1024,
 					.increment = 1
 				},
 				.digest_size = {
-					.min = 32,
-					.max = 32,
+					.minimum = 32,
+					.maximum = 32,
 					.increment = 0
 				},
 			}, }
@@ -241,13 +241,13 @@ static const struct rte_cryptodev_capabilities otx_sym_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA384,
 				.block_size = 64,
 				.key_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 48,
-					.max = 48,
+					.minimum = 48,
+					.maximum = 48,
 					.increment = 0
 					},
 			}, }
@@ -261,13 +261,13 @@ static const struct rte_cryptodev_capabilities otx_sym_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA384_HMAC,
 				.block_size = 64,
 				.key_size = {
-					.min = 1,
-					.max = 1024,
+					.minimum = 1,
+					.maximum = 1024,
 					.increment = 1
 				},
 				.digest_size = {
-					.min = 48,
-					.max = 48,
+					.minimum = 48,
+					.maximum = 48,
 					.increment = 0
 					},
 			}, }
@@ -281,13 +281,13 @@ static const struct rte_cryptodev_capabilities otx_sym_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA512,
 				.block_size = 128,
 				.key_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 64,
-					.max = 64,
+					.minimum = 64,
+					.maximum = 64,
 					.increment = 0
 				},
 			}, }
@@ -301,13 +301,13 @@ static const struct rte_cryptodev_capabilities otx_sym_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA512_HMAC,
 				.block_size = 128,
 				.key_size = {
-					.min = 1,
-					.max = 1024,
+					.minimum = 1,
+					.maximum = 1024,
 					.increment = 1
 				},
 				.digest_size = {
-					.min = 64,
-					.max = 64,
+					.minimum = 64,
+					.maximum = 64,
 					.increment = 0
 				},
 			}, }
@@ -321,18 +321,18 @@ static const struct rte_cryptodev_capabilities otx_sym_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_SNOW3G_UIA2,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 4,
-					.max = 4,
+					.minimum = 4,
+					.maximum = 4,
 					.increment = 0
 				},
 				.iv_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				}
 			}, }
@@ -346,18 +346,18 @@ static const struct rte_cryptodev_capabilities otx_sym_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_ZUC_EIA3,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 4,
-					.max = 4,
+					.minimum = 4,
+					.maximum = 4,
 					.increment = 0
 				},
 				.iv_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				}
 			}, }
@@ -371,13 +371,13 @@ static const struct rte_cryptodev_capabilities otx_sym_capabilities[] = {
 				.algo = RTE_CRYPTO_CIPHER_NULL,
 				.block_size = 1,
 				.key_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				},
 				.iv_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				}
 			}, },
@@ -391,13 +391,13 @@ static const struct rte_cryptodev_capabilities otx_sym_capabilities[] = {
 				.algo = RTE_CRYPTO_CIPHER_3DES_CBC,
 				.block_size = 8,
 				.key_size = {
-					.min = 24,
-					.max = 24,
+					.minimum = 24,
+					.maximum = 24,
 					.increment = 0
 				},
 				.iv_size = {
-					.min = 8,
-					.max = 16,
+					.minimum = 8,
+					.maximum = 16,
 					.increment = 8
 				}
 			}, }
@@ -411,13 +411,13 @@ static const struct rte_cryptodev_capabilities otx_sym_capabilities[] = {
 				.algo = RTE_CRYPTO_CIPHER_3DES_ECB,
 				.block_size = 8,
 				.key_size = {
-					.min = 24,
-					.max = 24,
+					.minimum = 24,
+					.maximum = 24,
 					.increment = 0
 				},
 				.iv_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				}
 			}, }
@@ -431,13 +431,13 @@ static const struct rte_cryptodev_capabilities otx_sym_capabilities[] = {
 				.algo = RTE_CRYPTO_CIPHER_AES_CBC,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 32,
+					.minimum = 16,
+					.maximum = 32,
 					.increment = 8
 				},
 				.iv_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				}
 			}, }
@@ -451,13 +451,13 @@ static const struct rte_cryptodev_capabilities otx_sym_capabilities[] = {
 				.algo = RTE_CRYPTO_CIPHER_AES_CTR,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 32,
+					.minimum = 16,
+					.maximum = 32,
 					.increment = 8
 				},
 				.iv_size = {
-					.min = 12,
-					.max = 16,
+					.minimum = 12,
+					.maximum = 16,
 					.increment = 4
 				}
 			}, }
@@ -471,13 +471,13 @@ static const struct rte_cryptodev_capabilities otx_sym_capabilities[] = {
 				.algo = RTE_CRYPTO_CIPHER_AES_XTS,
 				.block_size = 16,
 				.key_size = {
-					.min = 32,
-					.max = 64,
+					.minimum = 32,
+					.maximum = 64,
 					.increment = 0
 				},
 				.iv_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				}
 			}, }
@@ -491,13 +491,13 @@ static const struct rte_cryptodev_capabilities otx_sym_capabilities[] = {
 				.algo = RTE_CRYPTO_CIPHER_DES_CBC,
 				.block_size = 8,
 				.key_size = {
-					.min = 8,
-					.max = 8,
+					.minimum = 8,
+					.maximum = 8,
 					.increment = 0
 				},
 				.iv_size = {
-					.min = 8,
-					.max = 8,
+					.minimum = 8,
+					.maximum = 8,
 					.increment = 0
 				}
 			}, }
@@ -511,13 +511,13 @@ static const struct rte_cryptodev_capabilities otx_sym_capabilities[] = {
 				.algo = RTE_CRYPTO_CIPHER_KASUMI_F8,
 				.block_size = 8,
 				.key_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				},
 				.iv_size = {
-					.min = 8,
-					.max = 8,
+					.minimum = 8,
+					.maximum = 8,
 					.increment = 0
 				}
 			}, }
@@ -531,13 +531,13 @@ static const struct rte_cryptodev_capabilities otx_sym_capabilities[] = {
 				.algo = RTE_CRYPTO_CIPHER_SNOW3G_UEA2,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				},
 				.iv_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				}
 			}, }
@@ -551,13 +551,13 @@ static const struct rte_cryptodev_capabilities otx_sym_capabilities[] = {
 				.algo = RTE_CRYPTO_CIPHER_ZUC_EEA3,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				},
 				.iv_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				}
 			}, }
@@ -571,23 +571,23 @@ static const struct rte_cryptodev_capabilities otx_sym_capabilities[] = {
 				.algo = RTE_CRYPTO_AEAD_AES_GCM,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 32,
+					.minimum = 16,
+					.maximum = 32,
 					.increment = 8
 				},
 				.digest_size = {
-					.min = 8,
-					.max = 16,
+					.minimum = 8,
+					.maximum = 16,
 					.increment = 4
 				},
 				.aad_size = {
-					.min = 0,
-					.max = 1024,
+					.minimum = 0,
+					.maximum = 1024,
 					.increment = 1
 				},
 				.iv_size = {
-					.min = 12,
-					.max = 12,
+					.minimum = 12,
+					.maximum = 12,
 					.increment = 0
 				}
 			}, }
@@ -609,8 +609,8 @@ static const struct rte_cryptodev_capabilities otx_asym_capabilities[] = {
 					(1 << RTE_CRYPTO_ASYM_OP_ENCRYPT) |
 					(1 << RTE_CRYPTO_ASYM_OP_DECRYPT)),
 				{.modlen = {
-					.min = 17,
-					.max = 1024,
+					.minimum = 17,
+					.maximum = 1024,
 					.increment = 1
 				}, }
 			}
@@ -623,8 +623,8 @@ static const struct rte_cryptodev_capabilities otx_asym_capabilities[] = {
 				.xform_type = RTE_CRYPTO_ASYM_XFORM_MODEX,
 				.op_types = 0,
 				{.modlen = {
-					.min = 17,
-					.max = 1024,
+					.minimum = 17,
+					.maximum = 1024,
 					.increment = 1
 				}, }
 			}
diff --git a/drivers/crypto/octeontx2/otx2_cryptodev_capabilities.c b/drivers/crypto/octeontx2/otx2_cryptodev_capabilities.c
index 80f3729995..b4a03f3913 100644
--- a/drivers/crypto/octeontx2/otx2_cryptodev_capabilities.c
+++ b/drivers/crypto/octeontx2/otx2_cryptodev_capabilities.c
@@ -52,8 +52,8 @@ static const struct rte_cryptodev_capabilities caps_mul[] = {
 					(1 << RTE_CRYPTO_ASYM_OP_ENCRYPT) |
 					(1 << RTE_CRYPTO_ASYM_OP_DECRYPT)),
 				{.modlen = {
-					.min = 17,
-					.max = 1024,
+					.minimum = 17,
+					.maximum = 1024,
 					.increment = 1
 				}, }
 			}
@@ -66,8 +66,8 @@ static const struct rte_cryptodev_capabilities caps_mul[] = {
 				.xform_type = RTE_CRYPTO_ASYM_XFORM_MODEX,
 				.op_types = 0,
 				{.modlen = {
-					.min = 17,
-					.max = 1024,
+					.minimum = 17,
+					.maximum = 1024,
 					.increment = 1
 				}, }
 			}
@@ -105,13 +105,13 @@ static const struct rte_cryptodev_capabilities caps_sha1_sha2[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA1,
 				.block_size = 64,
 				.key_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 20,
-					.max = 20,
+					.minimum = 20,
+					.maximum = 20,
 					.increment = 0
 				},
 			}, }
@@ -125,13 +125,13 @@ static const struct rte_cryptodev_capabilities caps_sha1_sha2[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA1_HMAC,
 				.block_size = 64,
 				.key_size = {
-					.min = 1,
-					.max = 1024,
+					.minimum = 1,
+					.maximum = 1024,
 					.increment = 1
 				},
 				.digest_size = {
-					.min = 12,
-					.max = 20,
+					.minimum = 12,
+					.maximum = 20,
 					.increment = 8
 				},
 			}, }
@@ -145,13 +145,13 @@ static const struct rte_cryptodev_capabilities caps_sha1_sha2[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA224,
 				.block_size = 64,
 					.key_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 28,
-					.max = 28,
+					.minimum = 28,
+					.maximum = 28,
 					.increment = 0
 				},
 			}, }
@@ -165,13 +165,13 @@ static const struct rte_cryptodev_capabilities caps_sha1_sha2[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA224_HMAC,
 				.block_size = 64,
 					.key_size = {
-					.min = 1,
-					.max = 1024,
+					.minimum = 1,
+					.maximum = 1024,
 					.increment = 1
 				},
 				.digest_size = {
-					.min = 28,
-					.max = 28,
+					.minimum = 28,
+					.maximum = 28,
 					.increment = 0
 				},
 			}, }
@@ -185,13 +185,13 @@ static const struct rte_cryptodev_capabilities caps_sha1_sha2[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA256,
 				.block_size = 64,
 				.key_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 32,
-					.max = 32,
+					.minimum = 32,
+					.maximum = 32,
 					.increment = 0
 				},
 			}, }
@@ -205,13 +205,13 @@ static const struct rte_cryptodev_capabilities caps_sha1_sha2[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA256_HMAC,
 				.block_size = 64,
 				.key_size = {
-					.min = 1,
-					.max = 1024,
+					.minimum = 1,
+					.maximum = 1024,
 					.increment = 1
 				},
 				.digest_size = {
-					.min = 16,
-					.max = 32,
+					.minimum = 16,
+					.maximum = 32,
 					.increment = 16
 				},
 			}, }
@@ -225,13 +225,13 @@ static const struct rte_cryptodev_capabilities caps_sha1_sha2[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA384,
 				.block_size = 64,
 				.key_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 48,
-					.max = 48,
+					.minimum = 48,
+					.maximum = 48,
 					.increment = 0
 					},
 			}, }
@@ -245,13 +245,13 @@ static const struct rte_cryptodev_capabilities caps_sha1_sha2[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA384_HMAC,
 				.block_size = 64,
 				.key_size = {
-					.min = 1,
-					.max = 1024,
+					.minimum = 1,
+					.maximum = 1024,
 					.increment = 1
 				},
 				.digest_size = {
-					.min = 24,
-					.max = 48,
+					.minimum = 24,
+					.maximum = 48,
 					.increment = 24
 					},
 			}, }
@@ -265,13 +265,13 @@ static const struct rte_cryptodev_capabilities caps_sha1_sha2[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA512,
 				.block_size = 128,
 				.key_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 64,
-					.max = 64,
+					.minimum = 64,
+					.maximum = 64,
 					.increment = 0
 				},
 			}, }
@@ -285,13 +285,13 @@ static const struct rte_cryptodev_capabilities caps_sha1_sha2[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA512_HMAC,
 				.block_size = 128,
 				.key_size = {
-					.min = 1,
-					.max = 1024,
+					.minimum = 1,
+					.maximum = 1024,
 					.increment = 1
 				},
 				.digest_size = {
-					.min = 32,
-					.max = 64,
+					.minimum = 32,
+					.maximum = 64,
 					.increment = 32
 				},
 			}, }
@@ -305,13 +305,13 @@ static const struct rte_cryptodev_capabilities caps_sha1_sha2[] = {
 				.algo = RTE_CRYPTO_AUTH_MD5,
 				.block_size = 64,
 				.key_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				},
 			}, }
@@ -325,13 +325,13 @@ static const struct rte_cryptodev_capabilities caps_sha1_sha2[] = {
 				.algo = RTE_CRYPTO_AUTH_MD5_HMAC,
 				.block_size = 64,
 				.key_size = {
-					.min = 8,
-					.max = 64,
+					.minimum = 8,
+					.maximum = 64,
 					.increment = 8
 				},
 				.digest_size = {
-					.min = 12,
-					.max = 16,
+					.minimum = 12,
+					.maximum = 16,
 					.increment = 4
 				},
 			}, }
@@ -348,23 +348,23 @@ static const struct rte_cryptodev_capabilities caps_chacha20[] = {
 				.algo = RTE_CRYPTO_AEAD_CHACHA20_POLY1305,
 				.block_size = 64,
 				.key_size = {
-					.min = 32,
-					.max = 32,
+					.minimum = 32,
+					.maximum = 32,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				},
 				.aad_size = {
-					.min = 0,
-					.max = 1024,
+					.minimum = 0,
+					.maximum = 1024,
 					.increment = 1
 				},
 				.iv_size = {
-					.min = 12,
-					.max = 12,
+					.minimum = 12,
+					.maximum = 12,
 					.increment = 0
 				},
 			}, }
@@ -381,13 +381,13 @@ static const struct rte_cryptodev_capabilities caps_zuc_snow3g[] = {
 				.algo = RTE_CRYPTO_CIPHER_SNOW3G_UEA2,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				},
 				.iv_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				}
 			}, }
@@ -401,13 +401,13 @@ static const struct rte_cryptodev_capabilities caps_zuc_snow3g[] = {
 				.algo = RTE_CRYPTO_CIPHER_ZUC_EEA3,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				},
 				.iv_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				}
 			}, }
@@ -421,18 +421,18 @@ static const struct rte_cryptodev_capabilities caps_zuc_snow3g[] = {
 				.algo = RTE_CRYPTO_AUTH_SNOW3G_UIA2,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 4,
-					.max = 4,
+					.minimum = 4,
+					.maximum = 4,
 					.increment = 0
 				},
 				.iv_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				}
 			}, }
@@ -446,18 +446,18 @@ static const struct rte_cryptodev_capabilities caps_zuc_snow3g[] = {
 				.algo = RTE_CRYPTO_AUTH_ZUC_EIA3,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 4,
-					.max = 4,
+					.minimum = 4,
+					.maximum = 4,
 					.increment = 0
 				},
 				.iv_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				}
 			}, }
@@ -474,18 +474,18 @@ static const struct rte_cryptodev_capabilities caps_aes[] = {
 				.algo = RTE_CRYPTO_AUTH_AES_GMAC,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 32,
+					.minimum = 16,
+					.maximum = 32,
 					.increment = 8
 				},
 				.digest_size = {
-					.min = 8,
-					.max = 16,
+					.minimum = 8,
+					.maximum = 16,
 					.increment = 4
 				},
 				.iv_size = {
-					.min = 12,
-					.max = 12,
+					.minimum = 12,
+					.maximum = 12,
 					.increment = 0
 				}
 			}, }
@@ -499,13 +499,13 @@ static const struct rte_cryptodev_capabilities caps_aes[] = {
 				.algo = RTE_CRYPTO_CIPHER_AES_CBC,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 32,
+					.minimum = 16,
+					.maximum = 32,
 					.increment = 8
 				},
 				.iv_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				}
 			}, }
@@ -519,13 +519,13 @@ static const struct rte_cryptodev_capabilities caps_aes[] = {
 				.algo = RTE_CRYPTO_CIPHER_AES_CTR,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 32,
+					.minimum = 16,
+					.maximum = 32,
 					.increment = 8
 				},
 				.iv_size = {
-					.min = 12,
-					.max = 16,
+					.minimum = 12,
+					.maximum = 16,
 					.increment = 4
 				}
 			}, }
@@ -539,13 +539,13 @@ static const struct rte_cryptodev_capabilities caps_aes[] = {
 				.algo = RTE_CRYPTO_CIPHER_AES_XTS,
 				.block_size = 16,
 				.key_size = {
-					.min = 32,
-					.max = 64,
+					.minimum = 32,
+					.maximum = 64,
 					.increment = 0
 				},
 				.iv_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				}
 			}, }
@@ -559,23 +559,23 @@ static const struct rte_cryptodev_capabilities caps_aes[] = {
 				.algo = RTE_CRYPTO_AEAD_AES_GCM,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 32,
+					.minimum = 16,
+					.maximum = 32,
 					.increment = 8
 				},
 				.digest_size = {
-					.min = 4,
-					.max = 16,
+					.minimum = 4,
+					.maximum = 16,
 					.increment = 1
 				},
 				.aad_size = {
-					.min = 0,
-					.max = 1024,
+					.minimum = 0,
+					.maximum = 1024,
 					.increment = 1
 				},
 				.iv_size = {
-					.min = 12,
-					.max = 12,
+					.minimum = 12,
+					.maximum = 12,
 					.increment = 0
 				}
 			}, }
@@ -592,13 +592,13 @@ static const struct rte_cryptodev_capabilities caps_kasumi[] = {
 				.algo = RTE_CRYPTO_CIPHER_KASUMI_F8,
 				.block_size = 8,
 				.key_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				},
 				.iv_size = {
-					.min = 8,
-					.max = 8,
+					.minimum = 8,
+					.maximum = 8,
 					.increment = 0
 				}
 			}, }
@@ -612,13 +612,13 @@ static const struct rte_cryptodev_capabilities caps_kasumi[] = {
 				.algo = RTE_CRYPTO_AUTH_KASUMI_F9,
 				.block_size = 8,
 				.key_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 4,
-					.max = 4,
+					.minimum = 4,
+					.maximum = 4,
 					.increment = 0
 				},
 			}, }
@@ -635,13 +635,13 @@ static const struct rte_cryptodev_capabilities caps_des[] = {
 				.algo = RTE_CRYPTO_CIPHER_3DES_CBC,
 				.block_size = 8,
 				.key_size = {
-					.min = 24,
-					.max = 24,
+					.minimum = 24,
+					.maximum = 24,
 					.increment = 0
 				},
 				.iv_size = {
-					.min = 8,
-					.max = 16,
+					.minimum = 8,
+					.maximum = 16,
 					.increment = 8
 				}
 			}, }
@@ -655,13 +655,13 @@ static const struct rte_cryptodev_capabilities caps_des[] = {
 				.algo = RTE_CRYPTO_CIPHER_3DES_ECB,
 				.block_size = 8,
 				.key_size = {
-					.min = 24,
-					.max = 24,
+					.minimum = 24,
+					.maximum = 24,
 					.increment = 0
 				},
 				.iv_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				}
 			}, }
@@ -675,13 +675,13 @@ static const struct rte_cryptodev_capabilities caps_des[] = {
 				.algo = RTE_CRYPTO_CIPHER_DES_CBC,
 				.block_size = 8,
 				.key_size = {
-					.min = 8,
-					.max = 8,
+					.minimum = 8,
+					.maximum = 8,
 					.increment = 0
 				},
 				.iv_size = {
-					.min = 8,
-					.max = 8,
+					.minimum = 8,
+					.maximum = 8,
 					.increment = 0
 				}
 			}, }
@@ -698,13 +698,13 @@ static const struct rte_cryptodev_capabilities caps_null[] = {
 				.algo = RTE_CRYPTO_AUTH_NULL,
 				.block_size = 1,
 				.key_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				},
 			}, },
@@ -718,13 +718,13 @@ static const struct rte_cryptodev_capabilities caps_null[] = {
 				.algo = RTE_CRYPTO_CIPHER_NULL,
 				.block_size = 1,
 				.key_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				},
 				.iv_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				}
 			}, },
@@ -745,23 +745,23 @@ static const struct rte_cryptodev_capabilities sec_caps_aes[] = {
 				.algo = RTE_CRYPTO_AEAD_AES_GCM,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 32,
+					.minimum = 16,
+					.maximum = 32,
 					.increment = 8
 				},
 				.digest_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				},
 				.aad_size = {
-					.min = 8,
-					.max = 12,
+					.minimum = 8,
+					.maximum = 12,
 					.increment = 4
 				},
 				.iv_size = {
-					.min = 12,
-					.max = 12,
+					.minimum = 12,
+					.maximum = 12,
 					.increment = 0
 				}
 			}, }
diff --git a/drivers/crypto/openssl/rte_openssl_pmd_ops.c b/drivers/crypto/openssl/rte_openssl_pmd_ops.c
index ed75877581..71d918ec83 100644
--- a/drivers/crypto/openssl/rte_openssl_pmd_ops.c
+++ b/drivers/crypto/openssl/rte_openssl_pmd_ops.c
@@ -21,13 +21,13 @@ static const struct rte_cryptodev_capabilities openssl_pmd_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_MD5_HMAC,
 				.block_size = 64,
 				.key_size = {
-					.min = 1,
-					.max = 64,
+					.minimum = 1,
+					.maximum = 64,
 					.increment = 1
 				},
 				.digest_size = {
-					.min = 1,
-					.max = 16,
+					.minimum = 1,
+					.maximum = 16,
 					.increment = 1
 				},
 				.iv_size = { 0 }
@@ -42,13 +42,13 @@ static const struct rte_cryptodev_capabilities openssl_pmd_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_MD5,
 				.block_size = 64,
 				.key_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				},
 				.iv_size = { 0 }
@@ -63,13 +63,13 @@ static const struct rte_cryptodev_capabilities openssl_pmd_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA1_HMAC,
 				.block_size = 64,
 				.key_size = {
-					.min = 1,
-					.max = 64,
+					.minimum = 1,
+					.maximum = 64,
 					.increment = 1
 				},
 				.digest_size = {
-					.min = 1,
-					.max = 20,
+					.minimum = 1,
+					.maximum = 20,
 					.increment = 1
 				},
 				.iv_size = { 0 }
@@ -84,13 +84,13 @@ static const struct rte_cryptodev_capabilities openssl_pmd_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA1,
 				.block_size = 64,
 				.key_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 20,
-					.max = 20,
+					.minimum = 20,
+					.maximum = 20,
 					.increment = 0
 				},
 				.iv_size = { 0 }
@@ -105,13 +105,13 @@ static const struct rte_cryptodev_capabilities openssl_pmd_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA224_HMAC,
 				.block_size = 64,
 				.key_size = {
-					.min = 1,
-					.max = 64,
+					.minimum = 1,
+					.maximum = 64,
 					.increment = 1
 				},
 				.digest_size = {
-					.min = 1,
-					.max = 28,
+					.minimum = 1,
+					.maximum = 28,
 					.increment = 1
 				},
 				.iv_size = { 0 }
@@ -126,13 +126,13 @@ static const struct rte_cryptodev_capabilities openssl_pmd_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA224,
 				.block_size = 64,
 				.key_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 1,
-					.max = 28,
+					.minimum = 1,
+					.maximum = 28,
 					.increment = 1
 				},
 				.iv_size = { 0 }
@@ -147,13 +147,13 @@ static const struct rte_cryptodev_capabilities openssl_pmd_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA256_HMAC,
 				.block_size = 64,
 				.key_size = {
-					.min = 1,
-					.max = 64,
+					.minimum = 1,
+					.maximum = 64,
 					.increment = 1
 				},
 				.digest_size = {
-					.min = 1,
-					.max = 32,
+					.minimum = 1,
+					.maximum = 32,
 					.increment = 1
 				},
 				.iv_size = { 0 }
@@ -168,13 +168,13 @@ static const struct rte_cryptodev_capabilities openssl_pmd_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA256,
 				.block_size = 64,
 				.key_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 32,
-					.max = 32,
+					.minimum = 32,
+					.maximum = 32,
 					.increment = 0
 				},
 				.iv_size = { 0 }
@@ -189,13 +189,13 @@ static const struct rte_cryptodev_capabilities openssl_pmd_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA384_HMAC,
 				.block_size = 128,
 				.key_size = {
-					.min = 1,
-					.max = 128,
+					.minimum = 1,
+					.maximum = 128,
 					.increment = 1
 				},
 				.digest_size = {
-					.min = 1,
-					.max = 48,
+					.minimum = 1,
+					.maximum = 48,
 					.increment = 1
 				},
 				.iv_size = { 0 }
@@ -210,13 +210,13 @@ static const struct rte_cryptodev_capabilities openssl_pmd_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA384,
 				.block_size = 128,
 				.key_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 48,
-					.max = 48,
+					.minimum = 48,
+					.maximum = 48,
 					.increment = 0
 				},
 				.iv_size = { 0 }
@@ -231,13 +231,13 @@ static const struct rte_cryptodev_capabilities openssl_pmd_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA512_HMAC,
 				.block_size = 128,
 				.key_size = {
-					.min = 1,
-					.max = 128,
+					.minimum = 1,
+					.maximum = 128,
 					.increment = 1
 				},
 				.digest_size = {
-					.min = 1,
-					.max = 64,
+					.minimum = 1,
+					.maximum = 64,
 					.increment = 1
 				},
 				.iv_size = { 0 }
@@ -252,13 +252,13 @@ static const struct rte_cryptodev_capabilities openssl_pmd_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA512,
 				.block_size = 128,
 				.key_size = {
-					.min = 0,
-					.max = 0,
+					.minimum = 0,
+					.maximum = 0,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 64,
-					.max = 64,
+					.minimum = 64,
+					.maximum = 64,
 					.increment = 0
 				},
 				.iv_size = { 0 }
@@ -273,13 +273,13 @@ static const struct rte_cryptodev_capabilities openssl_pmd_capabilities[] = {
 				.algo = RTE_CRYPTO_CIPHER_AES_CBC,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 32,
+					.minimum = 16,
+					.maximum = 32,
 					.increment = 8
 				},
 				.iv_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				}
 			}, }
@@ -293,13 +293,13 @@ static const struct rte_cryptodev_capabilities openssl_pmd_capabilities[] = {
 				.algo = RTE_CRYPTO_CIPHER_AES_CTR,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 32,
+					.minimum = 16,
+					.maximum = 32,
 					.increment = 8
 				},
 				.iv_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				}
 			}, }
@@ -313,23 +313,23 @@ static const struct rte_cryptodev_capabilities openssl_pmd_capabilities[] = {
 				.algo = RTE_CRYPTO_AEAD_AES_GCM,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 32,
+					.minimum = 16,
+					.maximum = 32,
 					.increment = 8
 				},
 				.digest_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				},
 				.aad_size = {
-					.min = 0,
-					.max = 65535,
+					.minimum = 0,
+					.maximum = 65535,
 					.increment = 1
 				},
 				.iv_size = {
-					.min = 12,
-					.max = 16,
+					.minimum = 12,
+					.maximum = 16,
 					.increment = 4
 				},
 			}, }
@@ -343,23 +343,23 @@ static const struct rte_cryptodev_capabilities openssl_pmd_capabilities[] = {
 				.algo = RTE_CRYPTO_AEAD_AES_CCM,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 32,
+					.minimum = 16,
+					.maximum = 32,
 					.increment = 8
 				},
 				.digest_size = {
-					.min = 4,
-					.max = 16,
+					.minimum = 4,
+					.maximum = 16,
 					.increment = 2
 				},
 				.aad_size = {
-					.min = 0,
-					.max = 65535,
+					.minimum = 0,
+					.maximum = 65535,
 					.increment = 1
 				},
 				.iv_size = {
-					.min = 7,
-					.max = 13,
+					.minimum = 7,
+					.maximum = 13,
 					.increment = 1
 				},
 			}, }
@@ -373,18 +373,18 @@ static const struct rte_cryptodev_capabilities openssl_pmd_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_AES_GMAC,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 32,
+					.minimum = 16,
+					.maximum = 32,
 					.increment = 8
 				},
 				.digest_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				},
 				.iv_size = {
-					.min = 12,
-					.max = 16,
+					.minimum = 12,
+					.maximum = 16,
 					.increment = 4
 				}
 			}, }
@@ -398,13 +398,13 @@ static const struct rte_cryptodev_capabilities openssl_pmd_capabilities[] = {
 				.algo = RTE_CRYPTO_CIPHER_3DES_CBC,
 				.block_size = 8,
 				.key_size = {
-					.min = 8,
-					.max = 24,
+					.minimum = 8,
+					.maximum = 24,
 					.increment = 8
 				},
 				.iv_size = {
-					.min = 8,
-					.max = 8,
+					.minimum = 8,
+					.maximum = 8,
 					.increment = 0
 				}
 			}, }
@@ -418,13 +418,13 @@ static const struct rte_cryptodev_capabilities openssl_pmd_capabilities[] = {
 				.algo = RTE_CRYPTO_CIPHER_3DES_CTR,
 				.block_size = 8,
 				.key_size = {
-					.min = 16,
-					.max = 24,
+					.minimum = 16,
+					.maximum = 24,
 					.increment = 8
 				},
 				.iv_size = {
-					.min = 8,
-					.max = 8,
+					.minimum = 8,
+					.maximum = 8,
 					.increment = 0
 				}
 			}, }
@@ -438,13 +438,13 @@ static const struct rte_cryptodev_capabilities openssl_pmd_capabilities[] = {
 				.algo = RTE_CRYPTO_CIPHER_DES_CBC,
 				.block_size = 8,
 				.key_size = {
-					.min = 8,
-					.max = 8,
+					.minimum = 8,
+					.maximum = 8,
 					.increment = 0
 				},
 				.iv_size = {
-					.min = 8,
-					.max = 8,
+					.minimum = 8,
+					.maximum = 8,
 					.increment = 0
 				}
 			}, }
@@ -458,13 +458,13 @@ static const struct rte_cryptodev_capabilities openssl_pmd_capabilities[] = {
 				.algo = RTE_CRYPTO_CIPHER_DES_DOCSISBPI,
 				.block_size = 8,
 				.key_size = {
-					.min = 8,
-					.max = 8,
+					.minimum = 8,
+					.maximum = 8,
 					.increment = 0
 				},
 				.iv_size = {
-					.min = 8,
-					.max = 8,
+					.minimum = 8,
+					.maximum = 8,
 					.increment = 0
 				}
 			}, }
@@ -482,9 +482,9 @@ static const struct rte_cryptodev_capabilities openssl_pmd_capabilities[] = {
 				{
 				.modlen = {
 				/* min length is based on openssl rsa keygen */
-				.min = 30,
+				.minimum = 30,
 				/* value 0 symbolizes no limit on max length */
-				.max = 0,
+				.maximum = 0,
 				.increment = 1
 				}, }
 			}
@@ -500,9 +500,9 @@ static const struct rte_cryptodev_capabilities openssl_pmd_capabilities[] = {
 				{
 				.modlen = {
 				/* value 0 symbolizes no limit on min length */
-				.min = 0,
+				.minimum = 0,
 				/* value 0 symbolizes no limit on max length */
-				.max = 0,
+				.maximum = 0,
 				.increment = 1
 				}, }
 			}
@@ -518,9 +518,9 @@ static const struct rte_cryptodev_capabilities openssl_pmd_capabilities[] = {
 				{
 				.modlen = {
 				/* value 0 symbolizes no limit on min length */
-				.min = 0,
+				.minimum = 0,
 				/* value 0 symbolizes no limit on max length */
-				.max = 0,
+				.maximum = 0,
 				.increment = 1
 				}, }
 			}
@@ -540,9 +540,9 @@ static const struct rte_cryptodev_capabilities openssl_pmd_capabilities[] = {
 				{
 				.modlen = {
 				/* value 0 symbolizes no limit on min length */
-				.min = 0,
+				.minimum = 0,
 				/* value 0 symbolizes no limit on max length */
-				.max = 0,
+				.maximum = 0,
 				.increment = 1
 				}, }
 			}
@@ -560,9 +560,9 @@ static const struct rte_cryptodev_capabilities openssl_pmd_capabilities[] = {
 				{
 				.modlen = {
 				/* value 0 symbolizes no limit on min length */
-				.min = 0,
+				.minimum = 0,
 				/* value 0 symbolizes no limit on max length */
-				.max = 0,
+				.maximum = 0,
 				.increment = 1
 				}, }
 			}
diff --git a/drivers/crypto/qat/qat_asym_capabilities.h b/drivers/crypto/qat/qat_asym_capabilities.h
index 523b4da6d3..f4e5573a98 100644
--- a/drivers/crypto/qat/qat_asym_capabilities.h
+++ b/drivers/crypto/qat/qat_asym_capabilities.h
@@ -14,8 +14,8 @@
 				.op_types = 0,					\
 				{						\
 				.modlen = {					\
-				.min = 1,					\
-				.max = 512,					\
+				.minimum = 1,					\
+				.maximum = 512,					\
 				.increment = 1					\
 				}, }						\
 			}							\
@@ -30,8 +30,8 @@
 				.op_types = 0,					\
 				{						\
 				.modlen = {					\
-				.min = 1,					\
-				.max = 512,					\
+				.minimum = 1,					\
+				.maximum = 512,					\
 				.increment = 1					\
 				}, }						\
 			}							\
@@ -50,9 +50,9 @@
 				{						\
 				.modlen = {					\
 				/* min length is based on openssl rsa keygen */	\
-				.min = 64,					\
+				.minimum = 64,					\
 				/* value 0 symbolizes no limit on max length */	\
-				.max = 512,					\
+				.maximum = 512,					\
 				.increment = 64					\
 				}, }						\
 			}							\
diff --git a/drivers/crypto/qat/qat_sym_capabilities.h b/drivers/crypto/qat/qat_sym_capabilities.h
index cfb176ca94..05b2083d96 100644
--- a/drivers/crypto/qat/qat_sym_capabilities.h
+++ b/drivers/crypto/qat/qat_sym_capabilities.h
@@ -14,13 +14,13 @@
 				.algo = RTE_CRYPTO_AUTH_SHA1,		\
 				.block_size = 64,			\
 				.key_size = {				\
-					.min = 0,			\
-					.max = 0,			\
+					.minimum = 0,			\
+					.maximum = 0,			\
 					.increment = 0			\
 				},					\
 				.digest_size = {			\
-					.min = 1,			\
-					.max = 20,			\
+					.minimum = 1,			\
+					.maximum = 20,			\
 					.increment = 1			\
 				},					\
 				.iv_size = { 0 }			\
@@ -35,13 +35,13 @@
 				.algo = RTE_CRYPTO_AUTH_SHA224,		\
 				.block_size = 64,			\
 				.key_size = {				\
-					.min = 0,			\
-					.max = 0,			\
+					.minimum = 0,			\
+					.maximum = 0,			\
 					.increment = 0			\
 				},					\
 				.digest_size = {			\
-					.min = 1,			\
-					.max = 28,			\
+					.minimum = 1,			\
+					.maximum = 28,			\
 					.increment = 1			\
 				},					\
 				.iv_size = { 0 }			\
@@ -56,13 +56,13 @@
 				.algo = RTE_CRYPTO_AUTH_SHA256,		\
 				.block_size = 64,			\
 				.key_size = {				\
-					.min = 0,			\
-					.max = 0,			\
+					.minimum = 0,			\
+					.maximum = 0,			\
 					.increment = 0			\
 				},					\
 				.digest_size = {			\
-					.min = 1,			\
-					.max = 32,			\
+					.minimum = 1,			\
+					.maximum = 32,			\
 					.increment = 1			\
 				},					\
 				.iv_size = { 0 }			\
@@ -77,13 +77,13 @@
 				.algo = RTE_CRYPTO_AUTH_SHA384,		\
 				.block_size = 128,			\
 				.key_size = {				\
-					.min = 0,			\
-					.max = 0,			\
+					.minimum = 0,			\
+					.maximum = 0,			\
 					.increment = 0			\
 				},					\
 				.digest_size = {			\
-					.min = 1,			\
-					.max = 48,			\
+					.minimum = 1,			\
+					.maximum = 48,			\
 					.increment = 1			\
 				},					\
 				.iv_size = { 0 }			\
@@ -98,13 +98,13 @@
 				.algo = RTE_CRYPTO_AUTH_SHA512,		\
 				.block_size = 128,			\
 				.key_size = {				\
-					.min = 0,			\
-					.max = 0,			\
+					.minimum = 0,			\
+					.maximum = 0,			\
 					.increment = 0			\
 				},					\
 				.digest_size = {			\
-					.min = 1,			\
-					.max = 64,			\
+					.minimum = 1,			\
+					.maximum = 64,			\
 					.increment = 1			\
 				},					\
 				.iv_size = { 0 }			\
@@ -119,13 +119,13 @@
 				.algo = RTE_CRYPTO_AUTH_SHA1_HMAC,	\
 				.block_size = 64,			\
 				.key_size = {				\
-					.min = 1,			\
-					.max = 64,			\
+					.minimum = 1,			\
+					.maximum = 64,			\
 					.increment = 1			\
 				},					\
 				.digest_size = {			\
-					.min = 1,			\
-					.max = 20,			\
+					.minimum = 1,			\
+					.maximum = 20,			\
 					.increment = 1			\
 				},					\
 				.iv_size = { 0 }			\
@@ -140,13 +140,13 @@
 				.algo = RTE_CRYPTO_AUTH_SHA224_HMAC,	\
 				.block_size = 64,			\
 				.key_size = {				\
-					.min = 1,			\
-					.max = 64,			\
+					.minimum = 1,			\
+					.maximum = 64,			\
 					.increment = 1			\
 				},					\
 				.digest_size = {			\
-					.min = 1,			\
-					.max = 28,			\
+					.minimum = 1,			\
+					.maximum = 28,			\
 					.increment = 1			\
 				},					\
 				.iv_size = { 0 }			\
@@ -161,13 +161,13 @@
 				.algo = RTE_CRYPTO_AUTH_SHA256_HMAC,	\
 				.block_size = 64,			\
 				.key_size = {				\
-					.min = 1,			\
-					.max = 64,			\
+					.minimum = 1,			\
+					.maximum = 64,			\
 					.increment = 1			\
 				},					\
 				.digest_size = {			\
-					.min = 1,			\
-					.max = 32,			\
+					.minimum = 1,			\
+					.maximum = 32,			\
 					.increment = 1			\
 				},					\
 				.iv_size = { 0 }			\
@@ -182,13 +182,13 @@
 				.algo = RTE_CRYPTO_AUTH_SHA384_HMAC,	\
 				.block_size = 128,			\
 				.key_size = {				\
-					.min = 1,			\
-					.max = 128,			\
+					.minimum = 1,			\
+					.maximum = 128,			\
 					.increment = 1			\
 				},					\
 				.digest_size = {			\
-					.min = 1,			\
-					.max = 48,			\
+					.minimum = 1,			\
+					.maximum = 48,			\
 					.increment = 1			\
 				},					\
 				.iv_size = { 0 }			\
@@ -203,13 +203,13 @@
 				.algo = RTE_CRYPTO_AUTH_SHA512_HMAC,	\
 				.block_size = 128,			\
 				.key_size = {				\
-					.min = 1,			\
-					.max = 128,			\
+					.minimum = 1,			\
+					.maximum = 128,			\
 					.increment = 1			\
 				},					\
 				.digest_size = {			\
-					.min = 1,			\
-					.max = 64,			\
+					.minimum = 1,			\
+					.maximum = 64,			\
 					.increment = 1			\
 				},					\
 				.iv_size = { 0 }			\
@@ -224,13 +224,13 @@
 				.algo = RTE_CRYPTO_AUTH_MD5_HMAC,	\
 				.block_size = 64,			\
 				.key_size = {				\
-					.min = 1,			\
-					.max = 64,			\
+					.minimum = 1,			\
+					.maximum = 64,			\
 					.increment = 1			\
 				},					\
 				.digest_size = {			\
-					.min = 1,			\
-					.max = 16,			\
+					.minimum = 1,			\
+					.maximum = 16,			\
 					.increment = 1			\
 				},					\
 				.iv_size = { 0 }			\
@@ -245,13 +245,13 @@
 				.algo = RTE_CRYPTO_AUTH_AES_XCBC_MAC,	\
 				.block_size = 16,			\
 				.key_size = {				\
-					.min = 16,			\
-					.max = 16,			\
+					.minimum = 16,			\
+					.maximum = 16,			\
 					.increment = 0			\
 				},					\
 				.digest_size = {			\
-					.min = 12,			\
-					.max = 12,			\
+					.minimum = 12,			\
+					.maximum = 12,			\
 					.increment = 0			\
 				},					\
 				.aad_size = { 0 },			\
@@ -267,13 +267,13 @@
 				.algo = RTE_CRYPTO_AUTH_AES_CMAC,	\
 				.block_size = 16,			\
 				.key_size = {				\
-					.min = 16,			\
-					.max = 16,			\
+					.minimum = 16,			\
+					.maximum = 16,			\
 					.increment = 0			\
 				},					\
 				.digest_size = {			\
-					.min = 4,			\
-					.max = 16,			\
+					.minimum = 4,			\
+					.maximum = 16,			\
 					.increment = 4			\
 				}					\
 			}, }						\
@@ -287,23 +287,23 @@
 				.algo = RTE_CRYPTO_AEAD_AES_CCM,	\
 				.block_size = 16,			\
 				.key_size = {				\
-					.min = 16,			\
-					.max = 16,			\
+					.minimum = 16,			\
+					.maximum = 16,			\
 					.increment = 0			\
 				},					\
 				.digest_size = {			\
-					.min = 4,			\
-					.max = 16,			\
+					.minimum = 4,			\
+					.maximum = 16,			\
 					.increment = 2			\
 				},					\
 				.aad_size = {				\
-					.min = 0,			\
-					.max = 224,			\
+					.minimum = 0,			\
+					.maximum = 224,			\
 					.increment = 1			\
 				},					\
 				.iv_size = {				\
-					.min = 7,			\
-					.max = 13,			\
+					.minimum = 7,			\
+					.maximum = 13,			\
 					.increment = 1			\
 				},					\
 			}, }						\
@@ -317,23 +317,23 @@
 				.algo = RTE_CRYPTO_AEAD_AES_GCM,	\
 				.block_size = 16,			\
 				.key_size = {				\
-					.min = 16,			\
-					.max = 32,			\
+					.minimum = 16,			\
+					.maximum = 32,			\
 					.increment = 8			\
 				},					\
 				.digest_size = {			\
-					.min = 8,			\
-					.max = 16,			\
+					.minimum = 8,			\
+					.maximum = 16,			\
 					.increment = 4			\
 				},					\
 				.aad_size = {				\
-					.min = 0,			\
-					.max = 240,			\
+					.minimum = 0,			\
+					.maximum = 240,			\
 					.increment = 1			\
 				},					\
 				.iv_size = {				\
-					.min = 0,			\
-					.max = 12,			\
+					.minimum = 0,			\
+					.maximum = 12,			\
 					.increment = 12			\
 				},					\
 			}, }						\
@@ -347,18 +347,18 @@
 				.algo = RTE_CRYPTO_AUTH_AES_GMAC,	\
 				.block_size = 16,			\
 				.key_size = {				\
-					.min = 16,			\
-					.max = 32,			\
+					.minimum = 16,			\
+					.maximum = 32,			\
 					.increment = 8			\
 				},					\
 				.digest_size = {			\
-					.min = 8,			\
-					.max = 16,			\
+					.minimum = 8,			\
+					.maximum = 16,			\
 					.increment = 4			\
 				},					\
 				.iv_size = {				\
-					.min = 0,			\
-					.max = 12,			\
+					.minimum = 0,			\
+					.maximum = 12,			\
 					.increment = 12			\
 				}					\
 			}, }						\
@@ -372,18 +372,18 @@
 				.algo = RTE_CRYPTO_AUTH_SNOW3G_UIA2,	\
 				.block_size = 16,			\
 				.key_size = {				\
-					.min = 16,			\
-					.max = 16,			\
+					.minimum = 16,			\
+					.maximum = 16,			\
 					.increment = 0			\
 				},					\
 				.digest_size = {			\
-					.min = 4,			\
-					.max = 4,			\
+					.minimum = 4,			\
+					.maximum = 4,			\
 					.increment = 0			\
 				},					\
 				.iv_size = {				\
-					.min = 16,			\
-					.max = 16,			\
+					.minimum = 16,			\
+					.maximum = 16,			\
 					.increment = 0			\
 				}					\
 			}, }						\
@@ -397,13 +397,13 @@
 				.algo = RTE_CRYPTO_CIPHER_AES_CBC,	\
 				.block_size = 16,			\
 				.key_size = {				\
-					.min = 16,			\
-					.max = 32,			\
+					.minimum = 16,			\
+					.maximum = 32,			\
 					.increment = 8			\
 				},					\
 				.iv_size = {				\
-					.min = 16,			\
-					.max = 16,			\
+					.minimum = 16,			\
+					.maximum = 16,			\
 					.increment = 0			\
 				}					\
 			}, }						\
@@ -417,13 +417,13 @@
 				.algo = RTE_CRYPTO_CIPHER_AES_XTS,	\
 				.block_size = 16,			\
 				.key_size = {				\
-					.min = 32,			\
-					.max = 64,			\
+					.minimum = 32,			\
+					.maximum = 64,			\
 					.increment = 32			\
 				},					\
 				.iv_size = {				\
-					.min = 16,			\
-					.max = 16,			\
+					.minimum = 16,			\
+					.maximum = 16,			\
 					.increment = 0			\
 				}					\
 			}, }						\
@@ -437,13 +437,13 @@
 				.algo = RTE_CRYPTO_CIPHER_AES_DOCSISBPI,\
 				.block_size = 16,			\
 				.key_size = {				\
-					.min = 16,			\
-					.max = 32,			\
+					.minimum = 16,			\
+					.maximum = 32,			\
 					.increment = 16			\
 				},					\
 				.iv_size = {				\
-					.min = 16,			\
-					.max = 16,			\
+					.minimum = 16,			\
+					.maximum = 16,			\
 					.increment = 0			\
 				}					\
 			}, }						\
@@ -457,13 +457,13 @@
 				.algo = RTE_CRYPTO_CIPHER_SNOW3G_UEA2,	\
 				.block_size = 16,			\
 				.key_size = {				\
-					.min = 16,			\
-					.max = 16,			\
+					.minimum = 16,			\
+					.maximum = 16,			\
 					.increment = 0			\
 				},					\
 				.iv_size = {				\
-					.min = 16,			\
-					.max = 16,			\
+					.minimum = 16,			\
+					.maximum = 16,			\
 					.increment = 0			\
 				}					\
 			}, }						\
@@ -477,13 +477,13 @@
 				.algo = RTE_CRYPTO_CIPHER_AES_CTR,	\
 				.block_size = 16,			\
 				.key_size = {				\
-					.min = 16,			\
-					.max = 32,			\
+					.minimum = 16,			\
+					.maximum = 32,			\
 					.increment = 8			\
 				},					\
 				.iv_size = {				\
-					.min = 16,			\
-					.max = 16,			\
+					.minimum = 16,			\
+					.maximum = 16,			\
 					.increment = 0			\
 				}					\
 			}, }						\
@@ -497,13 +497,13 @@
 				.algo = RTE_CRYPTO_AUTH_NULL,		\
 				.block_size = 1,			\
 				.key_size = {				\
-					.min = 0,			\
-					.max = 0,			\
+					.minimum = 0,			\
+					.maximum = 0,			\
 					.increment = 0			\
 				},					\
 				.digest_size = {			\
-					.min = 0,			\
-					.max = 0,			\
+					.minimum = 0,			\
+					.maximum = 0,			\
 					.increment = 0			\
 				},					\
 				.iv_size = { 0 }			\
@@ -518,13 +518,13 @@
 				.algo = RTE_CRYPTO_CIPHER_NULL,		\
 				.block_size = 1,			\
 				.key_size = {				\
-					.min = 0,			\
-					.max = 0,			\
+					.minimum = 0,			\
+					.maximum = 0,			\
 					.increment = 0			\
 				},					\
 				.iv_size = {				\
-					.min = 0,			\
-					.max = 0,			\
+					.minimum = 0,			\
+					.maximum = 0,			\
 					.increment = 0			\
 				}					\
 			}, },						\
@@ -538,13 +538,13 @@
 				.algo = RTE_CRYPTO_CIPHER_KASUMI_F8,	\
 				.block_size = 8,			\
 				.key_size = {				\
-					.min = 16,			\
-					.max = 16,			\
+					.minimum = 16,			\
+					.maximum = 16,			\
 					.increment = 0			\
 				},					\
 				.iv_size = {				\
-					.min = 8,			\
-					.max = 8,			\
+					.minimum = 8,			\
+					.maximum = 8,			\
 					.increment = 0			\
 				}					\
 			}, }						\
@@ -558,13 +558,13 @@
 				.algo = RTE_CRYPTO_AUTH_KASUMI_F9,	\
 				.block_size = 8,			\
 				.key_size = {				\
-					.min = 16,			\
-					.max = 16,			\
+					.minimum = 16,			\
+					.maximum = 16,			\
 					.increment = 0			\
 				},					\
 				.digest_size = {			\
-					.min = 4,			\
-					.max = 4,			\
+					.minimum = 4,			\
+					.maximum = 4,			\
 					.increment = 0			\
 				},					\
 				.iv_size = { 0 }			\
@@ -579,13 +579,13 @@
 				.algo = RTE_CRYPTO_CIPHER_3DES_CBC,	\
 				.block_size = 8,			\
 				.key_size = {				\
-					.min = 8,			\
-					.max = 24,			\
+					.minimum = 8,			\
+					.maximum = 24,			\
 					.increment = 8			\
 				},					\
 				.iv_size = {				\
-					.min = 8,			\
-					.max = 8,			\
+					.minimum = 8,			\
+					.maximum = 8,			\
 					.increment = 0			\
 				}					\
 			}, }						\
@@ -599,13 +599,13 @@
 				.algo = RTE_CRYPTO_CIPHER_3DES_CTR,	\
 				.block_size = 8,			\
 				.key_size = {				\
-					.min = 16,			\
-					.max = 24,			\
+					.minimum = 16,			\
+					.maximum = 24,			\
 					.increment = 8			\
 				},					\
 				.iv_size = {				\
-					.min = 8,			\
-					.max = 8,			\
+					.minimum = 8,			\
+					.maximum = 8,			\
 					.increment = 0			\
 				}					\
 			}, }						\
@@ -619,13 +619,13 @@
 				.algo = RTE_CRYPTO_CIPHER_DES_CBC,	\
 				.block_size = 8,			\
 				.key_size = {				\
-					.min = 8,			\
-					.max = 8,			\
+					.minimum = 8,			\
+					.maximum = 8,			\
 					.increment = 0			\
 				},					\
 				.iv_size = {				\
-					.min = 8,			\
-					.max = 8,			\
+					.minimum = 8,			\
+					.maximum = 8,			\
 					.increment = 0			\
 				}					\
 			}, }						\
@@ -639,13 +639,13 @@
 				.algo = RTE_CRYPTO_CIPHER_DES_DOCSISBPI,\
 				.block_size = 8,			\
 				.key_size = {				\
-					.min = 8,			\
-					.max = 8,			\
+					.minimum = 8,			\
+					.maximum = 8,			\
 					.increment = 0			\
 				},					\
 				.iv_size = {				\
-					.min = 8,			\
-					.max = 8,			\
+					.minimum = 8,			\
+					.maximum = 8,			\
 					.increment = 0			\
 				}					\
 			}, }						\
@@ -661,13 +661,13 @@
 				.algo = RTE_CRYPTO_CIPHER_ZUC_EEA3,	\
 				.block_size = 16,			\
 				.key_size = {				\
-					.min = 16,			\
-					.max = 16,			\
+					.minimum = 16,			\
+					.maximum = 16,			\
 					.increment = 0			\
 				},					\
 				.iv_size = {				\
-					.min = 16,			\
-					.max = 16,			\
+					.minimum = 16,			\
+					.maximum = 16,			\
 					.increment = 0			\
 				}					\
 			}, }						\
@@ -681,18 +681,18 @@
 				.algo = RTE_CRYPTO_AUTH_ZUC_EIA3,	\
 				.block_size = 16,			\
 				.key_size = {				\
-					.min = 16,			\
-					.max = 16,			\
+					.minimum = 16,			\
+					.maximum = 16,			\
 					.increment = 0			\
 				},					\
 				.digest_size = {			\
-					.min = 4,			\
-					.max = 4,			\
+					.minimum = 4,			\
+					.maximum = 4,			\
 					.increment = 0			\
 				},					\
 				.iv_size = {				\
-					.min = 16,			\
-					.max = 16,			\
+					.minimum = 16,			\
+					.maximum = 16,			\
 					.increment = 0			\
 				}					\
 			}, }						\
@@ -708,23 +708,23 @@
 				.algo = RTE_CRYPTO_AEAD_CHACHA20_POLY1305, \
 				.block_size = 64,			\
 				.key_size = {				\
-					.min = 32,			\
-					.max = 32,			\
+					.minimum = 32,			\
+					.maximum = 32,			\
 					.increment = 0			\
 				},					\
 				.digest_size = {			\
-					.min = 16,			\
-					.max = 16,			\
+					.minimum = 16,			\
+					.maximum = 16,			\
 					.increment = 0			\
 				},					\
 				.aad_size = {				\
-					.min = 0,			\
-					.max = 240,			\
+					.minimum = 0,			\
+					.maximum = 240,			\
 					.increment = 1			\
 				},					\
 				.iv_size = {				\
-					.min = 12,			\
-					.max = 12,			\
+					.minimum = 12,			\
+					.maximum = 12,			\
 					.increment = 0			\
 				},					\
 			}, }						\
@@ -740,13 +740,13 @@
 				.algo = RTE_CRYPTO_CIPHER_AES_CBC,	\
 				.block_size = 16,			\
 				.key_size = {				\
-					.min = 16,			\
-					.max = 32,			\
+					.minimum = 16,			\
+					.maximum = 32,			\
 					.increment = 8			\
 				},					\
 				.iv_size = {				\
-					.min = 16,			\
-					.max = 16,			\
+					.minimum = 16,			\
+					.maximum = 16,			\
 					.increment = 0			\
 				}					\
 			}, }						\
@@ -760,13 +760,13 @@
 				.algo = RTE_CRYPTO_AUTH_SHA1_HMAC,	\
 				.block_size = 64,			\
 				.key_size = {				\
-					.min = 1,			\
-					.max = 64,			\
+					.minimum = 1,			\
+					.maximum = 64,			\
 					.increment = 1			\
 				},					\
 				.digest_size = {			\
-					.min = 1,			\
-					.max = 20,			\
+					.minimum = 1,			\
+					.maximum = 20,			\
 					.increment = 1			\
 				},					\
 				.iv_size = { 0 }			\
@@ -781,13 +781,13 @@
 				.algo = RTE_CRYPTO_AUTH_SHA224_HMAC,	\
 				.block_size = 64,			\
 				.key_size = {				\
-					.min = 1,			\
-					.max = 64,			\
+					.minimum = 1,			\
+					.maximum = 64,			\
 					.increment = 1			\
 				},					\
 				.digest_size = {			\
-					.min = 1,			\
-					.max = 28,			\
+					.minimum = 1,			\
+					.maximum = 28,			\
 					.increment = 1			\
 				},					\
 				.iv_size = { 0 }			\
@@ -802,13 +802,13 @@
 				.algo = RTE_CRYPTO_AUTH_SHA256_HMAC,	\
 				.block_size = 64,			\
 				.key_size = {				\
-					.min = 1,			\
-					.max = 64,			\
+					.minimum = 1,			\
+					.maximum = 64,			\
 					.increment = 1			\
 				},					\
 				.digest_size = {			\
-					.min = 1,			\
-					.max = 32,			\
+					.minimum = 1,			\
+					.maximum = 32,			\
 					.increment = 1			\
 				},					\
 				.iv_size = { 0 }			\
@@ -823,13 +823,13 @@
 				.algo = RTE_CRYPTO_AUTH_SHA384_HMAC,	\
 				.block_size = 128,			\
 				.key_size = {				\
-					.min = 1,			\
-					.max = 128,			\
+					.minimum = 1,			\
+					.maximum = 128,			\
 					.increment = 1			\
 				},					\
 				.digest_size = {			\
-					.min = 1,			\
-					.max = 48,			\
+					.minimum = 1,			\
+					.maximum = 48,			\
 					.increment = 1			\
 				},					\
 				.iv_size = { 0 }			\
@@ -844,13 +844,13 @@
 				.algo = RTE_CRYPTO_AUTH_SHA512_HMAC,	\
 				.block_size = 128,			\
 				.key_size = {				\
-					.min = 1,			\
-					.max = 128,			\
+					.minimum = 1,			\
+					.maximum = 128,			\
 					.increment = 1			\
 				},					\
 				.digest_size = {			\
-					.min = 1,			\
-					.max = 64,			\
+					.minimum = 1,			\
+					.maximum = 64,			\
 					.increment = 1			\
 				},					\
 				.iv_size = { 0 }			\
@@ -865,13 +865,13 @@
 				.algo = RTE_CRYPTO_AUTH_AES_XCBC_MAC,	\
 				.block_size = 16,			\
 				.key_size = {				\
-					.min = 16,			\
-					.max = 16,			\
+					.minimum = 16,			\
+					.maximum = 16,			\
 					.increment = 0			\
 				},					\
 				.digest_size = {			\
-					.min = 12,			\
-					.max = 12,			\
+					.minimum = 12,			\
+					.maximum = 12,			\
 					.increment = 0			\
 				},					\
 				.aad_size = { 0 },			\
@@ -887,13 +887,13 @@
 				.algo = RTE_CRYPTO_AUTH_AES_CMAC,	\
 				.block_size = 16,			\
 				.key_size = {				\
-					.min = 16,			\
-					.max = 16,			\
+					.minimum = 16,			\
+					.maximum = 16,			\
 					.increment = 0			\
 				},					\
 				.digest_size = {			\
-					.min = 4,			\
-					.max = 16,			\
+					.minimum = 4,			\
+					.maximum = 16,			\
 					.increment = 4			\
 				}					\
 			}, }						\
@@ -907,13 +907,13 @@
 				.algo = RTE_CRYPTO_CIPHER_AES_DOCSISBPI,\
 				.block_size = 16,			\
 				.key_size = {				\
-					.min = 16,			\
-					.max = 32,			\
+					.minimum = 16,			\
+					.maximum = 32,			\
 					.increment = 16			\
 				},					\
 				.iv_size = {				\
-					.min = 16,			\
-					.max = 16,			\
+					.minimum = 16,			\
+					.maximum = 16,			\
 					.increment = 0			\
 				}					\
 			}, }						\
@@ -927,13 +927,13 @@
 				.algo = RTE_CRYPTO_AUTH_NULL,		\
 				.block_size = 1,			\
 				.key_size = {				\
-					.min = 0,			\
-					.max = 0,			\
+					.minimum = 0,			\
+					.maximum = 0,			\
 					.increment = 0			\
 				},					\
 				.digest_size = {			\
-					.min = 0,			\
-					.max = 0,			\
+					.minimum = 0,			\
+					.maximum = 0,			\
 					.increment = 0			\
 				},					\
 				.iv_size = { 0 }			\
@@ -948,13 +948,13 @@
 				.algo = RTE_CRYPTO_CIPHER_NULL,		\
 				.block_size = 1,			\
 				.key_size = {				\
-					.min = 0,			\
-					.max = 0,			\
+					.minimum = 0,			\
+					.maximum = 0,			\
 					.increment = 0			\
 				},					\
 				.iv_size = {				\
-					.min = 0,			\
-					.max = 0,			\
+					.minimum = 0,			\
+					.maximum = 0,			\
 					.increment = 0			\
 				}					\
 			}, },						\
@@ -968,13 +968,13 @@
 				.algo = RTE_CRYPTO_AUTH_SHA1,		\
 				.block_size = 64,			\
 				.key_size = {				\
-					.min = 0,			\
-					.max = 0,			\
+					.minimum = 0,			\
+					.maximum = 0,			\
 					.increment = 0			\
 				},					\
 				.digest_size = {			\
-					.min = 1,			\
-					.max = 20,			\
+					.minimum = 1,			\
+					.maximum = 20,			\
 					.increment = 1			\
 				},					\
 				.iv_size = { 0 }			\
@@ -989,13 +989,13 @@
 				.algo = RTE_CRYPTO_AUTH_SHA224,		\
 				.block_size = 64,			\
 				.key_size = {				\
-					.min = 0,			\
-					.max = 0,			\
+					.minimum = 0,			\
+					.maximum = 0,			\
 					.increment = 0			\
 				},					\
 				.digest_size = {			\
-					.min = 1,			\
-					.max = 28,			\
+					.minimum = 1,			\
+					.maximum = 28,			\
 					.increment = 1			\
 				},					\
 				.iv_size = { 0 }			\
@@ -1010,13 +1010,13 @@
 				.algo = RTE_CRYPTO_AUTH_SHA256,		\
 				.block_size = 64,			\
 				.key_size = {				\
-					.min = 0,			\
-					.max = 0,			\
+					.minimum = 0,			\
+					.maximum = 0,			\
 					.increment = 0			\
 				},					\
 				.digest_size = {			\
-					.min = 1,			\
-					.max = 32,			\
+					.minimum = 1,			\
+					.maximum = 32,			\
 					.increment = 1			\
 				},					\
 				.iv_size = { 0 }			\
@@ -1031,13 +1031,13 @@
 				.algo = RTE_CRYPTO_AUTH_SHA384,		\
 				.block_size = 128,			\
 				.key_size = {				\
-					.min = 0,			\
-					.max = 0,			\
+					.minimum = 0,			\
+					.maximum = 0,			\
 					.increment = 0			\
 				},					\
 				.digest_size = {			\
-					.min = 1,			\
-					.max = 48,			\
+					.minimum = 1,			\
+					.maximum = 48,			\
 					.increment = 1			\
 				},					\
 				.iv_size = { 0 }			\
@@ -1052,13 +1052,13 @@
 				.algo = RTE_CRYPTO_AUTH_SHA512,		\
 				.block_size = 128,			\
 				.key_size = {				\
-					.min = 0,			\
-					.max = 0,			\
+					.minimum = 0,			\
+					.maximum = 0,			\
 					.increment = 0			\
 				},					\
 				.digest_size = {			\
-					.min = 1,			\
-					.max = 64,			\
+					.minimum = 1,			\
+					.maximum = 64,			\
 					.increment = 1			\
 				},					\
 				.iv_size = { 0 }			\
@@ -1073,13 +1073,13 @@
 				.algo = RTE_CRYPTO_CIPHER_AES_CTR,	\
 				.block_size = 16,			\
 				.key_size = {				\
-					.min = 16,			\
-					.max = 32,			\
+					.minimum = 16,			\
+					.maximum = 32,			\
 					.increment = 8			\
 				},					\
 				.iv_size = {				\
-					.min = 16,			\
-					.max = 16,			\
+					.minimum = 16,			\
+					.maximum = 16,			\
 					.increment = 0			\
 				}					\
 			}, }						\
@@ -1093,23 +1093,23 @@
 				.algo = RTE_CRYPTO_AEAD_AES_GCM,	\
 				.block_size = 16,			\
 				.key_size = {				\
-					.min = 16,			\
-					.max = 32,			\
+					.minimum = 16,			\
+					.maximum = 32,			\
 					.increment = 8			\
 				},					\
 				.digest_size = {			\
-					.min = 8,			\
-					.max = 16,			\
+					.minimum = 8,			\
+					.maximum = 16,			\
 					.increment = 4			\
 				},					\
 				.aad_size = {				\
-					.min = 0,			\
-					.max = 240,			\
+					.minimum = 0,			\
+					.maximum = 240,			\
 					.increment = 1			\
 				},					\
 				.iv_size = {				\
-					.min = 0,			\
-					.max = 12,			\
+					.minimum = 0,			\
+					.maximum = 12,			\
 					.increment = 12			\
 				},					\
 			}, }						\
@@ -1123,23 +1123,23 @@
 				.algo = RTE_CRYPTO_AEAD_AES_CCM,	\
 				.block_size = 16,			\
 				.key_size = {				\
-					.min = 16,			\
-					.max = 16,			\
+					.minimum = 16,			\
+					.maximum = 16,			\
 					.increment = 0			\
 				},					\
 				.digest_size = {			\
-					.min = 4,			\
-					.max = 16,			\
+					.minimum = 4,			\
+					.maximum = 16,			\
 					.increment = 2			\
 				},					\
 				.aad_size = {				\
-					.min = 0,			\
-					.max = 224,			\
+					.minimum = 0,			\
+					.maximum = 224,			\
 					.increment = 1			\
 				},					\
 				.iv_size = {				\
-					.min = 7,			\
-					.max = 13,			\
+					.minimum = 7,			\
+					.maximum = 13,			\
 					.increment = 1			\
 				},					\
 			}, }						\
@@ -1153,23 +1153,23 @@
 				.algo = RTE_CRYPTO_AEAD_CHACHA20_POLY1305, \
 				.block_size = 64,			\
 				.key_size = {				\
-					.min = 32,			\
-					.max = 32,			\
+					.minimum = 32,			\
+					.maximum = 32,			\
 					.increment = 0			\
 				},					\
 				.digest_size = {			\
-					.min = 16,			\
-					.max = 16,			\
+					.minimum = 16,			\
+					.maximum = 16,			\
 					.increment = 0			\
 				},					\
 				.aad_size = {				\
-					.min = 0,			\
-					.max = 240,			\
+					.minimum = 0,			\
+					.maximum = 240,			\
 					.increment = 1			\
 				},					\
 				.iv_size = {				\
-					.min = 12,			\
-					.max = 12,			\
+					.minimum = 12,			\
+					.maximum = 12,			\
 					.increment = 0			\
 				},					\
 			}, }						\
@@ -1183,18 +1183,18 @@
 				.algo = RTE_CRYPTO_AUTH_AES_GMAC,	\
 				.block_size = 16,			\
 				.key_size = {				\
-					.min = 16,			\
-					.max = 32,			\
+					.minimum = 16,			\
+					.maximum = 32,			\
 					.increment = 8			\
 				},					\
 				.digest_size = {			\
-					.min = 8,			\
-					.max = 16,			\
+					.minimum = 8,			\
+					.maximum = 16,			\
 					.increment = 4			\
 				},					\
 				.iv_size = {				\
-					.min = 0,			\
-					.max = 12,			\
+					.minimum = 0,			\
+					.maximum = 12,			\
 					.increment = 12			\
 				}					\
 			}, }						\
@@ -1213,13 +1213,13 @@
 				.algo = RTE_CRYPTO_CIPHER_AES_DOCSISBPI,\
 				.block_size = 16,			\
 				.key_size = {				\
-					.min = 16,			\
-					.max = 32,			\
+					.minimum = 16,			\
+					.maximum = 32,			\
 					.increment = 16			\
 				},					\
 				.iv_size = {				\
-					.min = 16,			\
-					.max = 16,			\
+					.minimum = 16,			\
+					.maximum = 16,			\
 					.increment = 0			\
 				}					\
 			}, }						\
diff --git a/drivers/crypto/scheduler/rte_cryptodev_scheduler.c b/drivers/crypto/scheduler/rte_cryptodev_scheduler.c
index 1e0b4df0ca..fe96ca949a 100644
--- a/drivers/crypto/scheduler/rte_cryptodev_scheduler.c
+++ b/drivers/crypto/scheduler/rte_cryptodev_scheduler.c
@@ -49,16 +49,16 @@ sync_caps(struct rte_cryptodev_capabilities *caps,
 						cap->sym.auth.algo)
 					continue;
 
-				cap->sym.auth.digest_size.min =
-					s_cap->sym.auth.digest_size.min <
-					cap->sym.auth.digest_size.min ?
-					s_cap->sym.auth.digest_size.min :
-					cap->sym.auth.digest_size.min;
-				cap->sym.auth.digest_size.max =
-					s_cap->sym.auth.digest_size.max <
-					cap->sym.auth.digest_size.max ?
-					s_cap->sym.auth.digest_size.max :
-					cap->sym.auth.digest_size.max;
+				cap->sym.auth.digest_size.minimum =
+					s_cap->sym.auth.digest_size.minimum <
+					cap->sym.auth.digest_size.minimum ?
+					s_cap->sym.auth.digest_size.minimum :
+					cap->sym.auth.digest_size.minimum;
+				cap->sym.auth.digest_size.maximum =
+					s_cap->sym.auth.digest_size.maximum <
+					cap->sym.auth.digest_size.maximum ?
+					s_cap->sym.auth.digest_size.maximum :
+					cap->sym.auth.digest_size.maximum;
 
 			}
 
diff --git a/drivers/crypto/snow3g/rte_snow3g_pmd_ops.c b/drivers/crypto/snow3g/rte_snow3g_pmd_ops.c
index 906a0fe60b..6aea6d701f 100644
--- a/drivers/crypto/snow3g/rte_snow3g_pmd_ops.c
+++ b/drivers/crypto/snow3g/rte_snow3g_pmd_ops.c
@@ -19,18 +19,18 @@ static const struct rte_cryptodev_capabilities snow3g_pmd_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_SNOW3G_UIA2,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 4,
-					.max = 4,
+					.minimum = 4,
+					.maximum = 4,
 					.increment = 0
 				},
 				.iv_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				}
 			}, }
@@ -44,13 +44,13 @@ static const struct rte_cryptodev_capabilities snow3g_pmd_capabilities[] = {
 				.algo = RTE_CRYPTO_CIPHER_SNOW3G_UEA2,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				},
 				.iv_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				}
 			}, }
diff --git a/drivers/crypto/virtio/virtio_crypto_capabilities.h b/drivers/crypto/virtio/virtio_crypto_capabilities.h
index 03c30deefd..3624a28ce5 100644
--- a/drivers/crypto/virtio/virtio_crypto_capabilities.h
+++ b/drivers/crypto/virtio/virtio_crypto_capabilities.h
@@ -14,13 +14,13 @@
 				.algo = RTE_CRYPTO_AUTH_SHA1_HMAC,	\
 				.block_size = 64,			\
 				.key_size = {				\
-					.min = 1,			\
-					.max = 64,			\
+					.minimum = 1,			\
+					.maximum = 64,			\
 					.increment = 1			\
 				},					\
 				.digest_size = {			\
-					.min = 1,			\
-					.max = 20,			\
+					.minimum = 1,			\
+					.maximum = 20,			\
 					.increment = 1			\
 				},					\
 				.iv_size = { 0 }			\
@@ -35,13 +35,13 @@
 				.algo = RTE_CRYPTO_CIPHER_AES_CBC,	\
 				.block_size = 16,			\
 				.key_size = {				\
-					.min = 16,			\
-					.max = 32,			\
+					.minimum = 16,			\
+					.maximum = 32,			\
 					.increment = 8			\
 				},					\
 				.iv_size = {				\
-					.min = 16,			\
-					.max = 16,			\
+					.minimum = 16,			\
+					.maximum = 16,			\
 					.increment = 0			\
 				}					\
 			}, }						\
diff --git a/drivers/crypto/zuc/rte_zuc_pmd_ops.c b/drivers/crypto/zuc/rte_zuc_pmd_ops.c
index dc9dc25ef8..cb33795462 100644
--- a/drivers/crypto/zuc/rte_zuc_pmd_ops.c
+++ b/drivers/crypto/zuc/rte_zuc_pmd_ops.c
@@ -19,18 +19,18 @@ static const struct rte_cryptodev_capabilities zuc_pmd_capabilities[] = {
 				.algo = RTE_CRYPTO_AUTH_ZUC_EIA3,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 4,
-					.max = 4,
+					.minimum = 4,
+					.maximum = 4,
 					.increment = 0
 				},
 				.iv_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				}
 			}, }
@@ -44,13 +44,13 @@ static const struct rte_cryptodev_capabilities zuc_pmd_capabilities[] = {
 				.algo = RTE_CRYPTO_CIPHER_ZUC_EEA3,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				},
 				.iv_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				},
 			}, }
diff --git a/drivers/net/ixgbe/ixgbe_ipsec.c b/drivers/net/ixgbe/ixgbe_ipsec.c
index e45c5501e6..8022e9f460 100644
--- a/drivers/net/ixgbe/ixgbe_ipsec.c
+++ b/drivers/net/ixgbe/ixgbe_ipsec.c
@@ -507,18 +507,18 @@ ixgbe_crypto_capabilities_get(void *device __rte_unused)
 					.algo = RTE_CRYPTO_AUTH_AES_GMAC,
 					.block_size = 16,
 					.key_size = {
-						.min = 16,
-						.max = 16,
+						.minimum = 16,
+						.maximum = 16,
 						.increment = 0
 					},
 					.digest_size = {
-						.min = 16,
-						.max = 16,
+						.minimum = 16,
+						.maximum = 16,
 						.increment = 0
 					},
 					.iv_size = {
-						.min = 12,
-						.max = 12,
+						.minimum = 12,
+						.maximum = 12,
 						.increment = 0
 					}
 				}, }
@@ -532,23 +532,23 @@ ixgbe_crypto_capabilities_get(void *device __rte_unused)
 					.algo = RTE_CRYPTO_AEAD_AES_GCM,
 					.block_size = 16,
 					.key_size = {
-						.min = 16,
-						.max = 16,
+						.minimum = 16,
+						.maximum = 16,
 						.increment = 0
 					},
 					.digest_size = {
-						.min = 16,
-						.max = 16,
+						.minimum = 16,
+						.maximum = 16,
 						.increment = 0
 					},
 					.aad_size = {
-						.min = 0,
-						.max = 65535,
+						.minimum = 0,
+						.maximum = 65535,
 						.increment = 1
 					},
 					.iv_size = {
-						.min = 12,
-						.max = 12,
+						.minimum = 12,
+						.maximum = 12,
 						.increment = 0
 					}
 				}, }
diff --git a/drivers/net/octeontx2/otx2_ethdev_sec.c b/drivers/net/octeontx2/otx2_ethdev_sec.c
index c2a36883cb..0cb6b88641 100644
--- a/drivers/net/octeontx2/otx2_ethdev_sec.c
+++ b/drivers/net/octeontx2/otx2_ethdev_sec.c
@@ -45,23 +45,23 @@ static struct rte_cryptodev_capabilities otx2_eth_sec_crypto_caps[] = {
 				.algo = RTE_CRYPTO_AEAD_AES_GCM,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 32,
+					.minimum = 16,
+					.maximum = 32,
 					.increment = 8
 				},
 				.digest_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				},
 				.aad_size = {
-					.min = 8,
-					.max = 12,
+					.minimum = 8,
+					.maximum = 12,
 					.increment = 4
 				},
 				.iv_size = {
-					.min = 12,
-					.max = 12,
+					.minimum = 12,
+					.maximum = 12,
 					.increment = 0
 				}
 			}, }
@@ -75,13 +75,13 @@ static struct rte_cryptodev_capabilities otx2_eth_sec_crypto_caps[] = {
 				.algo = RTE_CRYPTO_CIPHER_AES_CBC,
 				.block_size = 16,
 				.key_size = {
-					.min = 16,
-					.max = 32,
+					.minimum = 16,
+					.maximum = 32,
 					.increment = 8
 				},
 				.iv_size = {
-					.min = 16,
-					.max = 16,
+					.minimum = 16,
+					.maximum = 16,
 					.increment = 0
 				}
 			}, }
@@ -95,13 +95,13 @@ static struct rte_cryptodev_capabilities otx2_eth_sec_crypto_caps[] = {
 				.algo = RTE_CRYPTO_AUTH_SHA1_HMAC,
 				.block_size = 64,
 				.key_size = {
-					.min = 20,
-					.max = 64,
+					.minimum = 20,
+					.maximum = 64,
 					.increment = 1
 				},
 				.digest_size = {
-					.min = 12,
-					.max = 12,
+					.minimum = 12,
+					.maximum = 12,
 					.increment = 0
 				},
 			}, }
diff --git a/drivers/net/txgbe/txgbe_ipsec.c b/drivers/net/txgbe/txgbe_ipsec.c
index ccd747973b..a82b4ce2d1 100644
--- a/drivers/net/txgbe/txgbe_ipsec.c
+++ b/drivers/net/txgbe/txgbe_ipsec.c
@@ -486,18 +486,18 @@ txgbe_crypto_capabilities_get(void *device __rte_unused)
 					.algo = RTE_CRYPTO_AUTH_AES_GMAC,
 					.block_size = 16,
 					.key_size = {
-						.min = 16,
-						.max = 16,
+						.minimum = 16,
+						.maximum = 16,
 						.increment = 0
 					},
 					.digest_size = {
-						.min = 16,
-						.max = 16,
+						.minimum = 16,
+						.maximum = 16,
 						.increment = 0
 					},
 					.iv_size = {
-						.min = 12,
-						.max = 12,
+						.minimum = 12,
+						.maximum = 12,
 						.increment = 0
 					}
 				}, }
@@ -511,23 +511,23 @@ txgbe_crypto_capabilities_get(void *device __rte_unused)
 					.algo = RTE_CRYPTO_AEAD_AES_GCM,
 					.block_size = 16,
 					.key_size = {
-						.min = 16,
-						.max = 16,
+						.minimum = 16,
+						.maximum = 16,
 						.increment = 0
 					},
 					.digest_size = {
-						.min = 16,
-						.max = 16,
+						.minimum = 16,
+						.maximum = 16,
 						.increment = 0
 					},
 					.aad_size = {
-						.min = 0,
-						.max = 65535,
+						.minimum = 0,
+						.maximum = 65535,
 						.increment = 1
 					},
 					.iv_size = {
-						.min = 12,
-						.max = 12,
+						.minimum = 12,
+						.maximum = 12,
 						.increment = 0
 					}
 				}, }
diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c
index 5f539c458c..b6bc371bd2 100644
--- a/examples/l2fwd-crypto/main.c
+++ b/examples/l2fwd-crypto/main.c
@@ -1996,8 +1996,8 @@ check_iv_param(const struct rte_crypto_param_range *iv_range_size,
 	 */
 	if (iv_param) {
 		if (check_supported_size(iv_length,
-				iv_range_size->min,
-				iv_range_size->max,
+				iv_range_size->minimum,
+				iv_range_size->maximum,
 				iv_range_size->increment)
 					!= 0)
 			return -1;
@@ -2007,8 +2007,8 @@ check_iv_param(const struct rte_crypto_param_range *iv_range_size,
 	 */
 	} else if (iv_random_size != -1) {
 		if (check_supported_size(iv_random_size,
-				iv_range_size->min,
-				iv_range_size->max,
+				iv_range_size->minimum,
+				iv_range_size->maximum,
 				iv_range_size->increment)
 					!= 0)
 			return -1;
@@ -2050,8 +2050,8 @@ check_capabilities(struct l2fwd_crypto_options *options, uint8_t cdev_id)
 		if (options->aead_key_param) {
 			if (check_supported_size(
 					options->aead_xform.aead.key.length,
-					cap->sym.aead.key_size.min,
-					cap->sym.aead.key_size.max,
+					cap->sym.aead.key_size.minimum,
+					cap->sym.aead.key_size.maximum,
 					cap->sym.aead.key_size.increment)
 						!= 0) {
 				RTE_LOG(DEBUG, USER1,
@@ -2066,8 +2066,8 @@ check_capabilities(struct l2fwd_crypto_options *options, uint8_t cdev_id)
 		 */
 		} else if (options->aead_key_random_size != -1) {
 			if (check_supported_size(options->aead_key_random_size,
-					cap->sym.aead.key_size.min,
-					cap->sym.aead.key_size.max,
+					cap->sym.aead.key_size.minimum,
+					cap->sym.aead.key_size.maximum,
 					cap->sym.aead.key_size.increment)
 						!= 0) {
 				RTE_LOG(DEBUG, USER1,
@@ -2085,8 +2085,8 @@ check_capabilities(struct l2fwd_crypto_options *options, uint8_t cdev_id)
 		 */
 		if (options->aad_param) {
 			if (check_supported_size(options->aad.length,
-					cap->sym.aead.aad_size.min,
-					cap->sym.aead.aad_size.max,
+					cap->sym.aead.aad_size.minimum,
+					cap->sym.aead.aad_size.maximum,
 					cap->sym.aead.aad_size.increment)
 						!= 0) {
 				RTE_LOG(DEBUG, USER1,
@@ -2101,8 +2101,8 @@ check_capabilities(struct l2fwd_crypto_options *options, uint8_t cdev_id)
 		 */
 		} else if (options->aad_random_size != -1) {
 			if (check_supported_size(options->aad_random_size,
-					cap->sym.aead.aad_size.min,
-					cap->sym.aead.aad_size.max,
+					cap->sym.aead.aad_size.minimum,
+					cap->sym.aead.aad_size.maximum,
 					cap->sym.aead.aad_size.increment)
 						!= 0) {
 				RTE_LOG(DEBUG, USER1,
@@ -2116,8 +2116,8 @@ check_capabilities(struct l2fwd_crypto_options *options, uint8_t cdev_id)
 		/* Check if digest size is supported by the algorithm. */
 		if (options->digest_size != -1) {
 			if (check_supported_size(options->digest_size,
-					cap->sym.aead.digest_size.min,
-					cap->sym.aead.digest_size.max,
+					cap->sym.aead.digest_size.minimum,
+					cap->sym.aead.digest_size.maximum,
 					cap->sym.aead.digest_size.increment)
 						!= 0) {
 				RTE_LOG(DEBUG, USER1,
@@ -2160,8 +2160,8 @@ check_capabilities(struct l2fwd_crypto_options *options, uint8_t cdev_id)
 		if (options->ckey_param) {
 			if (check_supported_size(
 					options->cipher_xform.cipher.key.length,
-					cap->sym.cipher.key_size.min,
-					cap->sym.cipher.key_size.max,
+					cap->sym.cipher.key_size.minimum,
+					cap->sym.cipher.key_size.maximum,
 					cap->sym.cipher.key_size.increment)
 						!= 0) {
 				if (dev_info.feature_flags &
@@ -2185,8 +2185,8 @@ check_capabilities(struct l2fwd_crypto_options *options, uint8_t cdev_id)
 		 */
 		} else if (options->ckey_random_size != -1) {
 			if (check_supported_size(options->ckey_random_size,
-					cap->sym.cipher.key_size.min,
-					cap->sym.cipher.key_size.max,
+					cap->sym.cipher.key_size.minimum,
+					cap->sym.cipher.key_size.maximum,
 					cap->sym.cipher.key_size.increment)
 						!= 0) {
 				RTE_LOG(DEBUG, USER1,
@@ -2262,8 +2262,8 @@ check_capabilities(struct l2fwd_crypto_options *options, uint8_t cdev_id)
 		if (options->akey_param) {
 			if (check_supported_size(
 					options->auth_xform.auth.key.length,
-					cap->sym.auth.key_size.min,
-					cap->sym.auth.key_size.max,
+					cap->sym.auth.key_size.minimum,
+					cap->sym.auth.key_size.maximum,
 					cap->sym.auth.key_size.increment)
 						!= 0) {
 				RTE_LOG(DEBUG, USER1,
@@ -2278,8 +2278,8 @@ check_capabilities(struct l2fwd_crypto_options *options, uint8_t cdev_id)
 		 */
 		} else if (options->akey_random_size != -1) {
 			if (check_supported_size(options->akey_random_size,
-					cap->sym.auth.key_size.min,
-					cap->sym.auth.key_size.max,
+					cap->sym.auth.key_size.minimum,
+					cap->sym.auth.key_size.maximum,
 					cap->sym.auth.key_size.increment)
 						!= 0) {
 				RTE_LOG(DEBUG, USER1,
@@ -2293,8 +2293,8 @@ check_capabilities(struct l2fwd_crypto_options *options, uint8_t cdev_id)
 		/* Check if digest size is supported by the algorithm. */
 		if (options->digest_size != -1) {
 			if (check_supported_size(options->digest_size,
-					cap->sym.auth.digest_size.min,
-					cap->sym.auth.digest_size.max,
+					cap->sym.auth.digest_size.minimum,
+					cap->sym.auth.digest_size.maximum,
 					cap->sym.auth.digest_size.increment)
 						!= 0) {
 				RTE_LOG(DEBUG, USER1,
@@ -2448,7 +2448,7 @@ initialize_cryptodevs(struct l2fwd_crypto_options *options, unsigned nb_ports,
 				/* No size provided, use minimum size. */
 				else
 					options->aead_iv.length =
-						cap->sym.aead.iv_size.min;
+						cap->sym.aead.iv_size.minimum;
 			}
 
 			/* Set key if not provided from command line */
@@ -2459,7 +2459,7 @@ initialize_cryptodevs(struct l2fwd_crypto_options *options, unsigned nb_ports,
 				/* No size provided, use minimum size. */
 				else
 					options->aead_xform.aead.key.length =
-						cap->sym.aead.key_size.min;
+						cap->sym.aead.key_size.minimum;
 
 				generate_random_key(options->aead_key,
 					options->aead_xform.aead.key.length);
@@ -2473,7 +2473,7 @@ initialize_cryptodevs(struct l2fwd_crypto_options *options, unsigned nb_ports,
 				/* No size provided, use minimum size. */
 				else
 					options->aad.length =
-						cap->sym.auth.aad_size.min;
+						cap->sym.auth.aad_size.minimum;
 			}
 
 			options->aead_xform.aead.aad_length =
@@ -2486,7 +2486,7 @@ initialize_cryptodevs(struct l2fwd_crypto_options *options, unsigned nb_ports,
 				/* No size provided, use minimum size. */
 			else
 				options->aead_xform.aead.digest_length =
-						cap->sym.aead.digest_size.min;
+					cap->sym.aead.digest_size.minimum;
 		}
 
 		/* Set cipher parameters */
@@ -2505,7 +2505,7 @@ initialize_cryptodevs(struct l2fwd_crypto_options *options, unsigned nb_ports,
 				/* No size provided, use minimum size. */
 				else
 					options->cipher_iv.length =
-						cap->sym.cipher.iv_size.min;
+						cap->sym.cipher.iv_size.minimum;
 			}
 
 			/* Set key if not provided from command line */
@@ -2516,7 +2516,7 @@ initialize_cryptodevs(struct l2fwd_crypto_options *options, unsigned nb_ports,
 				/* No size provided, use minimum size. */
 				else
 					options->cipher_xform.cipher.key.length =
-						cap->sym.cipher.key_size.min;
+						cap->sym.cipher.key_size.minimum;
 
 				generate_random_key(options->cipher_key,
 					options->cipher_xform.cipher.key.length);
@@ -2538,7 +2538,7 @@ initialize_cryptodevs(struct l2fwd_crypto_options *options, unsigned nb_ports,
 				/* No size provided, use minimum size. */
 				else
 					options->auth_iv.length =
-						cap->sym.auth.iv_size.min;
+						cap->sym.auth.iv_size.minimum;
 			}
 
 			/* Set key if not provided from command line */
@@ -2549,7 +2549,7 @@ initialize_cryptodevs(struct l2fwd_crypto_options *options, unsigned nb_ports,
 				/* No size provided, use minimum size. */
 				else
 					options->auth_xform.auth.key.length =
-						cap->sym.auth.key_size.min;
+						cap->sym.auth.key_size.minimum;
 
 				generate_random_key(options->auth_key,
 					options->auth_xform.auth.key.length);
@@ -2562,7 +2562,7 @@ initialize_cryptodevs(struct l2fwd_crypto_options *options, unsigned nb_ports,
 				/* No size provided, use minimum size. */
 			else
 				options->auth_xform.auth.digest_length =
-						cap->sym.auth.digest_size.min;
+						cap->sym.auth.digest_size.minimum;
 		}
 
 		retval = rte_cryptodev_configure(cdev_id, &conf);
diff --git a/lib/cryptodev/rte_cryptodev.c b/lib/cryptodev/rte_cryptodev.c
index 447aa9d519..9db1b86426 100644
--- a/lib/cryptodev/rte_cryptodev.c
+++ b/lib/cryptodev/rte_cryptodev.c
@@ -320,10 +320,10 @@ param_range_check(uint16_t size, const struct rte_crypto_param_range *range)
 	unsigned int next_size;
 
 	/* Check lower/upper bounds */
-	if (size < range->min)
+	if (size < range->minimum)
 		return -1;
 
-	if (size > range->max)
+	if (size > range->maximum)
 		return -1;
 
 	/* If range is actually only one value, size is correct */
@@ -331,7 +331,7 @@ param_range_check(uint16_t size, const struct rte_crypto_param_range *range)
 		return 0;
 
 	/* Check if value is one of the supported sizes */
-	for (next_size = range->min; next_size <= range->max;
+	for (next_size = range->minimum; next_size <= range->maximum;
 			next_size += range->increment)
 		if (size == next_size)
 			return 0;
@@ -429,13 +429,13 @@ rte_cryptodev_asym_xform_capability_check_modlen(
 	uint16_t modlen)
 {
 	/* no need to check for limits, if min or max = 0 */
-	if (capability->modlen.min != 0) {
-		if (modlen < capability->modlen.min)
+	if (capability->modlen.minimum != 0) {
+		if (modlen < capability->modlen.minimum)
 			return -1;
 	}
 
-	if (capability->modlen.max != 0) {
-		if (modlen > capability->modlen.max)
+	if (capability->modlen.maximum != 0) {
+		if (modlen > capability->modlen.maximum)
 			return -1;
 	}
 
diff --git a/lib/cryptodev/rte_cryptodev.h b/lib/cryptodev/rte_cryptodev.h
index 11f4e6fdbf..63ce4d0530 100644
--- a/lib/cryptodev/rte_cryptodev.h
+++ b/lib/cryptodev/rte_cryptodev.h
@@ -85,8 +85,8 @@ extern const char **rte_cyptodev_names;
  * Crypto parameters range description
  */
 struct rte_crypto_param_range {
-	uint16_t min;	/**< minimum size */
-	uint16_t max;	/**< maximum size */
+	uint16_t minimum;	/**< minimum size */
+	uint16_t maximum;	/**< maximum size */
 	uint16_t increment;
 	/**< if a range of sizes are supported,
 	 * this parameter is used to indicate
-- 
2.29.3


^ permalink raw reply	[relevance 1%]

* [dpdk-dev] [PATCH 5/5] net: rename Ethernet header fields
    2021-09-15 21:40  4% ` [dpdk-dev] [PATCH 1/5] compressdev: rename fields for Windows compatibility Dmitry Kozlyuk
  2021-09-15 21:40  1% ` [dpdk-dev] [PATCH 2/5] cryptodev: " Dmitry Kozlyuk
@ 2021-09-15 21:40  1% ` Dmitry Kozlyuk
  2 siblings, 0 replies; 200+ results
From: Dmitry Kozlyuk @ 2021-09-15 21:40 UTC (permalink / raw)
  To: dev
  Cc: Dmitry Kozlyuk, Ferruh Yigit, Narcisa Ana Maria Vasile,
	Olivier Matz, Pallavi Kadam, Ray Kinsella, Tyler Retzlaff

Definition of `rte_ether_addr` structure used a workaround allowing DPDK
and Windows SDK headers to be used in the same file, because Windows SDK
defines `s_addr` as a macro. Rename `s_addr` to `src_addr` and `d_addr`
to `dst_addr` to avoid the conflict and remove the workaround.
Deprecation notice:
https://mails.dpdk.org/archives/dev/2021-July/215270.html

Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
---
 app/test-pmd/5tswap.c                         |  6 +--
 app/test-pmd/csumonly.c                       |  4 +-
 app/test-pmd/flowgen.c                        |  4 +-
 app/test-pmd/icmpecho.c                       | 16 ++++----
 app/test-pmd/ieee1588fwd.c                    |  6 +--
 app/test-pmd/macfwd.c                         |  4 +-
 app/test-pmd/macswap.h                        |  4 +-
 app/test-pmd/txonly.c                         |  4 +-
 app/test-pmd/util.c                           |  4 +-
 app/test/packet_burst_generator.c             |  4 +-
 app/test/test_bpf.c                           |  4 +-
 app/test/test_link_bonding_mode4.c            | 15 +++----
 doc/guides/rel_notes/deprecation.rst          |  3 --
 doc/guides/rel_notes/release_20_11.rst        |  3 ++
 drivers/net/avp/avp_ethdev.c                  |  6 +--
 drivers/net/bnx2x/bnx2x.c                     | 16 ++++----
 drivers/net/bonding/rte_eth_bond_8023ad.c     |  6 +--
 drivers/net/bonding/rte_eth_bond_alb.c        |  4 +-
 drivers/net/bonding/rte_eth_bond_pmd.c        | 22 +++++-----
 drivers/net/enic/enic_flow.c                  |  8 ++--
 drivers/net/mlx5/mlx5_txpp.c                  |  4 +-
 examples/bond/main.c                          | 14 ++++---
 examples/ethtool/ethtool-app/main.c           |  4 +-
 examples/eventdev_pipeline/pipeline_common.h  |  4 +-
 examples/flow_filtering/main.c                |  4 +-
 examples/ioat/ioatfwd.c                       |  4 +-
 examples/ip_fragmentation/main.c              |  4 +-
 examples/ip_reassembly/main.c                 |  4 +-
 examples/ipsec-secgw/ipsec-secgw.c            |  4 +-
 examples/ipsec-secgw/ipsec_worker.c           |  4 +-
 examples/ipv4_multicast/main.c                |  4 +-
 examples/l2fwd-crypto/main.c                  |  4 +-
 examples/l2fwd-event/l2fwd_common.h           |  4 +-
 examples/l2fwd-jobstats/main.c                |  4 +-
 examples/l2fwd-keepalive/main.c               |  4 +-
 examples/l2fwd/main.c                         |  4 +-
 examples/l3fwd-acl/main.c                     | 19 +++++----
 examples/l3fwd-power/main.c                   |  6 +--
 examples/l3fwd/l3fwd_em.h                     |  4 +-
 examples/l3fwd/l3fwd_fib.c                    |  2 +-
 examples/l3fwd/l3fwd_lpm.c                    |  2 +-
 examples/l3fwd/l3fwd_lpm.h                    |  4 +-
 examples/link_status_interrupt/main.c         |  4 +-
 .../performance-thread/l3fwd-thread/main.c    | 40 +++++++++----------
 examples/ptpclient/ptpclient.c                | 16 ++++----
 examples/vhost/main.c                         | 10 ++---
 examples/vmdq/main.c                          |  4 +-
 examples/vmdq_dcb/main.c                      |  4 +-
 lib/ethdev/rte_flow.h                         |  4 +-
 lib/gro/gro_tcp4.c                            |  4 +-
 lib/gro/gro_udp4.c                            |  4 +-
 lib/gro/gro_vxlan_tcp4.c                      |  8 ++--
 lib/gro/gro_vxlan_udp4.c                      |  8 ++--
 lib/net/rte_arp.c                             |  4 +-
 lib/net/rte_ether.h                           | 22 +---------
 lib/pipeline/rte_table_action.c               | 40 +++++++++----------
 56 files changed, 207 insertions(+), 219 deletions(-)

diff --git a/app/test-pmd/5tswap.c b/app/test-pmd/5tswap.c
index e8cef9623b..629d3e0d31 100644
--- a/app/test-pmd/5tswap.c
+++ b/app/test-pmd/5tswap.c
@@ -27,9 +27,9 @@ swap_mac(struct rte_ether_hdr *eth_hdr)
 	struct rte_ether_addr addr;
 
 	/* Swap dest and src mac addresses. */
-	rte_ether_addr_copy(&eth_hdr->d_addr, &addr);
-	rte_ether_addr_copy(&eth_hdr->s_addr, &eth_hdr->d_addr);
-	rte_ether_addr_copy(&addr, &eth_hdr->s_addr);
+	rte_ether_addr_copy(&eth_hdr->dst_addr, &addr);
+	rte_ether_addr_copy(&eth_hdr->src_addr, &eth_hdr->dst_addr);
+	rte_ether_addr_copy(&addr, &eth_hdr->src_addr);
 }
 
 static inline void
diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c
index 38cc256533..090797318a 100644
--- a/app/test-pmd/csumonly.c
+++ b/app/test-pmd/csumonly.c
@@ -873,9 +873,9 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
 
 		eth_hdr = rte_pktmbuf_mtod(m, struct rte_ether_hdr *);
 		rte_ether_addr_copy(&peer_eth_addrs[fs->peer_addr],
-				&eth_hdr->d_addr);
+				&eth_hdr->dst_addr);
 		rte_ether_addr_copy(&ports[fs->tx_port].eth_addr,
-				&eth_hdr->s_addr);
+				&eth_hdr->src_addr);
 		parse_ethernet(eth_hdr, &info);
 		l3_hdr = (char *)eth_hdr + info.l2_len;
 
diff --git a/app/test-pmd/flowgen.c b/app/test-pmd/flowgen.c
index 9348618d0f..3f3378a444 100644
--- a/app/test-pmd/flowgen.c
+++ b/app/test-pmd/flowgen.c
@@ -123,8 +123,8 @@ pkt_burst_flow_gen(struct fwd_stream *fs)
 
 			/* Initialize Ethernet header. */
 			eth_hdr = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *);
-			rte_ether_addr_copy(&cfg_ether_dst, &eth_hdr->d_addr);
-			rte_ether_addr_copy(&cfg_ether_src, &eth_hdr->s_addr);
+			rte_ether_addr_copy(&cfg_ether_dst, &eth_hdr->dst_addr);
+			rte_ether_addr_copy(&cfg_ether_src, &eth_hdr->src_addr);
 			eth_hdr->ether_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV4);
 
 			/* Initialize IP header. */
diff --git a/app/test-pmd/icmpecho.c b/app/test-pmd/icmpecho.c
index 8948f28eb5..8f1d68a83a 100644
--- a/app/test-pmd/icmpecho.c
+++ b/app/test-pmd/icmpecho.c
@@ -319,8 +319,8 @@ reply_to_icmp_echo_rqsts(struct fwd_stream *fs)
 		if (verbose_level > 0) {
 			printf("\nPort %d pkt-len=%u nb-segs=%u\n",
 			       fs->rx_port, pkt->pkt_len, pkt->nb_segs);
-			ether_addr_dump("  ETH:  src=", &eth_h->s_addr);
-			ether_addr_dump(" dst=", &eth_h->d_addr);
+			ether_addr_dump("  ETH:  src=", &eth_h->src_addr);
+			ether_addr_dump(" dst=", &eth_h->dst_addr);
 		}
 		if (eth_type == RTE_ETHER_TYPE_VLAN) {
 			vlan_h = (struct rte_vlan_hdr *)
@@ -385,17 +385,17 @@ reply_to_icmp_echo_rqsts(struct fwd_stream *fs)
 			 */
 
 			/* Use source MAC address as destination MAC address. */
-			rte_ether_addr_copy(&eth_h->s_addr, &eth_h->d_addr);
+			rte_ether_addr_copy(&eth_h->src_addr, &eth_h->dst_addr);
 			/* Set source MAC address with MAC address of TX port */
 			rte_ether_addr_copy(&ports[fs->tx_port].eth_addr,
-					&eth_h->s_addr);
+					&eth_h->src_addr);
 
 			arp_h->arp_opcode = rte_cpu_to_be_16(RTE_ARP_OP_REPLY);
 			rte_ether_addr_copy(&arp_h->arp_data.arp_tha,
 					&eth_addr);
 			rte_ether_addr_copy(&arp_h->arp_data.arp_sha,
 					&arp_h->arp_data.arp_tha);
-			rte_ether_addr_copy(&eth_h->s_addr,
+			rte_ether_addr_copy(&eth_h->src_addr,
 					&arp_h->arp_data.arp_sha);
 
 			/* Swap IP addresses in ARP payload */
@@ -453,9 +453,9 @@ reply_to_icmp_echo_rqsts(struct fwd_stream *fs)
 		 * ICMP checksum is computed by assuming it is valid in the
 		 * echo request and not verified.
 		 */
-		rte_ether_addr_copy(&eth_h->s_addr, &eth_addr);
-		rte_ether_addr_copy(&eth_h->d_addr, &eth_h->s_addr);
-		rte_ether_addr_copy(&eth_addr, &eth_h->d_addr);
+		rte_ether_addr_copy(&eth_h->src_addr, &eth_addr);
+		rte_ether_addr_copy(&eth_h->dst_addr, &eth_h->src_addr);
+		rte_ether_addr_copy(&eth_addr, &eth_h->dst_addr);
 		ip_addr = ip_h->src_addr;
 		if (is_multicast_ipv4_addr(ip_h->dst_addr)) {
 			uint32_t ip_src;
diff --git a/app/test-pmd/ieee1588fwd.c b/app/test-pmd/ieee1588fwd.c
index 034f238c34..9cf10c1c50 100644
--- a/app/test-pmd/ieee1588fwd.c
+++ b/app/test-pmd/ieee1588fwd.c
@@ -178,9 +178,9 @@ ieee1588_packet_fwd(struct fwd_stream *fs)
 	port_ieee1588_rx_timestamp_check(fs->rx_port, timesync_index);
 
 	/* Swap dest and src mac addresses. */
-	rte_ether_addr_copy(&eth_hdr->d_addr, &addr);
-	rte_ether_addr_copy(&eth_hdr->s_addr, &eth_hdr->d_addr);
-	rte_ether_addr_copy(&addr, &eth_hdr->s_addr);
+	rte_ether_addr_copy(&eth_hdr->dst_addr, &addr);
+	rte_ether_addr_copy(&eth_hdr->src_addr, &eth_hdr->dst_addr);
+	rte_ether_addr_copy(&addr, &eth_hdr->src_addr);
 
 	/* Forward PTP packet with hardware TX timestamp */
 	mb->ol_flags |= PKT_TX_IEEE1588_TMST;
diff --git a/app/test-pmd/macfwd.c b/app/test-pmd/macfwd.c
index 0568ea794d..ee76df7f03 100644
--- a/app/test-pmd/macfwd.c
+++ b/app/test-pmd/macfwd.c
@@ -85,9 +85,9 @@ pkt_burst_mac_forward(struct fwd_stream *fs)
 		mb = pkts_burst[i];
 		eth_hdr = rte_pktmbuf_mtod(mb, struct rte_ether_hdr *);
 		rte_ether_addr_copy(&peer_eth_addrs[fs->peer_addr],
-				&eth_hdr->d_addr);
+				&eth_hdr->dst_addr);
 		rte_ether_addr_copy(&ports[fs->tx_port].eth_addr,
-				&eth_hdr->s_addr);
+				&eth_hdr->src_addr);
 		mb->ol_flags &= IND_ATTACHED_MBUF | EXT_ATTACHED_MBUF;
 		mb->ol_flags |= ol_flags;
 		mb->l2_len = sizeof(struct rte_ether_hdr);
diff --git a/app/test-pmd/macswap.h b/app/test-pmd/macswap.h
index 0138441566..20823b9b8c 100644
--- a/app/test-pmd/macswap.h
+++ b/app/test-pmd/macswap.h
@@ -30,8 +30,8 @@ do_macswap(struct rte_mbuf *pkts[], uint16_t nb,
 
 		/* Swap dest and src mac addresses. */
 		rte_ether_addr_copy(&eth_hdr->d_addr, &addr);
-		rte_ether_addr_copy(&eth_hdr->s_addr, &eth_hdr->d_addr);
-		rte_ether_addr_copy(&addr, &eth_hdr->s_addr);
+		rte_ether_addr_copy(&eth_hdr->src_addr, &eth_hdr->d_addr);
+		rte_ether_addr_copy(&addr, &eth_hdr->src_addr);
 
 		mbuf_field_set(mb, ol_flags);
 	}
diff --git a/app/test-pmd/txonly.c b/app/test-pmd/txonly.c
index aed820f5d3..40655801cc 100644
--- a/app/test-pmd/txonly.c
+++ b/app/test-pmd/txonly.c
@@ -362,8 +362,8 @@ pkt_burst_transmit(struct fwd_stream *fs)
 	/*
 	 * Initialize Ethernet header.
 	 */
-	rte_ether_addr_copy(&peer_eth_addrs[fs->peer_addr], &eth_hdr.d_addr);
-	rte_ether_addr_copy(&ports[fs->tx_port].eth_addr, &eth_hdr.s_addr);
+	rte_ether_addr_copy(&peer_eth_addrs[fs->peer_addr], &eth_hdr.dst_addr);
+	rte_ether_addr_copy(&ports[fs->tx_port].eth_addr, &eth_hdr.src_addr);
 	eth_hdr.ether_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV4);
 
 	if (rte_mempool_get_bulk(mbp, (void **)pkts_burst,
diff --git a/app/test-pmd/util.c b/app/test-pmd/util.c
index 14a9a251fb..51506e4940 100644
--- a/app/test-pmd/util.c
+++ b/app/test-pmd/util.c
@@ -142,9 +142,9 @@ dump_pkt_burst(uint16_t port_id, uint16_t queue, struct rte_mbuf *pkts[],
 					  " - no miss group");
 			MKDUMPSTR(print_buf, buf_size, cur_len, "\n");
 		}
-		print_ether_addr("  src=", &eth_hdr->s_addr,
+		print_ether_addr("  src=", &eth_hdr->src_addr,
 				 print_buf, buf_size, &cur_len);
-		print_ether_addr(" - dst=", &eth_hdr->d_addr,
+		print_ether_addr(" - dst=", &eth_hdr->dst_addr,
 				 print_buf, buf_size, &cur_len);
 		MKDUMPSTR(print_buf, buf_size, cur_len,
 			  " - type=0x%04x - length=%u - nb_segs=%d",
diff --git a/app/test/packet_burst_generator.c b/app/test/packet_burst_generator.c
index 0fd7290b0e..8ac24577ba 100644
--- a/app/test/packet_burst_generator.c
+++ b/app/test/packet_burst_generator.c
@@ -56,8 +56,8 @@ initialize_eth_header(struct rte_ether_hdr *eth_hdr,
 		struct rte_ether_addr *dst_mac, uint16_t ether_type,
 		uint8_t vlan_enabled, uint16_t van_id)
 {
-	rte_ether_addr_copy(dst_mac, &eth_hdr->d_addr);
-	rte_ether_addr_copy(src_mac, &eth_hdr->s_addr);
+	rte_ether_addr_copy(dst_mac, &eth_hdr->dst_addr);
+	rte_ether_addr_copy(src_mac, &eth_hdr->src_addr);
 
 	if (vlan_enabled) {
 		struct rte_vlan_hdr *vhdr = (struct rte_vlan_hdr *)(
diff --git a/app/test/test_bpf.c b/app/test/test_bpf.c
index 527c06b807..8118a1849b 100644
--- a/app/test/test_bpf.c
+++ b/app/test/test_bpf.c
@@ -1008,9 +1008,9 @@ test_jump2_prepare(void *arg)
 	 * Initialize ether header.
 	 */
 	rte_ether_addr_copy((struct rte_ether_addr *)dst_mac,
-			    &dn->eth_hdr.d_addr);
+			    &dn->eth_hdr.dst_addr);
 	rte_ether_addr_copy((struct rte_ether_addr *)src_mac,
-			    &dn->eth_hdr.s_addr);
+			    &dn->eth_hdr.src_addr);
 	dn->eth_hdr.ether_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_VLAN);
 
 	/*
diff --git a/app/test/test_link_bonding_mode4.c b/app/test/test_link_bonding_mode4.c
index 2c835fa7ad..f120b2e3be 100644
--- a/app/test/test_link_bonding_mode4.c
+++ b/app/test/test_link_bonding_mode4.c
@@ -502,8 +502,8 @@ make_lacp_reply(struct slave_conf *slave, struct rte_mbuf *pkt)
 	slow_hdr = rte_pktmbuf_mtod(pkt, struct slow_protocol_frame *);
 
 	/* Change source address to partner address */
-	rte_ether_addr_copy(&parnter_mac_default, &slow_hdr->eth_hdr.s_addr);
-	slow_hdr->eth_hdr.s_addr.addr_bytes[RTE_ETHER_ADDR_LEN - 1] =
+	rte_ether_addr_copy(&parnter_mac_default, &slow_hdr->eth_hdr.src_addr);
+	slow_hdr->eth_hdr.src_addr.addr_bytes[RTE_ETHER_ADDR_LEN - 1] =
 		slave->port_id;
 
 	lacp = (struct lacpdu *) &slow_hdr->slow_protocol;
@@ -870,7 +870,7 @@ test_mode4_rx(void)
 
 		for (i = 0; i < expected_pkts_cnt; i++) {
 			hdr = rte_pktmbuf_mtod(pkts[i], struct rte_ether_hdr *);
-			cnt[rte_is_same_ether_addr(&hdr->d_addr,
+			cnt[rte_is_same_ether_addr(&hdr->dst_addr,
 							&bonded_mac)]++;
 		}
 
@@ -918,7 +918,7 @@ test_mode4_rx(void)
 
 		for (i = 0; i < expected_pkts_cnt; i++) {
 			hdr = rte_pktmbuf_mtod(pkts[i], struct rte_ether_hdr *);
-			eq_cnt += rte_is_same_ether_addr(&hdr->d_addr,
+			eq_cnt += rte_is_same_ether_addr(&hdr->dst_addr,
 							&bonded_mac);
 		}
 
@@ -1163,11 +1163,12 @@ init_marker(struct rte_mbuf *pkt, struct slave_conf *slave)
 
 	/* Copy multicast destination address */
 	rte_ether_addr_copy(&slow_protocol_mac_addr,
-			&marker_hdr->eth_hdr.d_addr);
+			&marker_hdr->eth_hdr.dst_addr);
 
 	/* Init source address */
-	rte_ether_addr_copy(&parnter_mac_default, &marker_hdr->eth_hdr.s_addr);
-	marker_hdr->eth_hdr.s_addr.addr_bytes[RTE_ETHER_ADDR_LEN - 1] =
+	rte_ether_addr_copy(&parnter_mac_default,
+			&marker_hdr->eth_hdr.src_addr);
+	marker_hdr->eth_hdr.src_addr.addr_bytes[RTE_ETHER_ADDR_LEN - 1] =
 		slave->port_id;
 
 	marker_hdr->eth_hdr.ether_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_SLOW);
diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index 6d48155b35..3ae713edae 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -172,9 +172,6 @@ Deprecation Notices
   can still be used if users specify the devarg "driver=i40evf". I40evf will
   be deleted in DPDK 21.11.
 
-* net: ``s_addr`` and ``d_addr`` fields of ``rte_ether_hdr`` structure
-  will be renamed in DPDK 21.11 to avoid conflict with Windows Sockets headers.
-
 * net: The structure ``rte_ipv4_hdr`` will have two unions.
   The first union is for existing ``version_ihl`` byte
   and new bitfield for version and IHL.
diff --git a/doc/guides/rel_notes/release_20_11.rst b/doc/guides/rel_notes/release_20_11.rst
index 3eb30f855c..51e85a7279 100644
--- a/doc/guides/rel_notes/release_20_11.rst
+++ b/doc/guides/rel_notes/release_20_11.rst
@@ -668,6 +668,9 @@ API Changes
 * cryptodev: Renamed ``min`` and ``max`` fields of ``rte_crypto_param_range``
   structure to ``minimum`` and ``maximum``, respectively.
 
+* net: Renamed ``s_addr`` and ``d_addr`` fields of ``rte_ether_hdr`` structure
+  to ``src_addr`` and ``dst_addr``, respectively.
+
 
 ABI Changes
 -----------
diff --git a/drivers/net/avp/avp_ethdev.c b/drivers/net/avp/avp_ethdev.c
index 623fa5e5ff..b5fafd32b0 100644
--- a/drivers/net/avp/avp_ethdev.c
+++ b/drivers/net/avp/avp_ethdev.c
@@ -1205,17 +1205,17 @@ _avp_mac_filter(struct avp_dev *avp, struct rte_mbuf *m)
 {
 	struct rte_ether_hdr *eth = rte_pktmbuf_mtod(m, struct rte_ether_hdr *);
 
-	if (likely(_avp_cmp_ether_addr(&avp->ethaddr, &eth->d_addr) == 0)) {
+	if (likely(_avp_cmp_ether_addr(&avp->ethaddr, &eth->dst_addr) == 0)) {
 		/* allow all packets destined to our address */
 		return 0;
 	}
 
-	if (likely(rte_is_broadcast_ether_addr(&eth->d_addr))) {
+	if (likely(rte_is_broadcast_ether_addr(&eth->dst_addr))) {
 		/* allow all broadcast packets */
 		return 0;
 	}
 
-	if (likely(rte_is_multicast_ether_addr(&eth->d_addr))) {
+	if (likely(rte_is_multicast_ether_addr(&eth->dst_addr))) {
 		/* allow all multicast packets */
 		return 0;
 	}
diff --git a/drivers/net/bnx2x/bnx2x.c b/drivers/net/bnx2x/bnx2x.c
index 7ee805bd0d..2d0403e593 100644
--- a/drivers/net/bnx2x/bnx2x.c
+++ b/drivers/net/bnx2x/bnx2x.c
@@ -2233,8 +2233,8 @@ int bnx2x_tx_encap(struct bnx2x_tx_queue *txq, struct rte_mbuf *m0)
 
 		tx_parse_bd =
 		    &txq->tx_ring[TX_BD(bd_prod, txq)].parse_bd_e2;
-		if (rte_is_multicast_ether_addr(&eh->d_addr)) {
-			if (rte_is_broadcast_ether_addr(&eh->d_addr))
+		if (rte_is_multicast_ether_addr(&eh->dst_addr)) {
+			if (rte_is_broadcast_ether_addr(&eh->dst_addr))
 				mac_type = BROADCAST_ADDRESS;
 			else
 				mac_type = MULTICAST_ADDRESS;
@@ -2243,17 +2243,17 @@ int bnx2x_tx_encap(struct bnx2x_tx_queue *txq, struct rte_mbuf *m0)
 		    (mac_type << ETH_TX_PARSE_BD_E2_ETH_ADDR_TYPE_SHIFT);
 
 		rte_memcpy(&tx_parse_bd->data.mac_addr.dst_hi,
-			   &eh->d_addr.addr_bytes[0], 2);
+			   &eh->dst_addr.addr_bytes[0], 2);
 		rte_memcpy(&tx_parse_bd->data.mac_addr.dst_mid,
-			   &eh->d_addr.addr_bytes[2], 2);
+			   &eh->dst_addr.addr_bytes[2], 2);
 		rte_memcpy(&tx_parse_bd->data.mac_addr.dst_lo,
-			   &eh->d_addr.addr_bytes[4], 2);
+			   &eh->dst_addr.addr_bytes[4], 2);
 		rte_memcpy(&tx_parse_bd->data.mac_addr.src_hi,
-			   &eh->s_addr.addr_bytes[0], 2);
+			   &eh->src_addr.addr_bytes[0], 2);
 		rte_memcpy(&tx_parse_bd->data.mac_addr.src_mid,
-			   &eh->s_addr.addr_bytes[2], 2);
+			   &eh->src_addr.addr_bytes[2], 2);
 		rte_memcpy(&tx_parse_bd->data.mac_addr.src_lo,
-			   &eh->s_addr.addr_bytes[4], 2);
+			   &eh->src_addr.addr_bytes[4], 2);
 
 		tx_parse_bd->data.mac_addr.dst_hi =
 		    rte_cpu_to_be_16(tx_parse_bd->data.mac_addr.dst_hi);
diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c b/drivers/net/bonding/rte_eth_bond_8023ad.c
index 128754f459..ce911f0f90 100644
--- a/drivers/net/bonding/rte_eth_bond_8023ad.c
+++ b/drivers/net/bonding/rte_eth_bond_8023ad.c
@@ -587,8 +587,8 @@ tx_machine(struct bond_dev_private *internals, uint16_t slave_id)
 	hdr = rte_pktmbuf_mtod(lacp_pkt, struct lacpdu_header *);
 
 	/* Source and destination MAC */
-	rte_ether_addr_copy(&lacp_mac_addr, &hdr->eth_hdr.d_addr);
-	rte_eth_macaddr_get(slave_id, &hdr->eth_hdr.s_addr);
+	rte_ether_addr_copy(&lacp_mac_addr, &hdr->eth_hdr.dst_addr);
+	rte_eth_macaddr_get(slave_id, &hdr->eth_hdr.src_addr);
 	hdr->eth_hdr.ether_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_SLOW);
 
 	lacpdu = &hdr->lacpdu;
@@ -1346,7 +1346,7 @@ bond_mode_8023ad_handle_slow_pkt(struct bond_dev_private *internals,
 		} while (unlikely(retval == 0));
 
 		m_hdr->marker.tlv_type_marker = MARKER_TLV_TYPE_RESP;
-		rte_eth_macaddr_get(slave_id, &m_hdr->eth_hdr.s_addr);
+		rte_eth_macaddr_get(slave_id, &m_hdr->eth_hdr.src_addr);
 
 		if (internals->mode4.dedicated_queues.enabled == 0) {
 			if (rte_ring_enqueue(port->tx_ring, pkt) != 0) {
diff --git a/drivers/net/bonding/rte_eth_bond_alb.c b/drivers/net/bonding/rte_eth_bond_alb.c
index 1d36a4a4a2..86335a7971 100644
--- a/drivers/net/bonding/rte_eth_bond_alb.c
+++ b/drivers/net/bonding/rte_eth_bond_alb.c
@@ -213,8 +213,8 @@ bond_mode_alb_arp_upd(struct client_data *client_info,
 	rte_spinlock_lock(&internals->mode6.lock);
 	eth_h = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *);
 
-	rte_ether_addr_copy(&client_info->app_mac, &eth_h->s_addr);
-	rte_ether_addr_copy(&client_info->cli_mac, &eth_h->d_addr);
+	rte_ether_addr_copy(&client_info->app_mac, &eth_h->src_addr);
+	rte_ether_addr_copy(&client_info->cli_mac, &eth_h->dst_addr);
 	if (client_info->vlan_count > 0)
 		eth_h->ether_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_VLAN);
 	else
diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index a6755661c4..b7f9cfcfa3 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -342,11 +342,11 @@ rx_burst_8023ad(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts,
 						 bufs[j])) ||
 				!collecting ||
 				(!promisc &&
-				 ((rte_is_unicast_ether_addr(&hdr->d_addr) &&
+				 ((rte_is_unicast_ether_addr(&hdr->dst_addr) &&
 				   !rte_is_same_ether_addr(bond_mac,
-						       &hdr->d_addr)) ||
+						       &hdr->dst_addr)) ||
 				  (!allmulti &&
-				   rte_is_multicast_ether_addr(&hdr->d_addr)))))) {
+				   rte_is_multicast_ether_addr(&hdr->dst_addr)))))) {
 
 				if (hdr->ether_type == ether_type_slow_be) {
 					bond_mode_8023ad_handle_slow_pkt(
@@ -477,9 +477,9 @@ update_client_stats(uint32_t addr, uint16_t port, uint32_t *TXorRXindicator)
 		"DstMAC:%02X:%02X:%02X:%02X:%02X:%02X DstIP:%s %s %d\n", \
 		info,							\
 		port,							\
-		eth_h->s_addr.addr_bytes[0], eth_h->s_addr.addr_bytes[1], \
-		eth_h->s_addr.addr_bytes[2], eth_h->s_addr.addr_bytes[3], \
-		eth_h->s_addr.addr_bytes[4], eth_h->s_addr.addr_bytes[5], \
+		eth_h->src_addr.addr_bytes[0], eth_h->src_addr.addr_bytes[1], \
+		eth_h->src_addr.addr_bytes[2], eth_h->src_addr.addr_bytes[3], \
+		eth_h->src_addr.addr_bytes[4], eth_h->src_addr.addr_bytes[5], \
 		src_ip,							\
 		eth_h->d_addr.addr_bytes[0], eth_h->d_addr.addr_bytes[1], \
 		eth_h->d_addr.addr_bytes[2], eth_h->d_addr.addr_bytes[3], \
@@ -647,9 +647,9 @@ static inline uint16_t
 ether_hash(struct rte_ether_hdr *eth_hdr)
 {
 	unaligned_uint16_t *word_src_addr =
-		(unaligned_uint16_t *)eth_hdr->s_addr.addr_bytes;
+		(unaligned_uint16_t *)eth_hdr->src_addr.addr_bytes;
 	unaligned_uint16_t *word_dst_addr =
-		(unaligned_uint16_t *)eth_hdr->d_addr.addr_bytes;
+		(unaligned_uint16_t *)eth_hdr->dst_addr.addr_bytes;
 
 	return (word_src_addr[0] ^ word_dst_addr[0]) ^
 			(word_src_addr[1] ^ word_dst_addr[1]) ^
@@ -946,10 +946,10 @@ bond_ethdev_tx_burst_tlb(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 
 			ether_hdr = rte_pktmbuf_mtod(bufs[j],
 						struct rte_ether_hdr *);
-			if (rte_is_same_ether_addr(&ether_hdr->s_addr,
+			if (rte_is_same_ether_addr(&ether_hdr->src_addr,
 							&primary_slave_addr))
 				rte_ether_addr_copy(&active_slave_addr,
-						&ether_hdr->s_addr);
+						&ether_hdr->src_addr);
 #if defined(RTE_LIBRTE_BOND_DEBUG_ALB) || defined(RTE_LIBRTE_BOND_DEBUG_ALB_L1)
 					mode6_debug("TX IPv4:", ether_hdr, slaves[i], &burstnumberTX);
 #endif
@@ -1021,7 +1021,7 @@ bond_ethdev_tx_burst_alb(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 			slave_idx = bond_mode_alb_arp_xmit(eth_h, offset, internals);
 
 			/* Change src mac in eth header */
-			rte_eth_macaddr_get(slave_idx, &eth_h->s_addr);
+			rte_eth_macaddr_get(slave_idx, &eth_h->src_addr);
 
 			/* Add packet to slave tx buffer */
 			slave_bufs[slave_idx][slave_bufs_pkts[slave_idx]] = bufs[i];
diff --git a/drivers/net/enic/enic_flow.c b/drivers/net/enic/enic_flow.c
index cdfdc904a6..33147169ba 100644
--- a/drivers/net/enic/enic_flow.c
+++ b/drivers/net/enic/enic_flow.c
@@ -656,14 +656,14 @@ enic_copy_item_eth_v2(struct copy_item_args *arg)
 	if (!mask)
 		mask = &rte_flow_item_eth_mask;
 
-	memcpy(enic_spec.d_addr.addr_bytes, spec->dst.addr_bytes,
+	memcpy(enic_spec.dst_addr.addr_bytes, spec->dst.addr_bytes,
 	       RTE_ETHER_ADDR_LEN);
-	memcpy(enic_spec.s_addr.addr_bytes, spec->src.addr_bytes,
+	memcpy(enic_spec.src_addr.addr_bytes, spec->src.addr_bytes,
 	       RTE_ETHER_ADDR_LEN);
 
-	memcpy(enic_mask.d_addr.addr_bytes, mask->dst.addr_bytes,
+	memcpy(enic_mask.dst_addr.addr_bytes, mask->dst.addr_bytes,
 	       RTE_ETHER_ADDR_LEN);
-	memcpy(enic_mask.s_addr.addr_bytes, mask->src.addr_bytes,
+	memcpy(enic_mask.src_addr.addr_bytes, mask->src.addr_bytes,
 	       RTE_ETHER_ADDR_LEN);
 	enic_spec.ether_type = spec->type;
 	enic_mask.ether_type = mask->type;
diff --git a/drivers/net/mlx5/mlx5_txpp.c b/drivers/net/mlx5/mlx5_txpp.c
index 4f6da9f2d1..2be7e71f89 100644
--- a/drivers/net/mlx5/mlx5_txpp.c
+++ b/drivers/net/mlx5/mlx5_txpp.c
@@ -333,8 +333,8 @@ mlx5_txpp_fill_wqe_clock_queue(struct mlx5_dev_ctx_shared *sh)
 		/* Build test packet L2 header (Ethernet). */
 		dst = (uint8_t *)&es->inline_data;
 		eth_hdr = (struct rte_ether_hdr *)dst;
-		rte_eth_random_addr(&eth_hdr->d_addr.addr_bytes[0]);
-		rte_eth_random_addr(&eth_hdr->s_addr.addr_bytes[0]);
+		rte_eth_random_addr(&eth_hdr->dst_addr.addr_bytes[0]);
+		rte_eth_random_addr(&eth_hdr->src_addr.addr_bytes[0]);
 		eth_hdr->ether_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV4);
 		/* Build test packet L3 header (IP v4). */
 		dst += sizeof(struct rte_ether_hdr);
diff --git a/examples/bond/main.c b/examples/bond/main.c
index f48400e211..c51892b6f0 100644
--- a/examples/bond/main.c
+++ b/examples/bond/main.c
@@ -423,8 +423,8 @@ static int lcore_main(__rte_unused void *arg1)
 					if (arp_hdr->arp_opcode == rte_cpu_to_be_16(RTE_ARP_OP_REQUEST)) {
 						arp_hdr->arp_opcode = rte_cpu_to_be_16(RTE_ARP_OP_REPLY);
 						/* Switch src and dst data and set bonding MAC */
-						rte_ether_addr_copy(&eth_hdr->s_addr, &eth_hdr->d_addr);
-						rte_ether_addr_copy(&bond_mac_addr, &eth_hdr->s_addr);
+						rte_ether_addr_copy(&eth_hdr->src_addr, &eth_hdr->dst_addr);
+						rte_ether_addr_copy(&bond_mac_addr, &eth_hdr->src_addr);
 						rte_ether_addr_copy(&arp_hdr->arp_data.arp_sha,
 								&arp_hdr->arp_data.arp_tha);
 						arp_hdr->arp_data.arp_tip = arp_hdr->arp_data.arp_sip;
@@ -444,8 +444,10 @@ static int lcore_main(__rte_unused void *arg1)
 				 }
 				ipv4_hdr = (struct rte_ipv4_hdr *)((char *)(eth_hdr + 1) + offset);
 				if (ipv4_hdr->dst_addr == bond_ip) {
-					rte_ether_addr_copy(&eth_hdr->s_addr, &eth_hdr->d_addr);
-					rte_ether_addr_copy(&bond_mac_addr, &eth_hdr->s_addr);
+					rte_ether_addr_copy(&eth_hdr->src_addr,
+							&eth_hdr->dst_addr);
+					rte_ether_addr_copy(&bond_mac_addr,
+							&eth_hdr->src_addr);
 					ipv4_hdr->dst_addr = ipv4_hdr->src_addr;
 					ipv4_hdr->src_addr = bond_ip;
 					rte_eth_tx_burst(BOND_PORT, 0, &pkts[i], 1);
@@ -520,8 +522,8 @@ static void cmd_obj_send_parsed(void *parsed_result,
 	created_pkt->pkt_len = pkt_size;
 
 	eth_hdr = rte_pktmbuf_mtod(created_pkt, struct rte_ether_hdr *);
-	rte_ether_addr_copy(&bond_mac_addr, &eth_hdr->s_addr);
-	memset(&eth_hdr->d_addr, 0xFF, RTE_ETHER_ADDR_LEN);
+	rte_ether_addr_copy(&bond_mac_addr, &eth_hdr->src_addr);
+	memset(&eth_hdr->dst_addr, 0xFF, RTE_ETHER_ADDR_LEN);
 	eth_hdr->ether_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_ARP);
 
 	arp_hdr = (struct rte_arp_hdr *)(
diff --git a/examples/ethtool/ethtool-app/main.c b/examples/ethtool/ethtool-app/main.c
index 21ed85c7d6..1bc675962b 100644
--- a/examples/ethtool/ethtool-app/main.c
+++ b/examples/ethtool/ethtool-app/main.c
@@ -172,8 +172,8 @@ static void process_frame(struct app_port *ptr_port,
 	struct rte_ether_hdr *ptr_mac_hdr;
 
 	ptr_mac_hdr = rte_pktmbuf_mtod(ptr_frame, struct rte_ether_hdr *);
-	rte_ether_addr_copy(&ptr_mac_hdr->s_addr, &ptr_mac_hdr->d_addr);
-	rte_ether_addr_copy(&ptr_port->mac_addr, &ptr_mac_hdr->s_addr);
+	rte_ether_addr_copy(&ptr_mac_hdr->src_addr, &ptr_mac_hdr->dst_addr);
+	rte_ether_addr_copy(&ptr_port->mac_addr, &ptr_mac_hdr->src_addr);
 }
 
 static int worker_main(__rte_unused void *ptr_data)
diff --git a/examples/eventdev_pipeline/pipeline_common.h b/examples/eventdev_pipeline/pipeline_common.h
index 6a4287602e..b12eb281e1 100644
--- a/examples/eventdev_pipeline/pipeline_common.h
+++ b/examples/eventdev_pipeline/pipeline_common.h
@@ -104,8 +104,8 @@ exchange_mac(struct rte_mbuf *m)
 
 	/* change mac addresses on packet (to use mbuf data) */
 	eth = rte_pktmbuf_mtod(m, struct rte_ether_hdr *);
-	rte_ether_addr_copy(&eth->d_addr, &addr);
-	rte_ether_addr_copy(&addr, &eth->d_addr);
+	rte_ether_addr_copy(&eth->dst_addr, &addr);
+	rte_ether_addr_copy(&addr, &eth->dst_addr);
 }
 
 static __rte_always_inline void
diff --git a/examples/flow_filtering/main.c b/examples/flow_filtering/main.c
index 29fb4b3d55..dd8a33d036 100644
--- a/examples/flow_filtering/main.c
+++ b/examples/flow_filtering/main.c
@@ -75,9 +75,9 @@ main_loop(void)
 					eth_hdr = rte_pktmbuf_mtod(m,
 							struct rte_ether_hdr *);
 					print_ether_addr("src=",
-							&eth_hdr->s_addr);
+							&eth_hdr->src_addr);
 					print_ether_addr(" - dst=",
-							&eth_hdr->d_addr);
+							&eth_hdr->dst_addr);
 					printf(" - queue=0x%x",
 							(unsigned int)i);
 					printf("\n");
diff --git a/examples/ioat/ioatfwd.c b/examples/ioat/ioatfwd.c
index 0c413180f8..7824247d69 100644
--- a/examples/ioat/ioatfwd.c
+++ b/examples/ioat/ioatfwd.c
@@ -322,11 +322,11 @@ update_mac_addrs(struct rte_mbuf *m, uint32_t dest_portid)
 	/* 02:00:00:00:00:xx - overwriting 2 bytes of source address but
 	 * it's acceptable cause it gets overwritten by rte_ether_addr_copy
 	 */
-	tmp = &eth->d_addr.addr_bytes[0];
+	tmp = &eth->dst_addr.addr_bytes[0];
 	*((uint64_t *)tmp) = 0x000000000002 + ((uint64_t)dest_portid << 40);
 
 	/* src addr */
-	rte_ether_addr_copy(&ioat_ports_eth_addr[dest_portid], &eth->s_addr);
+	rte_ether_addr_copy(&ioat_ports_eth_addr[dest_portid], &eth->src_addr);
 }
 
 /* Perform packet copy there is a user-defined function. 8< */
diff --git a/examples/ip_fragmentation/main.c b/examples/ip_fragmentation/main.c
index f245369720..a7f40970f2 100644
--- a/examples/ip_fragmentation/main.c
+++ b/examples/ip_fragmentation/main.c
@@ -362,13 +362,13 @@ l3fwd_simple_forward(struct rte_mbuf *m, struct lcore_queue_conf *qconf,
 		m->l2_len = sizeof(struct rte_ether_hdr);
 
 		/* 02:00:00:00:00:xx */
-		d_addr_bytes = &eth_hdr->d_addr.addr_bytes[0];
+		d_addr_bytes = &eth_hdr->dst_addr.addr_bytes[0];
 		*((uint64_t *)d_addr_bytes) = 0x000000000002 +
 			((uint64_t)port_out << 40);
 
 		/* src addr */
 		rte_ether_addr_copy(&ports_eth_addr[port_out],
-				&eth_hdr->s_addr);
+				&eth_hdr->src_addr);
 		eth_hdr->ether_type = ether_type;
 	}
 
diff --git a/examples/ip_reassembly/main.c b/examples/ip_reassembly/main.c
index 8645ac790b..d611c7d016 100644
--- a/examples/ip_reassembly/main.c
+++ b/examples/ip_reassembly/main.c
@@ -413,11 +413,11 @@ reassemble(struct rte_mbuf *m, uint16_t portid, uint32_t queue,
 	/* if packet wasn't IPv4 or IPv6, it's forwarded to the port it came from */
 
 	/* 02:00:00:00:00:xx */
-	d_addr_bytes = &eth_hdr->d_addr.addr_bytes[0];
+	d_addr_bytes = &eth_hdr->dst_addr.addr_bytes[0];
 	*((uint64_t *)d_addr_bytes) = 0x000000000002 + ((uint64_t)dst_port << 40);
 
 	/* src addr */
-	rte_ether_addr_copy(&ports_eth_addr[dst_port], &eth_hdr->s_addr);
+	rte_ether_addr_copy(&ports_eth_addr[dst_port], &eth_hdr->src_addr);
 
 	send_single_packet(m, dst_port);
 }
diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c
index f252d34985..61987c513e 100644
--- a/examples/ipsec-secgw/ipsec-secgw.c
+++ b/examples/ipsec-secgw/ipsec-secgw.c
@@ -545,9 +545,9 @@ prepare_tx_pkt(struct rte_mbuf *pkt, uint16_t port,
 		ethhdr->ether_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV6);
 	}
 
-	memcpy(&ethhdr->s_addr, &ethaddr_tbl[port].src,
+	memcpy(&ethhdr->src_addr, &ethaddr_tbl[port].src,
 			sizeof(struct rte_ether_addr));
-	memcpy(&ethhdr->d_addr, &ethaddr_tbl[port].dst,
+	memcpy(&ethhdr->dst_addr, &ethaddr_tbl[port].dst,
 			sizeof(struct rte_ether_addr));
 }
 
diff --git a/examples/ipsec-secgw/ipsec_worker.c b/examples/ipsec-secgw/ipsec_worker.c
index 647e22df59..996b0acd03 100644
--- a/examples/ipsec-secgw/ipsec_worker.c
+++ b/examples/ipsec-secgw/ipsec_worker.c
@@ -44,8 +44,8 @@ update_mac_addrs(struct rte_mbuf *pkt, uint16_t portid)
 	struct rte_ether_hdr *ethhdr;
 
 	ethhdr = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *);
-	memcpy(&ethhdr->s_addr, &ethaddr_tbl[portid].src, RTE_ETHER_ADDR_LEN);
-	memcpy(&ethhdr->d_addr, &ethaddr_tbl[portid].dst, RTE_ETHER_ADDR_LEN);
+	memcpy(&ethhdr->src_addr, &ethaddr_tbl[portid].src, RTE_ETHER_ADDR_LEN);
+	memcpy(&ethhdr->dst_addr, &ethaddr_tbl[portid].dst, RTE_ETHER_ADDR_LEN);
 }
 
 static inline void
diff --git a/examples/ipv4_multicast/main.c b/examples/ipv4_multicast/main.c
index cc527d7f6b..d10de30ddb 100644
--- a/examples/ipv4_multicast/main.c
+++ b/examples/ipv4_multicast/main.c
@@ -283,8 +283,8 @@ mcast_send_pkt(struct rte_mbuf *pkt, struct rte_ether_addr *dest_addr,
 		rte_pktmbuf_prepend(pkt, (uint16_t)sizeof(*ethdr));
 	RTE_ASSERT(ethdr != NULL);
 
-	rte_ether_addr_copy(dest_addr, &ethdr->d_addr);
-	rte_ether_addr_copy(&ports_eth_addr[port], &ethdr->s_addr);
+	rte_ether_addr_copy(dest_addr, &ethdr->dst_addr);
+	rte_ether_addr_copy(&ports_eth_addr[port], &ethdr->src_addr);
 	ethdr->ether_type = rte_be_to_cpu_16(RTE_ETHER_TYPE_IPV4);
 
 	/* Put new packet into the output queue */
diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c
index b6bc371bd2..96636e84ce 100644
--- a/examples/l2fwd-crypto/main.c
+++ b/examples/l2fwd-crypto/main.c
@@ -617,11 +617,11 @@ l2fwd_mac_updating(struct rte_mbuf *m, uint16_t dest_portid)
 	eth = rte_pktmbuf_mtod(m, struct rte_ether_hdr *);
 
 	/* 02:00:00:00:00:xx */
-	tmp = &eth->d_addr.addr_bytes[0];
+	tmp = &eth->dst_addr.addr_bytes[0];
 	*((uint64_t *)tmp) = 0x000000000002 + ((uint64_t)dest_portid << 40);
 
 	/* src addr */
-	rte_ether_addr_copy(&l2fwd_ports_eth_addr[dest_portid], &eth->s_addr);
+	rte_ether_addr_copy(&l2fwd_ports_eth_addr[dest_portid], &eth->src_addr);
 }
 
 static void
diff --git a/examples/l2fwd-event/l2fwd_common.h b/examples/l2fwd-event/l2fwd_common.h
index 939221d45a..cecbd9b70e 100644
--- a/examples/l2fwd-event/l2fwd_common.h
+++ b/examples/l2fwd-event/l2fwd_common.h
@@ -92,11 +92,11 @@ l2fwd_mac_updating(struct rte_mbuf *m, uint32_t dest_port_id,
 	eth = rte_pktmbuf_mtod(m, struct rte_ether_hdr *);
 
 	/* 02:00:00:00:00:xx */
-	tmp = &eth->d_addr.addr_bytes[0];
+	tmp = &eth->dst_addr.addr_bytes[0];
 	*((uint64_t *)tmp) = 0x000000000002 + ((uint64_t)dest_port_id << 40);
 
 	/* src addr */
-	rte_ether_addr_copy(addr, &eth->s_addr);
+	rte_ether_addr_copy(addr, &eth->src_addr);
 }
 
 static __rte_always_inline struct l2fwd_resources *
diff --git a/examples/l2fwd-jobstats/main.c b/examples/l2fwd-jobstats/main.c
index bbb4a27a6d..117e06d712 100644
--- a/examples/l2fwd-jobstats/main.c
+++ b/examples/l2fwd-jobstats/main.c
@@ -351,11 +351,11 @@ l2fwd_simple_forward(struct rte_mbuf *m, unsigned portid)
 	eth = rte_pktmbuf_mtod(m, struct rte_ether_hdr *);
 
 	/* 02:00:00:00:00:xx */
-	tmp = &eth->d_addr.addr_bytes[0];
+	tmp = &eth->dst_addr.addr_bytes[0];
 	*((uint64_t *)tmp) = 0x000000000002 + ((uint64_t)dst_port << 40);
 
 	/* src addr */
-	rte_ether_addr_copy(&l2fwd_ports_eth_addr[dst_port], &eth->s_addr);
+	rte_ether_addr_copy(&l2fwd_ports_eth_addr[dst_port], &eth->src_addr);
 
 	buffer = tx_buffer[dst_port];
 	sent = rte_eth_tx_buffer(dst_port, 0, buffer, m);
diff --git a/examples/l2fwd-keepalive/main.c b/examples/l2fwd-keepalive/main.c
index 4e1a17cfe4..efdfa4d89c 100644
--- a/examples/l2fwd-keepalive/main.c
+++ b/examples/l2fwd-keepalive/main.c
@@ -177,11 +177,11 @@ l2fwd_simple_forward(struct rte_mbuf *m, unsigned portid)
 	eth = rte_pktmbuf_mtod(m, struct rte_ether_hdr *);
 
 	/* 02:00:00:00:00:xx */
-	tmp = &eth->d_addr.addr_bytes[0];
+	tmp = &eth->dst_addr.addr_bytes[0];
 	*((uint64_t *)tmp) = 0x000000000002 + ((uint64_t)dst_port << 40);
 
 	/* src addr */
-	rte_ether_addr_copy(&l2fwd_ports_eth_addr[dst_port], &eth->s_addr);
+	rte_ether_addr_copy(&l2fwd_ports_eth_addr[dst_port], &eth->src_addr);
 
 	buffer = tx_buffer[dst_port];
 	sent = rte_eth_tx_buffer(dst_port, 0, buffer, m);
diff --git a/examples/l2fwd/main.c b/examples/l2fwd/main.c
index 911e40c66e..48c2a3da12 100644
--- a/examples/l2fwd/main.c
+++ b/examples/l2fwd/main.c
@@ -170,11 +170,11 @@ l2fwd_mac_updating(struct rte_mbuf *m, unsigned dest_portid)
 	eth = rte_pktmbuf_mtod(m, struct rte_ether_hdr *);
 
 	/* 02:00:00:00:00:xx */
-	tmp = &eth->d_addr.addr_bytes[0];
+	tmp = &eth->dst_addr.addr_bytes[0];
 	*((uint64_t *)tmp) = 0x000000000002 + ((uint64_t)dest_portid << 40);
 
 	/* src addr */
-	rte_ether_addr_copy(&l2fwd_ports_eth_addr[dest_portid], &eth->s_addr);
+	rte_ether_addr_copy(&l2fwd_ports_eth_addr[dest_portid], &eth->src_addr);
 }
 
 /* Simple forward. 8< */
diff --git a/examples/l3fwd-acl/main.c b/examples/l3fwd-acl/main.c
index a1f457b564..60545f3059 100644
--- a/examples/l3fwd-acl/main.c
+++ b/examples/l3fwd-acl/main.c
@@ -1375,7 +1375,8 @@ send_single_packet(struct rte_mbuf *m, uint16_t port)
 
 	/* update src and dst mac*/
 	eh = rte_pktmbuf_mtod(m, struct rte_ether_hdr *);
-	memcpy(eh, &port_l2hdr[port], sizeof(eh->d_addr) + sizeof(eh->s_addr));
+	memcpy(eh, &port_l2hdr[port],
+			sizeof(eh->dst_addr) + sizeof(eh->src_addr));
 
 	qconf = &lcore_conf[lcore_id];
 	rte_eth_tx_buffer(port, qconf->tx_queue_id[port],
@@ -1743,8 +1744,9 @@ parse_eth_dest(const char *optarg)
 		return "port value exceeds RTE_MAX_ETHPORTS("
 			RTE_STR(RTE_MAX_ETHPORTS) ")";
 
-	if (cmdline_parse_etheraddr(NULL, port_end, &port_l2hdr[portid].d_addr,
-			sizeof(port_l2hdr[portid].d_addr)) < 0)
+	if (cmdline_parse_etheraddr(NULL, port_end,
+			&port_l2hdr[portid].dst_addr,
+			sizeof(port_l2hdr[portid].dst_addr)) < 0)
 		return "Invalid ethernet address";
 	return NULL;
 }
@@ -2002,8 +2004,9 @@ set_default_dest_mac(void)
 	uint32_t i;
 
 	for (i = 0; i != RTE_DIM(port_l2hdr); i++) {
-		port_l2hdr[i].d_addr.addr_bytes[0] = RTE_ETHER_LOCAL_ADMIN_ADDR;
-		port_l2hdr[i].d_addr.addr_bytes[5] = i;
+		port_l2hdr[i].dst_addr.addr_bytes[0] =
+				RTE_ETHER_LOCAL_ADMIN_ADDR;
+		port_l2hdr[i].dst_addr.addr_bytes[5] = i;
 	}
 }
 
@@ -2109,14 +2112,14 @@ main(int argc, char **argv)
 				"rte_eth_dev_adjust_nb_rx_tx_desc: err=%d, port=%d\n",
 				ret, portid);
 
-		ret = rte_eth_macaddr_get(portid, &port_l2hdr[portid].s_addr);
+		ret = rte_eth_macaddr_get(portid, &port_l2hdr[portid].src_addr);
 		if (ret < 0)
 			rte_exit(EXIT_FAILURE,
 				"rte_eth_macaddr_get: err=%d, port=%d\n",
 				ret, portid);
 
-		print_ethaddr("Dst MAC:", &port_l2hdr[portid].d_addr);
-		print_ethaddr(", Src MAC:", &port_l2hdr[portid].s_addr);
+		print_ethaddr("Dst MAC:", &port_l2hdr[portid].dst_addr);
+		print_ethaddr(", Src MAC:", &port_l2hdr[portid].src_addr);
 		printf(", ");
 
 		/* init memory */
diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c
index aa7b8db44a..90456f8f33 100644
--- a/examples/l3fwd-power/main.c
+++ b/examples/l3fwd-power/main.c
@@ -717,7 +717,7 @@ l3fwd_simple_forward(struct rte_mbuf *m, uint16_t portid,
 			dst_port = portid;
 
 		/* 02:00:00:00:00:xx */
-		d_addr_bytes = &eth_hdr->d_addr.addr_bytes[0];
+		d_addr_bytes = &eth_hdr->dst_addr.addr_bytes[0];
 		*((uint64_t *)d_addr_bytes) =
 			0x000000000002 + ((uint64_t)dst_port << 40);
 
@@ -729,7 +729,7 @@ l3fwd_simple_forward(struct rte_mbuf *m, uint16_t portid,
 
 		/* src addr */
 		rte_ether_addr_copy(&ports_eth_addr[dst_port],
-				&eth_hdr->s_addr);
+				&eth_hdr->src_addr);
 
 		send_single_packet(m, dst_port);
 	} else if (RTE_ETH_IS_IPV6_HDR(m->packet_type)) {
@@ -755,7 +755,7 @@ l3fwd_simple_forward(struct rte_mbuf *m, uint16_t portid,
 
 		/* src addr */
 		rte_ether_addr_copy(&ports_eth_addr[dst_port],
-				&eth_hdr->s_addr);
+				&eth_hdr->src_addr);
 
 		send_single_packet(m, dst_port);
 #else
diff --git a/examples/l3fwd/l3fwd_em.h b/examples/l3fwd/l3fwd_em.h
index b992a21da4..1eff591b48 100644
--- a/examples/l3fwd/l3fwd_em.h
+++ b/examples/l3fwd/l3fwd_em.h
@@ -40,7 +40,7 @@ l3fwd_em_handle_ipv4(struct rte_mbuf *m, uint16_t portid,
 
 	/* src addr */
 	rte_ether_addr_copy(&ports_eth_addr[dst_port],
-			&eth_hdr->s_addr);
+			&eth_hdr->src_addr);
 
 	return dst_port;
 }
@@ -68,7 +68,7 @@ l3fwd_em_handle_ipv6(struct rte_mbuf *m, uint16_t portid,
 
 	/* src addr */
 	rte_ether_addr_copy(&ports_eth_addr[dst_port],
-			&eth_hdr->s_addr);
+			&eth_hdr->src_addr);
 
 	return dst_port;
 }
diff --git a/examples/l3fwd/l3fwd_fib.c b/examples/l3fwd/l3fwd_fib.c
index f8d6a3ac39..c594877d96 100644
--- a/examples/l3fwd/l3fwd_fib.c
+++ b/examples/l3fwd/l3fwd_fib.c
@@ -94,7 +94,7 @@ fib_send_single(int nb_tx, struct lcore_conf *qconf,
 				struct rte_ether_hdr *);
 		*(uint64_t *)&eth_hdr->d_addr = dest_eth_addr[hops[j]];
 		rte_ether_addr_copy(&ports_eth_addr[hops[j]],
-				&eth_hdr->s_addr);
+				&eth_hdr->src_addr);
 
 		/* Send single packet. */
 		send_single_packet(qconf, pkts_burst[j], hops[j]);
diff --git a/examples/l3fwd/l3fwd_lpm.c b/examples/l3fwd/l3fwd_lpm.c
index 7200160164..227a6d7fa5 100644
--- a/examples/l3fwd/l3fwd_lpm.c
+++ b/examples/l3fwd/l3fwd_lpm.c
@@ -260,7 +260,7 @@ lpm_process_event_pkt(const struct lcore_conf *lconf, struct rte_mbuf *mbuf)
 
 	/* src addr */
 	rte_ether_addr_copy(&ports_eth_addr[mbuf->port],
-			&eth_hdr->s_addr);
+			&eth_hdr->src_addr);
 #endif
 	return mbuf->port;
 }
diff --git a/examples/l3fwd/l3fwd_lpm.h b/examples/l3fwd/l3fwd_lpm.h
index d730d72a20..dd2eae18b8 100644
--- a/examples/l3fwd/l3fwd_lpm.h
+++ b/examples/l3fwd/l3fwd_lpm.h
@@ -44,7 +44,7 @@ l3fwd_lpm_simple_forward(struct rte_mbuf *m, uint16_t portid,
 
 		/* src addr */
 		rte_ether_addr_copy(&ports_eth_addr[dst_port],
-				&eth_hdr->s_addr);
+				&eth_hdr->src_addr);
 
 		send_single_packet(qconf, m, dst_port);
 	} else if (RTE_ETH_IS_IPV6_HDR(m->packet_type)) {
@@ -66,7 +66,7 @@ l3fwd_lpm_simple_forward(struct rte_mbuf *m, uint16_t portid,
 
 		/* src addr */
 		rte_ether_addr_copy(&ports_eth_addr[dst_port],
-				&eth_hdr->s_addr);
+				&eth_hdr->src_addr);
 
 		send_single_packet(qconf, m, dst_port);
 	} else {
diff --git a/examples/link_status_interrupt/main.c b/examples/link_status_interrupt/main.c
index 7470aa539a..903bf8c8e8 100644
--- a/examples/link_status_interrupt/main.c
+++ b/examples/link_status_interrupt/main.c
@@ -182,11 +182,11 @@ lsi_simple_forward(struct rte_mbuf *m, unsigned portid)
 	eth = rte_pktmbuf_mtod(m, struct rte_ether_hdr *);
 
 	/* 02:00:00:00:00:xx */
-	tmp = &eth->d_addr.addr_bytes[0];
+	tmp = &eth->dst_addr.addr_bytes[0];
 	*((uint64_t *)tmp) = 0x000000000002 + ((uint64_t)dst_port << 40);
 
 	/* src addr */
-	rte_ether_addr_copy(&lsi_ports_eth_addr[dst_port], &eth->s_addr);
+	rte_ether_addr_copy(&lsi_ports_eth_addr[dst_port], &eth->src_addr);
 
 	buffer = tx_buffer[dst_port];
 	sent = rte_eth_tx_buffer(dst_port, 0, buffer, m);
diff --git a/examples/performance-thread/l3fwd-thread/main.c b/examples/performance-thread/l3fwd-thread/main.c
index 2f593abf26..b3024a40e6 100644
--- a/examples/performance-thread/l3fwd-thread/main.c
+++ b/examples/performance-thread/l3fwd-thread/main.c
@@ -1078,14 +1078,14 @@ simple_ipv4_fwd_8pkts(struct rte_mbuf *m[8], uint16_t portid)
 	*(uint64_t *)&eth_hdr[7]->d_addr = dest_eth_addr[dst_port[7]];
 
 	/* src addr */
-	rte_ether_addr_copy(&ports_eth_addr[dst_port[0]], &eth_hdr[0]->s_addr);
-	rte_ether_addr_copy(&ports_eth_addr[dst_port[1]], &eth_hdr[1]->s_addr);
-	rte_ether_addr_copy(&ports_eth_addr[dst_port[2]], &eth_hdr[2]->s_addr);
-	rte_ether_addr_copy(&ports_eth_addr[dst_port[3]], &eth_hdr[3]->s_addr);
-	rte_ether_addr_copy(&ports_eth_addr[dst_port[4]], &eth_hdr[4]->s_addr);
-	rte_ether_addr_copy(&ports_eth_addr[dst_port[5]], &eth_hdr[5]->s_addr);
-	rte_ether_addr_copy(&ports_eth_addr[dst_port[6]], &eth_hdr[6]->s_addr);
-	rte_ether_addr_copy(&ports_eth_addr[dst_port[7]], &eth_hdr[7]->s_addr);
+	rte_ether_addr_copy(&ports_eth_addr[dst_port[0]], &eth_hdr[0]->src_addr);
+	rte_ether_addr_copy(&ports_eth_addr[dst_port[1]], &eth_hdr[1]->src_addr);
+	rte_ether_addr_copy(&ports_eth_addr[dst_port[2]], &eth_hdr[2]->src_addr);
+	rte_ether_addr_copy(&ports_eth_addr[dst_port[3]], &eth_hdr[3]->src_addr);
+	rte_ether_addr_copy(&ports_eth_addr[dst_port[4]], &eth_hdr[4]->src_addr);
+	rte_ether_addr_copy(&ports_eth_addr[dst_port[5]], &eth_hdr[5]->src_addr);
+	rte_ether_addr_copy(&ports_eth_addr[dst_port[6]], &eth_hdr[6]->src_addr);
+	rte_ether_addr_copy(&ports_eth_addr[dst_port[7]], &eth_hdr[7]->src_addr);
 
 	send_single_packet(m[0], (uint8_t)dst_port[0]);
 	send_single_packet(m[1], (uint8_t)dst_port[1]);
@@ -1213,14 +1213,14 @@ simple_ipv6_fwd_8pkts(struct rte_mbuf *m[8], uint16_t portid)
 	*(uint64_t *)&eth_hdr[7]->d_addr = dest_eth_addr[dst_port[7]];
 
 	/* src addr */
-	rte_ether_addr_copy(&ports_eth_addr[dst_port[0]], &eth_hdr[0]->s_addr);
-	rte_ether_addr_copy(&ports_eth_addr[dst_port[1]], &eth_hdr[1]->s_addr);
-	rte_ether_addr_copy(&ports_eth_addr[dst_port[2]], &eth_hdr[2]->s_addr);
-	rte_ether_addr_copy(&ports_eth_addr[dst_port[3]], &eth_hdr[3]->s_addr);
-	rte_ether_addr_copy(&ports_eth_addr[dst_port[4]], &eth_hdr[4]->s_addr);
-	rte_ether_addr_copy(&ports_eth_addr[dst_port[5]], &eth_hdr[5]->s_addr);
-	rte_ether_addr_copy(&ports_eth_addr[dst_port[6]], &eth_hdr[6]->s_addr);
-	rte_ether_addr_copy(&ports_eth_addr[dst_port[7]], &eth_hdr[7]->s_addr);
+	rte_ether_addr_copy(&ports_eth_addr[dst_port[0]], &eth_hdr[0]->src_addr);
+	rte_ether_addr_copy(&ports_eth_addr[dst_port[1]], &eth_hdr[1]->src_addr);
+	rte_ether_addr_copy(&ports_eth_addr[dst_port[2]], &eth_hdr[2]->src_addr);
+	rte_ether_addr_copy(&ports_eth_addr[dst_port[3]], &eth_hdr[3]->src_addr);
+	rte_ether_addr_copy(&ports_eth_addr[dst_port[4]], &eth_hdr[4]->src_addr);
+	rte_ether_addr_copy(&ports_eth_addr[dst_port[5]], &eth_hdr[5]->src_addr);
+	rte_ether_addr_copy(&ports_eth_addr[dst_port[6]], &eth_hdr[6]->src_addr);
+	rte_ether_addr_copy(&ports_eth_addr[dst_port[7]], &eth_hdr[7]->src_addr);
 
 	send_single_packet(m[0], dst_port[0]);
 	send_single_packet(m[1], dst_port[1]);
@@ -1268,11 +1268,11 @@ l3fwd_simple_forward(struct rte_mbuf *m, uint16_t portid)
 		++(ipv4_hdr->hdr_checksum);
 #endif
 		/* dst addr */
-		*(uint64_t *)&eth_hdr->d_addr = dest_eth_addr[dst_port];
+		*(uint64_t *)&eth_hdr->dst_addr = dest_eth_addr[dst_port];
 
 		/* src addr */
 		rte_ether_addr_copy(&ports_eth_addr[dst_port],
-				&eth_hdr->s_addr);
+				&eth_hdr->src_addr);
 
 		send_single_packet(m, dst_port);
 	} else if (RTE_ETH_IS_IPV6_HDR(m->packet_type)) {
@@ -1290,11 +1290,11 @@ l3fwd_simple_forward(struct rte_mbuf *m, uint16_t portid)
 			dst_port = portid;
 
 		/* dst addr */
-		*(uint64_t *)&eth_hdr->d_addr = dest_eth_addr[dst_port];
+		*(uint64_t *)&eth_hdr->dst_addr = dest_eth_addr[dst_port];
 
 		/* src addr */
 		rte_ether_addr_copy(&ports_eth_addr[dst_port],
-				&eth_hdr->s_addr);
+				&eth_hdr->src_addr);
 
 		send_single_packet(m, dst_port);
 	} else
diff --git a/examples/ptpclient/ptpclient.c b/examples/ptpclient/ptpclient.c
index 4f32ade7fb..61e4ee0ea1 100644
--- a/examples/ptpclient/ptpclient.c
+++ b/examples/ptpclient/ptpclient.c
@@ -426,10 +426,10 @@ parse_fup(struct ptpv2_data_slave_ordinary *ptp_data)
 		created_pkt->data_len = pkt_size;
 		created_pkt->pkt_len = pkt_size;
 		eth_hdr = rte_pktmbuf_mtod(created_pkt, struct rte_ether_hdr *);
-		rte_ether_addr_copy(&eth_addr, &eth_hdr->s_addr);
+		rte_ether_addr_copy(&eth_addr, &eth_hdr->src_addr);
 
 		/* Set multicast address 01-1B-19-00-00-00. */
-		rte_ether_addr_copy(&eth_multicast, &eth_hdr->d_addr);
+		rte_ether_addr_copy(&eth_multicast, &eth_hdr->dst_addr);
 
 		eth_hdr->ether_type = htons(PTP_PROTOCOL);
 		ptp_msg = (struct ptp_message *)
@@ -449,14 +449,14 @@ parse_fup(struct ptpv2_data_slave_ordinary *ptp_data)
 		client_clkid =
 			&ptp_msg->delay_req.hdr.source_port_id.clock_id;
 
-		client_clkid->id[0] = eth_hdr->s_addr.addr_bytes[0];
-		client_clkid->id[1] = eth_hdr->s_addr.addr_bytes[1];
-		client_clkid->id[2] = eth_hdr->s_addr.addr_bytes[2];
+		client_clkid->id[0] = eth_hdr->src_addr.addr_bytes[0];
+		client_clkid->id[1] = eth_hdr->src_addr.addr_bytes[1];
+		client_clkid->id[2] = eth_hdr->src_addr.addr_bytes[2];
 		client_clkid->id[3] = 0xFF;
 		client_clkid->id[4] = 0xFE;
-		client_clkid->id[5] = eth_hdr->s_addr.addr_bytes[3];
-		client_clkid->id[6] = eth_hdr->s_addr.addr_bytes[4];
-		client_clkid->id[7] = eth_hdr->s_addr.addr_bytes[5];
+		client_clkid->id[5] = eth_hdr->src_addr.addr_bytes[3];
+		client_clkid->id[6] = eth_hdr->src_addr.addr_bytes[4];
+		client_clkid->id[7] = eth_hdr->src_addr.addr_bytes[5];
 
 		rte_memcpy(&ptp_data->client_clock_id,
 			   client_clkid,
diff --git a/examples/vhost/main.c b/examples/vhost/main.c
index bc3d71c898..ba339076a5 100644
--- a/examples/vhost/main.c
+++ b/examples/vhost/main.c
@@ -763,7 +763,7 @@ link_vmdq(struct vhost_dev *vdev, struct rte_mbuf *m)
 	/* Learn MAC address of guest device from packet */
 	pkt_hdr = rte_pktmbuf_mtod(m, struct rte_ether_hdr *);
 
-	if (find_vhost_dev(&pkt_hdr->s_addr)) {
+	if (find_vhost_dev(&pkt_hdr->src_addr)) {
 		RTE_LOG(ERR, VHOST_DATA,
 			"(%d) device is using a registered MAC!\n",
 			vdev->vid);
@@ -771,7 +771,7 @@ link_vmdq(struct vhost_dev *vdev, struct rte_mbuf *m)
 	}
 
 	for (i = 0; i < RTE_ETHER_ADDR_LEN; i++)
-		vdev->mac_address.addr_bytes[i] = pkt_hdr->s_addr.addr_bytes[i];
+		vdev->mac_address.addr_bytes[i] = pkt_hdr->src_addr.addr_bytes[i];
 
 	/* vlan_tag currently uses the device_id. */
 	vdev->vlan_tag = vlan_tags[vdev->vid];
@@ -960,7 +960,7 @@ virtio_tx_local(struct vhost_dev *vdev, struct rte_mbuf *m)
 	uint16_t lcore_id = rte_lcore_id();
 	pkt_hdr = rte_pktmbuf_mtod(m, struct rte_ether_hdr *);
 
-	dst_vdev = find_vhost_dev(&pkt_hdr->d_addr);
+	dst_vdev = find_vhost_dev(&pkt_hdr->dst_addr);
 	if (!dst_vdev)
 		return -1;
 
@@ -1008,7 +1008,7 @@ find_local_dest(struct vhost_dev *vdev, struct rte_mbuf *m,
 	struct rte_ether_hdr *pkt_hdr =
 		rte_pktmbuf_mtod(m, struct rte_ether_hdr *);
 
-	dst_vdev = find_vhost_dev(&pkt_hdr->d_addr);
+	dst_vdev = find_vhost_dev(&pkt_hdr->dst_addr);
 	if (!dst_vdev)
 		return 0;
 
@@ -1091,7 +1091,7 @@ virtio_tx_route(struct vhost_dev *vdev, struct rte_mbuf *m, uint16_t vlan_tag)
 
 
 	nh = rte_pktmbuf_mtod(m, struct rte_ether_hdr *);
-	if (unlikely(rte_is_broadcast_ether_addr(&nh->d_addr))) {
+	if (unlikely(rte_is_broadcast_ether_addr(&nh->dst_addr))) {
 		struct vhost_dev *vdev2;
 
 		TAILQ_FOREACH(vdev2, &vhost_dev_list, global_vdev_entry) {
diff --git a/examples/vmdq/main.c b/examples/vmdq/main.c
index d3bc19f78e..cbf6883a01 100644
--- a/examples/vmdq/main.c
+++ b/examples/vmdq/main.c
@@ -469,11 +469,11 @@ update_mac_address(struct rte_mbuf *m, unsigned dst_port)
 	eth = rte_pktmbuf_mtod(m, struct rte_ether_hdr *);
 
 	/* 02:00:00:00:00:xx */
-	tmp = &eth->d_addr.addr_bytes[0];
+	tmp = &eth->dst_addr.addr_bytes[0];
 	*((uint64_t *)tmp) = 0x000000000002 + ((uint64_t)dst_port << 40);
 
 	/* src addr */
-	rte_ether_addr_copy(&vmdq_ports_eth_addr[dst_port], &eth->s_addr);
+	rte_ether_addr_copy(&vmdq_ports_eth_addr[dst_port], &eth->src_addr);
 }
 
 /* When we receive a HUP signal, print out our stats */
diff --git a/examples/vmdq_dcb/main.c b/examples/vmdq_dcb/main.c
index 685a03bdd1..6a444508df 100644
--- a/examples/vmdq_dcb/main.c
+++ b/examples/vmdq_dcb/main.c
@@ -520,11 +520,11 @@ update_mac_address(struct rte_mbuf *m, unsigned dst_port)
 	eth = rte_pktmbuf_mtod(m, struct rte_ether_hdr *);
 
 	/* 02:00:00:00:00:xx */
-	tmp = &eth->d_addr.addr_bytes[0];
+	tmp = &eth->dst_addr.addr_bytes[0];
 	*((uint64_t *)tmp) = 0x000000000002 + ((uint64_t)dst_port << 40);
 
 	/* src addr */
-	rte_ether_addr_copy(&vmdq_ports_eth_addr[dst_port], &eth->s_addr);
+	rte_ether_addr_copy(&vmdq_ports_eth_addr[dst_port], &eth->src_addr);
 }
 
 /* When we receive a HUP signal, print out our stats */
diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h
index 70f455d47d..3ce72ff198 100644
--- a/lib/ethdev/rte_flow.h
+++ b/lib/ethdev/rte_flow.h
@@ -784,8 +784,8 @@ struct rte_flow_item_eth {
 /** Default mask for RTE_FLOW_ITEM_TYPE_ETH. */
 #ifndef __cplusplus
 static const struct rte_flow_item_eth rte_flow_item_eth_mask = {
-	.hdr.d_addr.addr_bytes = "\xff\xff\xff\xff\xff\xff",
-	.hdr.s_addr.addr_bytes = "\xff\xff\xff\xff\xff\xff",
+	.hdr.dst_addr.addr_bytes = "\xff\xff\xff\xff\xff\xff",
+	.hdr.src_addr.addr_bytes = "\xff\xff\xff\xff\xff\xff",
 	.hdr.ether_type = RTE_BE16(0x0000),
 };
 #endif
diff --git a/lib/gro/gro_tcp4.c b/lib/gro/gro_tcp4.c
index feb5855144..aff22178e3 100644
--- a/lib/gro/gro_tcp4.c
+++ b/lib/gro/gro_tcp4.c
@@ -243,8 +243,8 @@ gro_tcp4_reassemble(struct rte_mbuf *pkt,
 	ip_id = is_atomic ? 0 : rte_be_to_cpu_16(ipv4_hdr->packet_id);
 	sent_seq = rte_be_to_cpu_32(tcp_hdr->sent_seq);
 
-	rte_ether_addr_copy(&(eth_hdr->s_addr), &(key.eth_saddr));
-	rte_ether_addr_copy(&(eth_hdr->d_addr), &(key.eth_daddr));
+	rte_ether_addr_copy(&(eth_hdr->src_addr), &(key.eth_saddr));
+	rte_ether_addr_copy(&(eth_hdr->dst_addr), &(key.eth_daddr));
 	key.ip_src_addr = ipv4_hdr->src_addr;
 	key.ip_dst_addr = ipv4_hdr->dst_addr;
 	key.src_port = tcp_hdr->src_port;
diff --git a/lib/gro/gro_udp4.c b/lib/gro/gro_udp4.c
index b8301296df..e78dda7874 100644
--- a/lib/gro/gro_udp4.c
+++ b/lib/gro/gro_udp4.c
@@ -238,8 +238,8 @@ gro_udp4_reassemble(struct rte_mbuf *pkt,
 	is_last_frag = ((frag_offset & RTE_IPV4_HDR_MF_FLAG) == 0) ? 1 : 0;
 	frag_offset = (uint16_t)(frag_offset & RTE_IPV4_HDR_OFFSET_MASK) << 3;
 
-	rte_ether_addr_copy(&(eth_hdr->s_addr), &(key.eth_saddr));
-	rte_ether_addr_copy(&(eth_hdr->d_addr), &(key.eth_daddr));
+	rte_ether_addr_copy(&(eth_hdr->src_addr), &(key.eth_saddr));
+	rte_ether_addr_copy(&(eth_hdr->dst_addr), &(key.eth_daddr));
 	key.ip_src_addr = ipv4_hdr->src_addr;
 	key.ip_dst_addr = ipv4_hdr->dst_addr;
 	key.ip_id = ip_id;
diff --git a/lib/gro/gro_vxlan_tcp4.c b/lib/gro/gro_vxlan_tcp4.c
index f3b6e603b9..2005899afe 100644
--- a/lib/gro/gro_vxlan_tcp4.c
+++ b/lib/gro/gro_vxlan_tcp4.c
@@ -358,8 +358,8 @@ gro_vxlan_tcp4_reassemble(struct rte_mbuf *pkt,
 
 	sent_seq = rte_be_to_cpu_32(tcp_hdr->sent_seq);
 
-	rte_ether_addr_copy(&(eth_hdr->s_addr), &(key.inner_key.eth_saddr));
-	rte_ether_addr_copy(&(eth_hdr->d_addr), &(key.inner_key.eth_daddr));
+	rte_ether_addr_copy(&(eth_hdr->src_addr), &(key.inner_key.eth_saddr));
+	rte_ether_addr_copy(&(eth_hdr->dst_addr), &(key.inner_key.eth_daddr));
 	key.inner_key.ip_src_addr = ipv4_hdr->src_addr;
 	key.inner_key.ip_dst_addr = ipv4_hdr->dst_addr;
 	key.inner_key.recv_ack = tcp_hdr->recv_ack;
@@ -368,8 +368,8 @@ gro_vxlan_tcp4_reassemble(struct rte_mbuf *pkt,
 
 	key.vxlan_hdr.vx_flags = vxlan_hdr->vx_flags;
 	key.vxlan_hdr.vx_vni = vxlan_hdr->vx_vni;
-	rte_ether_addr_copy(&(outer_eth_hdr->s_addr), &(key.outer_eth_saddr));
-	rte_ether_addr_copy(&(outer_eth_hdr->d_addr), &(key.outer_eth_daddr));
+	rte_ether_addr_copy(&(outer_eth_hdr->src_addr), &(key.outer_eth_saddr));
+	rte_ether_addr_copy(&(outer_eth_hdr->dst_addr), &(key.outer_eth_daddr));
 	key.outer_ip_src_addr = outer_ipv4_hdr->src_addr;
 	key.outer_ip_dst_addr = outer_ipv4_hdr->dst_addr;
 	key.outer_src_port = udp_hdr->src_port;
diff --git a/lib/gro/gro_vxlan_udp4.c b/lib/gro/gro_vxlan_udp4.c
index 37476361d5..4767c910bb 100644
--- a/lib/gro/gro_vxlan_udp4.c
+++ b/lib/gro/gro_vxlan_udp4.c
@@ -338,16 +338,16 @@ gro_vxlan_udp4_reassemble(struct rte_mbuf *pkt,
 	is_last_frag = ((frag_offset & RTE_IPV4_HDR_MF_FLAG) == 0) ? 1 : 0;
 	frag_offset = (uint16_t)(frag_offset & RTE_IPV4_HDR_OFFSET_MASK) << 3;
 
-	rte_ether_addr_copy(&(eth_hdr->s_addr), &(key.inner_key.eth_saddr));
-	rte_ether_addr_copy(&(eth_hdr->d_addr), &(key.inner_key.eth_daddr));
+	rte_ether_addr_copy(&(eth_hdr->src_addr), &(key.inner_key.eth_saddr));
+	rte_ether_addr_copy(&(eth_hdr->dst_addr), &(key.inner_key.eth_daddr));
 	key.inner_key.ip_src_addr = ipv4_hdr->src_addr;
 	key.inner_key.ip_dst_addr = ipv4_hdr->dst_addr;
 	key.inner_key.ip_id = ip_id;
 
 	key.vxlan_hdr.vx_flags = vxlan_hdr->vx_flags;
 	key.vxlan_hdr.vx_vni = vxlan_hdr->vx_vni;
-	rte_ether_addr_copy(&(outer_eth_hdr->s_addr), &(key.outer_eth_saddr));
-	rte_ether_addr_copy(&(outer_eth_hdr->d_addr), &(key.outer_eth_daddr));
+	rte_ether_addr_copy(&(outer_eth_hdr->src_addr), &(key.outer_eth_saddr));
+	rte_ether_addr_copy(&(outer_eth_hdr->dst_addr), &(key.outer_eth_daddr));
 	key.outer_ip_src_addr = outer_ipv4_hdr->src_addr;
 	key.outer_ip_dst_addr = outer_ipv4_hdr->dst_addr;
 	/* Note: It is unnecessary to save outer_src_port here because it can
diff --git a/lib/net/rte_arp.c b/lib/net/rte_arp.c
index 5c1e27b8c0..9f7eb6b375 100644
--- a/lib/net/rte_arp.c
+++ b/lib/net/rte_arp.c
@@ -29,8 +29,8 @@ rte_net_make_rarp_packet(struct rte_mempool *mpool,
 	}
 
 	/* Ethernet header. */
-	memset(eth_hdr->d_addr.addr_bytes, 0xff, RTE_ETHER_ADDR_LEN);
-	rte_ether_addr_copy(mac, &eth_hdr->s_addr);
+	memset(eth_hdr->dst_addr.addr_bytes, 0xff, RTE_ETHER_ADDR_LEN);
+	rte_ether_addr_copy(mac, &eth_hdr->src_addr);
 	eth_hdr->ether_type = RTE_BE16(RTE_ETHER_TYPE_RARP);
 
 	/* RARP header. */
diff --git a/lib/net/rte_ether.h b/lib/net/rte_ether.h
index 7ee5e9a292..ff9829a3a3 100644
--- a/lib/net/rte_ether.h
+++ b/lib/net/rte_ether.h
@@ -253,34 +253,16 @@ __rte_experimental
 int
 rte_ether_unformat_addr(const char *str, struct rte_ether_addr *eth_addr);
 
-/* Windows Sockets headers contain `#define s_addr S_un.S_addr`.
- * Temporarily disable this macro to avoid conflict at definition.
- * Place source MAC address in both `s_addr` and `S_un.S_addr` fields,
- * so that access works either directly or through the macro.
- */
-#pragma push_macro("s_addr")
-#ifdef s_addr
-#undef s_addr
-#endif
-
 /**
  * Ethernet header: Contains the destination address, source address
  * and frame type.
  */
 struct rte_ether_hdr {
-	struct rte_ether_addr d_addr; /**< Destination address. */
-	RTE_STD_C11
-	union {
-		struct rte_ether_addr s_addr; /**< Source address. */
-		struct {
-			struct rte_ether_addr S_addr;
-		} S_un; /**< Do not use directly; use s_addr instead.*/
-	};
+	struct rte_ether_addr dst_addr; /**< Destination address. */
+	struct rte_ether_addr src_addr; /**< Source address. */
 	rte_be16_t ether_type; /**< Frame type. */
 } __rte_aligned(2);
 
-#pragma pop_macro("s_addr")
-
 /**
  * Ethernet VLAN Header.
  * Contains the 16-bit VLAN Tag Control Identifier and the Ethernet type
diff --git a/lib/pipeline/rte_table_action.c b/lib/pipeline/rte_table_action.c
index 98f3438774..8c010763c7 100644
--- a/lib/pipeline/rte_table_action.c
+++ b/lib/pipeline/rte_table_action.c
@@ -615,8 +615,8 @@ encap_ether_apply(void *data,
 		RTE_ETHER_TYPE_IPV6;
 
 	/* Ethernet */
-	rte_ether_addr_copy(&p->ether.ether.da, &d->ether.d_addr);
-	rte_ether_addr_copy(&p->ether.ether.sa, &d->ether.s_addr);
+	rte_ether_addr_copy(&p->ether.ether.da, &d->ether.dst_addr);
+	rte_ether_addr_copy(&p->ether.ether.sa, &d->ether.src_addr);
 	d->ether.ether_type = rte_htons(ethertype);
 
 	return 0;
@@ -633,8 +633,8 @@ encap_vlan_apply(void *data,
 		RTE_ETHER_TYPE_IPV6;
 
 	/* Ethernet */
-	rte_ether_addr_copy(&p->vlan.ether.da, &d->ether.d_addr);
-	rte_ether_addr_copy(&p->vlan.ether.sa, &d->ether.s_addr);
+	rte_ether_addr_copy(&p->vlan.ether.da, &d->ether.dst_addr);
+	rte_ether_addr_copy(&p->vlan.ether.sa, &d->ether.src_addr);
 	d->ether.ether_type = rte_htons(RTE_ETHER_TYPE_VLAN);
 
 	/* VLAN */
@@ -657,8 +657,8 @@ encap_qinq_apply(void *data,
 		RTE_ETHER_TYPE_IPV6;
 
 	/* Ethernet */
-	rte_ether_addr_copy(&p->qinq.ether.da, &d->ether.d_addr);
-	rte_ether_addr_copy(&p->qinq.ether.sa, &d->ether.s_addr);
+	rte_ether_addr_copy(&p->qinq.ether.da, &d->ether.dst_addr);
+	rte_ether_addr_copy(&p->qinq.ether.sa, &d->ether.src_addr);
 	d->ether.ether_type = rte_htons(RTE_ETHER_TYPE_QINQ);
 
 	/* SVLAN */
@@ -683,8 +683,8 @@ encap_qinq_pppoe_apply(void *data,
 	struct encap_qinq_pppoe_data *d = data;
 
 	/* Ethernet */
-	rte_ether_addr_copy(&p->qinq.ether.da, &d->ether.d_addr);
-	rte_ether_addr_copy(&p->qinq.ether.sa, &d->ether.s_addr);
+	rte_ether_addr_copy(&p->qinq.ether.da, &d->ether.dst_addr);
+	rte_ether_addr_copy(&p->qinq.ether.sa, &d->ether.src_addr);
 	d->ether.ether_type = rte_htons(RTE_ETHER_TYPE_VLAN);
 
 	/* SVLAN */
@@ -719,8 +719,8 @@ encap_mpls_apply(void *data,
 	uint32_t i;
 
 	/* Ethernet */
-	rte_ether_addr_copy(&p->mpls.ether.da, &d->ether.d_addr);
-	rte_ether_addr_copy(&p->mpls.ether.sa, &d->ether.s_addr);
+	rte_ether_addr_copy(&p->mpls.ether.da, &d->ether.dst_addr);
+	rte_ether_addr_copy(&p->mpls.ether.sa, &d->ether.src_addr);
 	d->ether.ether_type = rte_htons(ethertype);
 
 	/* MPLS */
@@ -746,8 +746,8 @@ encap_pppoe_apply(void *data,
 	struct encap_pppoe_data *d = data;
 
 	/* Ethernet */
-	rte_ether_addr_copy(&p->pppoe.ether.da, &d->ether.d_addr);
-	rte_ether_addr_copy(&p->pppoe.ether.sa, &d->ether.s_addr);
+	rte_ether_addr_copy(&p->pppoe.ether.da, &d->ether.dst_addr);
+	rte_ether_addr_copy(&p->pppoe.ether.sa, &d->ether.src_addr);
 	d->ether.ether_type = rte_htons(RTE_ETHER_TYPE_PPPOE_SESSION);
 
 	/* PPPoE and PPP*/
@@ -777,9 +777,9 @@ encap_vxlan_apply(void *data,
 
 			/* Ethernet */
 			rte_ether_addr_copy(&p->vxlan.ether.da,
-					&d->ether.d_addr);
+					&d->ether.dst_addr);
 			rte_ether_addr_copy(&p->vxlan.ether.sa,
-					&d->ether.s_addr);
+					&d->ether.src_addr);
 			d->ether.ether_type = rte_htons(RTE_ETHER_TYPE_VLAN);
 
 			/* VLAN */
@@ -818,9 +818,9 @@ encap_vxlan_apply(void *data,
 
 			/* Ethernet */
 			rte_ether_addr_copy(&p->vxlan.ether.da,
-					&d->ether.d_addr);
+					&d->ether.dst_addr);
 			rte_ether_addr_copy(&p->vxlan.ether.sa,
-					&d->ether.s_addr);
+					&d->ether.src_addr);
 			d->ether.ether_type = rte_htons(RTE_ETHER_TYPE_IPV4);
 
 			/* IPv4*/
@@ -855,9 +855,9 @@ encap_vxlan_apply(void *data,
 
 			/* Ethernet */
 			rte_ether_addr_copy(&p->vxlan.ether.da,
-					&d->ether.d_addr);
+					&d->ether.dst_addr);
 			rte_ether_addr_copy(&p->vxlan.ether.sa,
-					&d->ether.s_addr);
+					&d->ether.src_addr);
 			d->ether.ether_type = rte_htons(RTE_ETHER_TYPE_VLAN);
 
 			/* VLAN */
@@ -896,9 +896,9 @@ encap_vxlan_apply(void *data,
 
 			/* Ethernet */
 			rte_ether_addr_copy(&p->vxlan.ether.da,
-					&d->ether.d_addr);
+					&d->ether.dst_addr);
 			rte_ether_addr_copy(&p->vxlan.ether.sa,
-					&d->ether.s_addr);
+					&d->ether.src_addr);
 			d->ether.ether_type = rte_htons(RTE_ETHER_TYPE_IPV6);
 
 			/* IPv6*/
-- 
2.29.3


^ permalink raw reply	[relevance 1%]

* [dpdk-dev] [PATCH v9 06/12] pdump: support pcapng and filtering
  @ 2021-09-16  0:14  1%   ` Stephen Hemminger
  2021-09-16  0:14  1%   ` [dpdk-dev] [PATCH v9 11/12] doc: changes for new pcapng and dumpcap Stephen Hemminger
  1 sibling, 0 replies; 200+ results
From: Stephen Hemminger @ 2021-09-16  0:14 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

This enhances the DPDK pdump library to support new
pcapng format and filtering via BPF.

The internal client/server protocol is changed to support
two versions: the original pdump basic version and a
new pcapng version.

The internal version number (not part of exposed API or ABI)
is intentionally increased to cause any attempt to try
mismatched primary/secondary process to fail.

Add new API to do allow filtering of captured packets with
DPDK BPF (eBPF) filter program. It keeps statistics
on packets captured, filtered, and missed (because ring was full).

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/meson.build       |   4 +-
 lib/pdump/meson.build |   2 +-
 lib/pdump/rte_pdump.c | 441 ++++++++++++++++++++++++++++++------------
 lib/pdump/rte_pdump.h | 110 ++++++++++-
 lib/pdump/version.map |   8 +
 5 files changed, 437 insertions(+), 128 deletions(-)

diff --git a/lib/meson.build b/lib/meson.build
index ba88e9eabc58..1da521ea6185 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -26,6 +26,7 @@ libraries = [
         'timer',   # eventdev depends on this
         'acl',
         'bbdev',
+        'bpf',
         'bitratestats',
         'cfgfile',
         'compressdev',
@@ -43,7 +44,6 @@ libraries = [
         'member',
         'pcapng',
         'power',
-        'pdump',
         'rawdev',
         'regexdev',
         'rib',
@@ -55,10 +55,10 @@ libraries = [
         'ipsec', # ipsec lib depends on net, crypto and security
         'fib', #fib lib depends on rib
         'port', # pkt framework libs which use other libs from above
+        'pdump', # pdump lib depends on bpf pcapng
         'table',
         'pipeline',
         'flow_classify', # flow_classify lib depends on pkt framework table lib
-        'bpf',
         'graph',
         'node',
 ]
diff --git a/lib/pdump/meson.build b/lib/pdump/meson.build
index 3a95eabde6a6..51ceb2afdec5 100644
--- a/lib/pdump/meson.build
+++ b/lib/pdump/meson.build
@@ -3,4 +3,4 @@
 
 sources = files('rte_pdump.c')
 headers = files('rte_pdump.h')
-deps += ['ethdev']
+deps += ['ethdev', 'bpf', 'pcapng']
diff --git a/lib/pdump/rte_pdump.c b/lib/pdump/rte_pdump.c
index 382217bc1564..abc28fcee0ad 100644
--- a/lib/pdump/rte_pdump.c
+++ b/lib/pdump/rte_pdump.c
@@ -7,8 +7,10 @@
 #include <rte_ethdev.h>
 #include <rte_lcore.h>
 #include <rte_log.h>
+#include <rte_memzone.h>
 #include <rte_errno.h>
 #include <rte_string_fns.h>
+#include <rte_pcapng.h>
 
 #include "rte_pdump.h"
 
@@ -27,30 +29,26 @@ enum pdump_operation {
 	ENABLE = 2
 };
 
+/*
+ * Note: version numbers intentionally start at 3
+ * in order to catch any application built with older out
+ * version of DPDK using incompatible client request format.
+ */
 enum pdump_version {
-	V1 = 1
+	PDUMP_CLIENT_LEGACY = 3,
+	PDUMP_CLIENT_PCAPNG = 4,
 };
 
 struct pdump_request {
 	uint16_t ver;
 	uint16_t op;
-	uint32_t flags;
-	union pdump_data {
-		struct enable_v1 {
-			char device[RTE_DEV_NAME_MAX_LEN];
-			uint16_t queue;
-			struct rte_ring *ring;
-			struct rte_mempool *mp;
-			void *filter;
-		} en_v1;
-		struct disable_v1 {
-			char device[RTE_DEV_NAME_MAX_LEN];
-			uint16_t queue;
-			struct rte_ring *ring;
-			struct rte_mempool *mp;
-			void *filter;
-		} dis_v1;
-	} data;
+	uint16_t flags;
+	uint16_t queue;
+	struct rte_ring *ring;
+	struct rte_mempool *mp;
+	const struct rte_bpf_prm *prm;
+	uint32_t snaplen;
+	char device[RTE_DEV_NAME_MAX_LEN];
 };
 
 struct pdump_response {
@@ -63,80 +61,140 @@ static struct pdump_rxtx_cbs {
 	struct rte_ring *ring;
 	struct rte_mempool *mp;
 	const struct rte_eth_rxtx_callback *cb;
-	void *filter;
+	const struct rte_bpf *filter;
+	enum pdump_version ver;
+	uint32_t snaplen;
 } rx_cbs[RTE_MAX_ETHPORTS][RTE_MAX_QUEUES_PER_PORT],
 tx_cbs[RTE_MAX_ETHPORTS][RTE_MAX_QUEUES_PER_PORT];
 
-
-static inline void
-pdump_copy(struct rte_mbuf **pkts, uint16_t nb_pkts, void *user_params)
+static const char *MZ_RTE_PDUMP_STATS = "rte_pdump_stats";
+
+/* Shared memory between primary and secondary processes. */
+static struct {
+	struct rte_pdump_stats rx[RTE_MAX_ETHPORTS][RTE_MAX_QUEUES_PER_PORT];
+	struct rte_pdump_stats tx[RTE_MAX_ETHPORTS][RTE_MAX_QUEUES_PER_PORT];
+} *pdump_stats;
+
+/* Create a clone of mbuf to be placed into ring. */
+static void
+pdump_copy(uint16_t port_id, uint16_t queue,
+	   enum rte_pcapng_direction direction,
+	   struct rte_mbuf **pkts, uint16_t nb_pkts,
+	   const struct pdump_rxtx_cbs *cbs,
+	   struct rte_pdump_stats *stats)
 {
 	unsigned int i;
 	int ring_enq;
 	uint16_t d_pkts = 0;
 	struct rte_mbuf *dup_bufs[nb_pkts];
-	struct pdump_rxtx_cbs *cbs;
+	uint64_t ts;
 	struct rte_ring *ring;
 	struct rte_mempool *mp;
 	struct rte_mbuf *p;
+	uint64_t rcs[nb_pkts];
+
+	if (cbs->filter &&
+	    rte_bpf_exec_burst(cbs->filter, (void **)pkts, rcs, nb_pkts) == 0) {
+		/* All packets were filtered out */
+		__atomic_fetch_add(&stats->filtered, nb_pkts,
+				   __ATOMIC_RELAXED);
+		return;
+	}
 
-	cbs  = user_params;
+	ts = rte_get_tsc_cycles();
 	ring = cbs->ring;
 	mp = cbs->mp;
 	for (i = 0; i < nb_pkts; i++) {
-		p = rte_pktmbuf_copy(pkts[i], mp, 0, UINT32_MAX);
-		if (p)
+		/*
+		 * Similar behavior to rte_bpf_eth callback.
+		 * if BPF program returns zero value for a given packet,
+		 * then it will be ignored.
+		 */
+		if (cbs->filter && rcs[i] == 0) {
+			__atomic_fetch_add(&stats->filtered,
+					   1, __ATOMIC_RELAXED);
+			continue;
+		}
+
+		/*
+		 * If using pcapng then want to wrap packets
+		 * otherwise a simple copy.
+		 */
+		if (cbs->ver == PDUMP_CLIENT_PCAPNG)
+			p = rte_pcapng_copy(port_id, queue,
+					    pkts[i], mp, cbs->snaplen,
+					    ts, direction);
+		else
+			p = rte_pktmbuf_copy(pkts[i], mp, 0, cbs->snaplen);
+
+		if (unlikely(p == NULL))
+			__atomic_fetch_add(&stats->nombuf, 1, __ATOMIC_RELAXED);
+		else
 			dup_bufs[d_pkts++] = p;
 	}
 
+	__atomic_fetch_add(&stats->accepted, d_pkts, __ATOMIC_RELAXED);
+
 	ring_enq = rte_ring_enqueue_burst(ring, (void *)dup_bufs, d_pkts, NULL);
 	if (unlikely(ring_enq < d_pkts)) {
 		unsigned int drops = d_pkts - ring_enq;
 
-		PDUMP_LOG(DEBUG,
-			"only %d of packets enqueued to ring\n", ring_enq);
+		__atomic_fetch_add(&stats->ringfull, drops, __ATOMIC_RELAXED);
 		rte_pktmbuf_free_bulk(&dup_bufs[ring_enq], drops);
 	}
 }
 
 static uint16_t
-pdump_rx(uint16_t port __rte_unused, uint16_t qidx __rte_unused,
+pdump_rx(uint16_t port, uint16_t queue,
 	struct rte_mbuf **pkts, uint16_t nb_pkts,
-	uint16_t max_pkts __rte_unused,
-	void *user_params)
+	uint16_t max_pkts __rte_unused, void *user_params)
 {
-	pdump_copy(pkts, nb_pkts, user_params);
+	const struct pdump_rxtx_cbs *cbs = user_params;
+	struct rte_pdump_stats *stats = &pdump_stats->rx[port][queue];
+
+	pdump_copy(port, queue, RTE_PCAPNG_DIRECTION_IN,
+		   pkts, nb_pkts, cbs, stats);
 	return nb_pkts;
 }
 
 static uint16_t
-pdump_tx(uint16_t port __rte_unused, uint16_t qidx __rte_unused,
+pdump_tx(uint16_t port, uint16_t queue,
 		struct rte_mbuf **pkts, uint16_t nb_pkts, void *user_params)
 {
-	pdump_copy(pkts, nb_pkts, user_params);
+	const struct pdump_rxtx_cbs *cbs = user_params;
+	struct rte_pdump_stats *stats = &pdump_stats->tx[port][queue];
+
+	pdump_copy(port, queue, RTE_PCAPNG_DIRECTION_OUT,
+		   pkts, nb_pkts, cbs, stats);
 	return nb_pkts;
 }
 
 static int
-pdump_register_rx_callbacks(uint16_t end_q, uint16_t port, uint16_t queue,
-				struct rte_ring *ring, struct rte_mempool *mp,
-				uint16_t operation)
+pdump_register_rx_callbacks(enum pdump_version ver,
+			    uint16_t end_q, uint16_t port, uint16_t queue,
+			    struct rte_ring *ring, struct rte_mempool *mp,
+			    struct rte_bpf *filter,
+			    uint16_t operation, uint32_t snaplen)
 {
 	uint16_t qid;
-	struct pdump_rxtx_cbs *cbs = NULL;
 
 	qid = (queue == RTE_PDUMP_ALL_QUEUES) ? 0 : queue;
 	for (; qid < end_q; qid++) {
-		cbs = &rx_cbs[port][qid];
-		if (cbs && operation == ENABLE) {
+		struct pdump_rxtx_cbs *cbs = &rx_cbs[port][qid];
+
+		if (operation == ENABLE) {
 			if (cbs->cb) {
 				PDUMP_LOG(ERR,
 					"rx callback for port=%d queue=%d, already exists\n",
 					port, qid);
 				return -EEXIST;
 			}
+			cbs->ver = ver;
 			cbs->ring = ring;
 			cbs->mp = mp;
+			cbs->snaplen = snaplen;
+			cbs->filter = filter;
+
 			cbs->cb = rte_eth_add_first_rx_callback(port, qid,
 								pdump_rx, cbs);
 			if (cbs->cb == NULL) {
@@ -145,8 +203,7 @@ pdump_register_rx_callbacks(uint16_t end_q, uint16_t port, uint16_t queue,
 					rte_errno);
 				return rte_errno;
 			}
-		}
-		if (cbs && operation == DISABLE) {
+		} else if (operation == DISABLE) {
 			int ret;
 
 			if (cbs->cb == NULL) {
@@ -170,26 +227,32 @@ pdump_register_rx_callbacks(uint16_t end_q, uint16_t port, uint16_t queue,
 }
 
 static int
-pdump_register_tx_callbacks(uint16_t end_q, uint16_t port, uint16_t queue,
-				struct rte_ring *ring, struct rte_mempool *mp,
-				uint16_t operation)
+pdump_register_tx_callbacks(enum pdump_version ver,
+			    uint16_t end_q, uint16_t port, uint16_t queue,
+			    struct rte_ring *ring, struct rte_mempool *mp,
+			    struct rte_bpf *filter,
+			    uint16_t operation, uint32_t snaplen)
 {
 
 	uint16_t qid;
-	struct pdump_rxtx_cbs *cbs = NULL;
 
 	qid = (queue == RTE_PDUMP_ALL_QUEUES) ? 0 : queue;
 	for (; qid < end_q; qid++) {
-		cbs = &tx_cbs[port][qid];
-		if (cbs && operation == ENABLE) {
+		struct pdump_rxtx_cbs *cbs = &tx_cbs[port][qid];
+
+		if (operation == ENABLE) {
 			if (cbs->cb) {
 				PDUMP_LOG(ERR,
 					"tx callback for port=%d queue=%d, already exists\n",
 					port, qid);
 				return -EEXIST;
 			}
+			cbs->ver = ver;
 			cbs->ring = ring;
 			cbs->mp = mp;
+			cbs->snaplen = snaplen;
+			cbs->filter = filter;
+
 			cbs->cb = rte_eth_add_tx_callback(port, qid, pdump_tx,
 								cbs);
 			if (cbs->cb == NULL) {
@@ -198,8 +261,7 @@ pdump_register_tx_callbacks(uint16_t end_q, uint16_t port, uint16_t queue,
 					rte_errno);
 				return rte_errno;
 			}
-		}
-		if (cbs && operation == DISABLE) {
+		} else if (operation == DISABLE) {
 			int ret;
 
 			if (cbs->cb == NULL) {
@@ -228,37 +290,47 @@ set_pdump_rxtx_cbs(const struct pdump_request *p)
 	uint16_t nb_rx_q = 0, nb_tx_q = 0, end_q, queue;
 	uint16_t port;
 	int ret = 0;
+	struct rte_bpf *filter = NULL;
 	uint32_t flags;
 	uint16_t operation;
 	struct rte_ring *ring;
 	struct rte_mempool *mp;
 
-	flags = p->flags;
-	operation = p->op;
-	if (operation == ENABLE) {
-		ret = rte_eth_dev_get_port_by_name(p->data.en_v1.device,
-				&port);
-		if (ret < 0) {
+	if (!(p->ver == PDUMP_CLIENT_LEGACY ||
+	      p->ver == PDUMP_CLIENT_PCAPNG)) {
+		PDUMP_LOG(ERR,
+			  "incorrect client version %u\n", p->ver);
+		return -EINVAL;
+	}
+
+	if (p->prm) {
+		if (p->prm->prog_arg.type != RTE_BPF_ARG_PTR_MBUF) {
 			PDUMP_LOG(ERR,
-				"failed to get port id for device id=%s\n",
-				p->data.en_v1.device);
+				  "invalid BPF program type: %u\n",
+				  p->prm->prog_arg.type);
 			return -EINVAL;
 		}
-		queue = p->data.en_v1.queue;
-		ring = p->data.en_v1.ring;
-		mp = p->data.en_v1.mp;
-	} else {
-		ret = rte_eth_dev_get_port_by_name(p->data.dis_v1.device,
-				&port);
-		if (ret < 0) {
-			PDUMP_LOG(ERR,
-				"failed to get port id for device id=%s\n",
-				p->data.dis_v1.device);
-			return -EINVAL;
+
+		filter = rte_bpf_load(p->prm);
+		if (filter == NULL) {
+			PDUMP_LOG(ERR, "cannot load BPF filter: %s\n",
+				  rte_strerror(rte_errno));
+			return -rte_errno;
 		}
-		queue = p->data.dis_v1.queue;
-		ring = p->data.dis_v1.ring;
-		mp = p->data.dis_v1.mp;
+	}
+
+	flags = p->flags;
+	operation = p->op;
+	queue = p->queue;
+	ring = p->ring;
+	mp = p->mp;
+
+	ret = rte_eth_dev_get_port_by_name(p->device, &port);
+	if (ret < 0) {
+		PDUMP_LOG(ERR,
+			  "failed to get port id for device id=%s\n",
+			  p->device);
+		return -EINVAL;
 	}
 
 	/* validation if packet capture is for all queues */
@@ -296,8 +368,9 @@ set_pdump_rxtx_cbs(const struct pdump_request *p)
 	/* register RX callback */
 	if (flags & RTE_PDUMP_FLAG_RX) {
 		end_q = (queue == RTE_PDUMP_ALL_QUEUES) ? nb_rx_q : queue + 1;
-		ret = pdump_register_rx_callbacks(end_q, port, queue, ring, mp,
-							operation);
+		ret = pdump_register_rx_callbacks(p->ver, end_q, port, queue,
+						  ring, mp, filter,
+						  operation, p->snaplen);
 		if (ret < 0)
 			return ret;
 	}
@@ -305,8 +378,9 @@ set_pdump_rxtx_cbs(const struct pdump_request *p)
 	/* register TX callback */
 	if (flags & RTE_PDUMP_FLAG_TX) {
 		end_q = (queue == RTE_PDUMP_ALL_QUEUES) ? nb_tx_q : queue + 1;
-		ret = pdump_register_tx_callbacks(end_q, port, queue, ring, mp,
-							operation);
+		ret = pdump_register_tx_callbacks(p->ver, end_q, port, queue,
+						  ring, mp, filter,
+						  operation, p->snaplen);
 		if (ret < 0)
 			return ret;
 	}
@@ -332,7 +406,7 @@ pdump_server(const struct rte_mp_msg *mp_msg, const void *peer)
 		resp->err_value = set_pdump_rxtx_cbs(cli_req);
 	}
 
-	strlcpy(mp_resp.name, PDUMP_MP, RTE_MP_MAX_NAME_LEN);
+	rte_strscpy(mp_resp.name, PDUMP_MP, RTE_MP_MAX_NAME_LEN);
 	mp_resp.len_param = sizeof(*resp);
 	mp_resp.num_fds = 0;
 	if (rte_mp_reply(&mp_resp, peer) < 0) {
@@ -347,8 +421,18 @@ pdump_server(const struct rte_mp_msg *mp_msg, const void *peer)
 int
 rte_pdump_init(void)
 {
+	const struct rte_memzone *mz;
 	int ret;
 
+	mz = rte_memzone_reserve(MZ_RTE_PDUMP_STATS, sizeof(*pdump_stats),
+				 rte_socket_id(), 0);
+	if (mz == NULL) {
+		PDUMP_LOG(ERR, "cannot allocate pdump statistics\n");
+		rte_errno = ENOMEM;
+		return -1;
+	}
+	pdump_stats = mz->addr;
+
 	ret = rte_mp_action_register(PDUMP_MP, pdump_server);
 	if (ret && rte_errno != ENOTSUP)
 		return -1;
@@ -392,14 +476,21 @@ pdump_validate_ring_mp(struct rte_ring *ring, struct rte_mempool *mp)
 static int
 pdump_validate_flags(uint32_t flags)
 {
-	if (flags != RTE_PDUMP_FLAG_RX && flags != RTE_PDUMP_FLAG_TX &&
-		flags != RTE_PDUMP_FLAG_RXTX) {
+	if ((flags & RTE_PDUMP_FLAG_RXTX) == 0) {
 		PDUMP_LOG(ERR,
 			"invalid flags, should be either rx/tx/rxtx\n");
 		rte_errno = EINVAL;
 		return -1;
 	}
 
+	/* mask off the flags we know about */
+	if (flags & ~(RTE_PDUMP_FLAG_RXTX | RTE_PDUMP_FLAG_PCAPNG)) {
+		PDUMP_LOG(ERR,
+			  "unknown flags: %#x\n", flags);
+		rte_errno = ENOTSUP;
+		return -1;
+	}
+
 	return 0;
 }
 
@@ -426,12 +517,12 @@ pdump_validate_port(uint16_t port, char *name)
 }
 
 static int
-pdump_prepare_client_request(char *device, uint16_t queue,
-				uint32_t flags,
-				uint16_t operation,
-				struct rte_ring *ring,
-				struct rte_mempool *mp,
-				void *filter)
+pdump_prepare_client_request(const char *device, uint16_t queue,
+			     uint32_t flags, uint32_t snaplen,
+			     uint16_t operation,
+			     struct rte_ring *ring,
+			     struct rte_mempool *mp,
+			     const struct rte_bpf_prm *prm)
 {
 	int ret = -1;
 	struct rte_mp_msg mp_req, *mp_rep;
@@ -440,26 +531,26 @@ pdump_prepare_client_request(char *device, uint16_t queue,
 	struct pdump_request *req = (struct pdump_request *)mp_req.param;
 	struct pdump_response *resp;
 
-	req->ver = 1;
-	req->flags = flags;
+	memset(req, 0, sizeof(*req));
+	if (flags & RTE_PDUMP_FLAG_PCAPNG)
+		req->ver = PDUMP_CLIENT_PCAPNG;
+	else
+		req->ver = PDUMP_CLIENT_LEGACY;
+
+	req->flags = flags & RTE_PDUMP_FLAG_RXTX;
 	req->op = operation;
+	req->queue = queue;
+	rte_strscpy(req->device, device, sizeof(req->device));
+
 	if ((operation & ENABLE) != 0) {
-		strlcpy(req->data.en_v1.device, device,
-			sizeof(req->data.en_v1.device));
-		req->data.en_v1.queue = queue;
-		req->data.en_v1.ring = ring;
-		req->data.en_v1.mp = mp;
-		req->data.en_v1.filter = filter;
-	} else {
-		strlcpy(req->data.dis_v1.device, device,
-			sizeof(req->data.dis_v1.device));
-		req->data.dis_v1.queue = queue;
-		req->data.dis_v1.ring = NULL;
-		req->data.dis_v1.mp = NULL;
-		req->data.dis_v1.filter = NULL;
+		req->queue = queue;
+		req->ring = ring;
+		req->mp = mp;
+		req->prm = prm;
+		req->snaplen = snaplen;
 	}
 
-	strlcpy(mp_req.name, PDUMP_MP, RTE_MP_MAX_NAME_LEN);
+	rte_strscpy(mp_req.name, PDUMP_MP, RTE_MP_MAX_NAME_LEN);
 	mp_req.len_param = sizeof(*req);
 	mp_req.num_fds = 0;
 	if (rte_mp_request_sync(&mp_req, &mp_reply, &ts) == 0) {
@@ -477,11 +568,17 @@ pdump_prepare_client_request(char *device, uint16_t queue,
 	return ret;
 }
 
-int
-rte_pdump_enable(uint16_t port, uint16_t queue, uint32_t flags,
-			struct rte_ring *ring,
-			struct rte_mempool *mp,
-			void *filter)
+/*
+ * There are two versions of this function, because although original API
+ * left place holder for future filter, it never checked the value.
+ * Therefore the API can't depend on application passing a non
+ * bogus value.
+ */
+static int
+pdump_enable(uint16_t port, uint16_t queue,
+	     uint32_t flags, uint32_t snaplen,
+	     struct rte_ring *ring, struct rte_mempool *mp,
+	     const struct rte_bpf_prm *prm)
 {
 	int ret;
 	char name[RTE_DEV_NAME_MAX_LEN];
@@ -496,20 +593,42 @@ rte_pdump_enable(uint16_t port, uint16_t queue, uint32_t flags,
 	if (ret < 0)
 		return ret;
 
-	ret = pdump_prepare_client_request(name, queue, flags,
-						ENABLE, ring, mp, filter);
+	if (snaplen == 0)
+		snaplen = UINT32_MAX;
 
-	return ret;
+	return pdump_prepare_client_request(name, queue, flags, snaplen,
+					    ENABLE, ring, mp, prm);
 }
 
 int
-rte_pdump_enable_by_deviceid(char *device_id, uint16_t queue,
-				uint32_t flags,
-				struct rte_ring *ring,
-				struct rte_mempool *mp,
-				void *filter)
+rte_pdump_enable(uint16_t port, uint16_t queue, uint32_t flags,
+		 struct rte_ring *ring,
+		 struct rte_mempool *mp,
+		 void *filter __rte_unused)
 {
-	int ret = 0;
+	return pdump_enable(port, queue, flags, 0,
+			    ring, mp, NULL);
+}
+
+int
+rte_pdump_enable_bpf(uint16_t port, uint16_t queue,
+		     uint32_t flags, uint32_t snaplen,
+		     struct rte_ring *ring,
+		     struct rte_mempool *mp,
+		     const struct rte_bpf_prm *prm)
+{
+	return pdump_enable(port, queue, flags, snaplen,
+			    ring, mp, prm);
+}
+
+static int
+pdump_enable_by_deviceid(const char *device_id, uint16_t queue,
+			 uint32_t flags, uint32_t snaplen,
+			 struct rte_ring *ring,
+			 struct rte_mempool *mp,
+			 const struct rte_bpf_prm *prm)
+{
+	int ret;
 
 	ret = pdump_validate_ring_mp(ring, mp);
 	if (ret < 0)
@@ -518,10 +637,30 @@ rte_pdump_enable_by_deviceid(char *device_id, uint16_t queue,
 	if (ret < 0)
 		return ret;
 
-	ret = pdump_prepare_client_request(device_id, queue, flags,
-						ENABLE, ring, mp, filter);
+	return pdump_prepare_client_request(device_id, queue, flags, snaplen,
+					    ENABLE, ring, mp, prm);
+}
 
-	return ret;
+int
+rte_pdump_enable_by_deviceid(char *device_id, uint16_t queue,
+			     uint32_t flags,
+			     struct rte_ring *ring,
+			     struct rte_mempool *mp,
+			     void *filter __rte_unused)
+{
+	return pdump_enable_by_deviceid(device_id, queue, flags, 0,
+					ring, mp, NULL);
+}
+
+int
+rte_pdump_enable_bpf_by_deviceid(const char *device_id, uint16_t queue,
+				 uint32_t flags, uint32_t snaplen,
+				 struct rte_ring *ring,
+				 struct rte_mempool *mp,
+				 const struct rte_bpf_prm *prm)
+{
+	return pdump_enable_by_deviceid(device_id, queue, flags, snaplen,
+					ring, mp, prm);
 }
 
 int
@@ -537,8 +676,8 @@ rte_pdump_disable(uint16_t port, uint16_t queue, uint32_t flags)
 	if (ret < 0)
 		return ret;
 
-	ret = pdump_prepare_client_request(name, queue, flags,
-						DISABLE, NULL, NULL, NULL);
+	ret = pdump_prepare_client_request(name, queue, flags, 0,
+					   DISABLE, NULL, NULL, NULL);
 
 	return ret;
 }
@@ -553,8 +692,66 @@ rte_pdump_disable_by_deviceid(char *device_id, uint16_t queue,
 	if (ret < 0)
 		return ret;
 
-	ret = pdump_prepare_client_request(device_id, queue, flags,
-						DISABLE, NULL, NULL, NULL);
+	ret = pdump_prepare_client_request(device_id, queue, flags, 0,
+					   DISABLE, NULL, NULL, NULL);
 
 	return ret;
 }
+
+static void
+pdump_sum_stats(uint16_t port, uint16_t nq,
+		struct rte_pdump_stats stats[RTE_MAX_ETHPORTS][RTE_MAX_QUEUES_PER_PORT],
+		struct rte_pdump_stats *total)
+{
+	uint64_t *sum = (uint64_t *)total;
+	unsigned int i;
+	uint64_t val;
+	uint16_t qid;
+
+	for (qid = 0; qid < nq; qid++) {
+		const uint64_t *perq = (const uint64_t *)&stats[port][qid];
+
+		for (i = 0; i < sizeof(*total) / sizeof(uint64_t); i++) {
+			val = __atomic_load_n(&perq[i], __ATOMIC_RELAXED);
+			sum[i] += val;
+		}
+	}
+}
+
+int
+rte_pdump_stats(uint16_t port, struct rte_pdump_stats *stats)
+{
+	struct rte_eth_dev_info dev_info;
+	const struct rte_memzone *mz;
+	int ret;
+
+	memset(stats, 0, sizeof(*stats));
+	ret = rte_eth_dev_info_get(port, &dev_info);
+	if (ret != 0) {
+		PDUMP_LOG(ERR,
+			  "Error during getting device (port %u) info: %s\n",
+			  port, strerror(-ret));
+		return ret;
+	}
+
+	if (pdump_stats == NULL) {
+		if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
+			PDUMP_LOG(ERR,
+				  "pdump not initialized\n");
+			rte_errno = EINVAL;
+			return -1;
+		}
+
+		mz = rte_memzone_lookup(MZ_RTE_PDUMP_STATS);
+		if (mz == NULL) {
+			PDUMP_LOG(ERR, "can not find pdump stats\n");
+			rte_errno = EINVAL;
+			return -1;
+		}
+		pdump_stats = mz->addr;
+	}
+
+	pdump_sum_stats(port, dev_info.nb_rx_queues, pdump_stats->rx, stats);
+	pdump_sum_stats(port, dev_info.nb_tx_queues, pdump_stats->tx, stats);
+	return 0;
+}
diff --git a/lib/pdump/rte_pdump.h b/lib/pdump/rte_pdump.h
index 6b00fc17aeb2..be3fd14c4bd3 100644
--- a/lib/pdump/rte_pdump.h
+++ b/lib/pdump/rte_pdump.h
@@ -15,6 +15,7 @@
 #include <stdint.h>
 #include <rte_mempool.h>
 #include <rte_ring.h>
+#include <rte_bpf.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -26,7 +27,9 @@ enum {
 	RTE_PDUMP_FLAG_RX = 1,  /* receive direction */
 	RTE_PDUMP_FLAG_TX = 2,  /* transmit direction */
 	/* both receive and transmit directions */
-	RTE_PDUMP_FLAG_RXTX = (RTE_PDUMP_FLAG_RX|RTE_PDUMP_FLAG_TX)
+	RTE_PDUMP_FLAG_RXTX = (RTE_PDUMP_FLAG_RX|RTE_PDUMP_FLAG_TX),
+
+	RTE_PDUMP_FLAG_PCAPNG = 4, /* format for pcapng */
 };
 
 /**
@@ -68,7 +71,7 @@ rte_pdump_uninit(void);
  * @param mp
  *  mempool on to which original packets will be mirrored or duplicated.
  * @param filter
- *  place holder for packet filtering.
+ *  Unused should be NULL.
  *
  * @return
  *    0 on success, -1 on error, rte_errno is set accordingly.
@@ -80,6 +83,41 @@ rte_pdump_enable(uint16_t port, uint16_t queue, uint32_t flags,
 		struct rte_mempool *mp,
 		void *filter);
 
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
+ *
+ * Enables packet capturing on given port and queue with filtering.
+ *
+ * @param port_id
+ *  The Ethernet port on which packet capturing should be enabled.
+ * @param queue
+ *  The queue on the Ethernet port which packet capturing
+ *  should be enabled. Pass UINT16_MAX to enable packet capturing on all
+ *  queues of a given port.
+ * @param flags
+ *  Pdump library flags that specify direction and packet format.
+ * @param snaplen
+ *  The upper limit on bytes to copy.
+ *  Passing UINT32_MAX means capture all the possible data.
+ * @param ring
+ *  The ring on which captured packets will be enqueued for user.
+ * @param mp
+ *  The mempool on to which original packets will be mirrored or duplicated.
+ * @param prm
+ *  Use BPF program to run to filter packes (can be NULL)
+ *
+ * @return
+ *    0 on success, -1 on error, rte_errno is set accordingly.
+ */
+__rte_experimental
+int
+rte_pdump_enable_bpf(uint16_t port_id, uint16_t queue,
+		     uint32_t flags, uint32_t snaplen,
+		     struct rte_ring *ring,
+		     struct rte_mempool *mp,
+		     const struct rte_bpf_prm *prm);
+
 /**
  * Disables packet capturing on given port and queue.
  *
@@ -118,7 +156,7 @@ rte_pdump_disable(uint16_t port, uint16_t queue, uint32_t flags);
  * @param mp
  *  mempool on to which original packets will be mirrored or duplicated.
  * @param filter
- *  place holder for packet filtering.
+ *  unused should be NULL
  *
  * @return
  *    0 on success, -1 on error, rte_errno is set accordingly.
@@ -131,6 +169,43 @@ rte_pdump_enable_by_deviceid(char *device_id, uint16_t queue,
 				struct rte_mempool *mp,
 				void *filter);
 
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
+ *
+ * Enables packet capturing on given device id and queue with filtering.
+ * device_id can be name or pci address of device.
+ *
+ * @param device_id
+ *  device id on which packet capturing should be enabled.
+ * @param queue
+ *  The queue on the Ethernet port which packet capturing
+ *  should be enabled. Pass UINT16_MAX to enable packet capturing on all
+ *  queues of a given port.
+ * @param flags
+ *  Pdump library flags that specify direction and packet format.
+ * @param snaplen
+ *  The upper limit on bytes to copy.
+ *  Passing UINT32_MAX means capture all the possible data.
+ * @param ring
+ *  The ring on which captured packets will be enqueued for user.
+ * @param mp
+ *  The mempool on to which original packets will be mirrored or duplicated.
+ * @param filter
+ *  Use BPF program to run to filter packes (can be NULL)
+ *
+ * @return
+ *    0 on success, -1 on error, rte_errno is set accordingly.
+ */
+__rte_experimental
+int
+rte_pdump_enable_bpf_by_deviceid(const char *device_id, uint16_t queue,
+				 uint32_t flags, uint32_t snaplen,
+				 struct rte_ring *ring,
+				 struct rte_mempool *mp,
+				 const struct rte_bpf_prm *filter);
+
+
 /**
  * Disables packet capturing on given device_id and queue.
  * device_id can be name or pci address of device.
@@ -153,6 +228,35 @@ int
 rte_pdump_disable_by_deviceid(char *device_id, uint16_t queue,
 				uint32_t flags);
 
+
+/**
+ * A structure used to retrieve statistics from packet capture.
+ * The statistics are sum of both receive and transmit queues.
+ */
+struct rte_pdump_stats {
+	uint64_t accepted; /**< Number of packets accepted by filter. */
+	uint64_t filtered; /**< Number of packets rejected by filter. */
+	uint64_t nombuf;   /**< Number of mbuf allocation failures. */
+	uint64_t ringfull; /**< Number of missed packets due to ring full. */
+
+	uint64_t reserved[4]; /**< Reserved and pad to cache line */
+};
+
+/**
+ * Retrieve the packet capture statistics for a queue.
+ *
+ * @param port_id
+ *   The port identifier of the Ethernet device.
+ * @param stats
+ *   A pointer to structure of type *rte_pdump_stats* to be filled in.
+ * @return
+ *   Zero if successful. -1 on error and rte_errno is set.
+ */
+__rte_experimental
+int
+rte_pdump_stats(uint16_t port_id, struct rte_pdump_stats *stats);
+
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/lib/pdump/version.map b/lib/pdump/version.map
index f0a9d12c9a9e..ce5502d9cdf4 100644
--- a/lib/pdump/version.map
+++ b/lib/pdump/version.map
@@ -10,3 +10,11 @@ DPDK_22 {
 
 	local: *;
 };
+
+EXPERIMENTAL {
+	global:
+
+	rte_pdump_enable_bpf;
+	rte_pdump_enable_bpf_by_deviceid;
+	rte_pdump_stats;
+};
-- 
2.30.2


^ permalink raw reply	[relevance 1%]

* [dpdk-dev] [PATCH v9 11/12] doc: changes for new pcapng and dumpcap
    2021-09-16  0:14  1%   ` [dpdk-dev] [PATCH v9 06/12] pdump: support pcapng and filtering Stephen Hemminger
@ 2021-09-16  0:14  1%   ` Stephen Hemminger
  1 sibling, 0 replies; 200+ results
From: Stephen Hemminger @ 2021-09-16  0:14 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

Describe the new packet capture library and utilities

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 doc/api/doxy-api-index.md                     |  1 +
 doc/api/doxy-api.conf.in                      |  1 +
 .../howto/img/packet_capture_framework.svg    | 96 +++++++++----------
 doc/guides/howto/packet_capture_framework.rst | 67 ++++++-------
 doc/guides/prog_guide/index.rst               |  1 +
 doc/guides/prog_guide/pcapng_lib.rst          | 24 +++++
 doc/guides/prog_guide/pdump_lib.rst           | 28 ++++--
 doc/guides/rel_notes/release_21_11.rst        | 10 ++
 doc/guides/tools/dumpcap.rst                  | 86 +++++++++++++++++
 doc/guides/tools/index.rst                    |  1 +
 10 files changed, 228 insertions(+), 87 deletions(-)
 create mode 100644 doc/guides/prog_guide/pcapng_lib.rst
 create mode 100644 doc/guides/tools/dumpcap.rst

diff --git a/doc/api/doxy-api-index.md b/doc/api/doxy-api-index.md
index 1992107a0356..ee07394d1c78 100644
--- a/doc/api/doxy-api-index.md
+++ b/doc/api/doxy-api-index.md
@@ -223,3 +223,4 @@ The public API headers are grouped by topics:
   [experimental APIs]  (@ref rte_compat.h),
   [ABI versioning]     (@ref rte_function_versioning.h),
   [version]            (@ref rte_version.h)
+  [pcapng]             (@ref rte_pcapng.h)
diff --git a/doc/api/doxy-api.conf.in b/doc/api/doxy-api.conf.in
index 325a0195c6ab..aba17799a9a1 100644
--- a/doc/api/doxy-api.conf.in
+++ b/doc/api/doxy-api.conf.in
@@ -58,6 +58,7 @@ INPUT                   = @TOPDIR@/doc/api/doxy-api-index.md \
                           @TOPDIR@/lib/metrics \
                           @TOPDIR@/lib/node \
                           @TOPDIR@/lib/net \
+                          @TOPDIR@/lib/pcapng \
                           @TOPDIR@/lib/pci \
                           @TOPDIR@/lib/pdump \
                           @TOPDIR@/lib/pipeline \
diff --git a/doc/guides/howto/img/packet_capture_framework.svg b/doc/guides/howto/img/packet_capture_framework.svg
index a76baf71fdee..1c2646a81096 100644
--- a/doc/guides/howto/img/packet_capture_framework.svg
+++ b/doc/guides/howto/img/packet_capture_framework.svg
@@ -1,6 +1,4 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
 <svg
    xmlns:osb="http://www.openswatchbook.org/uri/2009/osb"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
@@ -16,8 +14,8 @@
    viewBox="0 0 425.19685 283.46457"
    id="svg2"
    version="1.1"
-   inkscape:version="0.91 r13725"
-   sodipodi:docname="drawing-pcap.svg">
+   inkscape:version="1.0.2 (e86c870879, 2021-01-15)"
+   sodipodi:docname="packet_capture_framework.svg">
   <defs
      id="defs4">
     <marker
@@ -228,7 +226,7 @@
        x2="487.64606"
        y2="258.38232"
        gradientUnits="userSpaceOnUse"
-       gradientTransform="translate(-84.916417,744.90779)" />
+       gradientTransform="matrix(1.1457977,0,0,0.99944907,-151.97019,745.05014)" />
     <linearGradient
        inkscape:collect="always"
        xlink:href="#linearGradient5784"
@@ -277,17 +275,18 @@
      borderopacity="1.0"
      inkscape:pageopacity="0.0"
      inkscape:pageshadow="2"
-     inkscape:zoom="0.57434918"
-     inkscape:cx="215.17857"
-     inkscape:cy="285.26445"
+     inkscape:zoom="1"
+     inkscape:cx="226.77165"
+     inkscape:cy="78.124511"
      inkscape:document-units="px"
      inkscape:current-layer="layer1"
      showgrid="false"
-     inkscape:window-width="1874"
-     inkscape:window-height="971"
-     inkscape:window-x="2"
-     inkscape:window-y="24"
-     inkscape:window-maximized="0" />
+     inkscape:window-width="2560"
+     inkscape:window-height="1414"
+     inkscape:window-x="0"
+     inkscape:window-y="0"
+     inkscape:window-maximized="1"
+     inkscape:document-rotation="0" />
   <metadata
      id="metadata7">
     <rdf:RDF>
@@ -296,7 +295,7 @@
         <dc:format>image/svg+xml</dc:format>
         <dc:type
            rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
-        <dc:title></dc:title>
+        <dc:title />
       </cc:Work>
     </rdf:RDF>
   </metadata>
@@ -321,15 +320,15 @@
        y="790.82452" />
     <text
        xml:space="preserve"
-       style="font-style:normal;font-weight:normal;font-size:12.5px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
        x="61.050636"
        y="807.3205"
-       id="text4152"
-       sodipodi:linespacing="125%"><tspan
+       id="text4152"><tspan
          sodipodi:role="line"
          id="tspan4154"
          x="61.050636"
-         y="807.3205">DPDK Primary Application</tspan></text>
+         y="807.3205"
+         style="font-size:12.5px;line-height:1.25">DPDK Primary Application</tspan></text>
     <rect
        style="fill:#000000;fill-opacity:0;stroke:#257cdc;stroke-width:2;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
        id="rect4156-6"
@@ -339,19 +338,20 @@
        y="827.01843" />
     <text
        xml:space="preserve"
-       style="font-style:normal;font-weight:normal;font-size:12.5px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
        x="350.68585"
        y="841.16058"
-       id="text4189"
-       sodipodi:linespacing="125%"><tspan
+       id="text4189"><tspan
          sodipodi:role="line"
          id="tspan4191"
          x="350.68585"
-         y="841.16058">dpdk-pdump</tspan><tspan
+         y="841.16058"
+         style="font-size:12.5px;line-height:1.25">dpdk-dumpcap</tspan><tspan
          sodipodi:role="line"
          x="350.68585"
          y="856.78558"
-         id="tspan4193">tool</tspan></text>
+         id="tspan4193"
+         style="font-size:12.5px;line-height:1.25">tool</tspan></text>
     <rect
        style="fill:#000000;fill-opacity:0;stroke:#257cdc;stroke-width:2;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
        id="rect4156-6-4"
@@ -361,15 +361,15 @@
        y="891.16315" />
     <text
        xml:space="preserve"
-       style="font-style:normal;font-weight:normal;font-size:12.5px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
        x="352.70612"
        y="905.3053"
-       id="text4189-1"
-       sodipodi:linespacing="125%"><tspan
+       id="text4189-1"><tspan
          sodipodi:role="line"
          x="352.70612"
          y="905.3053"
-         id="tspan4193-3">PCAP PMD</tspan></text>
+         id="tspan4193-3"
+         style="font-size:12.5px;line-height:1.25">librte_pcapng</tspan></text>
     <rect
        style="fill:url(#linearGradient5745);fill-opacity:1;stroke:#257cdc;stroke-width:2;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
        id="rect4156-6-6"
@@ -379,15 +379,15 @@
        y="923.9931" />
     <text
        xml:space="preserve"
-       style="font-style:normal;font-weight:normal;font-size:12.5px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
        x="136.02846"
        y="938.13525"
-       id="text4189-0"
-       sodipodi:linespacing="125%"><tspan
+       id="text4189-0"><tspan
          sodipodi:role="line"
          x="136.02846"
          y="938.13525"
-         id="tspan4193-6">dpdk_port0</tspan></text>
+         id="tspan4193-6"
+         style="font-size:12.5px;line-height:1.25">dpdk_port0</tspan></text>
     <rect
        style="fill:#000000;fill-opacity:0;stroke:#257cdc;stroke-width:2;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
        id="rect4156-6-5"
@@ -397,33 +397,33 @@
        y="824.99817" />
     <text
        xml:space="preserve"
-       style="font-style:normal;font-weight:normal;font-size:12.5px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
        x="137.54369"
        y="839.14026"
-       id="text4189-4"
-       sodipodi:linespacing="125%"><tspan
+       id="text4189-4"><tspan
          sodipodi:role="line"
          x="137.54369"
          y="839.14026"
-         id="tspan4193-2">librte_pdump</tspan></text>
+         id="tspan4193-2"
+         style="font-size:12.5px;line-height:1.25">librte_pdump</tspan></text>
     <rect
-       style="fill:url(#linearGradient5788);fill-opacity:1;stroke:#257cdc;stroke-width:1;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       style="fill:url(#linearGradient5788);fill-opacity:1;stroke:#257cdc;stroke-width:1.07013;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
        id="rect4156-6-4-5"
-       width="94.449265"
-       height="35.355339"
-       x="307.7804"
-       y="985.61243" />
+       width="108.21974"
+       height="35.335861"
+       x="297.9809"
+       y="985.62219" />
     <text
        xml:space="preserve"
-       style="font-style:normal;font-weight:normal;font-size:12.5px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
        x="352.70618"
        y="999.75458"
-       id="text4189-1-8"
-       sodipodi:linespacing="125%"><tspan
+       id="text4189-1-8"><tspan
          sodipodi:role="line"
          x="352.70618"
          y="999.75458"
-         id="tspan4193-3-2">capture.pcap</tspan></text>
+         id="tspan4193-3-2"
+         style="font-size:12.5px;line-height:1.25">capture.pcapng</tspan></text>
     <rect
        style="fill:url(#linearGradient5788-1);fill-opacity:1;stroke:#257cdc;stroke-width:1.12555885;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
        id="rect4156-6-4-5-1"
@@ -433,15 +433,15 @@
        y="983.14984" />
     <text
        xml:space="preserve"
-       style="font-style:normal;font-weight:normal;font-size:12.5px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
        x="136.53352"
        y="1002.785"
-       id="text4189-1-8-4"
-       sodipodi:linespacing="125%"><tspan
+       id="text4189-1-8-4"><tspan
          sodipodi:role="line"
          x="136.53352"
          y="1002.785"
-         id="tspan4193-3-2-7">Traffic Generator</tspan></text>
+         id="tspan4193-3-2-7"
+         style="font-size:12.5px;line-height:1.25">Traffic Generator</tspan></text>
     <path
        style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#marker7331)"
        d="m 351.46948,927.02357 c 0,57.5787 0,57.5787 0,57.5787"
diff --git a/doc/guides/howto/packet_capture_framework.rst b/doc/guides/howto/packet_capture_framework.rst
index c31bac52340e..78baa609a021 100644
--- a/doc/guides/howto/packet_capture_framework.rst
+++ b/doc/guides/howto/packet_capture_framework.rst
@@ -1,18 +1,19 @@
 ..  SPDX-License-Identifier: BSD-3-Clause
     Copyright(c) 2017 Intel Corporation.
 
-DPDK pdump Library and pdump Tool
-=================================
+DPDK packet capture libraries and tools
+=======================================
 
 This document describes how the Data Plane Development Kit (DPDK) Packet
 Capture Framework is used for capturing packets on DPDK ports. It is intended
 for users of DPDK who want to know more about the Packet Capture feature and
 for those who want to monitor traffic on DPDK-controlled devices.
 
-The DPDK packet capture framework was introduced in DPDK v16.07. The DPDK
-packet capture framework consists of the DPDK pdump library and DPDK pdump
-tool.
-
+The DPDK packet capture framework was introduced in DPDK v16.07 and
+enhanced in 21.1. The DPDK packet capture framework consists of the
+libraries for collecting packets ``librte_pdump`` and writing packets
+to a file ``librte_pcapng``. There are two sample applications:
+``dpdk-dumpcap`` and older ``dpdk-pdump``.
 
 Introduction
 ------------
@@ -22,43 +23,46 @@ allow users to initialize the packet capture framework and to enable or
 disable packet capture. The library works on a multi process communication model and its
 usage is recommended for debugging purposes.
 
-The :ref:`dpdk-pdump <pdump_tool>` tool is developed based on the
-``librte_pdump`` library.  It runs as a DPDK secondary process and is capable
-of enabling or disabling packet capture on DPDK ports. The ``dpdk-pdump`` tool
-provides command-line options with which users can request enabling or
-disabling of the packet capture on DPDK ports.
+The :ref:`librte_pcapng <pcapng_library>` library provides the APIs to format
+packets and write them to a file in Pcapng format.
+
+
+The :ref:`dpdk-dumpcap <dumpcap_tool>` is a tool that captures packets in
+like Wireshark dumpcap does for Linux. It runs as a DPDK secondary process and
+captures packets from one or more interfaces and writes them to a file
+in Pcapng format.  The ``dpdk-dumpcap`` tool is designed to take
+most of the same options as the Wireshark ``dumpcap`` command.
 
-The application which initializes the packet capture framework will be a primary process
-and the application that enables or disables the packet capture will
-be a secondary process. The primary process sends the Rx and Tx packets from the DPDK ports
-to the secondary process.
+Without any options it will use the packet capture framework to
+capture traffic from the first available DPDK port.
 
 In DPDK the ``testpmd`` application can be used to initialize the packet
-capture framework and acts as a server, and the ``dpdk-pdump`` tool acts as a
+capture framework and acts as a server, and the ``dpdk-dumpcap`` tool acts as a
 client. To view Rx or Tx packets of ``testpmd``, the application should be
-launched first, and then the ``dpdk-pdump`` tool. Packets from ``testpmd``
-will be sent to the tool, which then sends them on to the Pcap PMD device and
-that device writes them to the Pcap file or to an external interface depending
-on the command-line option used.
+launched first, and then the ``dpdk-dumpcap`` tool. Packets from ``testpmd``
+will be sent to the tool, and then to the Pcapng file.
 
 Some things to note:
 
-* The ``dpdk-pdump`` tool can only be used in conjunction with a primary
+* All tools using ``librte_pdump`` can only be used in conjunction with a primary
   application which has the packet capture framework initialized already. In
   dpdk, only ``testpmd`` is modified to initialize packet capture framework,
-  other applications remain untouched. So, if the ``dpdk-pdump`` tool has to
+  other applications remain untouched. So, if the ``dpdk-dumpcap`` tool has to
   be used with any application other than the testpmd, the user needs to
   explicitly modify that application to call the packet capture framework
   initialization code. Refer to the ``app/test-pmd/testpmd.c`` code and look
   for ``pdump`` keyword to see how this is done.
 
-* The ``dpdk-pdump`` tool depends on the libpcap based PMD.
+* The ``dpdk-pdump`` tool is an older tool created as demonstration of ``librte_pdump``
+  library. The ``dpdk-pdump`` tool provides more limited functionality and
+  and depends on the Pcap PMD. It is retained only for compatibility reasons;
+  users should use ``dpdk-dumpcap`` instead.
 
 
 Test Environment
 ----------------
 
-The overview of using the Packet Capture Framework and the ``dpdk-pdump`` tool
+The overview of using the Packet Capture Framework and the ``dpdk-dumpcap`` utility
 for packet capturing on the DPDK port in
 :numref:`figure_packet_capture_framework`.
 
@@ -66,13 +70,13 @@ for packet capturing on the DPDK port in
 
 .. figure:: img/packet_capture_framework.*
 
-   Packet capturing on a DPDK port using the dpdk-pdump tool.
+   Packet capturing on a DPDK port using the dpdk-dumpcap utility.
 
 
 Running the Application
 -----------------------
 
-The following steps demonstrate how to run the ``dpdk-pdump`` tool to capture
+The following steps demonstrate how to run the ``dpdk-dumpcap`` tool to capture
 Rx side packets on dpdk_port0 in :numref:`figure_packet_capture_framework` and
 inspect them using ``tcpdump``.
 
@@ -80,16 +84,15 @@ inspect them using ``tcpdump``.
 
      sudo <build_dir>/app/dpdk-testpmd -c 0xf0 -n 4 -- -i --port-topology=chained
 
-#. Launch the pdump tool as follows::
+#. Launch the dpdk-dump as follows::
 
-     sudo <build_dir>/app/dpdk-pdump -- \
-          --pdump 'port=0,queue=*,rx-dev=/tmp/capture.pcap'
+     sudo <build_dir>/app/dpdk-dumpcap -w /tmp/capture.pcapng
 
 #. Send traffic to dpdk_port0 from traffic generator.
-   Inspect packets captured in the file capture.pcap using a tool
-   that can interpret Pcap files, for example tcpdump::
+   Inspect packets captured in the file capture.pcap using a tool such as
+   tcpdump or tshark that can interpret Pcapng files::
 
-     $tcpdump -nr /tmp/capture.pcap
+     $ tcpdump -nr /tmp/capture.pcapng
      reading from file /tmp/capture.pcap, link-type EN10MB (Ethernet)
      11:11:36.891404 IP 4.4.4.4.whois++ > 3.3.3.3.whois++: UDP, length 18
      11:11:36.891442 IP 4.4.4.4.whois++ > 3.3.3.3.whois++: UDP, length 18
diff --git a/doc/guides/prog_guide/index.rst b/doc/guides/prog_guide/index.rst
index 2dce507f46a3..b440c77c2ba1 100644
--- a/doc/guides/prog_guide/index.rst
+++ b/doc/guides/prog_guide/index.rst
@@ -43,6 +43,7 @@ Programmer's Guide
     ip_fragment_reassembly_lib
     generic_receive_offload_lib
     generic_segmentation_offload_lib
+    pcapng_lib
     pdump_lib
     multi_proc_support
     kernel_nic_interface
diff --git a/doc/guides/prog_guide/pcapng_lib.rst b/doc/guides/prog_guide/pcapng_lib.rst
new file mode 100644
index 000000000000..36379b530a57
--- /dev/null
+++ b/doc/guides/prog_guide/pcapng_lib.rst
@@ -0,0 +1,24 @@
+..  SPDX-License-Identifier: BSD-3-Clause
+    Copyright(c) 2016 Intel Corporation.
+
+.. _pcapng_library:
+
+Packet Capture File Writer
+==========================
+
+Pcapng is a library for creating files in Pcapng file format.
+The Pcapng file format is the default capture file format for modern
+network capture processing tools. It can be read by wireshark and tcpdump.
+
+Usage
+-----
+
+Before the library can be used the function ``rte_pcapng_init``
+should be called once to initialize timestamp computation.
+
+
+References
+----------
+* Draft RFC https://www.ietf.org/id/draft-tuexen-opsawg-pcapng-03.html
+
+* Project repository  https://github.com/pcapng/pcapng/
diff --git a/doc/guides/prog_guide/pdump_lib.rst b/doc/guides/prog_guide/pdump_lib.rst
index 62c0b015b2fe..9af91415e5ea 100644
--- a/doc/guides/prog_guide/pdump_lib.rst
+++ b/doc/guides/prog_guide/pdump_lib.rst
@@ -3,10 +3,10 @@
 
 .. _pdump_library:
 
-The librte_pdump Library
-========================
+The Packet Capture Library
+==========================
 
-The ``librte_pdump`` library provides a framework for packet capturing in DPDK.
+The DPDK ``pdump`` library provides a framework for packet capturing in DPDK.
 The library does the complete copy of the Rx and Tx mbufs to a new mempool and
 hence it slows down the performance of the applications, so it is recommended
 to use this library for debugging purposes.
@@ -23,11 +23,19 @@ or disable the packet capture, and to uninitialize it.
 
 * ``rte_pdump_enable()``:
   This API enables the packet capture on a given port and queue.
-  Note: The filter option in the API is a place holder for future enhancements.
+
+* ``rte_pdump_enable_bpf()``
+  This API enables the packet capture on a given port and queue.
+  It also allows setting an optional filter using DPDK BPF interpreter and
+  setting the captured packet length.
 
 * ``rte_pdump_enable_by_deviceid()``:
   This API enables the packet capture on a given device id (``vdev name or pci address``) and queue.
-  Note: The filter option in the API is a place holder for future enhancements.
+
+* ``rte_pdump_enable_bpf_by_deviceid()``
+  This API enables the packet capture on a given device id (``vdev name or pci address``) and queue.
+  It also allows seating an optional filter using DPDK BPF interpreter and
+  setting the captured packet length.
 
 * ``rte_pdump_disable()``:
   This API disables the packet capture on a given port and queue.
@@ -61,6 +69,12 @@ and enables the packet capture by registering the Ethernet RX and TX callbacks f
 and queue combinations. Then the primary process will mirror the packets to the new mempool and enqueue them to
 the rte_ring that secondary process have passed to these APIs.
 
+The packet ring supports one of two formats. The default format enqueues copies of the original packets
+into the rte_ring. If the ``RTE_PDUMP_FLAG_PCAPNG`` is set the mbuf data is extended with header and trailer
+to match the format of Pcapng enhanced packet block. The enhanced packet block has meta-data such as the
+timestamp, port and queue the packet was captured on. It is up to the application consuming the
+packets from the ring to select the format desired.
+
 The library APIs ``rte_pdump_disable()`` and ``rte_pdump_disable_by_deviceid()`` disables the packet capture.
 For the calls to these APIs from secondary process, the library creates the "pdump disable" request and sends
 the request to the primary process over the multi process channel. The primary process takes this request and
@@ -74,5 +88,5 @@ function.
 Use Case: Packet Capturing
 --------------------------
 
-The DPDK ``app/pdump`` tool is developed based on this library to capture packets in DPDK.
-Users can use this as an example to develop their own packet capturing tools.
+The DPDK ``app/dpdk-dumpcap`` utility uses this library
+to capture packets in DPDK.
diff --git a/doc/guides/rel_notes/release_21_11.rst b/doc/guides/rel_notes/release_21_11.rst
index 43d367bcada2..fedbd64e9777 100644
--- a/doc/guides/rel_notes/release_21_11.rst
+++ b/doc/guides/rel_notes/release_21_11.rst
@@ -87,6 +87,16 @@ New Features
   Added command-line options to specify total number of processes and
   current process ID. Each process owns subset of Rx and Tx queues.
 
+* **Revised packet capture framework.**
+
+  * New dpdk-dumpcap program that has most of the features of the
+    wireshark dumpcap utility including: capture of multiple interfaces,
+    filtering, and stopping after number of bytes, packets.
+  * New library for writing pcapng packet capture files.
+  * Enhancements to the pdump library to support:
+    * Packet filter with BPF.
+    * Pcapng format with timestamps and meta-data.
+    * Fixes packet capture with stripped VLAN tags.
 
 Removed Items
 -------------
diff --git a/doc/guides/tools/dumpcap.rst b/doc/guides/tools/dumpcap.rst
new file mode 100644
index 000000000000..664ea0c79802
--- /dev/null
+++ b/doc/guides/tools/dumpcap.rst
@@ -0,0 +1,86 @@
+..  SPDX-License-Identifier: BSD-3-Clause
+    Copyright(c) 2020 Microsoft Corporation.
+
+.. _dumpcap_tool:
+
+dpdk-dumpcap Application
+========================
+
+The ``dpdk-dumpcap`` tool is a Data Plane Development Kit (DPDK)
+network traffic dump tool.  The interface is similar to  the dumpcap tool in Wireshark.
+It runs as a secondary DPDK process and lets you capture packets that are
+coming into and out of a DPDK primary process.
+The ``dpdk-dumpcap`` writes files in Pcapng packet format using
+capture file format is pcapng.
+
+Without any options set it will use DPDK to capture traffic from the first
+available DPDK interface and write the received raw packet data, along
+with timestamps into a pcapng file.
+
+If the ``-w`` option is not specified, ``dpdk-dumpcap`` writes to a newly
+create file with a name chosen based on interface name and timestamp.
+If ``-w`` option is specified, then that file is used.
+
+   .. Note::
+      * The ``dpdk-dumpcap`` tool can only be used in conjunction with a primary
+        application which has the packet capture framework initialized already.
+        In dpdk, only the ``testpmd`` is modified to initialize packet capture
+        framework, other applications remain untouched. So, if the ``dpdk-dumpcap``
+        tool has to be used with any application other than the testpmd, user
+        needs to explicitly modify that application to call packet capture
+        framework initialization code. Refer ``app/test-pmd/testpmd.c``
+        code to see how this is done.
+
+      * The ``dpdk-dumpcap`` tool runs as a DPDK secondary process. It exits when
+        the primary application exits.
+
+
+Running the Application
+-----------------------
+
+To list interfaces available for capture use ``--list-interfaces``.
+
+To filter packets in style of *tshark* use the ``-f`` flag.
+
+To capture on multiple interfaces at once, use multiple ``-I`` flags.
+
+Example
+-------
+
+.. code-block:: console
+
+   # ./<build_dir>/app/dpdk-dumpcap --list-interfaces
+   0. 000:00:03.0
+   1. 000:00:03.1
+
+   # ./<build_dir>/app/dpdk-dumpcap -I 0000:00:03.0 -c 6 -w /tmp/sample.pcapng
+   Packets captured: 6
+   Packets received/dropped on interface '0000:00:03.0' 6/0
+
+   # ./<build_dir>/app/dpdk-dumpcap -f 'tcp port 80'
+   Packets captured: 6
+   Packets received/dropped on interface '0000:00:03.0' 10/8
+
+
+Limitations
+-----------
+The following option of Wireshark ``dumpcap`` is not yet implemented:
+
+   * ``-b|--ring-buffer`` -- more complex file management.
+
+The following options do not make sense in the context of DPDK.
+
+   * ``-C <byte_limit>`` -- its a kernel thing
+
+   * ``-t`` -- use a thread per interface
+
+   * Timestamp type.
+
+   * Link data types. Only EN10MB (Ethernet) is supported.
+
+   * Wireless related options:  ``-I|--monitor-mode`` and  ``-k <freq>``
+
+
+.. Note::
+   * The options to ``dpdk-dumpcap`` are like the Wireshark dumpcap program and
+     are not the same as ``dpdk-pdump`` and other DPDK applications.
diff --git a/doc/guides/tools/index.rst b/doc/guides/tools/index.rst
index 93dde4148e90..b71c12b8f2dd 100644
--- a/doc/guides/tools/index.rst
+++ b/doc/guides/tools/index.rst
@@ -8,6 +8,7 @@ DPDK Tools User Guides
     :maxdepth: 2
     :numbered:
 
+    dumpcap
     proc_info
     pdump
     pmdinfo
-- 
2.30.2


^ permalink raw reply	[relevance 1%]

* [dpdk-dev] [PATCH v22 0/5] support dmadev
    2021-09-04 10:10  3% ` [dpdk-dev] [PATCH v20 0/7] support dmadev Chengwen Feng
  2021-09-07 12:56  3% ` [dpdk-dev] [PATCH v21 " Chengwen Feng
@ 2021-09-16  3:41  3% ` Chengwen Feng
  2 siblings, 0 replies; 200+ results
From: Chengwen Feng @ 2021-09-16  3:41 UTC (permalink / raw)
  To: thomas, ferruh.yigit, bruce.richardson, jerinj, jerinjacobk,
	andrew.rybchenko
  Cc: dev, mb, nipun.gupta, hemant.agrawal, maxime.coquelin,
	honnappa.nagarahalli, david.marchand, sburla, pkapoor,
	konstantin.ananyev, conor.walsh, kevin.laatz

This patch set contains five patch for new add dmadev.

Chengwen Feng (5):
  dmadev: introduce DMA device library
  dmadev: add control plane function support
  dmadev: add data plane function support
  dma/skeleton: introduce skeleton dmadev driver
  app/test: add dmadev API test

---
v22:
* function prefix change from rte_dmadev_* to rte_dma_*.
* change to prefix comment in most scenarios.
* dmadev dev_id use int16_t type.
* fix typo.
* organize patchsets in incremental mode.
v21:
* add comment for reserved fields of struct rte_dmadev.
v20:
* delete unnecessary and duplicate include header files.
* the conf_sz parameter is added to the configure and vchan-setup
  callbacks of the PMD, this is mainly used to enhance ABI
  compatibility.
* the rte_dmadev structure field is rearranged to reserve more space
  for I/O functions.
* fix some ambiguous and unnecessary comments.
* fix the potential memory leak of ut.
* redefine skeldma_init_once to skeldma_count.
* suppress rte_dmadev error output when execute ut.

 MAINTAINERS                            |    7 +
 app/test/meson.build                   |    4 +
 app/test/test_dmadev.c                 |   43 +
 app/test/test_dmadev_api.c             |  539 ++++++++++++
 config/rte_config.h                    |    3 +
 doc/api/doxy-api-index.md              |    1 +
 doc/api/doxy-api.conf.in               |    1 +
 doc/guides/dmadevs/index.rst           |   12 +
 doc/guides/index.rst                   |    1 +
 doc/guides/prog_guide/dmadev.rst       |  125 +++
 doc/guides/prog_guide/img/dmadev.svg   |  283 +++++++
 doc/guides/prog_guide/index.rst        |    1 +
 doc/guides/rel_notes/release_21_11.rst |    5 +
 drivers/dma/meson.build                |    6 +
 drivers/dma/skeleton/meson.build       |    7 +
 drivers/dma/skeleton/skeleton_dmadev.c |  571 +++++++++++++
 drivers/dma/skeleton/skeleton_dmadev.h |   61 ++
 drivers/dma/skeleton/version.map       |    3 +
 drivers/meson.build                    |    1 +
 lib/dmadev/meson.build                 |    7 +
 lib/dmadev/rte_dmadev.c                |  718 ++++++++++++++++
 lib/dmadev/rte_dmadev.h                | 1073 ++++++++++++++++++++++++
 lib/dmadev/rte_dmadev_core.h           |  184 ++++
 lib/dmadev/rte_dmadev_pmd.h            |   60 ++
 lib/dmadev/version.map                 |   35 +
 lib/meson.build                        |    1 +
 26 files changed, 3752 insertions(+)
 create mode 100644 app/test/test_dmadev.c
 create mode 100644 app/test/test_dmadev_api.c
 create mode 100644 doc/guides/dmadevs/index.rst
 create mode 100644 doc/guides/prog_guide/dmadev.rst
 create mode 100644 doc/guides/prog_guide/img/dmadev.svg
 create mode 100644 drivers/dma/meson.build
 create mode 100644 drivers/dma/skeleton/meson.build
 create mode 100644 drivers/dma/skeleton/skeleton_dmadev.c
 create mode 100644 drivers/dma/skeleton/skeleton_dmadev.h
 create mode 100644 drivers/dma/skeleton/version.map
 create mode 100644 lib/dmadev/meson.build
 create mode 100644 lib/dmadev/rte_dmadev.c
 create mode 100644 lib/dmadev/rte_dmadev.h
 create mode 100644 lib/dmadev/rte_dmadev_core.h
 create mode 100644 lib/dmadev/rte_dmadev_pmd.h
 create mode 100644 lib/dmadev/version.map

-- 
2.33.0


^ permalink raw reply	[relevance 3%]

* Re: [dpdk-dev] [PATCH v2 01/15] ethdev: introduce shared Rx queue
  2021-09-15 14:45  0%                     ` Xueming(Steven) Li
@ 2021-09-16  4:16  0%                       ` Jerin Jacob
  0 siblings, 0 replies; 200+ results
From: Jerin Jacob @ 2021-09-16  4:16 UTC (permalink / raw)
  To: Xueming(Steven) Li
  Cc: NBU-Contact-Thomas Monjalon, andrew.rybchenko, dev, ferruh.yigit

On Wed, Sep 15, 2021 at 8:15 PM Xueming(Steven) Li <xuemingl@nvidia.com> wrote:
>
> Hi Jerin,
>
> On Mon, 2021-08-30 at 15:01 +0530, Jerin Jacob wrote:
> > On Sat, Aug 28, 2021 at 7:46 PM Xueming(Steven) Li <xuemingl@nvidia.com> wrote:
> > >
> > >
> > >
> > > > -----Original Message-----
> > > > From: Jerin Jacob <jerinjacobk@gmail.com>
> > > > Sent: Thursday, August 26, 2021 7:58 PM
> > > > To: Xueming(Steven) Li <xuemingl@nvidia.com>
> > > > Cc: dpdk-dev <dev@dpdk.org>; Ferruh Yigit <ferruh.yigit@intel.com>; NBU-Contact-Thomas Monjalon <thomas@monjalon.net>;
> > > > Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
> > > > Subject: Re: [PATCH v2 01/15] ethdev: introduce shared Rx queue
> > > >
> > > > On Thu, Aug 19, 2021 at 5:39 PM Xueming(Steven) Li <xuemingl@nvidia.com> wrote:
> > > > >
> > > > >
> > > > >
> > > > > > -----Original Message-----
> > > > > > From: Jerin Jacob <jerinjacobk@gmail.com>
> > > > > > Sent: Thursday, August 19, 2021 1:27 PM
> > > > > > To: Xueming(Steven) Li <xuemingl@nvidia.com>
> > > > > > Cc: dpdk-dev <dev@dpdk.org>; Ferruh Yigit <ferruh.yigit@intel.com>;
> > > > > > NBU-Contact-Thomas Monjalon <thomas@monjalon.net>; Andrew Rybchenko
> > > > > > <andrew.rybchenko@oktetlabs.ru>
> > > > > > Subject: Re: [PATCH v2 01/15] ethdev: introduce shared Rx queue
> > > > > >
> > > > > > On Wed, Aug 18, 2021 at 4:44 PM Xueming(Steven) Li <xuemingl@nvidia.com> wrote:
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > > -----Original Message-----
> > > > > > > > From: Jerin Jacob <jerinjacobk@gmail.com>
> > > > > > > > Sent: Tuesday, August 17, 2021 11:12 PM
> > > > > > > > To: Xueming(Steven) Li <xuemingl@nvidia.com>
> > > > > > > > Cc: dpdk-dev <dev@dpdk.org>; Ferruh Yigit
> > > > > > > > <ferruh.yigit@intel.com>; NBU-Contact-Thomas Monjalon
> > > > > > > > <thomas@monjalon.net>; Andrew Rybchenko
> > > > > > > > <andrew.rybchenko@oktetlabs.ru>
> > > > > > > > Subject: Re: [PATCH v2 01/15] ethdev: introduce shared Rx queue
> > > > > > > >
> > > > > > > > On Tue, Aug 17, 2021 at 5:01 PM Xueming(Steven) Li <xuemingl@nvidia.com> wrote:
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > > -----Original Message-----
> > > > > > > > > > From: Jerin Jacob <jerinjacobk@gmail.com>
> > > > > > > > > > Sent: Tuesday, August 17, 2021 5:33 PM
> > > > > > > > > > To: Xueming(Steven) Li <xuemingl@nvidia.com>
> > > > > > > > > > Cc: dpdk-dev <dev@dpdk.org>; Ferruh Yigit
> > > > > > > > > > <ferruh.yigit@intel.com>; NBU-Contact-Thomas Monjalon
> > > > > > > > > > <thomas@monjalon.net>; Andrew Rybchenko
> > > > > > > > > > <andrew.rybchenko@oktetlabs.ru>
> > > > > > > > > > Subject: Re: [PATCH v2 01/15] ethdev: introduce shared Rx
> > > > > > > > > > queue
> > > > > > > > > >
> > > > > > > > > > On Wed, Aug 11, 2021 at 7:34 PM Xueming Li <xuemingl@nvidia.com> wrote:
> > > > > > > > > > >
> > > > > > > > > > > In current DPDK framework, each RX queue is pre-loaded
> > > > > > > > > > > with mbufs for incoming packets. When number of
> > > > > > > > > > > representors scale out in a switch domain, the memory
> > > > > > > > > > > consumption became significant. Most important, polling
> > > > > > > > > > > all ports leads to high cache miss, high latency and low throughput.
> > > > > > > > > > >
> > > > > > > > > > > This patch introduces shared RX queue. Ports with same
> > > > > > > > > > > configuration in a switch domain could share RX queue set by specifying sharing group.
> > > > > > > > > > > Polling any queue using same shared RX queue receives
> > > > > > > > > > > packets from all member ports. Source port is identified by mbuf->port.
> > > > > > > > > > >
> > > > > > > > > > > Port queue number in a shared group should be identical.
> > > > > > > > > > > Queue index is
> > > > > > > > > > > 1:1 mapped in shared group.
> > > > > > > > > > >
> > > > > > > > > > > Share RX queue must be polled on single thread or core.
> > > > > > > > > > >
> > > > > > > > > > > Multiple groups is supported by group ID.
> > > > > > > > > > >
> > > > > > > > > > > Signed-off-by: Xueming Li <xuemingl@nvidia.com>
> > > > > > > > > > > Cc: Jerin Jacob <jerinjacobk@gmail.com>
> > > > > > > > > > > ---
> > > > > > > > > > > Rx queue object could be used as shared Rx queue object,
> > > > > > > > > > > it's important to clear all queue control callback api that using queue object:
> > > > > > > > > > >
> > > > > > > > > > > https://mails.dpdk.org/archives/dev/2021-July/215574.html
> > > > > > > > > >
> > > > > > > > > > >  #undef RTE_RX_OFFLOAD_BIT2STR diff --git
> > > > > > > > > > > a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h index
> > > > > > > > > > > d2b27c351f..a578c9db9d 100644
> > > > > > > > > > > --- a/lib/ethdev/rte_ethdev.h
> > > > > > > > > > > +++ b/lib/ethdev/rte_ethdev.h
> > > > > > > > > > > @@ -1047,6 +1047,7 @@ struct rte_eth_rxconf {
> > > > > > > > > > >         uint8_t rx_drop_en; /**< Drop packets if no descriptors are available. */
> > > > > > > > > > >         uint8_t rx_deferred_start; /**< Do not start queue with rte_eth_dev_start(). */
> > > > > > > > > > >         uint16_t rx_nseg; /**< Number of descriptions in rx_seg array.
> > > > > > > > > > > */
> > > > > > > > > > > +       uint32_t shared_group; /**< Shared port group
> > > > > > > > > > > + index in switch domain. */
> > > > > > > > > >
> > > > > > > > > > Not to able to see anyone setting/creating this group ID test application.
> > > > > > > > > > How this group is created?
> > > > > > > > >
> > > > > > > > > Nice catch, the initial testpmd version only support one default group(0).
> > > > > > > > > All ports that supports shared-rxq assigned in same group.
> > > > > > > > >
> > > > > > > > > We should be able to change "--rxq-shared" to "--rxq-shared-group"
> > > > > > > > > to support group other than default.
> > > > > > > > >
> > > > > > > > > To support more groups simultaneously, need to consider
> > > > > > > > > testpmd forwarding stream core assignment, all streams in same group need to stay on same core.
> > > > > > > > > It's possible to specify how many ports to increase group
> > > > > > > > > number, but user must schedule stream affinity carefully - error prone.
> > > > > > > > >
> > > > > > > > > On the other hand, one group should be sufficient for most
> > > > > > > > > customer, the doubt is whether it valuable to support multiple groups test.
> > > > > > > >
> > > > > > > > Ack. One group is enough in testpmd.
> > > > > > > >
> > > > > > > > My question was more about who and how this group is created,
> > > > > > > > Should n't we need API to create shared_group? If we do the following, at least, I can think, how it can be implemented in SW
> > > > or other HW.
> > > > > > > >
> > > > > > > > - Create aggregation queue group
> > > > > > > > - Attach multiple  Rx queues to the aggregation queue group
> > > > > > > > - Pull the packets from the queue group(which internally fetch
> > > > > > > > from the Rx queues _attached_)
> > > > > > > >
> > > > > > > > Does the above kind of sequence, break your representor use case?
> > > > > > >
> > > > > > > Seems more like a set of EAL wrapper. Current API tries to minimize the application efforts to adapt shared-rxq.
> > > > > > > - step 1, not sure how important it is to create group with API, in rte_flow, group is created on demand.
> > > > > >
> > > > > > Which rte_flow pattern/action for this?
> > > > >
> > > > > No rte_flow for this, just recalled that the group in rte_flow is not created along with flow, not via api.
> > > > > I don’t see anything else to create along with group, just double whether it valuable to introduce a new api set to manage group.
> > > >
> > > > See below.
> > > >
> > > > >
> > > > > >
> > > > > > > - step 2, currently, the attaching is done in rte_eth_rx_queue_setup, specify offload and group in rx_conf struct.
> > > > > > > - step 3, define a dedicate api to receive packets from shared rxq? Looks clear to receive packets from shared rxq.
> > > > > > >   currently, rxq objects in share group is same - the shared rxq, so the eth callback eth_rx_burst_t(rxq_obj, mbufs, n) could
> > > > > > >   be used to receive packets from any ports in group, normally the first port(PF) in group.
> > > > > > >   An alternative way is defining a vdev with same queue number and copy rxq objects will make the vdev a proxy of
> > > > > > >   the shared rxq group - this could be an helper API.
> > > > > > >
> > > > > > > Anyway the wrapper doesn't break use case, step 3 api is more clear, need to understand how to implement efficiently.
> > > > > >
> > > > > > Are you doing this feature based on any HW support or it just pure
> > > > > > SW thing, If it is SW, It is better to have just new vdev for like drivers/net/bonding/. This we can help aggregate multiple Rxq across
> > > > the multiple ports of same the driver.
> > > > >
> > > > > Based on HW support.
> > > >
> > > > In Marvel HW, we do some support, I will outline here and some queries on this.
> > > >
> > > > # We need to create some new HW structure for aggregation # Connect each Rxq to the new HW structure for aggregation # Use
> > > > rx_burst from the new HW structure.
> > > >
> > > > Could you outline your HW support?
> > > >
> > > > Also, I am not able to understand how this will reduce the memory, atleast in our HW need creating more memory now to deal this as
> > > > we need to deal new HW structure.
> > > >
> > > > How is in your HW it reduces the memory? Also, if memory is the constraint, why NOT reduce the number of queues.
> > > >
> > >
> > > Glad to know that Marvel is working on this, what's the status of driver implementation?
> > >
> > > In my PMD implementation, it's very similar, a new HW object shared memory pool is created to replace per rxq memory pool.
> > > Legacy rxq feed queue with allocated mbufs as number of descriptors, now shared rxqs share the same pool, no need to supply
> > > mbufs for each rxq, just feed the shared rxq.
> > >
> > > So the memory saving reflects to mbuf per rxq, even 1000 representors in shared rxq group, the mbufs consumed is one rxq.
> > > In other words, new members in shared rxq doesn’t allocate new mbufs to feed rxq, just share with existing shared rxq(HW mempool).
> > > The memory required to setup each rxq doesn't change too much, agree.
> >
> > We can ask the application to configure the same mempool for multiple
> > RQ too. RIght? If the saving is based on sharing the mempool
> > with multiple RQs.
> >
> > >
> > > > # Also, I was thinking, one way to avoid the fast path or ABI change would like.
> > > >
> > > > # Driver Initializes one more eth_dev_ops in driver as aggregator ethdev # devargs of new ethdev or specific API like
> > > > drivers/net/bonding/rte_eth_bond.h can take the argument (port, queue) tuples which needs to aggregate by new ethdev port # No
> > > > change in fastpath or ABI is required in this model.
> > > >
> > >
> > > This could be an option to access shared rxq. What's the difference of the new PMD?
> >
> > No ABI and fast change are required.
> >
> > > What's the difference of PMD driver to create the new device?
> > >
> > > Is it important in your implementation? Does it work with existing rx_burst api?
> >
> > Yes . It will work with the existing rx_burst API.
> >
>
> The aggregator ethdev required by user is a port, maybe it good to add
> a callback for PMD to prepare a complete ethdev just like creating
> representor ethdev - pmd register new port internally. If the PMD
> doens't provide the callback, ethdev api fallback to initialize an
> empty ethdev by copy rxq data(shared) and rx_burst api from source port
> and share group. Actually users can do this fallback themselves or with
> an util api.
>
> IIUC, an aggregator ethdev not a must, do you think we can continue and
> leave that design in later stage?


IMO aggregator ethdev reduces the complexity for application hence
avoid any change in
test application etc. IMO, I prefer to take that. I will leave the
decision to ethdev maintainers.


>
> > >
> > > >
> > > >
> > > > > Most user might uses PF in group as the anchor port to rx burst, current definition should be easy for them to migrate.
> > > > > but some user might prefer grouping some hot
> > > > > plug/unpluggedrepresentors, EAL could provide wrappers, users could do that either due to the strategy not complex enough.
> > > > Anyway, welcome any suggestion.
> > > > >
> > > > > >
> > > > > >
> > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > >         /**
> > > > > > > > > > >          * Per-queue Rx offloads to be set using DEV_RX_OFFLOAD_* flags.
> > > > > > > > > > >          * Only offloads set on rx_queue_offload_capa or
> > > > > > > > > > > rx_offload_capa @@ -1373,6 +1374,12 @@ struct rte_eth_conf
> > > > > > > > > > > { #define DEV_RX_OFFLOAD_OUTER_UDP_CKSUM  0x00040000
> > > > > > > > > > >  #define DEV_RX_OFFLOAD_RSS_HASH                0x00080000
> > > > > > > > > > >  #define RTE_ETH_RX_OFFLOAD_BUFFER_SPLIT 0x00100000
> > > > > > > > > > > +/**
> > > > > > > > > > > + * Rx queue is shared among ports in same switch domain
> > > > > > > > > > > +to save memory,
> > > > > > > > > > > + * avoid polling each port. Any port in group can be used to receive packets.
> > > > > > > > > > > + * Real source port number saved in mbuf->port field.
> > > > > > > > > > > + */
> > > > > > > > > > > +#define RTE_ETH_RX_OFFLOAD_SHARED_RXQ   0x00200000
> > > > > > > > > > >
> > > > > > > > > > >  #define DEV_RX_OFFLOAD_CHECKSUM (DEV_RX_OFFLOAD_IPV4_CKSUM | \
> > > > > > > > > > >                                  DEV_RX_OFFLOAD_UDP_CKSUM
> > > > > > > > > > > > \
> > > > > > > > > > > --
> > > > > > > > > > > 2.25.1
> > > > > > > > > > >
>

^ permalink raw reply	[relevance 0%]

* Re: [dpdk-dev] [PATCH v2 1/6] security: add SA lifetime configuration
  2021-09-07 16:32  8%   ` [dpdk-dev] [PATCH v2 1/6] security: add SA lifetime configuration Anoob Joseph
@ 2021-09-16 11:06  0%     ` Ananyev, Konstantin
  2021-09-17  4:48  0%       ` Anoob Joseph
  0 siblings, 1 reply; 200+ results
From: Ananyev, Konstantin @ 2021-09-16 11:06 UTC (permalink / raw)
  To: Anoob Joseph, Akhil Goyal, Doherty, Declan, Zhang, Roy Fan
  Cc: Jerin Jacob, Archana Muniganti, Tejasree Kondoj, Hemant Agrawal,
	Nicolau, Radu, Power, Ciara, Gagandeep Singh, dev


> Add SA lifetime configuration to register soft and hard expiry limits.
> Expiry can be in units of number of packets or bytes. Crypto op
> status is also updated to include new field, aux_flags, which can be
> used to indicate cases such as soft expiry in case of lookaside
> protocol operations.
> 
> In case of soft expiry, the packets are successfully IPsec processed but
> the soft expiry would indicate that SA needs to be reconfigured. For
> inline protocol capable ethdev, this would result in an eth event while
> for lookaside protocol capable cryptodev, this can be communicated via
> `rte_crypto_op.aux_flags` field.
> 
> In case of hard expiry, the packets will not be IPsec processed and
> would result in error.
> 
> Signed-off-by: Anoob Joseph <anoobj@marvell.com>
> ---
>  .../test_cryptodev_security_ipsec_test_vectors.h   |  3 ---
>  doc/guides/rel_notes/deprecation.rst               |  5 ----
>  doc/guides/rel_notes/release_21_11.rst             | 13 ++++++++++
>  examples/ipsec-secgw/ipsec.c                       |  2 +-
>  examples/ipsec-secgw/ipsec.h                       |  2 +-
>  lib/cryptodev/rte_crypto.h                         | 18 +++++++++++++-
>  lib/security/rte_security.h                        | 28 ++++++++++++++++++++--
>  7 files changed, 58 insertions(+), 13 deletions(-)
> 
> diff --git a/app/test/test_cryptodev_security_ipsec_test_vectors.h b/app/test/test_cryptodev_security_ipsec_test_vectors.h
> index ae9cd24..38ea43d 100644
> --- a/app/test/test_cryptodev_security_ipsec_test_vectors.h
> +++ b/app/test/test_cryptodev_security_ipsec_test_vectors.h
> @@ -98,7 +98,6 @@ struct ipsec_test_data pkt_aes_128_gcm = {
>  		.proto = RTE_SECURITY_IPSEC_SA_PROTO_ESP,
>  		.mode = RTE_SECURITY_IPSEC_SA_MODE_TUNNEL,
>  		.tunnel.type = RTE_SECURITY_IPSEC_TUNNEL_IPV4,
> -		.esn_soft_limit = 0,
>  		.replay_win_sz = 0,
>  	},
> 
> @@ -195,7 +194,6 @@ struct ipsec_test_data pkt_aes_192_gcm = {
>  		.proto = RTE_SECURITY_IPSEC_SA_PROTO_ESP,
>  		.mode = RTE_SECURITY_IPSEC_SA_MODE_TUNNEL,
>  		.tunnel.type = RTE_SECURITY_IPSEC_TUNNEL_IPV4,
> -		.esn_soft_limit = 0,
>  		.replay_win_sz = 0,
>  	},
> 
> @@ -295,7 +293,6 @@ struct ipsec_test_data pkt_aes_256_gcm = {
>  		.proto = RTE_SECURITY_IPSEC_SA_PROTO_ESP,
>  		.mode = RTE_SECURITY_IPSEC_SA_MODE_TUNNEL,
>  		.tunnel.type = RTE_SECURITY_IPSEC_TUNNEL_IPV4,
> -		.esn_soft_limit = 0,
>  		.replay_win_sz = 0,
>  	},
> 
> diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
> index 76a4abf..6118f06 100644
> --- a/doc/guides/rel_notes/deprecation.rst
> +++ b/doc/guides/rel_notes/deprecation.rst
> @@ -282,8 +282,3 @@ Deprecation Notices
>  * security: The functions ``rte_security_set_pkt_metadata`` and
>    ``rte_security_get_userdata`` will be made inline functions and additional
>    flags will be added in structure ``rte_security_ctx`` in DPDK 21.11.
> -
> -* cryptodev: The structure ``rte_crypto_op`` would be updated to reduce
> -  reserved bytes to 2 (from 3), and use 1 byte to indicate warnings and other
> -  information from the crypto/security operation. This field will be used to
> -  communicate events such as soft expiry with IPsec in lookaside mode.
> diff --git a/doc/guides/rel_notes/release_21_11.rst b/doc/guides/rel_notes/release_21_11.rst
> index 9b14c84..0e3ed28 100644
> --- a/doc/guides/rel_notes/release_21_11.rst
> +++ b/doc/guides/rel_notes/release_21_11.rst
> @@ -102,6 +102,13 @@ API Changes
>     Also, make sure to start the actual text at the margin.
>     =======================================================
> 
> +* cryptodev: use 1 reserved byte from ``rte_crypto_op`` for aux flags
> +
> +  * Updated the structure ``rte_crypto_op`` to reduce reserved bytes to
> +  2 (from 3), and use 1 byte to indicate warnings and other information from
> +  the crypto/security operation. This field will be used to communicate events
> +  such as soft expiry with IPsec in lookaside mode.
> +
> 
>  ABI Changes
>  -----------
> @@ -123,6 +130,12 @@ ABI Changes
>    * Added IPsec SA option to disable IV generation to allow known vector
>      tests as well as usage of application provided IV on supported PMDs.
> 
> +* security: add IPsec SA lifetime configuration
> +
> +  * Added IPsec SA lifetime configuration to allow applications to configure
> +    soft and hard SA expiry limits. Limits can be either in units of packets or
> +    bytes.
> +
> 
>  Known Issues
>  ------------
> diff --git a/examples/ipsec-secgw/ipsec.c b/examples/ipsec-secgw/ipsec.c
> index 5b032fe..4868294 100644
> --- a/examples/ipsec-secgw/ipsec.c
> +++ b/examples/ipsec-secgw/ipsec.c
> @@ -49,7 +49,7 @@ set_ipsec_conf(struct ipsec_sa *sa, struct rte_security_ipsec_xform *ipsec)
>  		}
>  		/* TODO support for Transport */
>  	}
> -	ipsec->esn_soft_limit = IPSEC_OFFLOAD_ESN_SOFTLIMIT;
> +	ipsec->life.packets_soft_limit = IPSEC_OFFLOAD_PKTS_SOFTLIMIT;
>  	ipsec->replay_win_sz = app_sa_prm.window_size;
>  	ipsec->options.esn = app_sa_prm.enable_esn;
>  	ipsec->options.udp_encap = sa->udp_encap;
> diff --git a/examples/ipsec-secgw/ipsec.h b/examples/ipsec-secgw/ipsec.h
> index ae5058d..90c81c1 100644
> --- a/examples/ipsec-secgw/ipsec.h
> +++ b/examples/ipsec-secgw/ipsec.h
> @@ -23,7 +23,7 @@
> 
>  #define MAX_DIGEST_SIZE 32 /* Bytes -- 256 bits */
> 
> -#define IPSEC_OFFLOAD_ESN_SOFTLIMIT 0xffffff00
> +#define IPSEC_OFFLOAD_PKTS_SOFTLIMIT 0xffffff00
> 
>  #define IV_OFFSET		(sizeof(struct rte_crypto_op) + \
>  				sizeof(struct rte_crypto_sym_op))
> diff --git a/lib/cryptodev/rte_crypto.h b/lib/cryptodev/rte_crypto.h
> index fd5ef3a..d602183 100644
> --- a/lib/cryptodev/rte_crypto.h
> +++ b/lib/cryptodev/rte_crypto.h
> @@ -66,6 +66,17 @@ enum rte_crypto_op_sess_type {
>  };
> 
>  /**
> + * Auxiliary flags to indicate additional info from the operation
> + */
> +
> +/**
> + * Auxiliary flags related to IPsec offload with RTE_SECURITY
> + */

Duplicate comments.

> +
> +#define RTE_CRYPTO_OP_AUX_FLAGS_IPSEC_SOFT_EXPIRY (1 << 0)
> +/**< SA soft expiry limit has been reached */
> +
> +/**
>   * Cryptographic Operation.
>   *
>   * This structure contains data relating to performing cryptographic
> @@ -93,7 +104,12 @@ struct rte_crypto_op {
>  			 */
>  			uint8_t sess_type;
>  			/**< operation session type */
> -			uint8_t reserved[3];
> +			uint8_t aux_flags;
> +			/**< Operation specific auxiliary/additional flags.
> +			 * These flags carry additional information from the
> +			 * operation. Processing of the same is optional.
> +			 */
> +			uint8_t reserved[2];
>  			/**< Reserved bytes to fill 64 bits for
>  			 * future additions
>  			 */
> diff --git a/lib/security/rte_security.h b/lib/security/rte_security.h
> index b4b6776..95c169d 100644
> --- a/lib/security/rte_security.h
> +++ b/lib/security/rte_security.h
> @@ -206,6 +206,30 @@ enum rte_security_ipsec_sa_direction {
>  };
> 
>  /**
> + * Configure soft and hard lifetime of an IPsec SA
> + *
> + * Lifetime of an IPsec SA would specify the maximum number of packets or bytes
> + * that can be processed. IPsec operations would start failing once any hard
> + * limit is reached.
> + *
> + * Soft limits can be specified to generate notification when the SA is
> + * approaching hard limits for lifetime. For inline operations, reaching soft
> + * expiry limit would result in raising an eth event for the same. For lookaside
> + * operations, this would result in a warning returned in
> + * ``rte_crypto_op.aux_flags``.
> + */
> +struct rte_security_ipsec_lifetime {
> +	uint64_t packets_soft_limit;
> +	/**< Soft expiry limit in number of packets */
> +	uint64_t bytes_soft_limit;
> +	/**< Soft expiry limit in bytes */
> +	uint64_t packets_hard_limit;
> +	/**< Soft expiry limit in number of packets */
> +	uint64_t bytes_hard_limit;
> +	/**< Soft expiry limit in bytes */
> +};
> +
> +/**
>   * IPsec security association configuration data.
>   *
>   * This structure contains data required to create an IPsec SA security session.
> @@ -225,8 +249,8 @@ struct rte_security_ipsec_xform {
>  	/**< IPsec SA Mode - transport/tunnel */
>  	struct rte_security_ipsec_tunnel_param tunnel;
>  	/**< Tunnel parameters, NULL for transport mode */
> -	uint64_t esn_soft_limit;
> -	/**< ESN for which the overflow event need to be raised */
> +	struct rte_security_ipsec_lifetime life;
> +	/**< IPsec SA lifetime */
>  	uint32_t replay_win_sz;
>  	/**< Anti replay window size to enable sequence replay attack handling.
>  	 * replay checking is disabled if the window size is 0.
> --

Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>

> 2.7.4


^ permalink raw reply	[relevance 0%]

* Re: [dpdk-dev] [PATCH v3 1/3] security: support user specified IV
  2021-09-07 16:17  5%     ` [dpdk-dev] [PATCH v3 1/3] security: support user specified IV Anoob Joseph
@ 2021-09-16 11:14  0%       ` Ananyev, Konstantin
  0 siblings, 0 replies; 200+ results
From: Ananyev, Konstantin @ 2021-09-16 11:14 UTC (permalink / raw)
  To: Anoob Joseph, Akhil Goyal, Doherty, Declan, Zhang, Roy Fan
  Cc: Jerin Jacob, Archana Muniganti, Tejasree Kondoj, Hemant Agrawal,
	Nicolau, Radu, Power, Ciara, Gagandeep Singh, dev


> 
> Enable user to provide IV to be used per security operation. This
> would be used with lookaside protocol offload for comparing
> against known vectors.
> 
> By default, PMD would generate IV internally and would be random.
> 
> Signed-off-by: Anoob Joseph <anoobj@marvell.com>
> Acked-by: Akhil Goyal <gakhil@marvell.com>
> ---
>  doc/guides/rel_notes/release_21_11.rst |  5 +++++
>  lib/security/rte_security.h            | 14 ++++++++++++++
>  2 files changed, 19 insertions(+)
> 
> diff --git a/doc/guides/rel_notes/release_21_11.rst b/doc/guides/rel_notes/release_21_11.rst
> index 411fa95..9b14c84 100644
> --- a/doc/guides/rel_notes/release_21_11.rst
> +++ b/doc/guides/rel_notes/release_21_11.rst
> @@ -118,6 +118,11 @@ ABI Changes
>     Also, make sure to start the actual text at the margin.
>     =======================================================
> 
> +* security: add IPsec SA option to disable IV generation
> +
> +  * Added IPsec SA option to disable IV generation to allow known vector
> +    tests as well as usage of application provided IV on supported PMDs.
> +
> 
>  Known Issues
>  ------------
> diff --git a/lib/security/rte_security.h b/lib/security/rte_security.h
> index 88d31de..b4b6776 100644
> --- a/lib/security/rte_security.h
> +++ b/lib/security/rte_security.h
> @@ -181,6 +181,20 @@ struct rte_security_ipsec_sa_options {
>  	 * * 0: Disable per session security statistics collection for this SA.
>  	 */
>  	uint32_t stats : 1;
> +
> +	/** Disable IV generation in PMD
> +	 *
> +	 * * 1: Disable IV generation in PMD. When disabled, IV provided in
> +	 *      rte_crypto_op will be used by the PMD.
> +	 *
> +	 * * 0: Enable IV generation in PMD. When enabled, PMD generated random
> +	 *      value would be used and application is not required to provide
> +	 *      IV.
> +	 *
> +	 * Note: For inline cases, IV generation would always need to be handled
> +	 * by the PMD.
> +	 */
> +	uint32_t iv_gen_disable : 1;
>  };
> 
>  /** IPSec security association direction */
> --

Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>

> 2.7.4


^ permalink raw reply	[relevance 0%]

* Re: [dpdk-dev] [PATCH] net: promote make rarp packet API as stable
  2021-09-08 10:59  3% [dpdk-dev] [PATCH] net: promote make rarp packet API as stable Xiao Wang
  2021-09-08  4:52  0% ` Stephen Hemminger
  2021-09-08  5:07  0% ` Xia, Chenbo
@ 2021-09-16 11:38  0% ` Olivier Matz
  2 siblings, 0 replies; 200+ results
From: Olivier Matz @ 2021-09-16 11:38 UTC (permalink / raw)
  To: Xiao Wang; +Cc: dev

On Wed, Sep 08, 2021 at 06:59:15PM +0800, Xiao Wang wrote:
> rte_net_make_rarp_packet was introduced in version v18.02, there was no
> change in this public API since then, and it's still being used by vhost
> lib and virtio driver, so promote it as stable ABI.
> 
> Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>

Acked-by: Olivier Matz <olivier.matz@6wind.com>

^ permalink raw reply	[relevance 0%]

* Re: [dpdk-dev] [PATCH 2/8] cryptodev: move inline APIs into separate structure
    2021-09-13 14:11  0%   ` Zhang, Roy Fan
@ 2021-09-16 15:21  0%   ` Ananyev, Konstantin
  1 sibling, 0 replies; 200+ results
From: Ananyev, Konstantin @ 2021-09-16 15:21 UTC (permalink / raw)
  To: Akhil Goyal, dev
  Cc: anoobj, Nicolau, Radu, Doherty, Declan, hemant.agrawal, matan,
	thomas, Zhang, Roy Fan, asomalap, ruifeng.wang, ajit.khaparde,
	De Lara Guarch, Pablo, Trahe, Fiona, adwivedi, michaelsh,
	rnagadheeraj, jianjay.zhou, jerinj

Hi Akhil,

Overall, looks good to me.
Few comments below.
Konstantin

> Move fastpath inline function pointers from rte_cryptodev into a
> separate structure accessed via a flat array.
> The intension is to make rte_cryptodev and related structures private
> to avoid future API/ABI breakages.
> 
> Signed-off-by: Akhil Goyal <gakhil@marvell.com>
> ---
>  lib/cryptodev/cryptodev_pmd.c      | 33 ++++++++++++++++++++++++++++++
>  lib/cryptodev/cryptodev_pmd.h      |  9 ++++++++
>  lib/cryptodev/rte_cryptodev.c      |  3 +++
>  lib/cryptodev/rte_cryptodev_core.h | 19 +++++++++++++++++
>  lib/cryptodev/version.map          |  4 ++++
>  5 files changed, 68 insertions(+)
> 
> diff --git a/lib/cryptodev/cryptodev_pmd.c b/lib/cryptodev/cryptodev_pmd.c
> index 71e34140cd..46772dc355 100644
> --- a/lib/cryptodev/cryptodev_pmd.c
> +++ b/lib/cryptodev/cryptodev_pmd.c
> @@ -158,3 +158,36 @@ rte_cryptodev_pmd_destroy(struct rte_cryptodev *cryptodev)
> 
>  	return 0;
>  }
> +
> +static uint16_t
> +dummy_crypto_enqueue_burst(__rte_unused uint8_t dev_id,
> +			  __rte_unused uint8_t qp_id,
> +			  __rte_unused struct rte_crypto_op **ops,
> +			  __rte_unused uint16_t nb_ops)
> +{
> +	CDEV_LOG_ERR(
> +		"crypto enqueue burst requested for unconfigured crypto device");
> +	return 0;
> +}
> +
> +static uint16_t
> +dummy_crypto_dequeue_burst(__rte_unused uint8_t dev_id,
> +			  __rte_unused uint8_t qp_id,
> +			  __rte_unused struct rte_crypto_op **ops,
> +			  __rte_unused uint16_t nb_ops)
> +{
> +	CDEV_LOG_ERR(
> +		"crypto enqueue burst requested for unconfigured crypto device");
> +	return 0;
> +}
> +
> +void
> +rte_cryptodev_api_reset(struct rte_cryptodev_api *api)
> +{
> +	static const struct rte_cryptodev_api dummy = {
> +		.enqueue_burst = dummy_crypto_enqueue_burst,
> +		.dequeue_burst = dummy_crypto_dequeue_burst,
> +	};
> +
> +	*api = dummy;
> +}
> diff --git a/lib/cryptodev/cryptodev_pmd.h b/lib/cryptodev/cryptodev_pmd.h
> index f775ba6beb..eeaea13a23 100644
> --- a/lib/cryptodev/cryptodev_pmd.h
> +++ b/lib/cryptodev/cryptodev_pmd.h
> @@ -520,6 +520,15 @@ RTE_INIT(init_ ##driver_id)\
>  	driver_id = rte_cryptodev_allocate_driver(&crypto_drv, &(drv));\
>  }
> 
> +/**
> + * Reset crypto device fastpath APIs to dummy values.
> + *
> + * @param The *api* pointer to reset.
> + */
> +__rte_internal
> +void
> +rte_cryptodev_api_reset(struct rte_cryptodev_api *api);
> +
>  static inline void *
>  get_sym_session_private_data(const struct rte_cryptodev_sym_session *sess,
>  		uint8_t driver_id) {
> diff --git a/lib/cryptodev/rte_cryptodev.c b/lib/cryptodev/rte_cryptodev.c
> index 9fa3aff1d3..26f8390668 100644
> --- a/lib/cryptodev/rte_cryptodev.c
> +++ b/lib/cryptodev/rte_cryptodev.c
> @@ -54,6 +54,9 @@ static struct rte_cryptodev_global cryptodev_globals = {
>  		.nb_devs		= 0
>  };
> 
> +/* Public fastpath APIs. */
> +struct rte_cryptodev_api *rte_cryptodev_api;

I think it has to be an statically allocated array:
struct rte_cryptodev_api rte_cryptodev_api[RTE_CRYPTO_MAX_DEVS];
Other alternative would be to allocate space for it at some RTE_INIT() function,
but not sure is it really worth it.

Another thing - to make things a bit more error prone - probably
need to fill it with dummy pointers at RTE_INIT timeframe.
Also, I think we need to call rte_cryptodev_api_reset() at 
rte_cryptodev_pmd_destroy() or so.

> +
>  /* spinlock for crypto device callbacks */
>  static rte_spinlock_t rte_cryptodev_cb_lock = RTE_SPINLOCK_INITIALIZER;
> 
> diff --git a/lib/cryptodev/rte_cryptodev_core.h b/lib/cryptodev/rte_cryptodev_core.h
> index 1633e55889..ec38f70e0c 100644
> --- a/lib/cryptodev/rte_cryptodev_core.h
> +++ b/lib/cryptodev/rte_cryptodev_core.h
> @@ -25,6 +25,25 @@ typedef uint16_t (*enqueue_pkt_burst_t)(void *qp,
>  		struct rte_crypto_op **ops,	uint16_t nb_ops);
>  /**< Enqueue packets for processing on queue pair of a device. */
> 
> +typedef uint16_t (*rte_crypto_dequeue_burst_t)(uint8_t dev_id, uint8_t qp_id,
> +					      struct rte_crypto_op **ops,
> +					      uint16_t nb_ops);
> +/**< @internal Dequeue processed packets from queue pair of a device. */
> +typedef uint16_t (*rte_crypto_enqueue_burst_t)(uint8_t dev_id, uint8_t qp_id,
> +					      struct rte_crypto_op **ops,
> +					      uint16_t nb_ops);
> +/**< @internal Enqueue packets for processing on queue pair of a device. */
> +
> +struct rte_cryptodev_api {
> +	rte_crypto_enqueue_burst_t enqueue_burst;
> +	/**< PMD enqueue burst function. */
> +	rte_crypto_dequeue_burst_t dequeue_burst;
> +	/**< PMD dequeue burst function. */
> +	uintptr_t reserved[6];
> +} __rte_cache_aligned;
> +
> +extern struct rte_cryptodev_api *rte_cryptodev_api;
> +
>  /**
>   * @internal
>   * The data part, with no function pointers, associated with each device.
> diff --git a/lib/cryptodev/version.map b/lib/cryptodev/version.map
> index 2fdf70002d..050089ae55 100644
> --- a/lib/cryptodev/version.map
> +++ b/lib/cryptodev/version.map
> @@ -57,6 +57,9 @@ DPDK_22 {
>  	rte_cryptodev_sym_session_init;
>  	rte_cryptodevs;
> 
> +	#added in 21.11
> +	rte_cryptodev_api;
> +
>  	local: *;
>  };
> 
> @@ -114,6 +117,7 @@ INTERNAL {
>  	global:
> 
>  	rte_cryptodev_allocate_driver;
> +	rte_cryptodev_api_reset;
>  	rte_cryptodev_pmd_allocate;
>  	rte_cryptodev_pmd_callback_process;
>  	rte_cryptodev_pmd_create;
> --
> 2.25.1


^ permalink raw reply	[relevance 0%]

* [dpdk-dev] [PATCH v10 06/12] pdump: support pcapng and filtering
  @ 2021-09-16 22:26  1%   ` Stephen Hemminger
  2021-09-16 22:26  1%   ` [dpdk-dev] [PATCH v10 11/12] doc: changes for new pcapng and dumpcap Stephen Hemminger
  1 sibling, 0 replies; 200+ results
From: Stephen Hemminger @ 2021-09-16 22:26 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

This enhances the DPDK pdump library to support new
pcapng format and filtering via BPF.

The internal client/server protocol is changed to support
two versions: the original pdump basic version and a
new pcapng version.

The internal version number (not part of exposed API or ABI)
is intentionally increased to cause any attempt to try
mismatched primary/secondary process to fail.

Add new API to do allow filtering of captured packets with
DPDK BPF (eBPF) filter program. It keeps statistics
on packets captured, filtered, and missed (because ring was full).

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/meson.build       |   4 +-
 lib/pdump/meson.build |   2 +-
 lib/pdump/rte_pdump.c | 441 ++++++++++++++++++++++++++++++------------
 lib/pdump/rte_pdump.h | 110 ++++++++++-
 lib/pdump/version.map |   8 +
 5 files changed, 437 insertions(+), 128 deletions(-)

diff --git a/lib/meson.build b/lib/meson.build
index ba88e9eabc58..1da521ea6185 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -26,6 +26,7 @@ libraries = [
         'timer',   # eventdev depends on this
         'acl',
         'bbdev',
+        'bpf',
         'bitratestats',
         'cfgfile',
         'compressdev',
@@ -43,7 +44,6 @@ libraries = [
         'member',
         'pcapng',
         'power',
-        'pdump',
         'rawdev',
         'regexdev',
         'rib',
@@ -55,10 +55,10 @@ libraries = [
         'ipsec', # ipsec lib depends on net, crypto and security
         'fib', #fib lib depends on rib
         'port', # pkt framework libs which use other libs from above
+        'pdump', # pdump lib depends on bpf pcapng
         'table',
         'pipeline',
         'flow_classify', # flow_classify lib depends on pkt framework table lib
-        'bpf',
         'graph',
         'node',
 ]
diff --git a/lib/pdump/meson.build b/lib/pdump/meson.build
index 3a95eabde6a6..51ceb2afdec5 100644
--- a/lib/pdump/meson.build
+++ b/lib/pdump/meson.build
@@ -3,4 +3,4 @@
 
 sources = files('rte_pdump.c')
 headers = files('rte_pdump.h')
-deps += ['ethdev']
+deps += ['ethdev', 'bpf', 'pcapng']
diff --git a/lib/pdump/rte_pdump.c b/lib/pdump/rte_pdump.c
index 382217bc1564..abc28fcee0ad 100644
--- a/lib/pdump/rte_pdump.c
+++ b/lib/pdump/rte_pdump.c
@@ -7,8 +7,10 @@
 #include <rte_ethdev.h>
 #include <rte_lcore.h>
 #include <rte_log.h>
+#include <rte_memzone.h>
 #include <rte_errno.h>
 #include <rte_string_fns.h>
+#include <rte_pcapng.h>
 
 #include "rte_pdump.h"
 
@@ -27,30 +29,26 @@ enum pdump_operation {
 	ENABLE = 2
 };
 
+/*
+ * Note: version numbers intentionally start at 3
+ * in order to catch any application built with older out
+ * version of DPDK using incompatible client request format.
+ */
 enum pdump_version {
-	V1 = 1
+	PDUMP_CLIENT_LEGACY = 3,
+	PDUMP_CLIENT_PCAPNG = 4,
 };
 
 struct pdump_request {
 	uint16_t ver;
 	uint16_t op;
-	uint32_t flags;
-	union pdump_data {
-		struct enable_v1 {
-			char device[RTE_DEV_NAME_MAX_LEN];
-			uint16_t queue;
-			struct rte_ring *ring;
-			struct rte_mempool *mp;
-			void *filter;
-		} en_v1;
-		struct disable_v1 {
-			char device[RTE_DEV_NAME_MAX_LEN];
-			uint16_t queue;
-			struct rte_ring *ring;
-			struct rte_mempool *mp;
-			void *filter;
-		} dis_v1;
-	} data;
+	uint16_t flags;
+	uint16_t queue;
+	struct rte_ring *ring;
+	struct rte_mempool *mp;
+	const struct rte_bpf_prm *prm;
+	uint32_t snaplen;
+	char device[RTE_DEV_NAME_MAX_LEN];
 };
 
 struct pdump_response {
@@ -63,80 +61,140 @@ static struct pdump_rxtx_cbs {
 	struct rte_ring *ring;
 	struct rte_mempool *mp;
 	const struct rte_eth_rxtx_callback *cb;
-	void *filter;
+	const struct rte_bpf *filter;
+	enum pdump_version ver;
+	uint32_t snaplen;
 } rx_cbs[RTE_MAX_ETHPORTS][RTE_MAX_QUEUES_PER_PORT],
 tx_cbs[RTE_MAX_ETHPORTS][RTE_MAX_QUEUES_PER_PORT];
 
-
-static inline void
-pdump_copy(struct rte_mbuf **pkts, uint16_t nb_pkts, void *user_params)
+static const char *MZ_RTE_PDUMP_STATS = "rte_pdump_stats";
+
+/* Shared memory between primary and secondary processes. */
+static struct {
+	struct rte_pdump_stats rx[RTE_MAX_ETHPORTS][RTE_MAX_QUEUES_PER_PORT];
+	struct rte_pdump_stats tx[RTE_MAX_ETHPORTS][RTE_MAX_QUEUES_PER_PORT];
+} *pdump_stats;
+
+/* Create a clone of mbuf to be placed into ring. */
+static void
+pdump_copy(uint16_t port_id, uint16_t queue,
+	   enum rte_pcapng_direction direction,
+	   struct rte_mbuf **pkts, uint16_t nb_pkts,
+	   const struct pdump_rxtx_cbs *cbs,
+	   struct rte_pdump_stats *stats)
 {
 	unsigned int i;
 	int ring_enq;
 	uint16_t d_pkts = 0;
 	struct rte_mbuf *dup_bufs[nb_pkts];
-	struct pdump_rxtx_cbs *cbs;
+	uint64_t ts;
 	struct rte_ring *ring;
 	struct rte_mempool *mp;
 	struct rte_mbuf *p;
+	uint64_t rcs[nb_pkts];
+
+	if (cbs->filter &&
+	    rte_bpf_exec_burst(cbs->filter, (void **)pkts, rcs, nb_pkts) == 0) {
+		/* All packets were filtered out */
+		__atomic_fetch_add(&stats->filtered, nb_pkts,
+				   __ATOMIC_RELAXED);
+		return;
+	}
 
-	cbs  = user_params;
+	ts = rte_get_tsc_cycles();
 	ring = cbs->ring;
 	mp = cbs->mp;
 	for (i = 0; i < nb_pkts; i++) {
-		p = rte_pktmbuf_copy(pkts[i], mp, 0, UINT32_MAX);
-		if (p)
+		/*
+		 * Similar behavior to rte_bpf_eth callback.
+		 * if BPF program returns zero value for a given packet,
+		 * then it will be ignored.
+		 */
+		if (cbs->filter && rcs[i] == 0) {
+			__atomic_fetch_add(&stats->filtered,
+					   1, __ATOMIC_RELAXED);
+			continue;
+		}
+
+		/*
+		 * If using pcapng then want to wrap packets
+		 * otherwise a simple copy.
+		 */
+		if (cbs->ver == PDUMP_CLIENT_PCAPNG)
+			p = rte_pcapng_copy(port_id, queue,
+					    pkts[i], mp, cbs->snaplen,
+					    ts, direction);
+		else
+			p = rte_pktmbuf_copy(pkts[i], mp, 0, cbs->snaplen);
+
+		if (unlikely(p == NULL))
+			__atomic_fetch_add(&stats->nombuf, 1, __ATOMIC_RELAXED);
+		else
 			dup_bufs[d_pkts++] = p;
 	}
 
+	__atomic_fetch_add(&stats->accepted, d_pkts, __ATOMIC_RELAXED);
+
 	ring_enq = rte_ring_enqueue_burst(ring, (void *)dup_bufs, d_pkts, NULL);
 	if (unlikely(ring_enq < d_pkts)) {
 		unsigned int drops = d_pkts - ring_enq;
 
-		PDUMP_LOG(DEBUG,
-			"only %d of packets enqueued to ring\n", ring_enq);
+		__atomic_fetch_add(&stats->ringfull, drops, __ATOMIC_RELAXED);
 		rte_pktmbuf_free_bulk(&dup_bufs[ring_enq], drops);
 	}
 }
 
 static uint16_t
-pdump_rx(uint16_t port __rte_unused, uint16_t qidx __rte_unused,
+pdump_rx(uint16_t port, uint16_t queue,
 	struct rte_mbuf **pkts, uint16_t nb_pkts,
-	uint16_t max_pkts __rte_unused,
-	void *user_params)
+	uint16_t max_pkts __rte_unused, void *user_params)
 {
-	pdump_copy(pkts, nb_pkts, user_params);
+	const struct pdump_rxtx_cbs *cbs = user_params;
+	struct rte_pdump_stats *stats = &pdump_stats->rx[port][queue];
+
+	pdump_copy(port, queue, RTE_PCAPNG_DIRECTION_IN,
+		   pkts, nb_pkts, cbs, stats);
 	return nb_pkts;
 }
 
 static uint16_t
-pdump_tx(uint16_t port __rte_unused, uint16_t qidx __rte_unused,
+pdump_tx(uint16_t port, uint16_t queue,
 		struct rte_mbuf **pkts, uint16_t nb_pkts, void *user_params)
 {
-	pdump_copy(pkts, nb_pkts, user_params);
+	const struct pdump_rxtx_cbs *cbs = user_params;
+	struct rte_pdump_stats *stats = &pdump_stats->tx[port][queue];
+
+	pdump_copy(port, queue, RTE_PCAPNG_DIRECTION_OUT,
+		   pkts, nb_pkts, cbs, stats);
 	return nb_pkts;
 }
 
 static int
-pdump_register_rx_callbacks(uint16_t end_q, uint16_t port, uint16_t queue,
-				struct rte_ring *ring, struct rte_mempool *mp,
-				uint16_t operation)
+pdump_register_rx_callbacks(enum pdump_version ver,
+			    uint16_t end_q, uint16_t port, uint16_t queue,
+			    struct rte_ring *ring, struct rte_mempool *mp,
+			    struct rte_bpf *filter,
+			    uint16_t operation, uint32_t snaplen)
 {
 	uint16_t qid;
-	struct pdump_rxtx_cbs *cbs = NULL;
 
 	qid = (queue == RTE_PDUMP_ALL_QUEUES) ? 0 : queue;
 	for (; qid < end_q; qid++) {
-		cbs = &rx_cbs[port][qid];
-		if (cbs && operation == ENABLE) {
+		struct pdump_rxtx_cbs *cbs = &rx_cbs[port][qid];
+
+		if (operation == ENABLE) {
 			if (cbs->cb) {
 				PDUMP_LOG(ERR,
 					"rx callback for port=%d queue=%d, already exists\n",
 					port, qid);
 				return -EEXIST;
 			}
+			cbs->ver = ver;
 			cbs->ring = ring;
 			cbs->mp = mp;
+			cbs->snaplen = snaplen;
+			cbs->filter = filter;
+
 			cbs->cb = rte_eth_add_first_rx_callback(port, qid,
 								pdump_rx, cbs);
 			if (cbs->cb == NULL) {
@@ -145,8 +203,7 @@ pdump_register_rx_callbacks(uint16_t end_q, uint16_t port, uint16_t queue,
 					rte_errno);
 				return rte_errno;
 			}
-		}
-		if (cbs && operation == DISABLE) {
+		} else if (operation == DISABLE) {
 			int ret;
 
 			if (cbs->cb == NULL) {
@@ -170,26 +227,32 @@ pdump_register_rx_callbacks(uint16_t end_q, uint16_t port, uint16_t queue,
 }
 
 static int
-pdump_register_tx_callbacks(uint16_t end_q, uint16_t port, uint16_t queue,
-				struct rte_ring *ring, struct rte_mempool *mp,
-				uint16_t operation)
+pdump_register_tx_callbacks(enum pdump_version ver,
+			    uint16_t end_q, uint16_t port, uint16_t queue,
+			    struct rte_ring *ring, struct rte_mempool *mp,
+			    struct rte_bpf *filter,
+			    uint16_t operation, uint32_t snaplen)
 {
 
 	uint16_t qid;
-	struct pdump_rxtx_cbs *cbs = NULL;
 
 	qid = (queue == RTE_PDUMP_ALL_QUEUES) ? 0 : queue;
 	for (; qid < end_q; qid++) {
-		cbs = &tx_cbs[port][qid];
-		if (cbs && operation == ENABLE) {
+		struct pdump_rxtx_cbs *cbs = &tx_cbs[port][qid];
+
+		if (operation == ENABLE) {
 			if (cbs->cb) {
 				PDUMP_LOG(ERR,
 					"tx callback for port=%d queue=%d, already exists\n",
 					port, qid);
 				return -EEXIST;
 			}
+			cbs->ver = ver;
 			cbs->ring = ring;
 			cbs->mp = mp;
+			cbs->snaplen = snaplen;
+			cbs->filter = filter;
+
 			cbs->cb = rte_eth_add_tx_callback(port, qid, pdump_tx,
 								cbs);
 			if (cbs->cb == NULL) {
@@ -198,8 +261,7 @@ pdump_register_tx_callbacks(uint16_t end_q, uint16_t port, uint16_t queue,
 					rte_errno);
 				return rte_errno;
 			}
-		}
-		if (cbs && operation == DISABLE) {
+		} else if (operation == DISABLE) {
 			int ret;
 
 			if (cbs->cb == NULL) {
@@ -228,37 +290,47 @@ set_pdump_rxtx_cbs(const struct pdump_request *p)
 	uint16_t nb_rx_q = 0, nb_tx_q = 0, end_q, queue;
 	uint16_t port;
 	int ret = 0;
+	struct rte_bpf *filter = NULL;
 	uint32_t flags;
 	uint16_t operation;
 	struct rte_ring *ring;
 	struct rte_mempool *mp;
 
-	flags = p->flags;
-	operation = p->op;
-	if (operation == ENABLE) {
-		ret = rte_eth_dev_get_port_by_name(p->data.en_v1.device,
-				&port);
-		if (ret < 0) {
+	if (!(p->ver == PDUMP_CLIENT_LEGACY ||
+	      p->ver == PDUMP_CLIENT_PCAPNG)) {
+		PDUMP_LOG(ERR,
+			  "incorrect client version %u\n", p->ver);
+		return -EINVAL;
+	}
+
+	if (p->prm) {
+		if (p->prm->prog_arg.type != RTE_BPF_ARG_PTR_MBUF) {
 			PDUMP_LOG(ERR,
-				"failed to get port id for device id=%s\n",
-				p->data.en_v1.device);
+				  "invalid BPF program type: %u\n",
+				  p->prm->prog_arg.type);
 			return -EINVAL;
 		}
-		queue = p->data.en_v1.queue;
-		ring = p->data.en_v1.ring;
-		mp = p->data.en_v1.mp;
-	} else {
-		ret = rte_eth_dev_get_port_by_name(p->data.dis_v1.device,
-				&port);
-		if (ret < 0) {
-			PDUMP_LOG(ERR,
-				"failed to get port id for device id=%s\n",
-				p->data.dis_v1.device);
-			return -EINVAL;
+
+		filter = rte_bpf_load(p->prm);
+		if (filter == NULL) {
+			PDUMP_LOG(ERR, "cannot load BPF filter: %s\n",
+				  rte_strerror(rte_errno));
+			return -rte_errno;
 		}
-		queue = p->data.dis_v1.queue;
-		ring = p->data.dis_v1.ring;
-		mp = p->data.dis_v1.mp;
+	}
+
+	flags = p->flags;
+	operation = p->op;
+	queue = p->queue;
+	ring = p->ring;
+	mp = p->mp;
+
+	ret = rte_eth_dev_get_port_by_name(p->device, &port);
+	if (ret < 0) {
+		PDUMP_LOG(ERR,
+			  "failed to get port id for device id=%s\n",
+			  p->device);
+		return -EINVAL;
 	}
 
 	/* validation if packet capture is for all queues */
@@ -296,8 +368,9 @@ set_pdump_rxtx_cbs(const struct pdump_request *p)
 	/* register RX callback */
 	if (flags & RTE_PDUMP_FLAG_RX) {
 		end_q = (queue == RTE_PDUMP_ALL_QUEUES) ? nb_rx_q : queue + 1;
-		ret = pdump_register_rx_callbacks(end_q, port, queue, ring, mp,
-							operation);
+		ret = pdump_register_rx_callbacks(p->ver, end_q, port, queue,
+						  ring, mp, filter,
+						  operation, p->snaplen);
 		if (ret < 0)
 			return ret;
 	}
@@ -305,8 +378,9 @@ set_pdump_rxtx_cbs(const struct pdump_request *p)
 	/* register TX callback */
 	if (flags & RTE_PDUMP_FLAG_TX) {
 		end_q = (queue == RTE_PDUMP_ALL_QUEUES) ? nb_tx_q : queue + 1;
-		ret = pdump_register_tx_callbacks(end_q, port, queue, ring, mp,
-							operation);
+		ret = pdump_register_tx_callbacks(p->ver, end_q, port, queue,
+						  ring, mp, filter,
+						  operation, p->snaplen);
 		if (ret < 0)
 			return ret;
 	}
@@ -332,7 +406,7 @@ pdump_server(const struct rte_mp_msg *mp_msg, const void *peer)
 		resp->err_value = set_pdump_rxtx_cbs(cli_req);
 	}
 
-	strlcpy(mp_resp.name, PDUMP_MP, RTE_MP_MAX_NAME_LEN);
+	rte_strscpy(mp_resp.name, PDUMP_MP, RTE_MP_MAX_NAME_LEN);
 	mp_resp.len_param = sizeof(*resp);
 	mp_resp.num_fds = 0;
 	if (rte_mp_reply(&mp_resp, peer) < 0) {
@@ -347,8 +421,18 @@ pdump_server(const struct rte_mp_msg *mp_msg, const void *peer)
 int
 rte_pdump_init(void)
 {
+	const struct rte_memzone *mz;
 	int ret;
 
+	mz = rte_memzone_reserve(MZ_RTE_PDUMP_STATS, sizeof(*pdump_stats),
+				 rte_socket_id(), 0);
+	if (mz == NULL) {
+		PDUMP_LOG(ERR, "cannot allocate pdump statistics\n");
+		rte_errno = ENOMEM;
+		return -1;
+	}
+	pdump_stats = mz->addr;
+
 	ret = rte_mp_action_register(PDUMP_MP, pdump_server);
 	if (ret && rte_errno != ENOTSUP)
 		return -1;
@@ -392,14 +476,21 @@ pdump_validate_ring_mp(struct rte_ring *ring, struct rte_mempool *mp)
 static int
 pdump_validate_flags(uint32_t flags)
 {
-	if (flags != RTE_PDUMP_FLAG_RX && flags != RTE_PDUMP_FLAG_TX &&
-		flags != RTE_PDUMP_FLAG_RXTX) {
+	if ((flags & RTE_PDUMP_FLAG_RXTX) == 0) {
 		PDUMP_LOG(ERR,
 			"invalid flags, should be either rx/tx/rxtx\n");
 		rte_errno = EINVAL;
 		return -1;
 	}
 
+	/* mask off the flags we know about */
+	if (flags & ~(RTE_PDUMP_FLAG_RXTX | RTE_PDUMP_FLAG_PCAPNG)) {
+		PDUMP_LOG(ERR,
+			  "unknown flags: %#x\n", flags);
+		rte_errno = ENOTSUP;
+		return -1;
+	}
+
 	return 0;
 }
 
@@ -426,12 +517,12 @@ pdump_validate_port(uint16_t port, char *name)
 }
 
 static int
-pdump_prepare_client_request(char *device, uint16_t queue,
-				uint32_t flags,
-				uint16_t operation,
-				struct rte_ring *ring,
-				struct rte_mempool *mp,
-				void *filter)
+pdump_prepare_client_request(const char *device, uint16_t queue,
+			     uint32_t flags, uint32_t snaplen,
+			     uint16_t operation,
+			     struct rte_ring *ring,
+			     struct rte_mempool *mp,
+			     const struct rte_bpf_prm *prm)
 {
 	int ret = -1;
 	struct rte_mp_msg mp_req, *mp_rep;
@@ -440,26 +531,26 @@ pdump_prepare_client_request(char *device, uint16_t queue,
 	struct pdump_request *req = (struct pdump_request *)mp_req.param;
 	struct pdump_response *resp;
 
-	req->ver = 1;
-	req->flags = flags;
+	memset(req, 0, sizeof(*req));
+	if (flags & RTE_PDUMP_FLAG_PCAPNG)
+		req->ver = PDUMP_CLIENT_PCAPNG;
+	else
+		req->ver = PDUMP_CLIENT_LEGACY;
+
+	req->flags = flags & RTE_PDUMP_FLAG_RXTX;
 	req->op = operation;
+	req->queue = queue;
+	rte_strscpy(req->device, device, sizeof(req->device));
+
 	if ((operation & ENABLE) != 0) {
-		strlcpy(req->data.en_v1.device, device,
-			sizeof(req->data.en_v1.device));
-		req->data.en_v1.queue = queue;
-		req->data.en_v1.ring = ring;
-		req->data.en_v1.mp = mp;
-		req->data.en_v1.filter = filter;
-	} else {
-		strlcpy(req->data.dis_v1.device, device,
-			sizeof(req->data.dis_v1.device));
-		req->data.dis_v1.queue = queue;
-		req->data.dis_v1.ring = NULL;
-		req->data.dis_v1.mp = NULL;
-		req->data.dis_v1.filter = NULL;
+		req->queue = queue;
+		req->ring = ring;
+		req->mp = mp;
+		req->prm = prm;
+		req->snaplen = snaplen;
 	}
 
-	strlcpy(mp_req.name, PDUMP_MP, RTE_MP_MAX_NAME_LEN);
+	rte_strscpy(mp_req.name, PDUMP_MP, RTE_MP_MAX_NAME_LEN);
 	mp_req.len_param = sizeof(*req);
 	mp_req.num_fds = 0;
 	if (rte_mp_request_sync(&mp_req, &mp_reply, &ts) == 0) {
@@ -477,11 +568,17 @@ pdump_prepare_client_request(char *device, uint16_t queue,
 	return ret;
 }
 
-int
-rte_pdump_enable(uint16_t port, uint16_t queue, uint32_t flags,
-			struct rte_ring *ring,
-			struct rte_mempool *mp,
-			void *filter)
+/*
+ * There are two versions of this function, because although original API
+ * left place holder for future filter, it never checked the value.
+ * Therefore the API can't depend on application passing a non
+ * bogus value.
+ */
+static int
+pdump_enable(uint16_t port, uint16_t queue,
+	     uint32_t flags, uint32_t snaplen,
+	     struct rte_ring *ring, struct rte_mempool *mp,
+	     const struct rte_bpf_prm *prm)
 {
 	int ret;
 	char name[RTE_DEV_NAME_MAX_LEN];
@@ -496,20 +593,42 @@ rte_pdump_enable(uint16_t port, uint16_t queue, uint32_t flags,
 	if (ret < 0)
 		return ret;
 
-	ret = pdump_prepare_client_request(name, queue, flags,
-						ENABLE, ring, mp, filter);
+	if (snaplen == 0)
+		snaplen = UINT32_MAX;
 
-	return ret;
+	return pdump_prepare_client_request(name, queue, flags, snaplen,
+					    ENABLE, ring, mp, prm);
 }
 
 int
-rte_pdump_enable_by_deviceid(char *device_id, uint16_t queue,
-				uint32_t flags,
-				struct rte_ring *ring,
-				struct rte_mempool *mp,
-				void *filter)
+rte_pdump_enable(uint16_t port, uint16_t queue, uint32_t flags,
+		 struct rte_ring *ring,
+		 struct rte_mempool *mp,
+		 void *filter __rte_unused)
 {
-	int ret = 0;
+	return pdump_enable(port, queue, flags, 0,
+			    ring, mp, NULL);
+}
+
+int
+rte_pdump_enable_bpf(uint16_t port, uint16_t queue,
+		     uint32_t flags, uint32_t snaplen,
+		     struct rte_ring *ring,
+		     struct rte_mempool *mp,
+		     const struct rte_bpf_prm *prm)
+{
+	return pdump_enable(port, queue, flags, snaplen,
+			    ring, mp, prm);
+}
+
+static int
+pdump_enable_by_deviceid(const char *device_id, uint16_t queue,
+			 uint32_t flags, uint32_t snaplen,
+			 struct rte_ring *ring,
+			 struct rte_mempool *mp,
+			 const struct rte_bpf_prm *prm)
+{
+	int ret;
 
 	ret = pdump_validate_ring_mp(ring, mp);
 	if (ret < 0)
@@ -518,10 +637,30 @@ rte_pdump_enable_by_deviceid(char *device_id, uint16_t queue,
 	if (ret < 0)
 		return ret;
 
-	ret = pdump_prepare_client_request(device_id, queue, flags,
-						ENABLE, ring, mp, filter);
+	return pdump_prepare_client_request(device_id, queue, flags, snaplen,
+					    ENABLE, ring, mp, prm);
+}
 
-	return ret;
+int
+rte_pdump_enable_by_deviceid(char *device_id, uint16_t queue,
+			     uint32_t flags,
+			     struct rte_ring *ring,
+			     struct rte_mempool *mp,
+			     void *filter __rte_unused)
+{
+	return pdump_enable_by_deviceid(device_id, queue, flags, 0,
+					ring, mp, NULL);
+}
+
+int
+rte_pdump_enable_bpf_by_deviceid(const char *device_id, uint16_t queue,
+				 uint32_t flags, uint32_t snaplen,
+				 struct rte_ring *ring,
+				 struct rte_mempool *mp,
+				 const struct rte_bpf_prm *prm)
+{
+	return pdump_enable_by_deviceid(device_id, queue, flags, snaplen,
+					ring, mp, prm);
 }
 
 int
@@ -537,8 +676,8 @@ rte_pdump_disable(uint16_t port, uint16_t queue, uint32_t flags)
 	if (ret < 0)
 		return ret;
 
-	ret = pdump_prepare_client_request(name, queue, flags,
-						DISABLE, NULL, NULL, NULL);
+	ret = pdump_prepare_client_request(name, queue, flags, 0,
+					   DISABLE, NULL, NULL, NULL);
 
 	return ret;
 }
@@ -553,8 +692,66 @@ rte_pdump_disable_by_deviceid(char *device_id, uint16_t queue,
 	if (ret < 0)
 		return ret;
 
-	ret = pdump_prepare_client_request(device_id, queue, flags,
-						DISABLE, NULL, NULL, NULL);
+	ret = pdump_prepare_client_request(device_id, queue, flags, 0,
+					   DISABLE, NULL, NULL, NULL);
 
 	return ret;
 }
+
+static void
+pdump_sum_stats(uint16_t port, uint16_t nq,
+		struct rte_pdump_stats stats[RTE_MAX_ETHPORTS][RTE_MAX_QUEUES_PER_PORT],
+		struct rte_pdump_stats *total)
+{
+	uint64_t *sum = (uint64_t *)total;
+	unsigned int i;
+	uint64_t val;
+	uint16_t qid;
+
+	for (qid = 0; qid < nq; qid++) {
+		const uint64_t *perq = (const uint64_t *)&stats[port][qid];
+
+		for (i = 0; i < sizeof(*total) / sizeof(uint64_t); i++) {
+			val = __atomic_load_n(&perq[i], __ATOMIC_RELAXED);
+			sum[i] += val;
+		}
+	}
+}
+
+int
+rte_pdump_stats(uint16_t port, struct rte_pdump_stats *stats)
+{
+	struct rte_eth_dev_info dev_info;
+	const struct rte_memzone *mz;
+	int ret;
+
+	memset(stats, 0, sizeof(*stats));
+	ret = rte_eth_dev_info_get(port, &dev_info);
+	if (ret != 0) {
+		PDUMP_LOG(ERR,
+			  "Error during getting device (port %u) info: %s\n",
+			  port, strerror(-ret));
+		return ret;
+	}
+
+	if (pdump_stats == NULL) {
+		if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
+			PDUMP_LOG(ERR,
+				  "pdump not initialized\n");
+			rte_errno = EINVAL;
+			return -1;
+		}
+
+		mz = rte_memzone_lookup(MZ_RTE_PDUMP_STATS);
+		if (mz == NULL) {
+			PDUMP_LOG(ERR, "can not find pdump stats\n");
+			rte_errno = EINVAL;
+			return -1;
+		}
+		pdump_stats = mz->addr;
+	}
+
+	pdump_sum_stats(port, dev_info.nb_rx_queues, pdump_stats->rx, stats);
+	pdump_sum_stats(port, dev_info.nb_tx_queues, pdump_stats->tx, stats);
+	return 0;
+}
diff --git a/lib/pdump/rte_pdump.h b/lib/pdump/rte_pdump.h
index 6b00fc17aeb2..be3fd14c4bd3 100644
--- a/lib/pdump/rte_pdump.h
+++ b/lib/pdump/rte_pdump.h
@@ -15,6 +15,7 @@
 #include <stdint.h>
 #include <rte_mempool.h>
 #include <rte_ring.h>
+#include <rte_bpf.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -26,7 +27,9 @@ enum {
 	RTE_PDUMP_FLAG_RX = 1,  /* receive direction */
 	RTE_PDUMP_FLAG_TX = 2,  /* transmit direction */
 	/* both receive and transmit directions */
-	RTE_PDUMP_FLAG_RXTX = (RTE_PDUMP_FLAG_RX|RTE_PDUMP_FLAG_TX)
+	RTE_PDUMP_FLAG_RXTX = (RTE_PDUMP_FLAG_RX|RTE_PDUMP_FLAG_TX),
+
+	RTE_PDUMP_FLAG_PCAPNG = 4, /* format for pcapng */
 };
 
 /**
@@ -68,7 +71,7 @@ rte_pdump_uninit(void);
  * @param mp
  *  mempool on to which original packets will be mirrored or duplicated.
  * @param filter
- *  place holder for packet filtering.
+ *  Unused should be NULL.
  *
  * @return
  *    0 on success, -1 on error, rte_errno is set accordingly.
@@ -80,6 +83,41 @@ rte_pdump_enable(uint16_t port, uint16_t queue, uint32_t flags,
 		struct rte_mempool *mp,
 		void *filter);
 
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
+ *
+ * Enables packet capturing on given port and queue with filtering.
+ *
+ * @param port_id
+ *  The Ethernet port on which packet capturing should be enabled.
+ * @param queue
+ *  The queue on the Ethernet port which packet capturing
+ *  should be enabled. Pass UINT16_MAX to enable packet capturing on all
+ *  queues of a given port.
+ * @param flags
+ *  Pdump library flags that specify direction and packet format.
+ * @param snaplen
+ *  The upper limit on bytes to copy.
+ *  Passing UINT32_MAX means capture all the possible data.
+ * @param ring
+ *  The ring on which captured packets will be enqueued for user.
+ * @param mp
+ *  The mempool on to which original packets will be mirrored or duplicated.
+ * @param prm
+ *  Use BPF program to run to filter packes (can be NULL)
+ *
+ * @return
+ *    0 on success, -1 on error, rte_errno is set accordingly.
+ */
+__rte_experimental
+int
+rte_pdump_enable_bpf(uint16_t port_id, uint16_t queue,
+		     uint32_t flags, uint32_t snaplen,
+		     struct rte_ring *ring,
+		     struct rte_mempool *mp,
+		     const struct rte_bpf_prm *prm);
+
 /**
  * Disables packet capturing on given port and queue.
  *
@@ -118,7 +156,7 @@ rte_pdump_disable(uint16_t port, uint16_t queue, uint32_t flags);
  * @param mp
  *  mempool on to which original packets will be mirrored or duplicated.
  * @param filter
- *  place holder for packet filtering.
+ *  unused should be NULL
  *
  * @return
  *    0 on success, -1 on error, rte_errno is set accordingly.
@@ -131,6 +169,43 @@ rte_pdump_enable_by_deviceid(char *device_id, uint16_t queue,
 				struct rte_mempool *mp,
 				void *filter);
 
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
+ *
+ * Enables packet capturing on given device id and queue with filtering.
+ * device_id can be name or pci address of device.
+ *
+ * @param device_id
+ *  device id on which packet capturing should be enabled.
+ * @param queue
+ *  The queue on the Ethernet port which packet capturing
+ *  should be enabled. Pass UINT16_MAX to enable packet capturing on all
+ *  queues of a given port.
+ * @param flags
+ *  Pdump library flags that specify direction and packet format.
+ * @param snaplen
+ *  The upper limit on bytes to copy.
+ *  Passing UINT32_MAX means capture all the possible data.
+ * @param ring
+ *  The ring on which captured packets will be enqueued for user.
+ * @param mp
+ *  The mempool on to which original packets will be mirrored or duplicated.
+ * @param filter
+ *  Use BPF program to run to filter packes (can be NULL)
+ *
+ * @return
+ *    0 on success, -1 on error, rte_errno is set accordingly.
+ */
+__rte_experimental
+int
+rte_pdump_enable_bpf_by_deviceid(const char *device_id, uint16_t queue,
+				 uint32_t flags, uint32_t snaplen,
+				 struct rte_ring *ring,
+				 struct rte_mempool *mp,
+				 const struct rte_bpf_prm *filter);
+
+
 /**
  * Disables packet capturing on given device_id and queue.
  * device_id can be name or pci address of device.
@@ -153,6 +228,35 @@ int
 rte_pdump_disable_by_deviceid(char *device_id, uint16_t queue,
 				uint32_t flags);
 
+
+/**
+ * A structure used to retrieve statistics from packet capture.
+ * The statistics are sum of both receive and transmit queues.
+ */
+struct rte_pdump_stats {
+	uint64_t accepted; /**< Number of packets accepted by filter. */
+	uint64_t filtered; /**< Number of packets rejected by filter. */
+	uint64_t nombuf;   /**< Number of mbuf allocation failures. */
+	uint64_t ringfull; /**< Number of missed packets due to ring full. */
+
+	uint64_t reserved[4]; /**< Reserved and pad to cache line */
+};
+
+/**
+ * Retrieve the packet capture statistics for a queue.
+ *
+ * @param port_id
+ *   The port identifier of the Ethernet device.
+ * @param stats
+ *   A pointer to structure of type *rte_pdump_stats* to be filled in.
+ * @return
+ *   Zero if successful. -1 on error and rte_errno is set.
+ */
+__rte_experimental
+int
+rte_pdump_stats(uint16_t port_id, struct rte_pdump_stats *stats);
+
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/lib/pdump/version.map b/lib/pdump/version.map
index f0a9d12c9a9e..ce5502d9cdf4 100644
--- a/lib/pdump/version.map
+++ b/lib/pdump/version.map
@@ -10,3 +10,11 @@ DPDK_22 {
 
 	local: *;
 };
+
+EXPERIMENTAL {
+	global:
+
+	rte_pdump_enable_bpf;
+	rte_pdump_enable_bpf_by_deviceid;
+	rte_pdump_stats;
+};
-- 
2.30.2


^ permalink raw reply	[relevance 1%]

* [dpdk-dev] [PATCH v10 11/12] doc: changes for new pcapng and dumpcap
    2021-09-16 22:26  1%   ` [dpdk-dev] [PATCH v10 06/12] pdump: support pcapng and filtering Stephen Hemminger
@ 2021-09-16 22:26  1%   ` Stephen Hemminger
  1 sibling, 0 replies; 200+ results
From: Stephen Hemminger @ 2021-09-16 22:26 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

Describe the new packet capture library and utilities

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 doc/api/doxy-api-index.md                     |  1 +
 doc/api/doxy-api.conf.in                      |  1 +
 .../howto/img/packet_capture_framework.svg    | 96 +++++++++----------
 doc/guides/howto/packet_capture_framework.rst | 67 ++++++-------
 doc/guides/prog_guide/index.rst               |  1 +
 doc/guides/prog_guide/pcapng_lib.rst          | 24 +++++
 doc/guides/prog_guide/pdump_lib.rst           | 28 ++++--
 doc/guides/rel_notes/release_21_11.rst        | 10 ++
 doc/guides/tools/dumpcap.rst                  | 86 +++++++++++++++++
 doc/guides/tools/index.rst                    |  1 +
 10 files changed, 228 insertions(+), 87 deletions(-)
 create mode 100644 doc/guides/prog_guide/pcapng_lib.rst
 create mode 100644 doc/guides/tools/dumpcap.rst

diff --git a/doc/api/doxy-api-index.md b/doc/api/doxy-api-index.md
index 1992107a0356..ee07394d1c78 100644
--- a/doc/api/doxy-api-index.md
+++ b/doc/api/doxy-api-index.md
@@ -223,3 +223,4 @@ The public API headers are grouped by topics:
   [experimental APIs]  (@ref rte_compat.h),
   [ABI versioning]     (@ref rte_function_versioning.h),
   [version]            (@ref rte_version.h)
+  [pcapng]             (@ref rte_pcapng.h)
diff --git a/doc/api/doxy-api.conf.in b/doc/api/doxy-api.conf.in
index 325a0195c6ab..aba17799a9a1 100644
--- a/doc/api/doxy-api.conf.in
+++ b/doc/api/doxy-api.conf.in
@@ -58,6 +58,7 @@ INPUT                   = @TOPDIR@/doc/api/doxy-api-index.md \
                           @TOPDIR@/lib/metrics \
                           @TOPDIR@/lib/node \
                           @TOPDIR@/lib/net \
+                          @TOPDIR@/lib/pcapng \
                           @TOPDIR@/lib/pci \
                           @TOPDIR@/lib/pdump \
                           @TOPDIR@/lib/pipeline \
diff --git a/doc/guides/howto/img/packet_capture_framework.svg b/doc/guides/howto/img/packet_capture_framework.svg
index a76baf71fdee..1c2646a81096 100644
--- a/doc/guides/howto/img/packet_capture_framework.svg
+++ b/doc/guides/howto/img/packet_capture_framework.svg
@@ -1,6 +1,4 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
 <svg
    xmlns:osb="http://www.openswatchbook.org/uri/2009/osb"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
@@ -16,8 +14,8 @@
    viewBox="0 0 425.19685 283.46457"
    id="svg2"
    version="1.1"
-   inkscape:version="0.91 r13725"
-   sodipodi:docname="drawing-pcap.svg">
+   inkscape:version="1.0.2 (e86c870879, 2021-01-15)"
+   sodipodi:docname="packet_capture_framework.svg">
   <defs
      id="defs4">
     <marker
@@ -228,7 +226,7 @@
        x2="487.64606"
        y2="258.38232"
        gradientUnits="userSpaceOnUse"
-       gradientTransform="translate(-84.916417,744.90779)" />
+       gradientTransform="matrix(1.1457977,0,0,0.99944907,-151.97019,745.05014)" />
     <linearGradient
        inkscape:collect="always"
        xlink:href="#linearGradient5784"
@@ -277,17 +275,18 @@
      borderopacity="1.0"
      inkscape:pageopacity="0.0"
      inkscape:pageshadow="2"
-     inkscape:zoom="0.57434918"
-     inkscape:cx="215.17857"
-     inkscape:cy="285.26445"
+     inkscape:zoom="1"
+     inkscape:cx="226.77165"
+     inkscape:cy="78.124511"
      inkscape:document-units="px"
      inkscape:current-layer="layer1"
      showgrid="false"
-     inkscape:window-width="1874"
-     inkscape:window-height="971"
-     inkscape:window-x="2"
-     inkscape:window-y="24"
-     inkscape:window-maximized="0" />
+     inkscape:window-width="2560"
+     inkscape:window-height="1414"
+     inkscape:window-x="0"
+     inkscape:window-y="0"
+     inkscape:window-maximized="1"
+     inkscape:document-rotation="0" />
   <metadata
      id="metadata7">
     <rdf:RDF>
@@ -296,7 +295,7 @@
         <dc:format>image/svg+xml</dc:format>
         <dc:type
            rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
-        <dc:title></dc:title>
+        <dc:title />
       </cc:Work>
     </rdf:RDF>
   </metadata>
@@ -321,15 +320,15 @@
        y="790.82452" />
     <text
        xml:space="preserve"
-       style="font-style:normal;font-weight:normal;font-size:12.5px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
        x="61.050636"
        y="807.3205"
-       id="text4152"
-       sodipodi:linespacing="125%"><tspan
+       id="text4152"><tspan
          sodipodi:role="line"
          id="tspan4154"
          x="61.050636"
-         y="807.3205">DPDK Primary Application</tspan></text>
+         y="807.3205"
+         style="font-size:12.5px;line-height:1.25">DPDK Primary Application</tspan></text>
     <rect
        style="fill:#000000;fill-opacity:0;stroke:#257cdc;stroke-width:2;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
        id="rect4156-6"
@@ -339,19 +338,20 @@
        y="827.01843" />
     <text
        xml:space="preserve"
-       style="font-style:normal;font-weight:normal;font-size:12.5px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
        x="350.68585"
        y="841.16058"
-       id="text4189"
-       sodipodi:linespacing="125%"><tspan
+       id="text4189"><tspan
          sodipodi:role="line"
          id="tspan4191"
          x="350.68585"
-         y="841.16058">dpdk-pdump</tspan><tspan
+         y="841.16058"
+         style="font-size:12.5px;line-height:1.25">dpdk-dumpcap</tspan><tspan
          sodipodi:role="line"
          x="350.68585"
          y="856.78558"
-         id="tspan4193">tool</tspan></text>
+         id="tspan4193"
+         style="font-size:12.5px;line-height:1.25">tool</tspan></text>
     <rect
        style="fill:#000000;fill-opacity:0;stroke:#257cdc;stroke-width:2;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
        id="rect4156-6-4"
@@ -361,15 +361,15 @@
        y="891.16315" />
     <text
        xml:space="preserve"
-       style="font-style:normal;font-weight:normal;font-size:12.5px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
        x="352.70612"
        y="905.3053"
-       id="text4189-1"
-       sodipodi:linespacing="125%"><tspan
+       id="text4189-1"><tspan
          sodipodi:role="line"
          x="352.70612"
          y="905.3053"
-         id="tspan4193-3">PCAP PMD</tspan></text>
+         id="tspan4193-3"
+         style="font-size:12.5px;line-height:1.25">librte_pcapng</tspan></text>
     <rect
        style="fill:url(#linearGradient5745);fill-opacity:1;stroke:#257cdc;stroke-width:2;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
        id="rect4156-6-6"
@@ -379,15 +379,15 @@
        y="923.9931" />
     <text
        xml:space="preserve"
-       style="font-style:normal;font-weight:normal;font-size:12.5px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
        x="136.02846"
        y="938.13525"
-       id="text4189-0"
-       sodipodi:linespacing="125%"><tspan
+       id="text4189-0"><tspan
          sodipodi:role="line"
          x="136.02846"
          y="938.13525"
-         id="tspan4193-6">dpdk_port0</tspan></text>
+         id="tspan4193-6"
+         style="font-size:12.5px;line-height:1.25">dpdk_port0</tspan></text>
     <rect
        style="fill:#000000;fill-opacity:0;stroke:#257cdc;stroke-width:2;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
        id="rect4156-6-5"
@@ -397,33 +397,33 @@
        y="824.99817" />
     <text
        xml:space="preserve"
-       style="font-style:normal;font-weight:normal;font-size:12.5px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
        x="137.54369"
        y="839.14026"
-       id="text4189-4"
-       sodipodi:linespacing="125%"><tspan
+       id="text4189-4"><tspan
          sodipodi:role="line"
          x="137.54369"
          y="839.14026"
-         id="tspan4193-2">librte_pdump</tspan></text>
+         id="tspan4193-2"
+         style="font-size:12.5px;line-height:1.25">librte_pdump</tspan></text>
     <rect
-       style="fill:url(#linearGradient5788);fill-opacity:1;stroke:#257cdc;stroke-width:1;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       style="fill:url(#linearGradient5788);fill-opacity:1;stroke:#257cdc;stroke-width:1.07013;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
        id="rect4156-6-4-5"
-       width="94.449265"
-       height="35.355339"
-       x="307.7804"
-       y="985.61243" />
+       width="108.21974"
+       height="35.335861"
+       x="297.9809"
+       y="985.62219" />
     <text
        xml:space="preserve"
-       style="font-style:normal;font-weight:normal;font-size:12.5px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
        x="352.70618"
        y="999.75458"
-       id="text4189-1-8"
-       sodipodi:linespacing="125%"><tspan
+       id="text4189-1-8"><tspan
          sodipodi:role="line"
          x="352.70618"
          y="999.75458"
-         id="tspan4193-3-2">capture.pcap</tspan></text>
+         id="tspan4193-3-2"
+         style="font-size:12.5px;line-height:1.25">capture.pcapng</tspan></text>
     <rect
        style="fill:url(#linearGradient5788-1);fill-opacity:1;stroke:#257cdc;stroke-width:1.12555885;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
        id="rect4156-6-4-5-1"
@@ -433,15 +433,15 @@
        y="983.14984" />
     <text
        xml:space="preserve"
-       style="font-style:normal;font-weight:normal;font-size:12.5px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
        x="136.53352"
        y="1002.785"
-       id="text4189-1-8-4"
-       sodipodi:linespacing="125%"><tspan
+       id="text4189-1-8-4"><tspan
          sodipodi:role="line"
          x="136.53352"
          y="1002.785"
-         id="tspan4193-3-2-7">Traffic Generator</tspan></text>
+         id="tspan4193-3-2-7"
+         style="font-size:12.5px;line-height:1.25">Traffic Generator</tspan></text>
     <path
        style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#marker7331)"
        d="m 351.46948,927.02357 c 0,57.5787 0,57.5787 0,57.5787"
diff --git a/doc/guides/howto/packet_capture_framework.rst b/doc/guides/howto/packet_capture_framework.rst
index c31bac52340e..78baa609a021 100644
--- a/doc/guides/howto/packet_capture_framework.rst
+++ b/doc/guides/howto/packet_capture_framework.rst
@@ -1,18 +1,19 @@
 ..  SPDX-License-Identifier: BSD-3-Clause
     Copyright(c) 2017 Intel Corporation.
 
-DPDK pdump Library and pdump Tool
-=================================
+DPDK packet capture libraries and tools
+=======================================
 
 This document describes how the Data Plane Development Kit (DPDK) Packet
 Capture Framework is used for capturing packets on DPDK ports. It is intended
 for users of DPDK who want to know more about the Packet Capture feature and
 for those who want to monitor traffic on DPDK-controlled devices.
 
-The DPDK packet capture framework was introduced in DPDK v16.07. The DPDK
-packet capture framework consists of the DPDK pdump library and DPDK pdump
-tool.
-
+The DPDK packet capture framework was introduced in DPDK v16.07 and
+enhanced in 21.1. The DPDK packet capture framework consists of the
+libraries for collecting packets ``librte_pdump`` and writing packets
+to a file ``librte_pcapng``. There are two sample applications:
+``dpdk-dumpcap`` and older ``dpdk-pdump``.
 
 Introduction
 ------------
@@ -22,43 +23,46 @@ allow users to initialize the packet capture framework and to enable or
 disable packet capture. The library works on a multi process communication model and its
 usage is recommended for debugging purposes.
 
-The :ref:`dpdk-pdump <pdump_tool>` tool is developed based on the
-``librte_pdump`` library.  It runs as a DPDK secondary process and is capable
-of enabling or disabling packet capture on DPDK ports. The ``dpdk-pdump`` tool
-provides command-line options with which users can request enabling or
-disabling of the packet capture on DPDK ports.
+The :ref:`librte_pcapng <pcapng_library>` library provides the APIs to format
+packets and write them to a file in Pcapng format.
+
+
+The :ref:`dpdk-dumpcap <dumpcap_tool>` is a tool that captures packets in
+like Wireshark dumpcap does for Linux. It runs as a DPDK secondary process and
+captures packets from one or more interfaces and writes them to a file
+in Pcapng format.  The ``dpdk-dumpcap`` tool is designed to take
+most of the same options as the Wireshark ``dumpcap`` command.
 
-The application which initializes the packet capture framework will be a primary process
-and the application that enables or disables the packet capture will
-be a secondary process. The primary process sends the Rx and Tx packets from the DPDK ports
-to the secondary process.
+Without any options it will use the packet capture framework to
+capture traffic from the first available DPDK port.
 
 In DPDK the ``testpmd`` application can be used to initialize the packet
-capture framework and acts as a server, and the ``dpdk-pdump`` tool acts as a
+capture framework and acts as a server, and the ``dpdk-dumpcap`` tool acts as a
 client. To view Rx or Tx packets of ``testpmd``, the application should be
-launched first, and then the ``dpdk-pdump`` tool. Packets from ``testpmd``
-will be sent to the tool, which then sends them on to the Pcap PMD device and
-that device writes them to the Pcap file or to an external interface depending
-on the command-line option used.
+launched first, and then the ``dpdk-dumpcap`` tool. Packets from ``testpmd``
+will be sent to the tool, and then to the Pcapng file.
 
 Some things to note:
 
-* The ``dpdk-pdump`` tool can only be used in conjunction with a primary
+* All tools using ``librte_pdump`` can only be used in conjunction with a primary
   application which has the packet capture framework initialized already. In
   dpdk, only ``testpmd`` is modified to initialize packet capture framework,
-  other applications remain untouched. So, if the ``dpdk-pdump`` tool has to
+  other applications remain untouched. So, if the ``dpdk-dumpcap`` tool has to
   be used with any application other than the testpmd, the user needs to
   explicitly modify that application to call the packet capture framework
   initialization code. Refer to the ``app/test-pmd/testpmd.c`` code and look
   for ``pdump`` keyword to see how this is done.
 
-* The ``dpdk-pdump`` tool depends on the libpcap based PMD.
+* The ``dpdk-pdump`` tool is an older tool created as demonstration of ``librte_pdump``
+  library. The ``dpdk-pdump`` tool provides more limited functionality and
+  and depends on the Pcap PMD. It is retained only for compatibility reasons;
+  users should use ``dpdk-dumpcap`` instead.
 
 
 Test Environment
 ----------------
 
-The overview of using the Packet Capture Framework and the ``dpdk-pdump`` tool
+The overview of using the Packet Capture Framework and the ``dpdk-dumpcap`` utility
 for packet capturing on the DPDK port in
 :numref:`figure_packet_capture_framework`.
 
@@ -66,13 +70,13 @@ for packet capturing on the DPDK port in
 
 .. figure:: img/packet_capture_framework.*
 
-   Packet capturing on a DPDK port using the dpdk-pdump tool.
+   Packet capturing on a DPDK port using the dpdk-dumpcap utility.
 
 
 Running the Application
 -----------------------
 
-The following steps demonstrate how to run the ``dpdk-pdump`` tool to capture
+The following steps demonstrate how to run the ``dpdk-dumpcap`` tool to capture
 Rx side packets on dpdk_port0 in :numref:`figure_packet_capture_framework` and
 inspect them using ``tcpdump``.
 
@@ -80,16 +84,15 @@ inspect them using ``tcpdump``.
 
      sudo <build_dir>/app/dpdk-testpmd -c 0xf0 -n 4 -- -i --port-topology=chained
 
-#. Launch the pdump tool as follows::
+#. Launch the dpdk-dump as follows::
 
-     sudo <build_dir>/app/dpdk-pdump -- \
-          --pdump 'port=0,queue=*,rx-dev=/tmp/capture.pcap'
+     sudo <build_dir>/app/dpdk-dumpcap -w /tmp/capture.pcapng
 
 #. Send traffic to dpdk_port0 from traffic generator.
-   Inspect packets captured in the file capture.pcap using a tool
-   that can interpret Pcap files, for example tcpdump::
+   Inspect packets captured in the file capture.pcap using a tool such as
+   tcpdump or tshark that can interpret Pcapng files::
 
-     $tcpdump -nr /tmp/capture.pcap
+     $ tcpdump -nr /tmp/capture.pcapng
      reading from file /tmp/capture.pcap, link-type EN10MB (Ethernet)
      11:11:36.891404 IP 4.4.4.4.whois++ > 3.3.3.3.whois++: UDP, length 18
      11:11:36.891442 IP 4.4.4.4.whois++ > 3.3.3.3.whois++: UDP, length 18
diff --git a/doc/guides/prog_guide/index.rst b/doc/guides/prog_guide/index.rst
index 2dce507f46a3..b440c77c2ba1 100644
--- a/doc/guides/prog_guide/index.rst
+++ b/doc/guides/prog_guide/index.rst
@@ -43,6 +43,7 @@ Programmer's Guide
     ip_fragment_reassembly_lib
     generic_receive_offload_lib
     generic_segmentation_offload_lib
+    pcapng_lib
     pdump_lib
     multi_proc_support
     kernel_nic_interface
diff --git a/doc/guides/prog_guide/pcapng_lib.rst b/doc/guides/prog_guide/pcapng_lib.rst
new file mode 100644
index 000000000000..36379b530a57
--- /dev/null
+++ b/doc/guides/prog_guide/pcapng_lib.rst
@@ -0,0 +1,24 @@
+..  SPDX-License-Identifier: BSD-3-Clause
+    Copyright(c) 2016 Intel Corporation.
+
+.. _pcapng_library:
+
+Packet Capture File Writer
+==========================
+
+Pcapng is a library for creating files in Pcapng file format.
+The Pcapng file format is the default capture file format for modern
+network capture processing tools. It can be read by wireshark and tcpdump.
+
+Usage
+-----
+
+Before the library can be used the function ``rte_pcapng_init``
+should be called once to initialize timestamp computation.
+
+
+References
+----------
+* Draft RFC https://www.ietf.org/id/draft-tuexen-opsawg-pcapng-03.html
+
+* Project repository  https://github.com/pcapng/pcapng/
diff --git a/doc/guides/prog_guide/pdump_lib.rst b/doc/guides/prog_guide/pdump_lib.rst
index 62c0b015b2fe..9af91415e5ea 100644
--- a/doc/guides/prog_guide/pdump_lib.rst
+++ b/doc/guides/prog_guide/pdump_lib.rst
@@ -3,10 +3,10 @@
 
 .. _pdump_library:
 
-The librte_pdump Library
-========================
+The Packet Capture Library
+==========================
 
-The ``librte_pdump`` library provides a framework for packet capturing in DPDK.
+The DPDK ``pdump`` library provides a framework for packet capturing in DPDK.
 The library does the complete copy of the Rx and Tx mbufs to a new mempool and
 hence it slows down the performance of the applications, so it is recommended
 to use this library for debugging purposes.
@@ -23,11 +23,19 @@ or disable the packet capture, and to uninitialize it.
 
 * ``rte_pdump_enable()``:
   This API enables the packet capture on a given port and queue.
-  Note: The filter option in the API is a place holder for future enhancements.
+
+* ``rte_pdump_enable_bpf()``
+  This API enables the packet capture on a given port and queue.
+  It also allows setting an optional filter using DPDK BPF interpreter and
+  setting the captured packet length.
 
 * ``rte_pdump_enable_by_deviceid()``:
   This API enables the packet capture on a given device id (``vdev name or pci address``) and queue.
-  Note: The filter option in the API is a place holder for future enhancements.
+
+* ``rte_pdump_enable_bpf_by_deviceid()``
+  This API enables the packet capture on a given device id (``vdev name or pci address``) and queue.
+  It also allows seating an optional filter using DPDK BPF interpreter and
+  setting the captured packet length.
 
 * ``rte_pdump_disable()``:
   This API disables the packet capture on a given port and queue.
@@ -61,6 +69,12 @@ and enables the packet capture by registering the Ethernet RX and TX callbacks f
 and queue combinations. Then the primary process will mirror the packets to the new mempool and enqueue them to
 the rte_ring that secondary process have passed to these APIs.
 
+The packet ring supports one of two formats. The default format enqueues copies of the original packets
+into the rte_ring. If the ``RTE_PDUMP_FLAG_PCAPNG`` is set the mbuf data is extended with header and trailer
+to match the format of Pcapng enhanced packet block. The enhanced packet block has meta-data such as the
+timestamp, port and queue the packet was captured on. It is up to the application consuming the
+packets from the ring to select the format desired.
+
 The library APIs ``rte_pdump_disable()`` and ``rte_pdump_disable_by_deviceid()`` disables the packet capture.
 For the calls to these APIs from secondary process, the library creates the "pdump disable" request and sends
 the request to the primary process over the multi process channel. The primary process takes this request and
@@ -74,5 +88,5 @@ function.
 Use Case: Packet Capturing
 --------------------------
 
-The DPDK ``app/pdump`` tool is developed based on this library to capture packets in DPDK.
-Users can use this as an example to develop their own packet capturing tools.
+The DPDK ``app/dpdk-dumpcap`` utility uses this library
+to capture packets in DPDK.
diff --git a/doc/guides/rel_notes/release_21_11.rst b/doc/guides/rel_notes/release_21_11.rst
index 1d56fa9bf2f1..32ebdb97c96d 100644
--- a/doc/guides/rel_notes/release_21_11.rst
+++ b/doc/guides/rel_notes/release_21_11.rst
@@ -87,6 +87,16 @@ New Features
   Added command-line options to specify total number of processes and
   current process ID. Each process owns subset of Rx and Tx queues.
 
+* **Revised packet capture framework.**
+
+  * New dpdk-dumpcap program that has most of the features of the
+    wireshark dumpcap utility including: capture of multiple interfaces,
+    filtering, and stopping after number of bytes, packets.
+  * New library for writing pcapng packet capture files.
+  * Enhancements to the pdump library to support:
+    * Packet filter with BPF.
+    * Pcapng format with timestamps and meta-data.
+    * Fixes packet capture with stripped VLAN tags.
 
 Removed Items
 -------------
diff --git a/doc/guides/tools/dumpcap.rst b/doc/guides/tools/dumpcap.rst
new file mode 100644
index 000000000000..664ea0c79802
--- /dev/null
+++ b/doc/guides/tools/dumpcap.rst
@@ -0,0 +1,86 @@
+..  SPDX-License-Identifier: BSD-3-Clause
+    Copyright(c) 2020 Microsoft Corporation.
+
+.. _dumpcap_tool:
+
+dpdk-dumpcap Application
+========================
+
+The ``dpdk-dumpcap`` tool is a Data Plane Development Kit (DPDK)
+network traffic dump tool.  The interface is similar to  the dumpcap tool in Wireshark.
+It runs as a secondary DPDK process and lets you capture packets that are
+coming into and out of a DPDK primary process.
+The ``dpdk-dumpcap`` writes files in Pcapng packet format using
+capture file format is pcapng.
+
+Without any options set it will use DPDK to capture traffic from the first
+available DPDK interface and write the received raw packet data, along
+with timestamps into a pcapng file.
+
+If the ``-w`` option is not specified, ``dpdk-dumpcap`` writes to a newly
+create file with a name chosen based on interface name and timestamp.
+If ``-w`` option is specified, then that file is used.
+
+   .. Note::
+      * The ``dpdk-dumpcap`` tool can only be used in conjunction with a primary
+        application which has the packet capture framework initialized already.
+        In dpdk, only the ``testpmd`` is modified to initialize packet capture
+        framework, other applications remain untouched. So, if the ``dpdk-dumpcap``
+        tool has to be used with any application other than the testpmd, user
+        needs to explicitly modify that application to call packet capture
+        framework initialization code. Refer ``app/test-pmd/testpmd.c``
+        code to see how this is done.
+
+      * The ``dpdk-dumpcap`` tool runs as a DPDK secondary process. It exits when
+        the primary application exits.
+
+
+Running the Application
+-----------------------
+
+To list interfaces available for capture use ``--list-interfaces``.
+
+To filter packets in style of *tshark* use the ``-f`` flag.
+
+To capture on multiple interfaces at once, use multiple ``-I`` flags.
+
+Example
+-------
+
+.. code-block:: console
+
+   # ./<build_dir>/app/dpdk-dumpcap --list-interfaces
+   0. 000:00:03.0
+   1. 000:00:03.1
+
+   # ./<build_dir>/app/dpdk-dumpcap -I 0000:00:03.0 -c 6 -w /tmp/sample.pcapng
+   Packets captured: 6
+   Packets received/dropped on interface '0000:00:03.0' 6/0
+
+   # ./<build_dir>/app/dpdk-dumpcap -f 'tcp port 80'
+   Packets captured: 6
+   Packets received/dropped on interface '0000:00:03.0' 10/8
+
+
+Limitations
+-----------
+The following option of Wireshark ``dumpcap`` is not yet implemented:
+
+   * ``-b|--ring-buffer`` -- more complex file management.
+
+The following options do not make sense in the context of DPDK.
+
+   * ``-C <byte_limit>`` -- its a kernel thing
+
+   * ``-t`` -- use a thread per interface
+
+   * Timestamp type.
+
+   * Link data types. Only EN10MB (Ethernet) is supported.
+
+   * Wireless related options:  ``-I|--monitor-mode`` and  ``-k <freq>``
+
+
+.. Note::
+   * The options to ``dpdk-dumpcap`` are like the Wireshark dumpcap program and
+     are not the same as ``dpdk-pdump`` and other DPDK applications.
diff --git a/doc/guides/tools/index.rst b/doc/guides/tools/index.rst
index 93dde4148e90..b71c12b8f2dd 100644
--- a/doc/guides/tools/index.rst
+++ b/doc/guides/tools/index.rst
@@ -8,6 +8,7 @@ DPDK Tools User Guides
     :maxdepth: 2
     :numbered:
 
+    dumpcap
     proc_info
     pdump
     pmdinfo
-- 
2.30.2


^ permalink raw reply	[relevance 1%]

* Re: [dpdk-dev] [PATCH v2 1/6] security: add SA lifetime configuration
  2021-09-16 11:06  0%     ` Ananyev, Konstantin
@ 2021-09-17  4:48  0%       ` Anoob Joseph
  0 siblings, 0 replies; 200+ results
From: Anoob Joseph @ 2021-09-17  4:48 UTC (permalink / raw)
  To: Ananyev, Konstantin, Akhil Goyal, Doherty, Declan, Zhang, Roy Fan
  Cc: Jerin Jacob Kollanukkaran, Archana Muniganti, Tejasree Kondoj,
	Hemant Agrawal, Nicolau, Radu, Power, Ciara, Gagandeep Singh,
	dev

Hi Konstantin,

Please see inline.

Thanks,
Anoob

> -----Original Message-----
> From: Ananyev, Konstantin <konstantin.ananyev@intel.com>
> Sent: Thursday, September 16, 2021 4:36 PM
> To: Anoob Joseph <anoobj@marvell.com>; Akhil Goyal
> <gakhil@marvell.com>; Doherty, Declan <declan.doherty@intel.com>;
> Zhang, Roy Fan <roy.fan.zhang@intel.com>
> Cc: Jerin Jacob Kollanukkaran <jerinj@marvell.com>; Archana Muniganti
> <marchana@marvell.com>; Tejasree Kondoj <ktejasree@marvell.com>;
> Hemant Agrawal <hemant.agrawal@nxp.com>; Nicolau, Radu
> <radu.nicolau@intel.com>; Power, Ciara <ciara.power@intel.com>;
> Gagandeep Singh <g.singh@nxp.com>; dev@dpdk.org
> Subject: [EXT] RE: [PATCH v2 1/6] security: add SA lifetime configuration
> 
> External Email
> 
> ----------------------------------------------------------------------
> 
> > Add SA lifetime configuration to register soft and hard expiry limits.
> > Expiry can be in units of number of packets or bytes. Crypto op status
> > is also updated to include new field, aux_flags, which can be used to
> > indicate cases such as soft expiry in case of lookaside protocol
> > operations.
> >
> > In case of soft expiry, the packets are successfully IPsec processed
> > but the soft expiry would indicate that SA needs to be reconfigured.
> > For inline protocol capable ethdev, this would result in an eth event
> > while for lookaside protocol capable cryptodev, this can be
> > communicated via `rte_crypto_op.aux_flags` field.
> >
> > In case of hard expiry, the packets will not be IPsec processed and
> > would result in error.
> >
> > Signed-off-by: Anoob Joseph <anoobj@marvell.com>
> > ---
> >  .../test_cryptodev_security_ipsec_test_vectors.h   |  3 ---
> >  doc/guides/rel_notes/deprecation.rst               |  5 ----
> >  doc/guides/rel_notes/release_21_11.rst             | 13 ++++++++++
> >  examples/ipsec-secgw/ipsec.c                       |  2 +-
> >  examples/ipsec-secgw/ipsec.h                       |  2 +-
> >  lib/cryptodev/rte_crypto.h                         | 18 +++++++++++++-
> >  lib/security/rte_security.h                        | 28 ++++++++++++++++++++--
> >  7 files changed, 58 insertions(+), 13 deletions(-)
> >
> > diff --git a/app/test/test_cryptodev_security_ipsec_test_vectors.h
> > b/app/test/test_cryptodev_security_ipsec_test_vectors.h
> > index ae9cd24..38ea43d 100644
> > --- a/app/test/test_cryptodev_security_ipsec_test_vectors.h
> > +++ b/app/test/test_cryptodev_security_ipsec_test_vectors.h
> > @@ -98,7 +98,6 @@ struct ipsec_test_data pkt_aes_128_gcm = {
> >  		.proto = RTE_SECURITY_IPSEC_SA_PROTO_ESP,
> >  		.mode = RTE_SECURITY_IPSEC_SA_MODE_TUNNEL,
> >  		.tunnel.type = RTE_SECURITY_IPSEC_TUNNEL_IPV4,
> > -		.esn_soft_limit = 0,
> >  		.replay_win_sz = 0,
> >  	},
> >
> > @@ -195,7 +194,6 @@ struct ipsec_test_data pkt_aes_192_gcm = {
> >  		.proto = RTE_SECURITY_IPSEC_SA_PROTO_ESP,
> >  		.mode = RTE_SECURITY_IPSEC_SA_MODE_TUNNEL,
> >  		.tunnel.type = RTE_SECURITY_IPSEC_TUNNEL_IPV4,
> > -		.esn_soft_limit = 0,
> >  		.replay_win_sz = 0,
> >  	},
> >
> > @@ -295,7 +293,6 @@ struct ipsec_test_data pkt_aes_256_gcm = {
> >  		.proto = RTE_SECURITY_IPSEC_SA_PROTO_ESP,
> >  		.mode = RTE_SECURITY_IPSEC_SA_MODE_TUNNEL,
> >  		.tunnel.type = RTE_SECURITY_IPSEC_TUNNEL_IPV4,
> > -		.esn_soft_limit = 0,
> >  		.replay_win_sz = 0,
> >  	},
> >
> > diff --git a/doc/guides/rel_notes/deprecation.rst
> > b/doc/guides/rel_notes/deprecation.rst
> > index 76a4abf..6118f06 100644
> > --- a/doc/guides/rel_notes/deprecation.rst
> > +++ b/doc/guides/rel_notes/deprecation.rst
> > @@ -282,8 +282,3 @@ Deprecation Notices
> >  * security: The functions ``rte_security_set_pkt_metadata`` and
> >    ``rte_security_get_userdata`` will be made inline functions and additional
> >    flags will be added in structure ``rte_security_ctx`` in DPDK 21.11.
> > -
> > -* cryptodev: The structure ``rte_crypto_op`` would be updated to
> > reduce
> > -  reserved bytes to 2 (from 3), and use 1 byte to indicate warnings
> > and other
> > -  information from the crypto/security operation. This field will be
> > used to
> > -  communicate events such as soft expiry with IPsec in lookaside mode.
> > diff --git a/doc/guides/rel_notes/release_21_11.rst
> > b/doc/guides/rel_notes/release_21_11.rst
> > index 9b14c84..0e3ed28 100644
> > --- a/doc/guides/rel_notes/release_21_11.rst
> > +++ b/doc/guides/rel_notes/release_21_11.rst
> > @@ -102,6 +102,13 @@ API Changes
> >     Also, make sure to start the actual text at the margin.
> >     =======================================================
> >
> > +* cryptodev: use 1 reserved byte from ``rte_crypto_op`` for aux flags
> > +
> > +  * Updated the structure ``rte_crypto_op`` to reduce reserved bytes
> > + to
> > +  2 (from 3), and use 1 byte to indicate warnings and other
> > + information from  the crypto/security operation. This field will be
> > + used to communicate events  such as soft expiry with IPsec in lookaside
> mode.
> > +
> >
> >  ABI Changes
> >  -----------
> > @@ -123,6 +130,12 @@ ABI Changes
> >    * Added IPsec SA option to disable IV generation to allow known vector
> >      tests as well as usage of application provided IV on supported PMDs.
> >
> > +* security: add IPsec SA lifetime configuration
> > +
> > +  * Added IPsec SA lifetime configuration to allow applications to configure
> > +    soft and hard SA expiry limits. Limits can be either in units of packets or
> > +    bytes.
> > +
> >
> >  Known Issues
> >  ------------
> > diff --git a/examples/ipsec-secgw/ipsec.c
> > b/examples/ipsec-secgw/ipsec.c index 5b032fe..4868294 100644
> > --- a/examples/ipsec-secgw/ipsec.c
> > +++ b/examples/ipsec-secgw/ipsec.c
> > @@ -49,7 +49,7 @@ set_ipsec_conf(struct ipsec_sa *sa, struct
> rte_security_ipsec_xform *ipsec)
> >  		}
> >  		/* TODO support for Transport */
> >  	}
> > -	ipsec->esn_soft_limit = IPSEC_OFFLOAD_ESN_SOFTLIMIT;
> > +	ipsec->life.packets_soft_limit = IPSEC_OFFLOAD_PKTS_SOFTLIMIT;
> >  	ipsec->replay_win_sz = app_sa_prm.window_size;
> >  	ipsec->options.esn = app_sa_prm.enable_esn;
> >  	ipsec->options.udp_encap = sa->udp_encap; diff --git
> > a/examples/ipsec-secgw/ipsec.h b/examples/ipsec-secgw/ipsec.h index
> > ae5058d..90c81c1 100644
> > --- a/examples/ipsec-secgw/ipsec.h
> > +++ b/examples/ipsec-secgw/ipsec.h
> > @@ -23,7 +23,7 @@
> >
> >  #define MAX_DIGEST_SIZE 32 /* Bytes -- 256 bits */
> >
> > -#define IPSEC_OFFLOAD_ESN_SOFTLIMIT 0xffffff00
> > +#define IPSEC_OFFLOAD_PKTS_SOFTLIMIT 0xffffff00
> >
> >  #define IV_OFFSET		(sizeof(struct rte_crypto_op) + \
> >  				sizeof(struct rte_crypto_sym_op)) diff --git
> > a/lib/cryptodev/rte_crypto.h b/lib/cryptodev/rte_crypto.h index
> > fd5ef3a..d602183 100644
> > --- a/lib/cryptodev/rte_crypto.h
> > +++ b/lib/cryptodev/rte_crypto.h
> > @@ -66,6 +66,17 @@ enum rte_crypto_op_sess_type {  };
> >
> >  /**
> > + * Auxiliary flags to indicate additional info from the operation */
> > +
> > +/**
> > + * Auxiliary flags related to IPsec offload with RTE_SECURITY  */
> 
> Duplicate comments.

[Anoob] The proposal is to make auxiliary flags custom to operation. Like, flags related to IPsec offload may not be applicable for PDCP offload (and vice versa). But then, I agree these could be updated as we add new fields related to other kinds of operations. I'll drop the extra comments in the next version.
 
> 
> > +
> > +#define RTE_CRYPTO_OP_AUX_FLAGS_IPSEC_SOFT_EXPIRY (1 << 0) /**<
> SA
> > +soft expiry limit has been reached */
> > +
> > +/**
> >   * Cryptographic Operation.
> >   *
> >   * This structure contains data relating to performing cryptographic
> > @@ -93,7 +104,12 @@ struct rte_crypto_op {
> >  			 */
> >  			uint8_t sess_type;
> >  			/**< operation session type */
> > -			uint8_t reserved[3];
> > +			uint8_t aux_flags;
> > +			/**< Operation specific auxiliary/additional flags.
> > +			 * These flags carry additional information from the
> > +			 * operation. Processing of the same is optional.
> > +			 */
> > +			uint8_t reserved[2];
> >  			/**< Reserved bytes to fill 64 bits for
> >  			 * future additions
> >  			 */
> > diff --git a/lib/security/rte_security.h b/lib/security/rte_security.h
> > index b4b6776..95c169d 100644
> > --- a/lib/security/rte_security.h
> > +++ b/lib/security/rte_security.h
> > @@ -206,6 +206,30 @@ enum rte_security_ipsec_sa_direction {  };
> >
> >  /**
> > + * Configure soft and hard lifetime of an IPsec SA
> > + *
> > + * Lifetime of an IPsec SA would specify the maximum number of
> > +packets or bytes
> > + * that can be processed. IPsec operations would start failing once
> > +any hard
> > + * limit is reached.
> > + *
> > + * Soft limits can be specified to generate notification when the SA
> > +is
> > + * approaching hard limits for lifetime. For inline operations,
> > +reaching soft
> > + * expiry limit would result in raising an eth event for the same.
> > +For lookaside
> > + * operations, this would result in a warning returned in
> > + * ``rte_crypto_op.aux_flags``.
> > + */
> > +struct rte_security_ipsec_lifetime {
> > +	uint64_t packets_soft_limit;
> > +	/**< Soft expiry limit in number of packets */
> > +	uint64_t bytes_soft_limit;
> > +	/**< Soft expiry limit in bytes */
> > +	uint64_t packets_hard_limit;
> > +	/**< Soft expiry limit in number of packets */
> > +	uint64_t bytes_hard_limit;
> > +	/**< Soft expiry limit in bytes */
> > +};
> > +
> > +/**
> >   * IPsec security association configuration data.
> >   *
> >   * This structure contains data required to create an IPsec SA security
> session.
> > @@ -225,8 +249,8 @@ struct rte_security_ipsec_xform {
> >  	/**< IPsec SA Mode - transport/tunnel */
> >  	struct rte_security_ipsec_tunnel_param tunnel;
> >  	/**< Tunnel parameters, NULL for transport mode */
> > -	uint64_t esn_soft_limit;
> > -	/**< ESN for which the overflow event need to be raised */
> > +	struct rte_security_ipsec_lifetime life;
> > +	/**< IPsec SA lifetime */
> >  	uint32_t replay_win_sz;
> >  	/**< Anti replay window size to enable sequence replay attack
> handling.
> >  	 * replay checking is disabled if the window size is 0.
> > --
> 
> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
> 
> > 2.7.4


^ permalink raw reply	[relevance 0%]

* [dpdk-dev] DPDK Release Status Meeting 2021-09-16
@ 2021-09-17 15:32  3% Mcnamara, John
  0 siblings, 0 replies; 200+ results
From: Mcnamara, John @ 2021-09-17 15:32 UTC (permalink / raw)
  To: dev; +Cc: thomas, Yigit, Ferruh

Release status meeting minutes 2021-09-16
=========================================

Agenda:
* Release Dates
* Subtrees
* Roadmaps
* LTS
* Defects
* Opens

Participants:
* ARM
* Broadcom
* Canonical
* Debian
* Intel
* Marvell
* Nvidia
* Red Hat


Release Dates
-------------

* v21.11 dates
  * Proposal/V1:    Friday, 10 September (complete)
  * -rc1:           Friday, 15 October
  * Release:        Friday, 19 November


Subtrees
--------

* main
  * Oops/core dump handling
  * Windows: new API for thread management
  * Will review new version of DMA dev
  * New Slack channel: https://join.slack.com/t/dpdkproject/shared_invite/zt-v6c9ef5z-FqgOAS7BDAYqev_a~pbXdw

* next-net
  * Reviews and merging ongoing
  * Lot of Ethdev patches - concerning due to number and to conflicts
  * Will merge from sub-trees today

* next-net-brcm
  * Patches have been merged to subtree

* next-net-intel
  - Reviews and merging ongoing

* next-net-mlx
  - 24 patches on the list that need to reviewed merged

* next-net-mrvl
  - Some patches merged.
  - 50-60 other patches
  - Ready to merge

* next-crypto
  * Merged ~50 patches
  * Has been pulled by Thomas

* next-eventdev
  * Some patches from Intel under review with comments
  * Driver patches for cxnk
  * Changes on API hiding (for ABI stability)

* next-virtio
  * Reviewing patches and  submitted first PR
  * Maxime submitting virtio RSS feature
  * 30 Patches on list, many around Vhost async
  * Xilinx driver reviewed
  * Power management patches  under review
  * DMA Device RFC under review
    * Comments from Ilya on the OVS list that functionality may below in DPDK rather than OVS:  http://patchwork.ozlabs.org/comment/2751918/


LTS
---

* v19.11 (next version is v19.11.10)
  * 20.11.3 released on Monday Sept 6

  * 19.11.10 released on Monday Sept 6



* Distros
  * v20.11 in Debian 11

  * v20.11 in Ubuntu 21.04




Defects
-------

* Bugzilla links, 'Bugs',  added for hosted projects
  - https://www.dpdk.org/hosted-projects/


Opens
-----

* Release of OpenSSL 3.0 will cause some compilation issues in cryptodev: https://www.openssl.org/blog/blog/2021/09/07/OpenSSL3.Final/


DPDK Release Status Meetings
----------------------------

The DPDK Release Status Meeting is intended for DPDK Committers to discuss the status of the master tree and sub-trees, and for project managers to track progress or milestone dates.

The meeting occurs on every Thursdays at 8:30 UTC. on https://meet.jit.si/DPDK

If you wish to attend just send an email to "John McNamara john.mcnamara@intel.com<mailto:john.mcnamara@intel.com>" for the invite.

^ permalink raw reply	[relevance 3%]

Results 10401-10600 of ~18000   |  | reverse | sort options + mbox downloads above
-- links below jump to the message on this page --
2020-12-18 15:16     [dpdk-dev] [RFC 1/9] devargs: fix data buffer storage type Xueming Li
2021-04-13  3:14     ` [dpdk-dev] [PATCH v5 0/5] eal: enable global device syntax by default Xueming Li
2021-04-14 19:49       ` Thomas Monjalon
2021-09-02 14:46  0%     ` Thomas Monjalon
2021-01-10 18:44     [dpdk-dev] [PATCH] doc: add release milestones definition Asaf Penso
2021-08-26 10:11     ` [dpdk-dev] [PATCH v8] " Thomas Monjalon
2021-09-02 16:33  0%   ` Ferruh Yigit
2021-09-14  7:56  5% ` [dpdk-dev] [PATCH v9] " Thomas Monjalon
2021-02-24 21:20     [dpdk-dev] [RFC 0/5] Use correct memory ordering in eal functions Honnappa Nagarahalli
2021-09-09 23:13     ` [dpdk-dev] [PATCH v2 0/6] " Honnappa Nagarahalli
2021-09-09 23:13       ` [dpdk-dev] [PATCH v2 4/6] eal: update rte_eal_wait_lcore definition Honnappa Nagarahalli
2021-09-09 23:37  3%     ` Honnappa Nagarahalli
2021-06-01 11:14     [dpdk-dev] [RFC PATCH] ethdev: clarify flow action PORT ID semantics Ivan Malov
2021-09-03  7:46  3% ` [dpdk-dev] [PATCH v1] " Andrew Rybchenko
2021-06-18 16:36     [dpdk-dev] [PATCH] devtools: script to track map symbols Ray Kinsella
2021-08-31 14:50     ` [dpdk-dev] [PATCH v10 0/3] devtools: scripts to count and track symbols Ray Kinsella
2021-08-31 14:50  5%   ` [dpdk-dev] [PATCH v10 1/3] devtools: script to track symbols over releases Ray Kinsella
2021-08-31 14:50  5%   ` [dpdk-dev] [PATCH v10 2/3] devtools: script to send notifications of expired symbols Ray Kinsella
2021-09-01 12:46  0%     ` Aaron Conole
2021-09-03 11:15  0%       ` Kinsella, Ray
2021-09-03 13:32  0%       ` Kinsella, Ray
2021-09-01 13:01  5%     ` David Marchand
2021-09-03 13:28  0%       ` Kinsella, Ray
2021-08-31 14:50 17%   ` [dpdk-dev] [PATCH v10 3/3] maintainers: add new abi scripts Ray Kinsella
2021-09-01 12:31  0%   ` [dpdk-dev] [PATCH v10 0/3] devtools: scripts to count and track symbols Aaron Conole
2021-09-03 13:23  3% ` [dpdk-dev] [PATCH v11 " Ray Kinsella
2021-09-03 13:23  5%   ` [dpdk-dev] [PATCH v11 1/3] devtools: script to track symbols over releases Ray Kinsella
2021-09-03 13:23  5%   ` [dpdk-dev] [PATCH v11 2/3] devtools: script to send notifications of expired symbols Ray Kinsella
2021-09-03 13:23 17%   ` [dpdk-dev] [PATCH v11 3/3] maintainers: add new abi scripts Ray Kinsella
2021-09-08 15:12  3% ` [dpdk-dev] [PATCH v11 0/3] devtools: scripts to count and track symbols Ray Kinsella
2021-09-08 15:12  5%   ` [dpdk-dev] [PATCH v11 1/3] devtools: script to track symbols over releases Ray Kinsella
2021-09-08 15:12  5%   ` [dpdk-dev] [PATCH v11 2/3] devtools: script to send notifications of expired symbols Ray Kinsella
2021-09-08 15:12 17%   ` [dpdk-dev] [PATCH v11 3/3] maintainers: add new abi scripts Ray Kinsella
2021-09-08 15:13  3% ` [dpdk-dev] [PATCH v12 0/4] devtools: scripts to count and track symbols Ray Kinsella
2021-09-08 15:13  5%   ` [dpdk-dev] [PATCH v12 1/4] devtools: script to track symbols over releases Ray Kinsella
2021-09-08 15:13  5%   ` [dpdk-dev] [PATCH v12 2/4] devtools: script to send notifications of expired symbols Ray Kinsella
2021-09-08 15:13 17%   ` [dpdk-dev] [PATCH v12 3/4] maintainers: add new abi scripts Ray Kinsella
2021-09-09 13:48  3% ` [dpdk-dev] [PATCH v13 0/4] devtools: scripts to count and track symbols Ray Kinsella
2021-09-09 13:48  5%   ` [dpdk-dev] [PATCH v13 1/4] devtools: script to track symbols over releases Ray Kinsella
2021-09-09 13:48  5%   ` [dpdk-dev] [PATCH v13 2/4] devtools: script to send notifications of expired symbols Ray Kinsella
2021-09-09 13:48 19%   ` [dpdk-dev] [PATCH v13 3/4] maintainers: add new abi scripts Ray Kinsella
2021-06-24 10:28     [dpdk-dev] [PATCH 1/2] security: enforce semantics for Tx inline processing Akhil Goyal
2021-08-12 12:32     ` [dpdk-dev] [PATCH v4 0/4] security: Improve inline fast path routines Nithin Dabilpuram
2021-08-12 12:32       ` [dpdk-dev] [PATCH v4 4/4] doc: remove deprecation notice for security fast path change Nithin Dabilpuram
2021-09-06 18:57  3%     ` Akhil Goyal
2021-09-14 15:14     ` [dpdk-dev] [PATCH v5 0/3] security: Improve inline fast path routines Nithin Dabilpuram
2021-09-14 15:14  8%   ` [dpdk-dev] [PATCH v5 2/3] security: add option for faster udata or mdata access Nithin Dabilpuram
2021-09-15 14:33  0%     ` Ananyev, Konstantin
2021-09-15 16:29     ` [dpdk-dev] [PATCH v6 0/3] security: Improve inline fast path routines Nithin Dabilpuram
2021-09-15 16:30  8%   ` [dpdk-dev] [PATCH v6 2/3] security: add option for faster udata or mdata access Nithin Dabilpuram
2021-07-02 13:18     [dpdk-dev] [PATCH] dmadev: introduce DMA device library Chengwen Feng
2021-09-04 10:10  3% ` [dpdk-dev] [PATCH v20 0/7] support dmadev Chengwen Feng
2021-09-06 13:37  0%   ` Bruce Richardson
2021-09-07 12:56  3% ` [dpdk-dev] [PATCH v21 " Chengwen Feng
2021-09-16  3:41  3% ` [dpdk-dev] [PATCH v22 0/5] " Chengwen Feng
2021-07-05  8:04     [dpdk-dev] [RFC PATCH v4 0/3] Add PIE support for HQoS library Liguzinski, WojciechX
2021-09-07  7:33  3% ` [dpdk-dev] [RFC PATCH v5 0/5] " Liguzinski, WojciechX
2021-09-07  7:33       ` [dpdk-dev] [RFC PATCH v5 1/5] sched: add PIE based congestion management Liguzinski, WojciechX
2021-09-07 19:14  3%     ` Stephen Hemminger
2021-09-08  8:49  3%       ` Liguzinski, WojciechX
2021-09-07 14:11  3%   ` [dpdk-dev] [RFC PATCH v6 0/5] Add PIE support for HQoS library Liguzinski, WojciechX
2021-07-12 16:17     [dpdk-dev] [PATCH] ethdev: fix representor port ID search by name Andrew Rybchenko
2021-08-20 12:18     ` [dpdk-dev] [PATCH v3] " Andrew Rybchenko
2021-08-31 15:41  0%   ` Andrew Rybchenko
2021-08-31 16:06  3% ` [dpdk-dev] [PATCH v4] " Andrew Rybchenko
2021-08-31 16:32  0%   ` Wang, Haiyue
2021-08-31 16:37  0%     ` Andrew Rybchenko
2021-09-01  5:15  0%   ` Xing, Beilei
2021-09-01 14:55  0%   ` Ferruh Yigit
2021-09-13 11:26  4% ` [dpdk-dev] [PATCH v5] " Andrew Rybchenko
2021-07-27  3:42     [dpdk-dev] [RFC] ethdev: introduce shared Rx queue Xueming Li
2021-08-11 14:04     ` [dpdk-dev] [PATCH v2 01/15] " Xueming Li
2021-08-17  9:33       ` Jerin Jacob
2021-08-17 11:31         ` Xueming(Steven) Li
2021-08-17 15:11           ` Jerin Jacob
2021-08-18 11:14             ` Xueming(Steven) Li
2021-08-19  5:26               ` Jerin Jacob
2021-08-19 12:09                 ` Xueming(Steven) Li
2021-08-26 11:58                   ` Jerin Jacob
2021-08-28 14:16                     ` Xueming(Steven) Li
2021-08-30  9:31                       ` Jerin Jacob
2021-09-15 14:45  0%                     ` Xueming(Steven) Li
2021-09-16  4:16  0%                       ` Jerin Jacob
2021-07-31 18:13     [dpdk-dev] [PATCH 0/4] cryptodev and security ABI improvements Akhil Goyal
2021-07-31 18:13     ` [dpdk-dev] [PATCH 4/4] security: add reserved bitfields Akhil Goyal
2021-09-15 15:55  0%   ` Ananyev, Konstantin
2021-08-10 19:50     [dpdk-dev] [PATCH v2 0/4] cryptodev: expose driver interface as internal Akhil Goyal
2021-09-07 19:00     ` [dpdk-dev] [PATCH v3 " Akhil Goyal
2021-09-07 19:00  3%   ` [dpdk-dev] [PATCH v3 2/4] cryptodev: change valid dev API Akhil Goyal
2021-09-07 19:00  2%   ` [dpdk-dev] [PATCH v3 4/4] cryptodev: expose driver interface as internal Akhil Goyal
2021-09-07 19:22       ` [dpdk-dev] [PATCH v4 0/4] " Akhil Goyal
2021-09-07 19:22  3%     ` [dpdk-dev] [PATCH v4 2/4] cryptodev: change valid dev API Akhil Goyal
2021-09-08 15:16  0%       ` Akhil Goyal
2021-09-07 19:22  2%     ` [dpdk-dev] [PATCH v4 4/4] cryptodev: expose driver interface as internal Akhil Goyal
2021-08-16  5:59     [dpdk-dev] [PATCH 0/3] Add user specified IV with lookaside IPsec Anoob Joseph
2021-09-06 14:58     ` [dpdk-dev] [PATCH v2 " Anoob Joseph
2021-09-06 14:58  4%   ` [dpdk-dev] [PATCH v2 1/3] security: support user specified IV Anoob Joseph
2021-09-07 16:17  3%   ` [dpdk-dev] [PATCH v3 0/3] Add user specified IV with lookaside IPsec Anoob Joseph
2021-09-07 16:17  5%     ` [dpdk-dev] [PATCH v3 1/3] security: support user specified IV Anoob Joseph
2021-09-16 11:14  0%       ` Ananyev, Konstantin
2021-08-17 13:42     [dpdk-dev] [PATCH 0/5] Add SA lifetime in security Anoob Joseph
2021-09-07 16:32     ` [dpdk-dev] [PATCH v2 0/6] " Anoob Joseph
2021-09-07 16:32  8%   ` [dpdk-dev] [PATCH v2 1/6] security: add SA lifetime configuration Anoob Joseph
2021-09-16 11:06  0%     ` Ananyev, Konstantin
2021-09-17  4:48  0%       ` Anoob Joseph
2021-08-19 21:10     [dpdk-dev] [PATCH v2 0/6] bbdev update related to CRC usage Nicolas Chautru
2021-08-19 21:10     ` [dpdk-dev] [PATCH v2 1/6] bbdev: add capability for CRC16 check Nicolas Chautru
2021-09-01 13:36  3%   ` Tom Rix
2021-09-01 15:00  3%     ` Chautru, Nicolas
2021-09-11 19:11  0%       ` Tom Rix
2021-08-20 16:28     [dpdk-dev] [RFC 0/7] hide eth dev related structures Konstantin Ananyev
2021-08-26 12:37     ` Jerin Jacob
2021-09-06 18:09  0%   ` Ferruh Yigit
2021-09-14 13:33  3%   ` Ananyev, Konstantin
2021-09-15  9:45  0%     ` Jerin Jacob
2021-08-23 10:02     [dpdk-dev] [PATCH] RFC: ethdev: add reassembly offload Akhil Goyal
2021-09-07  8:47  4% ` Ferruh Yigit
2021-09-08 10:29  0%   ` [dpdk-dev] [EXT] " Anoob Joseph
2021-09-13  6:56  0%     ` Xu, Rosen
2021-09-13  7:22  0%       ` Andrew Rybchenko
2021-09-14  5:14  0%         ` Anoob Joseph
2021-08-23 19:40     [dpdk-dev] [RFC 01/15] eventdev: make driver interface as internal pbhagavatula
2021-08-23 19:40     ` [dpdk-dev] [RFC 04/15] eventdev: move inline APIs into separate structure pbhagavatula
2021-09-08 12:03  0%   ` Kinsella, Ray
2021-08-23 19:40     ` [dpdk-dev] [RFC 11/15] eventdev: reserve fields in timer object pbhagavatula
2021-08-24 15:10       ` Stephen Hemminger
2021-09-01  6:48  0%     ` [dpdk-dev] [EXT] " Pavan Nikhilesh Bhagavatula
2021-09-07 21:02  0%       ` Carrillo, Erik G
2021-08-26 10:35     [dpdk-dev] [PATCH] doc: announce library refactor for ABI improvement Ferruh Yigit
2021-08-26 10:46     ` [dpdk-dev] [EXT] " Akhil Goyal
2021-08-26 11:04       ` Bruce Richardson
2021-08-26 15:44         ` Andrew Rybchenko
2021-08-31 15:48  4%       ` Kinsella, Ray
2021-08-26 14:57     [dpdk-dev] [RFC 0/7] make rte_intr_handle internal Harman Kalra
2021-09-03 12:40  4% ` [dpdk-dev] [PATCH v1 " Harman Kalra
2021-09-03 12:40  1%   ` [dpdk-dev] [PATCH v1 3/7] eal/interrupts: avoid direct access to interrupt handle Harman Kalra
2021-09-15 14:13  0%   ` [dpdk-dev] [PATCH v1 0/7] make rte_intr_handle internal Harman Kalra
2021-08-29 12:51     [dpdk-dev] [PATCH 0/8] cryptodev: hide internal strutures Akhil Goyal
2021-08-29 12:51     ` [dpdk-dev] [PATCH 2/8] cryptodev: move inline APIs into separate structure Akhil Goyal
2021-09-13 14:11  0%   ` Zhang, Roy Fan
2021-09-16 15:21  0%   ` Ananyev, Konstantin
2021-08-30 19:59     [dpdk-dev] [PATCH v2] eventdev: update crypto adapter metadata structures Shijith Thotton
2021-08-31  7:56     ` [dpdk-dev] [PATCH v3] " Shijith Thotton
2021-09-07  8:34  0%   ` Jerin Jacob
2021-09-07  8:53  0%   ` Gujjar, Abhinandan S
2021-09-07 10:37  0%     ` Shijith Thotton
2021-09-07 17:30  0%       ` Gujjar, Abhinandan S
2021-09-08  7:42  0%         ` Shijith Thotton
2021-09-08  7:53  0%           ` Gujjar, Abhinandan S
2021-09-14  4:36  0%             ` Shijith Thotton
2021-09-14  4:46  0%               ` Anoob Joseph
2021-08-31 13:10     [dpdk-dev] [PATCH] doc: announce change in vfio dma mapping Xuan Ding
2021-08-31 16:01  3% ` Ferruh Yigit
2021-09-01  1:41  0%   ` Ding, Xuan
2021-09-01  9:56  3%     ` Ferruh Yigit
2021-09-01 11:01  0%       ` Burakov, Anatoly
2021-09-01 11:42  4%         ` Ferruh Yigit
2021-09-01 13:25  4%           ` Burakov, Anatoly
2021-09-02  9:50  3%             ` Ferruh Yigit
2021-09-02 16:13  0%               ` Kinsella, Ray
2021-09-06  8:51  0%                 ` Ding, Xuan
2021-09-06 13:43  0%                   ` Ferruh Yigit
2021-09-07 15:21  0%                     ` Burakov, Anatoly
2021-09-07 16:08  0%                       ` Ferruh Yigit
2021-08-31 16:25     [dpdk-dev] [PATCH v1] bbdev: remove experimental tag from API Nicolas Chautru
2021-08-31 16:25  3% ` Nicolas Chautru
2021-08-31 16:38     ` David Marchand
2021-09-01  3:52       ` Hemant Agrawal
2021-09-01 11:14         ` Kinsella, Ray
2021-09-01 14:54  3%       ` Chautru, Nicolas
2021-09-13 19:44  0%         ` Maxime Coquelin
2021-09-14  3:13  0%           ` Hemant Agrawal
2021-09-01  5:07  3% [dpdk-dev] [PATCH v1 0/3] Promote some API to stable Haiyue Wang
2021-09-01  5:07  3% ` [dpdk-dev] [PATCH v1 1/3] net/ixgbe: promote " Haiyue Wang
2021-09-01  9:02  0%   ` Ferruh Yigit
2021-09-01 11:13  3%     ` Wang, Haiyue
2021-09-01 13:55  0%       ` Kinsella, Ray
2021-09-01  5:07  3% ` [dpdk-dev] [PATCH v1 2/3] net/ice: " Haiyue Wang
2021-09-01  5:07  3% ` [dpdk-dev] [PATCH v1 3/3] ethdev: promote burst mode " Haiyue Wang
2021-09-01  9:07  0%   ` Ferruh Yigit
2021-09-01 13:49  0%     ` Kinsella, Ray
2021-09-06  5:56  3% ` [dpdk-dev] [PATCH v2] " Haiyue Wang
2021-09-06  6:36  0%   ` Andrew Rybchenko
2021-09-15  8:46  0%     ` Ferruh Yigit
2021-09-02 17:59     [dpdk-dev] [PATCH v2 0/5] drivers/net: add NXP ENETFEC driver Apeksha Gupta
2021-09-02 17:59     ` [dpdk-dev] [PATCH v2 1/5] net/enetfec: introduce " Apeksha Gupta
2021-09-03  7:14  3%   ` David Marchand
2021-09-10  3:47  0%     ` [dpdk-dev] [EXT] " Apeksha Gupta
2021-09-03  0:47     [dpdk-dev] [PATCH 0/5] Packet capture framework enhancements Stephen Hemminger
2021-09-03  0:47  1% ` [dpdk-dev] [PATCH 2/5] pdump: support pcapng and filtering Stephen Hemminger
2021-09-03  0:47  2% ` [dpdk-dev] [PATCH 4/5] doc: changes for new pcapng and dumpcap Stephen Hemminger
2021-09-03 22:06     ` [dpdk-dev] [PATCH v2 0/5] Packet capture framework enhancements Stephen Hemminger
2021-09-03 22:06  1%   ` [dpdk-dev] [PATCH v2 2/5] pdump: support pcapng and filtering Stephen Hemminger
2021-09-03 22:06  1%   ` [dpdk-dev] [PATCH v2 4/5] doc: changes for new pcapng and dumpcap Stephen Hemminger
2021-09-08  4:50     ` [dpdk-dev] [PATCH v3 0/8] Packet capture framework enhancements Stephen Hemminger
2021-09-08  4:50  1%   ` [dpdk-dev] [PATCH v3 5/8] pdump: support pcapng and filtering Stephen Hemminger
2021-09-08  4:50  1%   ` [dpdk-dev] [PATCH v3 7/8] doc: changes for new pcapng and dumpcap Stephen Hemminger
2021-09-08 17:16     ` [dpdk-dev] [PATCH v4 0/8] Packet capture framework enhancements Stephen Hemminger
2021-09-08 17:16  1%   ` [dpdk-dev] [PATCH v4 5/8] pdump: support pcapng and filtering Stephen Hemminger
2021-09-08 17:16  1%   ` [dpdk-dev] [PATCH v4 7/8] doc: changes for new pcapng and dumpcap Stephen Hemminger
2021-09-08 21:50     ` [dpdk-dev] [PATCH v5 0/9] Packet capture framework enhancements Stephen Hemminger
2021-09-08 21:50  1%   ` [dpdk-dev] [PATCH v5 6/9] pdump: support pcapng and filtering Stephen Hemminger
2021-09-08 21:50  1%   ` [dpdk-dev] [PATCH v5 8/9] doc: changes for new pcapng and dumpcap Stephen Hemminger
2021-09-09 23:33     ` [dpdk-dev] [PATCH v6 00/10] Packet capture framework enhancements Stephen Hemminger
2021-09-09 23:33  1%   ` [dpdk-dev] [PATCH v6 07/10] pdump: support pcapng and filtering Stephen Hemminger
2021-09-09 23:33  1%   ` [dpdk-dev] [PATCH v6 09/10] doc: changes for new pcapng and dumpcap Stephen Hemminger
2021-09-10 18:18     ` [dpdk-dev] [PATCH v7 00/11] Packet capture framework enhancements Stephen Hemminger
2021-09-10 18:18  1%   ` [dpdk-dev] [PATCH v7 06/11] pdump: support pcapng and filtering Stephen Hemminger
2021-09-10 18:18  1%   ` [dpdk-dev] [PATCH v7 10/11] doc: changes for new pcapng and dumpcap Stephen Hemminger
2021-09-13 18:14     ` [dpdk-dev] [PATCH v8 00/12] Packet capture framework enhancements Stephen Hemminger
2021-09-13 18:15  1%   ` [dpdk-dev] [PATCH v8 06/12] pdump: support pcapng and filtering Stephen Hemminger
2021-09-13 18:15  1%   ` [dpdk-dev] [PATCH v8 11/12] doc: changes for new pcapng and dumpcap Stephen Hemminger
2021-09-16  0:14     ` [dpdk-dev] [PATCH v9 00/12] Packet capture framework enhancements Stephen Hemminger
2021-09-16  0:14  1%   ` [dpdk-dev] [PATCH v9 06/12] pdump: support pcapng and filtering Stephen Hemminger
2021-09-16  0:14  1%   ` [dpdk-dev] [PATCH v9 11/12] doc: changes for new pcapng and dumpcap Stephen Hemminger
2021-09-16 22:26     ` [dpdk-dev] [PATCH v10 00/12] Packet capture framework enhancements Stephen Hemminger
2021-09-16 22:26  1%   ` [dpdk-dev] [PATCH v10 06/12] pdump: support pcapng and filtering Stephen Hemminger
2021-09-16 22:26  1%   ` [dpdk-dev] [PATCH v10 11/12] doc: changes for new pcapng and dumpcap Stephen Hemminger
2021-09-03 16:31  3% [dpdk-dev] DPDK Release Status Meeting 2021-09-02 Mcnamara, John
2021-09-06 16:01     [dpdk-dev] [PATCH] fib: promote experimental API's to stable Vladimir Medvedkin
2021-09-07  0:34     ` Stephen Hemminger
2021-09-08 13:57  3%   ` Medvedkin, Vladimir
2021-09-08 15:10  0%     ` Stephen Hemminger
2021-09-06 16:55     [dpdk-dev] [RFC PATCH v2] raw/ptdma: introduce ptdma driver Selwin Sebastian
2021-09-06 17:17  3% ` David Marchand
2021-09-06 20:48     [dpdk-dev] [PATCH 0/4] support async dequeue for split ring Wenwu Ma
2021-09-06 20:48     ` [dpdk-dev] [PATCH 1/4] vhost: " Wenwu Ma
2021-09-15  2:51       ` Xia, Chenbo
     [not found]         ` <CO1PR11MB4897F3D5ABDE7133DB99791385DB9@CO1PR11MB4897.namprd11.prod.outlook.com>
2021-09-15 11:35  3%       ` Xia, Chenbo
2021-09-07 13:37     [dpdk-dev] [PATCH] crypto/dpaa_sec: update release notes Hemant Agrawal
2021-09-07 19:15  3% ` [dpdk-dev] [EXT] " Akhil Goyal
2021-09-08  7:02  0%   ` Hemant Agrawal
2021-09-08  1:15     [dpdk-dev] [PATCH v3 0/6] bbdev update related to CRC usage Nicolas Chautru
2021-09-08  1:15  4% ` [dpdk-dev] [PATCH v3 1/6] bbdev: add capability for CRC16 check Nicolas Chautru
2021-09-12 12:35  0%   ` Tom Rix
2021-09-08  8:21     [dpdk-dev] [PATCH 0/3] add option to configure tunnel header verification Tejasree Kondoj
2021-09-08  8:21  5% ` [dpdk-dev] [PATCH 1/3] security: " Tejasree Kondoj
2021-09-08  7:46  0%   ` Hemant Agrawal
2021-09-08 10:42  3%   ` Akhil Goyal
2021-09-08  8:25     [dpdk-dev] [PATCH 0/3] add option to configure UDP ports verification Tejasree Kondoj
2021-09-08  8:25  5% ` [dpdk-dev] [PATCH 1/3] security: " Tejasree Kondoj
2021-09-08  7:42  0%   ` Hemant Agrawal
2021-09-08 10:59  3% [dpdk-dev] [PATCH] net: promote make rarp packet API as stable Xiao Wang
2021-09-08  4:52  0% ` Stephen Hemminger
2021-09-08  5:07  0% ` Xia, Chenbo
2021-09-16 11:38  0% ` Olivier Matz
2021-09-09 12:54  3% [dpdk-dev] [PATCH 0/2] eventdev: add port usage hints Harry van Haaren
2021-09-09 13:45     [dpdk-dev] build: Increase the default value of RTE_MAX_LCORE David Hunt
2021-09-09 13:45     ` [dpdk-dev] [PATCH v1 1/6] build: increase default of max lcores to 512 David Hunt
2021-09-09 14:37       ` Bruce Richardson
2021-09-10  6:51         ` David Marchand
2021-09-10  7:54           ` Bruce Richardson
2021-09-10  8:06  3%         ` David Marchand
2021-09-10  8:24  0%           ` Thomas Monjalon
2021-09-14  9:34  0%             ` David Hunt
2021-09-14 10:00  0%               ` David Marchand
2021-09-14 11:07  0%                 ` David Hunt
2021-09-09 17:56     [dpdk-dev] [PATCH 00/18] comment spelling errors Stephen Hemminger
2021-09-09 17:56  4% ` [dpdk-dev] [PATCH 08/18] eal: fix typos in comments Stephen Hemminger
2021-09-09 18:10     ` [dpdk-dev] [PATCH v2 00/18] Fix spelling errors Stephen Hemminger
2021-09-09 18:10  4%   ` [dpdk-dev] [PATCH v2 08/18] eal: fix typos in comments Stephen Hemminger
2021-09-13 16:10     ` [dpdk-dev] [PATCH v2 00/18] fix spelling errors Stephen Hemminger
2021-09-13 16:10  4%   ` [dpdk-dev] [PATCH v2 08/18] eal: fix typos in comments Stephen Hemminger
2021-09-10  2:23     [dpdk-dev] [PATCH 0/8] Removal of PCI bus ABIs Chenbo Xia
2021-09-10  2:24  3% ` [dpdk-dev] [PATCH 7/8] kni: replace unused variable definition with reserved bytes Chenbo Xia
2021-09-10  2:24  2% ` [dpdk-dev] [PATCH 8/8] bus/pci: remove ABIs in PCI bus Chenbo Xia
2021-09-13 12:06  0%   ` Kinsella, Ray
2021-09-14  8:15  0%   ` Xu, Rosen
2021-09-10 12:30  3% [dpdk-dev] [PATCH v1 1/7] eal: promote IPC API's to stable Anatoly Burakov
2021-09-10 12:30  2% ` [dpdk-dev] [PATCH v1 2/7] fbarray: promote " Anatoly Burakov
2021-09-10 15:52  0%   ` Kinsella, Ray
2021-09-10 12:30  3% ` [dpdk-dev] [PATCH v1 3/7] eal: promote malloc " Anatoly Burakov
2021-09-10 15:53  0%   ` Kinsella, Ray
2021-09-10 12:30  3% ` [dpdk-dev] [PATCH v1 4/7] mem: promote memseg " Anatoly Burakov
2021-09-10 15:55  0%   ` Kinsella, Ray
2021-09-10 12:30  3% ` [dpdk-dev] [PATCH v1 5/7] mem: promote extmem " Anatoly Burakov
2021-09-10 15:56  0%   ` Kinsella, Ray
2021-09-10 12:30  3% ` [dpdk-dev] [PATCH v1 6/7] mem: promote DMA mask " Anatoly Burakov
2021-09-10 15:56  0%   ` Kinsella, Ray
2021-09-10 12:30  3% ` [dpdk-dev] [PATCH v1 7/7] eal: promote mcfg " Anatoly Burakov
2021-09-10 16:23  0%   ` Kinsella, Ray
2021-09-10 15:51  0% ` [dpdk-dev] [PATCH v1 1/7] eal: promote IPC " Kinsella, Ray
2021-09-10 13:36     [dpdk-dev] [PATCH V2 01/24] pipeline: move data structures to internal header file Cristian Dumitrescu
2021-09-13 16:44     ` [dpdk-dev] [PATCH V3 " Cristian Dumitrescu
2021-09-13 16:51  3%   ` Stephen Hemminger
2021-09-13 18:42  0%     ` Dumitrescu, Cristian
2021-09-13 19:02  0%       ` Stephen Hemminger
2021-09-10 14:16  9% [dpdk-dev] [RFC 1/3] ethdev: update modify field flow action Viacheslav Ovsiienko
     [not found]     <DU2PR04MB8630C0339D3CFB3CDE952B1389D69@DU2PR04MB8630.eurprd04.prod.outlook.com>
2021-09-10 14:25  4% ` [dpdk-dev] Minutes of Technical Board Meeting, 2021-08-25 Hemant Agrawal
2021-09-10 16:53     [dpdk-dev] [PATCH] efd: change data type of parameter Pablo de Lara
2021-09-14  7:10     ` David Marchand
2021-09-14 10:49  3%   ` Kinsella, Ray
2021-09-10 23:16     [dpdk-dev] [PATCH] cmdline: make cmdline structure opaque Dmitry Kozlyuk
2021-09-10 23:16  8% ` [dpdk-dev] [PATCH] cmdline: reduce ABI Dmitry Kozlyuk
2021-09-13  8:44 13% [dpdk-dev] [PATCH] eal: promote rte_mcfg_get_single_file_segment to stable ABI Jakub Grajciar -X (jgrajcia - PANTHEON TECH SRO at Cisco)
2021-09-15 16:25 19% [dpdk-dev] [PATCH] doc: remove template comments in old release notes Thomas Monjalon
2021-09-15 21:40     [dpdk-dev] [PATCH 0/5] lib: Windows compatibility renaming Dmitry Kozlyuk
2021-09-15 21:40  4% ` [dpdk-dev] [PATCH 1/5] compressdev: rename fields for Windows compatibility Dmitry Kozlyuk
2021-09-15 21:40  1% ` [dpdk-dev] [PATCH 2/5] cryptodev: " Dmitry Kozlyuk
2021-09-15 21:40  1% ` [dpdk-dev] [PATCH 5/5] net: rename Ethernet header fields Dmitry Kozlyuk
2021-09-17 15:32  3% [dpdk-dev] DPDK Release Status Meeting 2021-09-16 Mcnamara, John

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).